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

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/views/bpm/handleTask/components/saleOrder/saleReturnGoods/detailDialog.vue
#	src/views/bpm/handleTask/components/saleOrder/saleReturnGoods/submit.vue
Z 2 лет назад
Родитель
Сommit
cfd94ffb74
23 измененных файлов с 6282 добавлено и 97 удалено
  1. 46 0
      src/api/tickets/index.js
  2. 3 2
      src/utils/dict/tickets.js
  3. 5 2
      src/views/bpm/doneTickets/index.vue
  4. 757 0
      src/views/bpm/doneTickets/repair/detail.vue
  5. 341 0
      src/views/bpm/doneTickets/repair/index.vue
  6. 9 3
      src/views/bpm/handleTask/components/measuringToolInspection/detailDialog.vue
  7. 339 0
      src/views/bpm/handleTask/components/measuringToolInspection/submit copy.vue
  8. 38 68
      src/views/bpm/handleTask/components/measuringToolInspection/submit.vue
  9. 6 5
      src/views/bpm/handleTask/components/productionWarehousing/productionWarehousing.vue
  10. 2 2
      src/views/bpm/handleTask/components/purchaseOrder/outSourceSend/outsourcingOutbound.vue
  11. 0 1
      src/views/bpm/handleTask/components/purchaseOrder/outsourceSendReturnGoods/entrustedStorage.vue
  12. 1971 0
      src/views/bpm/handleTask/components/saleOrder/saleReturnGoods/salesReturnReceipt.vue
  13. 2 0
      src/views/bpm/stockManagement/components/WareHouseDailog.vue
  14. 597 0
      src/views/bpm/tickets/components/RepairDetailsDialog.vue
  15. 303 0
      src/views/bpm/tickets/components/RepairNotesTab.vue
  16. 675 0
      src/views/bpm/tickets/components/WorkOrderTab.vue
  17. 16 1
      src/views/bpm/tickets/components/signingUpWork.vue
  18. 7 1
      src/views/bpm/tickets/delivery/index.vue
  19. 16 5
      src/views/bpm/tickets/index.vue
  20. 4 3
      src/views/bpm/tickets/maintenance/index.vue
  21. 5 4
      src/views/bpm/tickets/patrolInspection/index.vue
  22. 757 0
      src/views/bpm/tickets/repair/detail.vue
  23. 383 0
      src/views/bpm/tickets/repair/index.vue

+ 46 - 0
src/api/tickets/index.js

@@ -73,3 +73,49 @@ export async function getUserPage(params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+// 维修工单列表
+export async function getWorkOrderList(data) {
+  const res = await request.get('/eam/workorder/getWorkOrderList', {
+    params: data
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 维修工单详情
+export async function getRepairById(id) {
+  const res = await request.get(`/eam/repairrequest/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+export async function getWorkOrderDetail(code) {
+  const res = await request.get('/eam/workorder/getWorkOrderDetail/' + code);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  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 acceptance(data) {
+  const res = await request.post('/eam/workorder/acceptance', data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 3 - 2
src/utils/dict/tickets.js

@@ -1,7 +1,8 @@
 // 工单状态
 export const ticketStatus = [
   { id: 0, label: '待接收' },
-  // { id: 1, label: '已接收' },
+  { id: 1, label: '已接收' },
   { id: 2, label: '执行中' },
-  { id: 3, label: '已完成' }
+  { id: 3, label: '已完成' },
+  { id: 4, label: '已验收' }
 ];

+ 5 - 2
src/views/bpm/doneTickets/index.vue

@@ -27,18 +27,21 @@
   import patrolInspection from './patrolInspection';
   import maintenance from './maintenance';
   import delivery from './delivery';
+  import repair from './repair';
   export default {
     components: {
       patrolInspection,
       maintenance,
-      delivery
+      delivery,
+      repair
     },
     data() {
       return {
         activeComp: 'patrolInspection',
         tabOptions: [
           { key: 'patrolInspection', name: '巡点检工单' },
-          { key: 'maintenance', name: '保养工单' }
+          { key: 'maintenance', name: '保养工单' },
+          { key: 'repair', name: '维修工单' }
           // { key: 'delivery', name: '量具送检工单' }
           // { key: 'repair', name: '计划性维修工单' },
           // { key: 'malfunction', name: '盘点工单' }

+ 757 - 0
src/views/bpm/doneTickets/repair/detail.vue

@@ -0,0 +1,757 @@
+<template>
+  <div class="page" v-loading="pageLoading">
+    <el-form label-width="130px">
+      <div class="content-detail" v-show="num == 1">
+        <div class="basic-details">
+          <HeaderTitle title="基本信息" size="16px">
+            <el-button
+              type="primary"
+              @click="
+                $router.push({
+                  path: '/tickets',
+                  query: { title: '巡点检工单' }
+                })
+              "
+              >返回</el-button
+            >
+          </HeaderTitle>
+          <el-row>
+            <el-col :span="12">
+              <el-col :span="12">
+                <el-form-item label="计划单号">
+                  <span> {{ infoData.planCode }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="来源计划配置单号">
+                  <span> {{ infoData.planConfigCode }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="名称">
+                  <span> {{ infoData.planName }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="部门">
+                  <span>
+                    {{ infoData.executeGroupName }}
+                  </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="人员">
+                  <span>
+                    {{ infoData.executeUserName }}
+                  </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="计划完成时长">
+                  <span v-if="infoData.duration >= 0"
+                    >{{ infoData.duration }}分钟</span
+                  >
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="周期">
+                  <span v-if="infoData.ruleInfo">
+                    {{ infoData.ruleInfo.cycleValue
+                    }}{{
+                      getDictValue('巡点检周期', infoData.ruleInfo.cycleType)
+                    }}
+                  </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="设备分类">
+                  <span> {{ infoData.categoryLevelName }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="规则名称">
+                  <span>
+                    {{ infoData.ruleName }}
+                  </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="创建部门">
+                  <span> {{ infoData.createGroupName }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="创建人">
+                  <span> {{ infoData.createUserName }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="创建时间">
+                  <span> {{ infoData.createTime }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="备注">
+                  <span> {{ infoData.remark }} </span>
+                </el-form-item>
+              </el-col>
+            </el-col>
+            <el-col :span="12">
+              <img :src="data.imageUrl" alt="" />
+            </el-col>
+          </el-row>
+        </div>
+
+        <!-- 巡点检、执行信息 -->
+        <!-- <div class="execute_info">
+          <div class="execute_info_title">
+            <span>执行信息</span>
+            <span
+              >执行人:{{ data.executeUserName }}
+              <i style="margin: 0 18px"></i> 执行时间:{{
+                data.acceptTime
+              }}</span
+            >
+          </div>
+          <HeaderTitle title="执行信息" size="16px"></HeaderTitle>
+          <el-row class="execute_row">
+            <el-col :span="8" class="column">
+              <span class="label">确认结果:</span>
+              <span class="value">{{
+                infoData.status ? infoData.status.descp : ''
+              }}</span>
+            </el-col>
+            <el-col :span="8" class="column">
+              <span class="label">实际开始时间:</span>
+              <span class="value">{{ infoData.acceptTime }}</span>
+            </el-col>
+            <el-col :span="8" class="column">
+              <span class="label">实际结束时间:</span>
+              <span class="value">{{ infoData.finishTime }}</span>
+            </el-col>
+            <el-col :span="24" class="column">
+              <span class="label">超期原因:</span>
+              <span class="value">{{ infoData.timeoutCause }}</span>
+            </el-col>
+          </el-row>
+        </div> -->
+
+        <!-- 巡点检、保养设备 -->
+        <div class="maintain_equipment_info">
+          <HeaderTitle title="巡点检设备" size="16px"></HeaderTitle>
+          <div class="maintain_equipment_info_content">
+            <div
+              class="equipment_item"
+              v-for="item in infoData.deviceList"
+              :key="item.id"
+            >
+              <div class="equipment_info" v-if="item.substance">
+                <div class="item_info">
+                  <span class="item_label">设备编码</span>
+                  <span class="item_value">{{ item.substance.code }}</span>
+                </div>
+                <div class="item_info">
+                  <span class="item_label">设备名称</span>
+                  <span class="item_value">{{ item.substance.name }}</span>
+                </div>
+                <div class="item_info">
+                  <span class="item_label">设备型号</span>
+                  <span class="item_value">{{ item.substance.model }}</span>
+                </div>
+                <div class="item_info">
+                  <span class="item_label">设备位置</span>
+                  <span class="item_value">{{
+                    item.substance.positionNames
+                  }}</span>
+                </div>
+              </div>
+              <p>操作事项</p>
+              <div class="ruleMatters_box">
+                <el-table :data="item.workItems" border>
+                  <el-table-column label="序号" width="50">
+                    <template slot-scope="scope">
+                      <span>{{ scope.$index + 1 }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="事项" prop="name" width="100">
+                    <template slot-scope="scope">
+                      <div>
+                        <span>{{ scope.row.name }}</span>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="内容" prop="content" width="300">
+                    <template slot-scope="scope">
+                      <div>
+                        <span>{{ scope.row.content }}</span>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="操作指导" prop="operationGuide">
+                    <template slot-scope="scope">
+                      <div class="operationGuide_box">
+                        <div class="left_content">
+                          <template v-if="scope.row.operationGuide">
+                            <div
+                              v-for="(item, index) in scope.row.operationGuide
+                                .toolList"
+                              :key="item.id"
+                              >{{ index + 1 }}.{{ item.name }}</div
+                            >
+                          </template>
+                        </div>
+                        <div class="line"></div>
+                        <div class="right_content">
+                          <template v-if="scope.row.operationGuide">
+                            <div
+                              v-for="(item, index) in scope.row.operationGuide
+                                .procedureList"
+                              :key="item.id"
+                              >{{ index + 1 }}.{{ item.content }}</div
+                            >
+                          </template>
+                        </div>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="标准" prop="norm" width="100">
+                    <template slot-scope="scope">
+                      <div>
+                        <span>{{ scope.row.norm }}</span>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="状态" prop="status" width="100">
+                    <template slot-scope="scope">
+                      <div>
+                        <span>{{ options[scope.row.status] }}</span>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="结果" prop="result" width="200">
+                  </el-table-column>
+                </el-table>
+              </div>
+            </div>
+            <!-- <div class="btnbox" v-if="$route.query.isshow">
+              <el-button class="confirm-btn" type="danger" plain @click="reject"
+                >驳回</el-button
+              >
+              <el-button class="confirm-btn" type="success" plain @click="pass"
+                >通过</el-button
+              >
+              <el-button class="cancel-btn">关闭</el-button>
+            </div> -->
+            <!-- <div class="textbox" v-if="showtext">
+              <el-input
+                type="textarea"
+                placeholder="请输入驳回原因"
+                v-model="cause"
+                maxlength="30"
+                rows="5"
+                show-word-limit
+              >
+              </el-input>
+              <div class="textbtnbox">
+                <el-button size="small" round @click="cancelreject"
+                  >取消</el-button
+                >
+                <el-button size="small" round @click="surereject"
+                  >提交</el-button
+                >
+              </div>
+            </div> -->
+          </div>
+        </div>
+
+        <!-- 巡点检、缺陷设备报修记录 -->
+        <!-- <div class="repair_notes">
+          <HeaderTitle title="缺陷设备报修记录" size="16px"></HeaderTitle>
+          <div class="repair_notes_equipment_item">
+            <el-row class="equipment_item_tilte">
+              <el-col :span="8">
+                <span class="label">设备名称:</span>
+                <span>{{ repairNotes.equiName }}</span>
+              </el-col>
+              <el-col :span="8">
+                <span class="label">规格型号:</span>
+                <span>{{ repairNotes.equiModel }}</span>
+              </el-col>
+              <el-col :span="8">
+                <span class="label">设备编码:</span>
+                <span>{{ repairNotes.equiCode }}</span>
+              </el-col>
+            </el-row>
+            <div class="main_info">
+              <div>
+                <span>报修记录编号:</span>
+                <span>{{ repairNotes.repairsCode }}</span>
+              </div>
+              <div>
+                <span>故障描述:</span>
+                <span>{{ repairNotes.repairsDescription }}</span>
+              </div>
+              <div>
+                <span>处理进度:</span>
+                <span>{{ statusObj[repairNotes.status] }}</span>
+              </div>
+            </div>
+          </div>
+        </div> -->
+      </div>
+    </el-form>
+  </div>
+</template>
+
+<script>
+  import dictMixins from '@/mixins/dictMixins';
+  import { getWordOrderDetail } from '@/api/tickets';
+  export default {
+    mixins: [dictMixins],
+    data() {
+      return {
+        options: {
+          0: '正常',
+          '-1': '缺陷'
+        },
+        num: 1,
+        infoData: {},
+        dialogVisible: false,
+        data: {},
+        repairNotes: {},
+        pageLoading: false,
+        typeValue: null,
+        contract_type: [],
+        status: [
+          {
+            value: true,
+            label: '失效'
+          },
+          {
+            value: false,
+            label: '生效'
+          }
+        ],
+        ruleItem: [],
+        cause: '',
+        showtext: false,
+        from: null
+      };
+    },
+    created() {
+      this.requestDict('巡点检周期');
+      this.getInfo();
+    },
+    methods: {
+      // getStatus: useDictLabel(patrolMatterStatus),
+      delete() {},
+      // 点击切换事件
+      tab(index) {
+        this.num = index;
+      },
+      goBack() {
+        window.sessionStorage.setItem('patrolTabType', 'work');
+        if (this.form) {
+          this.$router.push({
+            path: '/workspace/workOrder',
+            query: { activeName: 'polling' }
+          });
+        } else {
+          this.$router.go(-1);
+        }
+      },
+      // 表格数据
+      getInfo() {
+        this.pageLoading = true;
+        getWordOrderDetail(this.$route.query.id)
+          .then((data) => {
+            this.infoData = data;
+            // if (res.success) {
+            //   this.data = res.data;
+            //   this.data.planEquiList = this.data.planEquiList.filter(
+            //     (item) => item.itemList && item.itemList.length > 0
+            //   );
+            //   // 获取 缺陷设备报修记录
+            //   const repairId = res.data.planEquiList[0].repairId;
+            //   if (repairId) {
+            //     this.getRepairNotes(repairId);
+            //   }
+            // }
+            this.pageLoading = false;
+          })
+          .catch(() => {
+            this.pageLoading = false;
+          });
+      },
+      // 获取 缺陷设备报修记录
+      async getRepairNotes(repairId) {
+        const res = await repair.getInfo(repairId);
+        if (res?.success) {
+          console.log('缺陷设备报修记录:', res.data);
+          this.repairNotes = res.data;
+        }
+      },
+      //通过按钮事件
+      pass() {
+        let params = {
+          planId: this.$route.query.id,
+          checked: 2,
+          myHandleId: this.$route.query.dbid,
+          cause: this.cause,
+          type: 2, //1维修;2保养,巡点检
+          handleType: 0 //办理类型(0 审批 1 验收)
+        };
+        sendAudit(params).then((res) => {
+          if (res.success) {
+            this.$message.success('审批通过!');
+            this.$router.back();
+          }
+        });
+      },
+      //驳回按钮事件
+      reject() {
+        this.showtext = true;
+      },
+      cancelreject() {
+        this.showtext = false;
+        this.cause = '';
+      },
+      surereject() {
+        if (!this.cause) {
+          this.$message.info('请填写驳回原因!');
+        } else {
+          let params = {
+            id: this.$route.query.id,
+            checked: 0,
+            myHandleId: this.$route.query.dbid,
+            cause: this.cause,
+            type: 2, //1维修;2保养,巡点检
+            handleType: 0 //办理类型(0 审批 1 验收)
+          };
+          sendAudit(params).then((res) => {
+            if (res.success) {
+              this.$message.error('审批驳回!');
+              this.$router.back();
+            }
+          });
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  // @import '@/assets/css/oaa.scss';
+  .page {
+    padding: 10px;
+  }
+  .page-title {
+    background: #fff;
+    font-size: 18px;
+    padding: 6px 20px;
+    font-weight: 500;
+    .page-title-div {
+      margin: 5px 0;
+      height: 30px;
+      line-height: 30px;
+      border-bottom: 1px solid #eaeefb;
+      .title-div-no {
+        margin-left: 10px;
+        font-weight: 400;
+        color: #909090;
+        font-size: 14px;
+      }
+    }
+  }
+  .page-data {
+    padding-top: 10px;
+  }
+  .content-detail {
+    background: #fff;
+    padding: 20px;
+  }
+  .flows {
+    .flow-left {
+      width: 156px;
+      height: 70px;
+      border: 1px dashed #ccc;
+      padding: 10px;
+    }
+    .row {
+      margin-top: 13px;
+    }
+  }
+  .basic-details-title {
+    margin-bottom: 12px;
+    margin-top: 20px;
+    border-bottom: 1px solid #1890ff;
+    padding-bottom: 8px;
+    display: flex;
+    justify-content: space-between;
+  }
+  .basic-details-title .border-span {
+    height: 18px;
+    font-size: 16px;
+    border-left: 4px solid #1890ff;
+    padding-left: 8px;
+
+    font-weight: 500;
+  }
+  .heade-right {
+    // float: right;
+    .heade-right-content {
+      margin-right: 12px;
+      font-size: 14px;
+      display: inline-block;
+      .content-key {
+        color: #3e3e3e;
+        margin-right: 12px;
+        font-weight: 500;
+      }
+      .content-value {
+        color: #000;
+      }
+    }
+  }
+  .list-title {
+    font-size: 14px;
+    color: #3e3e3e;
+    margin: 10px 0px;
+  }
+  .goods {
+    background: #a30014;
+    border: 1px solid #a30014;
+  }
+  .details-title {
+    display: inline-block;
+    color: #6e6e6e;
+    font-size: 14px;
+    font-weight: bold;
+    margin-right: 13px;
+    width: 70px;
+    text-align: right;
+  }
+  .details-con {
+    color: #3e3e3e;
+    font-size: 14px;
+  }
+  .detailed-tab {
+    margin-left: 10px;
+    margin-top: 10px;
+  }
+  ::v-deep .el-form-item--medium .el-form-item__label {
+    color: #6e6e6e;
+    font-size: 14px;
+    font-weight: bold;
+  }
+  .warehouse {
+    display: block;
+    border-bottom: 1px solid #eaeefb;
+    padding: 10px 0;
+  }
+  .box-card {
+    .store-box {
+      width: 80%;
+      .store-box-span {
+        display: inline-block;
+        font-size: 14px;
+        height: 50px;
+        width: 50px;
+        text-align: center;
+        line-height: 50px;
+        color: #fff;
+        margin: 2px;
+      }
+    }
+  }
+  .vacant {
+    background: #3196fb;
+  }
+  .inUse {
+    background: #157a2c;
+  }
+  .invalid {
+    background: #cccccc;
+  }
+  .full {
+    background: #cc3300;
+  }
+
+  .maintain_equipment_info {
+    .maintain_equipment_info_title {
+      border-bottom: 1px solid #1890ff;
+      padding-bottom: 3px;
+      margin-bottom: 20px;
+      > span {
+        display: inline-block;
+        line-height: 16px;
+        border-left: 6px solid #1890ff;
+        padding-left: 6px;
+      }
+    }
+    .maintain_equipment_info_content {
+      padding: 0 30px;
+      .equipment_item {
+        border: 1px solid #ccc;
+        font-size: 14px;
+        padding: 15px;
+        margin-bottom: 30px;
+        .equipment_info {
+          display: flex;
+          flex-wrap: wrap;
+          border: 1px solid #ddd;
+          .item_info {
+            width: 33.33%;
+            height: 24px;
+            line-height: 24px;
+            display: flex;
+            .item_label {
+              width: 90px;
+              text-align: center;
+              background-color: #f2f2f2;
+              font-weight: 700;
+            }
+            .item_value {
+              border-bottom: 1px solid #f2f2f2;
+              flex: 1;
+              padding-left: 5px;
+            }
+            &:last-child {
+              width: 100%;
+              .item_value {
+                border: 0;
+              }
+            }
+          }
+        }
+        > p {
+          margin-top: 20px;
+          color: #797979;
+        }
+        .matter_info {
+          ::v-deep .el-table {
+            th.el-table__cell {
+              background-color: #f2f2f2;
+              padding: 0;
+            }
+            td.el-table__cell {
+              padding: 0;
+            }
+          }
+        }
+        .ruleMatters_box {
+          flex: 3;
+          height: 100%;
+          display: flex;
+          flex-direction: column;
+          .divider {
+            flex: 0 0 50px;
+            .title {
+              height: 35px;
+            }
+          }
+          .el-table {
+            overflow: auto;
+            .operationGuide_box {
+              width: 100%;
+              display: flex;
+              position: relative;
+              .left_content {
+                flex: 0 0 300px;
+                padding: 10px;
+                margin-right: 10px;
+                overflow-y: auto;
+              }
+              .line {
+                position: absolute;
+                top: -10px;
+                left: 300px;
+                bottom: -10px;
+                height: 110%;
+                width: 1px;
+                background-color: #ededed;
+              }
+              .right_content {
+                flex: 1;
+                padding: 10px;
+                overflow-y: auto;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  .execute_info {
+    margin: 30px 0;
+    .execute_info_title {
+      border-bottom: 1px solid #1890ff;
+      padding-bottom: 3px;
+      margin-bottom: 20px;
+      display: flex;
+      justify-content: space-between;
+      > span:first-child {
+        line-height: 16px;
+        border-left: 6px solid #1890ff;
+        padding-left: 6px;
+      }
+    }
+    .execute_row {
+      padding: 0 30px;
+      .column {
+        display: flex;
+        font-size: 14px;
+        margin-bottom: 20px;
+        .label {
+          // width: 110px;
+          text-align: center;
+          font-weight: 700;
+        }
+      }
+    }
+  }
+  .repair_notes {
+    .repair_notes_title {
+      border-bottom: 1px solid #1890ff;
+      padding-bottom: 3px;
+      margin-bottom: 20px;
+      > span {
+        display: inline-block;
+        line-height: 16px;
+        border-left: 6px solid #1890ff;
+        padding-left: 6px;
+      }
+    }
+    .repair_notes_equipment_item {
+      padding: 0 20px;
+      .equipment_item_tilte {
+        background-color: #f7f7f7;
+        height: 36px;
+        line-height: 36px;
+        .label {
+          font-weight: 700;
+        }
+      }
+      .main_info {
+        font-size: 14px;
+        margin-top: 15px;
+        > div {
+          margin-bottom: 10px;
+        }
+      }
+    }
+  }
+  .btnbox {
+    display: flex;
+    justify-content: center;
+  }
+  ::v-deep .el-button {
+    padding: 10px 20px;
+    margin-right: 10px;
+  }
+  .textbtnbox {
+    margin-top: 10px;
+    display: flex;
+    justify-content: center;
+  }
+</style>

+ 341 - 0
src/views/bpm/doneTickets/repair/index.vue

@@ -0,0 +1,341 @@
+<!-- 巡点检工单 -->
+<template>
+  <div class="patrolInspection">
+    <div class="search">
+      <el-form label-width="120px">
+        <el-row>
+          <el-col :md="4" :sm="8" :xs="8">
+            <el-form-item label="工单编号">
+              <el-input
+                v-model="searchForm.code"
+                placeholder="请输入"
+                size="small"
+              ></el-input> </el-form-item
+          ></el-col>
+          <el-col :md="4" :sm="8" :xs="8">
+            <el-form-item label="规则名称">
+              <el-select
+                v-model="searchForm.ruleId"
+                size="small"
+                clearable
+                style="width: 100%"
+                filterable
+              >
+                <el-option
+                  v-for="item in ruleNameList"
+                  :key="item.id"
+                  :value="item.id"
+                  :label="item.name"
+                ></el-option> </el-select></el-form-item
+          ></el-col>
+          <!-- <el-col :md="4" :sm="8" :xs="8">
+            <el-form-item label="状态">
+              <el-select
+                filterable
+                clearable
+                v-model="searchForm.orderStatus"
+                size="small"
+              >
+                <el-option
+                  v-for="item in ticketStatus"
+                  :key="item.id"
+                  :value="item.id"
+                  :label="item.label"
+                ></el-option>
+              </el-select> </el-form-item
+          ></el-col> -->
+          <el-col :md="8" :sm="8" :xs="8">
+            <el-form-item label="开始结束时间">
+              <el-date-picker
+                class="form-input"
+                size="small"
+                v-model="searchForm.date"
+                type="daterange"
+                range-separator="至"
+                start-placeholder="开始日期"
+                end-placeholder="结束日期"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                :default-time="['00:00:00', '23:59:59']"
+              >
+              </el-date-picker> </el-form-item
+          ></el-col>
+          <el-col :md="4" :sm="16" :xs="16" style="text-align: right">
+            <el-button icon="el-icon-refresh-left" size="small" @click="rest"
+              >重置</el-button
+            >
+            <el-button
+              type="primary"
+              icon="el-icon-search"
+              size="small"
+              @click="search"
+              >搜索</el-button
+            ></el-col
+          >
+        </el-row>
+      </el-form>
+    </div>
+    <div class="table">
+      <el-table
+        :data="tableData"
+        border
+        height="99%"
+        tooltip-effect="dark"
+        :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
+      >
+        <el-table-column
+          width="80px"
+          label="序号"
+          type="index"
+          :index="indexMethod"
+        >
+        </el-table-column>
+        <el-table-column prop="code" label="工单编号" />
+        <el-table-column prop="planCode" label="计划单号" />
+        <el-table-column prop="planName" label="维修名称" />
+        <!-- <el-table-column prop="createTime" label="设备分类" /> -->
+        <el-table-column prop="ruleName" label="规则名称" />
+        <el-table-column prop="createUserName" label="创建人" />
+        <el-table-column prop="createTime" label="创建时间" />
+        <el-table-column prop="acceptTime" label="开始时间" />
+        <el-table-column prop="finishTime" label="结束时间" />
+        <el-table-column prop="planFinishTime" label="计划完成时间" />
+        <el-table-column prop="orderStatus" label="执行结果">
+          <template slot-scope="{ row }">
+            {{ { 0: '缺陷', 1: '正常' }[row.isAbnormal] }}
+          </template>
+        </el-table-column>
+        <el-table-column prop="orderStatus" label="状态">
+          <template slot-scope="{ row }">
+            {{
+              ticketStatus.filter((item) => item.id == row.orderStatus)[0].label
+            }}
+          </template>
+        </el-table-column>
+        <el-table-column prop="practicalTime" label="实际工时">
+          <template slot-scope="{ row }">
+            {{ time_interval(row.acceptTime, row.finishTime) }}
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" width="150">
+          <template slot-scope="{ row }">
+            <el-link
+              v-if="row.orderStatus !== 3 && row.orderStatus !== 4"
+              type="primary"
+              :underline="false"
+              icon="el-icon-edit"
+              @click="toSigningUpWork(row)"
+            >
+              报工
+            </el-link>
+            <el-link
+              v-if="row.orderStatus !== 3 && row.orderStatus !== 4"
+              type="primary"
+              :underline="false"
+              icon="el-icon-edit"
+              @click="toRedeploy(row)"
+            >
+              转派
+            </el-link>
+            <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-edit"
+              @click="openDetail(row)"
+            >
+              详情
+            </el-link>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <div class="table-footer">
+      <el-pagination
+        background
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="total"
+        :page-sizes="[15, 30, 50, 100, 500]"
+        :page-size.sync="pages.size"
+        :current-page.sync="pages.page"
+        @current-change="handleCurrentChange"
+        @size-change="handleSizeChange"
+      >
+      </el-pagination>
+    </div>
+    <!-- 验收 -->
+    <RepairDetailsDialog ref="detailsDialogRef" @refesh="getData" />
+    <!-- 转派弹窗 -->
+    <redeployOther ref="redeployOtherRef" @refresh="getData" />
+    <!-- 报工弹框 -->
+    <signingUpWork ref="signingUpWorkRef" @refresh="getData" />
+  </div>
+</template>
+
+<script>
+  import redeployOther from '../components/redeployOther.vue';
+  import signingUpWork from '../components/signingUpWork.vue';
+  import RepairDetailsDialog from '@/views/bpm/tickets/components/RepairDetailsDialog.vue';
+  import { ticketStatus } from '@/utils/dict/tickets';
+  import { getWorkOrderList, getRule } from '@/api/tickets';
+  import pagenation from '@/components/Pagination';
+  export default {
+    components: {
+      pagenation,
+      redeployOther,
+      signingUpWork,
+      RepairDetailsDialog
+    },
+    data() {
+      return {
+        ruleNameList: [],
+        tableData: [],
+        statusOptions: [],
+        ticketStatus,
+        searchForm: {
+          code: '',
+          orderStatus: 4,
+          ruleId: '',
+          date: '',
+          startTime: '',
+          endTime: '',
+          type: 3
+        },
+        pages: {
+          page: 1,
+          size: 15
+        },
+        total: 0
+      };
+    },
+    created() {
+      this.getRuleNameList();
+      this.getData();
+    },
+    methods: {
+      // 转派
+      toRedeploy(row) {
+        this.$refs.redeployOtherRef.open(row);
+      },
+      // 报工
+      toSigningUpWork(row) {
+        this.$refs.signingUpWorkRef.open(row);
+      },
+      reload(where) {
+        this.$refs.table.reload({ page: 1, ...where });
+      },
+      openDetail(row) {
+        row.title = '工单详情';
+        row.tabLabel = '工单信息';
+        this.$refs.detailsDialogRef.init(row, true);
+      },
+      // 获取规则名列表(维修)
+      async getRuleNameList() {
+        const res = await getRule({
+          status: 1,
+          type: 3,
+          pageNum: 1,
+          size: -1
+        });
+        if (res.list) {
+          this.ruleNameList = res.list || [];
+        }
+      },
+      // 实现分页序号连贯
+      indexMethod(index) {
+        index = index + 1 + (this.pages.page - 1) * this.pages.size;
+        return index;
+      },
+      getData() {
+        let userId = localStorage.getItem('userId');
+        console.log(userId);
+        let par = {
+          ...this.pages,
+          ...this.searchForm,
+          executeUserId: userId,
+          statusType: 2
+        };
+        if (this.searchForm.date) {
+          par.startTime = this.searchForm.date[0];
+          par.endTime = this.searchForm.date[1];
+        }
+        delete par.date;
+        getWorkOrderList(par).then((res) => {
+          this.tableData = res.list;
+          this.total = res.total;
+        });
+      },
+      search() {
+        this.pages.page = 1;
+        this.getData();
+      },
+      rest() {
+        this.searchForm = {
+          code: '',
+          orderStatus: 4,
+          ruleId: '',
+          date: '',
+          startTime: '',
+          endTime: '',
+          type: 3
+        };
+        this.pages.page = 1;
+        this.getData();
+      },
+      handleCurrentChange() {
+        this.getData();
+      },
+      handleSizeChange() {
+        this.pages.page = 1;
+        this.getData();
+      },
+      // 计算实际工时
+      time_interval(dt1, dt2) {
+        if (!dt1 || !dt2) {
+          return '';
+        }
+        if (typeof dt1 == 'string') {
+          dt1 = new Date(dt1.replace(/-/, '/'));
+          dt2 = new Date(dt2.replace(/-/, '/'));
+        }
+        var res = dt2 - dt1;
+        if (isNaN(res)) throw Error('invalid dates arguments');
+        let re = res / (1000 * 60 * 60);
+
+        var h = parseInt(re);
+        var m = parseInt((re - h) * 60);
+        let result = '';
+        if (h) {
+          result += `${h} 小时`;
+        }
+        if (m) {
+          result += `${m} 分钟`;
+        }
+        return result;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .patrolInspection {
+    height: 100%;
+    width: 100%;
+    display: flex;
+    flex-direction: column;
+    .search {
+      flex: 0 0 50px;
+    }
+    .table {
+      flex: 1;
+      .el-table {
+        width: 100%;
+        display: flex;
+        flex-direction: column;
+      }
+    }
+    .table-footer {
+      flex: 0 0 30px;
+      display: flex;
+      justify-content: flex-end;
+    }
+  }
+</style>

+ 9 - 3
src/views/bpm/handleTask/components/measuringToolInspection/detailDialog.vue

@@ -365,16 +365,22 @@
         case 'user_submit':
           type = 1;
           break;
+        case 'team_leader_receive':
+          type = 2;
+          break;
         case 'team_leader_submit':
           type = 2;
           break;
-        case 'leader_approve':
+        case 'leader_receive':
           type = 3;
           break;
-        case 'leader_check':
+        case 'leader_send':
           type = 3;
           break;
-        case 'team_leader_receive_send':
+        case 'team_leader_receive1':
+          type = 2;
+          break;
+        case 'team_leader_send':
           type = 2;
           break;
         case 'user_receive':

+ 339 - 0
src/views/bpm/handleTask/components/measuringToolInspection/submit copy.vue

@@ -0,0 +1,339 @@
+<template>
+  <el-col :span="16" :offset="6">
+    <el-form label-width="100px" ref="formRef" :model="form">
+      <el-form-item
+        label="审批建议"
+        prop="reason"
+        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"
+        :loading="isSaveLoading"
+        @click="submit"
+        v-if="currentBtn === '上交'"
+        >上交
+      </el-button>
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        :loading="isSaveLoading"
+        @click="submit"
+        v-if="currentBtn === '接收'"
+        >接收
+      </el-button>
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        :loading="isSaveLoading"
+        @click="submit"
+        v-if="currentBtn === '检查'"
+        >已检
+      </el-button>
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        :loading="isSaveLoading"
+        @click="submit"
+        v-if="currentBtn === '发出'"
+        >发出
+      </el-button>
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        :loading="isSaveLoading"
+        @click="submit(1)"
+        v-if="['user_receive'].includes(this.taskDefinitionKey)"
+        >已收
+      </el-button>
+      <el-button
+        icon="el-icon-edit-outline"
+        type="danger"
+        size="mini"
+        :loading="isSaveLoading"
+        @click="submit(0)"
+        v-if="['user_receive'].includes(this.taskDefinitionKey)"
+        >未收
+      </el-button>
+    </div>
+  </el-col>
+</template>
+
+<script>
+  import { EventBus } from './eventBus';
+  import {
+    getList,
+    surrender
+  } from '@/api/bpm/components/inspectionManage/index.js';
+  export default {
+    name: 'measuringToolInspection_submit',
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskId: {
+        default: ''
+      },
+      id: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        default: ''
+      }
+    },
+    data() {
+      return {
+        isSaveLoading: false,
+        // 0默认; 10使用人上交; 20班组收到; 21班组上交; 30负责人收; 31负责人发出; 32负责人收;
+        // 33负责人检查; 34负责人发; 40班组长收; 41班组长发; 50使用人已收; 51使用人未收
+        toolsStatus: 0,
+        currentBtn: '',
+        form: {
+          reason: ''
+        }
+      };
+    },
+    async mounted() {
+      EventBus.$on('getData', ({ logList }) => {
+        console.log('------mounted----------');
+        console.log(logList);
+        let currentBtn = '';
+        switch (this.taskDefinitionKey) {
+          // 使用人上交
+          case 'user_submit':
+            currentBtn = '上交';
+            break;
+          // 班组长收交
+          case 'team_leader_submit':
+            if (logList.length > 0) {
+              currentBtn = '发出';
+            } else {
+              currentBtn = '接收';
+            }
+            break;
+          // 负责人收发
+          case 'leader_approve':
+            if (logList.length > 0) {
+              currentBtn = '发出';
+            } else {
+              currentBtn = '接收';
+            }
+            break;
+          // 负责人收检发
+          case 'leader_check':
+            if (logList.length > 1) {
+              currentBtn = '发出';
+            } else if (logList.length == 1) {
+              currentBtn = '检查';
+            } else {
+              currentBtn = '接收';
+            }
+            break;
+          // 班组长收发
+          case 'team_leader_receive_send':
+            if (logList.length > 0) {
+              currentBtn = '发出';
+            } else {
+              currentBtn = '接收';
+            }
+            break;
+          // 使用人收
+          case 'user_receive':
+            break;
+        }
+        this.currentBtn = currentBtn;
+      });
+    },
+    destroyed() {
+      EventBus.$off('getData');
+    },
+    methods: {
+      async submit(boolen) {
+        if (!this.form.reason) {
+          return this.$message.error('请输入审批意见');
+        }
+        let data = await this.getTableValue();
+        let status = 10;
+        let isSubmit = 0;
+        switch (this.taskDefinitionKey) {
+          // 使用人上交
+          case 'user_submit':
+            status = 10;
+            break;
+          // 班组长收交
+          case 'team_leader_submit':
+            if (this.currentBtn === '接收') {
+              status = 20;
+              isSubmit = 1;
+            } else {
+              status = 21;
+              isSubmit = 0;
+            }
+            break;
+          // 负责人收发
+          case 'leader_approve':
+            if (this.currentBtn === '接收') {
+              status = 30;
+              isSubmit = 1;
+            } else {
+              status = 31;
+              isSubmit = 0;
+            }
+            break;
+          // 负责人收检发
+          case 'leader_check':
+            if (this.currentBtn === '接收') {
+              status = 32;
+              isSubmit = 1;
+            } else if (this.currentBtn === '检查') {
+              status = 33;
+              isSubmit = 1;
+            } else {
+              status = 34;
+              isSubmit = 0;
+            }
+            break;
+          // 班组长收发
+          case 'team_leader_receive_send':
+            if (this.currentBtn === '接收') {
+              status = 40;
+              isSubmit = 1;
+            } else {
+              status = 41;
+              isSubmit = 0;
+            }
+            break;
+          // 使用人收
+          case 'user_receive':
+            if (boolen) {
+              // 已收
+              status = 50;
+            } else {
+              // 未收
+              status = 51;
+            }
+            isSubmit = 0;
+            break;
+        }
+        console.log(data);
+        let params = {
+          bpmTaskId: this.taskId,
+          bpmTaskReason: this.form.reason,
+          node: this.taskDefinitionKey,
+          status,
+          isSubmit,
+          planId: data.planId
+        };
+        if (status === 33 || status >= 50) {
+          console.log(data.planDeviceList);
+          let boolen = data.planDeviceList.every(
+            (item) => item.qualityStatus !== null
+          );
+          console.log(boolen);
+          if (boolen) {
+            params.planDeviceToolsList = data.planDeviceList.map((item) => {
+              return {
+                deviceId: item.deviceId,
+                qualityStatus: item.qualityStatus,
+                isLose: item.isLose
+              };
+            });
+          } else {
+            this.$message.error('请完成质检');
+            return false;
+          }
+        } else if (status === 10) {
+          console.log(data.planDeviceList);
+          let boolen = data.planDeviceList.every(
+            (item) => item.isLose !== null
+          );
+          console.log(boolen);
+          if (boolen) {
+            params.planDeviceToolsList = data.planDeviceList.map((item) => {
+              return {
+                deviceId: item.deviceId,
+                qualityStatus: item.qualityStatus,
+                isLose: item.isLose
+              };
+            });
+          } else {
+            this.$message.error('设备是否遗失');
+            return false;
+          }
+        }
+        console.log(params);
+        surrender(params).then(() => {
+          this.$emit('handleAudit', {
+            status: 1,
+            title: '提交'
+          });
+        });
+      },
+      async storeManagerApprove() {
+        let res = await this.getTableValue();
+        console.log(res);
+        // let storageData = res.returnStorageData;
+        // // 入库来源storageSource 0-正常  1-外部(外部跳过内部审核流程)
+        // storageData.storageSource = 1;
+        // console.log(storageData);
+        // try {
+        //   this.isSaveLoading = true;
+        //   await outin.save(storageData);
+        //   approveTaskWithVariables({
+        //     id: this.taskId,
+        //     reason: this.form.reason,
+        //     variables: {
+        //       pass: true
+        //     }
+        //   }).then((res) => {
+        //     if (res.code != '-1') {
+        //       this.$emit('handleAudit', {
+        //         status: 1,
+        //         title: '入库'
+        //       });
+        //     }
+        //     this.isSaveLoading = false;
+        //   });
+        // } catch (error) {
+        //   this.isSaveLoading = false;
+        //   this.$message.error('保存失败');
+        // }
+      },
+      /** 处理转办审批人 */
+      handleUpdateAssignee() {
+        this.$emit('handleUpdateAssignee');
+      },
+      /** 退回 */
+      handleBackList() {
+        this.$emit('handleBackList');
+      },
+      getTableValue() {
+        return new Promise((resolve) => {
+          this.$emit('getTableValue', async (data) => {
+            resolve(await data);
+          });
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="scss"></style>

+ 38 - 68
src/views/bpm/handleTask/components/measuringToolInspection/submit.vue

@@ -121,39 +121,29 @@
           case 'user_submit':
             currentBtn = '上交';
             break;
-          // 班组长收交
+          // 负责人收
+          case 'team_leader_receive':
+            currentBtn = '接收';
+            break;
+          // 负责人发
           case 'team_leader_submit':
-            if (logList.length > 0) {
-              currentBtn = '发出';
-            } else {
-              currentBtn = '接收';
-            }
+            currentBtn = '发出';
             break;
-          // 负责人收发
-          case 'leader_approve':
-            if (logList.length > 0) {
-              currentBtn = '发出';
-            } else {
-              currentBtn = '接收';
-            }
+          // 量具管理员收
+          case 'leader_receive':
+            currentBtn = '接收';
             break;
-          // 负责人收检发
-          case 'leader_check':
-            if (logList.length > 1) {
-              currentBtn = '发出';
-            } else if (logList.length == 1) {
-              currentBtn = '检查';
-            } else {
-              currentBtn = '接收';
-            }
+          // 量具管理员发
+          case 'leader_send':
+            currentBtn = '发出';
             break;
-          // 班组长收发
-          case 'team_leader_receive_send':
-            if (logList.length > 0) {
-              currentBtn = '发出';
-            } else {
-              currentBtn = '接收';
-            }
+          // 负责人收
+          case 'team_leader_receive1':
+            currentBtn = '接收';
+            break;
+          // 负责人发
+          case 'team_leader_send':
+            currentBtn = '发出';
             break;
           // 使用人收
           case 'user_receive':
@@ -178,48 +168,29 @@
           case 'user_submit':
             status = 10;
             break;
-          // 班组长收交
+          // 负责人收
+          case 'team_leader_receive':
+            status = 20;
+            break;
+          // 负责人发
           case 'team_leader_submit':
-            if (this.currentBtn === '接收') {
-              status = 20;
-              isSubmit = 1;
-            } else {
-              status = 21;
-              isSubmit = 0;
-            }
+            status = 21;
             break;
-          // 负责人收发
-          case 'leader_approve':
-            if (this.currentBtn === '接收') {
-              status = 30;
-              isSubmit = 1;
-            } else {
-              status = 31;
-              isSubmit = 0;
-            }
+          // 量具管理员收
+          case 'leader_receive':
+            status = 30;
             break;
-          // 负责人收检发
-          case 'leader_check':
-            if (this.currentBtn === '接收') {
-              status = 32;
-              isSubmit = 1;
-            } else if (this.currentBtn === '检查') {
-              status = 33;
-              isSubmit = 1;
-            } else {
-              status = 34;
-              isSubmit = 0;
-            }
+          // 量具管理员发
+          case 'leader_send':
+            status = 31;
             break;
-          // 班组长收发
-          case 'team_leader_receive_send':
-            if (this.currentBtn === '接收') {
-              status = 40;
-              isSubmit = 1;
-            } else {
-              status = 41;
-              isSubmit = 0;
-            }
+          // 负责人收
+          case 'team_leader_receive1':
+            status = 40;
+            break;
+          // 负责人发
+          case 'team_leader_send':
+            status = 41;
             break;
           // 使用人收
           case 'user_receive':
@@ -230,7 +201,6 @@
               // 未收
               status = 51;
             }
-            isSubmit = 0;
             break;
         }
         console.log(data);

+ 6 - 5
src/views/bpm/handleTask/components/productionWarehousing/productionWarehousing.vue

@@ -1305,13 +1305,13 @@
         });
 
         // 添加包装批号丶包装编码丶包装数量
+        const onlyCodeList = await outin.getAssetNum({
+          assetCode: list.detailList[0].categoryCode,
+          batchNum: batchNo,
+          num: list.detailList.length
+        });
         Promise.all(
           sameItemWraplist.map(async (goodsItem) => {
-            const onlyCodeList = await outin.getAssetNum({
-              assetCode: goodsItem[0].categoryCode,
-              batchNum: batchNo,
-              num: goodsItem.length
-            });
             goodsItem = goodsItem.map((wrapItem) => {
               return {
                 ...wrapItem,
@@ -1328,6 +1328,7 @@
                 clientCode: wrapItem.extInfo.clientCode,
                 num: wrapItem.quantity,
                 isPack: false,
+                packingCount: 1,
                 minPackingCount: wrapItem.quantity,
                 onlyCode: onlyCodeList.shift().onlyCode,
                 result: '0',

+ 2 - 2
src/views/bpm/handleTask/components/purchaseOrder/outSourceSend/outsourcingOutbound.vue

@@ -15,7 +15,7 @@
             </el-form-item></el-col
           >
           <el-col :span="8">
-            <el-form-item label="退货处理单" prop="sourceBizNo">
+            <el-form-item label="委外发货单" prop="sourceBizNo">
               <span>{{ formData.sourceBizNo }}</span>
             </el-form-item>
           </el-col>
@@ -493,7 +493,7 @@
           this.formData.extInfo.assetType =
             returnDetailsForm.categoryLevelTopId;
           // 出库类型(委外出库)
-          this.formData.bizType = '6';
+          this.formData.bizType = '7';
           // 增加添加物品判断条件
           this.title = this.assetTypeMapping[this.formData.extInfo.assetType];
           // 添加单据来源

+ 0 - 1
src/views/bpm/handleTask/components/purchaseOrder/outsourceSendReturnGoods/entrustedStorage.vue

@@ -908,7 +908,6 @@
         }
       };
     },
-    props: ['inboundType'],
     computed: {
       // 条码信息
       materialCodeReqList() {

+ 1971 - 0
src/views/bpm/handleTask/components/saleOrder/saleReturnGoods/salesReturnReceipt.vue

@@ -0,0 +1,1971 @@
+<!-- 销售退货审批(销售退货入库) 入库标识 -->
+<template>
+  <div class="procurementStorage">
+    <el-card shadow="never">
+      <header-title title="基本信息"></header-title>
+      <el-form
+        :model="formData"
+        ref="formName"
+        label-width="110px"
+        :rules="rules"
+      >
+        <el-row :gutter="20">
+          <el-col :span="8">
+            <el-form-item label="物品类型" prop="extInfo.assetType">
+              <selectTree
+                ref="tree"
+                class="form-ipt"
+                :isBindPlan="true"
+                disabled
+                size="medium"
+                style="width: 100%"
+                :value="formData.extInfo.assetType"
+                clearable
+                :options="codeList"
+                :props="{
+                  value: 'id',
+                  label: 'name',
+                  children: 'children'
+                }"
+                @getValue="codeListValue"
+                :isAll="false"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="入库类型" prop="bizType">
+              <el-select
+                @change="onClear"
+                filterable
+                placeholder="请选择"
+                v-model="formData.bizType"
+                clearable
+                :disabled="
+                  !!(warehousingMaterialList && warehousingMaterialList.length)
+                "
+              >
+                <el-option
+                  v-for="item in sceneState"
+                  :key="item.code"
+                  :value="item.code + ''"
+                  :label="item.label"
+                ></el-option>
+              </el-select> </el-form-item
+          ></el-col>
+          <el-col :span="8">
+            <el-form-item label="采购订单编码" prop="documentSource">
+              <el-input
+                placeholder="请输入"
+                v-model="formData.extInfo.documentSource"
+                @click.native="handlePicker()"
+                :disabled="isTask"
+              >
+              </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="权属部门" prop="deptName">
+              <el-input
+                placeholder="权属部门"
+                disabled
+                v-model="formData.extInfo.deptName"
+                clearable
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="入库登记人">
+              <el-input
+                placeholder="登记人"
+                disabled
+                v-model="formData.extInfo.createUserName"
+                clearable /></el-form-item
+          ></el-col>
+          <el-col :span="8" v-if="formData.bizType == 2">
+            <el-form-item label="供应商" prop="supplierName">
+              <el-input
+                placeholder="请输入"
+                clearable
+                v-model="formData.extInfo.supplierName"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="送货人" prop="fromUser">
+              <el-input
+                placeholder="请输入"
+                v-model="formData.fromUser"
+                clearable
+              /> </el-form-item
+          ></el-col>
+          <el-col :span="8">
+            <el-form-item label="送货人联系方式" prop="deliveryPhone">
+              <el-input
+                placeholder="请输入"
+                v-model="formData.extInfo.deliveryPhone"
+                clearable /></el-form-item
+          ></el-col>
+          <el-col :span="24">
+            <el-form-item label="备注" prop="remark">
+              <el-input
+                v-model="formData.remark"
+                clearable
+                type="textarea"
+                placeholder="请详细说明"
+                :rows="4"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+
+      <div class="material">
+        <header-title title="产品信息">
+          <el-button type="primary" @click="addStock" v-if="!isTask"
+            >添加</el-button
+          >
+        </header-title>
+
+        <div class="mt10 form-table">
+          <el-form
+            ref="warehousingMaterialListRef"
+            :model="{ warehousingMaterialList: warehousingMaterialList }"
+            :show-message="false"
+          >
+            <el-button
+              v-if="warehousingMaterialList.length != 0"
+              type="success"
+              plain
+              style="margin-bottom: 20px; float: right; margin-right: 20px"
+              size="mini"
+              @click="listSaveArrs"
+              >批量保存</el-button
+            >
+            <el-table
+              v-if="isWeight"
+              :header-cell-style="rowClass"
+              ref="warehousingMaterialListTable"
+              :key="formData.extInfo.assetType"
+              :data="warehousingMaterialList"
+              tooltip-effect="dark"
+              style="width: 100%"
+              stripe
+            >
+              <el-table-column
+                label="序号"
+                type="index"
+                width="50"
+                align="center"
+              >
+              </el-table-column>
+
+              <el-table-column
+                label="编码"
+                prop="assetCode"
+                align="center"
+                width="130"
+              ></el-table-column>
+              <el-table-column
+                label="名称"
+                align="center"
+                width="200"
+                prop="assetName"
+              ></el-table-column>
+              <el-table-column
+                v-for="(item, index) in tableHeader"
+                :key="index"
+                align="center"
+                :label="item.label"
+                width="150"
+                :prop="item.prop"
+              >
+                <template slot-scope="{ row }">
+                  <template v-if="item.formatter">{{
+                    item.formatter(row)
+                  }}</template>
+                  <template v-else>{{ row[item.prop] }}</template>
+                </template>
+              </el-table-column>
+              <el-table-column label="批号" width="100" prop="assetName">
+                <template slot-scope="{ row, $index }">
+                  <template v-if="row.isSave">
+                    {{ row.manualBatchNo }}
+                  </template>
+                  <el-form-item v-else>
+                    <el-input v-model="row.manualBatchNo"> </el-input>
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="批次号"
+                prop="batchNo"
+                width="70"
+                align="center"
+              >
+                <template slot-scope="{ row, $index }">
+                  <template v-if="row.isSave">
+                    {{ row.batchNo }}
+                  </template>
+                  <el-form-item
+                    v-else
+                    :prop="`warehousingMaterialList.${$index}.batchNo`"
+                    required
+                  >
+                    <!-- <el-input v-model="row.batchNo"></el-input> -->
+                    {{ row.batchNo }}
+                  </el-form-item>
+                </template>
+              </el-table-column>
+
+              <el-table-column
+                label="最小包装单元"
+                align="center"
+                prop="minPackingCount"
+                width="100"
+              >
+                <el-table-column label="" prop="minPackingCount" width="100">
+                  <template slot-scope="{ row, $index }">
+                    <template v-if="row.isSave">
+                      {{ row.minPackingCount }}
+                    </template>
+                    <el-form-item
+                      v-else
+                      :prop="`warehousingMaterialList.${$index}.minPackingCount`"
+                      required
+                    >
+                      <el-input
+                        type="number"
+                        v-model="row.minPackingCount"
+                        @input="minPackingCountChange(row, $event)"
+                      >
+                      </el-input>
+                    </el-form-item>
+                  </template>
+                </el-table-column>
+                <el-table-column label="" prop="minPackingCount">
+                  <template slot-scope="{ row, $index }">
+                    {{ handleRowUnit(row) }} /{{ row.minPackUnit }}
+                  </template>
+                </el-table-column>
+              </el-table-column>
+              <el-table-column
+                label="包装数量"
+                prop="outInNum"
+                width="150"
+                align="center"
+              >
+                <template slot-scope="{ row, $index }">
+                  <template v-if="row.isSave || formData.bizType == 5">
+                    {{ row.outInNum }} {{ row.minPackUnit }}
+                  </template>
+                  <el-form-item
+                    v-else
+                    :prop="`warehousingMaterialList.${$index}.outInNum`"
+                    required
+                  >
+                    <el-input
+                      v-model="row.outInNum"
+                      @input="packNum(row, $event)"
+                    >
+                      <template slot="append">
+                        {{ row.minPackUnit ? row.minPackUnit : '/' }}
+                      </template>
+                    </el-input>
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column label="计量数量" prop="counts">
+                <template slot-scope="{ row, $index }">
+                  {{ $math.format(row.minPackingCount * row.outInNum, 14) }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="计量单位"
+                prop="batchNo"
+                width="100"
+                align="center"
+              >
+                <!-- v-if="formData.extInfo.assetType == 1" -->
+
+                <template slot-scope="{ row, $index }">
+                  <template>
+                    {{ row.measuringUnit }}
+                  </template>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="重量"
+                align="center"
+                prop="contentImage"
+                :show-overflow-tooltip="true"
+              >
+                <template slot-scope="{ row, $index }">
+                  {{ row.weight }}
+                  <template slot="append">
+                    {{ handleRowUnit(row) }}
+                  </template>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="重量单位"
+                align="center"
+                prop="contentImage"
+                :show-overflow-tooltip="true"
+              >
+                <template slot-scope="{ row, $index }">
+                  {{ row.weightUnit }}
+                  <template slot="append"> </template>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="单价"
+                prop="univalence"
+                width="150"
+                align="center"
+              >
+                <template slot-scope="{ row, $index }">
+                  <el-form-item
+                    :prop="`warehousingMaterialList.${$index}.univalence`"
+                  >
+                    <el-input
+                      v-model="row.univalence"
+                      placeholder="非必填"
+                      @input="
+                        (value) =>
+                          (row.univalence = value.replace(/[^0-9.]+/g, ''))
+                      "
+                    >
+                      <template slot="append">
+                        元/{{ handleRowUnit(row) }}
+                      </template>
+                    </el-input>
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="金额"
+                align="center"
+                prop="contentImage"
+                :show-overflow-tooltip="true"
+              >
+                <template slot-scope="{ row, $index }">
+                  {{
+                    calcSumTotal(
+                      row.outInNum,
+                      row.minPackingCount,
+                      row.univalence,
+                      row
+                    )
+                  }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="货位"
+                prop="warehouseName"
+                :show-overflow-tooltip="true"
+                width="250"
+                required
+              >
+                <template slot-scope="{ row, $index }">
+                  <el-form-item
+                    :prop="`warehousingMaterialList.${$index}.houseList`"
+                    :required="true"
+                  >
+                    <div @click="handleWareHouse(row, $index)">
+                      <div
+                        style="color: #ff4949"
+                        v-if="row.houseList.length == 0"
+                      >
+                        ---(必填)
+                      </div>
+                      <div v-else>
+                        <div
+                          class="fontOmitted"
+                          v-for="(item, index) in row.houseList"
+                          :key="index"
+                        >
+                          {{ item.warehouseName }}- {{ item.areaName }}-
+                          {{ item.shelfCode }}- {{ item.cargoSpaceCode
+                          }}<span style="color: #ff4949" v-if="item.num">
+                            - {{ item.num }}(数)</span
+                          >
+                          <br />
+                        </div>
+                      </div>
+                    </div>
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="质检单"
+                v-if="formData.extInfo.assetType === 3"
+                prop="contentImage"
+                :show-overflow-tooltip="true"
+              >
+                <template slot-scope="{ row, $index }">
+                  <upload @on-success="(data) => (row.contentImage = [data])"
+                    ><template slot="placeholder">上传</template></upload
+                  >
+                </template>
+              </el-table-column>
+
+              <el-table-column
+                label="操作"
+                width="200"
+                fixed="right"
+                align="center"
+              >
+                <template slot="header" slot-scope="scope"> 操作 </template>
+                <template slot-scope="{ row, $index }">
+                  <el-button
+                    type="text"
+                    v-show="!row.isSave"
+                    @click="listSave(row, $index)"
+                    >保存</el-button
+                  >
+                  <el-button
+                    type="text"
+                    v-show="row.isSave"
+                    @click="listEdit(row, $index)"
+                    >编辑</el-button
+                  >
+                  <el-button
+                    type="text"
+                    @click="listDel(row, $index)"
+                    v-if="!isTask"
+                    >删除</el-button
+                  >
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-form>
+        </div>
+        <div class="mt20">
+          <header-title :title="`包装明细`">
+            <div class="switch_right">
+              <span v-if="materialCodeReqList.length != 0">
+                分拆<el-switch
+                  v-model="isSplit"
+                  active-color="#13ce66"
+                  inactive-color="#ff4949"
+                  @change="handleIsDetail"
+                  style="margin-left: 10px"
+                >
+                </el-switch>
+              </span>
+
+              <el-button
+                style="margin-left: 20px"
+                type="text"
+                @click="dateSetting"
+                v-if="formData.bizType != 5"
+                >批量设置{{
+                  curDateType === 'manufactureTime' ? '生产日期' : '采购日期'
+                }}</el-button
+              >
+            </div>
+          </header-title>
+          <el-button
+            v-if="materialCodeReqList.length != 0"
+            type="success"
+            plain
+            style="margin-bottom: 20px; float: right; margin-right: 20px"
+            size="mini"
+            @click="wrapListSave"
+            >批量保存</el-button
+          >
+          <el-table
+            ref="materialCodeReqListTable"
+            :data="materialCodeReqList"
+            tooltip-effect="dark"
+            :key="formData.bizType"
+            :header-cell-style="rowClass"
+            style="width: 100%"
+            stripe
+            height="300px"
+            @selection-change="handleSelectionChange"
+          >
+            <el-table-column
+              label=""
+              type="selection"
+              align="center"
+              width="50"
+              v-if="formData.bizType != 5"
+            >
+            </el-table-column>
+            <el-table-column label="序号" type="index" width="50">
+            </el-table-column>
+            <el-table-column
+              label="编码"
+              prop="assetCode"
+              width="130"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="名称"
+              prop="assetName"
+              width="150"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="批号"
+              prop="manualBatchNo"
+              width="100"
+            ></el-table-column>
+            <el-table-column
+              label="批次号"
+              prop="batchNo"
+              width="70"
+            ></el-table-column>
+            <el-table-column
+              :label="`包装编码`"
+              prop="onlyCode"
+              width="130"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装数量"
+              prop="packingCount"
+              width="80"
+            ></el-table-column>
+            <el-table-column
+              label="包装单位"
+              prop="packingUnit"
+            ></el-table-column>
+            <el-table-column
+              label="计量数量"
+              prop="minPackingCount"
+            ></el-table-column>
+            <el-table-column
+              label="计量单位"
+              prop="measuringUnit"
+            ></el-table-column>
+            <el-table-column label="物料代号" prop="materielCode" width="130">
+              <template slot-scope="{ row }">
+                <el-input
+                  v-if="!row.isPack"
+                  v-model="row.materielCode"
+                ></el-input>
+                <span v-else>{{ row.materielCode }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="客户代号" prop="clientCode">
+              <template slot-scope="{ row }">
+                <el-input
+                  v-if="!row.isPack"
+                  v-model="row.clientCode"
+                ></el-input>
+                <span v-else> {{ row.clientCode }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="刻码" prop="engrave">
+              <template slot-scope="{ row }">
+                <el-input v-if="!row.isPack" v-model="row.engrave"></el-input>
+                <span v-else>{{ row.engrave }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="重量" prop="weight" width="100">
+              <template slot-scope="{ row }">
+                <el-input
+                  v-if="!row.isPack && row.measuringUnit != row.weightUtil"
+                  v-model="row.weight"
+                  @input="weightInput($event, row)"
+                ></el-input>
+                <span v-else>{{ row.weight }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="重量单位" prop="weightUtil">
+              <template slot-scope="{ row }">
+                {{ row.weightUtil }}
+              </template>
+            </el-table-column>
+
+            <el-table-column label="质检结果" prop="result" width="120">
+              <template slot-scope="{ row }">
+                <DictSelection
+                  dictName="质检结果"
+                  clearable
+                  v-model="row.result"
+                  v-if="!row.isPack"
+                  @updateVal="changeWrapStatus($event, row)"
+                />
+                <span v-else>{{ qualityResults[row.result] }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="质检状态" prop="status" width="120">
+              <template slot-scope="{ row }">
+                <span>{{ qualityStatus[row.status] }}</span>
+              </template>
+            </el-table-column>
+
+            <el-table-column
+              v-if="formData.bizType != 5"
+              label="生产日期"
+              prop=""
+              width="220"
+            >
+              <template slot="header" slot-scope="scope">
+                <el-select filterable v-model="curDateType">
+                  <el-option
+                    value="manufactureTime"
+                    label="生产日期"
+                  ></el-option>
+                  <el-option
+                    value="procurementTime"
+                    label="采购日期"
+                  ></el-option>
+                </el-select>
+              </template>
+              <template slot-scope="{ row }">
+                <template v-if="formData.bizType == 5">
+                  {{ row[curDateType] }}
+                </template>
+                <el-date-picker
+                  v-else
+                  :disabled="row.ispack"
+                  size="small"
+                  v-model="row[curDateType]"
+                  type="datetime"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  placeholder="选择日期"
+                >
+                </el-date-picker>
+              </template>
+            </el-table-column>
+            <template v-else>
+              <el-table-column
+                label="生产日期"
+                prop="manufactureTime"
+                width="200"
+              ></el-table-column>
+              <el-table-column
+                label="采购日期"
+                prop="procurementTime"
+                width="200"
+              ></el-table-column>
+            </template>
+            <el-table-column label="操作" width="80" fixed="right">
+              <template slot-scope="{ row }">
+                <el-button type="text" @click="packCout(row)">
+                  {{ !row.isPack ? '保存' : '编辑' }}
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+          <!-- </el-tab-pane>
+        </el-tabs> -->
+        </div>
+        <div class="mt20" v-if="isSplit">
+          <header-title :title="`物料明细`"> </header-title>
+          <el-button
+            v-if="resultArray.length != 0"
+            type="success"
+            plain
+            style="margin-bottom: 20px; float: right; margin-right: 20px"
+            size="mini"
+            @click="materialListSave"
+            >批量保存</el-button
+          >
+          <el-table
+            ref="resultArrayTable"
+            :data="resultArray"
+            tooltip-effect="dark"
+            :key="formData.bizType"
+            :header-cell-style="rowClass"
+            style="width: 100%"
+            stripe
+            height="300px"
+            @selection-change="handleSelectionChange"
+          >
+            <el-table-column label="序号" type="index" width="50">
+            </el-table-column>
+            <el-table-column
+              label="编码"
+              prop="assetCode"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="名称"
+              prop="assetName"
+              width="200"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="批号"
+              prop="manualBatchNo"
+              width="100"
+            ></el-table-column>
+            <el-table-column
+              label="批次号"
+              prop="batchNo"
+              width="80"
+            ></el-table-column>
+            <el-table-column
+              label="物料编码"
+              prop="no"
+              width="200"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量数量"
+              prop="minPackingCount"
+              width="90"
+            ></el-table-column>
+            <el-table-column
+              width="80"
+              label="计量单位"
+              prop="measuringUnit"
+            ></el-table-column>
+            <el-table-column label="物料代号" prop="meterielCode" width="130">
+              <template slot-scope="{ row }">
+                <el-input
+                  v-model="row.materielCode"
+                  v-if="!row.isPack"
+                ></el-input>
+                <span v-else>{{ row.materialCode }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="客户代号" prop="clientCode">
+              <template slot-scope="{ row }">
+                <el-input
+                  v-model="row.clientCode"
+                  v-if="!row.isPack"
+                ></el-input>
+                <span v-else> {{ row.clientCode }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="刻码" prop="engrave">
+              <template slot-scope="{ row }">
+                <el-input v-model="row.engrave" v-if="!row.isPack"></el-input>
+                <span v-else> {{ row.engrave }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column width="100" label="重量" prop="weight">
+              <template slot-scope="{ row }">
+                <el-input
+                  v-model="row.weight"
+                  v-if="!row.isPack && row.measuringUnit != row.weightUnit"
+                ></el-input>
+                <span v-else>{{ row.weight }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="重量单位" prop="weightUnit" width="100">
+            </el-table-column>
+            <el-table-column label="质检结果" prop="result" width="120">
+              <template slot-scope="{ row }">
+                <DictSelection
+                  dictName="质检结果"
+                  clearable
+                  v-model="row.result"
+                  v-if="!row.isPack"
+                  @updateVal="changeWrapStatus($event, row)"
+                />
+                <span v-else>{{ qualityResults[row.result] }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="质检状态" prop="status" width="120">
+              <template slot-scope="{ row }">
+                <span>{{ qualityStatus[row.status] }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" width="80" fixed="right">
+              <template slot-scope="{ row }">
+                <el-button type="text" @click="materialBtn(row)">
+                  {{ !row.isPack ? '保存' : '编辑' }}
+                </el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+    </el-card>
+    <selectType
+      :visibleDialog.sync="visibleDialog"
+      :title="title"
+      :tableHeader="tableHeader"
+      :bizScene="formData.bizType"
+      :type="[selectEquiType]"
+      :loadTree.sync="loadTree"
+      @selectTableData="addProduct"
+    />
+    <WareHouseDailog
+      ref="wareHouseDailogRef"
+      @houseData="houseData"
+    ></WareHouseDailog>
+    <el-dialog :visible.sync="dateVisible" title="选择日期" width="400px">
+      <el-date-picker
+        size="small"
+        v-model="batchTime"
+        type="datetime"
+        style="width: 320px"
+        value-format="yyyy-MM-dd HH:mm:ss"
+        placeholder="选择日期"
+      >
+      </el-date-picker>
+      <div style="text-align: right; margin-top: 20px">
+        <el-button @click="dateVisible = false">取消</el-button>
+        <el-button type="primary" @click="dateConfirm" :disabled="!batchTime"
+          >确认</el-button
+        >
+      </div>
+    </el-dialog>
+
+    <!-- 销售订单 -->
+    <picker ref="pickerRef" @success="pickerSuccess" />
+  </div>
+</template>
+
+<script>
+  import { getProductList } from '@/api/bpm/components/saleManage/contact';
+  import { getLoginUser } from '@/api/login';
+  import picker from '@/views/bpm/stockManagement/components/picker.vue';
+  import outin from '@/api/warehouseManagement/outin';
+  import { getTreeByGroup } from '@/api/classifyManage';
+  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
+  import selectUpload from '@/components/selectUpload';
+  import upload from '@/components/uploadImg';
+  import { sceneState } from '@/utils/dict/index';
+  import selectTree from '@/components/selectTree';
+  import selectType from '@/views/bpm/stockManagement/components/selectType.vue';
+  import WareHouseDailog from '@/views/bpm/stockManagement/components/WareHouseDailog.vue';
+  import ReturnSelect from '@/views/bpm/stockManagement/components/ReturnSelect.vue';
+  import { tableHeader } from '@/views/bpm/handleTask/components/inoutBound/common';
+  import { getCode } from '@/api/codeManagement/index.js';
+  import { getReceiveSaleOrderrecordDetail } from '@/api/bpm/components/purchasingManage/purchaseorderreceive';
+
+  export default {
+    components: {
+      selectUpload,
+      selectTree,
+      selectType,
+      WareHouseDailog,
+      upload,
+      ReturnSelect,
+      picker
+    },
+    data() {
+      return {
+        isSplit: false, // 是否拆分到物料明细
+        qualityStatus: {
+          0: '未检',
+          1: '已检',
+          2: '部分检'
+        }, // 质检状态 0未检 1已检
+        qualityResults: {
+          0: '合格',
+          1: '不合格',
+          3: '让步接收'
+        }, // 质检结果 0合格 1不合格 3让步接收
+        isTask: false,
+        isWeight: true,
+        resultArray: [],
+        pickerRow: {},
+        codeList: [],
+        sceneState,
+        visibleDialog: false,
+        curDateType: 'manufactureTime',
+        materialCodeReqListSelected: [],
+        title: '',
+        warehousingMaterialList: [],
+        loadTree: true,
+        selectEquiType: '',
+        batchTime: '',
+        dateVisible: false,
+        formData: {
+          extInfo: {
+            assetType: '', //物品类型
+            deptCode: '', //部门code
+            deptName: '', //部门名称
+            verifyDeptCode: '', //审核部门编码
+            verifyDeptName: '', //审核部门名称
+            deliveryName: '', //送货人名称
+            deliveryPhone: '', //送货人电话
+            documentSource: '', //销售订单
+            urgent: '', //紧急状态
+            supplierId: '', //供应商ID
+            supplierName: '', //供应商名称
+            createUserName: '', //创建人名字
+            contentImage: [] //图片数组
+          },
+          fromUser: '', //送货人
+          bizType: '', //物品类型
+          verifyId: '', //审核人Id
+          verifyName: '', //审核人名称
+          createUserId: '',
+          remark: ''
+        },
+        rules: {
+          'extInfo.assetType': {
+            required: true,
+            message: '请选择物品类型',
+            trigger: 'change'
+          },
+          bizType: {
+            required: true,
+            message: '请选择入库场景',
+            trigger: 'change'
+          }
+        }
+      };
+    },
+    computed: {
+      // 条码信息
+      materialCodeReqList() {
+        return this.warehousingMaterialList
+          .map((i) => i.warehouseLedgerDetails || [])
+          .flat();
+      },
+      tableHeader() {
+        return tableHeader(this.selectEquiType);
+      }
+    },
+    created() {
+      this.initData();
+    },
+    methods: {
+      // 包装维度最小包装单元改变——>总重量
+      minPackingCountChange(row, value) {
+        if (value >= 0) {
+          row.minPackingCount = value;
+        } else {
+          row.minPackingCount = 0;
+        }
+        // row.minPackingCount = value.replace(/^(0+)|[^\d]+/g, '');
+        if (row.outInNum >= 0 && value >= 0) {
+          this.packNum(row, row.outInNum);
+        }
+      },
+      // 选择质检结果改变质检状态
+      changeWrapStatus(resultValue, row) {
+        switch (resultValue) {
+          case '':
+            // 清空质检状态
+            row.status = '0';
+            break;
+          default:
+            // 默认已检质检状态
+            row.status = '1';
+            break;
+        }
+      },
+      weightInput(value, row) {
+        const newValue = value.replace(/[^\d.]/g, ''); // 保留数字和小数点
+        const decimalCount = (newValue.match(/\./g) || []).length; // 计算小数点的个数
+        if (decimalCount > 1) {
+          // 如果小数点个数大于1,移除多余的小数点
+          const lastIndex = newValue.lastIndexOf('.');
+          row.weight =
+            newValue.slice(0, lastIndex) + newValue.slice(lastIndex + 1);
+        } else if (decimalCount === 1) {
+          // 如果小数点个数等于1,允许小数点的输入
+          row.weight = newValue;
+        } else {
+          row.weight = newValue === '' ? 0 : parseFloat(newValue); // 如果输入为空,则设为0
+        }
+      },
+      // 拆分物料
+      handleIsDetail(event) {
+        this.isSplit = event;
+        const list = this.materialCodeReqList;
+        if (event) {
+          let resultArray = [];
+          list.forEach((item) => {
+            // 包装维度改成已保存状态
+            item.isPack = true;
+            // 拆分物料维度并生成列表
+            for (let i = 1; i <= Number(item.minPackingCount); i++) {
+              resultArray.push({
+                onlyCode: item.onlyCode,
+                no: item.onlyCode + i.toString().padStart(4, '0'),
+                assetCode: item.assetCode,
+                assetName: item.assetName,
+                manualBatchNo: item.manualBatchNo,
+                batchNo: item.batchNo,
+                minPackingCount: 1,
+                measuringUnit: item.measuringUnit,
+                materielCode: item.materielCode,
+                clientCode: item.clientCode,
+                weight: this.$math.format(
+                  item.weight / Number(item.minPackingCount),
+                  14
+                ),
+                initWeight: this.$math.format(
+                  item.weight / Number(item.minPackingCount),
+                  14
+                ),
+                weightUnit: item.weightUnit,
+                engrave: item.engrave,
+                result: item.result,
+                status: item.status,
+                isPack: false
+              });
+            }
+          });
+
+          this.resultArray = resultArray;
+          // 批量修改包装明细
+          this.isWeight = false;
+          this.bulkEditingWrap();
+          this.$nextTick(() => {
+            this.isWeight = true;
+          });
+        } else {
+          // 包装维度改成编辑状态
+          list.forEach((item) => {
+            item.isPack = false;
+          });
+          // 清空物料维度列表
+          this.resultArray = [];
+        }
+      },
+      //包装明细保存
+      packCout(row) {
+        //true保存==》反之
+        if (!row.isPack) {
+          row.isPack = true;
+          const code = row.assetCode;
+          const batchNo = row.batchNo;
+          //做防护,防止weight字符串类型
+          this.materialCodeReqList.forEach((ele) => {
+            ele.weight = Number(ele.weight);
+          });
+          // 修改产品信息重量(包装维度累计)
+          this.isWeight = false;
+          this.warehousingMaterialList.forEach((item) => {
+            if (item.assetCode == code && item.batchNo == batchNo) {
+              let arr = [];
+              for (const key in this.materialCodeReqList) {
+                if (
+                  this.materialCodeReqList[key].assetCode == item.assetCode &&
+                  this.materialCodeReqList[key].batchNo == item.batchNo
+                ) {
+                  arr.push({ ...this.materialCodeReqList[key] });
+                }
+              }
+              const count = arr.reduce((acc, curr) => {
+                if (curr.isPack) {
+                  this.$set(curr, 'initWeight', +curr.weight);
+                  return Number(this.$math.format(+acc + +curr.weight, 14));
+                } else {
+                  return Number(this.$math.format(+acc + +curr.initWeight, 14));
+                }
+              }, 0);
+              this.$set(item, 'weight', count);
+            }
+          });
+          this.$nextTick(() => {
+            this.isWeight = true;
+          });
+        } else {
+          row.isPack = false;
+        }
+      },
+      // 批量修改包装明细
+      bulkEditingWrap() {
+        // 批量修改包装明细列表状态(已保存)
+        this.materialCodeReqList.forEach((item) => {
+          item.isPack = true;
+        });
+        // 改变产品明细重量
+        this.warehousingMaterialList.forEach((outItem) => {
+          let arr = [];
+          this.materialCodeReqList.forEach((inneritem) => {
+            if (
+              inneritem.assetCode == outItem.assetCode &&
+              inneritem.batchNo == outItem.batchNo
+            ) {
+              arr.push(inneritem);
+            }
+          });
+          const count = arr.reduce((acc, curr) => {
+            if (curr.isPack) {
+              this.$set(curr, 'initWeight', +curr.weight);
+              return Number(this.$math.format(+acc + +curr.weight, 14));
+            } else {
+              return Number(this.$math.format(+acc + +curr.initWeight, 14));
+            }
+          }, 0);
+          this.$set(outItem, 'weight', count);
+        });
+      },
+      // 批量修改物料明细
+      bulkEditingMaterial() {
+        // 批量修改物料明细列表状态(已保存)
+        this.resultArray.forEach((item) => {
+          item.isPack = true;
+        });
+        // 改变包装明细重量
+        this.materialCodeReqList.forEach((outItem) => {
+          let arr = [];
+          this.resultArray.forEach((inneritem) => {
+            if (
+              inneritem.assetCode == outItem.assetCode &&
+              inneritem.batchNo == outItem.batchNo
+            ) {
+              arr.push(inneritem);
+            }
+          });
+          const count = arr.reduce((acc, curr) => {
+            if (curr.isPack) {
+              this.$set(curr, 'initWeight', +curr.weight);
+              return Number(this.$math.format(+acc + +curr.weight, 14));
+            } else {
+              return Number(this.$math.format(+acc + +curr.initWeight, 14));
+            }
+          }, 0);
+          this.$set(outItem, 'weight', count);
+        });
+      },
+      // 物料明细保存
+      materialBtn(row) {
+        console.log(row);
+        console.log(this.resultArray);
+        console.log(this.materialCodeReqList);
+        // true保存 false编辑
+        if (!row.isPack) {
+          row.isPack = true;
+          // 物料维度修改质检改变包装维度质检(结果和状态)
+          this.materialCodeReqList.forEach((outItem) => {
+            let arr = [];
+            this.resultArray.forEach((inneritem) => {
+              if (inneritem.onlyCode == outItem.onlyCode) {
+                arr.push(inneritem);
+              }
+            });
+            console.log(arr);
+            // 首先判断是未填/合格不合格
+            let boolen = arr.every((item) => {
+              return (
+                item.result === '' ||
+                item.result === undefined ||
+                item.result === null
+              );
+            });
+            // 判断只要物料全部质检结果(未填)——>包装质检结果(未填) 状态(未检)
+            if (boolen) {
+              this.$set(outItem, 'result', '');
+              this.$set(outItem, 'status', '0');
+            } else {
+              // 判断只要物料有一个质检结果(不合格)——>包装质检结果(不合格) 状态(已检)
+              let boolen = arr.some((item) => {
+                return item.result === '1';
+              });
+              if (boolen) {
+                this.$set(outItem, 'result', '1');
+                this.$set(outItem, 'status', '1');
+              } else {
+                // 判断只要物料有一个质检结果(让步接收)——>包装质检结果(让步接收) 状态(已检)
+                let boolen = arr.some((item) => {
+                  return item.result === '3';
+                });
+                if (boolen) {
+                  // 让步接收 已检
+                  this.$set(outItem, 'result', '3');
+                  this.$set(outItem, 'status', '1');
+                } else {
+                  // 判断只要物料有全部质检结果(合格)——>包装质检结果(合格) 状态(已检)
+                  let boolen = arr.every((item) => {
+                    return item.result === '0';
+                  });
+                  if (boolen) {
+                    // 合格 已检
+                    this.$set(outItem, 'result', '0');
+                    this.$set(outItem, 'status', '1');
+                  } else {
+                    // 合格 部分检
+                    this.$set(outItem, 'result', '0');
+                    this.$set(outItem, 'status', '2');
+                  }
+                }
+              }
+            }
+            // this.$set(outItem, 'result', boolen ? '1' : '0');
+          });
+          // 物料维度修改重量改变包装维度重量
+          let onlyCode = row.onlyCode;
+          this.materialCodeReqList.forEach((item) => {
+            if (item.onlyCode === onlyCode) {
+              let arr = [];
+              for (const key in this.resultArray) {
+                if (this.resultArray[key].onlyCode == item.onlyCode) {
+                  arr.push(this.resultArray[key]);
+                }
+              }
+              const count = arr.reduce((acc, curr) => {
+                if (curr.isPack) {
+                  this.$set(curr, 'initWeight', +curr.weight);
+                  return Number(this.$math.format(+acc + +curr.weight, 14));
+                } else {
+                  return Number(this.$math.format(+acc + +curr.initWeight, 14));
+                }
+              }, 0);
+              this.$set(item, 'weight', count);
+            }
+          });
+          // 包装维度修改重量改变产品信息
+          this.isWeight = false;
+          // 批量修改包装明细
+          this.bulkEditingWrap();
+          this.$nextTick(() => {
+            this.isWeight = true;
+          });
+        } else {
+          row.isPack = false;
+        }
+      },
+      // 重量计算
+      packNum(row, value) {
+        const total = {
+          packingCount: Number(
+            row.minPackingCount > 0 ? row.minPackingCount : 0
+          ),
+          outInNum: Number(row.outInNum > 0 ? row.outInNum : 0)
+        };
+        if (row.measuringUnit == row.weightUnit) {
+          row.weight = Number(
+            this.$math.format(
+              total.packingCount * 1 * total.outInNum.toFixed(2),
+              14
+            )
+          );
+        } else {
+          const totals = Number(
+            this.$math.format(total.packingCount * total.outInNum, 14)
+          );
+          row.weight = Number(
+            this.$math.format(
+              totals * (row.netWeight > 0 ? row.netWeight.toFixed(2) : 0),
+              14
+            )
+          );
+        }
+        return (row.outInNum = value.replace(/^(0+)|[^\d]+/g, ''));
+      },
+      // 根据单据信息初始化产品信息(外部调用)
+      async pickerSuccess(row) {
+        console.log(row);
+        this.formData.bizType = '6';
+        this.codeListValue(row.categoryLevelTopId);
+        this.isTask = true;
+        this.pickerRow = row;
+        this.formData.extInfo.documentSource = row.orderNo;
+        this.formData.sourceBizNo = row.returnNo;
+        this.formData.fromId = row.id;
+        this.formData.clientName = row.partaName;
+        this.formData.clientCode = row.partaId;
+        this.formData.extInfo.supplierName = row.supplierName;
+        this.formData.extInfo.supplierId = row.supplierId;
+        // const data = await getReceiveSaleOrderrecordDetail(row.id);
+        if (this.warehousingMaterialList.length == 0) {
+          let list = row.productList.map((item) => {
+            return {
+              ...item,
+              assetName: item.productName,
+              assetCode: item.productCode,
+              categoryId: item.productCategoryId,
+              minPackUnit: item.packingUnit
+            };
+          });
+          this.onSelectTableData(await this.serachMainCode(list));
+        }
+      },
+      async serachMainCode(arr) {
+        let newArr = [];
+        // 使用 Promise.all 来等待所有异步操作完成
+        await Promise.all(
+          arr.map(async (item) => {
+            const data = await getProductList({
+              pageNum: 1,
+              size: 10,
+              categoryLevelId: item.categoryLevelPathIdParent,
+              codeEq: item.assetCode
+            });
+            newArr.push(data.list); // 将结果存储到 newArr 中
+          })
+        );
+        let re = [];
+        for (const item of newArr) {
+          for (const it of item) {
+            re.push(it);
+          }
+        }
+        return re.map((item) => {
+          return {
+            ...item,
+            minPackUnit: item.packingUnit,
+            assetCode: item.code,
+            assetName: item.name
+          };
+        });
+      },
+      onClear() {
+        this.formData.extInfo.documentSource = '';
+        this.pickerRow = {};
+        this.formData.clientName = '';
+        this.formData.clientCode = '';
+        this.formData.extInfo.supplierName = '';
+        this.formData.extInfo.supplierId = '';
+        this.$forceUpdate();
+      },
+      handlePicker() {
+        this.$refs.pickerRef.open();
+      },
+      // 物品类型选择
+      codeListValue(val) {
+        this.formData.extInfo.assetType = val.id || val;
+        this.$forceUpdate();
+        this.title = val?.name;
+        this.selectEquiType = val?.id || val;
+      },
+      //计算金额
+      calcSumTotal(PackingCount, outInNum, univalence) {
+        //最小包装单元,包装数量,单价
+        const total = {
+          PackingCount: Number(PackingCount > 0 ? PackingCount : 0),
+          outInNum: Number(outInNum > 0 ? outInNum : 0),
+          univalence: Number(univalence == undefined ? 0 : univalence)
+        };
+        return Number(
+          this.$math.format(
+            total.PackingCount * total.outInNum * total.univalence,
+            14
+          )
+        );
+      },
+      handleRowUnit(row) {
+        return row.measuringUnit;
+      },
+      rowClass({ row, column, rowIndex, columnIndex }) {
+        if (rowIndex === 1) {
+          return {
+            display: 'none',
+            background: '#EEEEEE',
+            border: 'none'
+          };
+        }
+        return { background: '#EEEEEE', border: 'none' };
+      },
+      // 仓库编辑
+      handleWareHouse(row, idx) {
+        this.$refs.wareHouseDailogRef.open(row, idx);
+      },
+      // 入库操作
+      listEdit(row) {
+        this.$set(row, 'isSave', false);
+        row.selfWarehouseLedgerDetails = row.warehouseLedgerDetails;
+        row.warehouseLedgerDetails = [];
+        // 重置重量
+        this.packNum(row, row.outInNum);
+        // 清空物料明细防止数据错乱
+        if (this.isSplit && this.resultArray?.length > 0) {
+          this.handleIsDetail(false);
+        }
+      },
+      // 产品单个保存
+      listSave(row, index) {
+        // 清空物料明细防止数据错乱
+        if (this.isSplit && this.resultArray?.length > 0) {
+          this.handleIsDetail(false);
+        }
+        const fileds = [
+          // `warehousingMaterialList.${index}.cargoSpaceCode`,
+          `warehousingMaterialList.${index}.batchNo`,
+          `warehousingMaterialList.${index}.houseList`
+        ];
+        if (this.formData.bizType == 1) {
+          // fileds.push(...[`warehousingMaterialList.${index}.customCode`]);
+        } else if (this.formData.bizType == 2) {
+          // fileds.push(...[`warehousingMaterialList.${index}.supplierCode`]);
+        }
+        if (this.formData.bizType != 5) {
+          fileds.push(
+            ...[
+              `warehousingMaterialList.${index}.outInNum`,
+              `warehousingMaterialList.${index}.minPackingCount`
+            ]
+          );
+        } else if (
+          this.warehousingMaterialList.some(
+            (i) => !i.selfWarehouseLedgerDetails?.length
+          )
+        ) {
+          this.$message.error('请选择资产编号!');
+          return;
+        }
+        Promise.all(
+          fileds.map(
+            (item) =>
+              new Promise(async (resolve, rej) => {
+                this.$refs.warehousingMaterialListRef.validateField(
+                  item,
+                  (err) => {
+                    if (err) {
+                      rej(err);
+                    } else {
+                      resolve();
+                    }
+                  }
+                );
+              })
+          )
+        )
+          .then((res) => {
+            this.$set(row, 'isSave', true);
+            this.createMaterialCode(row);
+          })
+          .catch((err) => {
+            this.$message.error('请填入必填项!');
+          });
+      },
+      // 产品批量保存
+      listSaveArrs() {
+        // 已经拆分(还原到未拆封编辑状态)
+        if (this.isSplit && this.resultArray.length > 0) {
+          this.handleIsDetail(false);
+        }
+        const rows = this.warehousingMaterialList;
+        const indexes = Array.from(
+          { length: this.warehousingMaterialList.length },
+          (_, index) => index
+        );
+        let showMessage = true;
+        rows.forEach((row, i) => {
+          const index = indexes[i];
+          const fileds = [
+            // `warehousingMaterialList.${index}.cargoSpaceCode`,
+            `warehousingMaterialList.${index}.batchNo`,
+            `warehousingMaterialList.${index}.houseList`
+          ];
+          if (this.formData.bizType == 1) {
+            // fileds.push(...[`warehousingMaterialList.${index}.customCode`]);
+          } else if (this.formData.bizType == 2) {
+            // fileds.push(...[`warehousingMaterialList.${index}.supplierCode`]);
+          }
+          if (this.formData.bizType != 5) {
+            fileds.push(
+              ...[
+                `warehousingMaterialList.${index}.outInNum`,
+                `warehousingMaterialList.${index}.minPackingCount`
+              ]
+            );
+          } else if (
+            this.warehousingMaterialList.some(
+              (i) => !i.selfWarehouseLedgerDetails?.length
+            )
+          ) {
+            this.$message.error('请选择资产编号!');
+            return;
+          }
+          Promise.all(
+            fileds.map(
+              (item) =>
+                new Promise(async (resolve, rej) => {
+                  this.$refs.warehousingMaterialListRef.validateField(
+                    item,
+                    (err) => {
+                      if (err) {
+                        rej(err);
+                      } else {
+                        resolve();
+                      }
+                    }
+                  );
+                })
+            )
+          )
+            .then((res) => {
+              this.$set(row, 'isSave', true);
+              this.createMaterialCode(row);
+            })
+            .catch((err) => {
+              if (showMessage) {
+                showMessage = false;
+                this.$message.error('请填入必填项!');
+              }
+            });
+        });
+      },
+      // 批量设置生产日期
+      handleSelectionChange(val) {
+        this.materialCodeReqListSelected = val;
+      },
+      dateSetting() {
+        if (!this.materialCodeReqListSelected.length) {
+          return this.$message.error(`请选择${this.title}明细!`);
+        }
+        this.dateVisible = true;
+      },
+      dateConfirm() {
+        this.materialCodeReqListSelected.forEach((item) => {
+          this.$set(item, this.curDateType, this.batchTime);
+        });
+        this.dateVisible = false;
+      },
+      //入库明细删除
+      listDel(row, index) {
+        this.warehousingMaterialList.splice(index, 1);
+        if (this.isSplit && this.resultArray?.length > 0) {
+          this.handleIsDetail(false);
+        }
+      },
+      // 入库明细生成条码信息
+      async createMaterialCode(row) {
+        // 添加相同物品、批次号重新更新明细 原料编码
+        const list = this.warehousingMaterialList.filter(
+          (i) =>
+            i.assetCode === row.assetCode &&
+            i.batchNo === row.batchNo &&
+            i.isSave
+        );
+        const num = list.reduce((num, pre) => {
+          num += row.isUnpack
+            ? pre.outInNum * pre.minPackingCount
+            : pre.outInNum - 0;
+          return num;
+        }, 0);
+
+        const nums = list.reduce((num, pre) => {
+          num += pre.outInNum * pre.minPackingCount;
+
+          return num;
+        }, 0);
+
+        const res = await outin.getAssetNum({
+          assetCode: row.assetCode,
+          batchNum: row.batchNo,
+          num: num
+        });
+        // row.measuringUnit == 'PCS' ? nums :
+
+        list.forEach((item) => {
+          if (item.warehouseLedgerDetails?.length) {
+            item.warehouseLedgerDetails.forEach((i) => {
+              i.onlyCode = res.shift().onlyCode;
+            });
+          } else {
+            this.$set(
+              item,
+              'warehouseLedgerDetails',
+              Array.from(
+                new Array(
+                  item.isUnpack
+                    ? item.outInNum * item.minPackingCount
+                    : // : item.measuringUnit == 'PCS'
+                      // ? +item.outInNum * parseInt(item.minPackingCount)
+                      +item.outInNum
+                ),
+                (val, idx) => {
+                  return {
+                    ...item,
+                    onlyCode: res.shift().onlyCode,
+                    bizStatus: 1,
+                    contentImage: []
+                  };
+                }
+              )
+            );
+          }
+        });
+
+        // 添加相同物品,重复批次号 重新更新明细 包装编码
+        const batchList = this.warehousingMaterialList.filter(
+          (i) => i.batchNo === row.batchNo && i.isSave
+        );
+        if (batchList.length) {
+          const num = batchList.reduce((num, pre) => {
+            num += +pre.outInNum;
+            return num;
+          }, 0);
+          const res1 = await outin.getAssetNum({
+            batchNum: row.batchNo,
+            num
+          });
+          if (res1) {
+            batchList.forEach((item) => {
+              let num = res1.shift()?.num;
+              let minPackingCount = item.minPackingCount;
+              if (item.warehouseLedgerDetails?.length) {
+                item.warehouseLedgerDetails.forEach((i, index) => {
+                  this.$set(i, 'num', num);
+                  if (row.code == i.code) {
+                    if (item.measuringUnit == item.weightUnit) {
+                      this.$set(i, 'weight', item.minPackingCount);
+                      this.$set(i, 'initWeight', item.minPackingCount);
+                    } else {
+                      this.$set(
+                        i,
+                        'weight',
+                        Number(
+                          this.$math.format(
+                            1 * item.minPackingCount * item.netWeight,
+                            14
+                          )
+                        )
+                      );
+                      this.$set(
+                        i,
+                        'initWeight',
+                        Number(
+                          this.$math.format(
+                            1 * item.minPackingCount * item.netWeight,
+                            14
+                          )
+                        )
+                      );
+                    }
+                  }
+
+                  this.$set(i, 'weightUtil', item.weightUnit);
+
+                  this.$set(i, 'packingCount', 1);
+                  this.$set(i, 'packingUnit ', item.packingUnit);
+                  this.$set(i, 'minPackingCount ', item.minPackingCount);
+                  this.$set(i, 'measuringUnit', item.measuringUnit);
+                  this.$set(i, 'isPack', false);
+                  this.$set(i, 'result', '');
+                  this.$set(i, 'status', '0');
+                  if (!item.isUnpack) {
+                    if (index < item.warehouseLedgerDetails.length - 1) {
+                      num = res1.shift()?.num;
+                    }
+                  } else {
+                    // 拆包的包装编码一致
+                    minPackingCount--;
+                    if (
+                      minPackingCount === 0 &&
+                      index < item.warehouseLedgerDetails.length - 1
+                    ) {
+                      minPackingCount = item.minPackingCount;
+                      num = res1.shift()?.num;
+                    }
+                  }
+                });
+              }
+            });
+          }
+        }
+      },
+      // 包装批量保存
+      wrapListSave() {
+        // 批量修改包装明细
+        this.isWeight = false;
+        this.bulkEditingWrap();
+        this.$nextTick(() => {
+          this.isWeight = true;
+        });
+      },
+      // 物料批量保存
+      materialListSave() {
+        this.resultArray.forEach((item) => {
+          if (!item.isPack) {
+            this.materialBtn(item);
+          }
+        });
+      },
+      // 外部调用获取入库数据
+      getReturnStorage() {
+        return new Promise((resolve) => {
+          this.$refs.formName.validate(async (valid) => {
+            if (valid) {
+              if (!this.warehousingMaterialList?.length) {
+                return this.$message.error('请添加入库明细!');
+              } else if (
+                this.warehousingMaterialList.some((item) => !item.isSave)
+              ) {
+                return this.$message.error('请保存入库明细!');
+              }
+              // 默认全部保存
+              if (this.resultArray?.length > 0) {
+                // 物料批量保存
+                this.materialListSave();
+              } else {
+                // 包装批量保存
+                this.wrapListSave();
+              }
+              this.formatWarehouseMaterialList();
+
+              let arr = this.warehousingMaterialList.map((item) => {
+                console.log(item, 'item');
+                return {
+                  netWeight: item.netWeight > 0 ? item.netWeight : 0,
+                  num: item.num > 0 ? item.num : 0,
+                  manualBatchNo: item.manualBatchNo,
+                  batchNo: item.batchNo,
+                  categoryId:
+                    this.formData.bizType == 2
+                      ? item.categoryId
+                        ? item.categoryId
+                        : item.id
+                      : item.id,
+                  count:
+                    item.outInNum > 0 && item.minPackingCount > 0
+                      ? this.$math.format(
+                          parseInt(item.outInNum) *
+                            parseInt(item.minPackingCount),
+                          14
+                        )
+                      : 0,
+                  minPackingCount:
+                    item.minPackingCount > 0 ? item.minPackingCount : 0,
+                  packingCount: item.outInNum > 0 ? item.outInNum : 0,
+                  price: item.univalence > 0 ? item.univalence : 0,
+                  outInDetailRecordAddPOList: item.warehouseLedgerDetails,
+                  position: `${item.warehouseName}-${item.areaName}-${item.shelfCode}-${item.cargoSpaceCode}`,
+                  remark: '',
+                  pathIds: `${item.warehouseId},${item.areaId},${item.shelfId},${item.cargoSpaceId}`,
+                  pathName: `${item.warehouseName},${item.areaName},${item.shelfCode},${item.cargoSpaceCode}`,
+                  totalMoney:
+                    item.outInNum > 0 &&
+                    item.minPackingCount > 0 &&
+                    item.univalence > 0
+                      ? this.$math.format(
+                          item.outInNum *
+                            item.minPackingCount *
+                            item.univalence,
+                          14
+                        )
+                      : 0,
+                  weightUnit: item.weightUnit,
+                  customCode: item.customCode,
+                  supplierCode: item.supplierCode,
+                  weight: item.weight > 0 ? item.weight : 0,
+                  houseList: [
+                    `${item.warehouseName},${item.areaName},${item.shelfCode},${item.cargoSpaceCode}`
+                  ]
+                };
+              });
+              arr.forEach((item) => {
+                if (item.outInDetailRecordAddPOList.length > 0) {
+                  let list = item.outInDetailRecordAddPOList.map((it) => {
+                    return this.formatOutInDetailRecordAddPO(it, item);
+                  });
+                  item.outInDetailRecordAddPOList = list;
+                }
+              });
+
+              let obj = { ...this.formData, type: 1 };
+              obj.outInDetailAddPOList = arr;
+              resolve(obj);
+            }
+          });
+        });
+      },
+      // 格式化产品信息入库数据
+      formatWarehouseMaterialList() {
+        for (let key in this.warehousingMaterialList) {
+          for (let k in this.warehousingMaterialList[key].houseList) {
+            let house = this.warehousingMaterialList[key].houseList[k];
+            this.warehousingMaterialList[key].warehouseName =
+              house.warehouseName;
+            this.warehousingMaterialList[key].areaName = house.areaName;
+            this.warehousingMaterialList[key].shelfCode = house.shelfCode;
+            this.warehousingMaterialList[key].cargoSpaceCode =
+              house.cargoSpaceCode;
+            this.warehousingMaterialList[key].warehouseId = house.warehouseId;
+            this.warehousingMaterialList[key].areaId = house.areaId;
+            this.warehousingMaterialList[key].shelfId = house.shelfId;
+            this.warehousingMaterialList[key].cargoSpaceId = house.cargoSpaceId;
+            this.warehousingMaterialList[key].num = house.num;
+          }
+        }
+      },
+      // 格式化包装明细入库数据
+      formatOutInDetailRecordAddPO(it, item) {
+        return {
+          code: it.onlyCode,
+          dateType: this.curDateType === 'manufactureTime' ? 2 : 1,
+          dateValue: it[this.curDateType],
+          minUnit: it.minPackingCount,
+          minPositionId: it.cargoSpaceId,
+          minPackingCount: it.minPackingCount,
+          name: it.assetName,
+          pathIds: item.pathIds,
+          unit: it.unit,
+          packageNo: it.num,
+          clientCode: it.clientCode,
+          materielCode: it.materielCode,
+          weight: it.weight,
+          weightUtil: it.weightUtil,
+          engrave: it.engrave,
+          materialDetails: this.materialDetails(it.onlyCode),
+          packingCount: it.packingCount,
+          status: it.status,
+          result: it.result
+        };
+      },
+      // 过滤物料明细入库数据
+      materialDetails(onlyCode) {
+        return this.resultArray.filter((item) => item.onlyCode === onlyCode);
+      },
+      // 添加物品明细
+      addProduct(val) {
+        // 已经拆分(还原到未拆封编辑状态)
+        if (this.isSplit && this.resultArray.length > 0) {
+          this.handleIsDetail(false);
+        }
+        this.onSelectTableData(val);
+      },
+      //添加产品明细
+      async onSelectTableData(val) {
+        const res = await getCode('lot_number_code');
+        this.warehousingMaterialList.push(
+          ...val.map((next) => {
+            next.batchNo = res;
+            let cur = {};
+            next.realInventoryAmount = next.realInventoryAmount || 0;
+            cur = {
+              ...next,
+              cargoSpaceCode: '', //货位编码
+              cargoSpaceId: '', //货位id
+              shelfId: '', //货架id
+              shelfCode: '', //货架名称
+              areaId: '', //库区id
+              areaName: '', //库区名称
+              warehouseId: '', //仓库id
+              warehouseName: '', //仓库名称
+              assetType: this.formData.extInfo.assetType,
+              expirationDate: '',
+              outInNum: '',
+              minPackingCount: '',
+              bizStatus: 1,
+              contentImage: [],
+              warehouseLedgerDetails: [],
+              houseList: []
+            };
+            return cur;
+          })
+        );
+      },
+      async initData() {
+        const { data } = await getTreeByGroup({ type: 1 });
+        this.codeList = data;
+        const res = await warehouseDefinition.tree();
+        const info = await getLoginUser();
+        let obj = res.find(
+          (item) => item.id === info.deptId[info.deptId.length - 1]
+        );
+        if (!obj) return;
+        this.formData.extInfo.deptCode = obj.id;
+        this.formData.extInfo.deptName = obj.name;
+        this.formData.extInfo.createUserName = info.name;
+        this.formData.createUserId = info.id;
+      },
+      // 添加产品信息
+      addStock() {
+        if (!this.title) {
+          return this.$message.error('请选择入库产品类型');
+        }
+        if (!this.formData.bizType) {
+          return this.$message.error('请选择入库场景');
+        }
+        this.visibleDialog = true;
+      },
+      upload(data) {
+        this.formData.contentImage = data;
+        this.$refs.formName.validateField('contentImage');
+      },
+      houseData(argum, idx) {
+        this.$set(this.warehousingMaterialList[idx], 'houseList', argum);
+      }
+    },
+    watch: {
+      // 解决右侧悬浮操作栏不对称问题
+      warehousingMaterialList: {
+        handler() {
+          this.$nextTick(() => {
+            this.$refs.warehousingMaterialListTable?.doLayout();
+          });
+        },
+        deep: true
+      },
+      // 解决右侧悬浮操作栏不对称问题
+      materialCodeReqList: {
+        handler() {
+          this.$nextTick(() => {
+            this.$refs.materialCodeReqListTable?.doLayout();
+          });
+        },
+        deep: true
+      },
+      // 解决右侧悬浮操作栏不对称问题
+      resultArray: {
+        handler() {
+          this.$nextTick(() => {
+            this.$refs.resultArrayTable?.doLayout();
+          });
+        },
+        deep: true
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  ::v-deep.form-table {
+    .el-form-item {
+      margin-bottom: 0;
+    }
+    .el-input__inner {
+      padding: 0 10px;
+    }
+    ::-webkit-scrollbar {
+      width: 8px;
+      height: 8px;
+      background-color: transparent;
+    }
+  }
+  .p20 {
+    padding: 20px;
+  }
+  .el-select,
+  .el-date-editor {
+    width: 100%;
+  }
+  .el-form-item {
+    margin-bottom: 22px;
+  }
+  .material {
+    margin-top: 20px;
+    .flex {
+      display: flex;
+      justify-content: space-between;
+      font-size: 14px;
+      align-items: center;
+      .red {
+        color: #ff4949;
+      }
+    }
+  }
+  .mt10 {
+    margin-top: 10px;
+  }
+  .mt20 {
+    margin-top: 20px;
+  }
+  .center {
+    text-align: center;
+  }
+
+  .switch_left li {
+    border-right: 1px solid rgba(222, 222, 222, 1);
+    border-left: 1px solid rgba(222, 222, 222, 1);
+  }
+
+  .fontOmitted {
+    text-overflow: ellipsis;
+    overflow: hidden;
+    word-break: break-all;
+    white-space: nowrap;
+  }
+  .table-fixed {
+    .el-table__fixed-right {
+      height: 100% !important;
+    }
+    .el-table__fixed-left {
+      height: 100% !important;
+    }
+    .el-table__fixed {
+      height: 100% !important;
+    }
+  }
+</style>

+ 2 - 0
src/views/bpm/stockManagement/components/WareHouseDailog.vue

@@ -252,6 +252,8 @@
               this.row.warehouseId
             );
             this.areaList = rep || [];
+            this.shelves = '';
+            this.area = '';
           }
         } else {
           if (row.houseList.length != 0) {

+ 597 - 0
src/views/bpm/tickets/components/RepairDetailsDialog.vue

@@ -0,0 +1,597 @@
+<template>
+  <!-- 维修工单弹框 -->
+  <el-dialog
+    :title="dialogTitle"
+    :visible.sync="equipmentdialog"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    width="60%"
+  >
+    <el-tabs
+      v-model="detailsTabsActiveName"
+      type="border-card"
+      v-if="row.title == '工单详情'"
+    >
+      <el-tab-pane :label="tabLabel" name="keepInRepair">
+        <WorkOrderTab
+          :repairInfoLogList="repairInfoLogs"
+          :equipmentInfo="equipmentInfo"
+          :workOrderInfo="workOrderInfo"
+          :planInfo="planInfo"
+          v-if="tabLabel === '工单信息'"
+        />
+        <RepairNotesTab
+          :repairInfoLogList="repairInfoLogs"
+          v-if="tabLabel === '维修信息'"
+        />
+      </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.repairUserName : '' }}</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.repairsImg"
+              :key="index"
+              style="width: 100px; height: 100px; margin-right: 5px"
+              :src="item.url"
+              :preview-src-list="[item.url]"
+            />
+          </el-col>
+        </el-row>
+      </el-tab-pane>
+    </el-tabs>
+
+    <el-tabs v-model="detailsTabsActiveName" type="border-card" v-else>
+      <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 ? getDictValue('报修来源', 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.repairsDeptPhone : '' }}</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.repairsImg"
+              :key="index"
+              style="width: 100px; height: 100px; margin-right: 5px"
+              :src="item.url"
+              :preview-src-list="[item.url]"
+            />
+          </el-col>
+        </el-row> -->
+        <!-- <el-row class="repair_row">
+          <el-col :span="24" class="repair_column">
+            <span class="label">视频:</span>
+            <span>{{ infoData ? infoData.repairsVideo : '' }}</span>
+          </el-col>
+        </el-row> -->
+      </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.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.position }}</span>
+          </el-col>
+        </el-row>
+        <el-row class="repair_row">
+          <el-col :span="12" class="repair_column">
+            <span>规格型号:</span>
+            <span>
+              {{
+                equipmentInfo.category && equipmentInfo.category.specification
+              }}|{{
+                equipmentInfo.category && equipmentInfo.category.modelType
+              }}
+            </span>
+          </el-col>
+        </el-row>
+      </el-tab-pane>
+      <el-tab-pane :label="tabLabel" name="keepInRepair">
+        <WorkOrderTab
+          :repairInfoLogList="repairInfoLogs"
+          :workOrderInfo="workOrderInfo"
+          :planInfo="planInfo"
+          v-if="tabLabel === '工单信息'"
+        />
+        <RepairNotesTab
+          :repairInfoLogList="repairInfoLogs"
+          v-if="tabLabel === '维修信息'"
+        />
+      </el-tab-pane>
+    </el-tabs>
+    <!-- <div class="btnbox">
+      <el-button class="confirm-btn" type="danger" plain @click="reject"
+        >驳回</el-button
+      >
+      <el-button class="confirm-btn" type="success" plain @click="pass"
+        >验收</el-button
+      >
+      <el-button class="cancel-btn" @click="handleClose">关闭</el-button>
+    </div> -->
+    <div class="textbox" v-if="!showBtn">
+      <el-input
+        type="textarea"
+        placeholder="请输入理由"
+        v-model="cause"
+        maxlength="30"
+        rows="5"
+        show-word-limit
+      >
+      </el-input>
+      <div class="textbtnbox">
+        <el-button
+          class="confirm-btn"
+          type="danger"
+          plain
+          @click="surereject(5)"
+          >驳回</el-button
+        >
+        <el-button
+          class="confirm-btn"
+          type="success"
+          plain
+          @click="surereject(4)"
+          >验收</el-button
+        >
+        <el-button size="small" plain @click="cancelreject">取消</el-button>
+        <!-- <el-button size="small" round @click="surereject">提交</el-button> -->
+      </div>
+    </div>
+    <!-- <div slot="footer" v-if="!row.isshow">
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div> -->
+  </el-dialog>
+</template>
+
+<script>
+  import RepairNotesTab from './RepairNotesTab.vue';
+  import WorkOrderTab from './WorkOrderTab.vue';
+  import {
+    getWorkOrderDetail,
+    getRepairById,
+    getAssetInfo,
+    acceptance
+  } from '@/api/tickets';
+  import dictMixins from '@/mixins/dictMixins';
+  export default {
+    mixins: [dictMixins],
+    props: {},
+    components: { RepairNotesTab, WorkOrderTab },
+    data() {
+      return {
+        showBtn: false,
+        equipmentdialog: false,
+        detailsTabsActiveName: 'repairApplication',
+        workOrderInfo: {},
+        planInfo: {},
+        infoData: {},
+        equipmentInfo: {},
+        repairInfoLogs: [],
+        tabLabel: '',
+        dialogTitle: '',
+        row: {},
+        cause: '',
+        showtext: false
+      };
+    },
+    created() {
+      this.requestDict('报修来源');
+      this.requestDict('报修状态');
+    },
+    methods: {
+      handleClose() {
+        this.equipmentdialog = false;
+        if (this.row.title === '工单详情') {
+          this.detailsTabsActiveName = 'keepInRepair';
+        } else {
+          this.detailsTabsActiveName = 'repairApplication';
+        }
+      },
+      async init(row, boolen) {
+        this.showBtn = !!boolen;
+        this.row = row;
+        console.log('row----------------------------------');
+        console.log(row);
+        this.equipmentdialog = true;
+        this.dialogTitle = row.title;
+        this.tabLabel = row.tabLabel;
+        if (row.title === '工单详情') {
+          this.detailsTabsActiveName = 'keepInRepair';
+        }
+        if (row.title === '报修记录详情') {
+          this.getSbinfo(this.row.deviceId);
+          const res = await getRepairById(row.id);
+          console.log('报修记录详情', res);
+          this.infoData = res ? res : {};
+          this.repairInfoLogs = res.repairLogVOList.reverse();
+          // 处理图片
+          // if (this.infoData && this.infoData.repairsImg) {
+          //   const repairsImg = this.infoData.repairsImg
+          //   this.infoData.repairsImg = []
+          //   repairsImg.split(',').map(item => {
+          //     imageView(item).then(res => {
+          //       this.infoData.repairsImg.push({
+          //         name: item.substring('/download/'.length),
+          //         url: res
+          //       })
+          //     })
+
+          //     console.log(this.infoData.repairsImg)
+          //     return
+          //   })
+          // }
+        } else if (row.title === '消息信息详情') {
+          this.getSbinfo(this.row.deviceId);
+          const res = await getRepairById(row.id);
+          this.infoData = res ? res : {};
+          this.repairInfoLogs = res.repairLogVOList.reverse();
+          // 处理图片
+          // if (this.infoData && this.infoData.repairsImg) {
+          //   const repairsImg = this.infoData.repairsImg
+          //   this.infoData.repairsImg = []
+          //   repairsImg.split(',').map(item => {
+          //     imageView(item).then(res => {
+          //       this.infoData.repairsImg.push({
+          //         name: item.substring('/download/'.length),
+          //         url: res
+          //       })
+          //     })
+          //     return
+          //   })
+          // }
+        } else {
+          console.log('----------');
+          console.log(row);
+
+          const res = await getWorkOrderDetail(row.code);
+          console.log(res);
+          this.workOrderInfo = res.ticketsInfoResponse;
+          this.infoData = res.repairRequestResponse;
+          this.getSbinfo(res.ticketsInfoResponse.deviceId);
+          // this.planInfo = res.data.planInfo;
+          // this.planInfo.executeUserName = res.data.executeUserName;
+          // this.planInfo.executorDeptName = res.data.executorDeptName;
+          // this.infoData = res.data.repairInfo ? res.data.repairInfo : {};
+          // // 处理图片
+          // if (this.infoData && this.infoData.repairsImg) {
+          //   const repairsImg = this.infoData.repairsImg;
+          //   this.infoData.repairsImg = [];
+          //   repairsImg.split(',').map((item) => {
+          //     imageView(item).then((res) => {
+          //       this.infoData.repairsImg.push({
+          //         name: item.substring('/download/'.length),
+          //         url: res
+          //       });
+          //     });
+          //     return;
+          //   });
+          // }
+          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();
+        }
+      },
+
+      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
+                : ''
+            );
+          }
+        });
+      },
+
+      //通过按钮事件
+      pass() {
+        let params = {
+          orderStatus: 4,
+          remark: this.cause,
+          workOrderId: this.row.id
+        };
+        acceptance(params).then((res) => {
+          if (res.success) {
+            this.$message.success('验收成功!');
+            this.$emit('refesh');
+            this.equipmentdialog = false;
+          }
+        });
+      },
+      //驳回按钮事件
+      reject() {
+        this.showtext = true;
+        let ele = document.getElementsByClassName('el-dialog__wrapper');
+        let bodyscrollHeight = document.body.scrollHeight;
+        this.$nextTick(() => {
+          ele.forEach((element) => {
+            if (element.style.display !== 'none') {
+              element.scrollTop = bodyscrollHeight;
+            }
+          });
+        });
+      },
+      cancelreject() {
+        this.showtext = false;
+        this.cause = '';
+      },
+      surereject(orderStatus) {
+        let params = {
+          orderStatus,
+          remark: this.cause,
+          workOrderId: this.row.id
+        };
+        acceptance(params).then((res) => {
+          if (res.code == 0) {
+            this.$message.success(
+              orderStatus == 4 ? '审核通过!' : '驳回成功!'
+            );
+            this.$emit('refesh');
+            this.equipmentdialog = false;
+          }
+        });
+      }
+    },
+    watch: {
+      equipmentdialog(nVal, oVal) {
+        if (!nVal) {
+          this.cause = '';
+          this.showtext = false;
+        }
+      }
+    }
+  };
+</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>

+ 303 - 0
src/views/bpm/tickets/components/RepairNotesTab.vue

@@ -0,0 +1,303 @@
+<!-- 维修信息 -->
+<template>
+  <div class="repair_infoLogs">
+    <el-steps
+      direction="vertical"
+      :active="0"
+      :space="100"
+      v-for="(item, index) in repairInfoLogList"
+      :key="index"
+    >
+      <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>{{ item.createTime }}</span>
+        </div>
+        <div slot="description" class="step_description">
+          <span>验收人:{{ item.content.userName }}</span>
+          <span
+            >验收结果:{{
+              item.content.acceptanceResult ? '通过' : '驳回'
+            }}</span
+          >
+          <span>验收说明:{{ item.content.acceptanceInstructions }}</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>{{ item.content.createTime }}</span>
+        </div>
+        <div slot="description" class="work_report_desc">
+          <div> 处理说明:{{ item.content.repairReportExplain }} </div>
+          <div class="work_report_imgs" style="width: 50px; height: 50px">
+            <img
+              v-for="(ite, index) in item.content.workOrderImgList"
+              :key="index"
+              :src="ite"
+              alt=""
+              style="width: 40%"
+            />
+          </div>
+          <div>
+            <div>备品备件使用情况:</div>
+            <el-table :data="workReportData" border>
+              <el-table-column label="备件编码" prop="code" align="center" />
+              <el-table-column label="备件名称" align="center" prop="name" />
+              <el-table-column
+                label="所属分类"
+                prop="typeName"
+                align="center"
+              />
+              <el-table-column label="型号" align="center" prop="model" />
+              <el-table-column label="使用数量" prop="num" align="center" />
+            </el-table>
+          </div>
+        </div>
+      </el-step>
+
+      <el-step v-if="item.type == 'START'">
+        <span
+          slot="icon"
+          :class="
+            lastStepName == 'START' ? 'step_icon step_active' : 'step_icon'
+          "
+        ></span>
+        <div slot="title" class="step_title">
+          <span>开始执行</span>
+          <span>{{ item.createTime }}</span>
+        </div>
+        <div slot="description" class="step_description">
+          <span>执行人:{{ item.content.executorName }}</span>
+        </div>
+      </el-step>
+
+      <el-step v-if="item.type == 'CREATE_WORK_ORDER'">
+        <span
+          slot="icon"
+          :class="index == 0 ? 'step_icon step_active' : 'step_icon'"
+        ></span>
+        <div slot="title" class="step_title">
+          <span>生成工单</span>
+          <span>{{ item.createTime }}</span>
+        </div>
+        <div
+          slot="description"
+          class="step_description"
+          style="margin-bottom: 30px"
+        >
+          <el-row>
+            <el-col :span="8">
+              <span>工单编号:{{ item.content.workOrderCode }}</span>
+            </el-col>
+            <el-col :span="8">
+              <span>执行人:{{ item.content.workOrderExecutorName }}</span>
+            </el-col>
+            <el-col :span="8">
+              <span>执行人电话:{{ item.content.workOrderExecutorPhone }}</span>
+            </el-col>
+            <el-col :span="24">
+              <span>计划完成时间:{{ item.content.plannedTime }}</span>
+            </el-col>
+            <el-col :span="24">
+              <span>维修方案:{{ item.content.maintenanceContent }}</span>
+            </el-col>
+          </el-row>
+        </div>
+      </el-step>
+
+      <el-step v-if="item.type == 'EXAMINE_PLAN'">
+        <span
+          slot="icon"
+          :class="index == 0 ? 'step_icon step_active' : 'step_icon'"
+        ></span>
+        <div slot="title" class="step_title">
+          <span>审核维修计划</span>
+          <span>{{ item.content.createTime }}</span>
+        </div>
+        <div slot="description" class="step_description">
+          <span>审核人:{{ item.content.examinePlanUserName }}</span>
+          <span
+            >审核结果:{{
+              item.content.examinePlanUserName ? '通过' : ''
+            }}</span
+          >
+          <span>审核说明:{{ item.content.examineExplain }}</span>
+        </div>
+      </el-step>
+
+      <el-step v-if="item.type == 'CREATE_PLAN'">
+        <span
+          slot="icon"
+          :class="index == 0 ? 'step_icon step_active' : 'step_icon'"
+        ></span>
+        <div slot="title" class="step_title">
+          <span
+            >创建维修计划<span v-if="item.createNum"
+              >(第{{ item.createNum }}次)</span
+            ></span
+          >
+          <span>{{ item.createTime }}</span>
+        </div>
+        <div slot="description" class="step_description">
+          <span>创建人:{{ item.content.createUserName }}</span>
+          <span>计划单号:{{ item.content.planCode }}</span>
+          <span>计划名称:{{ item.content.planName }}</span>
+        </div>
+      </el-step>
+
+      <el-step v-if="item.type == 'ACCEPTANCE_CHEK_OUTSOURCE_WORK_ORDER'">
+        <span
+          slot="icon"
+          :class="index == 0 ? 'step_icon step_active' : 'step_icon'"
+        ></span>
+        <div slot="title" class="step_title">
+          <span>验收委外工单</span>
+          <span>{{ item.createTime }}</span>
+        </div>
+        <div slot="description" class="step_description">
+          <span>验收人:{{ item.content.executorName }}</span>
+          <span
+            >验收结果:{{ item.content.checkResult ? '通过' : '驳回' }}</span
+          >
+          <span>验收说明:{{ item.content.checkDesc }}</span>
+        </div>
+      </el-step>
+
+      <el-step v-if="item.type == 'CREATE_OUTSOURCE_WORK_ORDER'">
+        <span
+          slot="icon"
+          :class="index == 0 ? 'step_icon step_active' : 'step_icon'"
+        ></span>
+        <div slot="title" class="step_title">
+          <span
+            >生成委外工单<span v-if="item.createNum"
+              >(第{{ item.createNum }}次)</span
+            ></span
+          >
+          <span>{{ item.createTime }}</span>
+        </div>
+        <div slot="description" class="step_description">
+          <span>创建人:{{ item.content.executorName }}</span>
+          <span>工单编号:{{ item.content.outsourcCode }}</span>
+          <span>委外单位:{{ item.content.outsourcUnit }}</span>
+        </div>
+      </el-step>
+
+      <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>{{ item.createTime }}</span>
+          <!-- <span>{{ logs['CREATE'].createTime }}</span> -->
+        </div>
+      </el-step>
+    </el-steps>
+  </div>
+</template>
+
+<script>
+  // import repair from '@/api/maintenance/repair/repair'
+
+  export default {
+    props: {
+      repairInfoLogList: {
+        type: Array,
+        default: () => {
+          return [];
+        }
+      }
+    },
+    watch: {
+      repairInfoLogList(val) {
+        console.log('repairInfoLogList', val);
+        // val.forEach(item => {
+        //   this.logs[item.type.code] = {
+        //     id: item.id,
+        //     name: item.type.desc,
+        //     content: JSON.parse(item.content),
+        //     createTime: item.createTime
+        //   }
+        // })
+        // this.length = val.length
+        // this.logsKeys = Object.keys(this.logs)
+        // this.lastStepName = this.logsKeys[this.logsKeys.length - 1]
+        // if (this.logs['WORK_REPORT']) {
+        //   const workOrderId = this.logs['WORK_REPORT'].content.workOrderId
+        //   repair
+        //     .getSpareData({ workOrderId })
+        //     .then(res => {
+        //       // console.log(res)
+        //       this.workReportData = res.data
+        //     })
+        //     .catch(() => {})
+        // }
+      }
+    },
+    data() {
+      return {
+        logs: {},
+        logsKeys: [],
+        lastStepName: '',
+        workReportData: [],
+        length: null
+      };
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .repair_infoLogs {
+    .step_icon {
+      width: 100%;
+      height: 100%;
+      border-radius: 50%;
+      box-sizing: border-box;
+      background-color: #fff;
+    }
+    .step_active {
+      border: 0;
+      background-color: #1890ff;
+    }
+    .step_title {
+      width: 400px;
+      color: #000;
+      display: flex;
+      justify-content: space-between;
+    }
+    .step_description {
+      display: flex;
+      padding: 5px 10px;
+      background-color: #f2f2f2;
+      justify-content: space-between;
+      color: #7f7f7f;
+    }
+    ::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>

+ 675 - 0
src/views/bpm/tickets/components/WorkOrderTab.vue

@@ -0,0 +1,675 @@
+<!-- 工单信息 -->
+<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="24" class="repair_column">
+          <span>维修方案:</span>
+          <span>{{ workOrderInfo ? workOrderInfo.repairPrograms : '' }}</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>
+    </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="
+            lastStepName == 'CREATE' ? 'step_icon step_active' : 'step_icon'
+          "
+        ></span>
+        <div slot="title" class="step_title">
+          <span>生成工单</span>
+          <span>{{ logs['CREATE'].createTime }}</span>
+        </div>
+        <div slot="description" class="create_workerOrder_desc">
+          <div> 报修人:{{ logs['CREATE'].requestUserName }} </div>
+          <div> 故障描述:{{ logs['CREATE'].remark }} </div>
+        </div>
+      </el-step>
+      <el-step v-if="item.type == 'SPARE_PARTS_APPLY'">
+        <span
+          slot="icon"
+          :class="
+            lastStepName == 'SPARE_PARTS_APPLY'
+              ? 'step_icon step_active'
+              : 'step_icon'
+          "
+        ></span>
+        <div slot="title" class="step_title">
+          <span>备品备件申请</span>
+          <span>{{ logs['SPARE_PARTS_APPLY'].createTime }}</span>
+        </div>
+        <div slot="description" class="work_report_desc">
+          <!-- <div slot="description" class="step_description">
+            <span
+              >申领单号:{{
+                logs['SPARE_PARTS_APPLY'].content.sparePartsCode
+              }}</span
+            >
+          </div> -->
+          <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="
+            lastStepName == 'ACCEPTANCE_CHEK'
+              ? 'step_icon step_active'
+              : 'step_icon'
+          "
+        ></span>
+        <div slot="title" class="step_title">
+          <span>验收</span>
+          <span>{{ logs['ACCEPTANCE_CHEK'].createTime }}</span>
+        </div>
+        <div slot="description" class="step_description">
+          <span>验收人:{{ logs['ACCEPTANCE_CHEK'].content.userName }}</span>
+          <span
+            >验收结果:{{
+              logs['ACCEPTANCE_CHEK'].content.orderStatus == 4 ? '通过' : '驳回'
+            }}</span
+          >
+          <span>验收说明:{{ logs['ACCEPTANCE_CHEK'].content.remark }}</span>
+        </div>
+      </el-step>
+      <el-step v-if="item.type == 'WORK_REPORT'">
+        <span
+          slot="icon"
+          :class="
+            lastStepName == 'WORK_REPORT'
+              ? 'step_icon step_active'
+              : 'step_icon'
+          "
+        ></span>
+        <div slot="title" class="step_title">
+          <span>报工</span>
+          <span>{{ logs['WORK_REPORT'].createTime }}</span>
+        </div>
+        <div slot="description" class="work_report_desc">
+          <div> 处理说明:{{ logs['WORK_REPORT'].content.reason }} </div>
+          <div class="work_report_imgs" style="width: 50px; height: 50px">
+            <img
+              v-for="(item, index) in logs['WORK_REPORT'].content
+                .workOrderImgList"
+              :key="index"
+              :src="item"
+              alt=""
+              style="width: 40%"
+            />
+          </div>
+          <!-- <div>
+            <div>备品备件使用情况:</div>
+            <el-table :data="useData" border>
+              <el-table-column
+                label="备件编码"
+                prop="assetCode"
+                align="center"
+              />
+              <el-table-column
+                label="备件名称"
+                align="center"
+                prop="informationName"
+              />
+              <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="typeName" align="center">
+                <template slot-scope="{ row }">
+                  <div>1</div>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div> -->
+        </div>
+      </el-step>
+    </el-steps>
+    <!-- <el-steps
+      direction="vertical"
+      :active="0"
+      :space="100"
+      v-for="(item, index) in repairInfoLogList"
+      :key="index"
+    >
+      <el-step v-if="item.type.code == 'ACCEPTANCE_CHEK'">
+        <span
+          slot="icon"
+          :class="
+            lastStepName == 'ACCEPTANCE_CHEK'
+              ? 'step_icon step_active'
+              : 'step_icon'
+          "
+        ></span>
+        <div slot="title" class="step_title">
+          <span>验收</span>
+          <span>{{ logs['ACCEPTANCE_CHEK'].createTime }}</span>
+        </div>
+        <div slot="description" class="step_description">
+          <span>验收人:{{ logs['ACCEPTANCE_CHEK'].content.userName }}</span>
+          <span
+            >验收结果:{{
+              logs['ACCEPTANCE_CHEK'].content.acceptanceResult ? '通过' : '驳回'
+            }}</span
+          >
+          <span
+            >验收说明:{{
+              logs['ACCEPTANCE_CHEK'].content.acceptanceInstructions
+            }}</span
+          >
+        </div>
+      </el-step>
+
+      <el-step v-if="item.type.code == 'WORK_REPORT'">
+        <span
+          slot="icon"
+          :class="
+            lastStepName == 'WORK_REPORT'
+              ? 'step_icon step_active'
+              : 'step_icon'
+          "
+        ></span>
+        <div slot="title" class="step_title">
+          <span>报工</span>
+          <span>{{ logs['WORK_REPORT'].createTime }}</span>
+        </div>
+        <div slot="description" class="work_report_desc">
+          <div>
+            处理说明:{{ logs['WORK_REPORT'].content.repairReportExplain }}
+          </div>
+          <div class="work_report_imgs" style="width: 50px; height: 50px">
+            <img
+              v-for="(item, index) in logs['WORK_REPORT'].content
+                .workOrderImgList"
+              :key="index"
+              :src="item"
+              alt=""
+              style="width: 40%"
+            />
+          </div>
+          <div>
+            <div>备品备件使用情况:</div>
+            <el-table :data="useData" border>
+              <el-table-column
+                label="备件编码"
+                prop="assetCode"
+                align="center"
+              />
+              <el-table-column
+                label="备件名称"
+                align="center"
+                prop="informationName"
+              />
+              <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="typeName" align="center">
+                <template slot-scope="{ row }">
+                  <div>1</div>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </div>
+      </el-step>
+
+      <el-step v-if="item.type.code == 'STOCK_OUT_APPROVAL'">
+        <span
+          slot="icon"
+          :class="
+            lastStepName == 'STOCK_OUT_APPROVAL'
+              ? 'step_icon step_active'
+              : 'step_icon'
+          "
+        ></span>
+        <div slot="title" class="step_title">
+          <span>备品备件出库审核</span>
+          <span>{{ logs['STOCK_OUT_APPROVAL'].createTime }}</span>
+        </div>
+        <div slot="description" class="step_description">
+          <span
+            >出库单号:{{
+              logs['STOCK_OUT_APPROVAL'].content.stockOutCode
+            }}</span
+          >
+          <span
+            >审核人:{{
+              logs['STOCK_OUT_APPROVAL'].content.approvalUserName
+            }}</span
+          >
+          <span
+            >审核结果:{{
+              logs['SPARE_PARTS_APPROVAL'].content.approvalResult
+                ? '通过'
+                : '驳回'
+            }}</span
+          >
+        </div>
+      </el-step>
+
+      <el-step v-if="item.type.code == 'STOCK_OUT_APPLY'">
+        <span
+          slot="icon"
+          :class="
+            lastStepName == 'STOCK_OUT_APPLY'
+              ? 'step_icon step_active'
+              : 'step_icon'
+          "
+        ></span>
+        <div slot="title" class="step_title">
+          <span>备品备件出库申请</span>
+          <span>{{ logs['STOCK_OUT_APPLY'].createTime }}</span>
+        </div>
+        <div slot="description" class="step_description">
+          <span
+            >出库单号:{{ logs['STOCK_OUT_APPLY'].content.stockOutCode }}</span
+          >
+          <span
+            >申请人:{{ logs['STOCK_OUT_APPLY'].content.applyUserName }}</span
+          >
+          <span
+            >审核人:{{
+              logs['STOCK_OUT_APPLY'].content.approvalUserName
+            }}</span
+          >
+        </div>
+      </el-step>
+
+      <el-step v-if="item.type.code == 'SPARE_PARTS_APPROVAL'">
+        <span
+          slot="icon"
+          :class="
+            lastStepName == 'SPARE_PARTS_APPROVAL'
+              ? 'step_icon step_active'
+              : 'step_icon'
+          "
+        ></span>
+        <div slot="title" class="step_title">
+          <span>备品备件申领审核</span>
+          <span>{{ logs['SPARE_PARTS_APPROVAL'].createTime }}</span>
+        </div>
+        <div slot="description" class="step_description">
+          <span
+            >申领单号:{{
+              logs['SPARE_PARTS_APPROVAL'].content.sparePartsCode
+            }}</span
+          >
+          <span
+            >审核人:{{
+              logs['SPARE_PARTS_APPROVAL'].content.approvalUserName
+            }}</span
+          >
+          <span
+            >审核结果:{{
+              logs['SPARE_PARTS_APPROVAL'].content.approvalResult
+                ? '通过'
+                : '驳回'
+            }}</span
+          >
+        </div>
+      </el-step>
+
+      <el-step v-if="item.type.code == 'SPARE_PARTS_APPLY'">
+        <span
+          slot="icon"
+          :class="
+            lastStepName == 'SPARE_PARTS_APPLY'
+              ? 'step_icon step_active'
+              : 'step_icon'
+          "
+        ></span>
+        <div slot="title" class="step_title">
+          <span>备品备件申请</span>
+          <span>{{ logs['SPARE_PARTS_APPLY'].createTime }}</span>
+        </div>
+        <div slot="description" class="work_report_desc">
+          <div slot="description" class="step_description">
+            <span
+              >申领单号:{{
+                logs['SPARE_PARTS_APPLY'].content.sparePartsCode
+              }}</span
+            >
+            <span
+              >申请人:{{
+                logs['SPARE_PARTS_APPLY'].content.applyUserName
+              }}</span
+            >
+            <span
+              >审核人:{{
+                logs['SPARE_PARTS_APPLY'].content.approvalUserName
+              }}</span
+            >
+          </div>
+          <div>
+            <div>申领清单:</div>
+            <el-table :data="item.applyList" border>
+              <el-table-column
+                label="备件物品编码"
+                align="center"
+                prop="informationCode"
+              />
+              <el-table-column
+                label="备件名称"
+                align="center"
+                prop="informationName"
+              />
+              <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="num" align="center" />
+            </el-table>
+          </div>
+        </div>
+      </el-step>
+
+      <el-step v-if="item.type.code == 'START'">
+        <span
+          slot="icon"
+          :class="
+            lastStepName == 'START' ? 'step_icon step_active' : 'step_icon'
+          "
+        ></span>
+        <div slot="title" class="step_title">
+          <span>开始执行</span>
+          <span>{{ logs['START'].createTime }}</span>
+        </div>
+        <div slot="description" class="step_description">
+          <span>执行人:{{ logs['START'].content.executorName }}</span>
+        </div>
+      </el-step>
+
+      <el-step v-if="item.type.code == 'CREATE_WORK_ORDER'">
+        <span
+          slot="icon"
+          :class="
+            lastStepName == 'CREATE_WORK_ORDER'
+              ? 'step_icon step_active'
+              : 'step_icon'
+          "
+        ></span>
+        <div slot="title" class="step_title">
+          <span>生成工单</span>
+          <span>{{ logs['CREATE_WORK_ORDER'].createTime }}</span>
+        </div>
+      </el-step>
+    </el-steps> -->
+  </div>
+</template>
+
+<script>
+  // import repair from '@/api/maintenance/repair/repair'
+  // import {  getSparePartDetail , getUseDetail } from '@/api/stockManagement/stocking'
+  export default {
+    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.type] = {
+            id: item.id,
+            content: item.content,
+            createTime: item.createTime,
+            remark: item.remark,
+            requestUserName: item.requestUserName
+          };
+          if (item.type === 'SPARE_PARTS_APPLY') {
+            this.logs[item.type].content.infoList =
+              this.logs[item.type].content.infoList &&
+              this.logs[item.type].content.infoList.length > 0
+                ? this.logs[item.type].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>

+ 16 - 1
src/views/bpm/tickets/components/signingUpWork.vue

@@ -18,7 +18,7 @@
       <div class="content-detail">
         <!-- 巡点检、保养设备 -->
         <div class="maintain_equipment_info">
-          <HeaderTitle title="巡点检设备" size="16px"></HeaderTitle>
+          <HeaderTitle title="设备" size="16px"></HeaderTitle>
           <div class="maintain_equipment_info_content">
             <div
               class="equipment_item"
@@ -131,6 +131,15 @@
               </div>
             </div>
           </div>
+          <div class="control">
+            <span>处理说明:</span>
+            <el-input
+              type="textarea"
+              placeholder="请输入内容"
+              v-model="infoData.reason"
+            >
+            </el-input>
+          </div>
         </div>
       </div>
     </div>
@@ -207,6 +216,12 @@
   };
 </script>
 <style lang="scss" scoped>
+  .control {
+    display: flex;
+    > span {
+      width: 80px;
+    }
+  }
   .page {
     padding: 10px;
   }

+ 7 - 1
src/views/bpm/tickets/delivery/index.vue

@@ -166,6 +166,7 @@
   import { ticketStatus } from '@/utils/dict/tickets';
   import { getWorkOrderPage, getRule } from '@/api/tickets';
   import pagenation from '@/components/Pagination';
+  import { deepClone } from 'ele-admin/lib/utils/core';
   export default {
     components: { pagenation, signingUpWork, redeployOther },
     data() {
@@ -173,7 +174,7 @@
         ruleNameList: [],
         tableData: [],
         statusOptions: [],
-        ticketStatus,
+        ticketStatus: [],
         searchForm: {
           code: '',
           orderStatus: 0,
@@ -193,6 +194,10 @@
     created() {
       this.getRuleNameList();
       this.getData();
+      // 过滤待接收和执行中
+      this.ticketStatus = ticketStatus.filter((item) => {
+        return [0, 2].includes(item.id);
+      });
     },
     methods: {
       // 转派
@@ -248,6 +253,7 @@
           this.tableData = res.list;
           this.total = res.total;
         });
+        this.$emit('recount');
       },
       search() {
         this.pages.page = 1;

+ 16 - 5
src/views/bpm/tickets/index.vue

@@ -31,26 +31,29 @@
   import patrolInspection from './patrolInspection';
   import maintenance from './maintenance';
   import delivery from './delivery';
+  import repair from './repair';
   export default {
     components: {
       patrolInspection,
       maintenance,
-      delivery
+      delivery,
+      repair
     },
     data() {
       return {
         activeComp: 'patrolInspection',
         tabOptions: [
-          { key: 'patrolInspection', name: '巡点检工单' },
-          { key: 'maintenance', name: '保养工单' }
-          // { key: 'delivery', name: '量具送检工单' }
+          { key: 'patrolInspection', name: '点巡检工单' },
+          { key: 'maintenance', name: '保养工单' },
+          // { key: 'delivery', name: '量具送检工单' },
+          { key: 'repair', name: '维修工单' }
           // { key: 'repair', name: '计划性维修工单' },
           // { key: 'malfunction', name: '盘点工单' }
         ]
       };
     },
     mounted() {
-      this.setCount();
+      // this.setCount();
       switch (this.$route.query.title) {
         case '巡点检工单':
           this.activeComp = 'patrolInspection';
@@ -61,6 +64,9 @@
         case '量具送检工单':
           this.activeComp = 'delivery';
           break;
+        case '维修工单':
+          this.activeComp = 'repair';
+          break;
         default:
           break;
       }
@@ -69,11 +75,16 @@
       setCount() {
         statistics().then((data) => {
           this.tabOptions = this.tabOptions.map((item) => {
+            console.log(item);
             switch (item.key) {
               case 'maintenance':
                 return { ...item, count: data.maintenanceNum };
               case 'patrolInspection':
                 return { ...item, count: data.patrolInspection };
+              case 'delivery':
+                return { ...item, count: data.quantityNum };
+              case 'repair':
+                return { ...item, count: data.repairsNum };
             }
           });
         });

+ 4 - 3
src/views/bpm/tickets/maintenance/index.vue

@@ -194,9 +194,10 @@
     created() {
       this.getRuleNameList();
       this.getData();
-      let filtersTicketStatus = deepClone(ticketStatus);
-      filtersTicketStatus.pop();
-      this.ticketStatus = filtersTicketStatus;
+      // 过滤待接收和执行中
+      this.ticketStatus = ticketStatus.filter((item) => {
+        return [0, 2].includes(item.id);
+      });
     },
     methods: {
       // 转派

+ 5 - 4
src/views/bpm/tickets/patrolInspection/index.vue

@@ -91,7 +91,7 @@
         </el-table-column>
         <el-table-column prop="code" label="工单编号" />
         <el-table-column prop="planCode" label="计划单号" />
-        <el-table-column prop="planName" label="点检名称" />
+        <el-table-column prop="planName" label="点检名称" />
         <!-- <el-table-column prop="createTime" label="设备分类" /> -->
         <el-table-column prop="ruleName" label="规则名称" />
         <el-table-column prop="createUserName" label="创建人" />
@@ -194,9 +194,10 @@
     created() {
       this.getRuleNameList();
       this.getData();
-      let filtersTicketStatus = deepClone(ticketStatus);
-      filtersTicketStatus.pop();
-      this.ticketStatus = filtersTicketStatus;
+      // 过滤待接收和执行中
+      this.ticketStatus = ticketStatus.filter((item) => {
+        return [0, 2].includes(item.id);
+      });
     },
     methods: {
       // 转派

+ 757 - 0
src/views/bpm/tickets/repair/detail.vue

@@ -0,0 +1,757 @@
+<template>
+  <div class="page" v-loading="pageLoading">
+    <el-form label-width="130px">
+      <div class="content-detail" v-show="num == 1">
+        <div class="basic-details">
+          <HeaderTitle title="基本信息" size="16px">
+            <el-button
+              type="primary"
+              @click="
+                $router.push({
+                  path: '/tickets',
+                  query: { title: '维修工单' }
+                })
+              "
+              >返回</el-button
+            >
+          </HeaderTitle>
+          <el-row>
+            <el-col :span="12">
+              <el-col :span="12">
+                <el-form-item label="计划单号">
+                  <span> {{ infoData.planCode }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="来源计划配置单号">
+                  <span> {{ infoData.planConfigCode }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="名称">
+                  <span> {{ infoData.planName }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="部门">
+                  <span>
+                    {{ infoData.executeGroupName }}
+                  </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="人员">
+                  <span>
+                    {{ infoData.executeUserName }}
+                  </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="计划完成时长">
+                  <span v-if="infoData.duration >= 0"
+                    >{{ infoData.duration }}分钟</span
+                  >
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="周期">
+                  <span v-if="infoData.ruleInfo">
+                    {{ infoData.ruleInfo.cycleValue
+                    }}{{
+                      getDictValue('巡点检周期', infoData.ruleInfo.cycleType)
+                    }}
+                  </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="设备分类">
+                  <span> {{ infoData.categoryLevelName }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="规则名称">
+                  <span>
+                    {{ infoData.ruleName }}
+                  </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="创建部门">
+                  <span> {{ infoData.createGroupName }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="创建人">
+                  <span> {{ infoData.createUserName }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <el-form-item label="创建时间">
+                  <span> {{ infoData.createTime }} </span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24">
+                <el-form-item label="备注">
+                  <span> {{ infoData.remark }} </span>
+                </el-form-item>
+              </el-col>
+            </el-col>
+            <el-col :span="12">
+              <img :src="data.imageUrl" alt="" />
+            </el-col>
+          </el-row>
+        </div>
+
+        <!-- 巡点检、执行信息 -->
+        <!-- <div class="execute_info">
+          <div class="execute_info_title">
+            <span>执行信息</span>
+            <span
+              >执行人:{{ data.executeUserName }}
+              <i style="margin: 0 18px"></i> 执行时间:{{
+                data.acceptTime
+              }}</span
+            >
+          </div>
+          <HeaderTitle title="执行信息" size="16px"></HeaderTitle>
+          <el-row class="execute_row">
+            <el-col :span="8" class="column">
+              <span class="label">确认结果:</span>
+              <span class="value">{{
+                infoData.status ? infoData.status.descp : ''
+              }}</span>
+            </el-col>
+            <el-col :span="8" class="column">
+              <span class="label">实际开始时间:</span>
+              <span class="value">{{ infoData.acceptTime }}</span>
+            </el-col>
+            <el-col :span="8" class="column">
+              <span class="label">实际结束时间:</span>
+              <span class="value">{{ infoData.finishTime }}</span>
+            </el-col>
+            <el-col :span="24" class="column">
+              <span class="label">超期原因:</span>
+              <span class="value">{{ infoData.timeoutCause }}</span>
+            </el-col>
+          </el-row>
+        </div> -->
+
+        <!-- 巡点检、保养设备 -->
+        <div class="maintain_equipment_info">
+          <HeaderTitle title="设备" size="16px"></HeaderTitle>
+          <div class="maintain_equipment_info_content">
+            <div
+              class="equipment_item"
+              v-for="item in infoData.deviceList"
+              :key="item.id"
+            >
+              <div class="equipment_info" v-if="item.substance">
+                <div class="item_info">
+                  <span class="item_label">设备编码</span>
+                  <span class="item_value">{{ item.substance.code }}</span>
+                </div>
+                <div class="item_info">
+                  <span class="item_label">设备名称</span>
+                  <span class="item_value">{{ item.substance.name }}</span>
+                </div>
+                <div class="item_info">
+                  <span class="item_label">设备型号</span>
+                  <span class="item_value">{{ item.substance.model }}</span>
+                </div>
+                <div class="item_info">
+                  <span class="item_label">设备位置</span>
+                  <span class="item_value">{{
+                    item.substance.positionNames
+                  }}</span>
+                </div>
+              </div>
+              <p>操作事项</p>
+              <div class="ruleMatters_box">
+                <el-table :data="item.workItems" border>
+                  <el-table-column label="序号" width="50">
+                    <template slot-scope="scope">
+                      <span>{{ scope.$index + 1 }}</span>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="事项" prop="name" width="100">
+                    <template slot-scope="scope">
+                      <div>
+                        <span>{{ scope.row.name }}</span>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="内容" prop="content" width="300">
+                    <template slot-scope="scope">
+                      <div>
+                        <span>{{ scope.row.content }}</span>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="操作指导" prop="operationGuide">
+                    <template slot-scope="scope">
+                      <div class="operationGuide_box">
+                        <div class="left_content">
+                          <template v-if="scope.row.operationGuide">
+                            <div
+                              v-for="(item, index) in scope.row.operationGuide
+                                .toolList"
+                              :key="item.id"
+                              >{{ index + 1 }}.{{ item.name }}</div
+                            >
+                          </template>
+                        </div>
+                        <div class="line"></div>
+                        <div class="right_content">
+                          <template v-if="scope.row.operationGuide">
+                            <div
+                              v-for="(item, index) in scope.row.operationGuide
+                                .procedureList"
+                              :key="item.id"
+                              >{{ index + 1 }}.{{ item.content }}</div
+                            >
+                          </template>
+                        </div>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="标准" prop="norm" width="100">
+                    <template slot-scope="scope">
+                      <div>
+                        <span>{{ scope.row.norm }}</span>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="状态" prop="status" width="100">
+                    <template slot-scope="scope">
+                      <div>
+                        <span>{{ options[scope.row.status] }}</span>
+                      </div>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="结果" prop="result" width="200">
+                  </el-table-column>
+                </el-table>
+              </div>
+            </div>
+            <!-- <div class="btnbox" v-if="$route.query.isshow">
+              <el-button class="confirm-btn" type="danger" plain @click="reject"
+                >驳回</el-button
+              >
+              <el-button class="confirm-btn" type="success" plain @click="pass"
+                >通过</el-button
+              >
+              <el-button class="cancel-btn">关闭</el-button>
+            </div> -->
+            <!-- <div class="textbox" v-if="showtext">
+              <el-input
+                type="textarea"
+                placeholder="请输入驳回原因"
+                v-model="cause"
+                maxlength="30"
+                rows="5"
+                show-word-limit
+              >
+              </el-input>
+              <div class="textbtnbox">
+                <el-button size="small" round @click="cancelreject"
+                  >取消</el-button
+                >
+                <el-button size="small" round @click="surereject"
+                  >提交</el-button
+                >
+              </div>
+            </div> -->
+          </div>
+        </div>
+
+        <!-- 巡点检、缺陷设备报修记录 -->
+        <!-- <div class="repair_notes">
+          <HeaderTitle title="缺陷设备报修记录" size="16px"></HeaderTitle>
+          <div class="repair_notes_equipment_item">
+            <el-row class="equipment_item_tilte">
+              <el-col :span="8">
+                <span class="label">设备名称:</span>
+                <span>{{ repairNotes.equiName }}</span>
+              </el-col>
+              <el-col :span="8">
+                <span class="label">规格型号:</span>
+                <span>{{ repairNotes.equiModel }}</span>
+              </el-col>
+              <el-col :span="8">
+                <span class="label">设备编码:</span>
+                <span>{{ repairNotes.equiCode }}</span>
+              </el-col>
+            </el-row>
+            <div class="main_info">
+              <div>
+                <span>报修记录编号:</span>
+                <span>{{ repairNotes.repairsCode }}</span>
+              </div>
+              <div>
+                <span>故障描述:</span>
+                <span>{{ repairNotes.repairsDescription }}</span>
+              </div>
+              <div>
+                <span>处理进度:</span>
+                <span>{{ statusObj[repairNotes.status] }}</span>
+              </div>
+            </div>
+          </div>
+        </div> -->
+      </div>
+    </el-form>
+  </div>
+</template>
+
+<script>
+  import dictMixins from '@/mixins/dictMixins';
+  import { getWordOrderDetail } from '@/api/tickets';
+  export default {
+    mixins: [dictMixins],
+    data() {
+      return {
+        options: {
+          0: '正常',
+          '-1': '缺陷'
+        },
+        num: 1,
+        infoData: {},
+        dialogVisible: false,
+        data: {},
+        repairNotes: {},
+        pageLoading: false,
+        typeValue: null,
+        contract_type: [],
+        status: [
+          {
+            value: true,
+            label: '失效'
+          },
+          {
+            value: false,
+            label: '生效'
+          }
+        ],
+        ruleItem: [],
+        cause: '',
+        showtext: false,
+        from: null
+      };
+    },
+    created() {
+      this.requestDict('巡点检周期');
+      this.getInfo();
+    },
+    methods: {
+      // getStatus: useDictLabel(patrolMatterStatus),
+      delete() {},
+      // 点击切换事件
+      tab(index) {
+        this.num = index;
+      },
+      goBack() {
+        window.sessionStorage.setItem('patrolTabType', 'work');
+        if (this.form) {
+          this.$router.push({
+            path: '/workspace/workOrder',
+            query: { activeName: 'polling' }
+          });
+        } else {
+          this.$router.go(-1);
+        }
+      },
+      // 表格数据
+      getInfo() {
+        this.pageLoading = true;
+        getWordOrderDetail(this.$route.query.id)
+          .then((data) => {
+            this.infoData = data;
+            // if (res.success) {
+            //   this.data = res.data;
+            //   this.data.planEquiList = this.data.planEquiList.filter(
+            //     (item) => item.itemList && item.itemList.length > 0
+            //   );
+            //   // 获取 缺陷设备报修记录
+            //   const repairId = res.data.planEquiList[0].repairId;
+            //   if (repairId) {
+            //     this.getRepairNotes(repairId);
+            //   }
+            // }
+            this.pageLoading = false;
+          })
+          .catch(() => {
+            this.pageLoading = false;
+          });
+      },
+      // 获取 缺陷设备报修记录
+      async getRepairNotes(repairId) {
+        const res = await repair.getInfo(repairId);
+        if (res?.success) {
+          console.log('缺陷设备报修记录:', res.data);
+          this.repairNotes = res.data;
+        }
+      },
+      //通过按钮事件
+      pass() {
+        let params = {
+          planId: this.$route.query.id,
+          checked: 2,
+          myHandleId: this.$route.query.dbid,
+          cause: this.cause,
+          type: 2, //1维修;2保养,巡点检
+          handleType: 0 //办理类型(0 审批 1 验收)
+        };
+        sendAudit(params).then((res) => {
+          if (res.success) {
+            this.$message.success('审批通过!');
+            this.$router.back();
+          }
+        });
+      },
+      //驳回按钮事件
+      reject() {
+        this.showtext = true;
+      },
+      cancelreject() {
+        this.showtext = false;
+        this.cause = '';
+      },
+      surereject() {
+        if (!this.cause) {
+          this.$message.info('请填写驳回原因!');
+        } else {
+          let params = {
+            id: this.$route.query.id,
+            checked: 0,
+            myHandleId: this.$route.query.dbid,
+            cause: this.cause,
+            type: 2, //1维修;2保养,巡点检
+            handleType: 0 //办理类型(0 审批 1 验收)
+          };
+          sendAudit(params).then((res) => {
+            if (res.success) {
+              this.$message.error('审批驳回!');
+              this.$router.back();
+            }
+          });
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  // @import '@/assets/css/oaa.scss';
+  .page {
+    padding: 10px;
+  }
+  .page-title {
+    background: #fff;
+    font-size: 18px;
+    padding: 6px 20px;
+    font-weight: 500;
+    .page-title-div {
+      margin: 5px 0;
+      height: 30px;
+      line-height: 30px;
+      border-bottom: 1px solid #eaeefb;
+      .title-div-no {
+        margin-left: 10px;
+        font-weight: 400;
+        color: #909090;
+        font-size: 14px;
+      }
+    }
+  }
+  .page-data {
+    padding-top: 10px;
+  }
+  .content-detail {
+    background: #fff;
+    padding: 20px;
+  }
+  .flows {
+    .flow-left {
+      width: 156px;
+      height: 70px;
+      border: 1px dashed #ccc;
+      padding: 10px;
+    }
+    .row {
+      margin-top: 13px;
+    }
+  }
+  .basic-details-title {
+    margin-bottom: 12px;
+    margin-top: 20px;
+    border-bottom: 1px solid #1890ff;
+    padding-bottom: 8px;
+    display: flex;
+    justify-content: space-between;
+  }
+  .basic-details-title .border-span {
+    height: 18px;
+    font-size: 16px;
+    border-left: 4px solid #1890ff;
+    padding-left: 8px;
+
+    font-weight: 500;
+  }
+  .heade-right {
+    // float: right;
+    .heade-right-content {
+      margin-right: 12px;
+      font-size: 14px;
+      display: inline-block;
+      .content-key {
+        color: #3e3e3e;
+        margin-right: 12px;
+        font-weight: 500;
+      }
+      .content-value {
+        color: #000;
+      }
+    }
+  }
+  .list-title {
+    font-size: 14px;
+    color: #3e3e3e;
+    margin: 10px 0px;
+  }
+  .goods {
+    background: #a30014;
+    border: 1px solid #a30014;
+  }
+  .details-title {
+    display: inline-block;
+    color: #6e6e6e;
+    font-size: 14px;
+    font-weight: bold;
+    margin-right: 13px;
+    width: 70px;
+    text-align: right;
+  }
+  .details-con {
+    color: #3e3e3e;
+    font-size: 14px;
+  }
+  .detailed-tab {
+    margin-left: 10px;
+    margin-top: 10px;
+  }
+  ::v-deep .el-form-item--medium .el-form-item__label {
+    color: #6e6e6e;
+    font-size: 14px;
+    font-weight: bold;
+  }
+  .warehouse {
+    display: block;
+    border-bottom: 1px solid #eaeefb;
+    padding: 10px 0;
+  }
+  .box-card {
+    .store-box {
+      width: 80%;
+      .store-box-span {
+        display: inline-block;
+        font-size: 14px;
+        height: 50px;
+        width: 50px;
+        text-align: center;
+        line-height: 50px;
+        color: #fff;
+        margin: 2px;
+      }
+    }
+  }
+  .vacant {
+    background: #3196fb;
+  }
+  .inUse {
+    background: #157a2c;
+  }
+  .invalid {
+    background: #cccccc;
+  }
+  .full {
+    background: #cc3300;
+  }
+
+  .maintain_equipment_info {
+    .maintain_equipment_info_title {
+      border-bottom: 1px solid #1890ff;
+      padding-bottom: 3px;
+      margin-bottom: 20px;
+      > span {
+        display: inline-block;
+        line-height: 16px;
+        border-left: 6px solid #1890ff;
+        padding-left: 6px;
+      }
+    }
+    .maintain_equipment_info_content {
+      padding: 0 30px;
+      .equipment_item {
+        border: 1px solid #ccc;
+        font-size: 14px;
+        padding: 15px;
+        margin-bottom: 30px;
+        .equipment_info {
+          display: flex;
+          flex-wrap: wrap;
+          border: 1px solid #ddd;
+          .item_info {
+            width: 33.33%;
+            height: 24px;
+            line-height: 24px;
+            display: flex;
+            .item_label {
+              width: 90px;
+              text-align: center;
+              background-color: #f2f2f2;
+              font-weight: 700;
+            }
+            .item_value {
+              border-bottom: 1px solid #f2f2f2;
+              flex: 1;
+              padding-left: 5px;
+            }
+            &:last-child {
+              width: 100%;
+              .item_value {
+                border: 0;
+              }
+            }
+          }
+        }
+        > p {
+          margin-top: 20px;
+          color: #797979;
+        }
+        .matter_info {
+          ::v-deep .el-table {
+            th.el-table__cell {
+              background-color: #f2f2f2;
+              padding: 0;
+            }
+            td.el-table__cell {
+              padding: 0;
+            }
+          }
+        }
+        .ruleMatters_box {
+          flex: 3;
+          height: 100%;
+          display: flex;
+          flex-direction: column;
+          .divider {
+            flex: 0 0 50px;
+            .title {
+              height: 35px;
+            }
+          }
+          .el-table {
+            overflow: auto;
+            .operationGuide_box {
+              width: 100%;
+              display: flex;
+              position: relative;
+              .left_content {
+                flex: 0 0 300px;
+                padding: 10px;
+                margin-right: 10px;
+                overflow-y: auto;
+              }
+              .line {
+                position: absolute;
+                top: -10px;
+                left: 300px;
+                bottom: -10px;
+                height: 110%;
+                width: 1px;
+                background-color: #ededed;
+              }
+              .right_content {
+                flex: 1;
+                padding: 10px;
+                overflow-y: auto;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+  .execute_info {
+    margin: 30px 0;
+    .execute_info_title {
+      border-bottom: 1px solid #1890ff;
+      padding-bottom: 3px;
+      margin-bottom: 20px;
+      display: flex;
+      justify-content: space-between;
+      > span:first-child {
+        line-height: 16px;
+        border-left: 6px solid #1890ff;
+        padding-left: 6px;
+      }
+    }
+    .execute_row {
+      padding: 0 30px;
+      .column {
+        display: flex;
+        font-size: 14px;
+        margin-bottom: 20px;
+        .label {
+          // width: 110px;
+          text-align: center;
+          font-weight: 700;
+        }
+      }
+    }
+  }
+  .repair_notes {
+    .repair_notes_title {
+      border-bottom: 1px solid #1890ff;
+      padding-bottom: 3px;
+      margin-bottom: 20px;
+      > span {
+        display: inline-block;
+        line-height: 16px;
+        border-left: 6px solid #1890ff;
+        padding-left: 6px;
+      }
+    }
+    .repair_notes_equipment_item {
+      padding: 0 20px;
+      .equipment_item_tilte {
+        background-color: #f7f7f7;
+        height: 36px;
+        line-height: 36px;
+        .label {
+          font-weight: 700;
+        }
+      }
+      .main_info {
+        font-size: 14px;
+        margin-top: 15px;
+        > div {
+          margin-bottom: 10px;
+        }
+      }
+    }
+  }
+  .btnbox {
+    display: flex;
+    justify-content: center;
+  }
+  ::v-deep .el-button {
+    padding: 10px 20px;
+    margin-right: 10px;
+  }
+  .textbtnbox {
+    margin-top: 10px;
+    display: flex;
+    justify-content: center;
+  }
+</style>

+ 383 - 0
src/views/bpm/tickets/repair/index.vue

@@ -0,0 +1,383 @@
+<!-- 巡点检工单 -->
+<template>
+  <div class="patrolInspection">
+    <div class="search">
+      <el-form label-width="120px">
+        <el-row>
+          <el-col :md="4" :sm="8" :xs="8">
+            <el-form-item label="工单编号">
+              <el-input
+                v-model="searchForm.code"
+                placeholder="请输入"
+                size="small"
+              ></el-input> </el-form-item
+          ></el-col>
+          <el-col :md="4" :sm="8" :xs="8">
+            <el-form-item label="规则名称">
+              <el-select
+                v-model="searchForm.ruleId"
+                size="small"
+                clearable
+                style="width: 100%"
+                filterable
+              >
+                <el-option
+                  v-for="item in ruleNameList"
+                  :key="item.id"
+                  :value="item.id"
+                  :label="item.name"
+                ></el-option> </el-select></el-form-item
+          ></el-col>
+          <el-col :md="4" :sm="8" :xs="8">
+            <el-form-item label="状态">
+              <el-select
+                filterable
+                v-model="searchForm.orderStatus"
+                size="small"
+              >
+                <el-option
+                  v-for="item in ticketStatus"
+                  :key="item.id"
+                  :value="item.id"
+                  :label="item.label"
+                ></el-option>
+              </el-select> </el-form-item
+          ></el-col>
+          <el-col :md="8" :sm="8" :xs="8">
+            <el-form-item label="开始结束时间">
+              <el-date-picker
+                class="form-input"
+                size="small"
+                v-model="searchForm.date"
+                type="daterange"
+                range-separator="至"
+                start-placeholder="开始日期"
+                end-placeholder="结束日期"
+                value-format="yyyy-MM-dd HH:mm:ss"
+                :default-time="['00:00:00', '23:59:59']"
+              >
+              </el-date-picker> </el-form-item
+          ></el-col>
+          <el-col :md="4" :sm="16" :xs="16" style="text-align: right">
+            <el-button icon="el-icon-refresh-left" size="small" @click="rest"
+              >重置</el-button
+            >
+            <el-button
+              type="primary"
+              icon="el-icon-search"
+              size="small"
+              @click="search"
+              >搜索</el-button
+            ></el-col
+          >
+        </el-row>
+      </el-form>
+    </div>
+    <div class="table">
+      <el-table
+        :data="tableData"
+        border
+        height="99%"
+        tooltip-effect="dark"
+        :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
+      >
+        <el-table-column
+          width="80px"
+          label="序号"
+          type="index"
+          :index="indexMethod"
+        >
+        </el-table-column>
+        <el-table-column prop="code" label="工单编号" />
+        <el-table-column prop="planCode" label="计划单号" />
+        <el-table-column prop="planName" label="维修名称" />
+        <!-- <el-table-column prop="createTime" label="设备分类" /> -->
+        <el-table-column prop="ruleName" label="规则名称" />
+        <el-table-column prop="equiCode" label="设备编号" />
+        <el-table-column prop="equiName" label="设备名称" />
+        <el-table-column prop="executeUserName" label="执行人" />
+        <el-table-column prop="acceptTime" label="开始时间" />
+        <el-table-column prop="finishTime" label="结束时间" />
+        <el-table-column prop="planFinishTime" label="计划完成时间" />
+        <el-table-column prop="orderStatus" label="执行结果">
+          <template slot-scope="{ row }">
+            {{ { 0: '缺陷', 1: '正常' }[row.isAbnormal] }}
+          </template>
+        </el-table-column>
+        <el-table-column prop="orderStatus" label="状态">
+          <template slot-scope="{ row }">
+            {{
+              ticketStatus.filter((item) => item.id == row.orderStatus)[0].label
+            }}
+          </template>
+        </el-table-column>
+        <el-table-column prop="practicalTime" label="实际工时">
+          <template slot-scope="{ row }">
+            {{ time_interval(row.acceptTime, row.finishTime) }}
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" width="200">
+          <template slot-scope="{ row }">
+            <el-link
+              v-if="row.orderStatus == 3 && row.createUserId == userId"
+              type="primary"
+              :underline="false"
+              icon="el-icon-edit"
+              @click="goDetail(row)"
+            >
+              验收
+            </el-link>
+            <el-link
+              v-if="
+                row.orderStatus !== 3 &&
+                row.orderStatus !== 4 &&
+                userId === row.executeUserId
+              "
+              type="primary"
+              :underline="false"
+              icon="el-icon-edit"
+              @click="toSigningUpWork(row)"
+            >
+              报工
+            </el-link>
+            <el-link
+              v-if="
+                row.orderStatus !== 3 &&
+                row.orderStatus !== 4 &&
+                userId === row.executeUserId
+              "
+              type="primary"
+              :underline="false"
+              icon="el-icon-edit"
+              @click="toRedeploy(row)"
+            >
+              转派
+            </el-link>
+            <el-link
+              type="primary"
+              :underline="false"
+              icon="el-icon-edit"
+              @click="openDetail(row)"
+            >
+              详情
+            </el-link>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <div class="table-footer">
+      <el-pagination
+        background
+        layout="total, sizes, prev, pager, next, jumper"
+        :total="total"
+        :page-sizes="[15, 30, 50, 100, 500]"
+        :page-size.sync="pages.size"
+        :current-page.sync="pages.page"
+        @current-change="handleCurrentChange"
+        @size-change="handleSizeChange"
+      >
+      </el-pagination>
+    </div>
+    <!-- 验收 -->
+    <RepairDetailsDialog ref="detailsDialogRef" @refesh="getData" />
+    <!-- 转派弹窗 -->
+    <redeployOther ref="redeployOtherRef" @refresh="getData" />
+    <!-- 报工弹框 -->
+    <signingUpWork ref="signingUpWorkRef" @refresh="getData" />
+  </div>
+</template>
+
+<script>
+  import redeployOther from '../components/redeployOther.vue';
+  import signingUpWork from '../components/signingUpWork.vue';
+  import { ticketStatus } from '@/utils/dict/tickets';
+  import RepairDetailsDialog from '../components/RepairDetailsDialog.vue';
+  import { getWorkOrderList, getRule } from '@/api/tickets';
+  import pagenation from '@/components/Pagination';
+  export default {
+    components: {
+      pagenation,
+      redeployOther,
+      signingUpWork,
+      RepairDetailsDialog
+    },
+    data() {
+      return {
+        ruleNameList: [],
+        tableData: [],
+        statusOptions: [],
+        userId: '',
+        ticketStatus: [],
+        searchForm: {
+          code: '',
+          orderStatus: 0,
+          ruleId: '',
+          date: '',
+          startTime: '',
+          endTime: '',
+          type: 3
+        },
+        pages: {
+          page: 1,
+          size: 15
+        },
+        total: 0
+      };
+    },
+    created() {
+      this.userId = localStorage.getItem('userId');
+      this.getRuleNameList();
+      this.getData();
+      // 过滤待接收和执行中
+      this.ticketStatus = ticketStatus.filter((item) => {
+        return [0, 2, 3].includes(item.id);
+      });
+      console.log('-----this.ticketStatus');
+      console.log(this.ticketStatus);
+    },
+    methods: {
+      // 验收
+      goDetail(row) {
+        row.title = '工单详情';
+        row.tabLabel = '工单信息';
+        this.$refs.detailsDialogRef.init(row);
+      },
+      // 转派
+      toRedeploy(row) {
+        this.$refs.redeployOtherRef.open(row);
+      },
+      // 报工
+      toSigningUpWork(row) {
+        this.$refs.signingUpWorkRef.open(row);
+      },
+      reload(where) {
+        this.$refs.table.reload({ page: 1, ...where });
+      },
+      openDetail(row) {
+        row.title = '工单详情';
+        row.tabLabel = '工单信息';
+        this.$refs.detailsDialogRef.init(row, true);
+      },
+      // 获取规则名列表(设备维修)
+      async getRuleNameList() {
+        const res = await getRule({
+          status: 1,
+          type: 3,
+          pageNum: 1,
+          size: -1
+        });
+        if (res.list) {
+          this.ruleNameList = res.list || [];
+        }
+      },
+      // 实现分页序号连贯
+      indexMethod(index) {
+        index = index + 1 + (this.pages.page - 1) * this.pages.size;
+        return index;
+      },
+      getData() {
+        let par = {
+          ...this.pages,
+          ...this.searchForm,
+          executeUserId: this.userId,
+          statusType: 1
+        };
+        if (this.searchForm.date) {
+          par.startTime = this.searchForm.date[0];
+          par.endTime = this.searchForm.date[1];
+        }
+        delete par.date;
+        getWorkOrderList(par).then((res) => {
+          this.tableData = res.list;
+          this.total = res.total;
+        });
+        this.$emit('recount');
+      },
+      search() {
+        this.pages.page = 1;
+        this.getData();
+      },
+      rest() {
+        this.searchForm = {
+          code: '',
+          orderStatus: 0,
+          ruleId: '',
+          date: '',
+          startTime: '',
+          endTime: '',
+          type: 3
+        };
+        this.pages.page = 1;
+        this.getData();
+      },
+      handleCurrentChange() {
+        this.getData();
+      },
+      handleSizeChange() {
+        this.pages.page = 1;
+        this.getData();
+      },
+      // 计算实际工时
+      time_interval(dt1, dt2) {
+        if (!dt1 || !dt2) {
+          return '';
+        }
+        if (typeof dt1 == 'string') {
+          dt1 = new Date(dt1.replace(/-/, '/'));
+          dt2 = new Date(dt2.replace(/-/, '/'));
+        }
+        var res = dt2 - dt1;
+        if (isNaN(res)) throw Error('invalid dates arguments');
+        let re = res / (1000 * 60 * 60);
+
+        var h = parseInt(re);
+        var m = parseInt((re - h) * 60);
+        let result = '';
+        if (h) {
+          result += `${h} 小时`;
+        }
+        if (m) {
+          result += `${m} 分钟`;
+        }
+        return result;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  // 步骤条边线显示
+  ::v-deep .el-step__head.is-process .el-step__icon.is-text {
+    border: none !important;
+    background: none !important;
+  }
+  ::v-deep .el-step:last-of-type .el-step__line {
+    display: block !important;
+    width: 3px !important;
+  }
+  ::v-deep .el-steps:last-child .el-step__line {
+    display: none !important;
+  }
+  .patrolInspection {
+    height: 100%;
+    width: 100%;
+    display: flex;
+    flex-direction: column;
+    .search {
+      flex: 0 0 50px;
+    }
+    .table {
+      flex: 1;
+      .el-table {
+        width: 100%;
+        display: flex;
+        flex-direction: column;
+      }
+    }
+    .table-footer {
+      flex: 0 0 30px;
+      display: flex;
+      justify-content: flex-end;
+    }
+  }
+</style>