Jelajahi Sumber

2331 售后服务管理-费用管理-新建(添加工单增加搜索条件)

wsx 10 bulan lalu
induk
melakukan
eded769537

+ 184 - 185
src/views/salesServiceManagement/accessory/components/workOrderList.vue

@@ -11,6 +11,8 @@
     width="70%"
   >
     <el-card shadow="never">
+      <workSearch @search="reload"></workSearch>
+
       <ele-pro-table
         ref="table"
         :columns="columns"
@@ -35,200 +37,197 @@
     </div>
   </el-dialog>
 </template>
-  
-  <script>
-import { getSalesWorkOrder } from '@/api/salesServiceManagement/index';
-import workSearch from '../../workOrder/components/work-search.vue';
-// import AssetTree from '@/components/AssetTree';
 
-export default {
-  components: {
-    workSearch
-    // AssetTree
-  },
-  props: {
-    classType: {
-      type: Number | String,
-      default: 1
+<script>
+  import { getSalesWorkOrder } from '@/api/salesServiceManagement/index';
+  import workSearch from './workSearch.vue';
+  // import AssetTree from '@/components/AssetTree';
+
+  export default {
+    components: {
+      workSearch
+      // AssetTree
     },
-  },
-  data() {
-    return {
-      visible: false,
-      workOrderStatus: [
-        { code: 0, label: '待接收' },
-        { code: 1, label: '已接收' },
-        { code: 2, label: '执行中' },
-        { code: 3, label: '待验收' },
-        { code: 4, label: '待评价' },
-        { code: 5, label: '已完成' },
-        { code: 6, label: '验收不通过' }
-      ],
-      columns: [
-        {
-          action: 'action',
-          slot: 'action',
-          align: 'center',
-          label: '选择'
-        },
-        {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          prop: 'code',
-          slot: 'code',
-          label: '工单编号',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 150
-        },
-        {
-          prop: 'planCode',
-          label: '计划单号',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'planName',
-          label: '计划名称',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'executeUserName',
-          label: '报工人',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'accepterUserName',
-          label: '验收人',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'accepterTime',
-          label: '验收时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'acceptTime',
-          label: '开始时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'finishTime',
-          label: '结束时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'planFinishTime',
-          label: '计划完成时间',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          columnKey: 'inFactDuration',
-          label: '实际售后时长(分钟)',
-          align: 'center',
-          resizable: false,
-          showOverflowTooltip: true,
-          minWidth: 120,
-          formatter: (row) => {
-            if (row.finishTime && row.acceptTime) {
-              return parseInt(
-                (new Date(row.finishTime).getTime() -
-                  new Date(row.acceptTime).getTime()) /
-                  60000
-              );
+    props: {
+      classType: {
+        type: Number | String,
+        default: 1
+      }
+    },
+    data() {
+      return {
+        visible: false,
+        workOrderStatus: [
+          { code: 0, label: '待接收' },
+          { code: 1, label: '已接收' },
+          { code: 2, label: '执行中' },
+          { code: 3, label: '待验收' },
+          { code: 4, label: '待评价' },
+          { code: 5, label: '已完成' },
+          { code: 6, label: '验收不通过' }
+        ],
+        columns: [
+          {
+            action: 'action',
+            slot: 'action',
+            align: 'center',
+            label: '选择'
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            slot: 'code',
+            label: '工单编号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 150
+          },
+          {
+            prop: 'planCode',
+            label: '计划单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'planName',
+            label: '计划名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'executeUserName',
+            label: '报工人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'accepterUserName',
+            label: '验收人',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'accepterTime',
+            label: '验收时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'acceptTime',
+            label: '开始时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'finishTime',
+            label: '结束时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'planFinishTime',
+            label: '计划完成时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            columnKey: 'inFactDuration',
+            label: '实际售后时长(分钟)',
+            align: 'center',
+            resizable: false,
+            showOverflowTooltip: true,
+            minWidth: 120,
+            formatter: (row) => {
+              if (row.finishTime && row.acceptTime) {
+                return parseInt(
+                  (new Date(row.finishTime).getTime() -
+                    new Date(row.acceptTime).getTime()) /
+                    60000
+                );
+              }
+            }
+          },
+          {
+            prop: 'orderStatus',
+            label: '状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              return this.workOrderStatus.find(
+                (item) => item.code == row.orderStatus
+              )?.label;
             }
           }
-        },
-        {
-          prop: 'orderStatus',
-          label: '状态',
-          align: 'center',
-          showOverflowTooltip: true,
-          formatter: (row) => {
-            return this.workOrderStatus.find(
-              (item) => item.code == row.orderStatus
-            )?.label;
-          }
-        }
-      ],
-      radio: null,
-      current:{},
-    };
-  },
-
-  watch: {},
-  methods: {
-    open(item) {
-      if (item) {
-        this.radio = item.id;
-        this.current = item;
-      }
-      this.visible = true;
+        ],
+        radio: null,
+        current: {}
+      };
     },
 
-    /* 表格数据源 */
-    datasource({ page, limit, where, order }) {
-      return getSalesWorkOrder({
-        pageNum: page,
-        size: limit,
-        // orderStatus: 5,
-        ...where
-      });
-    },
+    watch: {},
+    methods: {
+      open(item) {
+        if (item) {
+          this.radio = item.id;
+          this.current = item;
+        }
+        this.visible = true;
+      },
 
-    /* 刷新表格 */
-    reload(where) {
-      where = {
-        ...where,
-        orderStatus: 5
-      };
-      this.$refs.table.reload({ page: 1, where });
-    },
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getSalesWorkOrder({
+          pageNum: page,
+          size: limit,
+          // orderStatus: 5,
+          ...where
+        });
+      },
 
-    // 单击获取id
-    cellClick(row) {
-      this.current = row;
-      this.radio = row.id;
-    },
-    handleClose() {
-      this.visible = false;
-      this.current = null;
-      this.radio = '';
-    },
+      /* 刷新表格 */
+      reload(where) {
+        where = {
+          ...where,
+        };
+        this.$refs.table.reload({ page: 1, where });
+      },
+
+      // 单击获取id
+      cellClick(row) {
+        this.current = row;
+        this.radio = row.id;
+      },
+      handleClose() {
+        this.visible = false;
+        this.current = null;
+        this.radio = '';
+      },
 
-    selected() {
-      if (!this.current) {
-        return this.$message.warning('请选择工单');
+      selected() {
+        if (!this.current) {
+          return this.$message.warning('请选择工单');
+        }
+        this.$emit('changeSelect', this.current);
+        this.handleClose();
       }
-      this.$emit('changeSelect', this.current);
-      this.handleClose();
     }
-  }
-};
+  };
 </script>
-  
-  <style lang="scss" scoped>
-</style>
-  
+
+<style lang="scss" scoped></style>

+ 65 - 0
src/views/salesServiceManagement/accessory/components/workSearch.vue

@@ -0,0 +1,65 @@
+<!-- 搜索表单 -->
+<template>
+  <seekPage :seekList="seekList" :formLength="4" @search="search"></seekPage>
+</template>
+<script>
+  import { reviewStatusSelect } from '@/enum/dict';
+  export default {
+    data() {
+      return {};
+    },
+    computed: {
+      // 表格列配置
+      seekList() {
+        return [
+          {
+            label: '工单编号:',
+            value: 'code',
+            type: 'input',
+            placeholder: '请输入',
+            labelWidth: 100
+          },
+          {
+            label: '计划单号:',
+            value: 'planCode',
+            type: 'input',
+            placeholder: '请输入',
+            labelWidth: 100
+          },
+          {
+            label: '报工人:',
+            value: 'executeUserName',
+            type: 'input',
+            placeholder: '请输入',
+            labelWidth: 100
+          },
+          {
+            label: '验收人:',
+            value: 'accepterUserName',
+            type: 'input',
+            placeholder: '请输入',
+            labelWidth: 100
+          }
+
+          //   {
+          //     label: '创建时间:',
+          //     value: 'createTime',
+          //     type: 'date',
+          //     dateType: 'datetimerange',
+          //     placeholder: '',
+          //     width: 380,
+          //     valueAr: ['createTimeStart', 'createTimeEnd']
+          //   },
+        ];
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search(e) {
+        this.$emit('search', {
+          ...e
+        });
+      }
+    }
+  };
+</script>