订单管理

This commit is contained in:
2024-02-23 17:01:48 +08:00
parent 2ee2b2bfc7
commit 71fc98b0bb
14 changed files with 786 additions and 862 deletions

View File

@@ -70,17 +70,13 @@ const tableProps = [
{
prop: 'name',
label: '订单名称',
minWidth: 120,
minWidth: 140,
showOverflowtooltip: true
},
{
prop: 'code',
label: '订单编码',
minWidth: 180
},
{
prop: 'customerId',
label: '客户',
minWidth: 150,
showOverflowtooltip: true
},
{
@@ -111,6 +107,7 @@ const tableProps = [
{
prop: 'productName',
label: '产品',
width: 200,
showOverflowtooltip: true
},
{
@@ -187,7 +184,7 @@ export default {
},
total: 0,
tableProps,
list: [{name: '111111'}],
list: [],
tableH: this.tableHeight(260),
tableBtn: [
this.$auth.hasPermi('base:order-manage:addWorkOrder')
@@ -195,26 +192,16 @@ export default {
type: 'add',
btnName: '新增',
showTip: '新增工单',
// showParam: {
// type: '|',
// data: [
// {
// type: 'equal',
// name: 'status',
// value: 1
// },
// {
// type: 'equal',
// name: 'status',
// value: 2
// },
// {
// type: 'equal',
// name: 'status',
// value: 3
// }
// ]
// }
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
@@ -222,41 +209,26 @@ export default {
type: 'bind',
btnName: '绑定',
showTip: '绑定工单',
// showParam: {
// type: '|',
// data: [
// {
// type: 'equal',
// name: 'status',
// value: 1
// },
// {
// type: 'equal',
// name: 'status',
// value: 2
// },
// {
// type: 'equal',
// name: 'status',
// value: 3
// }
// ]
// }
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
this.$auth.hasPermi('base:order-manage:complete')
? {
type: 'complete',
btnName: '完成',
showTip: '完成订单',
showParam: {
type: '|',
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 2
},
{
type: 'equal',
name: 'status',
@@ -266,16 +238,43 @@ export default {
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:detail')
this.$auth.hasPermi('base:order-manage:termination')
? {
type: 'termination',
btnName: '终止'
btnName: '终止',
showTip: '终止',
showParam: {
type: '|',
data: [
{
type: 'equal',
name: 'status',
value: 2
},
{
type: 'equal',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:detail')
this.$auth.hasPermi('base:order-manage:cancel')
? {
type: 'cancel',
btnName: '作废'
btnName: '作废',
showTip: '作废',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 2
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:detail')
@@ -292,14 +291,9 @@ export default {
type: '&',
data: [
{
type: 'equal',
name: 'triggerOrigin',
value: 1
},
{
type: 'equal',
type: 'less',
name: 'status',
value: 1
value: 3
}
]
}
@@ -319,7 +313,7 @@ export default {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
// this.getList()
this.getList()
},
methods: {
getList() {
@@ -336,7 +330,7 @@ export default {
item.customerId = i.name
}
}
item.price = item.price.toFixed(2)
item.price = item.price ? item.price.toFixed(2) : '0.00'
})
this.list = arr
}
@@ -407,12 +401,38 @@ export default {
},
// 完成,终止,作废
handleEditStatus(val, tip, status) {
this.$modal.confirm('是否确认'+tip+'"' + val.name + '"?').then(function() {
return orderStatusSet({ id: val.id })
console.log(val)
if (val.workOrderNum > 0) {//有下级工单
this.$confirm('是否将"'+tip+'"操作同步至下级工单?','确认信息', {
type: 'warning',
distinguishCancelAndClose: true,
confirmButtonText: '同步',
cancelButtonText: '不同步'
}).then(function() {
console.log('同步')
orderStatusSet({ id: val.id, status: status, isSync: true}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
})
}).catch(action => {
if (action === 'cancel') {
console.log('不同步')
orderStatusSet({ id: val.id, status: status, isSync: false}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
})
}else {
return console.log('关闭')
}
})
}else{// 无下级工单
this.$modal.confirm('是否确认"'+tip+'"厂务订单名称为"' + val.name + '"的数据项?').then(function() {
return orderStatusSet({ id: val.id, status: status})
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
}
},
// 新增
handleCancel() {