Преглед на файлове

feat: 对接评价信息

linwenxin преди 1 година
родител
ревизия
bca6dca01b
променени са 3 файла, в които са добавени 56 реда и са изтрити 88 реда
  1. 24 0
      src/utils/common.js
  2. 20 85
      src/views/workOrder/workOrderPool/detailModule/Evaluation/index.vue
  3. 12 3
      src/views/workOrder/workOrderPool/index.vue

+ 24 - 0
src/utils/common.js

@@ -1,5 +1,29 @@
 import { MessageBox, Message, Notification } from '@zjlib/element-ui2'
 
+export function tableDataParsing(fieldBeans) {
+  return fieldBeans.map((item, index) => {
+    var tiling =
+      item.tiling || item.tiling === null || item.tiling === undefined ? true : false;
+    return {
+      tiling,
+      exportField: item,
+      hidden: item.isShow === null ? false : !item.isShow,
+      isCopy: item.isCopy || false,
+      isTotal: item.isTotal || false,
+      sortNum: item.sortNum || 0,
+      recordType: item.type,
+      columnAttributes: {
+        fixed: item.fixed ? item.fixed : false,
+        label: item.label || '',
+        prop: item.jname,
+        width: item.width || 'auto',
+        'min-width': ((label) => label.length * 16 + 64)(item.label || ''),
+        align: ~['number', 'amount'].indexOf(item.type) ? 'right' : 'left',
+      },
+    };
+  });
+}
+
 export const successMsg = msg => {
   Message({
     showClose: true,

+ 20 - 85
src/views/workOrder/workOrderPool/detailModule/Evaluation/index.vue

@@ -3,10 +3,9 @@
     <zj-page-fill class="neibuview">
       <zj-form-container>
         <zj-form-module title="评价信息">
-          <zj-table  :is-drop="true" :columns="evaluationColumns" :table-data="evaluationData"
-            :table-attributes="{
-              border: true
-            }" />
+          <zj-table :is-drop="true" :columns="evaluationColumns" :table-data="evaluationData" :table-attributes="{
+            border: true
+          }" />
         </zj-form-module>
       </zj-form-container>
     </zj-page-fill>
@@ -14,93 +13,29 @@
 </template>
 
 <script>
+import { listPageV2 } from "@/api/workOrder/appraise";
+import { tableDataParsing } from "@/utils/common.js"
 export default {
+  props: {
+    id: {
+      type: [String, Number],
+      default: null,
+    }
+  },
   data() {
     return {
-      evaluationData: []
+      evaluationData: [],
+      evaluationColumns: []
     }
   },
-  computed: {
-    evaluationColumns() {
-      return [
-        {
-          columnAttributes: {
-            label: '产品品牌',
-            prop: 'workerName'
-          }
-        },
-        {
-          columnAttributes: {
-            label: '产品大类',
-            prop: 'userName'
-          }
-        },
-        {
-          columnAttributes: {
-            label: '产品小类',
-            prop: 'userPhone'
-          }
-        },
-        {
-          columnAttributes: {
-            label: '机型名称',
-            prop: 'mainName'
-          }
-        },
-        {
-          columnAttributes: {
-            label: '负责工程师',
-            prop: 'mainName'
-          }
-        },
-        {
-          columnAttributes: {
-            label: '联系电话',
-            prop: 'mainName'
-          }
-        },
-        {
-          columnAttributes: {
-            label: '用户昵称',
-            prop: 'mainName'
-          }
-        },
-        {
-          columnAttributes: {
-            label: '手机号',
-            prop: 'mainName'
-          }
-        },
-        {
-          columnAttributes: {
-            label: '评价类型',
-            prop: 'mainName'
-          }
-        },
-        {
-          columnAttributes: {
-            label: '评价内容',
-            prop: 'mainName'
-          }
-        },
-        {
-          columnAttributes: {
-            label: '评价来源',
-            prop: 'mainName'
-          }
-        },
-        {
-          columnAttributes: {
-            label: '评价时间',
-            prop: 'mainName'
-          }
-        },
-      ]
-    }
+  created() {
+    listPageV2({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "a.id", "compare": "=", "value": this.id }] }).then(res => {
+      this.evaluationColumns = tableDataParsing(res.fieldBeans)
+      this.$nextTick(() => {
+        this.evaluationData = res.data.records
+      })
+    })
   },
-  methods: {
-
-  }
 }
 </script>
 

+ 12 - 3
src/views/workOrder/workOrderPool/index.vue

@@ -18,15 +18,16 @@
     </div>
     <!-- 批量预约/改约 -->
     <div class="cartographer_big">
-      <el-dialog title="批量预约 / 改约" width="100%" :modal="false" :visible.sync="rescheduleBool" :before-close="rescheduleClose">
-        <Reschedule v-if="rescheduleBool" />
+      <el-dialog title="批量预约 / 改约" width="100%" :modal="false" :visible.sync="rescheduleBool"
+        :before-close="rescheduleClose">
+        <Reschedule v-if="rescheduleBool" :recordSelected="recordSelected"/>
       </el-dialog>
     </div>
     <!-- 批量派工/改派 -->
     <div class="cartographer_big">
       <el-dialog title="批量派工 / 改派" width="100%" :modal="false" :visible.sync="reassignmentBool"
         :before-close="reassignmentClose">
-        <Reassignment v-if="reassignmentBool" />
+        <Reassignment v-if="reassignmentBool" :recordSelected="recordSelected"/>
       </el-dialog>
     </div>
   </template-page>
@@ -149,12 +150,20 @@ export default {
             {
               name: '批量下派改派',
               click: () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.warning('请勾选工单')
+                  return
+                }
                 this.reassignmentBool = true
               }
             },
             {
               name: '批量预约改约',
               click: () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.warning('请勾选工单')
+                  return
+                }
                 this.rescheduleBool = true
               }
             },