326 lines
7.0 KiB
Vue
326 lines
7.0 KiB
Vue
<template>
|
|
<fvSearchForm :searchConfig="searchConfig" @search="search">
|
|
</fvSearchForm>
|
|
<fvTable ref="tableIns" :tableConfig="tableConfig" :data="mockData" @headBtnClick="headBtnClick"></fvTable>
|
|
<WorkDialog ref="workDialogRef" :rowData="rowData" />
|
|
</template>
|
|
|
|
<script setup lang="jsx">
|
|
import { isShallow, reactive, shallowRef } from 'vue';
|
|
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
|
import WorkDialog from '../components/WorkDialog.vue';
|
|
import { orderdDetele, orderdClose, orderAdd } from "@/api/order/order.js"
|
|
|
|
const rowData = ref()
|
|
const isShow = ref(false)
|
|
const workDialogRef = ref()
|
|
const router = useRouter()
|
|
const tableIns = ref()
|
|
//todo 外部模拟数据, 接口一出来, 直接在下方 tableConfig 的api处填写就行
|
|
const mockData = ref([
|
|
{
|
|
workOrderNumber: 1211,
|
|
workOrderTime: '2022-02-09 00 : 12',
|
|
state: 0,
|
|
callState: 0
|
|
},
|
|
{
|
|
workOrderNumber: 232,
|
|
state: 1,
|
|
callState: 1
|
|
}
|
|
])
|
|
const auths = reactive({
|
|
report: ['mosr:collect:reported'],
|
|
})
|
|
const searchConfig = reactive([
|
|
{
|
|
label: '工单号',
|
|
prop: 'orderNumber',
|
|
props: {
|
|
placeholder: '请输入工单号查询',
|
|
clearable: true,
|
|
checkStrictly: true
|
|
},
|
|
component: 'el-input',
|
|
}, {
|
|
label: '工单名称',
|
|
prop: 'orderName',
|
|
props: {
|
|
placeholder: '请输入工单名查询',
|
|
clearable: true,
|
|
checkStrictly: true
|
|
},
|
|
component: 'el-input',
|
|
}, {
|
|
label: '工单状态',
|
|
prop: 'orderState',
|
|
props: {
|
|
placeholder: '请选择工单状态查询',
|
|
cacheKey: 'work_order_status',
|
|
clearable: true,
|
|
filterable: true,
|
|
},
|
|
component: shallowRef(fvSelect),
|
|
}, {
|
|
label: '处理人',
|
|
prop: 'operationUser',
|
|
props: {
|
|
placeholder: '请输入处理人查询',
|
|
clearable: true,
|
|
checkStrictly: true
|
|
},
|
|
component: 'el-input',
|
|
}, {
|
|
label: '关单人',
|
|
prop: 'knotter',
|
|
props: {
|
|
placeholder: '请输入关单人查询',
|
|
clearable: true,
|
|
checkStrictly: true
|
|
},
|
|
component: 'el-input',
|
|
},
|
|
{
|
|
label: '创建日期',
|
|
prop: 'createTime',
|
|
props: {
|
|
placeholder: '请选择',
|
|
clearable: true,
|
|
checkStrictly: true
|
|
},
|
|
component: 'el-date-picker',
|
|
}, {
|
|
label: '处理时间',
|
|
prop: 'te',
|
|
props: {
|
|
placeholder: '请选择',
|
|
clearable: true,
|
|
checkStrictly: true
|
|
},
|
|
component: 'el-date-picker',
|
|
}, {
|
|
label: '完成时间',
|
|
prop: 'completionTime',
|
|
props: {
|
|
placeholder: '请选择',
|
|
clearable: true,
|
|
checkStrictly: true
|
|
},
|
|
component: 'el-date-picker',
|
|
}
|
|
])
|
|
|
|
const tableConfig = reactive({
|
|
columns: [
|
|
{
|
|
prop: 'index',
|
|
type: 'index',
|
|
label: '序号',
|
|
align: 'center',
|
|
width: 80,
|
|
},
|
|
{
|
|
prop: 'orderNumber',
|
|
label: '工单号',
|
|
align: 'center',
|
|
width: 200
|
|
},
|
|
{
|
|
prop: 'orderName',
|
|
label: '工单名称',
|
|
align: 'center',
|
|
width: 200
|
|
},
|
|
{
|
|
prop: 'orderContent',
|
|
label: '工单内容',
|
|
align: 'center',
|
|
width: 200
|
|
},
|
|
{
|
|
prop: 'orderState',
|
|
label: '工单状态',
|
|
align: 'center',
|
|
showOverflowTooltip: false,
|
|
currentRender: ({ row, index }) => {
|
|
if (row.orderState !== null) {
|
|
return (<Tag dictType={'work_order_status'} value={row.orderState} />)
|
|
} else {
|
|
return '--'
|
|
}
|
|
}
|
|
},
|
|
{
|
|
prop: 'callState',
|
|
label: '电话拨打状态',
|
|
align: 'center',
|
|
width: 150,
|
|
showOverflowTooltip: false,
|
|
currentRender: ({ row, index }) => {
|
|
if (row.callState !== null) {
|
|
return (<Tag dictType={'call_status'} value={row.callState} />)
|
|
} else {
|
|
return '--'
|
|
}
|
|
}
|
|
},
|
|
{
|
|
prop: 'operationUser',
|
|
label: '处理人',
|
|
align: 'center'
|
|
},
|
|
|
|
{
|
|
prop: 'processedContent',
|
|
label: '处理内容',
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'createTime',
|
|
label: '创建时间',
|
|
align: 'center',
|
|
width: 200
|
|
},
|
|
{
|
|
prop: 'processedTime',
|
|
label: '处理时间',
|
|
align: 'center',
|
|
width: 200
|
|
},
|
|
{
|
|
prop: 'completionTime',
|
|
label: '完成时间',
|
|
align: 'center',
|
|
width: 200
|
|
},
|
|
{
|
|
prop: 'knotter',
|
|
label: '关单人',
|
|
align: 'center'
|
|
},
|
|
{
|
|
prop: 'oper',
|
|
label: '操作',
|
|
align: 'center',
|
|
fixed: 'right',
|
|
width: 150,
|
|
showOverflowTooltip: false,
|
|
currentRender: ({ row, index }) => {
|
|
// console.log(row);
|
|
|
|
let btn = []
|
|
btn.push({ label: '详情', prem: auths.detail, func: () => handleDetail(row), type: 'primary' })
|
|
btn.push({ label: '关单', prem: auths.detail, func: () => handleClose(row), type: 'primary' })
|
|
btn.push({ label: '删除', prem: auths.detail, func: () => handleDelete(row), type: 'primary' })
|
|
return (
|
|
<div style={{ width: '100%' }}>
|
|
{
|
|
btn.map(item => (
|
|
<el-button
|
|
type={item.type}
|
|
// v-perm={item.prem}
|
|
onClick={() => item.func()}
|
|
link
|
|
>
|
|
{item.label}
|
|
</el-button>
|
|
))
|
|
}
|
|
</div>
|
|
)
|
|
}
|
|
}
|
|
],
|
|
api: '/order/list',
|
|
params: {orderState:"2"},
|
|
btns: [
|
|
// {name: '新增', key: 'add', color: '#DED0B2', auth: auths.report},
|
|
]
|
|
})
|
|
|
|
const search = (val) => {
|
|
let obj = {...val}
|
|
if (obj.dateValue) {
|
|
obj.startTime = obj.dateValue[0]
|
|
obj.endTime = obj.dateValue[1]
|
|
delete obj.dateValue
|
|
}
|
|
tableConfig.params = obj
|
|
tableIns.value.refresh()
|
|
}
|
|
const headBtnClick = (key) => {
|
|
// console.log(key);
|
|
|
|
switch (key) {
|
|
case 'add':
|
|
handleAdd()
|
|
break;
|
|
}
|
|
}
|
|
|
|
const handleDetail = (row) => {
|
|
workDialogRef.value.open(row)
|
|
rowData.value = row
|
|
}
|
|
|
|
const handleClose = async (row) => {
|
|
// console.log(row.orderNumber);
|
|
|
|
ElMessageBox.confirm(
|
|
'确定要关单吗?',
|
|
'温馨提示',
|
|
{
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning',
|
|
}
|
|
)
|
|
.then(async () => {
|
|
await orderdClose(row.orderNumber)
|
|
tableIns.value.refresh()
|
|
ElMessage({
|
|
type: 'success',
|
|
message: '关闭成功',
|
|
})
|
|
})
|
|
.catch(() => {
|
|
// tableIns.value.refresh()
|
|
ElMessage({
|
|
type: 'info',
|
|
message: '关闭失败',
|
|
})
|
|
})
|
|
}
|
|
|
|
const handleDelete = async (row) => {
|
|
|
|
ElMessageBox.confirm(
|
|
'确定要删除吗?',
|
|
'温馨提示',
|
|
{
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning',
|
|
}
|
|
)
|
|
.then(async () => {
|
|
await orderdDetele(row.orderNumber)
|
|
tableIns.value.refresh()
|
|
ElMessage({
|
|
type: 'success',
|
|
message: '删除成功',
|
|
})
|
|
})
|
|
.catch(() => {
|
|
// tableIns.value.refresh()
|
|
ElMessage({
|
|
type: 'info',
|
|
message: '删除失败',
|
|
})
|
|
})
|
|
}
|
|
</script>
|
|
|
|
<style scoped></style>
|