tangning 2 vuotta sitten
vanhempi
commit
7768d0b65b
2 muutettua tiedostoa jossa 175 lisäystä ja 101 poistoa
  1. 1 2
      src/views/work/detail.vue
  2. 174 99
      src/views/work/query.vue

+ 1 - 2
src/views/work/detail.vue

@@ -156,8 +156,7 @@
             >
             <DescriptionsItem label="收件信息" :span="2" v-if="detailData.customerAddress">
               {{ detailData.customerAddress.getAddrName }}
-              {{ detailData.customerAddress.getAddrName
-              }}{{ detailData.customerAddress.getAddress }}
+              {{ detailData.customerAddress.getAddress }}
             </DescriptionsItem>
           </Descriptions>
           <!-- <Descriptions title="单据下载" :column="3">

+ 174 - 99
src/views/work/query.vue

@@ -17,7 +17,21 @@
       </a-tabs></template
     >
     <div class="desc-wrap-BasicTable">
-    <BasicTable @register="registerTable">
+    <BasicTable @register="registerTable" v-show="tableType == null">
+      <template #action="{ record }">
+        <TableAction
+          stopButtonPropagation
+          :actions="[
+            {
+              label: '详情',
+              //ifShow:getCheckPerm('work_detail'),
+              onClick: handleDetail.bind(null, record),
+            },
+          ]"
+        />
+      </template>
+    </BasicTable>
+    <BasicTable @register="registerTable1" v-show="tableType != null">
       <template #action="{ record }">
         <TableAction
           stopButtonPropagation
@@ -75,101 +89,9 @@ export default defineComponent({
     onMounted(() => {
       // console.log(router.currentRoute.value.params.id);
     });
-    const columns: BasicColumn[] = [
-      {
-        title: '报修日期',
-        dataIndex: 'createTime',
-        width: 180,
-      },
-      {
-        title: '客户名称',
-        dataIndex: 'customerName',
-        width: 80,
-        // customRender: ({ record }) => {
-        //   return t(`routes.equity.operation.${record.operationType || 0}`);
-        // },
-      },
-      {
-        title: '产品类型',
-        dataIndex: 'cameraType',
-        width: 80,
-        customRender: ({ record }) => {
-          return t(`routes.scene.tableType.${record.cameraType || 0}`);
-        },
-      },
-      {
-        title: '产品SN码',
-        dataIndex: 'cameraSnCode',
-        width: 100,
-      },
-      {
-        title: '报修方式',
-        dataIndex: 'receiverType',
-        width: 100,
-        customRender: ({ record }) => {
-          return record.receiverType == 0 ? '系统录单' : '公众号报修';
-        },
-      },
-      {
-        title: '保修类型',
-        dataIndex: 'warrantyType',
-        width: 100,
-        customRender: ({ record }) => {
-          return record.warrantyType == 0 ? '保修期内' : record.warrantyType == 1 ? '保修期外' : '非保修项目';
-        },
-      },{
-        title: '售后工程师',
-        dataIndex: 'saleName',
-        width: 100,
-      },{
-        title: '接单日期',
-        dataIndex: 'orderReceivingTime',
-        width: 150,
-      },
-      {
-        title: '故障分析',
-        dataIndex: 'checkResult',
-        width: 100,
-      },
-      {
-        title: '维修工程师',
-        dataIndex: 'repairManName',
-        width: 100,
-      },{
-        title: '维修完成日期',
-        dataIndex: 'repairOverTime',
-        width: 150,
-      },
-      {
-        title: '状态',
-        dataIndex: 'status',
-        width: 100,
-        customRender: ({ record }) => {
-          return t(`routes.spares.tableType.${record.status || 0}`);
-        },
-      },
-      {
-        title: '维修单号',
-        dataIndex: 'repairId',
-        width: 180,
-      },
-      {
-        title: t('common.operating'),
-        dataIndex: 'action',
-        slots: { customRender: 'action' },
-        ifShow: true,
-        fixed: 'right',
-        flag: 'ACTION',
-        width: 120,
-      },
-    ];
-    const searchForm: Partial<FormProps> = {
-      labelWidth: 120,
-      autoAdvancedLine: 1,
-      actionColOptions: {
-        span: 24,
-      },
-      schemas: [
+    
+    const getSchemas = (status) => {
+      return  [
         {
           field: 'receiverType',
           component: 'Select',
@@ -307,6 +229,7 @@ export default defineComponent({
           field: 'status',
           component: 'Select',
           label: '工单状态',
+          ifShow: Boolean(status),
           colProps: {
             span: 7,
           },
@@ -364,8 +287,9 @@ export default defineComponent({
             ],
           },
         },{
-          field: 'commentStatus',
+          field: 'payStatus',
           component: 'Select',
+          ifShow: Boolean(status),
           label: '支付状态',
           colProps: {
             span: 7,
@@ -373,6 +297,31 @@ export default defineComponent({
           componentProps: {
             options: [
               {
+                  label: '未支付',
+                  value: 0,
+                  key: '0',
+                },{
+                label: '支付成功',
+                value: 1,
+                key: '1',
+              },{
+                label: '支付失败',
+                value: 2,
+                key: '2',
+              },
+            ],
+          },
+        },{
+          field: 'commentStatus',
+          component: 'Select',
+          ifShow: Boolean(status),
+          label: '评价状态',
+          colProps: {
+            span: 7,
+          },
+          componentProps: {
+            options: [
+              {
                   label: '未评论',
                   value: 0,
                   key: '0',
@@ -398,10 +347,115 @@ export default defineComponent({
             span: 7,
           },
         },
-      ],
+      ]
+    }
+    const columns: BasicColumn[] = [
+      {
+        title: '报修日期',
+        dataIndex: 'createTime',
+        width: 180,
+      },
+      {
+        title: '客户名称',
+        dataIndex: 'customerName',
+        width: 80,
+        // customRender: ({ record }) => {
+        //   return t(`routes.equity.operation.${record.operationType || 0}`);
+        // },
+      },
+      {
+        title: '产品类型',
+        dataIndex: 'cameraType',
+        width: 80,
+        customRender: ({ record }) => {
+          return t(`routes.scene.tableType.${record.cameraType || 0}`);
+        },
+      },
+      {
+        title: '产品SN码',
+        dataIndex: 'cameraSnCode',
+        width: 100,
+      },
+      {
+        title: '报修方式',
+        dataIndex: 'receiverType',
+        width: 100,
+        customRender: ({ record }) => {
+          return record.receiverType == 0 ? '系统录单' : '公众号报修';
+        },
+      },
+      {
+        title: '保修类型',
+        dataIndex: 'warrantyType',
+        width: 100,
+        customRender: ({ record }) => {
+          return record.warrantyType == 0 ? '保修期内' : record.warrantyType == 1 ? '保修期外' : '非保修项目';
+        },
+      },{
+        title: '售后工程师',
+        dataIndex: 'saleName',
+        width: 100,
+      },{
+        title: '接单日期',
+        dataIndex: 'orderReceivingTime',
+        width: 150,
+      },
+      {
+        title: '故障分析',
+        dataIndex: 'checkResult',
+        width: 100,
+      },
+      {
+        title: '维修工程师',
+        dataIndex: 'repairManName',
+        width: 100,
+      },{
+        title: '维修完成日期',
+        dataIndex: 'repairOverTime',
+        width: 150,
+      },
+      {
+        title: '状态',
+        dataIndex: 'status',
+        width: 100,
+        customRender: ({ record }) => {
+          return t(`routes.spares.tableType.${record.status || 0}`);
+        },
+      },
+      {
+        title: '维修单号',
+        dataIndex: 'repairId',
+        width: 180,
+      },
+      {
+        title: t('common.operating'),
+        dataIndex: 'action',
+        slots: { customRender: 'action' },
+        ifShow: true,
+        fixed: 'right',
+        flag: 'ACTION',
+        width: 120,
+      },
+    ];
+    const searchForm: Partial<FormProps> = {
+      labelWidth: 120,
+      autoAdvancedLine: 1,
+      actionColOptions: {
+        span: 24,
+      },
+      schemas:getSchemas(true)
+    };
+    
+    const searchForm1: Partial<FormProps> = {
+      labelWidth: 120,
+      autoAdvancedLine: 1,
+      actionColOptions: {
+        span: 24,
+      },
+      schemas:getSchemas(false)
     };
     const [registerRecovery, { openModal }] = useModal();
-    const [registerTable, { reload }] = useTable({
+    const [registerTable, { reload:reload0 }] = useTable({
       api: queryList,
       columns: columns,
       useSearchForm: true,
@@ -417,9 +471,29 @@ export default defineComponent({
       },
       canResize: false,
     });
+    const [registerTable1, { reload:reload1 }] = useTable({
+      api: queryList,
+      columns: columns,
+      useSearchForm: true,
+      searchInfo: { status: tableType },
+      formConfig: searchForm1,
+      showTableSetting: true,
+      showIndexColumn: false,
+      fetchSetting: {
+        pageField: 'pageNum',
+        sizeField: 'pageSize',
+        listField: 'list',
+        totalField: 'total',
+      },
+      canResize: false,
+    });
     onActivated(()=>{
       reload();
     })
+    const reload = () => {
+      reload1();
+      reload0()
+    }
     async function handleDetail(record: Recordable) {
       console.log('record', record);
       router.push({path:`detail/${record.repairId||'20230215174919387'}`})
@@ -435,6 +509,7 @@ export default defineComponent({
     }
     return {
       registerTable,
+      registerTable1,
       reload,
       t,
       tableType,