Browse Source

2026-03-30

标签变动记录增加【异常关闭】功能
master
fengyuan_yang 3 weeks ago
parent
commit
bcf3c4ae23
  1. 11
      src/api/warehouse/labelTransactionLog.js
  2. 70
      src/views/modules/warehouse/labelTransactionLog.vue

11
src/api/warehouse/labelTransactionLog.js

@ -34,3 +34,14 @@ export function labelTransactionLogRetry(data) {
}) })
} }
/**
* 批量异常关闭
*/
export function labelTransactionLogClose(data) {
return http({
url: http.adornUrl('/warehouse/labelTransactionLog/close'),
method: 'post',
data: http.adornData(data)
})
}

70
src/views/modules/warehouse/labelTransactionLog.vue

@ -176,6 +176,13 @@
@click="exceptionRetryHandle"> @click="exceptionRetryHandle">
异常重试 异常重试
</el-button> </el-button>
<el-button
v-if="isAuth('105006:exceptionClose')"
type="info"
icon="el-icon-circle-close"
@click="exceptionCloseHandle">
异常关闭
</el-button>
<el-button <el-button
icon="el-icon-download" icon="el-icon-download"
@click="exportData"> @click="exportData">
@ -262,7 +269,7 @@
</template> </template>
<script> <script>
import { labelTransactionLogList, labelTransactionLogRetry } from '@/api/warehouse/labelTransactionLog.js'
import { labelTransactionLogList, labelTransactionLogRetry, labelTransactionLogClose } from '@/api/warehouse/labelTransactionLog.js'
import { getSiteAndBuByUserName2 } from '@/api/qc/qc.js' import { getSiteAndBuByUserName2 } from '@/api/qc/qc.js'
import { getWarehouseList } from '@/api/wms/wms.js' import { getWarehouseList } from '@/api/wms/wms.js'
import excel from '@/utils/excel-util.js' // import excel from '@/utils/excel-util.js' //
@ -612,6 +619,67 @@ export default {
}).catch(() => {}) }).catch(() => {})
}, },
//
exceptionCloseHandle() {
if (this.dataListSelections.length === 0) {
this.$message.warning('请选择要关闭的记录!')
return
}
const count = this.dataListSelections.length
this.$confirm(`确定要异常关闭选中的 ${count} 条记录吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: `正在关闭 ${count} 条记录,请稍候...`,
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
//
const closeList = this.dataListSelections.map(item => ({
site: item.site,
buNo: item.buNo,
transactionId: item.transactionId
}))
//
labelTransactionLogClose({ closeList }).then(({ data }) => {
loading.close()
if (data && data.code === 0) {
const result = data.result || {}
const successCount = result.successCount || 0
const failureCount = result.failureCount || 0
let message = `关闭完成!成功:${successCount},失败:${failureCount}`
if (successCount === count) {
this.$message.success(message)
} else if (successCount > 0) {
this.$message.warning(message)
} else {
this.$message.error(message)
}
//
if (result.details && result.details.length > 0) {
this.showRetryResultDialog(result.details)
}
//
this.getDataList()
} else {
this.$message.error(data.msg || '关闭失败')
}
}).catch(error => {
loading.close()
this.$message.error('关闭失败:' + (error.message || '网络错误'))
})
}).catch(() => {})
},
// //
batchRetryHandle() { batchRetryHandle() {
if (this.dataListSelections.length === 0) { if (this.dataListSelections.length === 0) {

Loading…
Cancel
Save