From 2182727cf18c94d94d8745e860784f5bc5f805ef Mon Sep 17 00:00:00 2001 From: yyb <995253665@qq.com> Date: 星期六, 02 八月 2025 01:16:33 +0800 Subject: [PATCH] 报工页面传递dutyRecordId,机台id --- pages/product/report/components/saveForm.vue | 205 +++++++++++++++++++++++++++------------------------ 1 files changed, 108 insertions(+), 97 deletions(-) diff --git a/pages/product/report/components/saveForm.vue b/pages/product/report/components/saveForm.vue index 07dfda6..03049c7 100644 --- a/pages/product/report/components/saveForm.vue +++ b/pages/product/report/components/saveForm.vue @@ -7,10 +7,19 @@ @confirm="confirm" @cancel="cancel" :async-close="true" + :loading="loading" > <view class="packing-registration-param"> - <scroll-view scroll-y="true" style="height: 100%"> + <scroll-view scroll-y="true" style="height: 100%;transform: translateZ(0);-webkit-font-smoothing: antialiased;"> <view class="packing-registration-param-view"> + <view class="packing-registration-param-item param-extra"> + <view class="packing-registration-param-item-left"> + <text class="item-one">鎵瑰彿</text> + </view> + <view class="packing-registration-param-item-right"> + <u-input class="item-one item-two" v-model="form.outBatchNo" /> + </view> + </view> <view class="packing-registration-param-item param-extra"> <view class="packing-registration-param-item-left"> <text class="item-one">闀垮害</text> @@ -41,6 +50,14 @@ </view> <view class="packing-registration-param-item param-extra"> <view class="packing-registration-param-item-left"> + <text class="item-one">鐩橀噸</text> + </view> + <view class="packing-registration-param-item-right"> + <u-input class="item-one item-two" v-model="form.reelWeight" /> + </view> + </view> + <view class="packing-registration-param-item param-extra"> + <view class="packing-registration-param-item-left"> <text class="item-one">姣涢噸</text> </view> <view class="packing-registration-param-item-right"> @@ -52,7 +69,19 @@ <text class="item-one">鍑�閲�</text> </view> <view class="packing-registration-param-item-right"> - <u-input class="item-one item-two" v-model="form.theoryWeight" /> + <u-input + class="item-one item-two" + v-model="form.netWeight" + disabled + /> + </view> + </view> + <view class="packing-registration-param-item param-extra"> + <view class="packing-registration-param-item-left"> + <text class="item-one">搴熸枡</text> + </view> + <view class="packing-registration-param-item-right"> + <u-input class="item-one item-two" v-model="form.waste" /> </view> </view> <view class="packing-registration-param-item param-extra"> @@ -60,7 +89,7 @@ <text class="item-one">宸ュ簭</text> </view> <view class="packing-registration-param-item-right"> - <u-input class="item-one item-two" v-model="form.name" /> + <u-input class="item-one item-two" v-model="form.name" disabled /> </view> </view> <view class="packing-registration-param-item param-extra"> @@ -100,7 +129,10 @@ <text class="item-one item-two">鐢熶骇閫熷害</text> </view> <view class="packing-registration-param-item-right"> - <u-input class="item-one item-two" v-model="form.productionSpeed" /> + <u-input + class="item-one item-two" + v-model="form.productionSpeed" + /> </view> </view> </view> @@ -117,50 +149,98 @@ required: true, default: () => ({}), }, + dutyId: { + type: String, + required: true, + default: '', + }, }, data() { return { show: false, form: {}, + loading: false, }; + }, + watch: { + "form.grossWeight"(val) { + if (val === "") { + this.form.netWeight = ""; + } else if (this.form.reelWeight) { + this.form.netWeight = + parseFloat(val) - parseFloat(this.form.reelWeight); + } + }, + "form.reelWeight"(val) { + if (this.form.grossWeight && val) { + this.form.netWeight = + parseFloat(this.form.grossWeight) - parseFloat(val); + } + }, }, methods: { confirm() { - if (!this.form.outerDiameter) { - this.$u.toast("璇疯緭鍏ユ垚鍝佸寰勬祴閲忓��"); + if (this.loading) return; + // if (!this.form.outerDiameter) { + // this.$u.toast("璇疯緭鍏ユ垚鍝佸寰勬祴閲忓��"); + // this.$refs.uModal.clearLoading(); // 娓呴櫎鍔犺浇鐘舵�� + // return; + // } + // if (!this.form.voltage) { + // this.$u.toast("璇疯緭鍏ラ��鐏數鍘�"); + // this.$refs.uModal.clearLoading(); // 娓呴櫎鍔犺浇鐘舵�� + // return; + // } + // if (!this.form.speed) { + // this.$u.toast("璇疯緭鍏ヨ浆閫�"); + // this.$refs.uModal.clearLoading(); // 娓呴櫎鍔犺浇鐘舵�� + // return; + // } + // if (!this.form.pressure) { + // this.$u.toast("璇疯緭鍏ュ閮ㄦ皵鍘�"); + // this.$refs.uModal.clearLoading(); // 娓呴櫎鍔犺浇鐘舵�� + // return; + // } + // if (!this.form.productionSpeed) { + // this.$u.toast("璇疯緭鍏ョ敓浜ч�熷害"); + // this.$refs.uModal.clearLoading(); // 娓呴櫎鍔犺浇鐘舵�� + // return; + // } + if (!this.form.outBatchNo) { + this.$u.toast("璇疯緭鍏ユ壒鍙�"); this.$refs.uModal.clearLoading(); // 娓呴櫎鍔犺浇鐘舵�� return; } - if (!this.form.voltage) { - this.$u.toast("璇疯緭鍏ラ��鐏數鍘�"); + if (Number(this.form.netWeight) == 0) { + this.$u.toast("鍑�閲嶄笉涓�0"); this.$refs.uModal.clearLoading(); // 娓呴櫎鍔犺浇鐘舵�� return; } - if (!this.form.speed) { - this.$u.toast("璇疯緭鍏ヨ浆閫�"); + if (!this.form.waste) { + this.$u.toast("璇疯緭鍏ュ簾鏂�"); this.$refs.uModal.clearLoading(); // 娓呴櫎鍔犺浇鐘舵�� return; } - if (!this.form.pressure) { - this.$u.toast("璇疯緭鍏ュ閮ㄦ皵鍘�"); - this.$refs.uModal.clearLoading(); // 娓呴櫎鍔犺浇鐘舵�� - return; - } - if (!this.form.productionSpeed) { - this.$u.toast("璇疯緭鍏ョ敓浜ч�熷害"); - 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.operationTaskList.operationTaskId = this.operationTaskList.id; + this.form.operationTaskId = this.operationTaskList.id; + this.form.status = this.operationTaskList.status; + this.form.Persons = this.operationTaskList.Persons; + this.form.productStaffIds = this.operationTaskList.productStaffIds; + this.form.productStaffs = this.operationTaskList.productStaffs; + this.form.dutyRecordId = this.dutyId; + this.operationTaskList.productOutputList = []; // 鍒涘缓涓�涓┖鏁扮粍 + this.operationTaskList.productOutputList.push(this.form); // 鍚戞暟缁勪腑娣诲姞鍏冪礌 + console.log("this.operationTaskList", this.operationTaskList); + this.loading = true; this.$u.api.workReporting .submitPDA(this.operationTaskList) .then((res) => { - this.$emit('update') + this.$emit("update"); this.$refs.uModal.cancel(); + }) + .finally(() => { + this.loading = false; + this.$refs.uModal.clearLoading(); }); }, cancel() { @@ -169,7 +249,7 @@ }, open(val) { this.show = true; - this.form = val.data; + this.form = val.data; }, }, }; @@ -183,74 +263,5 @@ ::v-deep .u-input__input { text-align: right !important; } -.packing-registration-param { - padding: 40rpx 30rpx 10rpx 30rpx; - height: 350px; - overflow: hidden; - - .packing-registration-param-title { - display: flex; - flex-direction: row; - align-items: center; - margin-bottom: 30rpx; - - .title-label { - margin-left: 14rpx; - font-size: 34rpx; - font-weight: bold; - color: #283e65; - } - } - - .packing-registration-param-view { - height: 177rpx; - background-color: #fff; - border-radius: 10rpx; - padding: 0rpx 23rpx; - margin-bottom: 30rpx; - - .packing-registration-param-item { - height: 90rpx; - border: 1px solid #adc8e4; - line-height: 90rpx; - display: flex; - justify-content: space-between; - border: none; - - .packing-registration-param-item-left { - .item-one { - font-size: 30rpx; - color: #666666; - } - } - - .packing-registration-param-item-right { - display: flex; - justify-content: space-between; - - .item-one { - font-size: 15rpx; - color: #060505; - margin-right: 6rpx; - } - - .item-two { - font-size: 15rpx; - color: #a6b4cc; - margin-right: 6rpx; - } - - .item-three { - font-size: 30rpx; - color: #214ded; - margin-right: 6rpx; - } - } - } - - .param-extra { - border-bottom: 1px solid #ededed; - } - } -} +@import "../index.scss"; </style> \ No newline at end of file -- Gitblit v1.9.3