opt: 加急工单
This commit is contained in:
@@ -321,6 +321,18 @@
|
||||
>
|
||||
设置右卷
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
v-permission="['urgent']"
|
||||
class="filter-item"
|
||||
type="danger"
|
||||
icon="el-icon-warning-outline"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length < 1"
|
||||
@click="urgentPlan"
|
||||
>
|
||||
加急
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="1200px">
|
||||
@@ -488,7 +500,7 @@
|
||||
<el-table-column v-if="false" prop="workorder_id" label="分切计划标识" />
|
||||
<el-table-column prop="status" label="状态" :formatter="formatStatusName" />
|
||||
<el-table-column prop="order_type" label="订单类型" :formatter="formatTypeName" />
|
||||
<el-table-column prop="mfg_order_name" label="订单号" min-width="200" >
|
||||
<el-table-column prop="mfg_order_name" label="订单号" min-width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="primary" @click="toView2(scope.$index, scope.row)">{{ scope.row.mfg_order_name }}</el-link>
|
||||
</template>
|
||||
@@ -724,6 +736,68 @@ export default {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
},
|
||||
urgentPlan() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
const data = {
|
||||
'data': _selectData
|
||||
}
|
||||
crudSlittingproductionplan.urgentPlan(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
if (res.failInfo.length == 0) {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
} else {
|
||||
this.$notify({
|
||||
title: '操作结果',
|
||||
dangerouslyUseHTMLString: true,
|
||||
message: this.buildNotificationContent(res),
|
||||
duration: 0,
|
||||
offset: 50,
|
||||
customClass: 'custom-notify'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
buildNotificationContent(data) {
|
||||
console.log('通知数据:', data)
|
||||
|
||||
// 第一行:统计信息
|
||||
const stats = `<div>总数:${data.total},成功:${data.success},失败:${data.fail}</div>`
|
||||
|
||||
// 第二行:失败信息表格
|
||||
let tableHtml = ''
|
||||
|
||||
if (data.failInfo && Object.keys(data.failInfo).length > 0) {
|
||||
// 创建表头
|
||||
const headers = `<tr style="background-color: #f5f5f5;">
|
||||
<th style="padding: 5px; text-align: left;">卷号</th>
|
||||
<th style="padding: 5px; text-align: left;">信息</th>
|
||||
</tr>`
|
||||
|
||||
// 创建表格行
|
||||
const rows = Object.values(data.failInfo).flatMap(errorObj => {
|
||||
return Object.entries(errorObj).map(([volumeNo, errorMsg]) => {
|
||||
return `<tr>
|
||||
<td style="padding: 5px; border: 1px solid #ddd;">${volumeNo}</td>
|
||||
<td style="padding: 5px; border: 1px solid #ddd;">${errorMsg}</td>
|
||||
</tr>`
|
||||
})
|
||||
}).join('')
|
||||
|
||||
tableHtml = `
|
||||
<div style="margin-top: 10px;">
|
||||
<div>失败信息:</div>
|
||||
<table border="1" style="border-collapse: collapse; width: 100%; margin-top: 5px;">
|
||||
${headers}
|
||||
${rows}
|
||||
</table>
|
||||
</div>
|
||||
`
|
||||
} else {
|
||||
tableHtml = '<div style="margin-top: 10px;">无失败信息</div>'
|
||||
}
|
||||
|
||||
return `${stats}${tableHtml}`
|
||||
},
|
||||
inFinish() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
const data = {
|
||||
@@ -810,5 +884,4 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -71,6 +71,14 @@ export function setDirection(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function urgentPlan(data) {
|
||||
return request({
|
||||
url: 'api/slittingproductionplan/urgentPlan',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function updates(data) {
|
||||
return request({
|
||||
url: 'api/slittingproductionplan',
|
||||
@@ -79,4 +87,4 @@ export function updates(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, upMaterFinish, caseFinish, sendFinish, inFinish, compelFinish, setDirection, updates }
|
||||
export default { add, edit, del, upMaterFinish, caseFinish, sendFinish, inFinish, compelFinish, setDirection, updates, urgentPlan }
|
||||
|
||||
Reference in New Issue
Block a user