Explorar el Código

售后服务新增需求编码字段

hezhanp hace 8 meses
padre
commit
66567ecb22

+ 138 - 127
src/views/salesServiceManagement/toDoList/components/plan-search.vue

@@ -3,132 +3,143 @@
   <seekPage :seekList="seekList" :formLength="3" @search="search"></seekPage>
 </template>
 <script>
-  export default {
-
-    data() {
-      return {
-        stateList: [
-          {
-            label: '待派单',
-            value: '0'
-          },
-          {
-            label: '已派单',
-            value: 1
-          },
-          {
-            label: '执行中',
-            value: 2
-          },
-          {
-            label: '已完成',
-            value: 3
-          },
-          {
-            label: '已撤回',
-            value: 4
-          },
-          {
-            label: '已驳回',
-            value: 5
-          }
-        ],
-        exigencyList: [
-          {
-            label: '普通',
-            value: 1
-          },
-          {
-            label: '紧急',
-            value: 2
-          },
-          {
-            label: '重要',
-            value: 3
-          }
-        ]
-      };
-    },
-    props: {},
-    computed: {
-      // 表格列配置
-      seekList() {
-        return [
-          {
-            label: '关键字:',
-            value: 'keyWord',
-            type: 'input',
-            placeholder: '计划单号/计划名称/设备名称'
-          },
-          {
-            label: '计划单号:',
-            value: 'code',
-            type: 'input',
-            placeholder: ''
-          },
-          {
-            label: '计划名称:',
-            value: 'name',
-            type: 'input',
-            placeholder: ''
-          },
-          {
-            label: '客户名称:',
-            width: 380,
-            value: 'contactName',
-            type: 'input',
-            placeholder: ''
-          },
-          {
-            label: '设备名称:',
-            width: 380,
-            value: 'deviceName',
-            type: 'input',
-            placeholder: ''
-          },
-          {
-            label: '状态:',
-            width: 380,
-            value: 'planStatus',
-            type: 'select',
-            planList: this.stateList,
-            placeholder: ''
-          },
-          {
-            label: '紧急状态:',
-            width: 380,
-            value: 'urgent',
-            type: 'select',
-            planList: this.exigencyList,
-            placeholder: ''
-          },
-          {
-            label: '创建人:',
-            width: 380,
-            value: 'createUserName',
-            type: 'input',
-            placeholder: ''
-          },
-          {
-            label: '创建时间:',
-            value: 'createTime',
-            type: 'date',
-            dateType: 'datetimerange',
-            placeholder: '',
-            width: 380,
-            valueAr: ['startTime', 'endTime']
-          }
-        ];
-      }
-    },
-    methods: {
-      /* 搜索 */
-      search(e) {
-        console.log(e)
-        this.$emit('search', {
-          ...e
-        });
-      }
+export default {
+  data() {
+    return {
+      stateList: [
+        {
+          label: '待派单',
+          value: '0'
+        },
+        {
+          label: '已派单',
+          value: 1
+        },
+        {
+          label: '执行中',
+          value: 2
+        },
+        {
+          label: '已完成',
+          value: 3
+        },
+        {
+          label: '已撤回',
+          value: 4
+        },
+        {
+          label: '已驳回',
+          value: 5
+        }
+      ],
+      exigencyList: [
+        {
+          label: '普通',
+          value: 1
+        },
+        {
+          label: '紧急',
+          value: 2
+        },
+        {
+          label: '重要',
+          value: 3
+        }
+      ]
+    };
+  },
+  props: {},
+  computed: {
+    // 表格列配置
+    seekList() {
+      return [
+        {
+          label: '关键字:',
+          value: 'keyWord',
+          type: 'input',
+          placeholder: '计划单号/计划名称/设备名称'
+        },
+        {
+          label: '计划单号:',
+          value: 'code',
+          type: 'input',
+          placeholder: ''
+        },
+        {
+          label: '计划名称:',
+          value: 'name',
+          type: 'input',
+          placeholder: ''
+        },
+        {
+          label: '客户名称:',
+          width: 380,
+          value: 'contactName',
+          type: 'input',
+          placeholder: ''
+        },
+        {
+          label: '需求编码:',
+          width: 380,
+          value: 'demandCode',
+          type: 'input',
+          placeholder: ''
+        },
+        {
+          label: '设备名称:',
+          width: 380,
+          value: 'deviceName',
+          type: 'input',
+          placeholder: ''
+        },
+        {
+          label: '状态:',
+          width: 380,
+          value: 'planStatus',
+          type: 'select',
+          planList: this.stateList,
+          placeholder: ''
+        },
+        {
+          label: '紧急状态:',
+          width: 380,
+          value: 'urgent',
+          type: 'select',
+          planList: this.exigencyList,
+          placeholder: ''
+        },
+        {
+          label: '创建人:',
+          width: 380,
+          value: 'createUserName',
+          type: 'input',
+          placeholder: ''
+        },
+        {
+          label: '创建时间:',
+          value: 'createTime',
+          type: 'date',
+          dateType: 'datetimerange',
+          placeholder: '',
+          width: 380,
+          valueAr: ['startTime', 'endTime']
+        }
+      ];
     }
-  };
+  },
+  methods: {
+    /* 搜索 */
+    search(e) {
+      let params = { ...e };
+      // 去除空值
+      Object.keys(params).forEach(key => {
+        if (params[key] === '' || params[key] === undefined || params[key] === null) {
+          delete params[key];
+        }
+      });
+      console.log(params);
+      this.$emit('search', params);
+    }
+  }
+};
 </script>

+ 268 - 253
src/views/salesServiceManagement/toDoList/index.vue

@@ -39,15 +39,21 @@
           <el-link
             type="primary"
             :underline="false"
-            @click="handleUpdate(row, 'edit')" 
-            v-if="[0, 4, 5].includes(row.planStatus) && $hasPermission('eom:aftersalesplan:update')"
+            @click="handleUpdate(row, 'edit')"
+            v-if="
+              [0, 4, 5].includes(row.planStatus) &&
+              $hasPermission('eom:aftersalesplan:update')
+            "
             >修改</el-link
           >
           <el-popconfirm
             class="ele-action"
             title="确认删除这条记录吗?"
             @confirm="cancel(row)"
-            v-if="[0, 4, 5].includes(row.planStatus) && $hasPermission('eom:aftersalesplan:delete')"
+            v-if="
+              [0, 4, 5].includes(row.planStatus) &&
+              $hasPermission('eom:aftersalesplan:delete')
+            "
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete"
@@ -59,14 +65,20 @@
             type="primary"
             :underline="false"
             @click="handleCommand('handleRevocation', row)"
-            v-if="row.planStatus == 1 && $hasPermission('eom:aftersalesplan:revocation')"
+            v-if="
+              row.planStatus == 1 &&
+              $hasPermission('eom:aftersalesplan:revocation')
+            "
             >撤回</el-link
           >
           <el-link
             type="primary"
             :underline="false"
             @click="handleCommand('handleDispatchOrders', row)"
-            v-if="[0, 4, 5].includes(row.planStatus) && $hasPermission('eom:aftersalesplan:sendOrder')"
+            v-if="
+              [0, 4, 5].includes(row.planStatus) &&
+              $hasPermission('eom:aftersalesplan:sendOrder')
+            "
             >派单</el-link
           >
         </template>
@@ -89,266 +101,269 @@
 </template>
 
 <script>
-  import planSearch from './components/plan-search.vue';
-  import addOrUpdateDialog from './components/addOrUpdateDialog.vue';
-  import generateForm from './components/generateForm.vue';
-  import jimureportBrowse from '@/components/jimureport/browseModal.vue';
-  import applyForSpare from '../components/applyForSpare.vue';
+import planSearch from './components/plan-search.vue';
+import addOrUpdateDialog from './components/addOrUpdateDialog.vue';
+import generateForm from './components/generateForm.vue';
+import jimureportBrowse from '@/components/jimureport/browseModal.vue';
+import applyForSpare from '../components/applyForSpare.vue';
 
-  import {
-    getSalesPlan,
-    deleteSalesPlan,
-    planRevocation,
-    checkByPlanId
-  } from '@/api/salesServiceManagement/index';
-  // import { getToken } from '@/utils/token-util';
-  import dictMixins from '@/mixins/dictMixins';
+import {
+  getSalesPlan,
+  deleteSalesPlan,
+  planRevocation,
+  checkByPlanId
+} from '@/api/salesServiceManagement/index';
+// import { getToken } from '@/utils/token-util';
+import dictMixins from '@/mixins/dictMixins';
 
-  export default {
-    mixins: [dictMixins],
-    components: {
-      planSearch,
-      addOrUpdateDialog,
-      generateForm,
-      applyForSpare,
-      jimureportBrowse
-    },
-    data() {
-      return {
-        // 表格列配置
-        columns: [
-          {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'left'
-          },
-          {
-            action: 'single',
-            slot: 'single',
-            align: 'center',
-            label: '选择',
-            width: 50
-          },
-          {
-            slot: 'code',
-            prop: 'code',
-            label: '计划单号',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'name',
-            label: '计划名称',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'planExecuteUserName',
-            label: '计划执行人',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'demandName',
-            label: '需求名称',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'demandCode',
-            label: '需求编码',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'categoryName',
-            label: '设备名称',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (row) => {
-              if (!row.deviceDetails) return '';
-              let str = '';
-              row.deviceDetails.map((el, idx) => {
-                if (idx + 1 == row.deviceDetails.length) {
-                  str += el.categoryName;
-                } else {
-                  str = str + '' + el.categoryName + ',';
-                }
-              });
-              return str;
-            }
-          },
-          {
-            prop: 'contactName',
-            label: '客户名称',
-            align: 'center',
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'planStatus',
-            label: '状态',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (item) => {
-              return {
-                0: '待派单',
-                1: '已派单',
-                2: '执行中',
-                3: '已完成',
-                4: '已撤回',
-                5: '已驳回'
-              }[item.planStatus];
-            }
-          },
-          {
-            prop: 'urgent',
-            label: '紧急程度',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (item) => {
-              return {
-                1: '普通',
-                2: '紧急',
-                3: '重要'
-              }[item.urgent];
-            }
-          },
-          {
-            columnKey: 'action',
-            label: '操作',
-            width: 230,
-            align: 'center',
-            resizable: false,
-            slot: 'action',
-            showOverflowTooltip: true,
-            fixed: 'right'
+export default {
+  mixins: [dictMixins],
+  components: {
+    planSearch,
+    addOrUpdateDialog,
+    generateForm,
+    applyForSpare,
+    jimureportBrowse
+  },
+  data() {
+    return {
+      // 表格列配置
+      columns: [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          action: 'single',
+          slot: 'single',
+          align: 'center',
+          label: '选择',
+          width: 50
+        },
+        {
+          slot: 'code',
+          prop: 'code',
+          label: '计划单号',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'name',
+          label: '计划名称',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'planExecuteUserName',
+          label: '计划执行人',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'demandName',
+          label: '需求名称',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'demandCode',
+          label: '需求编码',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'categoryName',
+          label: '设备名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (row) => {
+            if (!row.deviceDetails) return '';
+            let str = '';
+            row.deviceDetails.map((el, idx) => {
+              if (idx + 1 == row.deviceDetails.length) {
+                str += el.categoryName;
+              } else {
+                str = str + '' + el.categoryName + ',';
+              }
+            });
+            return str;
+          }
+        },
+        {
+          prop: 'contactName',
+          label: '客户名称',
+          align: 'center',
+          showOverflowTooltip: true
+        },
+        {
+          prop: 'planStatus',
+          label: '状态',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (item) => {
+            return {
+              0: '待派单',
+              1: '已派单',
+              2: '执行中',
+              3: '已完成',
+              4: '已撤回',
+              5: '已驳回'
+            }[item.planStatus];
+          }
+        },
+        {
+          prop: 'urgent',
+          label: '紧急程度',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (item) => {
+            return {
+              1: '普通',
+              2: '紧急',
+              3: '重要'
+            }[item.urgent];
           }
-        ],
-        // 加载状态
-        loading: false,
-        radioId: '',
-        currentRow: {},
-        browseShow: false
-      };
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 230,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true,
+          fixed: 'right'
+        }
+      ],
+      // 加载状态
+      loading: false,
+      radioId: '',
+      currentRow: {},
+      browseShow: false
+    };
+  },
+  computed: {},
+  created() {
+    this.requestDict('维修计划状态');
+  },
+  methods: {
+    /* 表格数据源 */
+    datasource({ page, limit, where, order }) {
+      return getSalesPlan({
+        pageNum: page,
+        size: limit,
+        ...where
+      });
     },
-    computed: {},
-    created() {
-      this.requestDict('维修计划状态');
+    /* 刷新表格 */
+    reload(where) {
+      this.$refs.table.reload({ page: 1, where });
+      this.radioId = '';
+      this.currentRow = {};
+      this.$emit('getToDoReminder');
     },
-    methods: {
-      /* 表格数据源 */
-      datasource({ page, limit, where, order }) {
-        return getSalesPlan({ pageNum: page, size: limit, });
-      },
-      /* 刷新表格 */
-      reload(where) {
-        this.$refs.table.reload({ page: 1, where });
-        this.radioId = '';
-        this.currentRow = {};
-        this.$emit('getToDoReminder')
-
-      },
-      async cancel(row) {
-        let flag = await this.permission(row);
-        if (!flag) return;
-        const res = await deleteSalesPlan([row.id]);
-        if (res) {
-          this.$message.success('删除成功');
-          this.reload();
-        }
-      },
-      async permission(row) {
-        try {
-          await checkByPlanId(row.id);
-          return true;
-        } catch {
-          return false;
-        }
-      },
-      async handleUpdate(row, type) {
-        let flag = await this.permission(row);
-        if (!flag) return;
-        this.$nextTick(() => {
-          this.$refs.addOrUpdateDialogRef.init(row, type);
-        });
-      },
-      goDetail(row) {
-        this.$nextTick(() => {
-          this.$refs.addOrUpdateDialogRef.init(row, 'view');
-        });
-      },
-      async handleDispatchOrders(row) {
-        this.$nextTick(() => {
-          this.$refs.addOrUpdateDialogRef.init(row, 'view', true);
-        });
-      },
-      async handleRevocation(row) {
-        await planRevocation([row.id]);
-        this.$message.success('撤回成功');
+    async cancel(row) {
+      let flag = await this.permission(row);
+      if (!flag) return;
+      const res = await deleteSalesPlan([row.id]);
+      if (res) {
+        this.$message.success('删除成功');
         this.reload();
-      },
-      addSpareItems(row) {
-        let data = JSON.parse(JSON.stringify(row));
-        this.$refs.edit.open(data, 'plan');
-      },
-      async handleGenerate(row) {
-        this.$refs.generateFormRef.open(row);
-      },
-      async handleCommand(command, row) {
-        let flag = await this.permission(row);
-        if (!flag) return;
-        if (command === 'handleRevocation') {
-          this.handleRevocation(row);
-        }
-        if (command === 'handleDispatchOrders') {
-          this.handleDispatchOrders(row);
-        }
-        if (command === 'handleGenerate') {
-          this.handleGenerate(row);
-        }
-        if (command === 'addSpareItems') {
-          this.addSpareItems(row);
-        }
-      },
-      // 单击选择
-      cellClick(row) {
-        this.currentRow = row;
-        this.radioId = row.id;
-      },
-      quotation() {
-        if (!this.currentRow.id) {
-          this.$message.warning('请先选择计划');
-          return;
-        }
-        this.browseShow = true;
-      },
-      cancelQuo() {
-        this.browseShow = false;
       }
+    },
+    async permission(row) {
+      try {
+        await checkByPlanId(row.id);
+        return true;
+      } catch {
+        return false;
+      }
+    },
+    async handleUpdate(row, type) {
+      let flag = await this.permission(row);
+      if (!flag) return;
+      this.$nextTick(() => {
+        this.$refs.addOrUpdateDialogRef.init(row, type);
+      });
+    },
+    goDetail(row) {
+      this.$nextTick(() => {
+        this.$refs.addOrUpdateDialogRef.init(row, 'view');
+      });
+    },
+    async handleDispatchOrders(row) {
+      this.$nextTick(() => {
+        this.$refs.addOrUpdateDialogRef.init(row, 'view', true);
+      });
+    },
+    async handleRevocation(row) {
+      await planRevocation([row.id]);
+      this.$message.success('撤回成功');
+      this.reload();
+    },
+    addSpareItems(row) {
+      let data = JSON.parse(JSON.stringify(row));
+      this.$refs.edit.open(data, 'plan');
+    },
+    async handleGenerate(row) {
+      this.$refs.generateFormRef.open(row);
+    },
+    async handleCommand(command, row) {
+      let flag = await this.permission(row);
+      if (!flag) return;
+      if (command === 'handleRevocation') {
+        this.handleRevocation(row);
+      }
+      if (command === 'handleDispatchOrders') {
+        this.handleDispatchOrders(row);
+      }
+      if (command === 'handleGenerate') {
+        this.handleGenerate(row);
+      }
+      if (command === 'addSpareItems') {
+        this.addSpareItems(row);
+      }
+    },
+    // 单击选择
+    cellClick(row) {
+      this.currentRow = row;
+      this.radioId = row.id;
+    },
+    quotation() {
+      if (!this.currentRow.id) {
+        this.$message.warning('请先选择计划');
+        return;
+      }
+      this.browseShow = true;
+    },
+    cancelQuo() {
+      this.browseShow = false;
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  .el-dropdown-link {
-    cursor: pointer;
-    color: var(--color-primary-5);
-  }
+.el-dropdown-link {
+  cursor: pointer;
+  color: var(--color-primary-5);
+}
 
-  .el-icon-arrow-down {
-    font-size: 12px;
-  }
+.el-icon-arrow-down {
+  font-size: 12px;
+}
 
-  ::v-deep .seep-search {
-    .el-input__inner {
-      padding: 0 5px 0 10px;
-    }
-    .el-input__inner::placeholder {
-      font-size: 13px;
-    }
+::v-deep .seep-search {
+  .el-input__inner {
+    padding: 0 5px 0 10px;
+  }
+  .el-input__inner::placeholder {
+    font-size: 13px;
   }
+}
 </style>

+ 6 - 0
src/views/salesServiceManagement/workOrder/components/work-search.vue

@@ -29,6 +29,12 @@
             type: 'input',
             placeholder: ''
           },
+          {
+            label: '需求编码:',
+            value: 'demandCode',
+            type: 'input',
+            placeholder: ''
+          },
           {
             label: '客户名称:',
             value: 'contactName',

+ 7 - 0
src/views/salesServiceManagement/workOrder/index.vue

@@ -364,6 +364,13 @@ export default {
           showOverflowTooltip: true,
           minWidth: 110
         },
+        {
+          prop: 'demandCode',
+          label: '需求编码',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
         {
           prop: 'categoryName',
           label: '设备名称',