From fcfa50cf224f515baffb647d75f53797575be8df Mon Sep 17 00:00:00 2001 From: yyb <995253665@qq.com> Date: 星期三, 18 六月 2025 11:00:01 +0800 Subject: [PATCH] pda报工单元测试 --- pages/product/WorkshopOrderCancellationIssued/index.vue | 3 + pages/product/report/components/saveForm.vue | 13 ++++-- pages/product/report/index.vue | 39 ++++++------------- pages/product/cancelReport/index.vue | 4 +- common/http.api.js | 2 pages/product/report/orderList.vue | 3 - 6 files changed, 26 insertions(+), 38 deletions(-) diff --git a/common/http.api.js b/common/http.api.js index 205c8ee..cb7f5a7 100644 --- a/common/http.api.js +++ b/common/http.api.js @@ -494,7 +494,7 @@ // 鑾峰彇杞﹂棿璁㈠崟鍒楄〃 getWorkshopOrder: (params = {}) => vm.$u.get('/mes/plan/manufacturingOrder/page', params), // 鑾峰彇浜у嚭鍒楄〃 - getProductMainV1: (params = {}) => vm.$u.get('/mes/operationTask/getxxMainList'+ params.id), + getProductMainV1: (params = {}) => vm.$u.get('/mes/operationTask/getxxMainList/'+ params.id), // 鎶ュ伐鎻愪氦鑾峰彇璇︾粏淇℃伅 operationTask: (params = {}) => vm.$u.get('/mes/operationTask/'+ params.id), // 鎻愪氦 diff --git a/pages/product/WorkshopOrderCancellationIssued/index.vue b/pages/product/WorkshopOrderCancellationIssued/index.vue index 8181993..eb46de3 100644 --- a/pages/product/WorkshopOrderCancellationIssued/index.vue +++ b/pages/product/WorkshopOrderCancellationIssued/index.vue @@ -124,6 +124,7 @@ }, data() { return { + showModal:false, background: { backgroundImage: `url(${content_bg})`, backgroundAttachment: "fixed", @@ -174,6 +175,7 @@ //鎵爜鎴愬姛鍚庣殑鍥炶皟锛屼綘鍙互鍐欒嚜宸辩殑閫昏緫浠g爜鍦ㄨ繖閲� console.log("鎵爜缁撴灉锛�", data.code); that.scanHandle(data.code); + this.showModal = true; that.$forceUpdate(); }); }, @@ -203,6 +205,7 @@ url: "/pages/product/report/orderList", }); }, + }, }; </script> diff --git a/pages/product/cancelReport/index.vue b/pages/product/cancelReport/index.vue index c6d17d5..5e68b36 100644 --- a/pages/product/cancelReport/index.vue +++ b/pages/product/cancelReport/index.vue @@ -182,7 +182,7 @@ onShow() { let that = this; uni.$off("scan"); // 姣忔杩涙潵鍏� 绉婚櫎鍏ㄥ眬鑷畾涔変簨浠剁洃鍚櫒 - if ((form.moNO = null)) { + if ((that.form.moNO = null)) { uni.showToast({ icon: "none", title: "璇峰厛閫夋嫨璁㈠崟鍙凤紒", @@ -190,7 +190,7 @@ }); return; } - if ((form.moNO = null)) { + if ((that.form.moNO = null)) { uni.showToast({ icon: "none", title: "鎵弿鐨勪簩缁寸爜涓庤璁㈠崟涓嶄竴鑷�", diff --git a/pages/product/report/components/saveForm.vue b/pages/product/report/components/saveForm.vue index 5780ac4..07dfda6 100644 --- a/pages/product/report/components/saveForm.vue +++ b/pages/product/report/components/saveForm.vue @@ -112,7 +112,7 @@ <script> export default { props: { - operationTaskId: { + operationTaskList: { type: Object, required: true, default: () => ({}), @@ -151,10 +151,14 @@ this.$refs.uModal.clearLoading(); // 娓呴櫎鍔犺浇鐘舵�� return; } + this.operationTaskList.operationTaskId = this.operationTaskList.id + this.form.operationTaskId = this.operationTaskList.id + this.operationTaskList.productOutputList = []; // 鍒涘缓涓�涓┖鏁扮粍 + this.operationTaskList.productOutputList.push(this.form); // 鍚戞暟缁勪腑娣诲姞鍏冪礌 + console.log('this.operationTaskList',this.operationTaskList) this.$u.api.workReporting - .submitPDA({ ...this.form, operationTaskId: this.operationTaskId.id }) + .submitPDA(this.operationTaskList) .then((res) => { - console.log("res", res); this.$emit('update') this.$refs.uModal.cancel(); }); @@ -164,9 +168,8 @@ this.form = {}; }, open(val) { - console.log('11daidecanshuskk',val) this.show = true; - this.form = val; + this.form = val.data; }, }, }; diff --git a/pages/product/report/index.vue b/pages/product/report/index.vue index c327e83..d66fafe 100644 --- a/pages/product/report/index.vue +++ b/pages/product/report/index.vue @@ -74,13 +74,13 @@ <u-radio name="鎶曟枡">鎶曟枡</u-radio> </u-radio-group> </u-form-item> - <u-form-item label="宸ュ簭" prop="value11"> + <u-form-item label="宸ュ簭" prop="value1"> <u-checkbox-group> <u-checkbox :name="item.name" v-for="(item, index) in checkboxList" :key="index" - v-model="item.value11" + v-model="item.value1" @change="changeCheckbox" :disabled="subdisabled || item.disabled" > @@ -119,7 +119,7 @@ <view class="_label-name">鏁伴噺锛�</view> </view> <view class="_content"> - {{ item.value1 }} + {{ item.netWeight }} </view> </view> <view class="row-list"> @@ -147,7 +147,7 @@ </modalBg> <saveForm ref="saveForm" - :operationTaskId="this.form" + :operationTaskList="this.form" @update="handleUpdate" /> <scan></scan> @@ -180,6 +180,7 @@ ], InventoryReceiptList: [], form: { + workstationId: "", work: "", taskNo: "", name: "", @@ -190,7 +191,7 @@ Jianqtyfinished: "", proposedLocation: "", productType: "dep", - receive: "mo", // 澶嶉�夋缁勭殑鍊� + receive: "mo", materialcost: "", autoReport: false, simplifyMaterials: false, @@ -247,27 +248,23 @@ // 鐐瑰嚮鎻愪氦鎸夐挳鐨勪簨浠跺鐞嗗嚱鏁� onNavigationBarButtonTap() { this.$refs.uForm.validate((valid) => { - if (valid) { - uni.showLoading({ + if (valid) { + uni.showLoading({ mask: true, title: "鍔犺浇涓�", }); - console.log("楠岃瘉閫氳繃"); // 澶勭悊鎻愪氦閫昏緫 this.$u.api.workReporting .operationTask({ id: this.form.id, }) .then((res) => { - console.log("res", res); this.$refs.saveForm.open(res); uni.hideLoading(); }); } else { - console.log("楠岃瘉澶辫触"); // 鍙互鑾峰彇鍏蜂綋鐨勯敊璇俊鎭� const errors = this.$refs.uForm.getError(); - console.log("閿欒淇℃伅:", errors); } }); }, @@ -276,12 +273,9 @@ }, onShow() { let that = this; - console.log("1111111111111"); uni.$off("scan"); // 姣忔杩涙潵鍏� 绉婚櫎鍏ㄥ眬鑷畾涔変簨浠剁洃鍚櫒 uni.$on("scan", function (data) { - console.log("onscan"); //鎵爜鎴愬姛鍚庣殑鍥炶皟锛屼綘鍙互鍐欒嚜宸辩殑閫昏緫浠g爜鍦ㄨ繖閲� - console.log("椤甸潰鎵爜缁撴灉锛�", data.code); if (data.code) { let codeInfo = JSON.parse(data.code); if (codeInfo.moOn) { @@ -291,28 +285,21 @@ .getProductMainV1({ current: 1, size: -1, - operationTaskId: codeInfo.id, + id: codeInfo.id, }) .then((res) => { - console.log("res", res); - let InventoryReceiptList = JSON.parse(res.data.records); - that.saveInventory(InventoryReceiptList); + that.InventoryReceiptList = res.data.productOutputList; }); - console.log("this.InventoryReceiptList", that.InventoryReceiptList); } } }); }, watch: { "form.taskNo": function (newVal, oldVal) { - console.log("taskNo changed:", newVal, oldVal); this.subdisabled = false; }, }, methods: { - saveInventory(val) { - this.InventoryReceiptList = val; - }, // 澶氶�夊鐞� changeCheckbox(val) { if (val.name === "宸ュ簭鐨勮嚜鍔ㄦ姤鍛�") { @@ -330,9 +317,7 @@ this.$refs.modalBg.open(); }, // 寮规淇濆瓨 - confirm() { - console.log("淇濆瓨", this.form.taskNo); - }, + confirm() {}, // 閫夋嫨璁㈠崟鍙� openList() { if (this.form.taskNo === "") { @@ -352,9 +337,9 @@ }, // 鍥炴樉鎵爜鐨勪俊鎭�-鎶ュ伐鍗� saveForm(val) { - console.log("鍥炴樉鐨勬暟鎹�", val); this.form = { id: val.id, + workstationId: val.workstationId, work: val.work, taskNo: val.taskNo, name: val.name, diff --git a/pages/product/report/orderList.vue b/pages/product/report/orderList.vue index 3f32950..3970b87 100644 --- a/pages/product/report/orderList.vue +++ b/pages/product/report/orderList.vue @@ -127,7 +127,6 @@ size: this.pageSize }) .then((res) => { - console.log("res", res); this.list = res.data.records; this.total = res.data.total; if (this.pageSize >= this.total) { @@ -138,7 +137,6 @@ }); }, search(value) { - console.log("111", value); if (value) { this.list = []; this.pageSize = 10; @@ -149,7 +147,6 @@ moNo: value, }) .then((res) => { - console.log("res", res); this.list = res.data.records; this.total = res.data.total; if (this.pageSize >= this.total) { -- Gitblit v1.9.3