订单管理

This commit is contained in:
2024-02-06 14:11:35 +08:00
parent 0a91161afe
commit 2ee2b2bfc7
11 changed files with 1643 additions and 288 deletions

View File

@@ -17,7 +17,7 @@
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="240"
:width="290"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
@@ -56,7 +56,7 @@
</template>
<script>
import { parseTime } from '@/utils/ruoyi'
import { getOrderPage, orderDelete, customerList, orderFinish } from '@/api/base/orderManage'
import { getOrderPage, orderStatusSet, customerList, orderFinish } from '@/api/base/orderManage'
import OrderAdd from './components/orderAdd'
import AddWorkOrder from './components/addWorkOrder'
import { publicFormatter } from '@/utils/dict'
@@ -187,7 +187,7 @@ export default {
},
total: 0,
tableProps,
list: [],
list: [{name: '111111'}],
tableH: this.tableHeight(260),
tableBtn: [
this.$auth.hasPermi('base:order-manage:addWorkOrder')
@@ -195,26 +195,26 @@ 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: 'equal',
// name: 'status',
// value: 1
// },
// {
// type: 'equal',
// name: 'status',
// value: 2
// },
// {
// type: 'equal',
// name: 'status',
// value: 3
// }
// ]
// }
}
: undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
@@ -222,26 +222,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: 'equal',
// name: 'status',
// value: 1
// },
// {
// type: 'equal',
// name: 'status',
// value: 2
// },
// {
// type: 'equal',
// name: 'status',
// value: 3
// }
// ]
// }
}
: undefined,
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
@@ -266,6 +266,18 @@ export default {
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:detail')
? {
type: 'termination',
btnName: '终止'
}
: undefined,
this.$auth.hasPermi('base:order-manage:detail')
? {
type: 'cancel',
btnName: '作废'
}
: undefined,
this.$auth.hasPermi('base:order-manage:detail')
? {
type: 'detail',
@@ -292,27 +304,6 @@ export default {
]
}
}
: undefined,
this.$auth.hasPermi('base:order-manage:delete')
? {
type: 'delete',
btnName: '删除',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'triggerOrigin',
value: 1
},
{
type: 'equal',
name: 'status',
value: 1
}
]
}
}
: undefined
].filter((v) => v),
addOrEditTitle: '',
@@ -328,7 +319,7 @@ export default {
window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260)
})
this.getList()
// this.getList()
},
methods: {
getList() {
@@ -385,8 +376,11 @@ export default {
this.$refs.orderAdd.init(val.data.id)
})
break
case 'delete':
this.handleDelete(val.data)
case 'cancel':
this.handleEditStatus(val.data, '作废', '6')
break
case 'termination':
this.handleEditStatus(val.data, '终止', '5')
break
case 'detail':
this.$router.push({path: '/order/base/order-manage/order-detail-data?orderId='+ val.data.id})
@@ -406,24 +400,15 @@ export default {
})
break
case 'complete':
this.handleComplete(val.data)
this.handleEditStatus(val.data, '完成', '4')
break
default:
}
},
// 删除
handleDelete(val) {
this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
return orderDelete({ id: val.id })
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");
}).catch(() => {});
},
// 完成
handleComplete(val) {
this.$modal.confirm('是否确认完成订单"' + val.name + '"?').then(function() {
return orderFinish({ id: val.id })
// 完成,终止,作废
handleEditStatus(val, tip, status) {
this.$modal.confirm('是否确认'+tip+'"' + val.name + '"?').then(function() {
return orderStatusSet({ id: val.id })
}).then(() => {
this.getList();
this.$modal.msgSuccess("操作成功");