| | |
| | | <template> |
| | | <u-modal v-model="show" ref="uModal" title="" :show-cancel-button="true" @confirm="confirm" @cancel="cancel" |
| | | :async-close="true"> |
| | | <view style="padding: 20rpx;"> |
| | | <u-form :model="form" ref="uFormSave" :label-width="280" :rules="rules" :error-type="['toast']"> |
| | | <u-form-item label="批号" :border-bottom="false" prop="value0"> |
| | | <u-input v-model="form.value0" disabled /> |
| | | </u-form-item> |
| | | <u-form-item label="长度" :border-bottom="false" prop="value1"> |
| | | <u-input v-model="form.value1" /> |
| | | </u-form-item> |
| | | <u-form-item label="库位" :border-bottom="false" prop="value2"> |
| | | <u-input v-model="form.value2" disabled /> |
| | | </u-form-item> |
| | | <u-form-item label="盘号" :border-bottom="false" prop="value3"> |
| | | <u-input v-model="form.value3" /> |
| | | </u-form-item> |
| | | <u-form-item label="毛重" :border-bottom="false" prop="value4"> |
| | | <u-input v-model="form.value4" /> |
| | | </u-form-item> |
| | | <u-form-item label="净重" :border-bottom="false" prop="value5"> |
| | | <u-input v-model="form.value5" /> |
| | | </u-form-item> |
| | | <u-form-item label="工序" :border-bottom="false" prop="value6"> |
| | | <u-input v-model="form.value6" disabled /> |
| | | </u-form-item> |
| | | <u-form-item label="成品外径测量值" :border-bottom="false" prop="value7"> |
| | | <u-input v-model="form.value7" /> |
| | | </u-form-item> |
| | | <u-form-item label="退火电压" :border-bottom="false" prop="value8"> |
| | | <u-input v-model="form.value8" /> |
| | | </u-form-item> |
| | | <u-form-item label="转速" prop="value9" :border-bottom="false"> |
| | | <u-input v-model="form.value9" /> |
| | | </u-form-item> |
| | | <u-form-item label="外部气压" prop="value10" :border-bottom="false"> |
| | | <u-input v-model="form.value10" /> |
| | | </u-form-item> |
| | | <u-form-item label="生产速度" prop="value11" :border-bottom="false"> |
| | | <u-input v-model="form.value11" /> |
| | | </u-form-item> |
| | | </u-form> |
| | | <u-modal |
| | | v-model="show" |
| | | ref="uModal" |
| | | title="" |
| | | :show-cancel-button="true" |
| | | @confirm="confirm" |
| | | @cancel="cancel" |
| | | :async-close="true" |
| | | > |
| | | <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" /> |
| | | </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" |
| | | 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.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.grossWeight" /> |
| | | </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" /> |
| | | </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" /> |
| | | </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.outerDiameter" /> |
| | | </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.voltage" /> |
| | | </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.speed" /> |
| | | </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.pressure" /> |
| | | </view> |
| | | </view> |
| | | <view class="packing-registration-param-item param-extra"> |
| | | <view class="packing-registration-param-item-left"> |
| | | <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" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | | |
| | | </u-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | props: { |
| | | operationTaskId: { |
| | | type: String, |
| | | required: true, |
| | | default: () => ({}), |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | show: false, |
| | | form: { |
| | | value0: null, |
| | | value1: null, |
| | | value2: null, |
| | | value3: null, |
| | | value4: null, |
| | | value5: null, |
| | | value6: null, |
| | | outerDiameter: null, |
| | | voltage: null, |
| | | speed: null, |
| | | pressure: null, |
| | | productionSpeed: null, |
| | | grossWeight: null, |
| | | reelNumber: null, |
| | | value7: null, |
| | | value8: null, |
| | | value9: null, |
| | | value10: null, |
| | | value11: 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'] } |
| | | ] |
| | | }, |
| | | } |
| | | // 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'] } |
| | | // ] |
| | | // }, |
| | | }; |
| | | }, |
| | | watch: { |
| | | show(val) { |
| | | if (val) { |
| | | this.$nextTick(() => { |
| | | this.$refs.uFormSave.setRules(this.rules); |
| | | // 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() { |
| | | this.$refs.uFormSave.validate((valid) => { |
| | | if (valid) { |
| | | console.log('验证通过'); |
| | | // 执行提交逻辑(如API请求) |
| | | // 提交成功后关闭模态框 |
| | | 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; |
| | | } |
| | | this.$u.api.workReporting |
| | | .submitPDA({ ...this.form, operationTaskId: this.operationTaskId }) |
| | | .then((res) => { |
| | | console.log("res", res); |
| | | this.$refs.uModal.cancel(); |
| | | } else { |
| | | console.log('验证失败'); |
| | | // 显示错误信息 |
| | | this.$refs.uModal.clearLoading(); // 清除加载状态 |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | cancel() { |
| | | this.show = false; |
| | | this.form = {}; |
| | | }, |
| | | open() { |
| | | this.show = true; |
| | | } |
| | | }, |
| | | }, |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | |
| | | ::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; |
| | | } |
| | | } |
| | | } |
| | | </style> |