| | |
| | | <template> |
| | | <view> |
| | | <u-modal |
| | | v-model="show" |
| | | ref="uModal" |
| | |
| | | :loading="loading" |
| | | > |
| | | <view class="packing-registration-param"> |
| | | <scroll-view scroll-y="true" style="height: 100%;transform: translateZ(0);-webkit-font-smoothing: antialiased;"> |
| | | <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"> |
| | |
| | | </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.ifsBatchNoArr" |
| | | 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.overallLength" /> |
| | | <u-input |
| | | class="item-one item-two" |
| | | v-model="form.overallLength" |
| | | /> |
| | | </view> |
| | | </view> |
| | | <view class="packing-registration-param-item param-extra"> |
| | |
| | | <text class="item-one">工序</text> |
| | | </view> |
| | | <view class="packing-registration-param-item-right"> |
| | | <u-input class="item-one item-two" v-model="form.name" disabled /> |
| | | <u-input |
| | | class="item-one item-two" |
| | | v-model="form.name" |
| | | disabled |
| | | /> |
| | | </view> |
| | | </view> |
| | | <view class="packing-registration-param-item param-extra"> |
| | |
| | | <text class="item-one">成品外径测量值</text> |
| | | </view> |
| | | <view class="packing-registration-param-item-right"> |
| | | <u-input class="item-one item-two" v-model="form.outerDiameter" /> |
| | | <u-input |
| | | class="item-one item-two" |
| | | v-model="form.outerDiameter" |
| | | /> |
| | | </view> |
| | | </view> |
| | | <view class="packing-registration-param-item param-extra"> |
| | |
| | | </scroll-view> |
| | | </view> |
| | | </u-modal> |
| | | <u-modal |
| | | v-model="showModal" |
| | | title="" |
| | | :show-cancel-button="true" |
| | | :show-confirm-button="true" |
| | | @confirm="confirmTl" |
| | | @cancel="cancelTl" |
| | | > |
| | | <view class="packing-registration-param"> |
| | | <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"> |
| | | <text class="item-one item-two">{{ |
| | | detailedList.ifsBatchNo |
| | | }}</text> |
| | | </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"> |
| | | <text class="item-one item-two">{{ detailedList.partName }}</text> |
| | | </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="detailedList.suppliedQuantity" |
| | | /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </u-modal> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | default: () => ({}), |
| | | }, |
| | | dutyId: { |
| | | type: String, |
| | | type: Number, |
| | | required: true, |
| | | default: '', |
| | | default: "", |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | showModal: false, |
| | | detailedList: {}, |
| | | show: false, |
| | | form: {}, |
| | | ifsBatchNo: [], |
| | | productInputList: [], |
| | | loading: false, |
| | | }; |
| | | }, |
| | |
| | | this.$refs.uModal.clearLoading(); // 清除加载状态 |
| | | return; |
| | | } |
| | | if (this.form.productInputList.length == 0) { |
| | | this.$u.toast("投料批次不能为空,请扫码投料"); |
| | | this.$refs.uModal.clearLoading(); // 清除加载状态 |
| | | return; |
| | | } |
| | | this.operationTaskList.operationTaskId = this.operationTaskList.id; |
| | | this.form.operationTaskId = this.operationTaskList.id; |
| | | this.form.status = this.operationTaskList.status; |
| | |
| | | this.$u.api.workReporting |
| | | .submitPDA(this.operationTaskList) |
| | | .then((res) => { |
| | | this.$emit("update"); |
| | | this.$emit("update",this.operationTaskList); |
| | | this.$refs.uModal.cancel(); |
| | | }) |
| | | .finally(() => { |
| | |
| | | cancel() { |
| | | this.show = false; |
| | | this.form = {}; |
| | | this.ifsBatchNo = []; |
| | | this.productInputList = []; |
| | | }, |
| | | cancelTl() { |
| | | this.showModal = false; |
| | | this.detailedList = {}; |
| | | }, |
| | | updateArray(arr, newObj) { |
| | | // 查找数组中是否有相同的 id |
| | | let index = arr.findIndex(item => item.ifsBatchNo === newObj.ifsBatchNo); |
| | | |
| | | if (index !== -1) { |
| | | // 如果找到相同 id 的对象,替换原有对象 |
| | | arr[index] = newObj; |
| | | } else { |
| | | // 如果没有找到相同 id 的对象,直接推入新对象 |
| | | arr.push(newObj); |
| | | } |
| | | return arr; |
| | | }, |
| | | confirmTl() { |
| | | let ifsBatchNoArr = []; |
| | | let updatedArrayList = this.updateArray(this.productInputList, this.detailedList); |
| | | console.log("updatedArrayList", updatedArrayList); |
| | | // this.productInputList.push(updatedArrayList); |
| | | this.$set(this.form, "productInputList", this.productInputList); |
| | | |
| | | this.productInputList.forEach((item) => { |
| | | ifsBatchNoArr.push(item.ifsBatchNo) |
| | | }) |
| | | console.log("ifsBatchNoArr", ifsBatchNoArr); |
| | | // this.ifsBatchNo.push(ifsBatchNoArr); |
| | | this.$set(this.form, "ifsBatchNoArr", ifsBatchNoArr); |
| | | console.log("this.form", this.form); |
| | | this.showModal = false; |
| | | this.detailedList = {}; |
| | | }, |
| | | open(val) { |
| | | this.show = true; |
| | | this.form = val.data; |
| | | }, |
| | | // 回显扫码的信息-报工单 |
| | | saveForm(val) { |
| | | this.$u.api.cancelReporting |
| | | .selInputPartInfoPDA({ |
| | | outBatchNo: val.BN, |
| | | partNo: val.PN, |
| | | moOn: this.operationTaskList.moOn, |
| | | }) |
| | | .then((res) => { |
| | | const list = { |
| | | suppliedQuantity: res.data.suppliedQuantity, |
| | | ifsBatchNo: res.data.ifsBatchNo, |
| | | partNo: res.data.partNo, |
| | | partName: res.data.partName, |
| | | locationNo: res.data.locationNo, |
| | | ifsLineItemNo: res.data.ifsLineItemNo, |
| | | serialNo: res.data.serialNo, |
| | | engChgLevel: res.data.engChgLevel, |
| | | ifsWdr: res.data.waivDevRejNo, |
| | | activitySeq: res.data.activitySeq, |
| | | }; |
| | | this.detailedList = list; |
| | | this.showModal = true; |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |