linwenxin před 9 měsíci
rodič
revize
fc3070fc6d

+ 28 - 38
src/views/workOrder/workOrderPool/detail.vue

@@ -2,44 +2,30 @@
   <div class="yemiansize">
     <el-tabs v-model="activeName" type="card" :lazy="true" @tab-click="handleClick">
       <el-tab-pane label="工单信息" name="workOrderInfo" key="workOrderInfo"> </el-tab-pane>
-      <el-tab-pane v-if="!isImport" label="操作明细" name="operationDetails" key="operationDetails"> </el-tab-pane>
-      <el-tab-pane v-if="!isImport" label="完工明细" name="detailsCompletion" key="detailsCompletion"></el-tab-pane>
-      <el-tab-pane v-if="!isImport" label="支付费用" name="payFee" key="payFee"></el-tab-pane>
-      <el-tab-pane v-if="!isImport && EvaluationShow" label="评价信息" name="Evaluation" key="Evaluation">
+      <el-tab-pane label="操作明细" name="operationDetails" key="operationDetails"> </el-tab-pane>
+      <el-tab-pane label="完工明细" name="detailsCompletion" key="detailsCompletion"></el-tab-pane>
+      <el-tab-pane label="支付费用" name="payFee" key="payFee"></el-tab-pane>
+      <el-tab-pane v-if="EvaluationShow" label="评价信息" name="Evaluation" key="Evaluation">
       </el-tab-pane>
-      <el-tab-pane v-if="!isImport && SettleAccountsShow" label="费用结算" name="SettleAccounts" key="SettleAccounts">
+      <el-tab-pane v-if="SettleAccountsShow" label="费用结算" name="SettleAccounts" key="SettleAccounts">
       </el-tab-pane>
-      <el-tab-pane
-        v-if="!isImport && PartsApplicationShow"
-        label="配件申请"
-        name="PartsApplication"
-        key="PartsApplication"
-      >
+      <el-tab-pane v-if="PartsApplicationShow" label="配件申请" name="PartsApplication" key="PartsApplication">
       </el-tab-pane>
     </el-tabs>
     <div class="view_div">
-      <div
-        :style="{
-          height: activeName === 'workOrderInfo' ? '100%' : '0px',
-          overflow: activeName === 'workOrderInfo' ? '' : 'hidden'
-        }"
-      >
+      <div :style="{
+      height: activeName === 'workOrderInfo' ? '100%' : '0px',
+      overflow: activeName === 'workOrderInfo' ? '' : 'hidden'
+    }">
         <workOrderInfo :id="id" ref="workOrderInfo" :workOrderType="workOrderType" />
       </div>
-      <OperationDetail v-if="!isImport && activeName == 'operationDetails'" :id="id" ref="operationDetails" />
-      <CompletionDetails v-if="!isImport && activeName == 'detailsCompletion'" :id="id" ref="detailsCompletion" />
-      <Payment v-if="!isImport && activeName == 'payFee'" :id="id" ref="payFee" :workOrderType="workOrderType" />
-      <Evaluation v-if="!isImport && activeName == 'Evaluation' && EvaluationShow" :id="id" ref="Evaluation" />
-      <SettleAccounts
-        v-if="!isImport && activeName == 'SettleAccounts' && SettleAccountsShow"
-        :id="id"
-        ref="SettleAccounts"
-      />
-      <PartsApplication
-        v-if="!isImport && activeName == 'PartsApplication' && PartsApplicationShow"
-        :id="id"
-        ref="PartsApplication"
-      />
+      <OperationDetail v-if="activeName == 'operationDetails'" :id="id" ref="operationDetails" />
+      <CompletionDetails v-if="activeName == 'detailsCompletion'" :id="id" ref="detailsCompletion" />
+      <Payment v-if="activeName == 'payFee'" :id="id" ref="payFee" :workOrderType="workOrderType" />
+      <Evaluation v-if="activeName == 'Evaluation' && EvaluationShow" :id="id" ref="Evaluation" />
+      <SettleAccounts v-if="activeName == 'SettleAccounts' && SettleAccountsShow" :id="id" ref="SettleAccounts" />
+      <PartsApplication v-if="activeName == 'PartsApplication' && PartsApplicationShow" :id="id"
+        ref="PartsApplication" />
     </div>
   </div>
 </template>
@@ -79,23 +65,27 @@ export default {
       EvaluationShow: false,
       SettleAccountsShow: false,
       PartsApplicationShow: true,
-      isImport: false
     }
   },
   created() {
     orderBaseDetail({
       orderBaseId: this.id
     }).then(res => {
-      this.isImport = res.data.isImport
-      console.log(this.isImport)
-      if (!~['DYY', 'DSHPG', 'DWDPG', 'DJD', 'FWZ', 'YQX'].indexOf(res.data.orderStatus)) {
+      if (
+        !["DYY"].includes(this?.orderInfo?.orderStatus) &&
+        !["DSHPG", "CJ", "YPD", "DXSPD", "DZBPG", "DWDSPGP", "DXSSPGP", "DTJXSSPGP", "DZBSPGP", "DFZXPD", "DFZXSPGP", 'XSBH', "TJXSBH", "ZBBH", "FZXBH", "FL"].includes(this?.orderInfo?.orderStatus) &&
+        !["DWDPG", "DWDPD", "WDBH"].includes(this?.orderInfo?.orderStatus) &&
+        !["DJD", "DSM", "YZP"].includes(this?.orderInfo?.orderStatus) &&
+        !["FWZ", "GCSZT", "BFWG"].includes(this?.orderInfo?.orderStatus) &&
+        !["YQX", "FWZT", "YCGB", "FWQX"].includes(this?.orderInfo?.orderStatus)
+      ) {
         this.EvaluationShow = true
         this.SettleAccountsShow = true
       }
     })
   },
   methods: {
-    handleClick(tab, event) {}
+    handleClick(tab, event) { }
   }
 }
 </script>
@@ -105,8 +95,8 @@ export default {
   height: calc(100vh - 140px) !important;
   overflow: hidden;
 
-  & > ::v-deep .el-tabs:nth-child(1) {
-    & > .el-tabs__header:nth-child(1) {
+  &> ::v-deep .el-tabs:nth-child(1) {
+    &>.el-tabs__header:nth-child(1) {
       margin-bottom: 0 !important;
     }
   }

+ 40 - 0
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/orderStatus.json

@@ -0,0 +1,40 @@
+{
+  "YQX": "已取消",
+  "LRCD": "录入存档",
+  "FL": "分流3.0",
+  "ZBBH": "总部驳回",
+  "DZBPG": "待总部派单",
+  "BFWG": "部分完工",
+  "YPD": "预派单",
+  "YCGB": "异常关闭",
+  "YZP": "已转派",
+  "FZXBH": "分中心驳回",
+  "DXSSPGP": "待销司审批改派",
+  "DFZXSPGP": "待分中心审批改派",
+  "DXSPD": "待销司派单",
+  "DWDSPGP": "待一级网点审批改派",
+  "DQD": "待抢单",
+  "FWQX": "服务取消",
+  "DSM": "待上门",
+  "YJS": "已结算",
+  "DWDPD": "待网点派单",
+  "TJXSBH": "同级销司驳回",
+  "DYY": "待预约",
+  "CJ": "创建",
+  "FWZ": "服务中",
+  "YWG": "已完工待结算",
+  "XSBH": "销司驳回",
+  "FWZT": "服务暂停",
+  "DWDPG": "待网点派工",
+  "YWGO": "已完工",
+  "DSHPG": "待商户派工",
+  "WDWG": "网点完工",
+  "DZBSPGP": "待总部审批改派",
+  "GCSZT": "工程师在途",
+  "DFZXPD": "待分中心派单",
+  "YCD": "异常单",
+  "DTJXSSPGP": "待同级销司审批改派",
+  "WDBH": "网点驳回",
+  "GCSZX": "工程师完工",
+  "DJD": "待接单"
+}

+ 69 - 52
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/workOrderLogic.js

@@ -1,5 +1,6 @@
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
 import { orderBaseDetail, orderBaseProductList } from '@/api/workOrderPool.js'
+
 var initdata_ = {
   // 基础信息--------------------
   // 维保项目
@@ -117,87 +118,105 @@ export default {
     btnRestrict() {
       // 1,保存 2,过程反馈 3,设为异常 4,加急 5,不加急 6,取消工单 7,回访 8,新建工单 9,工单驳回 10,激活工单
       var btns = []
-      if (this.orderInfo) {
-        if (this?.orderInfo?.isImport) {
-          return []
-        }
 
-        btns =
-          {
-            // 待预约
-            DYY: [20],
-            // 待商户派工
-            DSHPG: [1, 2, 4, 5, 6, 20],
-            // 待网点派工
-            DWDPG: [1, 2, 4, 5, 6, 20],
-            // 待接单
-            DJD: [1, 2, 4, 5, 6, 20],
-            // 服务中
-            FWZ: [1, 2, 3, 4, 5, 6, 20],
-            // 异常单
-            YCD: [1, 2, 6, 20],
-            // 已完工待结算
-            YWG: [7, 8, 9, 20],
-            // 已结算
-            YJS: [20],
-            // 已取消
-            YQX: [10, 20],
-            // 待抢单
-            DQD: [1, 2, 4, 5, 6, 20]
-          }[this.orderInfo.orderStatus] || []
+      if (["DYY"].includes(this?.orderInfo?.orderStatus)) {
+        // 待预约
+        btns = [20]
+      } else if (["DQD"].includes(this?.orderInfo?.orderStatus)) {
+        // 待抢单
+        btns = [1, 2, 4, 5, 6, 20]
+      } else if (["DSHPG", "CJ", "YPD", "DXSPD", "DZBPG", "DWDSPGP", "DXSSPGP", "DTJXSSPGP", "DZBSPGP", "DFZXPD", "DFZXSPGP", 'XSBH', "TJXSBH", "ZBBH", "FZXBH", "FL"].includes(this?.orderInfo?.orderStatus)) {
+        // 待商户派工
+        btns = [1, 2, 4, 5, 6, 20]
+      } else if (["DWDPG", "DWDPD", "WDBH"].includes(this?.orderInfo?.orderStatus)) {
+        // 待网点派工
+        btns = [1, 2, 4, 5, 6, 20]
+      } else if (["DJD", "DSM", "YZP"].includes(this?.orderInfo?.orderStatus)) {
+        // 待接单
+        btns = [1, 2, 4, 5, 6, 20]
+      } else if (["FWZ", "GCSZT", "BFWG"].includes(this?.orderInfo?.orderStatus)) {
+        // 服务中
+        btns = [1, 2, 3, 4, 5, 6, 20]
+      } else if (["YCD"].includes(this?.orderInfo?.orderStatus)) {
+        // 异常单
+        btns = [1, 2, 6, 20]
+      } else if (["YWG", "GCSZX", "WDWG", "YWGO"].includes(this?.orderInfo?.orderStatus)) {
+        // 已完工待结算
+        btns = [7, 8, 9, 20]
+      } else if (["YJS", "LRCD"].includes(this?.orderInfo?.orderStatus)) {
+        // 已结算
+        btns = [20]
+      } else if (["YQX", "FWZT", "YCGB", "FWQX"].includes(this?.orderInfo?.orderStatus)) {
+        // 已取消
+        btns = [10, 20]
       }
-
       // 已经加急
       if ((this.orderInfo.orderFlags || []).find(item => item.tag == 'JIA_JI')) {
         btns = btns.filter(item => !new Set([4]).has(item))
       } else {
         btns = btns.filter(item => !new Set([5]).has(item))
       }
-
       // 已经异常
       if ((this.orderInfo.orderFlags || []).find(item => item.tag == 'YI_CHANGE')) {
         btns = btns.filter(item => !new Set([3]).has(item))
       }
-
       return btns
     },
     // 处理每个字段是否可编辑
     formOptions() {
-      var finish = !!~['YWG', 'YJS', 'YQX'].indexOf(this.orderInfo.orderStatus)
+      // 已完工, 已结算, 已取消
+      var finish = (
+        ["YWG", "GCSZX", "WDWG", "YWGO"].includes(this?.orderInfo?.orderStatus) ||
+        ["YJS", "LRCD"].includes(this?.orderInfo?.orderStatus) ||
+        ["YQX", "FWZT", "YCGB", "FWQX"].includes(this?.orderInfo?.orderStatus)
+      );
+
+      // 待商户派工, 待网点派工, 待接单, 待预约
+      var isQD = (
+        ["DSHPG", "CJ", "YPD", "DXSPD", "DZBPG", "DWDSPGP", "DXSSPGP", "DTJXSSPGP", "DZBSPGP", "DFZXPD", "DFZXSPGP", 'XSBH', "TJXSBH", "ZBBH", "FZXBH", "FL"].includes(this?.orderInfo?.orderStatus) ||
+        ["DWDPG", "DWDPD", "WDBH"].includes(this?.orderInfo?.orderStatus) ||
+        ["DJD", "DSM", "YZP"].includes(this?.orderInfo?.orderStatus) ||
+        ["DQD"].includes(this?.orderInfo?.orderStatus) ||
+        undefined === this?.orderInfo?.orderStatus
+      )
+
+      // 非新创建
+      var notNewOrder = !!this.id
+
       return {
         // 基础信息--------------------
         // 维保项目
         rpProjectRepairId: {
-          isEdit: this.id ? false : true,
+          isEdit: notNewOrder,
           isShow: this.workOrderType == 4,
           isRules: [...required]
         },
         // 工程项目
         projectNo: {
-          isEdit: this.id ? false : true,
+          isEdit: notNewOrder,
           isShow: this.workOrderType == 2,
           isRules: [...required]
         },
         projectName: {
-          isEdit: this.id ? false : true,
+          isEdit: notNewOrder,
           isShow: this.workOrderType == 2,
           isRules: [...required]
         },
         // 客户名称
         userName: {
-          isEdit: this?.orderInfo?.isImport ? false : !!~[1, 3].indexOf(this?.workOrderType) && !finish,
+          isEdit: !!~[1, 3].indexOf(this?.workOrderType) && !finish,
           isShow: true,
           isRules: [...required]
         },
         // 联系人
         linkName: {
-          isEdit: this?.orderInfo?.isImport ? false : !!~[1, 3].indexOf(this?.workOrderType) && !finish,
+          isEdit: !!~[1, 3].indexOf(this?.workOrderType) && !finish,
           isShow: true,
           isRules: [...required]
         },
         // 客户电话
         userMobile: {
-          isEdit: this?.orderInfo?.isImport ? false : !!~[1, 3].indexOf(this?.workOrderType) && !finish,
+          isEdit: !!~[1, 3].indexOf(this?.workOrderType) && !finish,
           isShow: true,
           isRules: [...mobileRequired]
         },
@@ -209,31 +228,31 @@ export default {
         },
         // gps地址
         gpsAddress: {
-          isEdit: this?.orderInfo?.isImport ? false : !!~[1, 3].indexOf(this?.workOrderType) && !finish,
+          isEdit: !!~[1, 3].indexOf(this?.workOrderType) && !finish,
           isShow: true,
           isRules: [...required]
         },
         // 详细地址
         address: {
-          isEdit: this?.orderInfo?.isImport ? false : !!~[1, 3].indexOf(this?.workOrderType) && !finish,
+          isEdit: !!~[1, 3].indexOf(this?.workOrderType) && !finish,
           isShow: true,
           isRules: []
         },
         // 服务信息--------------------------------
         // 工单类型
         orderSmallType: {
-          isEdit: this.id ? false : true,
+          isEdit: notNewOrder,
           isShow: true,
           isRules: [...required]
         },
         orderChannelId: {
-          isEdit: this.id ? false : true,
+          isEdit: notNewOrder,
           isShow: true,
           isRules: [...required]
         },
         // 预约上门日期
         appointmentTime: {
-          isEdit: this?.orderInfo?.isImport ? false : !finish,
+          isEdit: !finish,
           isShow: true,
           isRules: []
         },
@@ -243,49 +262,47 @@ export default {
           isRules: [...required]
         },
         saleCompany: {
-          isEdit: this?.orderInfo?.isImport ? false : !finish,
+          isEdit: !finish,
           isShow: true,
           isRules: []
         },
         source: {
-          isEdit: this?.orderInfo?.isImport ? false : !finish,
+          isEdit: !finish,
           isShow: true,
           isRules: []
         },
         // 产品信息------------------------
         orderProducts: {
-          isEdit: this?.orderInfo?.isImport ? false : !finish && !this.orderInfo.isCj,
+          isEdit: !finish && !this.orderInfo.isCj,
           isShow: true,
           isRules: [...required]
         },
         // 其它信息------------------------
         // 备注
         remark: {
-          isEdit: this?.orderInfo?.isImport ? false : !finish,
+          isEdit: !finish,
           isShow: true,
           isRules: []
         },
         // 派单信息-----------------------------
         // 服务商网点
         websitId: {
-          isEdit: this?.orderInfo?.isImport ? false : !finish,
+          isEdit: !finish,
           isShow: true,
           isRules: [...required]
         },
         isQd: {
-          isEdit: this?.orderInfo?.isImport
-            ? false
-            : !!~['DSHPG', 'DWDPG', 'DJD', 'DQD', undefined].indexOf(this.orderInfo.orderStatus),
+          isEdit: isQD,
           isShow: true,
           isRules: [...required]
         },
         workerId: {
-          isEdit: this?.orderInfo?.isImport ? false : !finish,
+          isEdit: !finish,
           isShow: true,
           isRules: this.userInfo.type != 1 && !this.orderInfo.isQd ? [...required] : []
         },
         orderWorkers: {
-          isEdit: this?.orderInfo?.isImport ? false : !finish,
+          isEdit: !finish,
           isShow: true,
           isRules: this.userInfo.type != 1 && !this.orderInfo.isQd ? [...required] : []
         }

+ 36 - 68
src/views/workOrder/workOrderPool/index.vue

@@ -1,65 +1,33 @@
 <template>
   <!-- 工单池 -->
-  <template-page
-    ref="pageRef"
-    :getList="getList"
-    :operation="operation()"
-    :exportList="exportList"
-    :optionsEvensGroup="optionsEvensGroup"
-    :columnParsing="columnParsing"
-    :tableAttributes="tableAttributes"
-    :tableEvents="tableEvents"
-    :moreParameters="moreParameters"
-    :screeningAnalysis="screeningAnalysis"
-    :filterMethod="filterMethod"
-    :replaceOrNotMap="true"
-    :defaultSearchData="defaultSearchData"
-  >
+  <template-page ref="pageRef" :getList="getList" :operation="operation()" :exportList="exportList"
+    :optionsEvensGroup="optionsEvensGroup" :columnParsing="columnParsing" :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents" :moreParameters="moreParameters" :screeningAnalysis="screeningAnalysis"
+    :filterMethod="filterMethod" :replaceOrNotMap="true" :defaultSearchData="defaultSearchData">
     <!-- 创建工单 -->
     <div class="cartographer_big">
-      <el-dialog
-        title="创建工单"
-        width="100%"
-        :modal="false"
-        :visible.sync="createFormBool"
-        :before-close="handleClose"
-      >
+      <el-dialog title="创建工单" width="100%" :modal="false" :visible.sync="createFormBool" :before-close="handleClose">
         <workOrderInfo :workOrderType="workOrderType" v-if="createFormBool" :cloneWorkOrder="cloneWorkOrder" />
       </el-dialog>
     </div>
     <!-- 工单详情 -->
     <div class="cartographer_big">
-      <el-dialog
-        :title="'工单详情-' + id"
-        width="100%"
-        :modal="false"
-        :visible.sync="detailFormBool"
-        :before-close="handleClose"
-      >
+      <el-dialog :title="'工单详情-' + id" width="100%" :modal="false" :visible.sync="detailFormBool"
+        :before-close="handleClose">
         <Detail v-if="detailFormBool" :id="id" :workOrderType="workOrderType" />
       </el-dialog>
     </div>
     <!-- 批量预约/改约 -->
     <div class="cartographer_big">
-      <el-dialog
-        title="批量约单"
-        width="100%"
-        :modal="false"
-        :visible.sync="rescheduleBool"
-        :before-close="rescheduleClose"
-      >
+      <el-dialog title="批量约单" width="100%" :modal="false" :visible.sync="rescheduleBool"
+        :before-close="rescheduleClose">
         <Reschedule v-if="rescheduleBool" :recordSelected="recordSelected" @close="rescheduleClose" />
       </el-dialog>
     </div>
     <!-- 批量派工/改派 -->
     <div class="cartographer_big">
-      <el-dialog
-        title="批量派单"
-        width="100%"
-        :modal="false"
-        :visible.sync="reassignmentBool"
-        :before-close="reassignmentClose"
-      >
+      <el-dialog title="批量派单" width="100%" :modal="false" :visible.sync="reassignmentBool"
+        :before-close="reassignmentClose">
         <Reassignment v-if="reassignmentBool" :recordSelected="recordSelected" @close="reassignmentClose" />
       </el-dialog>
     </div>
@@ -166,7 +134,7 @@ export default {
           [
             this.optionsEvensAuth(['createWorkOrder', 'createWbWorkOrder'], {
               name: '创建工单',
-              click: () => {}
+              click: () => { }
             }),
             this.optionsEvensAuth('createWorkOrder', {
               click: () => {
@@ -192,7 +160,7 @@ export default {
               ['import4', 'importTemplate', 'downloadImportTemplate', 'importTemplate2', 'downloadImportTemplate2'],
               {
                 name: '导入工单',
-                click: () => {}
+                click: () => { }
               }
             ),
             this.optionsEvensAuth('import4', ({ moduleName }) => {
@@ -275,7 +243,7 @@ export default {
           [
             this.optionsEvensAuth(['bulkOrder', 'lotOrder'], {
               name: '批量操作',
-              click: () => {}
+              click: () => { }
             }),
             this.optionsEvensAuth('bulkOrder', {
               click: () => {
@@ -361,11 +329,11 @@ export default {
     },
 
     selectable(row, index) {
-      return (
-        !['YWG', 'YJS', 'YQX'].includes(
-          Object.entries(row.selectMapData.orderStatus).find(([key, val]) => val == row.orderStatus)?.[0]
-        ) && !row.rpProjectRepairId
-      )
+      var orderStatus = Object.entries(row.selectMapData.orderStatus).find(([key, val]) => val == row.orderStatus)?.[0]
+      return !["YWG", "GCSZX", "WDWG", "YWGO"].includes(orderStatus) &&
+        !["YJS", "LRCD"].includes(orderStatus) &&
+        !["YQX", "FWZT", "YCGB", "FWQX"].includes(orderStatus) &&
+        !row.rpProjectRepairId
     },
 
     screeningAnalysis(jname, val) {
@@ -480,9 +448,9 @@ export default {
     operation() {
       return this.operationBtn({
         edit: {
-          conditions: ({ row, index, column }) => {
-            return !row.isImport
-          },
+          // conditions: ({ row, index, column }) => {
+          //   return !row.isImport
+          // },
           click: ({ row, index, column }) => {
             this.id = row.id
             this.workOrderType = Number(
@@ -493,20 +461,20 @@ export default {
             })
           }
         },
-        view: {
-          conditions: ({ row, index, column }) => {
-            return row.isImport
-          },
-          click: ({ row, index, column }) => {
-            this.id = row.id
-            this.workOrderType = Number(
-              Object.entries(row?.selectMapData?.saleType || {}).find(([key, val]) => val == row.saleType)?.[0] || 1
-            )
-            this.$nextTick(() => {
-              this.detailFormBool = true
-            })
-          }
-        }
+        // view: {
+        //   conditions: ({ row, index, column }) => {
+        //     return row.isImport
+        //   },
+        //   click: ({ row, index, column }) => {
+        //     this.id = row.id
+        //     this.workOrderType = Number(
+        //       Object.entries(row?.selectMapData?.saleType || {}).find(([key, val]) => val == row.saleType)?.[0] || 1
+        //     )
+        //     this.$nextTick(() => {
+        //       this.detailFormBool = true
+        //     })
+        //   }
+        // }
       })
     },