LAPTOP-16IUEB3P\Lenovo 3 жил өмнө
parent
commit
ebecba0f06

+ 31 - 2
src/api/maintenance/repair_report.js

@@ -44,9 +44,38 @@ export async function removeRequest(id) {
 
 // 委外 
 export async function addOutsource (data) {
-  const res = await request.post('/outsourc-work-order/addOrEdit', data);
+  const res = await request.post('/eam/outsourceworkorder/addOrEdit', data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 委外工单列表
+export async function outsourceList (data) {
+  const res = await request.post('/eam/outsourceworkorder/getList', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 获取委外工单详情
+export async function getOutsourceInfo(id) {
+  const res = await request.get(`/eam/outsourceworkorder/info/${id}` );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 委外工单驳回或验收 
+export async function checkOrBack (data) {
+  const res = await request.post('/eam/outsourceworkorder/checkOrBack', data);
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+}
+
+ 

+ 17 - 0
src/styles/transition/common.scss

@@ -57,3 +57,20 @@
   border-top: 4px solid #157a2c;
   color: #157a2c;
 }
+
+
+// 步骤条边线显示
+.el-step__head.is-process .el-step__icon.is-text{
+	border: none!important;
+	background: none!important;
+}
+// .el-step.is-vertical .el-step__line{
+// 	left: 10px;
+// }
+.repair_infoLogs .el-step:last-of-type .el-step__line{
+  display: block!important;
+  width: 3px!important;
+}
+.repair_infoLogs .el-steps:last-child .el-step__line{
+   display: none!important;
+}

+ 39 - 93
src/views/maintenance/repair/components/RepairDetailsDialog.vue

@@ -29,19 +29,19 @@
         <el-row class="repair_row">
           <el-col :span="12" class="repair_column">
             <span>设备编码:</span>
-            <span>{{ equipmentInfo ? equipmentInfo.assetCode : '' }}</span>
+            <span>{{ equipmentInfo ? equipmentInfo.code : '' }}</span>
           </el-col>
           <el-col :span="12" class="repair_column">
             <span>权属部门:</span>
             <span>{{
-              equipmentInfo ? equipmentInfo.ownershipDeptName : ''
+              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.assetName : '' }}</span>
+            <span>{{ equipmentInfo ? equipmentInfo.name : '' }}</span>
           </el-col>
           <el-col :span="12" class="repair_column">
             <span>权属人:</span>
@@ -53,9 +53,8 @@
         <el-row class="repair_row">
           <el-col :span="12" class="repair_column">
             <span>设备分类:</span>
-            <span>{{
-              equipmentInfo.assetType
-                ? assetTypeList[equipmentInfo.assetType - 1]
+            <span>{{  equipmentInfo.category
+                ? equipmentInfo.category.categoryLevelPath
                 : ''
             }}</span>
           </el-col>
@@ -69,25 +68,19 @@
         <el-row class="repair_row">
           <el-col :span="12" class="repair_column">
             <span>固定资产编码:</span>
-            <span>{{ equipmentInfo ? equipmentInfo.fixAssetCode : '' }}</span>
+            <span>{{ equipmentInfo ? equipmentInfo.fixCode : '' }}</span>
           </el-col>
           <el-col :span="12" class="repair_column">
             <span>设备位置:</span>
-            <span
-              >{{ equipmentInfo ? equipmentInfo.factoryName : '' }}—{{
-                equipmentInfo ? equipmentInfo.workshopName : ''
-              }}—{{ equipmentInfo ? equipmentInfo.lineName : '' }}</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.information
-                ? equipmentInfo.information.specification
-                : ''
-            }}</span>
+            <span>
+			  {{equipmentInfo.category&&equipmentInfo.category.specification}}|{{equipmentInfo.category&&equipmentInfo.category.modelType}}
+			</span>
           </el-col>
         </el-row>
       </el-tab-pane>
@@ -227,19 +220,19 @@
         <el-row class="repair_row">
           <el-col :span="12" class="repair_column">
             <span>设备编码:</span>
-            <span>{{ equipmentInfo ? equipmentInfo.assetCode : '' }}</span>
+            <span>{{ equipmentInfo ? equipmentInfo.code : '' }}</span>
           </el-col>
           <el-col :span="12" class="repair_column">
             <span>权属部门:</span>
             <span>{{
-              equipmentInfo ? equipmentInfo.ownershipDeptName : ''
+              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.assetName : '' }}</span>
+            <span>{{ equipmentInfo ? equipmentInfo.name : '' }}</span>
           </el-col>
           <el-col :span="12" class="repair_column">
             <span>权属人:</span>
@@ -251,9 +244,8 @@
         <el-row class="repair_row">
           <el-col :span="12" class="repair_column">
             <span>设备分类:</span>
-            <span>{{
-              equipmentInfo.assetType
-                ? assetTypeList[equipmentInfo.assetType - 1]
+            <span>{{  equipmentInfo.category
+                ? equipmentInfo.category.categoryLevelPath
                 : ''
             }}</span>
           </el-col>
@@ -267,25 +259,19 @@
         <el-row class="repair_row">
           <el-col :span="12" class="repair_column">
             <span>固定资产编码:</span>
-            <span>{{ equipmentInfo ? equipmentInfo.fixAssetCode : '' }}</span>
+            <span>{{ equipmentInfo ? equipmentInfo.fixCode : '' }}</span>
           </el-col>
           <el-col :span="12" class="repair_column">
             <span>设备位置:</span>
-            <span
-              >{{ equipmentInfo ? equipmentInfo.factoryName : '' }}—{{
-                equipmentInfo ? equipmentInfo.workshopName : ''
-              }}—{{ equipmentInfo ? equipmentInfo.lineName : '' }}</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.information
-                ? equipmentInfo.information.specification
-                : ''
-            }}</span>
+            <span>
+              {{equipmentInfo.category&&equipmentInfo.category.specification}}|{{equipmentInfo.category&&equipmentInfo.category.modelType}}
+            </span>
           </el-col>
         </el-row>
       </el-tab-pane>
@@ -341,38 +327,7 @@ import dictMixins from '@/mixins/dictMixins';
 export default {
   mixins: [dictMixins],
   props: {
-    // dialogTitle: {
-    //   type: String,
-    //   default: '报修记录详情'
-    // },
-    // planInfo: {
-    //   type: Object,
-    //   default: () => {
-    //     return {}
-    //   }
-    // },
-    // workOrderInfo: {
-    //   type: Object,
-    //   default: () => {
-    //     return {}
-    //   }
-    // },
-    // infoData: {
-    //   type: Object,
-    //   default: () => {
-    //     return {}
-    //   }
-    // },
-    // repairInfoLogs: {
-    //   type: Array,
-    //   default: () => {
-    //     return []
-    //   }
-    // },
-    // tabLabel: {
-    //   type: String,
-    //   default: ''
-    // }
+
   },
   components: { RepairNotesTab, WorkOrderTab },
   data () {
@@ -389,16 +344,6 @@ export default {
       row: {},
       cause: '',
       showtext: false,
-      assetTypeList: [
-        '生产设备',
-        '舟皿',
-        '物料',
-        '产品',
-        '周转车',
-        '模具',
-        '备品备件',
-        '耗材'
-      ]
     }
   },
   created () {
@@ -427,7 +372,7 @@ export default {
         const res = await getRepairById(row.id)
 		console.log('报修记录详情',res)
         this.infoData = res ? res : {}
-        // this.repairInfoLogs = res.data.repairInfoLogs.reverse()
+        this.repairInfoLogs = res.repairLogVOList.reverse()
         // 处理图片
         // if (this.infoData && this.infoData.repairsImg) {
         //   const repairsImg = this.infoData.repairsImg
@@ -446,23 +391,23 @@ export default {
         // }
       } else if (row.title === '消息信息详情') {
         this.getSbinfo(this.row.deviceId)
-        const res = await repair.getInfo(row.workOrderId)
-        this.infoData = res.data ? res.data : {}
-        this.repairInfoLogs = res.data.repairInfoLogs.reverse()
+        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
-          })
-        }
+        // 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 {
         this.getSbinfo(this.row.deviceId )
         const res = await maintenancePlan.getWorkOrderDetail(row.workOrderCode)
@@ -494,6 +439,7 @@ export default {
       getAssetInfo(params).then(res => {
         if (res) {
           this.equipmentInfo = res
+		  this.$set(this.equipmentInfo,'position',res.positionList[0].pathName?res.positionList[0].pathName:'')
         }
       })
     },

+ 93 - 96
src/views/maintenance/repair/components/RepairNotesTab.vue

@@ -1,7 +1,7 @@
 <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.code=='ACCEPTANCE_CHEK'">
+      <el-step v-if="item.type=='ACCEPTANCE_CHEK'">
         <span
           slot="icon"
           :class="
@@ -11,24 +11,18 @@
           "
         ></span>
         <div slot="title" class="step_title">
-          <span>{{item.type.desc}}</span>
+          <span>验收</span>
           <span>{{ item.createTime }}</span>
         </div>
         <div slot="description" class="step_description">
-          <span>验收人:{{  JSON.parse(item.content).userName }}</span>
+          <span>验收人:{{ item.content.userName }}</span>
           <span
-            >验收结果:{{
-               JSON.parse(item.content).acceptanceResult ? '通过' : '驳回'
-            }}</span
-          >
-          <span
-            >验收说明:{{
-               JSON.parse(item.content).acceptanceInstructions
-            }}</span
+            >验收结果:{{ item.content.acceptanceResult ? '通过' : '驳回'}}</span
           >
+          <span>验收说明:{{item.content.acceptanceInstructions }}</span >
         </div>
       </el-step>
-      <el-step v-if="item.type.code=='WORK_REPORT'">
+      <el-step v-if="item.type=='WORK_REPORT'">
         <span
           slot="icon"
           :class="
@@ -38,19 +32,18 @@
           "
         ></span>
         <div slot="title" class="step_title">
-          <span>{{item.type.desc}}</span>
-          <span>{{  JSON.parse(item.content).createTime }}</span>
+          <span>报工</span>
+          <span>{{item.content.createTime}}</span>
         </div>
         <div slot="description" class="work_report_desc">
           <div>
-            处理说明:{{  JSON.parse(item.content).repairReportExplain }}
+            处理说明:{{  item.content.repairReportExplain }}
           </div>
           <div class="work_report_imgs" style="width: 50px; height: 50px">
             <img
-              v-for="(item, index) in  JSON.parse(item.content)
-                .workOrderImgList"
+              v-for="(ite, index) in  item.content.workOrderImgList"
               :key="index"
-              :src="item"
+              :src="ite"
               alt=""
               style="width: 40%"
             />
@@ -72,7 +65,7 @@
         </div>
       </el-step>
 
-      <el-step v-if="item.type.code=='START'">
+      <el-step v-if="item.type=='START'">
         <span
           slot="icon"
           :class="
@@ -80,15 +73,15 @@
           "
         ></span>
         <div slot="title" class="step_title">
-          <span>{{item.type.desc}}</span>
+          <span>开始执行</span>
           <span>{{ item.createTime }}</span>
         </div>
         <div slot="description" class="step_description">
-          <span>执行人:{{ JSON.parse(item.content).executorName }}</span>
+          <span>执行人:{{ item.content.executorName }}</span>
         </div>
       </el-step>
 
-      <el-step v-if="item.type.code=='CREATE_WORK_ORDER'">
+      <el-step v-if="item.type=='CREATE_WORK_ORDER'">
         <span
           slot="icon"
           :class="
@@ -98,7 +91,7 @@
           "
         ></span>
         <div slot="title" class="step_title">
-          <span>{{item.type.desc}}</span>
+          <span>生成工单</span>
           <span>{{ item.createTime }}</span>
         </div>
         <div
@@ -108,45 +101,25 @@
         >
           <el-row>
             <el-col :span="8">
-              <span
-                >工单编号:{{
-                   JSON.parse(item.content).workOrderCode
-                }}</span
-              >
+              <span>工单编号:{{item.content.workOrderCode}}</span >
             </el-col>
             <el-col :span="8">
-              <span
-                >执行人:{{
-                   JSON.parse(item.content).workOrderExecutorName
-                }}</span
-              >
+              <span>执行人:{{item.content.workOrderExecutorName}}</span>
             </el-col>
             <el-col :span="8">
-              <span
-                >执行人电话:{{
-                   JSON.parse(item.content).workOrderExecutorPhone
-                }}</span
-              >
+              <span>执行人电话:{{item.content.workOrderExecutorPhone}}</span>
             </el-col>
             <el-col :span="24">
-              <span
-                >计划完成时间:{{
-                   JSON.parse(item.content).plannedTime
-                }}</span
-              >
+              <span>计划完成时间:{{ item.content.plannedTime}}</span>
             </el-col>
             <el-col :span="24">
-              <span
-                >维修方案:{{
-                   JSON.parse(item.content).maintenanceContent
-                }}</span
-              >
+              <span>维修方案:{{item.content.maintenanceContent}}</span>
             </el-col>
           </el-row>
         </div>
       </el-step>
 
-      <el-step v-if="item.type.code=='EXAMINE_PLAN'">
+      <el-step v-if="item.type=='EXAMINE_PLAN'">
         <span
           slot="icon"
           :class="
@@ -156,27 +129,17 @@
           "
         ></span>
         <div slot="title" class="step_title">
-          <span>{{item.type.desc}}</span>
-          <span>{{  JSON.parse(item.content).createTime }}</span>
+          <span>审核维修计划</span>
+          <span>{{ item.content.createTime }}</span>
         </div>
         <div slot="description" class="step_description">
-          <span
-            >审核人:{{
-               JSON.parse(item.content).examinePlanUserName
-            }}</span
-          >
-          <span
-            >审核结果:{{
-               JSON.parse(item.content).examinePlanUserName ? '通过' : ''
-            }}</span
-          >
-          <span
-            >审核说明:{{  JSON.parse(item.content).examineExplain }}</span
-          >
+          <span>审核人:{{item.content.examinePlanUserName}}</span>
+          <span>审核结果:{{item.content.examinePlanUserName ? '通过' : ''}}</span>
+          <span>审核说明:{{item.content.examineExplain }}</span>
         </div>
       </el-step>
 
-      <el-step v-if="item.type.code=='CREATE_PLAN'">
+      <el-step v-if="item.type=='CREATE_PLAN'">
         <span
           slot="icon"
           :class="
@@ -186,16 +149,49 @@
           "
         ></span>
         <div slot="title" class="step_title">
-          <span>{{item.type.desc}}<span v-if="item.createNum">(第{{item.createNum}}次)</span></span>
+          <span>创建维修计划<span v-if="item.createNum">(第{{item.createNum}}次)</span></span>
           <span>{{ item.createTime }}</span>
         </div>
         <div slot="description" class="step_description">
-          <span>创建人:{{ JSON.parse(item.content).createUserName }}</span>
-          <span>计划单号:{{ JSON.parse(item.content).planCode }}</span>
-          <span>计划名称:{{ JSON.parse(item.content).planName }}</span>
+          <span>创建人:{{item.content.createUserName }}</span>
+          <span>计划单号:{{ item.content.planCode }}</span>
+          <span>计划名称:{{ item.content.planName }}</span>
         </div>
       </el-step>
-      <el-step v-if="item.type.code=='CREATE'">
+	  
+	  <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="
@@ -203,7 +199,7 @@
           "
         ></span>
         <div slot="title" class="step_title">
-          <span>{{item.type.desc}}</span>
+          <span>创建报修记录</span>
           <span>{{ item.createTime }}</span>
           <!-- <span>{{ logs['CREATE'].createTime }}</span> -->
         </div>
@@ -227,27 +223,27 @@ export default {
   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(() => {})
-      }
+      // 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 () {
@@ -263,17 +259,18 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+	
 .repair_infoLogs {
   .step_icon {
-    width: 22px;
-    height: 22px;
-    border: 1px solid #333;
+    width: 100%;
+    height: 100%;
     border-radius: 50%;
     box-sizing: border-box;
+	background:#ccc;
   }
   .step_active {
     border: 0;
-    background-color: #4b7902;
+    background-color: #1890ff;
   }
   .step_title {
     width: 400px;

+ 51 - 65
src/views/maintenance/repair/outsourcingOrder/components/AppointDetailsDialog.vue

@@ -13,7 +13,7 @@
         <el-row class="repair_row">
           <el-col :span="12" class="repair_column">
             <span>工单编号:</span>
-            <span>{{ workOrderInfo ? workOrderInfo.outsourcCode : '' }}</span>
+            <span>{{ workOrderInfo ? workOrderInfo.code : '' }}</span>
           </el-col>
           <el-col :span="12" class="repair_column">
             <span>发布时间:</span>
@@ -34,7 +34,7 @@
           <el-col :span="12" class="repair_column">
             <span>计划完成时间:</span>
             <span>{{
-              workOrderInfo ? workOrderInfo.plannCompletionTime : ''
+              workOrderInfo ? workOrderInfo.planCompletionTime : ''
             }}</span>
           </el-col>
           <el-col :span="12" class="repair_column">
@@ -93,19 +93,19 @@
         <el-row class="repair_row">
           <el-col :span="12" class="repair_column">
             <span>设备编码:</span>
-            <span>{{ equipmentInfo ? equipmentInfo.assetCode : '' }}</span>
+            <span>{{ equipmentInfo ? equipmentInfo.code : '' }}</span>
           </el-col>
           <el-col :span="12" class="repair_column">
             <span>权属部门:</span>
             <span>{{
-              equipmentInfo ? equipmentInfo.ownershipDeptName : ''
+              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.assetName : '' }}</span>
+            <span>{{ equipmentInfo ? equipmentInfo.name : '' }}</span>
           </el-col>
           <el-col :span="12" class="repair_column">
             <span>权属人:</span>
@@ -117,9 +117,8 @@
         <el-row class="repair_row">
           <el-col :span="12" class="repair_column">
             <span>设备分类:</span>
-            <span>{{
-              equipmentInfo.assetType
-                ? assetTypeList[equipmentInfo.assetType - 1]
+            <span>{{  equipmentInfo.category
+                ? equipmentInfo.category.categoryLevelPath
                 : ''
             }}</span>
           </el-col>
@@ -133,25 +132,19 @@
         <el-row class="repair_row">
           <el-col :span="12" class="repair_column">
             <span>固定资产编码:</span>
-            <span>{{ equipmentInfo ? equipmentInfo.fixAssetCode : '' }}</span>
+            <span>{{ equipmentInfo ? equipmentInfo.fixCode : '' }}</span>
           </el-col>
           <el-col :span="12" class="repair_column">
             <span>设备位置:</span>
-            <span
-              >{{ equipmentInfo ? equipmentInfo.factoryName : '' }}—{{
-                equipmentInfo ? equipmentInfo.workshopName : ''
-              }}—{{ equipmentInfo ? equipmentInfo.lineName : '' }}</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.information
-                ? equipmentInfo.information.specification
-                : ''
-            }}</span>
+            <span>
+              {{equipmentInfo.category&&equipmentInfo.category.specification}}|{{equipmentInfo.category&&equipmentInfo.category.modelType}}
+            </span>
           </el-col>
         </el-row>
       </el-tab-pane>
@@ -159,7 +152,7 @@
         <el-row class="repair_row">
           <el-col :span="12" class="repair_column">
             <span>报修记录编号:</span>
-            <span>{{ infoData ? infoData.repairsCode : '' }}</span>
+            <span>{{ infoData ? infoData.code : '' }}</span>
           </el-col>
           <el-col :span="12" class="repair_column">
             <span>报修时间:</span>
@@ -169,9 +162,7 @@
         <el-row class="repair_row">
           <el-col :span="12" class="repair_column">
             <span>来源:</span>
-            <span>{{
-              infoData && infoData.source ? infoData.source.desc : ''
-            }}</span>
+            <span>{{infoData ?getDictValue('报修来源', infoData.sourceType):''}}</span>
           </el-col>
           <el-col :span="12" class="repair_column">
             <span>来源编码:</span>
@@ -181,11 +172,11 @@
         <el-row class="repair_row">
           <el-col :span="12" class="repair_column">
             <span>报修部门:</span>
-            <span>{{ infoData ? infoData.repairsDeptName : '' }}</span>
+            <span>{{ infoData ? infoData.requestDeptName : '' }}</span>
           </el-col>
           <el-col :span="12" class="repair_column">
             <span>报修人:</span>
-            <span>{{ infoData ? infoData.repairsPerson : '' }}</span>
+            <span>{{ infoData ? infoData.requestUserName : '' }}</span>
           </el-col>
         </el-row>
         <el-row class="repair_row">
@@ -201,10 +192,10 @@
         <el-row class="repair_row">
           <el-col :span="24" class="repair_column">
             <span>故障描述:</span>
-            <span>{{ infoData ? infoData.repairsDescription : '' }}</span>
+            <span>{{ infoData ? infoData.remark : '' }}</span>
           </el-col>
         </el-row>
-        <el-row class="repair_row">
+<!--        <el-row class="repair_row">
           <el-col :span="24" class="repair_column">
             <span>图片:</span>
             <el-image
@@ -215,7 +206,7 @@
               :preview-src-list="[item.url]"
             />
           </el-col>
-        </el-row>
+        </el-row> -->
       </el-tab-pane>
     </el-tabs>
 
@@ -250,18 +241,12 @@
 </template>
 
 <script>
-// import {
-//   getOutsourcDetail,
-//   getDetailByCode,
-//   checkOrBack
-// } from '@/api/maintenance/repair/repair'
-// import { getWorkOrderDetail } from '@/api/maintenance/repair/maintenancePlan'
-// import { getNewinfo } from '@/api/stockManagement/stocking'
-// import { imageView } from '@/utils'
-// import UploadImg from '@/components/uploadImg/WithView.vue'
+import { getAssetInfo } from '@/api/ledgerAssets';
+import { getRepairById , getOutsourceInfo , checkOrBack } from '@/api/maintenance/repair_report';
+import dictMixins from '@/mixins/dictMixins';
 export default {
+  mixins: [dictMixins],
   props: {},
-  // components: { RepairNotesTab, WorkOrderTab, UploadImg },
   data () {
     return {
       equipmentdialog: false,
@@ -292,6 +277,10 @@ export default {
       imageUrl: null
     }
   },
+  created () {
+    this.requestDict('报修来源');
+    this.requestDict('报修状态');
+  },
   methods: {
     handleClose () {
       this.equipmentdialog = false
@@ -305,38 +294,39 @@ export default {
       this.equipmentdialog = true
       this.dialogTitle = row.title
       this.detailsTabsActiveName = 'keepInRepair'
-      // const res = await getOutsourcDetail(row.id)
-      // this.workOrderInfo = res.data
-      // this.getSbinfo({ code: this.row.equiCode })
-      // this.getBxinfo(row.repairsCode)
+      const res = await getOutsourceInfo(row.id)
+      this.workOrderInfo = res
+      this.getSbinfo(row.equiId)
+      this.getBxinfo(row.repairRequestId)
     },
 
     getSbinfo (params) {
-      getNewinfo(params).then(res => {
-        if (res.success) {
-          this.equipmentInfo = res.data
+      getAssetInfo(params).then(res => {
+        if (res) {
+          this.equipmentInfo = res
+      		this.$set(this.equipmentInfo,'position',res.positionList[0].pathName?res.positionList[0].pathName:'')
         }
       })
     },
 
     getBxinfo (params) {
-      getDetailByCode(params).then(res => {
-        if (res.success) {
-          this.infoData = res.data
+      getRepairById(params).then(res => {
+        if (res) {
+          this.infoData = res
           // 处理图片
-          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
-            })
-          }
+          // 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
+          //   })
+          // }
         }
       })
     },
@@ -351,11 +341,9 @@ export default {
         rejectReason: ''
       }
       checkOrBack(params).then(res => {
-        if (res.success) {
           this.$message.success('验收成功!')
           this.$emit('refesh')
           this.handleClose()
-        }
       })
     },
     //驳回按钮事件
@@ -387,11 +375,9 @@ export default {
           rejectReason: this.cause
         }
         checkOrBack(params).then(res => {
-          if (res.success) {
             this.$message.success('驳回成功!')
             this.$emit('refesh')
             this.handleClose()
-          }
         })
       }
     },

+ 12 - 7
src/views/maintenance/repair/outsourcingOrder/components/order-search.vue

@@ -8,7 +8,7 @@
   >
     <el-row :gutter="15">
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="单号:">
+        <el-form-item label="号:"  label-width="80px">
           <el-input clearable v-model="where.code" placeholder="请输入" />
         </el-form-item>
       </el-col>
@@ -20,7 +20,7 @@
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="执行人:" label-width="60px">
-			 <personSelect v-model="where.approvalUserId" />
+			 <personSelect v-model="where.userNo" />
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 7, md: 12 } : { span: 7 }">
@@ -65,10 +65,10 @@
     data() {
       // 默认表单数据
       const defaultWhere = {
-        name: '',
         code: '',
-        fixCode:'',
-        ownershipGroupId:''
+        status: '',
+        userNo:'',
+		time: []
       };
       return {
         // 表单数据
@@ -87,8 +87,13 @@
     methods: {
       /* 搜索 */
       search() {
-        console.log(this.where);
-        this.$emit('search', this.where);
+        const parmas = this.where;
+        if (parmas.time?.length) {
+          parmas.startTime = parmas.time[0];
+          parmas.endTime = parmas.time[1];
+        }
+        delete parmas.time;
+        this.$emit('search', parmas);
       },
       /*  重置 */
       reset() {

+ 19 - 9
src/views/maintenance/repair/outsourcingOrder/index.vue

@@ -18,9 +18,9 @@
 	       <el-button icon="el-icon-upload2" size="small"  @click="handlExport">导出</el-button>
 	       <el-button icon="el-icon-printer" size="small" @click="openAppoint">打印委外单</el-button>
 	     </template>
-       <template v-slot:outsourcCode="{ row }">
+       <template v-slot:code="{ row }">
          <el-link type="primary" :underline="false" @click="goDetail(row)">
-           {{ row.outsourcCode }}
+           {{ row.code }}
          </el-link>
        </template>
 	     <!-- 操作列 -->
@@ -30,6 +30,7 @@
 	         :underline="false"
 	         icon="el-icon-edit"
 	         @click="openCheck(row)"
+			 v-if="row.status==0"
 	       >
 	         验收
 	       </el-link>
@@ -47,8 +48,10 @@
   import OrderSearch from './components/order-search.vue';
   import AppointDialog from './components/appointDialog.vue'
   import AppointDetailsDialog from './components/AppointDetailsDialog.vue'
-  import { pageRoles } from '@/api/system/role';
+  import { outsourceList } from '@/api/maintenance/repair_report';
+  import dictMixins from '@/mixins/dictMixins';
   export default {
+	mixins: [dictMixins],
     components: {
       OrderSearch,
 	  AppointDialog,
@@ -74,14 +77,15 @@
 		    fixed: 'left'
 		  },
 		  {
-		    prop: 'outsourcCode',
+		    prop: 'code',
 		    label: '工单编号',
 		    align: 'center',	
 		    showOverflowTooltip: true,
-		    minWidth: 110
+		    minWidth: 110,
+			slot: 'code'
 		  },
 		  {
-		    prop: 'repairsCode',
+		    prop: 'repairRequestCode',
 		    label: '报修单号',
 		    align: 'center',
 		    showOverflowTooltip: true,
@@ -109,7 +113,7 @@
 		    minWidth: 110
 		  },
 			{
-			  prop: 'plannCompletionTime',
+			  prop: 'planCompletionTime',
 			  label: '计划完成时间',
 			  align: 'center',	
 			  showOverflowTooltip: true,
@@ -127,7 +131,10 @@
 			  label: '状态',
 			  align: 'center',	
 			  showOverflowTooltip: true,
-			  minWidth: 110
+			  minWidth: 110,
+			  formatter: (_row, _column, cellValue) => {
+			    return this.getDictValue('委外单状态', _row.status);
+			  }
 			},
 		  {
 		    prop: 'createBy',
@@ -169,10 +176,13 @@
     computed: {
 
     },
+	created () {
+	  this.requestDict('委外单状态')
+	},
     methods: {
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
-        return pageRoles({ pageNum: page, size: limit, ...where });
+        return outsourceList({ pageNum: page, size: limit, ...where });
       },
       /* 刷新表格 */
       reload(where) {

+ 15 - 11
src/views/maintenance/repair/repairNotes/components/entrustDialog.vue

@@ -13,7 +13,7 @@
           <el-col :span="12">
             <el-form-item label="报修记录编号:" prop="repairsRequestCode">
               <el-input
-                v-model="addForm.repairsRequestCode"
+                v-model="addForm.repairRequestCode"
                 disabled
               ></el-input>
             </el-form-item>
@@ -61,9 +61,9 @@
         </el-row>
         <el-row>
           <el-col :span="12">
-            <el-form-item label="计划完成时间:" prop="plannCompletionTime">
+            <el-form-item label="计划完成时间:" prop="planCompletionTime">
               <el-date-picker
-                v-model="addForm.plannCompletionTime"
+                v-model="addForm.planCompletionTime"
                 type="datetime"
                 style="width: 100%"
                 placeholder="选择日期时间"
@@ -76,7 +76,7 @@
       </el-form>
     </div>
     <div class="btns">
-      <el-button type="primary" size="small" @click="submitAdd">提交</el-button>
+      <el-button type="primary" size="small" @click="submitAdd" :loading="loading">提交</el-button>
       <el-button size="small" @click="handleClose">关闭</el-button>
     </div>
   </el-dialog>
@@ -96,10 +96,11 @@ export default {
       addForm: {},
       addFormRules: {
         outsourcUnit:[{ required: true, message: '请选择委外单位', trigger: 'blur' }],
-        plannCompletionTime:[{ required: true, message: '请选择计划完成时间', trigger: 'change' }]
+        planCompletionTime:[{ required: true, message: '请选择计划完成时间', trigger: 'change' }]
       },
       entrustVisible:false,
-      deptList:[]
+      deptList:[],
+	  loading:false
     }
   },
   created () {
@@ -108,8 +109,8 @@ export default {
   methods: {
     init(row){
        this.addForm = {}
-       this.addForm.repairsRequestCode = row.code
-       this.addForm.repairsRequestId = row.id
+       this.addForm.repairRequestCode = row.code
+       this.addForm.repairRequestId = row.id
        this.addForm.equiName = row.deviceName
        this.addForm.equiId = row.deviceId
 	   this.addForm.equiCode = row.deviceCode
@@ -132,17 +133,20 @@ export default {
     submitAdd(){
       this.$refs.addFormRef.validate(valid => {
         if (valid) {
+		  this.loading = true
           addOutsource(this.addForm).then(res=>{
-               if (res?.success) {
+			  this.loading = false
+               if (res.code=='0') {
                  this.handleClose()
                  this.$message.success('委派成功!')
                  this.$emit('refresh')
                }
            })
-
+		   .catch(e=>{
+			   this.loading = false
+		   })
         }
       })
-
     }
 
 

+ 1 - 0
src/views/maintenance/repair/repairNotes/index.vue

@@ -33,6 +33,7 @@
             :underline="false"
             icon="el-icon-edit"
             @click="appoint(row)"
+			v-if="row.status==0||row.status==6"
           >
             委外
           </el-link>