diff --git a/src/views/modules/yieldReport/com_separate_roll.vue b/src/views/modules/yieldReport/com_separate_roll.vue index d002519..2b790ae 100644 --- a/src/views/modules/yieldReport/com_separate_roll.vue +++ b/src/views/modules/yieldReport/com_separate_roll.vue @@ -144,6 +144,7 @@ 查询 批量编辑 批量保存 + 新增 + + 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 保存 + 关闭 + + @@ -233,6 +306,7 @@ validateShiftChangeDataCount,/*校验数据条数*/ saveAbnormalRollData,/*保存异常截卷数据*/ } from '@/api/yieldReport/com_separate_roll.js'; + import { fixedCarrierSave } from '@/api/fixedCarrier/fixedCarrier.js'; /*打印标签专用的js*/ import { @@ -336,6 +410,31 @@ export default { }, editBatchVisible: false, // 批量编辑状态 saveLoading: false, // 保存loading状态 + // 新增固定载具相关 + addCarrierFlag: false, + addCarrierLoading: false, + addCarrierData: { + bu: '', + site: '', + buNo: '', + carrierTypeCode: '', + carrierTypeName: '', + assetNo: '', + specification: '', + purchaseDate: null, + currentLocation: '', + dimensions: '', + availableQty: null, + maxWeight: null, + expectedLifeCycles: null, + expectedLifeDays: null, + status: 1, + remark: '' + }, + addCarrierRules: { + carrierTypeCode: [{ required: true, message: '请输入载具类型编码', trigger: 'blur' }], + carrierTypeName: [{ required: true, message: '请输入载具类型名称', trigger: 'blur' }] + }, hasCachedData: false, // 是否有缓存数据 cachedDataCount: 0, // 缓存数据条数 cachedRowDataList: [], // 缓存的原始行数据(用于校验) @@ -1055,6 +1154,52 @@ export default { }) }, + // 打开新增固定载具对话框 + addCarrierModal() { + console.log(this.scheduleData) + this.addCarrierData = { + bu: this.scheduleData.site + '_' + this.scheduleData.buNo || '', + site: this.scheduleData.site || '', + buNo: this.scheduleData.buNo || '', + carrierTypeCode: '', + carrierTypeName: '', + assetNo: '', + specification: '', + purchaseDate: null, + currentLocation: '', + dimensions: '', + availableQty: null, + maxWeight: null, + expectedLifeCycles: null, + expectedLifeDays: null, + status: 1, + remark: '' + }; + this.addCarrierFlag = true; + }, + + // 保存新增固定载具 + saveAddCarrier() { + this.$refs.addCarrierForm.validate((valid) => { + if (valid) { + this.addCarrierLoading = true; + fixedCarrierSave(this.addCarrierData).then(({data}) => { + if (data && data.code === 0) { + this.$message.success('新增成功'); + this.addCarrierFlag = false; + this.queryFixedCarrierList(); + } else { + this.$message.error(data.msg || '新增失败'); + } + }).catch(error => { + this.$message.error('新增失败: ' + error.message); + }).finally(() => { + this.addCarrierLoading = false; + }); + } + }); + }, + // 打印固定载具 printCarrier(row) { const LODOP = getLodop()