From 47aaf4c8e4bea6ce9e03b88ce10760a29ae5e1f0 Mon Sep 17 00:00:00 2001 From: yyb <995253665@qq.com> Date: 星期五, 11 七月 2025 14:25:23 +0800 Subject: [PATCH] 报工提交弹窗样式公用,防止代码冗余 --- pages/product/report/components/saveForm.vue | 190 +++++++++-------------------------------------- 1 files changed, 37 insertions(+), 153 deletions(-) diff --git a/pages/product/report/components/saveForm.vue b/pages/product/report/components/saveForm.vue index 364259c..22841b1 100644 --- a/pages/product/report/components/saveForm.vue +++ b/pages/product/report/components/saveForm.vue @@ -7,28 +7,17 @@ @confirm="confirm" @cancel="cancel" :async-close="true" + :loading="loading" > <view class="packing-registration-param"> <scroll-view scroll-y="true" style="height: 100%"> <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.value0" - 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.value1" /> + <u-input class="item-one item-two" v-model="form.overallLength" /> </view> </view> <view class="packing-registration-param-item param-extra"> @@ -38,7 +27,7 @@ <view class="packing-registration-param-item-right"> <u-input class="item-one item-two" - v-model="form.value1" + v-model="form.proposedLocation" disabled /> </view> @@ -51,6 +40,14 @@ <u-input class="item-one item-two" v-model="form.reelNumber" /> </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.reelWeight" /> + </view> + </view> <view class="packing-registration-param-item param-extra"> <view class="packing-registration-param-item-left"> <text class="item-one">姣涢噸</text> @@ -64,7 +61,7 @@ <text class="item-one">鍑�閲�</text> </view> <view class="packing-registration-param-item-right"> - <u-input class="item-one item-two" v-model="form.value1" /> + <u-input class="item-one item-two" v-model="form.netWeight" /> </view> </view> <view class="packing-registration-param-item param-extra"> @@ -72,7 +69,7 @@ <text class="item-one">宸ュ簭</text> </view> <view class="packing-registration-param-item-right"> - <u-input class="item-one item-two" v-model="form.value1" /> + <u-input class="item-one item-two" v-model="form.name" disabled /> </view> </view> <view class="packing-registration-param-item param-extra"> @@ -112,7 +109,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> @@ -124,8 +124,8 @@ <script> export default { props: { - operationTaskId: { - type: String, + operationTaskList: { + type: Object, required: true, default: () => ({}), }, @@ -133,71 +133,13 @@ data() { return { show: false, - form: { - outerDiameter: null, - voltage: null, - speed: null, - pressure: null, - productionSpeed: null, - grossWeight: null, - reelNumber: null, - value7: null, - value8: null, - value9: null, - value10: null, - value11: null, - }, - // rules: { - // value1: [ - // { required: true, message: '璇疯緭鍏ラ暱搴�', trigger: ['blur', 'change'] }, - // ], - // value3: [ - // { required: true, message: '璇疯緭鍏ョ洏鍙�', trigger: ['blur', 'change'] }, - // ], - // value4: [ - // { required: true, message: '璇疯緭鍏ユ瘺閲�', trigger: ['blur', 'change'] }, - // ], - // value5: [ - // { required: true, message: '璇疯緭鍏ュ噣閲�', trigger: ['blur', 'change'] }, - // ], - // value7: [ - // { required: true, message: '璇疯緭鍏ユ垚鍝佸寰勬祴閲忓��', trigger: ['blur', 'change'] }, - // ], - // value8: [ - // { required: true, message: '璇疯緭鍏ラ��鐏數鍘�', trigger: ['blur', 'change'] }, - // ], - // value9: [ - // { required: true, message: '璇疯緭鍏ヨ浆閫�', trigger: ['blur', 'change'] }, - // ], - // value10: [ - // { required: true, message: '璇疯緭鍏ュ閮ㄦ皵鍘�', trigger: ['blur', 'change'] } - // ], - // value11: [ - // { required: true, message: '璇疯緭鍏ョ敓浜ч�熷害', trigger: ['blur', 'change'] } - // ] - // }, + form: {}, + loading: false }; - }, - watch: { - show(val) { - if (val) { - this.$nextTick(() => { - // this.$refs.uFormSave.setRules(this.rules); - console.log("1222222"); - this.$u.api.workReporting - .operationTask({ - id: this.operationTaskId, - }) - .then((res) => { - console.log("res", res); - this.form = res.data.records; - }); - }); - } - }, }, methods: { confirm() { + if (this.loading) return; if (!this.form.outerDiameter) { this.$u.toast("璇疯緭鍏ユ垚鍝佸寰勬祴閲忓��"); this.$refs.uModal.clearLoading(); // 娓呴櫎鍔犺浇鐘舵�� @@ -223,19 +165,30 @@ 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.loading = true; this.$u.api.workReporting - .submitPDA({ ...this.form, operationTaskId: this.operationTaskId }) + .submitPDA(this.operationTaskList) .then((res) => { - console.log("res", res); + this.$emit("update"); this.$refs.uModal.cancel(); + }) + .finally(() => { + this.loading = false; + this.$refs.uModal.clearLoading(); }); }, cancel() { this.show = false; this.form = {}; }, - open() { + open(val) { this.show = true; + this.form = val.data; }, }, }; @@ -249,74 +202,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