Переглянути джерело

Merge branch 'master' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-wt into test

yusheng 7 місяців тому
батько
коміт
08cb3dc64c

+ 20 - 2
src/api/bpm/components/maintenance/repair.js

@@ -37,7 +37,7 @@ export async function save(data) {
   return Promise.reject(new Error(res.data.message));
 }
 // // 详情
-export async function details (id) {
+export async function details(id) {
   const res = await request.get(`/eam/spare_parts_apply/details/${id}`);
   if (res.data.code == 0) {
     return res.data.data;
@@ -45,7 +45,25 @@ export async function details (id) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
+// 查询设备详情
+export async function getAssetInfo(id) {
+  const res = await request.get(`/main/asset/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 转派
+export async function processAssignment(data) {
+  const res = await request.post(
+    `/eam/workordermaintenance/processAssignment`,
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 // // 保存
 // export async function save (data) {
 //   const res = await request.post('/eam/repairrequest/save', data);

+ 388 - 0
src/views/bpm/handleTask/components/maintenance/repair/WorkOrderTab.vue

@@ -0,0 +1,388 @@
+<!-- 工单信息 -->
+<template>
+  <div class="repairinfoLogs repair_infoLogs">
+    <div>
+      <el-row class="repair_row">
+        <el-col :span="8" class="repair_column">
+          <span>工单编号:</span>
+          <span>{{ workOrderInfo ? workOrderInfo.code : '' }}</span>
+        </el-col>
+        <el-col :span="8" class="repair_column">
+          <span>执行部门:</span>
+          <span>{{ workOrderInfo ? workOrderInfo.executeGroupName : '' }}</span>
+        </el-col>
+        <el-col :span="8" class="repair_column">
+          <span>执行人:</span>
+          <span>{{ workOrderInfo ? workOrderInfo.executeUserName : '' }}</span>
+        </el-col>
+      </el-row>
+      <el-row class="repair_row">
+        <el-col :span="8" class="repair_column">
+          <span>计划单号:</span>
+          <span>{{ workOrderInfo ? workOrderInfo.planCode : '' }}</span>
+        </el-col>
+        <el-col :span="8" class="repair_column">
+          <span>计划名称:</span>
+          <span>{{ workOrderInfo ? workOrderInfo.planName : '' }}</span>
+        </el-col>
+        <el-col :span="8" class="repair_column">
+          <span>计划完成时间:</span>
+          <span>{{ workOrderInfo ? workOrderInfo.planFinishTime : '' }}</span>
+        </el-col>
+      </el-row>
+      <el-row class="repair_row">
+        <el-col :span="8" class="repair_column">
+          <span>设备名称:</span>
+          <span>{{ equipmentInfo ? equipmentInfo.name : '' }}</span>
+        </el-col>
+        <el-col :span="8" class="repair_column">
+          <span>编号:</span>
+          <span>{{ equipmentInfo ? equipmentInfo.codeNumber : '' }}</span>
+        </el-col>
+        <el-col :span="8" class="repair_column">
+          <span>固定资产编码:</span>
+          <span>{{ equipmentInfo ? equipmentInfo.fixCode : '' }}</span>
+        </el-col>
+      </el-row>
+      <el-row
+        class="repair_row"
+        v-if="workOrderInfo.finishTime && workOrderInfo.acceptTime"
+      >
+        <el-col :span="12" class="repair_column">
+          <span>实际工时(分钟):</span>
+          <span>{{
+            parseInt(
+              (new Date(workOrderInfo.finishTime).getTime() -
+                new Date(workOrderInfo.acceptTime).getTime()) /
+                60000
+            )
+          }}</span>
+        </el-col>
+      </el-row>
+    </div>
+    <el-steps
+      direction="vertical"
+      :active="0"
+      :space="100"
+      v-for="(item, index) in repairInfoLogList"
+      :key="index"
+    >
+      <el-step v-if="item.type == 'CREATE'">
+        <span
+          slot="icon"
+          :class="index == 0 ? 'step_icon step_active' : 'step_icon'"
+        ></span>
+        <div slot="title" class="step_title">
+          <span>生成工单</span>
+          <span>{{ logs[item.id].createTime }}</span>
+        </div>
+        <div slot="description" class="create_workerOrder_desc">
+          <div> 报修人:{{ logs[item.id].requestUserName }} </div>
+          <div> 故障描述:{{ logs[item.id].remark }} </div>
+          <div class="work_report_imgs">
+            <el-image
+              v-for="(item, index) in logs[item.id]?.content?.images"
+              :key="index"
+              style="width: 100px; height: 100px; margin-right: 5px"
+              :src="item"
+              :preview-src-list="[item]"
+            />
+          </div>
+        </div>
+      </el-step>
+      <el-step v-if="item.type == 'SPARE_PARTS_APPLY'">
+        <span
+          slot="icon"
+          :class="index == 0 ? 'step_icon step_active' : 'step_icon'"
+        ></span>
+        <div slot="title" class="step_title">
+          <span>备品备件申请</span>
+          <span>{{ logs[item.id].createTime }}</span>
+        </div>
+        <div slot="description" class="work_report_desc">
+          <div>
+            <div>申领清单:</div>
+            <el-table :data="item.content.infoList" border>
+              <el-table-column
+                label="备件物品编码"
+                align="center"
+                prop="code"
+              />
+              <el-table-column label="备件名称" align="center" prop="name" />
+              <el-table-column label="所属分类" prop="typeName" align="center">
+                <template slot-scope="{ row }">
+                  <div>备品备件</div>
+                </template>
+              </el-table-column>
+              <el-table-column label="型号" align="center" prop="modelType" />
+              <el-table-column
+                label="使用数量"
+                prop="packingCountBase"
+                align="center"
+              />
+            </el-table>
+          </div>
+        </div>
+      </el-step>
+      <el-step v-if="item.type == 'ACCEPTANCE_CHEK'">
+        <span
+          slot="icon"
+          :class="index == 0 ? 'step_icon step_active' : 'step_icon'"
+        ></span>
+        <div slot="title" class="step_title">
+          <span>验收</span>
+          <span>{{ logs[item.id].createTime }}</span>
+        </div>
+        <div slot="description" class="step_description">
+          <span>验收人:{{ logs[item.id].content.userName }}</span>
+          <span
+            >验收结果:{{
+              logs[item.id].content.orderStatus == 4 ? '通过' : '驳回'
+            }}</span
+          >
+          <span>验收说明:{{ logs[item.id].content.remark }}</span>
+        </div>
+      </el-step>
+      <el-step v-if="item.type == 'WORK_REPORT'">
+        <span
+          slot="icon"
+          :class="index == 0 ? 'step_icon step_active' : 'step_icon'"
+        ></span>
+        <div slot="title" class="step_title">
+          <span>报工</span>
+          <span>{{ logs[item.id].createTime }}</span>
+        </div>
+        <div slot="description" class="work_report_desc">
+          <div> 报工人:{{ logs[item.id].content?.rawUserName }} </div>
+          <div>
+            辅助人:{{
+              logs[item.id].content.assists?.length > 0
+                ? logs[item.id].content.assists
+                    .map((item) => item.name)
+                    .toString()
+                : ''
+            }}
+          </div>
+          <div> 处理说明:{{ logs[item.id].content.reason }} </div>
+          <div style="display: flex">
+            附件:
+            <fileMain
+              v-model="logs[item.id].content.attachments"
+              type="view"
+            ></fileMain>
+          </div>
+          <div class="work_report_imgs">
+            <el-image
+              v-for="(item, index) in logs[item.id].content?.images"
+              :key="index"
+              style="width: 100px; height: 100px; margin-right: 5px"
+              :src="item"
+              :preview-src-list="logs[item.id].content?.images"
+            />
+          </div>
+        </div>
+      </el-step>
+    </el-steps>
+  </div>
+</template>
+
+<script>
+  export default {
+    components: {},
+    props: {
+      equipmentInfo: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      },
+      repairInfoLogList: {
+        type: Array,
+        default: () => {
+          return [];
+        }
+      },
+      workOrderInfo: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      },
+      planInfo: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      }
+    },
+
+    watch: {
+      repairInfoLogList(val) {
+        console.log('接收的值', val);
+        // val.forEach((item) => {
+        //   if (item.type !== 'SPARE_PARTS_APPLY') {
+        //     this.logs[item.type] = {
+        //       id: item.id,
+        //       content: item.content,
+        //       createTime: item.createTime,
+        //       remark: item.remark,
+        //       requestUserName: item.requestUserName
+        //     };
+        //   } else {
+        //     if (item.content.infoList && item.content.infoList.length > 0) {
+        //       item.content.infoList = item.content.infoList.map((item) => {
+        //         return {
+        //           ...JSON.parse(item.sparePartsList),
+        //           sparePartsId: item.sparePartsId
+        //         };
+        //       });
+        //       this.useData.push(item.content.infoList);
+        //     }
+        //   }
+        // });
+        val.forEach((item) => {
+          this.logs[item.id] = {
+            id: item.id,
+            content: item.content,
+            createTime: item.createTime,
+            type: item.type,
+            remark: item.remark,
+            requestUserName: item.requestUserName
+          };
+          if (item.type === 'SPARE_PARTS_APPLY') {
+            this.logs[item.id].content.infoList =
+              this.logs[item.id].content.infoList &&
+              this.logs[item.id].content.infoList.length > 0
+                ? this.logs[item.id].content.infoList.map((item) => {
+                    return {
+                      ...JSON.parse(item.sparePartsList),
+                      sparePartsId: item.sparePartsId
+                    };
+                  })
+                : [];
+          }
+        });
+        console.log(this.logs);
+        this.logsKeys = Object.keys(this.logs);
+        this.lastStepName = this.logsKeys[0];
+        // val.forEach((item) => {
+        //   this.logs[item.type.code] = {
+        //     id: item.id,
+        //     name: item.type.desc,
+        //     content: JSON.parse(item.content),
+        //     createTime: item.createTime
+        //   };
+        // });
+        // // console.log('this.logs',this.logs)
+        // this.logsKeys = Object.keys(this.logs);
+        // // this.lastStepName = this.logsKeys[this.logsKeys.length - 1]
+        // this.lastStepName = this.logsKeys[0];
+        // this.getUseList();
+        // val.map((item) => {
+        //   if (item.type.code === 'SPARE_PARTS_APPLY') {
+        //     let code = JSON.parse(item.content).sparePartsCode;
+        //     getSparePartDetail(code).then((res) => {
+        //       if (res?.success) {
+        //         item.applyList = res.data.sparePartsApplyDetailList;
+        //       }
+        //     });
+        //   }
+        // });
+        // console.log('val', val);
+      }
+    },
+    data() {
+      return {
+        logs: {},
+        logsKeys: [],
+        lastStepName: '',
+        useData: [],
+        workOrderCode: ''
+      };
+    },
+    methods: {
+      // 获取申请明细列表
+      getApplyList() {
+        getSparePartDetail().then((res) => {});
+      },
+
+      // 获取使用明细列表
+      getUseList() {
+        let params = {
+          sourceCode: this.workOrderInfo.workOrderCode,
+          status: true
+        };
+        getUseDetail(params).then((res) => {
+          if (res?.success) {
+            this.useData = res.data;
+          }
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .repair_row {
+    margin-bottom: 15px;
+    .repair_column {
+      display: flex;
+      > span {
+        &:first-child {
+          font-weight: 700;
+          text-align: right;
+          width: 120px;
+        }
+      }
+    }
+  }
+  .repairinfoLogs {
+    .step_icon {
+      width: 22px;
+      height: 22px;
+      border: 1px solid #333;
+      border-radius: 50%;
+      box-sizing: border-box;
+      background-color: #fff;
+    }
+    .step_active {
+      border: 0;
+      background-color: #4b7902;
+    }
+    .step_title {
+      width: 400px;
+      color: #000;
+      display: flex;
+      justify-content: space-between;
+    }
+    .step_description {
+      display: flex;
+      padding: 5px 0px;
+      background-color: #f2f2f2;
+      justify-content: space-between;
+      color: #7f7f7f;
+    }
+    ::v-deep .create_workerOrder_desc {
+      display: flex;
+      > div {
+        flex: 1;
+      }
+    }
+    ::v-deep .work_report_desc {
+      padding: 5px 10px;
+      margin-bottom: 30px;
+      background-color: #f2f2f2;
+      color: #7f7f7f;
+      .el-table th.el-table__cell {
+        background-color: #d7d7d7;
+        padding: 0;
+        color: #000;
+        font-weight: 400;
+      }
+      .el-table td.el-table__cell {
+        background-color: #f2f2f2;
+        padding: 0;
+      }
+    }
+  }
+</style>

+ 252 - 0
src/views/bpm/handleTask/components/maintenance/repair/details.vue

@@ -0,0 +1,252 @@
+<template>
+  <!-- 维修工单弹框 -->
+  <div>
+    <el-tabs v-model="detailsTabsActiveName" type="border-card">
+      <el-tab-pane label="工单详情" name="keepInRepair">
+        <WorkOrderTab
+          :repairInfoLogList="repairInfoLogs"
+          :workOrderInfo="workOrderInfo"
+          :equipmentInfo="equipmentInfo"
+        />
+      </el-tab-pane>
+      <el-tab-pane label="设备信息" name="equipment">
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>设备编码:</span>
+            <span>{{ equipmentInfo ? equipmentInfo.code : '' }}</span>
+          </el-col>
+          <el-col :span="12" class="repair_column">
+            <span>权属部门:</span>
+            <span>{{
+              equipmentInfo ? equipmentInfo.ownershipGroupName : ''
+            }}</span>
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>设备名称:</span>
+            <span>{{ equipmentInfo ? equipmentInfo.name : '' }}</span>
+          </el-col>
+          <el-col :span="12" class="repair_column">
+            <span>权属人:</span>
+            <span>{{
+              equipmentInfo ? equipmentInfo.ownershipUserName : ''
+            }}</span>
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>设备分类:</span>
+            <span>{{
+              equipmentInfo.category
+                ? equipmentInfo.category.category.categoryLevelPath
+                : ''
+            }}</span>
+          </el-col>
+          <el-col :span="12" class="repair_column">
+            <span>权属人电话:</span>
+            <span>{{
+              equipmentInfo ? equipmentInfo.ownershipUserMobile : ''
+            }}</span>
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>固定资产编码:</span>
+            <span>{{ equipmentInfo ? equipmentInfo.fixCode : '' }}</span>
+          </el-col>
+          <el-col :span="12" class="repair_column">
+            <span>设备位置:</span>
+            <span>{{
+              equipmentInfo.deviceLocationName +
+              '-' +
+              equipmentInfo.deviceDetailAddress
+            }}</span>
+          </el-col>
+        </el-row>
+ 
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>规格型号:</span>
+            <span>
+              {{
+                equipmentInfo.category &&
+                equipmentInfo.category.category.specification
+              }}|{{
+                equipmentInfo.category &&
+                equipmentInfo.category.category.modelType
+              }}
+            </span>
+          </el-col>
+        </el-row>
+      </el-tab-pane>
+      <el-tab-pane label="报修信息" name="repairApplication">
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>编号:</span>
+            <span>{{ infoData ? infoData.code : '' }}</span>
+          </el-col>
+          <el-col :span="12" class="repair_column">
+            <span>报修时间:</span>
+            <span>{{ infoData ? infoData.createTime : '' }}</span>
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>来源:</span>
+            <span>{{
+              infoData && infoData.sourceType ? infoData.sourceType : ''
+            }}</span>
+          </el-col>
+          <el-col :span="12" class="repair_column">
+            <span>来源编码:</span>
+            <span>{{ infoData ? infoData.sourceCode : '' }}</span>
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>报修部门:</span>
+            <span>{{ infoData ? infoData.requestDeptName : '' }}</span>
+          </el-col>
+          <el-col :span="12" class="repair_column">
+            <span>报修人:</span>
+            <span>{{ infoData ? infoData.requestUserName : '' }}</span>
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>报修人电话:</span>
+            <span>{{ infoData ? infoData.requestUserPhone : '' }}</span>
+          </el-col>
+          <el-col :span="12" class="repair_column">
+            <span>期望完成时间:</span>
+            <span>{{ infoData ? infoData.expectedTime : '' }}</span>
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="24" class="repair_column">
+            <span>故障描述:</span>
+            <span>{{ infoData ? infoData.remark : '' }}</span>
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="24" class="repair_column">
+            <span>图片:</span>
+
+            <el-image
+              v-for="(item, index) in infoData.images"
+              :key="index"
+              style="width: 100px; height: 100px; margin-right: 5px"
+              :src="item"
+              :preview-src-list="infoData.images"
+            />
+          </el-col>
+        </el-row>
+      </el-tab-pane>
+      <el-tab-pane label="备品备件申请单" name="sparePartsApply">
+        <editd :id="workOrderInfo.id" v-if="workOrderInfo" />
+      </el-tab-pane>
+    </el-tabs>
+  </div>
+</template>
+
+<script>
+  import WorkOrderTab from './WorkOrderTab.vue';
+  import {
+    getWorkOrderDetail,
+    getAssetInfo,
+    processAssignment
+  } from '@/api/bpm/components/maintenance/repair';
+  import dictMixins from '@/mixins/dictMixins';
+  import editd from './editd.vue';
+
+  export default {
+    mixins: [dictMixins],
+    props: { businessCode: '' },
+    components: { WorkOrderTab, editd },
+    data() {
+      return {
+        workOrderInfo: {},
+        infoData: {},
+        equipmentInfo: {},
+        repairInfoLogs: [],
+        detailsTabsActiveName: 'keepInRepair'
+      };
+    },
+    created() {
+      this.requestDict('报修来源');
+      this.requestDict('报修状态');
+      this.init();
+    },
+    methods: {
+      async init() {
+        const res = await getWorkOrderDetail(this.businessCode);
+        this.workOrderInfo = res.ticketsInfoResponse;
+        this.infoData = res.repairRequestResponse;
+        this.getSbinfo(res.ticketsInfoResponse.deviceId);
+
+        let repairInfoLogs =
+          res.ticketsInfoResponse.repairLogVOS?.length > 0
+            ? res.ticketsInfoResponse.repairLogVOS.map((item) => {
+                return {
+                  ...item,
+                  requestUserName: res.repairRequestResponse.requestUserName,
+                  remark: res.repairRequestResponse.remark
+                };
+              })
+            : [];
+        this.repairInfoLogs = repairInfoLogs.reverse();
+      },
+      async getTableValue() {
+        return this.infoData;
+      },
+      getSbinfo(params) {
+        getAssetInfo(params).then((res) => {
+          if (res) {
+            this.equipmentInfo = res;
+            this.$set(
+              this.equipmentInfo,
+              'position',
+              res.positionList?.length > 0 && res.positionList[0].pathName
+                ? res.positionList[0].pathName
+                : ''
+            );
+          }
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .repair_row {
+    margin-bottom: 15px;
+    .repair_column {
+      display: flex;
+      > span {
+        &:first-child {
+          font-weight: 700;
+          text-align: right;
+          width: 120px;
+        }
+      }
+    }
+  }
+  .btnbox {
+    display: flex;
+    justify-content: center;
+    margin-top: 10px;
+  }
+  ::v-deep .el-button {
+    padding: 10px 20px;
+    margin-right: 10px;
+  }
+  .textbox {
+    margin-top: 10px;
+  }
+  .textbtnbox {
+    margin-top: 10px;
+    display: flex;
+    justify-content: center;
+  }
+</style>

+ 188 - 0
src/views/bpm/handleTask/components/maintenance/repair/editd.vue

@@ -0,0 +1,188 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <!-- 数据表格 -->
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="tableList"
+        :needPage="false"
+        :toolbar="false"
+      >
+        <template v-slot:totalCount="{ row }">
+          {{ row.totalCount }} {{ row.measuringUnit }}
+        </template>
+
+        <template v-slot:totalPackage="{ row }">
+          {{ row.totalPackage }}
+        </template>
+
+        <template v-slot:totalWeight="{ row }">
+          {{ row.totalWeight }} {{ row.weightUnit }}
+        </template>
+
+        <template v-slot:approvalStatus="{ row }">
+          <span :class="{ 'ele-text-danger': row.approvalStatus == 2 }">
+            {{ statusFormatter(row.approvalStatus) }}
+          </span>
+        </template>
+      </ele-pro-table>
+    </el-card>
+  </div>
+</template>
+
+<script>
+  import { details } from '@/api/bpm/components/maintenance/repair';
+
+  export default {
+    props: {
+      id: ''
+    },
+    components: {},
+    data() {
+      return {
+        loading: false,
+        tableList: [],
+        outputSceneState: [
+          { code: 1, label: '退供出库' },
+          { code: 2, label: '调拨出库' },
+          { code: 3, label: '销售出库' },
+          { code: 4, label: '领用出库' },
+          { code: 5, label: '报废出库' },
+          { code: 6, label: '外协出库' },
+          { code: 7, label: '委外出库' },
+          { code: 8, label: '受托退货出库' },
+          { code: 9, label: '仓库委外出库' },
+          { code: 10, label: '采购退货出库' },
+          { code: 11, label: '自选领用出库' },
+          { code: 12, label: '配料出库' }
+        ],
+        statusOpt: [
+          { label: '审核中', value: 0 },
+          { label: '审核通过', value: 1 },
+          { label: '审核不通过', value: 2 }
+        ]
+      };
+    },
+    computed: {
+      // 表格列配置
+      columns() {
+        return [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '编码',
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'repairCode',
+            label: '工单编码',
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'repairName',
+            label: '工单名称',
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'deviceName',
+            label: '设备名称',
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'fixCode',
+            label: '固资编码',
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'deviceCode',
+            label: '设备编码',
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'receivingDeptName',
+            label: '领用部门',
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'recipientName',
+            label: '领用人',
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'usageTime',
+            label: '领用时间',
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'purpose',
+            label: '用途',
+            align: 'center',
+            minWidth: 110
+          },
+
+          {
+            prop: 'type',
+            label: '出库场景',
+            align: 'center',
+            formatter: (row, column, cellValue) => {
+              return this.outputSceneState.find(
+                (item) => item.code == cellValue
+              )?.label;
+            }
+          },
+
+          {
+            slot: 'approvalStatus',
+            label: '状态',
+            align: 'center'
+          }
+        ];
+      }
+    },
+    watch: {
+      id(val) {
+        console.log(val);
+        if (val) {
+          this.getValue();
+        }
+      }
+    },
+    created() {},
+    methods: {
+      async getValue() {
+        const data = await details(this.id);
+        console.log(data, 'data');
+        this.tableList = data.map((item) => {
+          return {
+            ...item,
+            deviceName: item.deviceList[0].name,
+            fixCode: item.deviceList[0].fixCode,
+            deviceCode: item.deviceList[0].code
+          };
+        });
+      },
+      statusFormatter(status) {
+        const obj = this.statusOpt.find((i) => i.value == status);
+        return obj && obj.label;
+      }
+    }
+  };
+</script>

+ 321 - 0
src/views/bpm/handleTask/components/maintenance/repair/submit.vue

@@ -0,0 +1,321 @@
+<template>
+  <el-col :span="16" :offset="6">
+    <el-form label-width="120px" ref="formRef" :model="form">
+      <el-form-item
+        v-if="
+          taskDefinitionKey === 'Activity_1osbg2j' ||
+          taskDefinitionKey === 'Activity_0voolvb'
+        "
+        :label="
+          (this.taskDefinitionKey == 'Activity_1osbg2j' ? '负责人' : '维修人') +
+          '部门'
+        "
+        style="margin-bottom: 20px"
+      >
+        <deptSelect
+          v-model="form.useDeptId"
+          @changeGroup="searchDeptNodeClick"
+        />
+      </el-form-item>
+      <el-form-item
+        v-if="
+          taskDefinitionKey === 'Activity_1osbg2j' ||
+          taskDefinitionKey === 'Activity_0voolvb'
+        "
+        :label="
+          this.taskDefinitionKey == 'Activity_1osbg2j' ? '负责人' : '维修人'
+        "
+        prop="userId"
+        style="margin-bottom: 20px"
+        :rules="{
+          required: true,
+          message: '请选择',
+          trigger: 'change'
+        }"
+      >
+        <el-select
+          v-model="form.userId"
+          clearable
+          style="width: 100%"
+          :filterable="true"
+        >
+          <el-option
+            v-for="item in userOptions"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          />
+        </el-select>
+      </el-form-item>
+
+      <el-form-item
+        v-if="taskDefinitionKey === 'Activity_0voolvb'"
+        label="协助维修部门"
+        style="margin-bottom: 20px"
+      >
+        <deptSelect
+          v-model="form.useDeptIdNew"
+          @changeGroup="searchDeptNodeClickNew"
+        />
+      </el-form-item>
+      <el-form-item
+        v-if="taskDefinitionKey === 'Activity_0voolvb'"
+        label="协助维修人"
+        prop="userIdNew"
+        style="margin-bottom: 20px"
+      >
+        <el-select
+          v-model="form.userIdNew"
+          clearable
+          style="width: 100%"
+          :filterable="true"
+          multiple
+        >
+          <el-option
+            v-for="item in userOptionsNew"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        label="审批建议"
+        style="margin-bottom: 20px"
+        :rules="{
+          required: true,
+          message: '请选择',
+          trigger: 'change'
+        }"
+      >
+        <el-input
+          type="textarea"
+          v-model="form.reason"
+          placeholder="请输入审批建议"
+        />
+      </el-form-item>
+    </el-form>
+    <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        @click="handleAudit(1)"
+        >通过
+      </el-button>
+      <!-- <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        @click="processAssignment()"
+        v-if="taskDefinitionKey === 'Activity_0voolvb'"
+        >确定指派人
+      </el-button> -->
+
+      <!-- <el-dropdown
+        @command="(command) => handleCommand(command)"
+        style="margin-left: 30px"
+      >
+        <span class="el-dropdown-link">
+          更多<i class="el-icon-arrow-down el-icon--right"></i>
+        </span>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item command="cancel">作废</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown> -->
+      <!-- 
+      <el-button
+        icon="el-icon-circle-close"
+        type="danger"
+        size="mini"
+        @click="rejectTask(0)"
+        >驳回
+      </el-button> -->
+    </div>
+  </el-col>
+</template>
+
+<script>
+  import {
+    approveTaskWithVariables,
+    rejectTask,
+    cancelTask
+  } from '@/api/bpm/task';
+  import { listAllUserBind } from '@/api/system/organization';
+  import { processAssignment } from '@/api/bpm/components/maintenance/repair';
+
+  import deptSelect from '@/components/CommomSelect/dept-select.vue';
+  import { getUserPage } from '@/api/system/organization';
+  import { mapGetters } from 'vuex';
+
+  // 流程实例的详情页,可用于审批
+  export default {
+    name: '',
+    components: {
+      deptSelect
+    },
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskId: {
+        default: ''
+      },
+      id: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        default: ''
+      }
+    },
+    data() {
+      return {
+        form: {
+          userId: '',
+          userIdNew: '',
+          reason: '',
+          useDeptId: '',
+          useDeptIdNew: ''
+        },
+        userOptions: [],
+        userOptionsNew: [],
+        isSaveLoading: false
+      };
+    },
+    computed: {
+      ...mapGetters(['user'])
+    },
+    created() {
+      this.userOptions = [];
+      listAllUserBind().then((data) => {
+        this.userOptions.push(...data);
+      });
+    },
+    methods: {
+      /** 处理转办审批人 */
+      handleUpdateAssignee() {
+        this.$emit('handleUpdateAssignee');
+      },
+      /** 退回 */
+      handleBackList() {
+        this.$emit('handleBackList');
+      },
+      searchDeptNodeClick(val) {
+        console.log(val, 'val');
+        getUserPage({
+          groupId: val,
+          size: 999
+        }).then((data) => {
+          this.userOptions = data.list;
+        });
+      },
+      searchDeptNodeClickNew(val) {
+        console.log(val, 'val');
+        getUserPage({
+          groupId: val,
+          size: 999
+        }).then((data) => {
+          this.userOptionsNew = data.list;
+        });
+      },
+      async handleAudit(status) {
+        let variables = {
+          pass: !!status
+        };
+        //收单办公室
+        if (this.taskDefinitionKey === 'Activity_1osbg2j') {
+          if (!this.form.userId) {
+            this.$message.warning(`请选择负责人!`);
+            return;
+          }
+          variables.userId = this.form.userId;
+        }
+
+        if (this.taskDefinitionKey === 'Activity_0voolvb') {
+          if (!this.form.userId) {
+            this.$message.warning(`请选择维修人!`);
+            return;
+          }
+          await processAssignment({
+            workOrderId: this.businessId,
+            executeUserId: this.form.userId,
+            assists: this.form.userIdNew.toString()
+          });
+          variables.userId = this.user.info.userId;
+        }
+        if (this.taskDefinitionKey === 'Activity_124p6g9') {
+          const data = await this.getTableValue();
+          if (data?.orderStatus < 3) {
+            return this.$message.warning(`请先报工!`);
+          }
+        }
+        // return;
+        // //采购员核对
+        // if (this.taskDefinitionKey === 'purchaserCheck') {
+        //   let arr = await this.getTableValue();
+        //   if (!arr) {
+        //     return;
+        //   }
+        //   await UpdateInformation(arr);
+        // }
+        let API = !!status ? approveTaskWithVariables : rejectTask;
+        API({
+          id: this.taskId,
+          reason: this.form.reason,
+          variables
+        });
+        this.$emit('handleAudit', {
+          status,
+          title: status === 0 ? '驳回' : ''
+        });
+      },
+      rejectTask(status) {
+        rejectTask({
+          id: this.taskId,
+          reason: this.form.reason,
+          variables: {
+            pass: !!status
+          }
+        });
+        this.$emit('handleAudit', {
+          status,
+          title: status === 0 ? '驳回' : ''
+        });
+      },
+      getTableValue() {
+        return new Promise((resolve, reject) => {
+          this.$emit('getTableValue', async (data) => {
+            resolve(await data);
+          });
+        });
+      },
+      //更多
+      handleCommand(command) {
+        if (command === 'cancel') {
+          this.$confirm('是否确认作废?', {
+            type: 'warning',
+            cancelButtonText: '取消',
+            confirmButtonText: '确定'
+          })
+            .then(() => {
+              cancelTask({
+                id: this.id,
+                taskId: this.taskId,
+                reason: this.form.reason,
+                businessId: this.businessId
+              })
+                .then(() => {
+                  this.$emit('handleClose');
+                })
+                .catch(() => {
+                  this.$message.error('流程作废失败');
+                });
+            })
+            .catch(() => {});
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss"></style>

+ 3 - 0
src/views/bpm/handleTask/index.vue

@@ -24,6 +24,7 @@
           <async-biz-form-component
             :taskId="listData?.taskId"
             :businessId="listData?.businessId"
+            :businessCode="listData?.businessCode"
             :id="listData?.id"
             :processDefinitionId="processInstance.processDefinition.id"
             :taskDefinitionKey="listData?.taskDefinitionKey"
@@ -353,7 +354,9 @@
           pcHandleRouter: '',
           pcViewRouter: '',
           businessId: '', // 业务id
+          businessCode:'',//业务编码
           taskDefinitionKey: '',
+          
           taskId: '' //任务编码
         },
 

+ 1 - 0
src/views/bpm/todo/index.vue

@@ -314,6 +314,7 @@
             this.$refs.handleTaskRef.open({
               id: row.processInstance.id,
               businessId: row.businessId,
+              businessCode: row.businessCode,
               taskId: row.id,
               taskDefinitionKey: row.taskDefinitionKey,
               pcHandleRouter: row.pcHandleRouter,