diff --git a/src/views/task-management/components/WorkDialog.vue b/src/views/task-management/components/WorkDialog.vue index 1d7059e..9584a3e 100644 --- a/src/views/task-management/components/WorkDialog.vue +++ b/src/views/task-management/components/WorkDialog.vue @@ -13,9 +13,13 @@ const dialogVisible = ref(false); const props = defineProps({ rowData: Object }) -let opsCallList = ref([]); -// let mergedData = ref([]); +const rowData=props.rowData +console.log(rowData); + +let opsCallList = ref([]); +let orderData = ref([]); +let orderContent = ref([]); const open = (row) => { dialogVisible.value = true; }; @@ -29,59 +33,10 @@ const getData = async () => { } -watch(() => props.rowData, (newRowData) => { - if (newRowData) { - // console.log(getData(newRowData)); - getData(newRowData).then((data) => { - const dataDetails = data.data.opsCallList - // console.log(dataDetails); - const theData=[{createTime:'',data:[]}] - - dataDetails.forEach(for1data => { - theData.forEach(for2data => { - if(for1data.createTime!==for2data.createTime){ - console.log(for2data); - for2data.createTime=for1data.createTime - // for2data.data.push(for1data) - theData.push({createTime:for1data.createTime,data:[]}) - }else{ - for2data.data.push(for1data) - return; - } - }) - }); - theData.pop() - // console.log(theData); - theData.forEach(item => { - opsCallList.value.push(item) - }) - console.log(opsCallList.value); - - - // dataDetails.forEach(item => { - // // console.log(item); - // opsCallList.value.push(item) - // }); - - // console.log(mergedData.value); - - }) - } -}, { - immediate: true // 立即执行一次,以便在rowData初始值非空时也能触发 -}); -// getData() -function omitCreateTime(item) { - const { createTime, ...rest } = item; - return rest; -} - - - -const test = [ +let content = [ { content: "待处理", - timestamp: "2022-07-20 20:00", + timestamp: "orderData.value", color: "#0bbd87", }, { @@ -98,6 +53,67 @@ const test = [ }, ]; +watch(() => props.rowData, (newRowData) => { + if (newRowData) { + // console.log(getData(newRowData)); + getData(newRowData).then((data) => { + orderData.value = data.data + //电话拨打记录 + const dataDetails = data.data.opsCallList + // console.log(dataDetails); + const theData = [{ createTime: '', data: [] }] + + dataDetails.forEach(for1data => { + theData.forEach(for2data => { + if (for1data.createTime !== for2data.createTime) { + // console.log(for2data); + for2data.createTime = for1data.createTime + // for2data.data.push(for1data) + theData.push({ createTime: for1data.createTime, data: [] }) + } else { + for2data.data.push(for1data) + return; + } + }) + }); + theData.pop() + // console.log(theData); + theData.forEach(item => { + opsCallList.value.push(item) + }) + //工单时间线 + console.log(orderData.value); + content.map((item, index) => { + if (index === 0) { + item.timestamp = orderData.value.operationTime || '--' + } else if (index === 1) { + item.timestamp = orderData.value.processedTime || '--' + + } else { + item.timestamp = orderData.value.completionTime || '--' + + } + + }) + content.forEach(item => { + // if (orderContent.value.length < 1) { + orderContent.value.push(item) + // }else{ + // orderContent.value.pop() + // } + + }) + + console.log(orderContent.value); + + }) + } +}, { + immediate: true // 立即执行一次,以便在rowData初始值非空时也能触发 +}); +// getData() + + const test2 = [ { @@ -145,9 +161,9 @@ defineExpose({
- +

{{ activity.content }}

diff --git a/src/views/task-management/historical-work-order/index.vue b/src/views/task-management/historical-work-order/index.vue index 55a0c0d..5f592b9 100644 --- a/src/views/task-management/historical-work-order/index.vue +++ b/src/views/task-management/historical-work-order/index.vue @@ -233,7 +233,7 @@ const tableConfig = reactive({ } ], api: '/order/list', - params: {state:"1",name:"已处理"}, + params: {orderState:"2"}, btns: [ // {name: '新增', key: 'add', color: '#DED0B2', auth: auths.report}, ] diff --git a/src/views/task-management/pending-work-order/index.vue b/src/views/task-management/pending-work-order/index.vue index 549fc6c..4f559c0 100644 --- a/src/views/task-management/pending-work-order/index.vue +++ b/src/views/task-management/pending-work-order/index.vue @@ -233,7 +233,7 @@ const tableConfig = reactive({ } ], api: '/order/list', - params: {state:"0",name:"待处理"}, + params: {orderState:"0"}, btns: [ // {name: '新增', key: 'add', color: '#DED0B2', auth: auths.report}, ]