yusheng hace 1 año
padre
commit
3b23f3fe29

+ 8 - 1
src/api/maintenance/repair_report.js

@@ -95,7 +95,14 @@ export async function savePlanRepair(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
-
+// 获取计划详情
+export async function getPlanById(id) {
+  const res = await request.get(`/eam/outsourceworkorder/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 // 获取维修计划列表数据
 export async function getPlanList(data) {
   const res = await request.get('/eam/plan/page', { params: data });

+ 5 - 0
src/styles/index.scss

@@ -3,3 +3,8 @@ $--ele-font-path: '~ele-admin/es/style/fonts';
 @import '~ele-admin/es/style/themes/dynamic.scss';
 @import '~ele-admin/es/style/index.scss';
 @import './transition/index.scss';
+table th .is-required::before{
+    content: "*";
+    color: red;
+    margin-right: 4px;
+} 

+ 5 - 5
src/utils/dict/operationManage.js

@@ -20,11 +20,11 @@ export const repairStatus1 = [
 ];
 // 工单状态
 export const workorderStatus = [
-  { code: 0, label: '待接收' },
-  { code: 1, label: '已接收' },
-  { code: 2, label: '执行中' },
-  { code: 3, label: '待验收' },
-  { code: 4, label: '已验收' }
+  { value: 0, label: '待接收' },
+  { value: 1, label: '已接收' },
+  { value: 2, label: '执行中' },
+  { value: 3, label: '待验收' },
+  { value: 4, label: '已验收' }
 ];
 
 // 执行结果

+ 263 - 247
src/views/home/data.js

@@ -1,4 +1,3 @@
-
 // 引入Day.js库
 // const dayjs = require('dayjs');
 // var quarterOfYear = require('dayjs/plugin/quarterOfYear');
@@ -32,95 +31,92 @@
 //     return dates;
 // }
 function getRandomNumber(type) {
-    let arr=[]
-    let j=type==1?5:type==2?4:12
-    for(let i=0;i<j;i++){
-        arr.push(Math.floor(Math.random() * 60))
-    }
-    return arr
+  let arr = [];
+  let j = type == 1 ? 5 : type == 2 ? 4 : 12;
+  for (let i = 0; i < j; i++) {
+    arr.push(Math.floor(Math.random() * 60));
+  }
+  return arr;
 }
 export const repaireOptions = [
-    {
-        title: '巡点检工单',
-        imgUrl: require('../../assets/vector.png'),
-        total: 0,
-        num: 0
-    },
-    {
-        title: '保养工单',
-        imgUrl: require('../../assets/vector.png'),
-        total: 0,
-        num: 0
-    },
-    {
-        title: '维修工单',
-        imgUrl: require('../../assets/vector.png'),
-        total: 0,
-        num: 0
-    },
-    {
-        title: '校准校验工单',
-        imgUrl: require('../../assets/vector.png'),
-        total: 0,
-        num: 0
-    }
-]
+  {
+    title: '巡点检工单',
+    imgUrl: require('../../assets/vector.png'),
+    total: 0,
+    num: 0
+  },
+  {
+    title: '保养工单',
+    imgUrl: require('../../assets/vector.png'),
+    total: 0,
+    num: 0
+  },
+  {
+    title: '维修工单',
+    imgUrl: require('../../assets/vector.png'),
+    total: 0,
+    num: 0
+  },
+  {
+    title: '校准校验工单',
+    imgUrl: require('../../assets/vector.png'),
+    total: 0,
+    num: 0
+  }
+];
 export const statusList = [
-    {
-        title: '运行',
-        titleUrl: require('../../assets/title3.png'),
-        numUrl: require('../../assets/num3.png'),
-        color: '#07AF2E ',
-        num: 0,
-        code: 'runNumber',
-    },
-    {
-        title: '维修',
-        color: '#9F9F9F',
-        titleUrl: require('../../assets/title1.png'),
-        numUrl: require('../../assets/num1.png'),
-        code: 'repairNumber',
-        num: 0
-    },
-    {
-        title: '故障',
-        color: '#C14E4D ',
-        titleUrl: require('../../assets/title2.png'),
-        numUrl: require('../../assets/num2.png'),
-        code: 'faultNumber',
-        num: 0
-    },
+  {
+    title: '运行',
+    titleUrl: require('../../assets/title3.png'),
+    numUrl: require('../../assets/num3.png'),
+    color: '#07AF2E ',
+    num: 0,
+    code: 'runNumber'
+  },
+  {
+    title: '维修',
+    color: '#9F9F9F',
+    titleUrl: require('../../assets/title1.png'),
+    numUrl: require('../../assets/num1.png'),
+    code: 'repairNumber',
+    num: 0
+  },
+  {
+    title: '故障',
+    color: '#C14E4D ',
+    titleUrl: require('../../assets/title2.png'),
+    numUrl: require('../../assets/num2.png'),
+    code: 'faultNumber',
+    num: 0
+  },
 
-    {
-        title: '停机',
-        color: '#F4C15E',
-        titleUrl: require('../../assets/title4.png'),
-        numUrl: require('../../assets/num4.png'),
-        code: 'shutdownNumber',
-        num: 0
-    }
-]
+  {
+    title: '停机',
+    color: '#F4C15E',
+    titleUrl: require('../../assets/title4.png'),
+    numUrl: require('../../assets/num4.png'),
+    code: 'shutdownNumber',
+    num: 0
+  }
+];
 
 export const rankList = [
+  {
+    label: '排名',
+    prop: 'rank',
+    width: '20%'
+  },
 
-    {
-        label: '排名',
-        prop: 'rank',
-        width: '20%',
-    },
-
-    {
-        prop: 'name',
-        label: '备品备件名称',
-        width: '50%',
-    },
-    {
-        prop: 'num',
-        label: '消耗数量',
-        width: '30%',
-    },
-
-
+  {
+    prop: 'name',
+    label: '备品备件名称',
+    width: '50%'
+  },
+  {
+    prop: 'num',
+    label: '消耗数量',
+    width: '30%'
+  }
 ];
 // export const planList = [
 //     {
@@ -152,180 +148,200 @@ export const rankList = [
 // ];
 
 export const barOption = (data, itemStyle = {}) => {
-    return {
-        tooltip: {
-            formatter: '{b}:{c}' + '个',
-            trigger: 'item'
-        },
-        color: ['#398f4e',],
-        xAxis: {
-            type: 'category',
-            data: data.map(item => item.name),
-            axisLabel: {
-                fontSize: window.innerHeight * 0.012,
+  return {
+    tooltip: {
+      formatter: '{b}:{c}' + '个',
+      trigger: 'item'
+    },
+    color: ['#398f4e'],
+    xAxis: {
+      type: 'category',
+      data: data.map((item) => item.name),
+      axisLabel: {
+        fontSize: window.innerHeight * 0.012
+      }
+    },
+    yAxis: {
+      type: 'value',
+      name: '(个)',
+      nameTextStyle: {
+        align: 'center',
+        color: '#333',
+        fontSize: window.innerHeight * 0.012,
+        padding: [0, 20, -3, 0]
+      }
+    },
+    series: [
+      {
+        // showBackground: true,
+        barWidth: '20%',
+        data: data.map((item) => item.value),
+        type: 'bar',
+        itemStyle
+      }
+    ]
+  };
+};
 
-            }
+export const pieOption = (data) => {
+  return {
+    color: ['#398f4e', '#458ef7', '#fdc537', '#fe6869', '#975fe6'],
+    tooltip: {
+      formatter: '{b}:{c}' + '%',
+      trigger: 'item'
+    },
+    legend: {
+      orient: 'vertical',
+      left: 'right',
+      right: '15%',
+      top: '10%',
+      itemGap: window.innerHeight * 0.014,
 
+      textStyle: {
+        fontSize: window.innerHeight * 0.013
+      }
+    },
+    series: [
+      {
+        center: ['30%', '50%'],
+        label: {
+          position: 'inside',
+          // show: true,
+          formatter: '{c}' + '%',
+          fontSize: window.innerHeight * 0.013,
+          color: '#fff'
         },
-        yAxis: {
-            type: 'value',
-            name: '(个)',
-            nameTextStyle: {
-                align: 'center',
-                color: "#333",
-                fontSize: window.innerHeight * 0.012,
-                padding: [0, 20, -3, 0]
-            },
-        },
-        series: [
-            {
-                // showBackground: true,
-                barWidth: '20%',
-                data: data.map(item => item.value),
-                type: 'bar',
-                itemStyle
-            }
-        ]
-    }
-}
-
-export const pieOption = (data) => {
-    return {
-        color: ['#398f4e', '#458ef7', '#fdc537', '#fe6869', '#975fe6'],
-        tooltip: {
-            formatter: '{b}:{c}' + '%',
-            trigger: 'item'
+        labelLine: {
+          show: false
         },
-        legend: {
-            orient: 'vertical',
-            // left: 'center',
-            right: '15%',
-            top: '10%',
-            itemGap: window.innerHeight * 0.014,
-
-            textStyle: {
-                fontSize: window.innerHeight * 0.013,
-            }
+        type: 'pie',
+        radius: '85%',
+        itemStyle: {
+          borderWidth: 0,
+          shadowBlur: 10,
+          shadowColor: 'rgba(0, 0, 0, 0.5)'
         },
-        series: [
-            {
-                center: ['30%', '50%'],
-                label: {
-                    position: 'inside',
-                    // show: true,
-                    formatter: '{c}' + '%',
-                    fontSize: window.innerHeight * 0.013,
-                    color: "#fff"
-                },
-                labelLine: {
-                    show: false
-                },
-                type: 'pie',
-                radius: '85%',
-                itemStyle: {
-                    borderWidth: 0,
-                    shadowBlur: 10,
-                    shadowColor: 'rgba(0, 0, 0, 0.5)'
-                },
-                data
-            }
-        ]
-    }
-}
+        data
+      }
+    ]
+  };
+};
 export const pieOption1 = (data) => {
-    return {
-        // color: ['#398f4e', '#458ef7', '#fdc537', '#fe6869', '#975fe6'],
-        tooltip: {
-            formatter: '{b}:{c}' + '%',
-            trigger: 'item'
+  return {
+    // color: ['#398f4e', '#458ef7', '#fdc537', '#fe6869', '#975fe6'],
+    tooltip: {
+      formatter: '{b}:{c}' + '%',
+      trigger: 'item'
+    },
+    legend: {
+      orient: 'horizontal',
+      left: 'center',
+      // right: '15%',
+      bottom: '5%',
+      itemGap: window.innerHeight * 0.014,
+      textStyle: {
+        fontSize: window.innerHeight * 0.013
+      }
+    },
+    series: [
+      {
+        center: ['50%', '45%'],
+        label: {
+          position: 'outside',
+          show: true,
+          formatter: (item) => {
+            return item.name + ':' + item.value + '%';
+          },
+          fontSize: window.innerHeight * 0.0125,
+          color: '#333'
         },
-        legend: {
-            orient: 'horizontal',
-            left: 'right',
-            right: '15%',
-            bottom: '5%',
-            itemGap: window.innerHeight * 0.014,
-            textStyle: {
-                fontSize: window.innerHeight * 0.013,
-            }
+        labelLine: {
+          show: true
         },
-        series: [
-            {
-                center: ['62%', '45%'],
-                label: {
-                    position: 'outside',
-                    show: true,
-                    formatter: (item) => {
-                        return item.name + ":" + item.value + '%'
-                    },
-                    fontSize: window.innerHeight * 0.0125,
-                    color: "#333"
-                },
-                labelLine: {
-                    show: true
-                },
-                type: 'pie',
-                radius: ['39%', '55%'],
-                itemStyle: {
-                    borderWidth: 0,
-                    shadowBlur: 10,
-                    shadowColor: 'rgba(0, 0, 0, 0.5)'
-                },
-                data
-            }
-        ]
-    }
-}
-
-export const lineOption = (type) => {
-    return {
-
-        tooltip: {
-            formatter: (item) => {
-                return item.name + ' ' + item.seriesName + ":" + item.value + '万元'
-            },
-            trigger: 'item'
+        type: 'pie',
+        radius: ['50%', '65%'],
+        itemStyle: {
+          borderWidth: 0,
+          shadowBlur: 10,
+          shadowColor: 'rgba(0, 0, 0, 0.5)'
         },
-        legend: {
-            // bottom: '2%',
-            itemGap: window.innerHeight * 0.014,
+        data
+      }
+    ]
+  };
+};
 
-            textStyle: {
-                fontSize: window.innerHeight * 0.013,
-            }
-        },
+export const lineOption = (type) => {
+  return {
+    tooltip: {
+      formatter: (item) => {
+        return item.name + ' ' + item.seriesName + ':' + item.value + '万元';
+      },
+      trigger: 'item'
+    },
+    legend: {
+      // bottom: '2%',
+      itemGap: window.innerHeight * 0.014,
 
-        xAxis: {
-            type: 'category',
+      textStyle: {
+        fontSize: window.innerHeight * 0.013
+      }
+    },
 
-            axisLabel: {
-                fontSize: window.innerHeight * 0.012,
+    xAxis: {
+      type: 'category',
 
-            },
-            data: type == 1 ? [2020, 2021, 2022, 2023, 2024] : type == 2 ? ['1季度','2季度','3季度','4季度',] : ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月',]
-        },
-        yAxis: {
-            type: 'value'
-        },
-        series: [
-            {
-                name: '班组一',
-                data: getRandomNumber(type),
-                type: 'line',
-                smooth: true,
-            }, {
-                name: '班组二',
-                data: getRandomNumber(type),
-                type: 'line', smooth: true,
-            }, {
-                name: '班组三',
-                data: getRandomNumber(type),
-                type: 'line', smooth: true,
-            }, {
-                name: '班组四',
-                data: getRandomNumber(type),
-                type: 'line', smooth: true,
-            }
-        ]
-    }
-}
+      axisLabel: {
+        fontSize: window.innerHeight * 0.012
+      },
+      data:
+        type == 1
+          ? [2020, 2021, 2022, 2023, 2024]
+          : type == 2
+          ? ['1季度', '2季度', '3季度', '4季度']
+          : [
+              '1月',
+              '2月',
+              '3月',
+              '4月',
+              '5月',
+              '6月',
+              '7月',
+              '8月',
+              '9月',
+              '10月',
+              '11月',
+              '12月'
+            ]
+    },
+    yAxis: {
+      type: 'value'
+    },
+    series: [
+      {
+        name: '班组一',
+        data: getRandomNumber(type),
+        type: 'line',
+        smooth: true
+      },
+      {
+        name: '班组二',
+        data: getRandomNumber(type),
+        type: 'line',
+        smooth: true
+      },
+      {
+        name: '班组三',
+        data: getRandomNumber(type),
+        type: 'line',
+        smooth: true
+      },
+      {
+        name: '班组四',
+        data: getRandomNumber(type),
+        type: 'line',
+        smooth: true
+      }
+    ]
+  };
+};

+ 14 - 17
src/views/home/index.vue

@@ -87,14 +87,14 @@
         <div class="char" style="height: 40%; margin: 0">
           <el-card
             class="box-card"
-            style="height: 100%; width: 63%; position: relative"
+            style="height: 100%;width: 100%;  position: relative"
           >
             <div slot="header" class="clearfix">
               <span>备品备件</span>
             </div>
             <div class="sparePart">
               <span>消耗总量 68</span>
-              <span
+              <!-- <span
                 >环比-17%
                 <i
                   class="el-icon-caret-bottom"
@@ -102,7 +102,7 @@
                 ></i
               ></span>
               <span>同比 - </span>
-              <span style="margin-top: 25px">消耗种类 20 </span>
+              <span style="margin-top: 25px">消耗种类 20 </span> -->
             </div>
             <v-chart
               ref="pieRef1"
@@ -111,7 +111,7 @@
             />
           </el-card>
 
-          <el-card
+          <!-- <el-card
             class="box-card"
             style="height: 100%; width: calc(37% - 15px)"
           >
@@ -165,13 +165,13 @@
                 </vue-seamless-scroll>
               </div>
             </div>
-          </el-card>
+          </el-card> -->
         </div>
 
         <el-card class="box-card" style="height: 60%; margin-top: 15px">
           <div slot="header" class="clearfix">
-            <span>班组维修消耗费用趋势(万元)</span>
-            <el-radio-group
+            <span>班组维修消耗趋势</span>
+            <!-- <el-radio-group
               style="margin-left: 15px"
               v-model="timeType"
               @change="timeTypeChange()"
@@ -179,7 +179,7 @@
               <el-radio-button label="3">月度</el-radio-button>
               <el-radio-button label="2">季度</el-radio-button>
               <el-radio-button label="1">年度</el-radio-button>
-            </el-radio-group>
+            </el-radio-group> -->
           </div>
           <v-chart ref="lineRef" style="height: 100%" :option="lineOption" />
         </el-card>
@@ -488,15 +488,12 @@ export default {
     },
     async queryDevice() {
       const data = await queryDevice();
-      this.barEquipmentFailureOption = barOption([
-        { name: '轴承', value: '45' },
-        { name: '升降机', value: '25' },
-        { name: '冲压杆', value: '18' },
-        { name: '冷却水管', value: '36' },
-        { name: '液压机', value: '21' },
-        { name: '电机', value: '42' },
-        { name: '水泵机', value: '38' }
-      ]);
+      this.barEquipmentFailureOption = barOption(data.map(item=>{
+        return {
+          name:item.deviceName,
+          value:item.qualifiedNumber
+        }
+      }));
       console.log(data);
     },
     queryRunStatus() {

+ 9 - 3
src/views/ledgerAssets/boat/components/boat-list.vue

@@ -177,10 +177,16 @@
             minWidth: 80
           },
           {
-            prop: 'chargePerson',
-            label: '负责人',
+            prop: 'areaPersonInChargeUserName',
+            label: '片区负责人',
             showOverflowTooltip: true,
-            minWidth: 80
+            minWidth: 150
+          },
+          {
+            prop: 'repairUserName',
+            label: '维修人',
+            showOverflowTooltip: true,
+            minWidth: 150
           },
           {
             prop: 'endTime',

+ 10 - 2
src/views/ledgerAssets/boat/edit.vue

@@ -53,7 +53,7 @@
               <el-form-item label="物联ID">{{ iotId }}</el-form-item>
             </el-col>
           </el-row>
-          <div class="basic-details-title border-none">
+          <!-- <div class="basic-details-title border-none">
             <span class="border-span">扩展信息</span>
           </div>
           <div class="kzzd">
@@ -105,7 +105,7 @@
                 </el-form-item>
               </el-col>
             </el-row>
-          </div>
+          </div> -->
         </div>
       </el-form>
       <DialogGoods
@@ -347,6 +347,14 @@
         }
         this.$refs.form.validate(async (valid) => {
           if (valid) {
+            if(!this.form.areaPersonInChargeGroupId){
+              this.$message.error('请选片区负责人部门');
+              return
+             }
+             if(!this.form.areaPersonInChargeUserId){
+              this.$message.error('请选片区负责人');
+              return
+             }
             let par = {
               //基本信息
               ...this.form,

+ 8 - 4
src/views/ledgerAssets/components/businessInformation.vue

@@ -49,7 +49,9 @@
           </el-descriptions-item>
 
           <el-descriptions-item>
-            <template slot="label"> 片区负责人部门 </template>
+            <template slot="label">
+              <span class="is-required">片区负责人部门</span>
+            </template>
             <el-form-item label-width="0">
               <div class="input">
                 <DeptSelect
@@ -60,7 +62,9 @@
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item>
-            <template slot="label"> 片区负责人 </template>
+            <template slot="label">
+              <span class="is-required">片区负责人</span>
+            </template>
             <el-form-item label-width="0">
               <el-select
                 style="width: 100%"
@@ -79,7 +83,7 @@
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item>
-            <template slot="label"> 片区负责人电话 </template>
+            <template slot="label">片区负责人电话 </template>
             <el-form-item label-width="0">
               <el-input
                 v-model="ywInfo.areaPersonInChargePhone"
@@ -108,7 +112,7 @@
                 placeholder="请选择"
               >
                 <el-option
-                  v-for="item in options.repairUserId"
+                  v-for="item in options.repairUserId1"
                   :key="item.id"
                   :label="item.name"
                   @click.native="repairUserIdChange(item, 2)"

+ 1 - 1
src/views/ledgerAssets/components/details/malfunction.vue

@@ -191,7 +191,7 @@ export default {
           showOverflowTooltip: true,
           formatter: (row) => {
             return workorderStatus.filter(
-              (item) => item.code == row.orderStatus
+              (item) => item.value == row.orderStatus
             )[0].label;
           }
         },

+ 9 - 3
src/views/ledgerAssets/equipment/components/equipment-list.vue

@@ -235,10 +235,16 @@
             minWidth: 80
           },
           {
-            prop: 'chargePerson',
-            label: '负责人',
+            prop: 'areaPersonInChargeUserName',
+            label: '片区负责人',
             showOverflowTooltip: true,
-            minWidth: 80
+            minWidth: 150
+          },
+          {
+            prop: 'repairUserName',
+            label: '维修人',
+            showOverflowTooltip: true,
+            minWidth: 150
           },
           {
             prop: 'endTime',

+ 413 - 405
src/views/ledgerAssets/equipment/edit.vue

@@ -26,7 +26,7 @@
           <basicInfoVue ref="basicInfoVueRef" />
           <!-- 设备标签 -->
           <equipmentTag :form="form" ref="equipmentTagRef" />
-          
+
           <businessInformation ref="businessInformationRef" :form="form" />
           <assetInformation ref="assetInformationRef" :form="form" />
           <!-- <warehouseConfigVue ref="warehouseConfigRef" class="ims" /> -->
@@ -120,412 +120,420 @@
 </template>
 
 <script>
-  import warehouseConfigVue from '../components/warehouseConfig.vue';
-  import productInfoVue from '../components/productInfo.vue';
-  import planVue from '../components/plan.vue';
-  import qualityConfig from '../components/qualityConfig.vue';
-  import footerVue from '../components/footer.vue';
-  import documentInformation from '../components/documentInformation.vue';
-  import equipmentTag from '../components/equipmentTag.vue';
-  import basicInfoVue from '../components/basicInfo.vue';
-  import DialogGoods from '../components/DialogGoods';
-  import assetInformation from '../components/assetInformation.vue';
-  import businessInformation from '../components/businessInformation.vue';
-  import { getDetails } from '@/api/classifyManage/itemInformation';
-  import {
-    saveOrEdit,
-    getAssetInfo,
-    getCode,
-    getAssetNum
-  } from '@/api/ledgerAssets';
-  const equipmentLabelJson = [
-    {
-      LJSB: '2', //老旧设备
-      SHSB: '2', //涉火设备
-      SHLJSB: '2', //涉火老旧设备
-      GZSB: '2', //关重设备
-      GJSB: '2', //关键设备
-      TZSB: '2', //特种设备
-      HBSB: '2', //环保设备
-      ZYSCSB: '2', //主要生产设备
-      FZSCSB: '2', //辅助生产设备
-      KYSB: '2', //科研设备
-      SBFL: '2', //设备封炉
-    }
-  ];
-  export default {
-    components: {
-      warehouseConfigVue,
-      productInfoVue,
-      planVue,
-      qualityConfig,
-      footerVue,
-      documentInformation,
-      DialogGoods,
-      assetInformation,
-      businessInformation,
-      basicInfoVue,
-      equipmentTag
-    },
-    props: {
-      showTitle: {
-        type: Boolean,
-        default: true
-      }
-    },
-    data() {
-      return {
-        labelStyle: {
-          width: '200px'
-        },
-        contentStyle: {
-          width: '400px'
-        },
-        isLink: true,
-        title: '新建设备信息',
-        pageType: 'add',
-        btnLoading: false,
-        // 设备主键id
-        id: '',
-        form: {
-          extInfoSelf: [],
-          // 基本信息
-          code: '',
-          name: '',
-          productTime: '',
-          workstation: '',
-          equipmentLabelJson
-        },
-        rules: {
-          name: [
-            { required: true, message: '请输入设备名称', trigger: 'blur' }
-          ],
-          code: [{ required: true, message: '请输入设备编码', trigger: 'blur' }]
-        },
-        // 基本信息
-        basicInfo: {},
-        positionInfo: {
-          // 详细地址
-          deviceDetailAddress: '',
-          // 请选择产线
-          lineCode: '',
-          lineName: '',
-          // 请选择车间
-          workshopCode: '',
-          workshopName: '',
-          // 请选择工厂
-          factoryCode: '',
-          factoryName: ''
-        },
-        // 图片
-        imageUrl: null,
-        // 文档信息
-        attUrl: {
-          operatingManual: {
-            value: [],
-            sort: 1
-          },
-          productionLicence: {
-            value: [],
-            sort: 2
-          },
-          explosionProofCertificate: {
-            value: [],
-            sort: 3
-          },
-          surveyReport: {
-            value: [],
-            sort: 4
-          },
-          inspectionCycleManual: {
-            value: [],
-            sort: 5
-          },
-          informationDrawing: {
-            value: [],
-            sort: 6
-          },
-          productCertificate: {
-            value: [],
-            sort: 7
-          }
-        },
-        // 是否开始物联
-        isIotEnable: '1',
-        // 物联ID
-        iotId: '',
-        // 回显过保时间
-        cbexpirationTime: '',
-        // 生命周期
-        sourceDICT: '',
-        // 网络状态
-        networkStatus: '',
-        id: ''
-      };
-    },
-    watch: {},
-    computed: {
-      // 过保时间
-      expirationTime() {
-        if (this.form.productTime && this.basicInfo.expirationDate) {
-          return this.setGbTime(
-            this.form.productTime,
-            this.basicInfo.expirationDate,
-            this.basicInfo.expirationDateUnit
-          );
-        } else {
-          return '';
-        }
-      }
-    },
-    async created() {
-      if (this.$route.query.id) {
-        this.pageType = 'edit';
-        this.id = this.$route.query.id;
-        await this.getInfo();
-        this.title = '编辑设备信息';
-        // this.getgys();
-        // await this._getWarehouseChildren();
-      } else {
-        this.pageType = 'add';
-        this.title = '新增设备信息';
-      }
-    },
-    methods: {
-      handlwpbm() {
-        this.$refs.DialogGoods.open('0', true);
-      },
-      async cbDialogGoods(data) {
-        let res = await getDetails(data.id);
-        if (!data.extInfoSelf) {
-          data.extInfoSelf = [];
-        }
-        // if (!data.workstation) {
-        //   data.workstation = {};
-        // }
-        if (!data.isPublic) {
-          data.isPublic = 0;
-        }
-        this.form = Object.assign({}, this.form, data);
-        console.log(this.form);
+   import warehouseConfigVue from '../components/warehouseConfig.vue';
+   import productInfoVue from '../components/productInfo.vue';
+   import planVue from '../components/plan.vue';
+   import qualityConfig from '../components/qualityConfig.vue';
+   import footerVue from '../components/footer.vue';
+   import documentInformation from '../components/documentInformation.vue';
+   import equipmentTag from '../components/equipmentTag.vue';
+   import basicInfoVue from '../components/basicInfo.vue';
+   import DialogGoods from '../components/DialogGoods';
+   import assetInformation from '../components/assetInformation.vue';
+   import businessInformation from '../components/businessInformation.vue';
+   import { getDetails } from '@/api/classifyManage/itemInformation';
+   import {
+     saveOrEdit,
+     getAssetInfo,
+     getCode,
+     getAssetNum
+   } from '@/api/ledgerAssets';
+   const equipmentLabelJson = [
+     {
+       LJSB: '2', //老旧设备
+       SHSB: '2', //涉火设备
+       SHLJSB: '2', //涉火老旧设备
+       GZSB: '2', //关重设备
+       GJSB: '2', //关键设备
+       TZSB: '2', //特种设备
+       HBSB: '2', //环保设备
+       ZYSCSB: '2', //主要生产设备
+       FZSCSB: '2', //辅助生产设备
+       KYSB: '2', //科研设备
+       SBFL: '2', //设备封炉
+     }
+   ];
+   export default {
+     components: {
+       warehouseConfigVue,
+       productInfoVue,
+       planVue,
+       qualityConfig,
+       footerVue,
+       documentInformation,
+       DialogGoods,
+       assetInformation,
+       businessInformation,
+       basicInfoVue,
+       equipmentTag
+     },
+     props: {
+       showTitle: {
+         type: Boolean,
+         default: true
+       }
+     },
+     data() {
+       return {
+         labelStyle: {
+           width: '200px'
+         },
+         contentStyle: {
+           width: '400px'
+         },
+         isLink: true,
+         title: '新建设备信息',
+         pageType: 'add',
+         btnLoading: false,
+         // 设备主键id
+         id: '',
+         form: {
+           extInfoSelf: [],
+           // 基本信息
+           code: '',
+           name: '',
+           productTime: '',
+           workstation: '',
+           equipmentLabelJson
+         },
+         rules: {
+           name: [
+             { required: true, message: '请输入设备名称', trigger: 'blur' }
+           ],
+           code: [{ required: true, message: '请输入设备编码', trigger: 'blur' }]
+         },
+         // 基本信息
+         basicInfo: {},
+         positionInfo: {
+           // 详细地址
+           deviceDetailAddress: '',
+           // 请选择产线
+           lineCode: '',
+           lineName: '',
+           // 请选择车间
+           workshopCode: '',
+           workshopName: '',
+           // 请选择工厂
+           factoryCode: '',
+           factoryName: ''
+         },
+         // 图片
+         imageUrl: null,
+         // 文档信息
+         attUrl: {
+           operatingManual: {
+             value: [],
+             sort: 1
+           },
+           productionLicence: {
+             value: [],
+             sort: 2
+           },
+           explosionProofCertificate: {
+             value: [],
+             sort: 3
+           },
+           surveyReport: {
+             value: [],
+             sort: 4
+           },
+           inspectionCycleManual: {
+             value: [],
+             sort: 5
+           },
+           informationDrawing: {
+             value: [],
+             sort: 6
+           },
+           productCertificate: {
+             value: [],
+             sort: 7
+           }
+         },
+         // 是否开始物联
+         isIotEnable: '1',
+         // 物联ID
+         iotId: '',
+         // 回显过保时间
+         cbexpirationTime: '',
+         // 生命周期
+         sourceDICT: '',
+         // 网络状态
+         networkStatus: '',
+         id: ''
+       };
+     },
+     watch: {},
+     computed: {
+       // 过保时间
+       expirationTime() {
+         if (this.form.productTime && this.basicInfo.expirationDate) {
+           return this.setGbTime(
+             this.form.productTime,
+             this.basicInfo.expirationDate,
+             this.basicInfo.expirationDateUnit
+           );
+         } else {
+           return '';
+         }
+       }
+     },
+     async created() {
+       if (this.$route.query.id) {
+         this.pageType = 'edit';
+         this.id = this.$route.query.id;
+         await this.getInfo();
+         this.title = '编辑设备信息';
+         // this.getgys();
+         // await this._getWarehouseChildren();
+       } else {
+         this.pageType = 'add';
+         this.title = '新增设备信息';
+       }
+     },
+     methods: {
+       handlwpbm() {
+         this.$refs.DialogGoods.open('0', true);
+       },
+       async cbDialogGoods(data) {
+         let res = await getDetails(data.id);
+         if (!data.extInfoSelf) {
+           data.extInfoSelf = [];
+         }
+         // if (!data.workstation) {
+         //   data.workstation = {};
+         // }
+         if (!data.isPublic) {
+           data.isPublic = 0;
+         }
+         this.form = Object.assign({}, this.form, data);
+         console.log(this.form);
 
-        this.form.category = res;
-        this.basicInfo = data;
-        console.log(data, 'data');
-        this.form.rootCategoryLevelId =
-          this.basicInfo.categoryLevelPathIdParent;
-        this.form.categoryId = this.basicInfo.id;
-        this.form.name = this.basicInfo.name;
-        this.form.code = data.code; //Date.now(); //res.data[0].onlyCode;
-        this.initOtherMsg();
-      },
-      // 计算过保时间
-      setGbTime(basic, value, type) {
-        basic = Date.parse(basic);
-        let time;
-        switch (type) {
-          case 'minute':
-            time = value * 1000 * 60;
-            break;
-          case 'hour':
-            time = value * 1000 * 60 * 60;
-            break;
-          case 'day':
-            time = value * 1000 * 60 * 60 * 24;
-            break;
-          case 'month':
-            time = value * 1000 * 60 * 60 * 24 * 30;
-            break;
-          case 'year':
-            time = value * 1000 * 60 * 60 * 24 * 365;
-            break;
-          default:
-            break;
-        }
+         this.form.category = res;
+         this.basicInfo = data;
+         console.log(data, 'data');
+         this.form.rootCategoryLevelId =
+           this.basicInfo.categoryLevelPathIdParent;
+         this.form.categoryId = this.basicInfo.id;
+         this.form.name = this.basicInfo.name;
+         this.form.code = data.code; //Date.now(); //res.data[0].onlyCode;
+         this.initOtherMsg();
+       },
+       // 计算过保时间
+       setGbTime(basic, value, type) {
+         basic = Date.parse(basic);
+         let time;
+         switch (type) {
+           case 'minute':
+             time = value * 1000 * 60;
+             break;
+           case 'hour':
+             time = value * 1000 * 60 * 60;
+             break;
+           case 'day':
+             time = value * 1000 * 60 * 60 * 24;
+             break;
+           case 'month':
+             time = value * 1000 * 60 * 60 * 24 * 30;
+             break;
+           case 'year':
+             time = value * 1000 * 60 * 60 * 24 * 365;
+             break;
+           default:
+             break;
+         }
 
-        let num = basic + time;
-        return parseTime(num);
-      },
-      // 添加自定义参数
-      addItem() {
-        if (this.form.extInfoSelf.length < 10) {
-          let item = { key: '', value: '' };
-          this.form.extInfoSelf.push(item);
-        } else {
-          this.$message.warning('自定义参数最多添加10条');
-        }
-      },
-      // 删除自定义参数
-      delt(item, index) {
-        this.form.extInfoSelf.splice(index, 1);
-      },
-      // 提交
-      submit() {
-        if (JSON.stringify(this.basicInfo) === '{}' && this.pageType == 'add') {
-          return this.$message.error('请选择物品');
-        }
-        this.$refs.form.validate(async (valid) => {
-          if (valid) {
-            let par = {
-              //基本信息
-              ...this.form,
-              assetType: 1,
-              // 资产信息
-              positionIds: '1,1,1,1',
-              position: {
-                detailPosition: this.positionInfo.deviceDetailAddress,
-                pathIds: `${
-                  this.positionInfo.factoryCode
-                    ? this.positionInfo.factoryCode + ','
-                    : ''
-                }${
-                  this.positionInfo.workshopCode
-                    ? this.positionInfo.workshopCode + ','
-                    : ''
-                }${this.positionInfo.lineCode}`,
-                pathName: `${
-                  this.positionInfo.factoryName
-                    ? this.positionInfo.factoryName + ','
-                    : ''
-                }${
-                  this.positionInfo.workshopName
-                    ? this.positionInfo.workshopName + ','
-                    : ''
-                }${this.positionInfo.lineName}`,
-                type: '1',
-                num: 1
-              },
-              // 文档信息
-              attUrl: this.setWd() || [],
-              // 设备图片
-              imageUrl: this.imageUrl || {},
-              // 是否启用物联
-              isIotEnable: this.isIotEnable
-              // 扩展字段
-              // extInfoSelf: this.setKz()
-            };
-            par.deviceLocationName = par.location
-              ? par.location.toString()
-              : '';
-            // par.extInfo = { ...this.form };
-            let obj = {};
-            par.extInfoSelf.forEach((item) => {
-              obj[item.key] = item.value;
-            });
-            // console.log('sasasasa', par);
-            // return;
-            par.extInfoSelf = obj;
-            if (this.pageType == 'edit') {
-              par.id = this.id;
-            } else {
-              // const batchNo = await getCode('lot_number_code');
-              // const res = await getAssetNum({
-              //   assetCode: par.code,
-              //   batchNum: batchNo,
-              //   num: 1
-              // });
-              // console.log(res);
-              // par.code = res.data.shift().onlyCode;
-              par.id = '';
-            }
-            this.btnLoading = true;
-            saveOrEdit(par)
-              .then((res) => {
-                this.$message.success('操作成功');
-                this.$router.go(-1);
-              })
-              .finally(() => {
-                this.btnLoading = false;
-              });
-          } else {
-            console.log('error submit!!');
-            return false;
-          }
-        });
-      },
-      // 处理扩展字段
-      setKz() {
-        return this.form.extInfoSelf || [];
-      },
-      // 处理文档信息
-      setWd() {
-        console.log(this.attUrl);
-        return Object.values(this.attUrl).map((item) => ({
-          value: item.value || [],
-          sort: item.sort
-        }));
-      },
-      // 获取设备详情
-      async getInfo() {
-        const data = await getAssetInfo(this.id);
-        // 扩展字段
-        data.extInfoSelf = data.extInfoSelf || [];
-        // 权属人相关信息
-        // if (!data.workstation) {
-        //   data.workstation = {};
-        // }
-        // 资产信息类型默认专用
-        if (!data.isPublic) {
-          data.isPublic = 0;
-        }
-        this.form = Object.assign({}, this.form, data);
-        console.log(this.form, 'dsadasdform');
-        this.form.lifeCycle = this.form.lifeCycle + '';
-        this.form.location = data.deviceLocationName.split(',');
-        this.basicInfo = data;
-        this.cbexpirationTime = data.expirationTime;
-        this.sourceDICT = data.sourceDICT;
-        this.networkStatus = data.networkStatus;
-        this.positionInfo.deviceDetailAddress = data.deviceDetailAddress;
-        if (this.form.equipmentLabelJson.length == 0) {
-          this.form.equipmentLabelJson = equipmentLabelJson;
-        }
-        this.initOtherMsg();
-        // 设备图片
-        this.imageUrl = data.imageUrl;
-        // 物联参数
-        this.isIotEnable = data.isIotEnable;
-        this.iotId = data.iotId;
-      },
-      async initOtherMsg() {
-        // 基本信息
-        this.$refs.basicInfoVueRef.getDetailInfoAugr(
-          this.form.category.category
-        );
-        // 仓储配置
-        // this.$refs.warehouseConfigRef.getDetailInfoAugr(
-        //   this.form.category.categoryWms
-        // );
-        // 生产信息
-        // this.$refs.productInfoRef.getDetailInfoAugr(
-        //   this.form.category.categoryMes
-        // );
-        // 计划配置
-        // this.$refs.planRef.getDetailInfoAugr(this.form.category.categoryAps);
-        // 质量配置
-        // this.$refs.qualityConfigRef.getDetailInfoAugr(
-        //   this.form.category.categoryQms
-        // );
-        // 其他和关联信息
-        // this.$refs.footerVueRef.getDetailInfoAugr(this.form.category.category);
-        // 文档信息
-        if (this.form.attUrl && this.form.attUrl.length > 0) {
-          Object.keys(this.attUrl).forEach((n, index) => {
-            this.attUrl[n].value = this.form.attUrl[index].value || [];
-          });
-          this.$refs.documentInformationRef.getDetailInfoAugr(this.attUrl);
-        }
-      },
-      // 设置标准产能
-      setbzcn(val) {
-        if (!val) {
-          return '';
-        }
-        let item = JSON.parse(val);
-        return item.standardCapacity || '';
-      }
-    }
-  };
+         let num = basic + time;
+         return parseTime(num);
+       },
+       // 添加自定义参数
+       addItem() {
+         if (this.form.extInfoSelf.length < 10) {
+           let item = { key: '', value: '' };
+           this.form.extInfoSelf.push(item);
+         } else {
+           this.$message.warning('自定义参数最多添加10条');
+         }
+       },
+       // 删除自定义参数
+       delt(item, index) {
+         this.form.extInfoSelf.splice(index, 1);
+       },
+       // 提交
+       submit() {
+         if (JSON.stringify(this.basicInfo) === '{}' && this.pageType == 'add') {
+           return this.$message.error('请选择物品');
+         }
+         this.$refs.form.validate(async (valid) => {
+           if (valid) {
+             if(!this.form.areaPersonInChargeGroupId){
+              this.$message.error('请选片区负责人部门');
+              return
+             }
+             if(!this.form.areaPersonInChargeUserId){
+              this.$message.error('请选片区负责人');
+              return
+             }
+             let par = {
+               //基本信息
+               ...this.form,
+               assetType: 1,
+               // 资产信息
+               positionIds: '1,1,1,1',
+               position: {
+                 detailPosition: this.positionInfo.deviceDetailAddress,
+                 pathIds: `${
+                   this.positionInfo.factoryCode
+                     ? this.positionInfo.factoryCode + ','
+                     : ''
+                 }${
+                   this.positionInfo.workshopCode
+                     ? this.positionInfo.workshopCode + ','
+                     : ''
+                 }${this.positionInfo.lineCode}`,
+                 pathName: `${
+                   this.positionInfo.factoryName
+                     ? this.positionInfo.factoryName + ','
+                     : ''
+                 }${
+                   this.positionInfo.workshopName
+                     ? this.positionInfo.workshopName + ','
+                     : ''
+                 }${this.positionInfo.lineName}`,
+                 type: '1',
+                 num: 1
+               },
+               // 文档信息
+               attUrl: this.setWd() || [],
+               // 设备图片
+               imageUrl: this.imageUrl || {},
+               // 是否启用物联
+               isIotEnable: this.isIotEnable
+               // 扩展字段
+               // extInfoSelf: this.setKz()
+             };
+             par.deviceLocationName = par.location
+               ? par.location.toString()
+               : '';
+             // par.extInfo = { ...this.form };
+             let obj = {};
+             par.extInfoSelf.forEach((item) => {
+               obj[item.key] = item.value;
+             });
+             // console.log('sasasasa', par);
+             // return;
+             par.extInfoSelf = obj;
+             if (this.pageType == 'edit') {
+               par.id = this.id;
+             } else {
+               // const batchNo = await getCode('lot_number_code');
+               // const res = await getAssetNum({
+               //   assetCode: par.code,
+               //   batchNum: batchNo,
+               //   num: 1
+               // });
+               // console.log(res);
+               // par.code = res.data.shift().onlyCode;
+               par.id = '';
+             }
+             this.btnLoading = true;
+             saveOrEdit(par)
+               .then((res) => {
+                 this.$message.success('操作成功');
+                 this.$router.go(-1);
+               })
+               .finally(() => {
+                 this.btnLoading = false;
+               });
+           } else {
+             console.log('error submit!!');
+             return false;
+           }
+         });
+       },
+       // 处理扩展字段
+       setKz() {
+         return this.form.extInfoSelf || [];
+       },
+       // 处理文档信息
+       setWd() {
+         console.log(this.attUrl);
+         return Object.values(this.attUrl).map((item) => ({
+           value: item.value || [],
+           sort: item.sort
+         }));
+       },
+       // 获取设备详情
+       async getInfo() {
+         const data = await getAssetInfo(this.id);
+         // 扩展字段
+         data.extInfoSelf = data.extInfoSelf || [];
+         // 权属人相关信息
+         // if (!data.workstation) {
+         //   data.workstation = {};
+         // }
+         // 资产信息类型默认专用
+         if (!data.isPublic) {
+           data.isPublic = 0;
+         }
+         this.form = Object.assign({}, this.form, data);
+         console.log(this.form, 'dsadasdform');
+         this.form.lifeCycle = this.form.lifeCycle + '';
+         this.form.location = data.deviceLocationName.split(',');
+         this.basicInfo = data;
+         this.cbexpirationTime = data.expirationTime;
+         this.sourceDICT = data.sourceDICT;
+         this.networkStatus = data.networkStatus;
+         this.positionInfo.deviceDetailAddress = data.deviceDetailAddress;
+         if (this.form.equipmentLabelJson.length == 0) {
+           this.form.equipmentLabelJson = equipmentLabelJson;
+         }
+         this.initOtherMsg();
+         // 设备图片
+         this.imageUrl = data.imageUrl;
+         // 物联参数
+         this.isIotEnable = data.isIotEnable;
+         this.iotId = data.iotId;
+       },
+       async initOtherMsg() {
+         // 基本信息
+         this.$refs.basicInfoVueRef.getDetailInfoAugr(
+           this.form.category.category
+         );
+         // 仓储配置
+         // this.$refs.warehouseConfigRef.getDetailInfoAugr(
+         //   this.form.category.categoryWms
+         // );
+         // 生产信息
+         // this.$refs.productInfoRef.getDetailInfoAugr(
+         //   this.form.category.categoryMes
+         // );
+         // 计划配置
+         // this.$refs.planRef.getDetailInfoAugr(this.form.category.categoryAps);
+         // 质量配置
+         // this.$refs.qualityConfigRef.getDetailInfoAugr(
+         //   this.form.category.categoryQms
+         // );
+         // 其他和关联信息
+         // this.$refs.footerVueRef.getDetailInfoAugr(this.form.category.category);
+         // 文档信息
+         if (this.form.attUrl && this.form.attUrl.length > 0) {
+           Object.keys(this.attUrl).forEach((n, index) => {
+             this.attUrl[n].value = this.form.attUrl[index].value || [];
+           });
+           this.$refs.documentInformationRef.getDetailInfoAugr(this.attUrl);
+         }
+       },
+       // 设置标准产能
+       setbzcn(val) {
+         if (!val) {
+           return '';
+         }
+         let item = JSON.parse(val);
+         return item.standardCapacity || '';
+       }
+     }
+   };
 </script>
 
 <style lang="scss" scoped>

+ 9 - 3
src/views/ledgerAssets/meter/components/equipment-list.vue

@@ -221,10 +221,16 @@
             minWidth: 80
           },
           {
-            prop: 'chargePerson',
-            label: '负责人',
+            prop: 'areaPersonInChargeUserName',
+            label: '片区负责人',
             showOverflowTooltip: true,
-            minWidth: 80
+            minWidth: 150
+          },
+          {
+            prop: 'repairUserName',
+            label: '维修人',
+            showOverflowTooltip: true,
+            minWidth: 150
           },
           {
             prop: 'endTime',

+ 8 - 0
src/views/ledgerAssets/meter/edit.vue

@@ -350,6 +350,14 @@
         }
         this.$refs.form.validate(async (valid) => {
           if (valid) {
+            if(!this.form.areaPersonInChargeGroupId){
+              this.$message.error('请选片区负责人部门');
+              return
+             }
+             if(!this.form.areaPersonInChargeUserId){
+              this.$message.error('请选片区负责人');
+              return
+             }
             let par = {
               //基本信息
               ...this.form,

+ 9 - 3
src/views/ledgerAssets/mould/components/mould-list.vue

@@ -201,10 +201,16 @@
             minWidth: 80
           },
           {
-            prop: 'chargePerson',
-            label: '负责人',
+            prop: 'areaPersonInChargeUserName',
+            label: '片区负责人',
             showOverflowTooltip: true,
-            minWidth: 80
+            minWidth: 150
+          },
+          {
+            prop: 'repairUserName',
+            label: '维修人',
+            showOverflowTooltip: true,
+            minWidth: 150
           },
           {
             prop: 'endTime',

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

@@ -346,6 +346,14 @@
         }
         this.$refs.form.validate(async (valid) => {
           if (valid) {
+            if(!this.form.areaPersonInChargeGroupId){
+              this.$message.error('请选片区负责人部门');
+              return
+             }
+             if(!this.form.areaPersonInChargeUserId){
+              this.$message.error('请选片区负责人');
+              return
+             }
             let par = {
               //基本信息
               ...this.form,

+ 9 - 3
src/views/ledgerAssets/turnoverCar/components/turnovercar-list.vue

@@ -187,10 +187,16 @@
             minWidth: 80
           },
           {
-            prop: 'chargePerson',
-            label: '负责人',
+            prop: 'areaPersonInChargeUserName',
+            label: '片区负责人',
             showOverflowTooltip: true,
-            minWidth: 80
+            minWidth: 150
+          },
+          {
+            prop: 'repairUserName',
+            label: '维修人',
+            showOverflowTooltip: true,
+            minWidth: 150
           },
           {
             prop: 'endTime',

+ 8 - 0
src/views/ledgerAssets/turnoverCar/edit.vue

@@ -349,6 +349,14 @@
         }
         this.$refs.form.validate(async (valid) => {
           if (valid) {
+            if(!this.form.areaPersonInChargeGroupId){
+              this.$message.error('请选片区负责人部门');
+              return
+             }
+             if(!this.form.areaPersonInChargeUserId){
+              this.$message.error('请选片区负责人');
+              return
+             }
             let par = {
               //基本信息
               ...this.form,

+ 9 - 3
src/views/ledgerAssets/turnoverDisks/components/equipment-list.vue

@@ -202,10 +202,16 @@
             minWidth: 80
           },
           {
-            prop: 'chargePerson',
-            label: '负责人',
+            prop: 'areaPersonInChargeUserName',
+            label: '片区负责人',
             showOverflowTooltip: true,
-            minWidth: 80
+            minWidth: 150
+          },
+          {
+            prop: 'repairUserName',
+            label: '维修人',
+            showOverflowTooltip: true,
+            minWidth: 150
           },
           {
             prop: 'endTime',

+ 8 - 0
src/views/ledgerAssets/turnoverDisks/edit.vue

@@ -346,6 +346,14 @@
         }
         this.$refs.form.validate(async (valid) => {
           if (valid) {
+            if(!this.form.areaPersonInChargeGroupId){
+              this.$message.error('请选片区负责人部门');
+              return
+             }
+             if(!this.form.areaPersonInChargeUserId){
+              this.$message.error('请选片区负责人');
+              return
+             }
             let par = {
               //基本信息
               ...this.form,

+ 84 - 158
src/views/maintenance/components/planRepaireDialog.vue

@@ -1,12 +1,11 @@
 <template>
   <ele-modal
     width="80%"
-    :visible="visible"
     v-if="visible"
     :append-to-body="true"
     custom-class="ele-dialog-form"
     :title="dialogTitle"
-    @update:visible="updateVisible"
+    :visible.sync="visible"
     :maxable="true"
   >
     <header-title title="基本信息"></header-title>
@@ -15,6 +14,7 @@
       :model="addForm"
       :rules="addFormRules"
       label-width="120px"
+      :disabled="dialogTitle == '详情'"
     >
       <el-row>
         <el-col :span="8">
@@ -252,125 +252,59 @@
                 </template>
               </template>
             </el-table-column>
-            <el-table-column label="操作" width="100">
-              <template slot-scope="scope">
-                <el-button type="text" @click="deleteEquipment(scope.$index)"
-                  >删除</el-button
-                >
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-        <!-- <div class="ruleMatters_box">
-          <header-title title="备品备件">
-            <div v-if="dialogTitle !== '派单'">
-              <el-button
-                size="small"
-                icon="el-icon-plus"
-                class="ele-btn-icon"
-                type="primary"
-                @click="addPostscript"
-                >新增</el-button
-              >
-            </div>
-          </header-title>
-          <el-table :data="equipmentList" 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 v-if="scope.row.isNew">
-                  <el-input
-                    v-model="scope.row.name"
-                    placeholder="请输入内容"
-                  ></el-input>
-                </div>
-                <div v-else>
-                  <span>{{ scope.row.name }}</span>
-                </div>
-              </template>
-            </el-table-column>
-            <el-table-column label="内容" prop="content" width="200">
-              <template slot-scope="scope">
-                <div v-if="scope.row.isNew">
-                  <el-input
-                    v-model="scope.row.content"
-                    placeholder="请输入内容"
-                  ></el-input>
-                </div>
-                <div v-else>
-                  <span>{{ scope.row.content }}</span>
-                </div>
-              </template>
-            </el-table-column>
-            <el-table-column label="操作指导" prop="operationGuide">
-              <template slot-scope="scope">
-                <div
-                  class="operationGuide_box"
-                  @click="
-                    openOperationGuideDialogDialog(
-                      scope.row.operationGuide,
-                      scope.$index
-                    )
-                  "
-                >
-                  <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="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 v-if="scope.row.isNew">
-                  <el-input
-                    v-model="scope.row.norm"
-                    placeholder="请输入内容"
-                  ></el-input>
-                </div>
-                <div v-else>
-                  <span>{{ scope.row.norm }}</span>
-                </div>
+            <el-table-column
+              label="负责人部门"
+              align="center"
+              prop="areaPersonInChargeGroupId"
+            >
+              <template slot-scope="{ row, $index }">
+                <template>
+                  <deptSelect
+                    v-model="row.areaPersonInChargeGroupId"
+                    @changeGroup="areaPersonGroup($index)"
+                  />
+                </template>
               </template>
             </el-table-column>
             <el-table-column
-              v-if="dialogTitle !== '派单'"
-              label="操作"
-              width="100"
+              label="负责人"
+              align="center"
+              prop="areaPersonInChargeUserId"
             >
+              <template slot-scope="{ row, $index }">
+                <template>
+                  <el-select
+                    style="width: 100%"
+                    v-model="row.areaPersonInChargeUserId"
+                    placeholder="请选择"
+                  >
+                    <el-option
+                      v-for="item in row.areaPersonList"
+                      :key="item.id"
+                      :label="item.name"
+                      :value="item.id"
+                    >
+                    </el-option>
+                  </el-select>
+                </template>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" width="100">
               <template slot-scope="scope">
-                <el-button type="text" @click="deleteItem(scope.$index)"
+                <el-button type="text" @click="deleteEquipment(scope.$index)"
                   >删除</el-button
                 >
               </template>
             </el-table-column>
           </el-table>
-        </div> -->
+        </div>
       </div>
     </el-form>
     <template v-slot:footer>
       <el-button @click="visible = false">取消</el-button>
-      <el-button type="primary" @click="save"> 保存</el-button>
+      <el-button type="primary" @click="save" v-if="dialogTitle != '详情'">
+        保存</el-button
+      >
     </template>
     <!-- 新增设备 -->
     <MaterialAdd ref="productRefs" @chooseEquipment="chooseEquipment">
@@ -380,23 +314,15 @@
 
 <script>
   import { getDetail, getCode } from '@/api/ruleManagement/matter';
-  import {
-    getRule,
-    getCategory,
-    getAssetList,
-    getInfoById
-  } from '@/api/ruleManagement/plan';
+  import { getCategory } from '@/api/ruleManagement/plan';
   import { saveOrUpdate } from '@/api/maintenance/patrol_maintenance';
   import { getUserPage } from '@/api/system/organization';
-  import { getTreeByType } from '@/api/classifyManage';
   import MaterialAdd from './MaterialAdd.vue';
   import OperationGuideDialog from './operationGuideDialog.vue';
   import deptSelect from '@/components/CommomSelect/dept-select.vue';
   import { pageList } from '@/api/technology/version/version.js';
   import { getById } from '@/api/maintenance/patrol_maintenance';
   import { getFile } from '@/api/system/file';
-  import { deepClone } from 'ele-admin/lib/utils/core';
-  import { data } from 'ele-admin/lib/ele-pro-table';
 
   export default {
     components: {
@@ -404,18 +330,7 @@
       deptSelect,
       OperationGuideDialog
     },
-    props: {
-      dialogTitle: {
-        type: String,
-        default: () => {
-          return '新增巡检点计划配置';
-        }
-      },
-      visible: {
-        type: Boolean,
-        default: false
-      }
-    },
+    props: {},
     data() {
       const defaultForm = {
         id: null,
@@ -433,6 +348,8 @@
         ruleId: '',
         formLabel: '',
         isBindPlan: false,
+        dialogTitle: '',
+        visible: false,
         equipmentList: [],
         ruleObj: {
           ruleId: '',
@@ -596,6 +513,7 @@
     },
     watch: {
       visible(val) {
+        console.log(val, 'dsds');
         if (val) {
           // 获取审核人列表数据
           this.getUserList();
@@ -622,6 +540,8 @@
       },
       // 初始化
       async init(row, tips) {
+        this.visible = true;
+        this.dialogTitle = tips;
         if (row) {
           this.getInfo(row.id, tips);
         } else {
@@ -647,7 +567,6 @@
           this.ruleIdList = [];
           this.isBindPlan = false;
           this.planRuleEquiList = [];
-          //   this.matterRulesList = [];
         }
         this.formLabel = '计划性维修';
         const typeOptions = {
@@ -725,17 +644,24 @@
         this.equipmentList.splice(index, 1);
       },
       async getInfo(id, tips) {
-        console.log(id);
         try {
           const res = await getById(id);
           console.log('res----------', res);
           this.addForm = res.data;
           this.addForm.id = res.data.planId;
+          this.equipmentList = res.data.planDeviceList.map((item) => {
+            return {
+              name: item.substance.name,
+              position: item.substance.position,
+              id: item.substance.id,
+              fixCode: item.substance.fixCode,
+              codeNumber: item.substance.codeNumber
+            };
+          });
           if (this.dialogTitle === '派单') {
             this.addForm.autoOrder = 1;
           }
           this.isBindPlan = res.isBindPlan;
-          // this.categoryEquipment(res.categoryLevelId);
           this.ruleIdList = [
             {
               id: res.data.id,
@@ -743,52 +669,40 @@
               name: res.data.name,
               code: res.data.code,
               categoryId: res.data.categoryId,
-              equipmentList: res.data.planDeviceList.map((item) => {
-                return {
-                  name: item.substance.name,
-                  position: item.substance.position,
-                  id: item.substance.id,
-                  fixCode: item.substance.fixCode,
-                  codeNumber: item.substance.codeNumber
-                  // category: {
-                  //   categoryLevelId: item.categoryId,
-                  //   categoryLevelName: item.categoryName
-                  // }
-                };
-              }),
+              equipmentList: this.equipmentList,
               ruleItems: res.data.planDeviceList[0].workItems
             }
           ];
-          console.log(this.ruleIdList);
           this.tabsValue = this.ruleIdList[0].ruleId;
           // const params = { groupId: res.data.groupId };
           // this.getUserList(params);
           // this._getMatterRulesDetails(res.ruleId);
           this.$set(this.addForm, 'code', res.data.code);
           this.$set(this.addForm, 'urgent', JSON.stringify(res.data.urgent));
-          this.$set(this.addForm, 'executeId', res.data.executeId.split(','));
+          this.$set(this.addForm, 'executeId', res.data.executeId?.split(','));
           this.$set(this.addForm, 'imageUrl', {});
           console.log(this.rootData);
         } catch (error) {
           console.log(error);
         }
       },
-      // 获取设备分类数据
-      async categoryEquipment(id) {
-        const params = { categoryLevelId: id, pageNum: 1, size: -1 };
-        console.log('params==', params);
-        const data = await getCategory(params);
-        console.log(data);
-        this.equipmentList = data.list;
-      },
+
       // 选择设备
       chooseEquipment(data) {
         console.log(data);
+
         this.equipmentList = this.equipmentList.concat(data);
+        this.equipmentList.forEach((item, index) => {
+          this.getUserList(
+            { groupId: item.areaPersonInChargeGroupId },
+            'isAreaPersonGroup',
+            index
+          );
+        });
       },
       // 获取计划配置单号
       async getOrderCode(tips) {
-        if (tips.includes('计划性维修')) {
+        if (tips.includes('新增计划性维修')) {
           const code = await getCode('repair_plan_code');
           this.$set(this.addForm, 'code', code);
         }
@@ -805,6 +719,14 @@
           this.executorList = [];
         }
       },
+      areaPersonGroup(index) {
+        this.$set(this.equipmentList[index], 'areaPersonInChargeUserId', '');
+        this.getUserList(
+          { groupId: this.equipmentList[index]?.areaPersonInChargeGroupId },
+          'isAreaPersonGroup',
+          index
+        );
+      },
       //选择部门(搜索)
       // searchDeptNodeClick(info, data) {
       //   if (info) {
@@ -825,7 +747,7 @@
         }
       },
       // 获取审核人列表、巡点检人员
-      async getUserList(params) {
+      async getUserList(params, type, index) {
         try {
           let data = { pageNum: 1, size: -1 };
           // 如果传了参数就是获取巡点检人员数据
@@ -833,9 +755,13 @@
             data = Object.assign(data, params);
           }
           const res = await getUserPage(data);
-          console.log('res------------', res);
+
           if (params) {
-            this.executorList = res.list;
+            if (type == 'isAreaPersonGroup') {
+              this.$set(this.equipmentList[index], 'areaPersonList', res.list);
+            } else {
+              this.executorList = res.list;
+            }
           } else {
             this.uerList = res.list;
           }

+ 14 - 23
src/views/maintenance/repair/planRepair/index.vue

@@ -16,7 +16,7 @@
             type="primary"
             icon="el-icon-plus"
             class="ele-btn-icon"
-            @click="openAdd('新增计划性维修配置')"
+            @click="openAdd('新增计划性维修')"
           >
             新增维修计划
           </el-button>
@@ -29,24 +29,22 @@
 		     详情
 		   </el-button> -->
         </template>
-        <!-- 	     <template v-slot:enable="{ row }">
-	       <el-switch
-	         v-model="row.enable"
-	         active-color="#13ce66"
-	         inactive-color="#ff4949"
-	         :active-value="1"
-	         :inactive-value="0"
-	         @change="changeEnable(row)"
-	       >
-	       </el-switch>
-	     </template> -->
+        <template v-slot:planCode="{ row }">
+          <el-link
+            type="primary"
+            :underline="false"
+            @click="openAdd('详情', row)"
+          >
+            {{ row.planCode }}
+          </el-link>
+        </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
           <!-- <el-link
             type="primary"
             :underline="false"
             icon="el-icon-edit"
-            @click="openAdd('编辑计划性维修配置')"
+            @click="openAdd('编辑计划性维修', row)"
           >
             编辑
           </el-link> -->
@@ -71,8 +69,6 @@
     <planRepaireDialog
       ref="planRepaireDialog"
       :visible.sync="addPlanRepaireDialog"
-      :dialogTitle="dialogTitle"
-      :isBindPlan="isBindPlan"
       @done="reload"
     />
   </div>
@@ -109,6 +105,7 @@
             prop: 'planCode',
             label: '计划维修单号',
             align: 'center',
+            slot: 'planCode',
             showOverflowTooltip: true,
             minWidth: 110
           },
@@ -181,11 +178,8 @@
         loading: false,
         infoData: {},
         repairInfoLogs: [],
-        addDialogTitle: '新增报修记录',
-        detailsDialogTitle: '报修记录详情',
+
         deviceInfo: {}, //设备信息
-        dialogTitle: '',
-        addPlanRepaireDialog: false,
         isBindPlan: false
       };
     },
@@ -195,11 +189,8 @@
     },
     methods: {
       openAdd(dialogTitle, row) {
-        this.isBindPlan = false;
-        this.addPlanRepaireDialog = true;
-        this.dialogTitle = dialogTitle;
         this.$nextTick(() => {
-          this.$refs.planRepaireDialog.init(row, '计划性维修');
+          this.$refs.planRepaireDialog.init(row, dialogTitle);
         });
       },
       /* 表格数据源 */

+ 1 - 1
src/views/maintenance/repair/workOrder/index.vue

@@ -274,7 +274,7 @@
             showOverflowTooltip: true,
             formatter: (row) => {
               return workorderStatus.filter(
-                (item) => item.code == row.orderStatus
+                (item) => item.value == row.orderStatus
               )[0].label;
             }
           },