From 3e473e90358abbf82e7a60b6ed58ca2df02d4ce4 Mon Sep 17 00:00:00 2001
From: liuying <1427574514@qq.com>
Date: 周二, 10 12月 2024 13:33:09 +0800
Subject: [PATCH] pda页面
---
LA24030_LuLiPackageLine_Pda/pages/untie/untie.vue | 476 ++++-------------------------------------------------------
1 files changed, 34 insertions(+), 442 deletions(-)
diff --git a/LA24030_LuLiPackageLine_Pda/pages/untie/untie.vue b/LA24030_LuLiPackageLine_Pda/pages/untie/untie.vue
index d002003..a9e7d82 100644
--- a/LA24030_LuLiPackageLine_Pda/pages/untie/untie.vue
+++ b/LA24030_LuLiPackageLine_Pda/pages/untie/untie.vue
@@ -23,6 +23,7 @@
>
<u-input
v-model.trim="warehouse.packageCode"
+ @focus="warehouse.packageCode = ''"
@confirm="getContainerData(1)"
placeholder="璇峰綍鍏ユ垨鎵爜"
class="width"
@@ -37,7 +38,7 @@
style="background-color: #fff"
>
<u-col span="12">
- <u-form-item label="鏉夸欢鍙�:" class="uFormItem">
+ <u-form-item label="閮ㄤ欢鏉$爜:" class="uFormItem">
<u-input
v-model="warehouse.upi"
ref="materialRef"
@@ -75,7 +76,7 @@
<!-- 閮ㄤ欢鍚嶇О upi銆佹潗鏂欍�佸昂瀵革紝浣嶇疆銆佹澘浠剁姸鎬� -->
<u-row>
<u-col span="12" class="flex align-center">
- <u-checkbox v-model="item.checked" size="50rpx"></u-checkbox>
+ <!-- <u-checkbox v-model="item.checked" size="50rpx"></u-checkbox> -->
<view
class="flex justify-center align-center"
style="
@@ -116,7 +117,7 @@
<u-row>
<u-col span="8">
<text class="color_80 padding_left25rpx">
- 鏉夸欢鐘舵�侊細{{ item.upiStatus }}
+ 鏉夸欢鐘舵�侊細{{ getEnumName(item.upiStatus) }}
</text>
</u-col>
<u-col span="4">
@@ -129,54 +130,12 @@
</u-swipe-action>
</view>
<modal-code :rescode="rescode" :resmessage="resmessage" ref="resmodal" />
- <u-popup
- v-model="detailshow"
- border-radius="14"
- @close="detailshow = false"
- mode="bottom"
- >
- <!-- <view class="pop "> -->
- <h2 class="text_align_center padding_bottom18 padding15">鐗╂枡淇℃伅</h2>
- <view class="line flex justify-between">
- <text class="text-gray">鐗╂枡缂栧彿</text>
- <text>{{ this.materlist.materialCode }}</text>
- </view>
- <view class="line flex justify-between">
- <text class="text-gray">鐗╂枡鍚嶇О</text>
- <text>{{ this.materlist.materialName }}</text>
- </view>
- <view class="line flex justify-between">
- <text class="text-gray">鐗╂枡灏忕被</text>
- <text>{{ this.materlist.materialTypeName }}</text>
- </view>
- <view class="line flex justify-between">
- <text class="text-gray">鎵规</text>
- <text>{{ this.materlist.batchNo }}</text>
- </view>
- <view class="line flex justify-between">
- <text class="text-gray">鐗╂枡瑙勬牸</text>
- <text>{{ this.materlist.specificationModel }}</text>
- </view>
- <view class="line flex justify-between">
- <text class="text-gray">鏁伴噺</text>
- <text>{{ this.materlist.unBindQuantity }}</text>
- </view>
- <!-- </view> -->
- <view class="margin_top140rpx">
- <button-modal
- :subShow="true"
- garmenTitle="鎵撳嵃"
- @submit="init"
- @reset="rest"
- />
- </view>
- </u-popup>
+
<button-modal
- :empTytowerShow="true"
- cleaningTitle="閲嶇疆"
- garmenTitle="鐗╂枡瑙g粦"
- @submit="submit"
- @reset="back"
+ :subShow="true"
+ garmenTitle="閲嶇疆"
+ @submit="rest"
+ @reset="rest"
/>
</view>
</template>
@@ -228,24 +187,32 @@
gridFocus: false,
gridable: true,
kwbhAllowed: false,
+ enumList: [],
};
},
components: {
ButtonModal,
ModalCode,
},
+ created() {
+ getenumDataList({
+ EnumName: "UpiStatusEnum",
+ }).then((res) => {
+ this.enumList = res.result || [];
+ });
+ },
onLoad() {
this.operator = JSON.parse(uni.getStorageSync("userInfo")).name;
},
mounted() {
- getenumDataList({
- EnumName: "UpiStatusEnum",
- }).then((res) => {
- this.singlist = res.data.result || [];
- });
+
},
methods: {
+ getEnumName(value) {
+ const name = this.enumList.find((item) => item.value === value);
+ return name? name.name : "";
+ },
// 濡傛灉鎵撳紑涓�涓殑鏃跺�欙紝涓嶉渶瑕佸叧闂叾浠栵紝鍒欐棤闇�瀹炵幇鏈柟娉�
open(index) {
// 鍏堝皢姝e湪琚搷浣滅殑swipeAction鏍囪涓烘墦寮�鐘舵�侊紝鍚﹀垯鐢变簬props鐨勭壒鎬ч檺鍒讹紝
@@ -263,323 +230,12 @@
this.materlist = this.singlist[index];
this.detailshow = true;
},
- //鏍囩閲嶆柊鎵撳嵃
- init() {
- const arr = ["materialCode", "unBindQuantity"];
- const arrzw = ["鐗╂枡缂栧彿", "鏈瑙g粦鏁伴噺"];
- let isAllow = "";
- Object.keys(this.materlist).forEach((item) => {
- if (arr.includes(item)) {
- if (!this.materlist[item]) {
- isAllow = arr.indexOf(item);
- // this.rescode = 400
- // this.resmessage = `${arrzw[isAllow]}涓虹┖锛屼笉鑳界户缁墦鍗癭
- // this.resmessage = `${item}涓虹┖锛屼笉鑳界户缁墦鍗癭
- // this.$refs.resmodal.show = true
- return;
- }
- }
- });
- if (isAllow != "") {
- this.detailshow = false;
- this.rescode = 400;
- this.resmessage = `${arrzw[isAllow]}涓虹┖锛屼笉鑳界户缁墦鍗癭;
- this.$refs.resmodal.show = true;
- return;
- }
- if (
- this.materlist.unBindQuantity <= 0 ||
- this.materlist.unBindQuantity > this.materlist.quantity
- ) {
- this.detailshow = false;
- this.rescode = 400;
- this.resmessage = `鏁伴噺涓嶇鍚堣鑼冿紝涓嶈兘缁х画鎵撳嵃`;
- this.$refs.resmodal.show = true;
- return;
- }
- if (!this.materlist.specificationModel) {
- this.materlist.specificationModel = "";
- }
- let ptintContext = [
- {
- type: "text",
- x: 0,
- y: 0,
- text: "",
- size: 2,
- rotate: 0,
- bold: 0,
- underline: false,
- reverse: false,
- },
- {
- type: "text",
- x: 0,
- y: 0,
- text: "",
- size: 2,
- rotate: 0,
- bold: 0,
- underline: false,
- reverse: false,
- },
- {
- type: "text",
- x: 0,
- y: 0,
- text: "",
- size: 2,
- rotate: 0,
- bold: 0,
- underline: false,
- reverse: false,
- },
- /* 浠ヤ笂绌烘暟鎹紝涓洪槻姝涪鍖呮椂鎵撳嵃涓嶆甯� */
- { type: "line", x1: 3, y1: 3, x2: 565, y2: 3, width: 2 },
- { type: "line", x1: 3, y1: 3, x2: 3, y2: 345, width: 2 },
- { type: "line", x1: 3, y1: 345, x2: 565, y2: 345, width: 2 },
- { type: "line", x1: 565, y1: 345, x2: 565, y2: 3, width: 2 },
- {
- type: "text",
- x: 80,
- y: 15,
- text: "鐗ч噹姹借溅瑁呭(姝︽眽)鏈夐檺鍏徃",
- size: 3,
- rotate: 0,
- bold: 1,
- underline: false,
- reverse: false,
- },
- { type: "line", x1: 3, y1: 60, x2: 565, y2: 60, width: 2 },
- {
- type: "text",
- x: 10,
- y: 75,
- text: `鐗╂枡缂栧彿: ${this.materlist.materialCode}`,
- size: 2,
- rotate: 0,
- bold: 1,
- underline: false,
- reverse: false,
- },
- { type: "line", x1: 3, y1: 110, x2: 380, y2: 110, width: 2 },
- {
- type: "text",
- x: 10,
- y: 125,
- text: `鐗╂枡鍚嶇О: ${this.materlist.materialTypeName || ""}`,
- size: 2,
- rotate: 0,
- bold: 1,
- underline: false,
- reverse: false,
- },
- { type: "line", x1: 3, y1: 160, x2: 380, y2: 160, width: 2 },
- {
- type: "text",
- x: 10,
- y: 175,
- text: `鎵规: ${this.materlist.batchNo}`,
- size: 2,
- rotate: 0,
- bold: 1,
- underline: false,
- reverse: false,
- },
- { type: "line", x1: 3, y1: 210, x2: 565, y2: 210, width: 2 },
- { type: "line", x1: 380, y1: 60, x2: 380, y2: 210, width: 2 },
- {
- type: "qr",
- x: 410,
- y: 72,
- text: `PARTS NUMBER: ${this.materlist.materialCode},SAP: ${
- this.materlist.sap_Location || ""
- },BOXNUM: ${this.materlist.boxNo || ""},LOT NO: ${
- this.materlist.batchNo
- },QUANTITY: ${this.materlist.unBindQuantity}`,
- width: 3,
- level: 1,
- },
- {
- type: "text",
- x: 10,
- y: 225,
- text: `瑙勬牸鍨嬪彿: ${
- this.materlist.specificationModel.length > 32
- ? this.materlist.specificationModel.substr(0, 32)
- : this.materlist.specificationModel
- }`,
- size: 2,
- rotate: 0,
- bold: 1,
- underline: false,
- reverse: false,
- },
- { type: "line", x1: 3, y1: 260, x2: 565, y2: 260, width: 2 },
- {
- type: "text",
- x: 120,
- y: 290,
- text: "MAKINO J(CHINA) CO.LTD",
- size: 3,
- rotate: 0,
- bold: 1,
- underline: false,
- reverse: false,
- },
- ];
- console.log(ptintContext);
- BluePrint.print(this.$store, ptintContext)
- .then(() => {
- // 鍏抽棴寮规 骞舵仮澶嶆粦鍔ㄥ潡
- this.detailshow = false;
- this.addForm.code = this.materlist.materlist;
- this.addForm.name = this.materlist.materialName;
- this.addForm.batchNo = this.materlist.batchNo;
- this.addForm.specificationModel = this.materlist.specificationModel;
- addPrintRecord(this.addForm).then((res) => {
- console.log(res);
- });
- uni.showToast({
- title: "鎵撳嵃鎴愬姛",
- duration: 2000,
- });
- })
- .catch((err) => {
- // uni.showToast({
- // title:'鎵撳嵃澶辫触',
- // duration: 2000
- // })
- });
+
+ rest() {
+ this.warehouse.upi = "";
+ this.warehouse.packageCode = "";
+ this.singlist = [];
},
- materialBlur() {
- clearTimeout(this.timerSm);
- this.timerSm = null;
- if (this.warehouse.materialCode == "") {
- return;
- }
-
- this.timer = setTimeout(() => {
- //澶氭瑙﹀彂bug 寤惰繜bug
- //鍒ゆ柇褰撳墠鐗╂枡鏄惁鍦ㄧ洏鐐瑰垪琛ㄤ腑
- const index = this.singlist.findIndex(
- (item) =>
- item.materialCode == this.warehouse.materialCode &&
- item.batchNo == lotNo
- );
- if (index > -1) {
- this.singlist[index].checked = 1;
- this.singlist.unshift(...this.singlist.splice(index, 1));
- return;
- } else {
- clearTimeout(this.timer);
- this.timer = null;
- this.containerBlur();
- }
- }, 100);
- },
- containerBlur() {
- if (
- this.warehouse.packageCode == "" ||
- this.warehouse.materialCode == ""
- ) {
- return;
- }
- getContainerMaterial(this.warehouse).then((res) => {
- if (res.data == null || res.data.length == 0) {
- this.rescode = 400;
- this.resmessage = "鏆傛棤鏁版嵁";
- this.$refs.resmodal.show = true;
- return;
- }
- this.warehouse.dutyCycle = res.data[0].dutyCycle || 0;
- //缁欐墍鏈夌殑鏉愭枡涓�涓湭閫変腑鐨勭姸鎬�
- res.data.map((item) => {
- (item.checked = true), (item.unBindQuantity = "");
- });
- this.singlist.unshift(...res.data);
- this.ordersId = res.data[0].ordersId;
- });
- },
- //瑙g粦鏁伴噺澶辩劍浜嬩欢
- changeNum(option) {
- //鍒ゆ柇鏄惁鍕鹃�夛紝濡傛灉鍕鹃�変簡锛屽氨瑕佸鏁伴噺鏍¢獙
- if (!option.checked) {
- return;
- }
- if (option.unBindQuantity == "") {
- this.rescode = 400;
- this.resmessage = "瑙g粦鏁伴噺涓嶈兘涓虹┖";
- this.$refs.resmodal.show = true;
- }
-
- if (option.unBindQuantity <= 0) {
- this.rescode = 400;
- this.resmessage = "瑙g粦鏁伴噺蹇呴』澶т簬0";
- this.$refs.resmodal.show = true;
- }
- if (option.unBindQuantity > option.quantity) {
- this.rescode = 400;
- this.resmessage = "瑙g粦鏁伴噺涓嶈兘澶т簬搴撳瓨鏁伴噺";
- this.$refs.resmodal.show = true;
- }
- if (this.detailable) {
- let filterHas = this.singlist.filter(
- (item) => item.unBindQuantity == Number(item.quantity)
- );
- if (filterHas.length > 0) {
- this.warehouse.exitNumber =
- this.warehouse.useNumber - filterHas.length;
- }
- }
- },
- //纭瑙g粦
- submit() {
- const filterArr = this.singlist.filter((item) => item.checked);
- if (filterArr.length <= 0) {
- this.rescode = 400;
- this.resmessage = "璇烽�夋嫨瑙g粦鐨勭墿鏂欙紒";
- this.$refs.resmodal.show = true;
- return;
- }
- //鍒ゆ柇閫変腑鐨勯噷闈㈡槸鍚﹀瓨鍦ㄨВ缁戠殑鏁伴噺涓嶇鍚堣鑼冪殑
- // const index = filterArr.findIndex(item => item.unBindQuantity == '' || item.unBindQuantity <= 0 || item.unBindQuantity > item.quantity)
- // if (index > -1) {
- // this.rescode = 400
- // this.resmessage = '瑙g粦鏁伴噺涓嶇鍚堣姹�'
- // this.$refs.resmodal.show = true
- // return
- // }
- const warehousOrderDetails = filterArr.reduce((curr, item) => {
- curr.push({
- ...item,
- });
- return curr;
- }, []);
- const params = {
- flag: 3, //3锛氱墿鏂欒В缁�
- packageCode: this.warehouse.packageCode,
- orderDetails: warehousOrderDetails,
- };
- uni.showModal({
- title: "瑙g粦",
- content: "鏄惁纭瑙g粦锛�",
- showCancel: true,
- cancelColor: "#333333",
- success: (res) => {
- if (res.confirm) {
- unbindOrder(params).then((res) => {
- this.rescode = 200;
- this.$refs.resmodal.show = true;
- this.resmessage = "瑙g粦鎴愬姛";
- this.back();
- });
- } else if (res.cancel) {
- }
- },
- });
- },
- rest() {},
//妫�鏌ュ鍣ㄦ爡鏍兼暟
checkGrid() {},
//鑾峰彇瀹瑰櫒鐨勪俊鎭�
@@ -587,9 +243,9 @@
if (param == 1) {
this.warehouse.upi = "";
}
- if (this.warehouse.packageCode == "") {
+ if (!this.warehouse.packageCode) {
uni.showToast({
- title: "璇锋壂瀹瑰櫒缂栧彿",
+ title: "璇锋壂鍖呰鍙�",
icon: "none",
duration: 2000,
});
@@ -599,79 +255,20 @@
packageCode: this.warehouse.packageCode,
upi: this.warehouse.upi,
}).then((res) => {
- // //debugger
const result = res.result;
if (Array.isArray(result) && result.length == 0) {
uni.showToast({
- title: "鏁版嵁涓嶅瓨鍦�",
+ title: "娌℃湁鏌ュ埌鏁版嵁",
icon: "none",
duration: 2000,
});
+ this.singlist = [];
return;
- // this.kwbhAllowed = true
}
- //瀹瑰櫒缂栧彿鍏ュ彛
- // if (param == 1) {
- // }
- if (res.result && res.result.length == 1) {
- res.result[0].checked = true;
- }
- this.singlist = res.result;
-
- //鐗╂枡鍏ュ彛 鏍规嵁id 鍒ゆ柇鐗╂枡鏄惁瀛樺湪
- // res.result.forEach(item => {
- // let index = this.singlist.findIndex(v => v.upi == item.upi);
- // if (index == -1) {
-
- // this.singlist.unshift({
- // ...item
- // })
- // }
- // });
+ this.singlist = result;
});
},
- onlyUpdateDutyCycleClick() {
- this.$refs.warehouseRef.setRules(this.warehouseRules);
- this.$refs.warehouseRef.validate((valid) => {
- if (valid) {
- //璇锋眰鍙傛暟
- let params = {
- warepackageCode: this.warehouse.packageCode,
- dutyCycle: this.warehouse.dutyCycle,
- };
- uni.showModal({
- title: "鎻愮ず",
- content: "鏄惁纭浠呮洿鏂扮┖闂村崰姣旀暟鎹紵",
- showCancel: true,
- cancelColor: "#333333",
- success: (res) => {
- if (res.confirm) {
- onlyUpdateDutyCycle(params).then((res) => {
- this.warhouseTph = this.warehouse.packageCode;
- this.rescode = res.code;
- this.resmessage = res.message;
- this.$refs.resmodal.show = true;
- this.rest();
- });
- } else if (res.cancel) {
- }
- },
- });
- }
- });
- },
- gridBtnClick() {
- this.gridable = !this.gridable;
- if (!this.gridable) {
- this.$nextTick(() => {
- this.gridFocus = true;
- });
- } else {
- this.$nextTick(() => {
- this.gridFocus = false;
- });
- }
- },
+
//鍏ㄩ儴鍙栨秷
back() {
this.ordersId = 0;
@@ -680,12 +277,7 @@
this.warehouse.packageCode = "";
},
},
- unmounted() {
- if (this.timer) {
- clearTimeout(this.timer);
- this.timer = null;
- }
- },
+
};
</script>
<style lang="scss">
--
Gitblit v1.9.3