Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
常熟吴彦祖 2 weeks ago
parent
commit
ee999721e6
  1. 27
      src/views/modules/purchase/cancelReceipt.vue
  2. 10
      src/views/modules/warehouse/labelQuery.vue

27
src/views/modules/purchase/cancelReceipt.vue

@ -17,7 +17,7 @@
<el-table
:data="dataList"
border :height="height"
v-loading="dataListLoading"
v-loading="dataListLoading || cancelLoading"
@selection-change="selectionChangeHandle"
style="width: 100%; margin-bottom: 20px;">
<el-table-column
@ -180,7 +180,9 @@ export default {
{ required: true, message: this.$t('purchase.cancelReceipt.cancelReasonRequired'), trigger: 'blur' }
]
},
currentCancelRecords: []
currentCancelRecords: [],
// loadingkeycontract + receiptSequence
cancelingRecordKeys: []
}
},
mounted() {
@ -241,8 +243,17 @@ export default {
selectionChangeHandle (val) {
this.dataListSelections = val
},
getCancelRecordKey (record) {
return `${record.contract || ''}__${record.receiptSequence || ''}`
},
isRecordCanceling (record) {
return this.cancelingRecordKeys.includes(this.getCancelRecordKey(record))
},
//
cancelSingleReceipt (row) {
if (this.cancelLoading) {
return
}
const receiptNo = row.receiptNo || row.sourceRef1 || ''
//
this.$confirm(this.$t('purchase.cancelReceipt.confirmSingle', { receiptNo }), this.$t('purchase.cancelReceipt.confirmTitle'), {
@ -260,6 +271,9 @@ export default {
},
//
cancelSelectedReceipts () {
if (this.cancelLoading) {
return
}
if (this.dataListSelections.length === 0) {
this.$message.warning(this.$t('purchase.cancelReceipt.selectRecordsFirst'))
return
@ -282,7 +296,9 @@ export default {
//
confirmCancel () {
this.cancelLoading = true
const promises = this.currentCancelRecords.map(record => {
const cancelRecords = [...this.currentCancelRecords]
this.cancelingRecordKeys = cancelRecords.map(record => this.getCancelRecordKey(record))
const promises = cancelRecords.map(record => {
return cancelReceipt({
receiptSequence: record.receiptSequence,
site: record.contract,
@ -298,7 +314,7 @@ export default {
if (result.data && result.data.code === 0) {
successCount++
} else {
const record = this.currentCancelRecords[index]
const record = cancelRecords[index]
errorMessages.push(this.$t('purchase.cancelReceipt.cancelItemFailed', {
receiptNo: record.receiptNo || record.sourceRef1 || '',
reason: result.data.msg || this.$t('purchase.cancelReceipt.cancelFailed')
@ -316,10 +332,11 @@ export default {
}
this.cancelDialogVisible = false
this.cancelLoading = false
}).catch(() => {
this.$message.error(this.$t('purchase.cancelReceipt.cancelOperationFailed'))
}).finally(() => {
this.cancelLoading = false
this.cancelingRecordKeys = []
})
},
//

10
src/views/modules/warehouse/labelQuery.vue

@ -348,6 +348,16 @@ export default {
showOverflowTooltip: true,
fixed: ""
},
{
columnProp: "site",
headerAlign: "center",
align: "center",
columnLabel: this.$t('warehouse.pallet.factory'),
columnWidth: 110,
columnSortable: false,
showOverflowTooltip: true,
fixed: ""
},
{
columnProp: "partNo",
headerAlign: "center",

Loading…
Cancel
Save