|
|
|
@ -8,6 +8,9 @@ |
|
|
|
<el-form-item :label="'打样单号'"> |
|
|
|
<el-input v-model="searchData.proofingNo" clearable style="width: 120px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'批次号'"> |
|
|
|
<el-input v-model="searchData.proofingBatchNo" clearable style="width: 120px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'项目号'"> |
|
|
|
<el-input v-model="searchData.projectId" clearable style="width: 120px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
@ -107,6 +110,14 @@ |
|
|
|
</download-excel> |
|
|
|
<el-button @click="filterVisible = true">搜索</el-button> |
|
|
|
<el-button type="warning" @click="closeProcessModal()">流程关闭</el-button> |
|
|
|
<el-button |
|
|
|
v-if="isAuth('103001:issued')" |
|
|
|
type="warning" |
|
|
|
:loading="batchIssuingLoading" |
|
|
|
:disabled="batchIssuingLoading" |
|
|
|
@click="batchIssueModal()"> |
|
|
|
批量下达 |
|
|
|
</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
@ -956,7 +967,10 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
"searchData.proofingNo"(newVal, oldVal) { |
|
|
|
this.searchData.proofingNo = newVal.toUpperCase() |
|
|
|
this.searchData.proofingNo = (newVal || '').toUpperCase() |
|
|
|
}, |
|
|
|
"searchData.proofingBatchNo"(newVal, oldVal) { |
|
|
|
this.searchData.proofingBatchNo = (newVal || '').toUpperCase() |
|
|
|
}, |
|
|
|
'modalFlag'(newVal, oldVal){ |
|
|
|
if (newVal === false){ |
|
|
|
@ -1071,6 +1085,7 @@ export default { |
|
|
|
approverName: '', |
|
|
|
priorityLevel: '', |
|
|
|
proofingNo: '', |
|
|
|
proofingBatchNo: '', |
|
|
|
customerPartNo: '', |
|
|
|
finalPartNo: '', |
|
|
|
page: 1, |
|
|
|
@ -1276,6 +1291,24 @@ export default { |
|
|
|
fixed: '', |
|
|
|
columnWidth: 120 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 103001, |
|
|
|
serialNumber: '103001Table1ProofingBatchNo', |
|
|
|
tableId: '103001Table1', |
|
|
|
tableName: '打样信息表', |
|
|
|
columnProp: 'proofingBatchNo', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: '批次号', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 140 |
|
|
|
}, |
|
|
|
{ |
|
|
|
userId: this.$store.state.user.name, |
|
|
|
functionId: 103001, |
|
|
|
@ -2279,6 +2312,7 @@ export default { |
|
|
|
rejectVisible: false, |
|
|
|
rejectOpinion: '', |
|
|
|
submitLoading: false, |
|
|
|
batchIssuingLoading: false, |
|
|
|
detailVisible: false, |
|
|
|
no: 1, |
|
|
|
size: 20, |
|
|
|
@ -2364,6 +2398,7 @@ export default { |
|
|
|
this.dataListLoading = false |
|
|
|
}) |
|
|
|
} else if (this.$route.params.proofingNo) { |
|
|
|
this.searchData.proofingBatchNo = '' |
|
|
|
this.searchData.proofingNo = this.$route.params.proofingNo |
|
|
|
this.getDataList(); |
|
|
|
setTimeout(() => { |
|
|
|
@ -2484,6 +2519,7 @@ export default { |
|
|
|
if (localStorage.getItem('proofingData') !== undefined) { |
|
|
|
let data = JSON.parse(localStorage.getItem('proofingData')); |
|
|
|
if (data) { |
|
|
|
this.searchData.proofingBatchNo = '' |
|
|
|
this.searchData.proofingNo = data.proofingNo |
|
|
|
} |
|
|
|
localStorage.removeItem('proofingData'); |
|
|
|
@ -2819,7 +2855,14 @@ export default { |
|
|
|
saveProofing() { |
|
|
|
proofingInformationSave(this.modalData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.searchData.proofingNo = data.proofingNo |
|
|
|
if (data.proofingBatchNo) { |
|
|
|
this.searchData.proofingBatchNo = data.proofingBatchNo |
|
|
|
this.searchData.proofingNo = '' |
|
|
|
} else { |
|
|
|
this.searchData.proofingNo = data.proofingNo |
|
|
|
this.searchData.proofingBatchNo = '' |
|
|
|
} |
|
|
|
this.pageIndex = 1 |
|
|
|
this.getDataList() |
|
|
|
this.modalFlag = false |
|
|
|
this.$message.success('操作成功') |
|
|
|
@ -2965,6 +3008,46 @@ export default { |
|
|
|
}) |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
batchIssueModal() { |
|
|
|
const draftRows = this.proofingSelections.filter(row => row.proofingStatus === '草稿') |
|
|
|
if (draftRows.length === 0) { |
|
|
|
this.$message.warning('请勾选状态为"草稿"的单据!') |
|
|
|
return |
|
|
|
} |
|
|
|
this.$confirm(`确定下达这 ${draftRows.length} 条打样单?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(async () => { |
|
|
|
this.batchIssuingLoading = true |
|
|
|
let successCount = 0 |
|
|
|
const failNos = [] |
|
|
|
try { |
|
|
|
for (let i = 0; i < draftRows.length; i++) { |
|
|
|
const row = draftRows[i] |
|
|
|
const success = await this.issueSingleProofing(row, 'C', false) |
|
|
|
if (success) { |
|
|
|
successCount++ |
|
|
|
} else { |
|
|
|
failNos.push(row.proofingNo) |
|
|
|
} |
|
|
|
} |
|
|
|
this.getDataList() |
|
|
|
this.modalFlag = false |
|
|
|
if (failNos.length === 0) { |
|
|
|
this.$message.success(`打样单已下达(${successCount}条)`) |
|
|
|
} else if (successCount === 0) { |
|
|
|
this.$message.error('批量下达失败,请重试') |
|
|
|
} else { |
|
|
|
const failPreview = failNos.slice(0, 5).join('、') |
|
|
|
const extraMsg = failNos.length > 5 ? ' 等' : '' |
|
|
|
this.$message.warning(`已下达${successCount}条,失败${failNos.length}条(${failPreview}${extraMsg})`) |
|
|
|
} |
|
|
|
} finally { |
|
|
|
this.batchIssuingLoading = false |
|
|
|
} |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
|
|
|
|
selectionProofing(val) { |
|
|
|
this.proofingSelections = val |
|
|
|
@ -3689,22 +3772,34 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
updateModalStatus(row, status) { |
|
|
|
if (this.issuingSet[row.proofingNo]) return |
|
|
|
this.$set(this.issuingSet, row.proofingNo, true) |
|
|
|
this.$confirm(`是否确认下达?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(async () => { |
|
|
|
if (!row.proofingAmount||row.proofingAmount===0){ |
|
|
|
if (row.finalPartNo){ |
|
|
|
const success = await this.issueSingleProofing(row, status, true) |
|
|
|
if (success) { |
|
|
|
this.getDataList() |
|
|
|
this.modalFlag = false |
|
|
|
this.$message.success('打样单已下达') |
|
|
|
} |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
async issueSingleProofing(row, status, showErrorAlert = true) { |
|
|
|
if (this.issuingSet[row.proofingNo]) { |
|
|
|
return false |
|
|
|
} |
|
|
|
this.$set(this.issuingSet, row.proofingNo, true) |
|
|
|
try { |
|
|
|
if (!row.proofingAmount || row.proofingAmount === 0) { |
|
|
|
if (row.finalPartNo) { |
|
|
|
let params = { |
|
|
|
configurationId: '*', |
|
|
|
userName: this.$store.state.user.name, |
|
|
|
partNo: row.finalPartNo, |
|
|
|
site: this.$store.state.user.site |
|
|
|
} |
|
|
|
const {data} = await queryPartUnitCostList(params); |
|
|
|
const {data} = await queryPartUnitCostList(params) |
|
|
|
if (data && data.code === 0 && data.rows.length > 0) { |
|
|
|
let unitPrice = +data.rows[0].inventoryValue |
|
|
|
row.proofingAmount = unitPrice * this.modalData.proofingNumber |
|
|
|
@ -3718,8 +3813,8 @@ export default { |
|
|
|
limit: 5, |
|
|
|
page: 1, |
|
|
|
} |
|
|
|
const {data} = await partInformationSearch(params); |
|
|
|
if (data && data.code === 0 && data.page.list.length > 0){ |
|
|
|
const {data} = await partInformationSearch(params) |
|
|
|
if (data && data.code === 0 && data.page.list.length > 0) { |
|
|
|
row.proofingAmount = data.page.list[0].estimatedMaterialCost * this.modalData.proofingNumber |
|
|
|
} else { |
|
|
|
row.proofingAmount = 0 |
|
|
|
@ -3727,26 +3822,28 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
let params = JSON.parse(JSON.stringify(row)) |
|
|
|
params.proofingResultStatus = status; |
|
|
|
params.proofingStatus = '下达'; |
|
|
|
params.proofingResultStatus = status |
|
|
|
params.proofingStatus = '下达' |
|
|
|
params.userName = this.$store.state.user.name |
|
|
|
params.menuId = this.$route.meta.menuId |
|
|
|
proofingInformationEditStatus(params).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.getDataList() |
|
|
|
this.modalFlag = false |
|
|
|
this.$message.success('打样单已下达') |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}).finally(() => { |
|
|
|
this.$set(this.issuingSet, row.proofingNo, false) |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
const {data} = await proofingInformationEditStatus(params) |
|
|
|
if (data && data.code === 0) { |
|
|
|
return true |
|
|
|
} |
|
|
|
if (showErrorAlert) { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
return false |
|
|
|
} catch (error) { |
|
|
|
if (showErrorAlert) { |
|
|
|
this.$message.error(error.message || '下达失败') |
|
|
|
} |
|
|
|
return false |
|
|
|
} finally { |
|
|
|
this.$set(this.issuingSet, row.proofingNo, false) |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
searchDelegateAccessByUser() { |
|
|
|
// 角色 ROO7 的用户 |
|
|
|
|