订单管理

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

@@ -43,21 +43,21 @@
<!-- 查看详情 -->
<!-- 新增工单 -->
<base-dialog
:dialogTitle="workIssueTitle"
:dialogVisible="addWorkOrdervisible"
@cancel="addWorkOrderCancel"
@confirm="addWorkOrderConfirm"
:before-close="addWorkOrderCancel"
width='70%'
dialogTitle="绑定厂务订单"
:dialogVisible="bindOrderVisible"
@cancel="bindOrderCancel"
@confirm="bindOrderConfirm"
:before-close="bindOrderCancel"
width='60%'
>
<add-work-order ref="bindOrder" @addWorkOrderSubmit="addWorkOrderSubmit" />
<bind-order ref="bindOrder" @bindOrderSubmit="bindOrderSubmit" />
</base-dialog>
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import { getOrderGroupPage, groupOrderStatusSet } from '@/api/base/orderGroup'
import { orderDelete, customerList, orderFinish } from '@/api/base/orderManage'
import { customerList } from '@/api/base/orderManage'
import OrderGroupAdd from './components/orderGroupAdd'
import BindOrder from './components/bindOrder'
import { publicFormatter } from '@/utils/dict'
@@ -71,13 +71,13 @@ const tableProps = [
{
prop: 'name',
label: '订单名称',
minWidth: 120,
minWidth: 140,
showOverflowtooltip: true
},
{
prop: 'code',
label: '订单编码',
minWidth: 180
minWidth: 150
},
{
prop: 'customerId',
@@ -88,9 +88,17 @@ const tableProps = [
prop: 'status',
label: '订单状态',
filter: publicFormatter('order_status')
},{
},
{
prop: 'productName',
label: '产品名称',
minWidth: 200,
showOverflowtooltip: true
},
{
prop: 'specifications',
label: '产品规格',
minWidth: 120,
showOverflowtooltip: true
},
{
@@ -109,14 +117,16 @@ const tableProps = [
width: 100
},
{
prop: 'finishProduceTime',
prop: 'deliveTime',
label: '交货时间',
filter: parseTime,
minWidth: 160
},
{
prop: 'productName2',
prop: 'packReq',
label: '包装要求',
filter: publicFormatter('pack_spec'),
minWidth: 120,
showOverflowtooltip: true
},
{
@@ -163,10 +173,10 @@ export default {
color: 'primary'
},
{
type: this.$auth.hasPermi('base:order-manage:create') ? 'separate' : '',
type: this.$auth.hasPermi('base:order-group:create') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '',
type: this.$auth.hasPermi('base:order-group:create') ? 'button' : '',
btnName: '新增',
name: 'add',
color: 'success',
@@ -179,131 +189,104 @@ export default {
pageSize: 20,
name: null,
status: null,
lastIssuedTime: []
planFinishTime: []
},
total: 0,
tableProps,
list: [],
tableH: this.tableHeight(260),
tableBtn: [
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
this.$auth.hasPermi('base:order-group:bind')
? {
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
// }
// ]
// }
showTip: '厂务订单',
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
this.$auth.hasPermi('base:order-group:complete')
? {
type: 'complete',
btnName: '完成',
showTip: '完成订单',
// showParam: {
// type: '|',
// data: [
// {
// type: 'equal',
// name: 'status',
// value: 2
// },
// {
// type: 'equal',
// name: 'status',
// value: 3
// }
// ]
// }
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
this.$auth.hasPermi('base:order-group:termination')
? {
type: 'termination',
btnName: '终止',
showTip: '终止',
// showParam: {
// type: '|',
// data: [
// {
// type: 'equal',
// name: 'status',
// value: 2
// },
// {
// type: 'equal',
// name: 'status',
// value: 3
// }
// ]
// }
showParam: {
type: '|',
data: [
{
type: 'equal',
name: 'status',
value: 2
},
{
type: 'equal',
name: 'status',
value: 3
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
this.$auth.hasPermi('base:order-group:cancel')
? {
type: 'cancel',
btnName: '作废',
showTip: '作废',
// showParam: {
// type: '|',
// data: [
// {
// type: 'equal',
// name: 'status',
// value: 2
// },
// {
// type: 'equal',
// name: 'status',
// value: 3
// }
// ]
// }
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 2
}
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:detail')
? {
type: 'detail',
btnName: '详情'
}
: undefined,
this.$auth.hasPermi('base:order-manage:edit')
{
type: 'detail',
btnName: '详情'
},
this.$auth.hasPermi('base:order-group:edit')
? {
type: 'edit',
btnName: '编辑',
// showParam: {
// type: '&',
// data: [
// {
// type: 'equal',
// name: 'triggerOrigin',
// value: 1
// },
// {
// type: 'equal',
// name: 'status',
// value: 1
// }
// ]
// }
showParam: {
type: '&',
data: [
{
type: 'less',
name: 'status',
value: 3
}
]
}
}
: undefined
].filter((v) => v),
@@ -311,7 +294,7 @@ export default {
centervisible: false,
priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
workIssueTitle: '',
addWorkOrdervisible: false,
bindOrderVisible: false,
orderDetailVisible: false
}
},
@@ -325,7 +308,7 @@ export default {
methods: {
getList() {
getOrderGroupPage({...this.queryParams}).then(res => {
let arr = res.data.list || []
let arr = res.data.records || []
this.total = res.data.total || 0
if (arr.length > 0) {
customerList().then(result => {
@@ -337,7 +320,6 @@ export default {
item.customerId = i.name
}
}
item.price = item.price?.toFixed(2)
})
this.list = arr
}
@@ -353,10 +335,10 @@ export default {
this.queryParams.name = val.name
this.queryParams.status = val.status
if (val.timeVal && val.timeVal.length > 0) {
this.queryParams.lastIssuedTime[0] = val.timeVal[0] + ' 00:00:00'
this.queryParams.lastIssuedTime[1] = val.timeVal[1] + ' 23:59:59'
this.queryParams.planFinishTime[0] = val.timeVal[0] + ' 00:00:00'
this.queryParams.planFinishTime[1] = val.timeVal[1] + ' 23:59:59'
} else {
this.queryParams.lastIssuedTime = []
this.queryParams.planFinishTime = []
}
this.getList()
} else {
@@ -388,9 +370,9 @@ export default {
break
case 'bind':
this.workIssueTitle = '绑定工单'
this.addWorkOrdervisible = true
this.bindOrderVisible = true
this.$nextTick(() => {
this.$refs.bindOrder.init(val.data, 'bind')
this.$refs.bindOrder.init(val.data)
})
break
case 'complete':
@@ -401,12 +383,38 @@ export default {
},
// 完成,终止,作废
handleEditStatus(val, tip, status) {
this.$modal.confirm('是否确认'+tip+'"' + val.name + '"?').then(function() {
console.log(val)
if (val.orderIdNum > 0) {// 有下级订单
this.$confirm('是否将"'+tip+'"操作同步至下级订单和工单?','确认信息', {
type: 'warning',
distinguishCancelAndClose: true,
confirmButtonText: '同步',
cancelButtonText: '不同步'
}).then(function() {
console.log('同步')
groupOrderStatusSet({ id: val.id, status: status, isSync: true}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
})
}).catch(action => {
if (action === 'cancel') {
console.log('不同步')
groupOrderStatusSet({ 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 groupOrderStatusSet({ id: val.id, status: status})
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
}
},
handleCancel() {
this.$refs.orderGroupAdd.formClear()
@@ -421,15 +429,15 @@ export default {
this.getList()
},
// 下发新增
addWorkOrderCancel() {
bindOrderCancel() {
this.$refs.bindOrder.formClear()
this.addWorkOrdervisible = false
this.bindOrderVisible = false
},
addWorkOrderConfirm() {
this.$refs.bindOrder.addWorkOrderSubmit()
bindOrderConfirm() {
this.$refs.bindOrder.bindOrderSubmit()
},
addWorkOrderSubmit() {
this.addWorkOrderCancel()
bindOrderSubmit() {
this.bindOrderCancel()
this.getList()
}
}