Browse Source

IQC批量修改添加送检单位

master
shenzhouyu 2 weeks ago
parent
commit
26b30fe4dc
  1. 36
      cclqms-vue/src/views/modules/qc/IQCBatchPurchaseAdd.vue

36
cclqms-vue/src/views/modules/qc/IQCBatchPurchaseAdd.vue

@ -121,6 +121,15 @@
class="batch-edit-input" /> class="batch-edit-input" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('qc.iqcPage.inspectionUnit')" width="130" align="center" fixed="right"
class-name="batch-edit-col">
<template slot-scope="scope">
<el-select v-model="scope.row.inspectionUmId" size="mini" filterable clearable class="batch-edit-input"
:placeholder="$t('qc.common.selectPlaceholder')">
<el-option v-for="i in umList" :key="i.umId" :label="i.umName" :value="i.umId" />
</el-select>
</template>
</el-table-column>
<el-table-column :label="$t('qc.iqcPage.supplierBatch')" width="140" align="center" fixed="right" <el-table-column :label="$t('qc.iqcPage.supplierBatch')" width="140" align="center" fixed="right"
class-name="batch-edit-col"> class-name="batch-edit-col">
<template slot-scope="scope"> <template slot-scope="scope">
@ -199,6 +208,7 @@ import {
batchSaveIQCInspection, batchSaveIQCInspection,
getSiteAndBuByUserName, getSiteAndBuByUserName,
getSenderList, getSenderList,
umSearch,
} from '@/api/qc/qc' } from '@/api/qc/qc'
export default { export default {
@ -219,6 +229,7 @@ export default {
createLoading: false, createLoading: false,
tableHeight: 460, tableHeight: 460,
userBuList: [], userBuList: [],
umList: [],
dataList: [], dataList: [],
selectedRows: [], selectedRows: [],
searchData: { searchData: {
@ -269,6 +280,7 @@ export default {
created() { created() {
this.calcTableHeight() this.calcTableHeight()
window.addEventListener('resize', this.calcTableHeight) window.addEventListener('resize', this.calcTableHeight)
this.loadUmList()
if (this.parentBuList && this.parentBuList.length) { if (this.parentBuList && this.parentBuList.length) {
this.userBuList = this.parentBuList this.userBuList = this.parentBuList
this.initDefaultBuSite() this.initDefaultBuSite()
@ -286,6 +298,20 @@ export default {
window.innerHeight - (this.embedded ? 280 : 320) window.innerHeight - (this.embedded ? 280 : 320)
) )
}, },
loadUmList() {
umSearch({ active: 'Y' }).then(({ data }) => {
if (data && data.code === 0) {
this.umList = data.rows || []
}
})
},
getDefaultInspectionUmId(row) {
if (row && row.umId) {
const matched = this.umList.find((item) => item.umId === row.umId)
if (matched) return matched.umId
}
return this.umList.length > 0 ? this.umList[0].umId : ''
},
loadBuList() { loadBuList() {
getSiteAndBuByUserName({ userName: this.$store.state.user.name }).then( getSiteAndBuByUserName({ userName: this.$store.state.user.name }).then(
({ data }) => { ({ data }) => {
@ -379,6 +405,7 @@ export default {
].join('_'), ].join('_'),
sendInspectQty: defaultQty, sendInspectQty: defaultQty,
batchNo: row.batchNo || '', batchNo: row.batchNo || '',
inspectionUmId: row.inspectionUmId || this.getDefaultInspectionUmId(row),
} }
}) })
} else { } else {
@ -470,6 +497,10 @@ export default {
) )
return false return false
} }
if (!row.inspectionUmId) {
this.$message.warning(this.$t('qc.iqcPage.selectInspectionUnit'))
return false
}
// 客户允许超检,暂不限制此次送检数量大于本次到货数量 // 客户允许超检,暂不限制此次送检数量大于本次到货数量
// const arrival = Number(row.currentArrivalQty) // const arrival = Number(row.currentArrivalQty)
// const sendQty = Number(row.sendInspectQty) // const sendQty = Number(row.sendInspectQty)
@ -521,6 +552,7 @@ export default {
lotsize: row.lotsize || row.currentArrivalQty, lotsize: row.lotsize || row.currentArrivalQty,
umId: row.umId, umId: row.umId,
umName: row.umName, umName: row.umName,
inspectionUmId: row.inspectionUmId,
rollQty: row.sendInspectQty, rollQty: row.sendInspectQty,
rollCount: row.sendInspectQty, rollCount: row.sendInspectQty,
batchNo: row.batchNo || '', batchNo: row.batchNo || '',
@ -611,4 +643,8 @@ export default {
padding-left: 8px !important; padding-left: 8px !important;
padding-right: 8px !important; padding-right: 8px !important;
} }
.iqc-batch-purchase >>> .el-select.batch-edit-input .el-input__inner {
height: 28px !important;
line-height: 28px !important;
}
</style> </style>
Loading…
Cancel
Save