Browse Source

2026-06-18

打样申请增加“批次号”和【批量下达】操作
master
fengyuan_yang 13 hours ago
parent
commit
49d8f1b359
  1. 137
      src/views/modules/proofing/requestForProofing.vue

137
src/views/modules/proofing/requestForProofing.vue

@ -8,6 +8,9 @@
<el-form-item :label="'打样单号'"> <el-form-item :label="'打样单号'">
<el-input v-model="searchData.proofingNo" clearable style="width: 120px"></el-input> <el-input v-model="searchData.proofingNo" clearable style="width: 120px"></el-input>
</el-form-item> </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-form-item :label="'项目号'">
<el-input v-model="searchData.projectId" clearable style="width: 120px"></el-input> <el-input v-model="searchData.projectId" clearable style="width: 120px"></el-input>
</el-form-item> </el-form-item>
@ -107,6 +110,14 @@
</download-excel> </download-excel>
<el-button @click="filterVisible = true">搜索</el-button> <el-button @click="filterVisible = true">搜索</el-button>
<el-button type="warning" @click="closeProcessModal()">流程关闭</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-item>
</el-form> </el-form>
@ -956,7 +967,10 @@ export default {
} }
}, },
"searchData.proofingNo"(newVal, oldVal) { "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){ 'modalFlag'(newVal, oldVal){
if (newVal === false){ if (newVal === false){
@ -1071,6 +1085,7 @@ export default {
approverName: '', approverName: '',
priorityLevel: '', priorityLevel: '',
proofingNo: '', proofingNo: '',
proofingBatchNo: '',
customerPartNo: '', customerPartNo: '',
finalPartNo: '', finalPartNo: '',
page: 1, page: 1,
@ -1276,6 +1291,24 @@ export default {
fixed: '', fixed: '',
columnWidth: 120 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, userId: this.$store.state.user.name,
functionId: 103001, functionId: 103001,
@ -2279,6 +2312,7 @@ export default {
rejectVisible: false, rejectVisible: false,
rejectOpinion: '', rejectOpinion: '',
submitLoading: false, submitLoading: false,
batchIssuingLoading: false,
detailVisible: false, detailVisible: false,
no: 1, no: 1,
size: 20, size: 20,
@ -2364,6 +2398,7 @@ export default {
this.dataListLoading = false this.dataListLoading = false
}) })
} else if (this.$route.params.proofingNo) { } else if (this.$route.params.proofingNo) {
this.searchData.proofingBatchNo = ''
this.searchData.proofingNo = this.$route.params.proofingNo this.searchData.proofingNo = this.$route.params.proofingNo
this.getDataList(); this.getDataList();
setTimeout(() => { setTimeout(() => {
@ -2484,6 +2519,7 @@ export default {
if (localStorage.getItem('proofingData') !== undefined) { if (localStorage.getItem('proofingData') !== undefined) {
let data = JSON.parse(localStorage.getItem('proofingData')); let data = JSON.parse(localStorage.getItem('proofingData'));
if (data) { if (data) {
this.searchData.proofingBatchNo = ''
this.searchData.proofingNo = data.proofingNo this.searchData.proofingNo = data.proofingNo
} }
localStorage.removeItem('proofingData'); localStorage.removeItem('proofingData');
@ -2819,7 +2855,14 @@ export default {
saveProofing() { saveProofing() {
proofingInformationSave(this.modalData).then(({data}) => { proofingInformationSave(this.modalData).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
if (data.proofingBatchNo) {
this.searchData.proofingBatchNo = data.proofingBatchNo
this.searchData.proofingNo = ''
} else {
this.searchData.proofingNo = data.proofingNo this.searchData.proofingNo = data.proofingNo
this.searchData.proofingBatchNo = ''
}
this.pageIndex = 1
this.getDataList() this.getDataList()
this.modalFlag = false this.modalFlag = false
this.$message.success('操作成功') this.$message.success('操作成功')
@ -2965,6 +3008,46 @@ export default {
}) })
}).catch(() => {}) }).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) { selectionProofing(val) {
this.proofingSelections = val this.proofingSelections = val
@ -3689,22 +3772,34 @@ export default {
} }
}, },
updateModalStatus(row, status) { updateModalStatus(row, status) {
if (this.issuingSet[row.proofingNo]) return
this.$set(this.issuingSet, row.proofingNo, true)
this.$confirm(`是否确认下达?`, '提示', { this.$confirm(`是否确认下达?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(async () => { }).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 = { let params = {
configurationId: '*', configurationId: '*',
userName: this.$store.state.user.name, userName: this.$store.state.user.name,
partNo: row.finalPartNo, partNo: row.finalPartNo,
site: this.$store.state.user.site 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) { if (data && data.code === 0 && data.rows.length > 0) {
let unitPrice = +data.rows[0].inventoryValue let unitPrice = +data.rows[0].inventoryValue
row.proofingAmount = unitPrice * this.modalData.proofingNumber row.proofingAmount = unitPrice * this.modalData.proofingNumber
@ -3718,8 +3813,8 @@ export default {
limit: 5, limit: 5,
page: 1, 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 row.proofingAmount = data.page.list[0].estimatedMaterialCost * this.modalData.proofingNumber
} else { } else {
row.proofingAmount = 0 row.proofingAmount = 0
@ -3727,26 +3822,28 @@ export default {
} }
} }
let params = JSON.parse(JSON.stringify(row)) 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.userName = this.$store.state.user.name
params.menuId = this.$route.meta.menuId params.menuId = this.$route.meta.menuId
proofingInformationEditStatus(params).then(({data}) => {
const {data} = await proofingInformationEditStatus(params)
if (data && data.code === 0) { if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message.success('打样单已下达')
} else {
return true
}
if (showErrorAlert) {
this.$alert(data.msg, '错误', { this.$alert(data.msg, '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
} }
}).finally(() => {
this.$set(this.issuingSet, row.proofingNo, false)
})
}).catch(() => {
return false
} catch (error) {
if (showErrorAlert) {
this.$message.error(error.message || '下达失败')
}
return false
} finally {
this.$set(this.issuingSet, row.proofingNo, false) this.$set(this.issuingSet, row.proofingNo, false)
})
}
}, },
searchDelegateAccessByUser() { searchDelegateAccessByUser() {
// ROO7 // ROO7

Loading…
Cancel
Save