Просмотр исходного кода

申请备品备件条件添加

huang_an 1 год назад
Родитель
Сommit
0bde21a5ef

+ 191 - 190
src/views/maintenance/equipment/workOrder/index.vue

@@ -29,6 +29,7 @@
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
           <el-link
+            v-if="row.orderStatus !== 3 && row.orderStatus !== 4"
             type="primary"
             :underline="false"
             icon="el-icon-truck"
@@ -68,203 +69,203 @@
 </template>
 
 <script>
-import WorkSearch from './components/work-search.vue';
-// import { pageRoles } from '@/api/system/role';
-import edit from '@/views/sparePartsApply/components/edit';
-import { workPage } from '@/api/equipment/work';
-import redeployOther from '@/views/maintenance/components/redeployOther.vue';
-import signingUpWork from '@/views/maintenance/components/signingUpWork.vue';
-import { getWordOrderDetail } from '@/api/maintenance/patrol_maintenance';
+  import WorkSearch from './components/work-search.vue';
+  // import { pageRoles } from '@/api/system/role';
+  import edit from '@/views/sparePartsApply/components/edit';
+  import { workPage } from '@/api/equipment/work';
+  import redeployOther from '@/views/maintenance/components/redeployOther.vue';
+  import signingUpWork from '@/views/maintenance/components/signingUpWork.vue';
+  import { getWordOrderDetail } from '@/api/maintenance/patrol_maintenance';
 
-export default {
-  components: {
-    WorkSearch,
-    redeployOther,
-    signingUpWork,
-    edit
-  },
-  data() {
-    return {
-      // 表格列配置
-      columns: [
-        {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          columnKey: 'code',
-          slot: 'code',
-          prop: 'code',
-          label: '工单单号',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 140
-        },
-        {
-          prop: 'planCode',
-          label: '计划单号',
-          align: 'center',
-          showOverflowTooltip: true,
-          slot: 'planCode',
-          minWidth: 140
-        },
-        {
-          prop: 'planName',
-          label: '保养名称',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 120
-        },
-        {
-          prop: 'executeGroupName',
-          label: '保养部门',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 120
-        },
-        {
-          prop: 'executeUserName',
-          label: '保养人员',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'ruleName',
-          label: '规则名称',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'createTime',
-          label: '工单生成时间',
-          // sortable: true,
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 170
-        },
-        {
-          prop: 'acceptTime',
-          label: '开工时间',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'finishTime',
-          label: '报工时间',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          columnKey: 'orderHour',
-          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
-              );
+  export default {
+    components: {
+      WorkSearch,
+      redeployOther,
+      signingUpWork,
+      edit
+    },
+    data() {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            columnKey: 'code',
+            slot: 'code',
+            prop: 'code',
+            label: '工单单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'planCode',
+            label: '计划单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            slot: 'planCode',
+            minWidth: 140
+          },
+          {
+            prop: 'planName',
+            label: '保养名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+          {
+            prop: 'executeGroupName',
+            label: '保养部门',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+          {
+            prop: 'executeUserName',
+            label: '保养人员',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'ruleName',
+            label: '规则名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'createTime',
+            label: '工单生成时间',
+            // sortable: true,
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 170
+          },
+          {
+            prop: 'acceptTime',
+            label: '开工时间',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'finishTime',
+            label: '报工时间',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            columnKey: 'orderHour',
+            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 {
+                0: '待接收',
+                1: '已接收',
+                2: '执行中',
+                3: '已完成'
+              }[row.orderStatus];
+            }
+          },
+          {
+            prop: 'executeResult',
+            label: '执行结果',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter(row) {
+              return { 0: '缺陷', 1: '正常' }[row.isAbnormal];
+            }
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 240,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
           }
-        },
-        {
-          prop: 'orderStatus',
-          label: '状态',
-          align: 'center',
-          showOverflowTooltip: true,
-          formatter: (row) => {
-            return {
-              0: '待接收',
-              1: '已接收',
-              2: '执行中',
-              3: '已完成'
-            }[row.orderStatus];
-          }
-        },
-        {
-          prop: 'executeResult',
-          label: '执行结果',
-          align: 'center',
-          showOverflowTooltip: true,
-          formatter(row) {
-            return { 0: '缺陷', 1: '正常' }[row.isAbnormal];
-          }
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 240,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ],
-      // 加载状态
-      loading: false,
-      pageType: 'add',
-      dialogTitle: '',
-      isBindPlan: false
-    };
-  },
-  computed: {},
-  methods: {
-    /* 表格数据源 */
-    datasource({ page, limit, where, order }) {
-      where.type = 2;
-      return workPage({ pageNum: page, size: limit, ...where });
+        ],
+        // 加载状态
+        loading: false,
+        pageType: 'add',
+        dialogTitle: '',
+        isBindPlan: false
+      };
     },
-    async changeEnable(row) {
-      const res = await putRoles(row);
-      if (res.code == 0) {
-        this.$message({
-          type: 'success',
-          message: '修改成功',
-          customClass: 'ele-message-border'
+    computed: {},
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        where.type = 2;
+        return workPage({ pageNum: page, size: limit, ...where });
+      },
+      async changeEnable(row) {
+        const res = await putRoles(row);
+        if (res.code == 0) {
+          this.$message({
+            type: 'success',
+            message: '修改成功',
+            customClass: 'ele-message-border'
+          });
+          this.reload();
+        }
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where });
+      },
+      // 添加备品备件
+      async addSpareItems(row) {
+        let data = await getWordOrderDetail(row.id);
+        data.deviceList = data.deviceList.map((item) => {
+          return item.substance;
         });
-        this.reload();
-      }
-    },
-    /* 刷新表格 */
-    reload(where) {
-      this.$refs.table.reload({ page: 1, where });
-    },
-    // 添加备品备件
-    async addSpareItems(row) {
-      let data = await getWordOrderDetail(row.id);
-      data.deviceList = data.deviceList.map((item) => {
-        return item.substance;
-      });
 
-      this.$refs.edit.open(data, 'add');
-    },
-    goDetail({ id }) {
-      this.$router.push({
-        path: '/maintenance/equipment/workOrder/details',
-        query: {
-          id
-        }
-      });
-    },
-    // 转派
-    toRedeploy(row) {
-      this.$refs.redeployOtherRef.open(row);
-    },
-    // 报工
-    toSigningUpWork(row) {
-      this.$refs.signingUpWorkRef.open(row);
+        this.$refs.edit.open(data, 'add');
+      },
+      goDetail({ id }) {
+        this.$router.push({
+          path: '/maintenance/equipment/workOrder/details',
+          query: {
+            id
+          }
+        });
+      },
+      // 转派
+      toRedeploy(row) {
+        this.$refs.redeployOtherRef.open(row);
+      },
+      // 报工
+      toSigningUpWork(row) {
+        this.$refs.signingUpWorkRef.open(row);
+      }
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped></style>

+ 201 - 200
src/views/maintenance/patrol/workOrder/index.vue

@@ -18,6 +18,7 @@
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
           <el-link
+            v-if="row.orderStatus !== 3 && row.orderStatus !== 4"
             type="primary"
             :underline="false"
             icon="el-icon-truck"
@@ -57,213 +58,213 @@
 </template>
 
 <script>
-import edit from '@/views/sparePartsApply/components/edit';
-import WorkSearch from './components/work-search.vue';
-import redeployOther from '@/views/maintenance/components/redeployOther.vue';
-import signingUpWork from '@/views/maintenance/components/signingUpWork.vue';
-import {
-  getWorkOrderPage,
-  getWordOrderDetail
-} from '@/api/maintenance/patrol_maintenance';
+  import edit from '@/views/sparePartsApply/components/edit';
+  import WorkSearch from './components/work-search.vue';
+  import redeployOther from '@/views/maintenance/components/redeployOther.vue';
+  import signingUpWork from '@/views/maintenance/components/signingUpWork.vue';
+  import {
+    getWorkOrderPage,
+    getWordOrderDetail
+  } from '@/api/maintenance/patrol_maintenance';
 
-import dictMixins from '@/mixins/dictMixins';
-export default {
-  components: {
-    WorkSearch,
-    redeployOther,
-    signingUpWork,
-    edit
-  },
-  mixins: [dictMixins],
-  data() {
-    return {
-      // 表格列配置
-      columns: [
-        {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          columnKey: 'code',
-          slot: 'code',
-          prop: 'code',
-          label: '工单单号',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 140
-        },
-        {
-          prop: 'planCode',
-          label: '计划单号',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 140
-        },
-        {
-          prop: 'planName',
-          label: '巡点检名称',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 120
-        },
-        {
-          prop: 'executeGroupName',
-          label: '巡点检部门',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 120
-        },
-        {
-          prop: 'executeUserName',
-          label: '巡点检人员',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'ruleName',
-          label: '规则名称',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'createTime',
-          label: '工单生成时间',
-          align: 'center',
-          // sortable: true,
-          showOverflowTooltip: true,
-          width: 170
-        },
-        {
-          prop: 'acceptTime',
-          label: '开工时间',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'finishTime',
-          label: '报工时间',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          columnKey: 'orderHour',
-          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
-              );
+  import dictMixins from '@/mixins/dictMixins';
+  export default {
+    components: {
+      WorkSearch,
+      redeployOther,
+      signingUpWork,
+      edit
+    },
+    mixins: [dictMixins],
+    data() {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            columnKey: 'code',
+            slot: 'code',
+            prop: 'code',
+            label: '工单单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'planCode',
+            label: '计划单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'planName',
+            label: '巡点检名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+          {
+            prop: 'executeGroupName',
+            label: '巡点检部门',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
+          {
+            prop: 'executeUserName',
+            label: '巡点检人员',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'ruleName',
+            label: '规则名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'createTime',
+            label: '工单生成时间',
+            align: 'center',
+            // sortable: true,
+            showOverflowTooltip: true,
+            width: 170
+          },
+          {
+            prop: 'acceptTime',
+            label: '开工时间',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'finishTime',
+            label: '报工时间',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            columnKey: 'orderHour',
+            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 {
+                0: '待接收',
+                1: '已接收',
+                2: '执行中',
+                3: '已完成'
+              }[row.orderStatus];
+            }
+          },
+          {
+            prop: 'acceptanceStatus',
+            label: '执行结果',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter(row) {
+              return { 0: '缺陷', 1: '正常' }[row.isAbnormal];
+            }
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 240,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
           }
-        },
-        {
-          prop: 'orderStatus',
-          label: '状态',
-          align: 'center',
-          showOverflowTooltip: true,
-          formatter: (row) => {
-            return {
-              0: '待接收',
-              1: '已接收',
-              2: '执行中',
-              3: '已完成'
-            }[row.orderStatus];
-          }
-        },
-        {
-          prop: 'acceptanceStatus',
-          label: '执行结果',
-          align: 'center',
-          showOverflowTooltip: true,
-          formatter(row) {
-            return { 0: '缺陷', 1: '正常' }[row.isAbnormal];
-          }
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 240,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ],
-      // 加载状态
-      loading: false,
-      pageType: 'add',
-      dialogTitle: '',
-      isBindPlan: false
-    };
-  },
-  created() {
-    this.requestDict('巡点检工单状态');
-  },
-  computed: {},
-  methods: {
-    /* 表格数据源 */
-    datasource({ page, limit, where, order }) {
-      return getWorkOrderPage({
-        pageNum: page,
-        size: limit,
-        ...where,
-        type: 1
-      });
+        ],
+        // 加载状态
+        loading: false,
+        pageType: 'add',
+        dialogTitle: '',
+        isBindPlan: false
+      };
     },
-    async changeEnable(row) {
-      const res = await putRoles(row);
-      if (res.code == 0) {
-        this.$message({
-          type: 'success',
-          message: '修改成功',
-          customClass: 'ele-message-border'
-        });
-        this.reload();
-      }
+    created() {
+      this.requestDict('巡点检工单状态');
     },
-    /* 刷新表格 */
-    reload(where) {
-      this.$refs.table.reload({ page: 1, where });
-    },
-
-    // 添加备品备件
-    async addSpareItems(row) {
-      let data = await getWordOrderDetail(row.id);
-      data.deviceList = data.deviceList.map((item) => {
-        return item.substance;
-      });
- 
-      this.$refs.edit.open(data, 'add');
-    },
-    goDetail({ id }) {
-      this.$router.push({
-        path: '/maintenance/patrol/workOrder/details',
-        query: {
-          id
+    computed: {},
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getWorkOrderPage({
+          pageNum: page,
+          size: limit,
+          ...where,
+          type: 1
+        });
+      },
+      async changeEnable(row) {
+        const res = await putRoles(row);
+        if (res.code == 0) {
+          this.$message({
+            type: 'success',
+            message: '修改成功',
+            customClass: 'ele-message-border'
+          });
+          this.reload();
         }
-      });
-    },
-    // 转派
-    toRedeploy(row) {
-      this.$refs.redeployOtherRef.open(row);
-    },
-    // 报工
-    toSigningUpWork(row) {
-      this.$refs.signingUpWorkRef.open(row);
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where });
+      },
+
+      // 添加备品备件
+      async addSpareItems(row) {
+        let data = await getWordOrderDetail(row.id);
+        data.deviceList = data.deviceList.map((item) => {
+          return item.substance;
+        });
+
+        this.$refs.edit.open(data, 'add');
+      },
+      goDetail({ id }) {
+        this.$router.push({
+          path: '/maintenance/patrol/workOrder/details',
+          query: {
+            id
+          }
+        });
+      },
+      // 转派
+      toRedeploy(row) {
+        this.$refs.redeployOtherRef.open(row);
+      },
+      // 报工
+      toSigningUpWork(row) {
+        this.$refs.signingUpWorkRef.open(row);
+      }
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped></style>

+ 294 - 293
src/views/maintenance/repair/workOrder/index.vue

@@ -28,6 +28,7 @@
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
           <el-link
+            v-if="row.orderStatus !== 3 && row.orderStatus !== 4"
             type="primary"
             :underline="false"
             icon="el-icon-truck"
@@ -99,311 +100,311 @@
 </template>
 
 <script>
-import { workorderStatus, resultStatus } from '@/utils/dict/operationManage';
-import WorkorderSearch from './components/workorder-search.vue';
-import AddSpareDialog from '@/components/addSpareDialog';
-import edit from '@/views/sparePartsApply/components/edit';
-import RepairReportingWork from '../components/repairReportingWork.vue';
-import RepairDetailsDialog from '../components/RepairDetailsDialog.vue';
-import redeployOther from '@/views/maintenance/components/redeployOther.vue';
-import {
-  getWorkOrderList,
-  applySpareParts,
-  save
-} from '@/api/maintenance/repair';
-import outin from '@/api/maintenance/outin';
-import { getToken } from '@/utils/token-util';
-import { download } from '@/utils/file';
-import { API_BASE_URL } from '@/config/setting';
+  import { workorderStatus, resultStatus } from '@/utils/dict/operationManage';
+  import WorkorderSearch from './components/workorder-search.vue';
+  import AddSpareDialog from '@/components/addSpareDialog';
+  import edit from '@/views/sparePartsApply/components/edit';
+  import RepairReportingWork from '../components/repairReportingWork.vue';
+  import RepairDetailsDialog from '../components/RepairDetailsDialog.vue';
+  import redeployOther from '@/views/maintenance/components/redeployOther.vue';
+  import {
+    getWorkOrderList,
+    applySpareParts,
+    save
+  } from '@/api/maintenance/repair';
+  import outin from '@/api/maintenance/outin';
+  import { getToken } from '@/utils/token-util';
+  import { download } from '@/utils/file';
+  import { API_BASE_URL } from '@/config/setting';
 
-import axios from 'axios';
-export default {
-  components: {
-    WorkorderSearch,
-    RepairDetailsDialog,
-    redeployOther,
-    AddSpareDialog,
-    RepairReportingWork,
-    edit
-  },
-  data() {
-    return {
-      workorderStatus,
-      resultStatus,
-      currentRow: {},
-      warehousingMaterialList: [],
-      batchDetailsVOList: [],
-      materialCodeReqList: [],
-      selectionList: [],
-      wlParams: {},
-      visible: false,
-      materialObj: {},
-      // 表格列配置
-      columns: [
-        {
-          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: '关联单号',
-          label: '计划单号',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'planName',
-          label: '维修名称',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'substanceDetailVO.name',
-          label: '设备名称',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'substanceDetailVO.fixCode',
-          label: '固资编码',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'substanceDetailVO.codeNumber',
-          label: '设备编号',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'executeUserName',
-          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: 'orderHour',
-          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
-              );
+  import axios from 'axios';
+  export default {
+    components: {
+      WorkorderSearch,
+      RepairDetailsDialog,
+      redeployOther,
+      AddSpareDialog,
+      RepairReportingWork,
+      edit
+    },
+    data() {
+      return {
+        workorderStatus,
+        resultStatus,
+        currentRow: {},
+        warehousingMaterialList: [],
+        batchDetailsVOList: [],
+        materialCodeReqList: [],
+        selectionList: [],
+        wlParams: {},
+        visible: false,
+        materialObj: {},
+        // 表格列配置
+        columns: [
+          {
+            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: '关联单号',
+            label: '计划单号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'planName',
+            label: '维修名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'substanceDetailVO.name',
+            label: '设备名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'substanceDetailVO.fixCode',
+            label: '固资编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'substanceDetailVO.codeNumber',
+            label: '设备编号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'executeUserName',
+            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: 'orderHour',
+            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 workorderStatus.filter(
+                (item) => item.code == row.orderStatus
+              )[0].label;
+            }
+          },
+          {
+            prop: 'acceptanceStatus',
+            label: '执行结果',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              return row.acceptanceStatus
+                ? resultStatus.filter(
+                    (item) => item.code == row.acceptanceStatus
+                  )[0].label
+                : '';
+            }
+          },
+          {
+            columnKey: 'action',
+            fixed: 'right',
+            label: '操作',
+            width: 300,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
           }
-        },
-        {
-          prop: 'orderStatus',
-          label: '状态',
-          align: 'center',
-          showOverflowTooltip: true,
-          formatter: (row) => {
-            return workorderStatus.filter(
-              (item) => item.code == row.orderStatus
-            )[0].label;
-          }
-        },
-        {
-          prop: 'acceptanceStatus',
-          label: '执行结果',
-          align: 'center',
-          showOverflowTooltip: true,
-          formatter: (row) => {
-            return row.acceptanceStatus
-              ? resultStatus.filter(
-                  (item) => item.code == row.acceptanceStatus
-                )[0].label
-              : '';
+        ],
+        // 加载状态
+        loading: false,
+        pageType: 'add',
+        dialogTitle: '',
+        isBindPlan: false,
+        warehouseList: [],
+        warehouseId: ''
+      };
+    },
+    created() {},
+    methods: {
+      downLoadOrder(row) {
+        let params = {
+          id: row.id
+        };
+        // downloadAsset(params, '设备台账导出数据');
+        axios({
+          url: `${API_BASE_URL}/eam/workorder/excel?id=${row.id}`,
+          method: 'get',
+          responseType: 'blob',
+          headers: {
+            Authorization: getToken()
           }
-        },
-        {
-          columnKey: 'action',
-          fixed: 'right',
-          label: '操作',
-          width: 300,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
+        }).then((res) => {
+          download(res.data, '维修工单');
+        });
+      },
+      async handleNewSave() {
+        let { user } = JSON.parse(sessionStorage.getItem('vuex-eam'));
+        console.log(user);
+        let userInfo = user.info;
+        let obj = {
+          fromUser: userInfo.userId,
+          bizType: '4', // 领用出库
+          extInfo: {
+            assetType: 6,
+            verifyDeptCode: userInfo.deptId[0],
+            verifyDeptName: userInfo.deptName
+          },
+          type: 2,
+          fromType: 2
+        };
+        obj = { ...obj, ...this.wlParams };
+        if (this.dimension == 4) {
+          obj.num = this.materialObj.wlList.length;
+        } else {
+          obj.num = this.materialCodeReqList.length;
         }
-      ],
-      // 加载状态
-      loading: false,
-      pageType: 'add',
-      dialogTitle: '',
-      isBindPlan: false,
-      warehouseList: [],
-      warehouseId: ''
-    };
-  },
-  created() {},
-  methods: {
-    downLoadOrder(row) {
-      let params = {
-        id: row.id
-      };
-      // downloadAsset(params, '设备台账导出数据');
-      axios({
-        url: `${API_BASE_URL}/eam/workorder/excel?id=${row.id}`,
-        method: 'get',
-        responseType: 'blob',
-        headers: {
-          Authorization: getToken()
+        obj.storageSource = 1;
+        try {
+          const res = await outin.saveNew(obj);
+          if (res.code == 0) {
+            let arr = obj.realTimeInventoryNewPOList.map((item) => {
+              return {
+                sparePartsId: item.id,
+                sparePartsList: JSON.stringify({
+                  ...item,
+                  inventoryDetailsNewPOList: [],
+                  inventoryDetailsVOList: [],
+                  outInIds: res.data
+                })
+              };
+            });
+            applySpareParts({
+              workOrderId: this.currentRow.id,
+              infoList: arr
+            }).then((res) => {
+              this.$message.success('申请成功!');
+            });
+          }
+        } catch (error) {
+          console.log(error);
         }
-      }).then((res) => {
-        download(res.data, '维修工单');
-      });
-    },
-    async handleNewSave() {
-      let { user } = JSON.parse(sessionStorage.getItem('vuex-eam'));
-      console.log(user);
-      let userInfo = user.info;
-      let obj = {
-        fromUser: userInfo.userId,
-        bizType: '4', // 领用出库
-        extInfo: {
-          assetType: 6,
-          verifyDeptCode: userInfo.deptId[0],
-          verifyDeptName: userInfo.deptName
-        },
-        type: 2,
-        fromType: 2
-      };
-      obj = { ...obj, ...this.wlParams };
-      if (this.dimension == 4) {
-        obj.num = this.materialObj.wlList.length;
-      } else {
-        obj.num = this.materialCodeReqList.length;
-      }
-      obj.storageSource = 1;
-      try {
-        const res = await outin.saveNew(obj);
+      },
+      detailData(data) {
+        applySpareParts({
+          workOrderId: this.currentRow.id,
+          listId: data.map((item) => item.id),
+          listNumber: data.map((item) => item.measureQuantity)
+        }).then((res) => {
+          this.$message.success('申请成功!');
+        });
+      },
+      // 添加备品备件
+      addSpareItems(row) {
+        let data = JSON.parse(JSON.stringify(row));
+        data['deviceList'] = [data.substanceDetailVO];
+        this.$refs.edit.open(data, 'add');
+      },
+
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getWorkOrderList({
+          pageNum: page,
+          size: limit,
+          ...where,
+          type: 3
+        });
+      },
+      async changeEnable(row) {
+        const res = await putRoles(row);
         if (res.code == 0) {
-          let arr = obj.realTimeInventoryNewPOList.map((item) => {
-            return {
-              sparePartsId: item.id,
-              sparePartsList: JSON.stringify({
-                ...item,
-                inventoryDetailsNewPOList: [],
-                inventoryDetailsVOList: [],
-                outInIds: res.data
-              })
-            };
-          });
-          applySpareParts({
-            workOrderId: this.currentRow.id,
-            infoList: arr
-          }).then((res) => {
-            this.$message.success('申请成功!');
+          this.$message({
+            type: 'success',
+            message: '修改成功',
+            customClass: 'ele-message-border'
           });
+          this.reload();
         }
-      } catch (error) {
-        console.log(error);
-      }
-    },
-    detailData(data) {
-      applySpareParts({
-        workOrderId: this.currentRow.id,
-        listId: data.map((item) => item.id),
-        listNumber: data.map((item) => item.measureQuantity)
-      }).then((res) => {
-        this.$message.success('申请成功!');
-      });
-    },
-    // 添加备品备件
-    addSpareItems(row) {
-      let data = JSON.parse(JSON.stringify(row));
-      data['deviceList'] = [data.substanceDetailVO];
-      this.$refs.edit.open(data, 'add');
-    },
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ page: 1, where });
+      },
 
-    /* 表格数据源 */
-    datasource({ page, limit, where, order }) {
-      return getWorkOrderList({
-        pageNum: page,
-        size: limit,
-        ...where,
-        type: 3
-      });
-    },
-    async changeEnable(row) {
-      const res = await putRoles(row);
-      if (res.code == 0) {
-        this.$message({
-          type: 'success',
-          message: '修改成功',
-          customClass: 'ele-message-border'
-        });
-        this.reload();
-      }
-    },
-    /* 刷新表格 */
-    reload(where) {
-      this.$refs.table.reload({ page: 1, where });
-    },
+      goDetail(row) {
+        row.title = '工单详情';
+        row.tabLabel = '工单信息';
+        this.$refs.detailsDialogRef.init(row);
+      },
 
-    goDetail(row) {
-      row.title = '工单详情';
-      row.tabLabel = '工单信息';
-      this.$refs.detailsDialogRef.init(row);
-    },
-
-    // 转派
-    toRedeploy(row) {
-      this.$refs.redeployOtherRef.open(row);
-    },
-    // 报工
-    toReport(row) {
-      this.$refs.repairReportingWorkRef.open(row, true);
+      // 转派
+      toRedeploy(row) {
+        this.$refs.redeployOtherRef.open(row);
+      },
+      // 报工
+      toReport(row) {
+        this.$refs.repairReportingWorkRef.open(row, true);
+      }
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped></style>