huang_an 2 anni fa
parent
commit
f136e8c1e9

+ 49 - 49
src/components/addPatrolConfigDialog/index.vue

@@ -89,7 +89,7 @@
                 v-model="addForm.categoryLevelId"
                 @changeNode="chooseClassify"
                 @setRootId="getRootId"
-				:disabled="isBindPlan"
+                :disabled="isBindPlan"
               />
             </el-form-item>
           </el-col>
@@ -136,7 +136,7 @@
               <deptSelect
                 v-model="addForm.groupId"
                 @changeGroup="searchDeptNodeClick"
-				:disabled="isBindPlan"
+                :disabled="isBindPlan"
               />
             </el-form-item>
           </el-col>
@@ -165,7 +165,7 @@
                 dictName="紧急程度"
                 clearable
                 v-model="addForm.urgent"
-				:disabled="isBindPlan"
+                :disabled="isBindPlan"
               >
               </DictSelection>
             </el-form-item>
@@ -370,7 +370,7 @@
         default: () => {
           return '新增巡点检计划配置';
         }
-      },
+      }
     },
     data() {
       return {
@@ -450,7 +450,7 @@
         addDialogLoading: false,
         equipmentList: [],
         rootId: null,
-		isBindPlan:false
+        isBindPlan: false
       };
     },
     computed: {},
@@ -479,7 +479,7 @@
         } else {
           //  获取计划配置单号
           this.getOrderCode(tips);
-		  this.isBindPlan = false
+          this.isBindPlan = false;
           this.planRuleEquiList = [];
           this.matterRulesList = [];
         }
@@ -488,7 +488,7 @@
       async getInfo(id) {
         const res = await getInfoById(id);
         this.addForm = res;
-	    this.isBindPlan = res.isBindPlan
+        this.isBindPlan = res.isBindPlan;
         this.categoryEquipment(res.categoryLevelId);
         const params = { groupId: res.groupId };
         this.getUserList(params);
@@ -497,7 +497,7 @@
         this.$set(this.addForm, 'urgent', JSON.stringify(res.urgent));
         this.$set(this.addForm, 'executeIdList', res.executeId.split(','));
         this.$set(this.addForm, 'imageUrl', {});
-        this._getEquipmentList(res.categoryId,this.isBindPlan);
+        this._getEquipmentList(res.categoryId, this.isBindPlan);
         let keys = [];
         res.deviceInfo.map((item) => {
           keys.push(item.substanceId);
@@ -538,56 +538,56 @@
       async handleEquipmentClassChange(item) {
         this.clickedTreeNode = true;
         this.equipmentInfo = {};
-        this._getEquipmentList(item.id,this.isBindPlan);
+        this._getEquipmentList(item.id, this.isBindPlan);
       },
       // 封装 - 获取设备分类列表
-      async _getEquipmentList(val,bind) {
+      async _getEquipmentList(val, bind) {
         const params = {
           pageNum: 1,
           size: -1,
           categoryId: val,
           rootCategoryLevelId: this.rootId
         };
-          const res = await getAssetList(params);
-          this.planRuleEquiList = res.list
-		  if(!res.list.length) return
-          this.planRuleEquiList.map((item) => {
-            item.showName = item.name + '(' + item.code + ')'
-			item.disabled = bind
-          })
-          this.currentEquItemIndex = 0
-          const item = this.planRuleEquiList[0]
-          this.$nextTick(() => {
-            this.$refs.equiListTree.setCurrentKey(item.id)
-            this.equipmentInfo = {
-              equiCode: item.code,
-              equiName: item.name,
-              equiModel: item.category.modelType,
-              equiLocation: item.position[0].pathName
-            }
-            // 对比详情返回的数据和设备分类下面所有的设备列表,将sparePart同步过去
-            if (this.addForm.deviceInfo) {
-              for (let i = 0; i < this.planRuleEquiList.length; i++) {
-                for (let j = 0; j < this.addForm.deviceInfo.length; j++) {
-                  if (
-                    this.planRuleEquiList[i].code ===
-                    this.addForm.deviceInfo[j].substance.code
-                  ) {
-                    this.$set(
-                      this.planRuleEquiList[i],
-                      'sparePart',
-                      this.addForm.deviceInfo[j].sparePart
-                    );
-                    this.$set(
-                      this.planRuleEquiList[i],
-                      'totalCost',
-                      this.addForm.deviceInfo[j].totalCost
-                    );
-                  }
+        const res = await getAssetList(params);
+        this.planRuleEquiList = res.list;
+        if (!res.list.length) return;
+        this.planRuleEquiList.map((item) => {
+          item.showName = item.name + '(' + item.code + ')';
+          item.disabled = bind;
+        });
+        this.currentEquItemIndex = 0;
+        const item = this.planRuleEquiList[0];
+        this.$nextTick(() => {
+          this.$refs.equiListTree.setCurrentKey(item.id);
+          this.equipmentInfo = {
+            equiCode: item.code,
+            equiName: item.name,
+            equiModel: item.category.modelType,
+            equiLocation: item.position[0].pathName
+          };
+          // 对比详情返回的数据和设备分类下面所有的设备列表,将sparePart同步过去
+          if (this.addForm.deviceInfo) {
+            for (let i = 0; i < this.planRuleEquiList.length; i++) {
+              for (let j = 0; j < this.addForm.deviceInfo.length; j++) {
+                if (
+                  this.planRuleEquiList[i].code ===
+                  this.addForm.deviceInfo[j].substance.code
+                ) {
+                  this.$set(
+                    this.planRuleEquiList[i],
+                    'sparePart',
+                    this.addForm.deviceInfo[j].sparePart
+                  );
+                  this.$set(
+                    this.planRuleEquiList[i],
+                    'totalCost',
+                    this.addForm.deviceInfo[j].totalCost
+                  );
                 }
               }
             }
-          })
+          }
+        });
       },
 
       // 获取审核人列表、巡点检人员
@@ -631,7 +631,7 @@
       async categoryEquipment(id) {
         const params = { categoryLevelId: id, pageNum: 1, size: -1 };
         const data = await getCategory(params);
-		// this.addForm.categoryId = '';
+        // this.addForm.categoryId = '';
         this.equipmentList = data.list;
       },
 
@@ -795,7 +795,7 @@
                 : this.dialogTitle.includes('保养')
                 ? 2
                 : 3;
-			  this.addForm.isBindPlan = this.isBindPlan
+              this.addForm.isBindPlan = this.isBindPlan;
               const res = await saveOrUpdate(this.addForm);
               if (res) {
                 const type = this.dialogTitle.includes('新增')

+ 6 - 0
src/views/ledgerAssets/mould/edit.vue

@@ -106,6 +106,12 @@
                 <template slot="label"> 最大冲压次数</template>
                 {{ categoryMold.maxCyTimes }}
               </el-descriptions-item>
+              <el-descriptions-item>
+                <template slot="label"> 已冲压次数 </template>
+                <el-form-item label-width="0">
+                  <el-input size="small" v-model="info.startCyTimes"></el-input>
+                </el-form-item>
+              </el-descriptions-item>
               <el-descriptions-item>
                 <template slot="label"> 大模体型号 </template>
                 {{ categoryMold.maxMoldType }}

+ 1 - 1
src/views/ledgerAssets/turnoverDisks/edit.vue

@@ -905,7 +905,7 @@
       },
       isExit,
       handlwpbm() {
-        this.$refs.DialogGoods.open('1787726120597663745');
+        this.$refs.DialogGoods.open('26');
       },
       async cbDialogGoods(data) {
         console.log(data);

+ 1 - 2
src/views/ledgerAssets/turnoverDisks/index.vue

@@ -8,11 +8,10 @@
       >
         <div>
           <div class="ele-border-lighter sys-organization-list">
-            <!-- id="1787668431368617985" -->
             <AssetTree
               @handleNodeClick="handleNodeClick"
               @setRootId="setRootId"
-              id="1787726120597663745"
+              id="26"
               :paramsType="'type'"
               ref="treeList"
             />

+ 20 - 10
src/views/maintenance/patrol/plan/index.vue

@@ -85,7 +85,7 @@
       DispatchDialog,
       AddPatrolPlanDialog
     },
-    data () {
+    data() {
       return {
         // 表格列配置
         columns: [
@@ -135,7 +135,7 @@
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110,
-            formatter (item) {
+            formatter(item) {
               return { 1: '自动', 0: '手动' }[item.cycleType];
             }
           },
@@ -144,7 +144,17 @@
             label: '状态',
             align: 'center',
             showOverflowTooltip: true,
-            minWidth: 110
+            minWidth: 110,
+            formatter(item) {
+              return {
+                0: '待审核',
+                1: '已派单',
+                2: '执行中',
+                3: '已完成',
+                4: '已撤回',
+                5: '已驳回'
+              }[item.cycleType];
+            }
           },
           {
             prop: 'approvalUserName',
@@ -189,10 +199,10 @@
     computed: {},
     methods: {
       /* 表格数据源 */
-      datasource ({ page, limit, where, order }) {
+      datasource({ page, limit, where, order }) {
         return getPage({ pageNum: page, size: limit, ...where, planType: 1 });
       },
-      async changeEnable (row) {
+      async changeEnable(row) {
         const res = await putRoles(row);
         if (res.code == 0) {
           this.$message({
@@ -204,10 +214,10 @@
         }
       },
       /* 刷新表格 */
-      reload (where) {
+      reload(where) {
         this.$refs.table.reload({ page: 1, where });
       },
-      handleWithdraw (row) {
+      handleWithdraw(row) {
         // 撤回
 
         this.$confirm(`确认撤回计划${row.name}?`, '提示').then(async () => {
@@ -222,14 +232,14 @@
         });
       },
 
-      openDispatch (row) {
+      openDispatch(row) {
         this.$refs.dispatchDialogRef.open(row);
       },
-      openAdd (dialogTitle, row) {
+      openAdd(dialogTitle, row) {
         this.$refs.addPatrolPlanDialogRef.open(dialogTitle, row);
       },
 
-      goDetail ({ id }) {
+      goDetail({ id }) {
         this.$router.push({
           path: '/maintenance/patrol/plan/details',
           query: {

+ 186 - 171
src/views/maintenance/repair/outsourcingOrder/components/AppointDetailsDialog.vue

@@ -42,11 +42,11 @@
             <el-date-picker
               v-if="row.isshow"
               v-model="checkTime"
-              type="datetime"
+              type="date"
               style="width: 50%"
               placeholder="选择日期时间"
               size="small"
-              value-format="yyyy-MM-dd HH:mm:ss"
+              value-format="yyyy-MM-dd"
             >
             </el-date-picker>
             <span v-else>{{
@@ -69,7 +69,7 @@
             <span>{{ workOrderInfo ? workOrderInfo.rejectReason : '' }}</span>
           </el-col>
         </el-row>
-<!--        <el-row class="repair_row">
+        <!--        <el-row class="repair_row">
           <el-col :span="24" class="repair_column">
             <span>图片:</span>
             <div class="upload-img" v-if="row.isshow">
@@ -117,7 +117,8 @@
         <el-row class="repair_row">
           <el-col :span="12" class="repair_column">
             <span>设备分类:</span>
-            <span>{{  equipmentInfo.category
+            <span>{{
+              equipmentInfo.category
                 ? equipmentInfo.category.categoryLevelPath
                 : ''
             }}</span>
@@ -136,14 +137,18 @@
           </el-col>
           <el-col :span="12" class="repair_column">
             <span>设备位置:</span>
-            <span>{{ equipmentInfo.position}}</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}}
+              {{
+                equipmentInfo.category && equipmentInfo.category.specification
+              }}|{{
+                equipmentInfo.category && equipmentInfo.category.modelType
+              }}
             </span>
           </el-col>
         </el-row>
@@ -162,7 +167,9 @@
         <el-row class="repair_row">
           <el-col :span="12" class="repair_column">
             <span>来源:</span>
-            <span>{{infoData ?getDictValue('报修来源', infoData.sourceType):''}}</span>
+            <span>{{
+              infoData ? getDictValue('报修来源', infoData.sourceType) : ''
+            }}</span>
           </el-col>
           <el-col :span="12" class="repair_column">
             <span>来源编码:</span>
@@ -195,7 +202,7 @@
             <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
@@ -241,187 +248,195 @@
 </template>
 
 <script>
-import { getAssetInfo } from '@/api/ledgerAssets';
-import { getRepairById , getOutsourceInfo , checkOrBack } from '@/api/maintenance/repair_report';
-import dictMixins from '@/mixins/dictMixins';
-export default {
-  mixins: [dictMixins],
-  props: {},
-  data () {
-    return {
-      equipmentdialog: false,
-      detailsTabsActiveName: 'repairApplication',
-      workOrderInfo: {},
-      equipmentInfo: {},
-      infoData: {},
-      statusObj: {
-        0: '委外中',
-        1: '未修复',
-        2: '已完成'
-      },
-      dialogTitle: '',
-      row: {},
-      cause: '',
-      showtext: false,
-      checkTime: '',
-      imageUrl: null
-    }
-  },
-  created () {
-    this.requestDict('报修来源');
-    this.requestDict('报修状态');
-  },
-  methods: {
-    handleClose () {
-      this.equipmentdialog = false
-      this.checkTime = ''
-      this.imageUrl = null
-      this.detailsTabsActiveName = 'keepInRepair'
+  import { getAssetInfo } from '@/api/ledgerAssets';
+  import {
+    getRepairById,
+    getOutsourceInfo,
+    checkOrBack
+  } from '@/api/maintenance/repair_report';
+  import dictMixins from '@/mixins/dictMixins';
+  export default {
+    mixins: [dictMixins],
+    props: {},
+    data() {
+      return {
+        equipmentdialog: false,
+        detailsTabsActiveName: 'repairApplication',
+        workOrderInfo: {},
+        equipmentInfo: {},
+        infoData: {},
+        statusObj: {
+          0: '委外中',
+          1: '未修复',
+          2: '已完成'
+        },
+        dialogTitle: '',
+        row: {},
+        cause: '',
+        showtext: false,
+        checkTime: '',
+        imageUrl: null
+      };
     },
-    async init (row) {
-      console.log(row)
-      this.row = row
-      this.equipmentdialog = true
-      this.dialogTitle = row.title
-      this.detailsTabsActiveName = 'keepInRepair'
-      const res = await getOutsourceInfo(row.id)
-      this.workOrderInfo = res
-      this.getSbinfo(row.equiId)
-      this.getBxinfo(row.repairRequestId)
-    },
-
-    getSbinfo (params) {
-      getAssetInfo(params).then(res => {
-        if (res) {
-          this.equipmentInfo = res
-      		this.$set(this.equipmentInfo,'position',res.positionList[0].pathName?res.positionList[0].pathName:'')
-        }
-      })
+    created() {
+      this.requestDict('报修来源');
+      this.requestDict('报修状态');
     },
+    methods: {
+      handleClose() {
+        this.equipmentdialog = false;
+        this.checkTime = '';
+        this.imageUrl = null;
+        this.detailsTabsActiveName = 'keepInRepair';
+      },
+      async init(row) {
+        console.log(row);
+        this.row = row;
+        this.equipmentdialog = true;
+        this.dialogTitle = row.title;
+        this.detailsTabsActiveName = 'keepInRepair';
+        const res = await getOutsourceInfo(row.id);
+        this.workOrderInfo = res;
+        this.getSbinfo(row.equiId);
+        this.getBxinfo(row.repairRequestId);
+      },
 
-    getBxinfo (params) {
-      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
-          //   })
-          // }
-        }
-      })
-    },
+      getSbinfo(params) {
+        getAssetInfo(params).then((res) => {
+          if (res) {
+            this.equipmentInfo = res;
+            this.$set(
+              this.equipmentInfo,
+              'position',
+              res.positionList[0].pathName ? res.positionList[0].pathName : ''
+            );
+          }
+        });
+      },
 
-    //通过按钮事件
-    pass () {
-      let params = {
-        id: this.row.id,
-        checkResult: 1,
-        checkTime: this.checkTime,
-        picPath: this.imageUrl,
-        rejectReason: ''
-      }
-      checkOrBack(params).then(res => {
-          this.$message.success('验收成功!')
-          this.$emit('refesh')
-          this.handleClose()
-      })
-    },
-    //驳回按钮事件
-    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
+      getBxinfo(params) {
+        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
+            //   })
+            // }
           }
-        })
-      })
-    },
-    cancelreject () {
-      this.showtext = false
-      this.cause = ''
-    },
-    surereject () {
-      if (!this.cause) {
-        this.$message.info('请填写驳回原因!')
-      } else {
+        });
+      },
+
+      //通过按钮事件
+      pass() {
         let params = {
           id: this.row.id,
-          checkResult: 0,
+          checkResult: 1,
           checkTime: this.checkTime,
           picPath: this.imageUrl,
-          rejectReason: this.cause
+          rejectReason: ''
+        };
+        checkOrBack(params).then((res) => {
+          this.$message.success('验收成功!');
+          this.$emit('refesh');
+          this.handleClose();
+        });
+      },
+      //驳回按钮事件
+      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() {
+        if (!this.cause) {
+          this.$message.info('请填写驳回原因!');
+        } else {
+          let params = {
+            id: this.row.id,
+            checkResult: 0,
+            checkTime: this.checkTime,
+            picPath: this.imageUrl,
+            rejectReason: this.cause
+          };
+          checkOrBack(params).then((res) => {
+            this.$message.success('驳回成功!');
+            this.$emit('refesh');
+            this.handleClose();
+          });
         }
-        checkOrBack(params).then(res => {
-            this.$message.success('驳回成功!')
-            this.$emit('refesh')
-            this.handleClose()
-        })
-      }
-    },
+      },
 
-    // 选择图片回调
-    cbUploadImg (data) {
-      if (data.length > 0) {
-        this.imageUrl = data[0]
-      } else {
-        this.imageUrl = ''
+      // 选择图片回调
+      cbUploadImg(data) {
+        if (data.length > 0) {
+          this.imageUrl = data[0];
+        } else {
+          this.imageUrl = '';
+        }
       }
-    }
-  },
-  watch: {
-    equipmentdialog (nVal, oVal) {
-      if (!nVal) {
-        this.cause = ''
-        this.showtext = 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;
-    align-items: center;
-    > span {
-      &:first-child {
-        font-weight: 700;
-        text-align: right;
-        width: 120px;
+  .repair_row {
+    margin-bottom: 15px;
+    .repair_column {
+      display: flex;
+      align-items: center;
+      > 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;
-}
+  .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>

+ 2 - 2
src/views/maintenance/repair/planRepair/index.vue

@@ -195,12 +195,12 @@
 
       jumpAdd() {
         this.$router.push({
-          path: '/maintenance/repair/maintenancePlan/add'
+          path: '/maintenance/repair/planRepair/add'
         });
       },
       toEdit({ id }) {
         this.$router.push({
-          path: '/maintenance/repair/maintenancePlan/add',
+          path: '/maintenance/repair/planRepair/add',
           query: { id }
         });
       },

+ 55 - 9
src/views/maintenance/repair/repairNotes/components/addDialog.vue

@@ -124,7 +124,10 @@
         <el-row>
           <el-col :span="12">
             <el-form-item label="领导部门:" prop="repairDeptId">
-              <dept-select v-model="addForm.repairDeptId" />
+              <dept-select
+                v-model="addForm.repairDeptId"
+                @input="auditorDeptClick"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -142,11 +145,26 @@
 
           <el-col :span="12">
             <el-form-item label="通知领导:" prop="repairUserId">
-              <person-select
+              <el-select
+                style="width: 100%"
+                v-model="addForm.repairLeaderUserId"
+                @change="changeUser"
+                filterable
+                placeholder="请选通知领导"
+              >
+                <el-option
+                  v-for="item in userList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+              <!-- <person-select
                 v-model="addForm.repairLeaderUserId"
                 clearable
                 @change="changeUser"
-              />
+              /> -->
             </el-form-item>
           </el-col>
           <el-col :span="24">
@@ -194,6 +212,7 @@
 </template>
 
 <script>
+  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
   import { getAssetInfo } from '@/api/ledgerAssets/index';
   import CategoryDialog from '@/components/AssetDialog/categoryDialog';
   import DeptSelect from '@/components/CommomSelect/dept-select.vue';
@@ -228,7 +247,14 @@
         addRepairNotesDialog: false,
         addForm: {},
         initData: [],
-        addFormRules: {},
+        userList: [],
+        addFormRules: {
+          remark: {
+            required: true,
+            message: '请输入故障描述',
+            trigger: 'blur'
+          }
+        },
         loading: false,
         row: null,
         receiverList: []
@@ -238,6 +264,27 @@
       this.getUserList();
     },
     methods: {
+      // 切换领导部门更换人员
+      async auditorDeptClick(data) {
+        console.log(data);
+        if (data) {
+          this.getStaffList(data);
+        } else {
+          this.addForm.repairLeaderUserId = '';
+          this.addForm.repairLeaderUserName = '';
+          this.userList = [];
+        }
+      },
+      // 获取领导部门下面人员
+      async getStaffList(id) {
+        let res = await warehouseDefinition.getUserPage({
+          groupId: id,
+          size: 9999,
+          page: 1
+        });
+        this.userList = res.list;
+      },
+      // 初始化数据(父组件调用)
       init(row) {
         this.addRepairNotesDialog = true;
         this.row = row;
@@ -248,7 +295,6 @@
           this.title = '新增';
         }
       },
-
       handleClose() {
         this.initData = [];
         this.addRepairNotesDialog = false;
@@ -263,14 +309,12 @@
         this.addForm.repairsImg = list.map((item) => item.accessUrl).join(',');
         console.log('上传的图片:', this.addForm.repairsImg);
       },
-
       // 获取接收人列表
       async getUserList(deptCode) {
         let data = { pageNum: 1, size: -1 };
         const res = await getUserPage(data);
         this.receiverList = res.list;
       },
-
       changeUser(data) {
         this.receiverList.map((item) => {
           if (item.id == data) {
@@ -288,9 +332,10 @@
           constApi = getRepairById;
         }
         constApi(id).then((res) => {
+          console.log('res--------------', res);
           this.addForm = res;
-          console.log('this.addForm----------', this.addForm);
-          // this.addForm.equiLocation = res.positionList[0].pathName;
+          this.addForm.equiLocation =
+            res.positionList?.length > 0 ? res.positionList[0].pathName : '';
           const model = res.modelType ? res.modelType : '';
           const specification = res.specification
             ? res.specification + '|'
@@ -329,6 +374,7 @@
         this.loading = true;
         if (this.row) {
           params.id = this.row.id;
+          params.deviceId = this.addForm.deviceId;
           params.code = this.row.code;
           update(params)
             .then((res) => {

+ 89 - 95
src/views/maintenance/repair/repairNotes/components/entrustDialog.vue

@@ -8,39 +8,33 @@
     width="50%"
   >
     <div class="main_container">
-      <el-form :model="addForm" :rules="addFormRules" label-width="120px"  ref="addFormRef">
+      <el-form
+        :model="addForm"
+        :rules="addFormRules"
+        label-width="120px"
+        ref="addFormRef"
+      >
         <el-row>
           <el-col :span="12">
             <el-form-item label="报修记录编号:" prop="repairsRequestCode">
-              <el-input
-                v-model="addForm.repairRequestCode"
-                disabled
-              ></el-input>
+              <el-input v-model="addForm.repairRequestCode" disabled></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="设备编码:" prop="equiCode">
-              <el-input
-                v-model="addForm.equiCode"
-                disabled
-              ></el-input>
+              <el-input v-model="addForm.equiCode" disabled></el-input>
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col :span="12">
             <el-form-item label="设备名称:" prop="equiName">
-              <el-input
-                v-model="addForm.equiName"
-                disabled
-              ></el-input>
+              <el-input v-model="addForm.equiName" disabled></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="12">
             <el-form-item label="委外单位:" prop="outsourcUnit">
-				<el-input
-				  v-model="addForm.outsourcUnit"
-				></el-input>
+              <el-input v-model="addForm.outsourcUnit"></el-input>
               <!-- <el-select
                 size="small"
                 style="width: 100%"
@@ -64,10 +58,10 @@
             <el-form-item label="计划完成时间:" prop="planCompletionTime">
               <el-date-picker
                 v-model="addForm.planCompletionTime"
-                type="datetime"
+                type="date"
                 style="width: 100%"
                 placeholder="选择日期时间"
-                value-format="yyyy-MM-dd HH:mm:ss"
+                value-format="yyyy-MM-dd"
               >
               </el-date-picker>
             </el-form-item>
@@ -76,7 +70,13 @@
       </el-form>
     </div>
     <div class="btns">
-      <el-button type="primary" size="small" @click="submitAdd" :loading="loading">提交</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>
@@ -84,88 +84,82 @@
 
 <script>
   import { addOutsource } from '@/api/maintenance/repair_report';
-export default {
-  props: {
-
-  },
- watch: {
-
-  },
-  data () {
-    return {
-      addForm: {},
-      addFormRules: {
-        outsourcUnit:[{ required: true, message: '请选择委外单位', trigger: 'blur' }],
-        planCompletionTime:[{ required: true, message: '请选择计划完成时间', trigger: 'change' }]
-      },
-      entrustVisible:false,
-      deptList:[],
-	  loading:false
-    }
-  },
-  created () {
-
-  },
-  methods: {
-    init(row){
-       this.addForm = {}
-       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
-       this.addForm.status = 0
-       // this.getgys()
-       this.entrustVisible = true
+  export default {
+    props: {},
+    watch: {},
+    data() {
+      return {
+        addForm: {},
+        addFormRules: {
+          outsourcUnit: [
+            { required: true, message: '请选择委外单位', trigger: 'blur' }
+          ],
+          planCompletionTime: [
+            { required: true, message: '请选择计划完成时间', trigger: 'change' }
+          ]
+        },
+        entrustVisible: false,
+        deptList: [],
+        loading: false
+      };
     },
+    created() {},
+    methods: {
+      init(row) {
+        this.addForm = {};
+        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;
+        this.addForm.status = 0;
+        // this.getgys()
+        this.entrustVisible = true;
+      },
 
-    // 获取供应商列表
-    async getgys () {
-      let res = await getAllSupplier()
-      this.deptList = res.data
-    },
+      // 获取供应商列表
+      async getgys() {
+        let res = await getAllSupplier();
+        this.deptList = res.data;
+      },
 
-    handleClose () {
-      this.$refs.addFormRef.resetFields()
-      this.entrustVisible = false
-    },
+      handleClose() {
+        this.$refs.addFormRef.resetFields();
+        this.entrustVisible = false;
+      },
 
-    submitAdd(){
-      this.$refs.addFormRef.validate(valid => {
-        if (valid) {
-		  this.loading = true
-          addOutsource(this.addForm).then(res=>{
-			  this.loading = false
-               if (res.code=='0') {
-                 this.handleClose()
-                 this.$message.success('委派成功!')
-                 this.$emit('refresh')
-               }
-           })
-		   .catch(e=>{
-			   this.loading = false
-		   })
-        }
-      })
+      submitAdd() {
+        this.$refs.addFormRef.validate((valid) => {
+          if (valid) {
+            this.loading = true;
+            addOutsource(this.addForm)
+              .then((res) => {
+                this.loading = false;
+                if (res.code == '0') {
+                  this.handleClose();
+                  this.$message.success('委派成功!');
+                  this.$emit('refresh');
+                }
+              })
+              .catch((e) => {
+                this.loading = false;
+              });
+          }
+        });
+      }
     }
-
-
-
-
-
-  }
-}
+  };
 </script>
 
 <style lang="scss" scoped>
-.dialog_top {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  margin-bottom: 10px;
-}
-.btns {
-  text-align: right;
-  margin: 10px 0;
-}
+  .dialog_top {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 10px;
+  }
+  .btns {
+    text-align: right;
+    margin: 10px 0;
+  }
 </style>

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

@@ -27,7 +27,7 @@
           </el-link></template
         >
         <!-- 操作列 -->
-        <template v-slot:action="{ row }">
+        <template v-if="" v-slot:action="{ row }">
           <el-link
             type="primary"
             :underline="false"
@@ -42,6 +42,7 @@
             :underline="false"
             icon="el-icon-edit"
             @click="openEdit(row)"
+            v-if="row.status != 5"
           >
             修改
           </el-link>
@@ -49,6 +50,7 @@
             class="ele-action"
             title="确定要撤销此报修记录吗?"
             @confirm="remove(row)"
+            v-if="row.status != 5"
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">