2213980799@qq.com 1 year ago
parent
commit
e83527585b

BIN
public/tinymce/skins/ui/oxide/fonts/black.ttf


+ 10 - 0
src/api/classifyManage/index.js

@@ -17,6 +17,16 @@ export async function saveOrUpdate(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
+// 根据ids查询物品分类
+export async function getTreeByIds(data) {
+  const res = await request.get(`/pda/main/categoryLevel/pdaTreeByPid`, {
+    params: data
+  });
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 // 根据父级id查分类树
 export async function getTreeByPid(parentId) {
   const res = await request.get(`/main/categoryLevel/getTreeByPid/${parentId}`);

+ 22 - 0
src/api/main/index.js

@@ -0,0 +1,22 @@
+import request from '@/utils/request';
+
+/**
+ * 工单信息
+ */
+export async function listInspection(data) {
+  const res = await request.get('/eam/workorder/listInspection?type='+data.type);
+  if (res.data.code == 0) {
+    return Promise.resolve(res.data.data)
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 设备状态
+ */
+ export async function queryRunStatus(data) {
+  const res = await request.get('/eam/workorder/queryRunStatus');
+  if (res.data.code == 0) {
+    return Promise.resolve(res.data.data)
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 14 - 0
src/api/sparePartsApply/index.js

@@ -0,0 +1,14 @@
+import request from '@/utils/request';
+
+/**
+ * 列表
+ */
+export async function getList (data) {
+  const res = await request.get('/eam/apply_storage/page', {
+    params: data
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 195 - 0
src/api/warehouseManagement/index.js

@@ -0,0 +1,195 @@
+import request from '@/utils/request';
+
+export default {
+  // 入库
+  storage: async (data) => {
+    const res = await request.post('/wms/outintwo/inStorage', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 批量获取包装编码
+  getAssetNum: async (data) => {
+    const res = await request.post('/wms/outintwo/getAssetNum', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 提交流程(入库)
+  submitTwo: async (data) => {
+    const res = await request.post('/bpm/outinApprove/submitTwo', data);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 提交流程(出库)
+  submitInsideTwo: async (data) => {
+    const res = await request.post('/bpm/outApprove/submitInsideTwo', data);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+
+  // 提交质检流程
+  qualityInspectionTwo: async (data) => {
+    const res = await request.post(
+      '/bpm/outinApprove/qualityInspectionTwo',
+      data
+    );
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 获取入库列表
+  getList: async (params) => {
+    const res = await request.get(`/wms/outintwo/page`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 获取入库详情
+  getInboundList: async (params) => {
+    const res = await request.get(`/wms/outintwo/page`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 获取入库详情
+  getInboundDetailsById: async (id) => {
+    const res = await request.get(`/wms/outintwo/getById/${id}`);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 删除入库详情
+  delete: async (data) => {
+    const res = await request.delete('/wms/outintwo/delete', { data });
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 物品维度台账列表
+  getProductList: async (params) => {
+    const res = await request.get(`/wms/outindetailtwo/page`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 批次维度台账列表
+  getBatchList: async (params) => {
+    const res = await request.get(`/wms/outindetailtwo/batchPage`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 包装维度台账列表
+  getPackingList: async (params) => {
+    const res = await request.get(`/wms/outInDetailRecordTwo/page`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 获取物料维度台账列表
+  getMaterialList: async (params) => {
+    const res = await request.get(`/wms/materialDetail/page`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 通过台账id获取出库物品详情
+  getHierarchyList: async (params) => {
+    const res = await request.get(`/wms/outintwo/getHierarchyList`, {
+      params
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  getHierarchyFifo: async (data) => {
+    const res = await request.post('/wms/outintwo/getHierarchyFifo', data);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 出库
+  outStorage: async (data) => {
+    const res = await request.post('/wms/outintwo/outStorage', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  outStorage: async (data) => {
+    const res = await request.post('/wms/outintwo/outStorage', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 包装维度流水
+  outInRecordsPage: async (params) => {
+    const res = await request.get(
+      `/wms/outInDetailRecordTwo/outInRecordsPage`,
+      {
+        params
+      }
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 上下架
+  upperLowerShelves: async (data) => {
+    const res = await request.post('/wms/outintwo/listing', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 入库申请列表
+  getinboundRequestsList: async (data) => {
+    const res = await request.get('/mes/applystorage/page', {
+      params: data
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 通过入库申请单查询详情
+  getApplystorageDetailById: async (id) => {
+    const res = await request.get(`/mes/applystorage/getById/${id}`);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  }
+};

BIN
src/assets/num1.png


BIN
src/assets/num2.png


BIN
src/assets/num3.png


BIN
src/assets/num4.png


BIN
src/assets/title1.png


BIN
src/assets/title2.png


BIN
src/assets/title3.png


BIN
src/assets/title4.png


+ 1 - 1
src/components/AssetTree/index.vue

@@ -98,7 +98,7 @@
                 (item) =>
                   item.id == '4' ||
                   item.id == '14' ||
-                  item.id == '1747157638286274562'
+                  item.id == '1812765052571865089'
               );
               this.treeList = arr;
             } else {

+ 4 - 1
src/enum/dict.js

@@ -30,7 +30,10 @@ export default {
   巡点检工单状态: 'patrolwork_status',
   巡点检周期: 'patrol_cycle',
   维修计划状态: 'repairplan_status',
-  干燥区状态: 'dry_status'
+  干燥区状态: 'dry_status',
+  设备生命周期:'equipment_lifeCycle',
+  设备处置方式:'equipment_Disposal',
+  精度等级:'accuracy_level'
 };
 
 export const numberList = ['patrol_cycle'];

+ 2 - 2
src/utils/dict/warehouse.js

@@ -136,8 +136,8 @@ export const businessStatus = [
 
 // 生命周期
 export const sourceStatus = [
-  { code: 1, label: '在用' },
-  { code: 2, label: '在库' },
+  { code: 1, label: '使用' },
+  { code: 2, label: '维修' },
   { code: 3, label: '消耗' },
   { code: 4, label: '报废' },
   { code: 5, label: '处置' }

+ 285 - 0
src/views/home/data.js

@@ -0,0 +1,285 @@
+
+
+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
+    }
+]
+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: '停机',
+        color: '#F4C15E',
+        titleUrl: require('../../assets/title4.png'),
+        numUrl: require('../../assets/num4.png'),
+        code:'shutdownNumber',
+        num: 0
+    }
+]
+
+export const rankList = [
+
+    {
+        label: '排名',
+        prop: 'rank',
+        width: '20%',
+    },
+
+    {
+        prop: 'name',
+        label: '备品备件名称',
+        width: '50%',
+    },
+    {
+        prop: 'num',
+        label: '消耗数量',
+        width: '30%',
+    },
+
+
+];
+export const planList = [
+    {
+        label: '类型',
+        prop: 'type',
+        width: '13%',
+    },
+
+    {
+        prop: 'code',
+        label: '编码',
+        width: '30%',
+    },
+    {
+        prop: 'title',
+        label: '标题',
+        width: '30%',
+    },
+    {
+        prop: 'userName',
+        label: '申请人',
+        width: '17%',
+    },
+    {
+        prop: 'action',
+        label: '操作',
+        width: '10%',
+    },
+];
+
+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,
+
+            }
+
+        },
+        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: 'center',
+            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"
+                },
+                labelLine: {
+                    show: false
+                },
+                type: 'pie',
+                radius: '85%',
+                itemStyle: {
+                    borderWidth: 0,
+                    shadowBlur: 10,
+                    shadowColor: 'rgba(0, 0, 0, 0.5)'
+                },
+                data
+            }
+        ]
+    }
+}
+export const pieOption1 = (data) => {
+    return {
+        // color: ['#398f4e', '#458ef7', '#fdc537', '#fe6869', '#975fe6'],
+        tooltip: {
+            formatter: '{b}:{c}' + '%',
+            trigger: 'item'
+        },
+        legend: {
+            orient: 'horizontal',
+            left: 'right',
+            right: '15%',
+            bottom: '5%',
+            itemGap: window.innerHeight * 0.014,
+            textStyle: {
+                fontSize: window.innerHeight * 0.013,
+            }
+        },
+        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 = (data) => {
+    return {
+
+        tooltip: {
+            formatter: (item) => {
+                return item.name + ' ' + item.seriesName + ":" + item.value + '万元'
+            },
+            trigger: 'item'
+        },
+        legend: {
+            // bottom: '2%',
+            itemGap: window.innerHeight * 0.014,
+
+            textStyle: {
+                fontSize: window.innerHeight * 0.013,
+            }
+        },
+
+        xAxis: {
+            type: 'category',
+
+            axisLabel: {
+                fontSize: window.innerHeight * 0.012,
+
+            },
+            data: [2020, 2021, 2022, 2023, 2024]
+        },
+        yAxis: {
+            type: 'value'
+        },
+        series: [
+            {
+                name: '班组一',
+                data: [40, 45, 36, 45, 56],
+                type: 'line'
+            }, {
+                name: '班组二',
+                data: [32, 33, 43, 56, 46],
+                type: 'line'
+            }, {
+                name: '班组三',
+                data: [47, 43, 41, 65, 36],
+                type: 'line'
+            }, {
+                name: '班组四',
+                data: [51, 56, 39, 54, 41],
+                type: 'line'
+            }
+        ]
+    }
+}

+ 691 - 562
src/views/home/index.vue

@@ -1,618 +1,747 @@
 <template>
-  <div id="home">
-    <!-- <div class="top_bar">
-      <div class="title">
-        <div class="line"></div>
-        <div class="text">常用功能</div>
-        <i class="el-icon-circle-plus-outline"></i>
-      </div>
-      <div class="list">
-        <div class="item" v-for="(item, index) in options">
-          <img :src="item.imgUrl" />
-          <div>{{ item.title }}</div>
-        </div>
-      </div>
-    </div> -->
-    <div class="warning_bar">
-      <i class="el-icon-message-solid"></i>
-      <div>5条 备品低于安全库存,请即时处理!</div>
-      <el-button type="danger" size="mini">立即处理</el-button>
-    </div>
-    <div class="info_bar">
-      <div class="echarts_box">
-        <div class="search_box">
-          <div class="tabs">
-            <el-radio-group v-model="tabValue" style="margin-bottom: 30px">
-              <el-radio-button label="top">平均修复时间MTTR</el-radio-button>
-              <el-radio-button label="right"
-                >平均故障间隔时间MTBF</el-radio-button
-              >
-              <el-radio-button label="bottom">故障设备分布</el-radio-button>
-            </el-radio-group>
+  <div class="ele-body">
+    <el-row :gutter="15">
+      <el-col :span="13" style="height: 100%">
+        <el-card class="box-card box-card1" style="height: 18%">
+          <div slot="header" class="clearfix">
+            <span>工单信息</span>
           </div>
-          <div class="select">
-            <el-select
-              size="mini"
-              style="width: 100px; margin-right: 10px"
-              v-model="value"
-              placeholder="请选择"
-            >
-              <el-option
-                v-for="item in options1"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
-            <el-select
-              size="mini"
-              style="width: 100px"
-              v-model="value"
-              placeholder="请选择"
-            >
-              <el-option
-                v-for="item in options2"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-              >
-              </el-option>
-            </el-select>
-          </div>
-        </div>
-        <div ref="echatrs" class="echatrs"></div>
-      </div>
-      <div class="toDo">
-        <div class="title">
-          <div class="line"></div>
-          <div class="text">待处理(17条)</div>
-          <div>更多</div>
-        </div>
-        <div class="list">
-          <vue-seamless-scroll
-            :data="listData"
-            :class-option="seamlessScrollOption"
-            class="scroll_box"
-          >
+          <div class="list">
             <div
-              v-for="(item, index) in toDoList"
+              class="item"
+              v-for="(item, index) in repaireOptions"
               :key="index"
-              class="srcoll_item"
-              :title="item.title"
-              style="padding: 5px; margin: 5px"
             >
-              {{ item.title }}
+              <div class="img_box">
+                <img :src="item.imgUrl" />
+              </div>
+              <div @click="handelRouterTo('/page-wt/tickets')">
+                <div>{{ item.title }}</div>
+                <div class="text">{{ item.num }}/{{ item.total }}</div>
+              </div>
             </div>
-          </vue-seamless-scroll>
-        </div>
-      </div>
-    </div>
-    <div class="worker_bar">
-      <div class="history">
-        <div class="title">
-          <div class="line"></div>
-          <div class="text">近7日工单信息</div>
-        </div>
-        <div class="list">
-          <div class="item" v-for="(item, index) in repaireOptions">
-            <div class="img_box">
-              <img :src="item.imgUrl" />
+          </div>
+        </el-card>
+
+        <div class="char">
+          <el-card class="box-card" style="width: 55%">
+            <div slot="header" class="clearfix">
+              <span>故障设备分布(部门)</span>
             </div>
-            <div>
-              <div>{{ item.title }}</div>
-              <div class="text">{{ item.num }}/{{ item.total }}</div>
+
+            <v-chart
+              ref="pieRef"
+              style="height: 100%"
+              :option="pieEquipmentFailureOption"
+            />
+          </el-card>
+          <el-card class="box-card" style="width: calc(45% - 15px)">
+            <div slot="header" class="clearfix">
+              <span>设备状态</span>
             </div>
-          </div>
-        </div>
-      </div>
-      <div class="total">
-        <div class="title">
-          <div class="line"></div>
-          <div class="text">工单响应时间统计TOP10</div>
-          <el-select
-            size="mini"
-            style="width: 100px"
-            v-model="value"
-            placeholder="请选择"
-          >
-            <el-option
-              v-for="item in dateOptions"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            >
-            </el-option>
-          </el-select>
+            <div class="statusList">
+              <div v-for="(item, index) in statusList" :key="index">
+                <div class="left" :style="{ color: item.color }">
+                  <img :src="item.titleUrl" />
+                  {{ item.title }}
+                </div>
+                <div class="right">
+                  <img :src="item.numUrl" />
+                  <div>
+                    <span>{{ item.num }}</span>
+                    <span>台</span>
+                  </div>
+                </div>
+              </div>
+            </div>
+          </el-card>
         </div>
-        <div class="list">
-          <vue-seamless-scroll
-            :data="listData"
-            :class-option="seamlessScrollOption"
-            class="scroll_box"
-          >
+        <!-- <el-card class="box-card" style="height: 18%; margin-top: 15px">
+          <div slot="header" class="clearfix">
+            <span>设备状态</span>
+          </div>
+          <div class="statusList">
             <div
-              v-for="(item, index) in listData"
+              :style="{ background: item.color }"
+              class="item"
+              v-for="(item, index) in statusList"
               :key="index"
-              class="srcoll_item"
-              style="padding: 5px; margin: 5px"
             >
-              <span class="name">{{ item.name }}</span
-              ><el-progress
-                color="#398f4d"
-                :text-inside="true"
-                :stroke-width="20"
-                :percentage="item.num"
-                :format="() => item.num"
-              ></el-progress
-              ><span>分钟</span>
+              <span>{{ item.title }}</span>
+              <span>{{ item.num }}</span>
             </div>
-          </vue-seamless-scroll>
+          </div>
+        </el-card> -->
+        <el-card class="box-card" style="height: 42%; margin-top: 15px">
+          <div slot="header" class="clearfix">
+            <span>故障设备分布(类型)</span>
+          </div>
+          <v-chart
+            ref="barRef"
+            style="height: 100%"
+            :option="barEquipmentFailureOption"
+          />
+        </el-card>
+      </el-col>
+      <el-col :span="11" style="height: 100%">
+        <div class="char" style="height: 40%; margin: 0">
+          <el-card
+            class="box-card"
+            style="height: 100%; width: 63%; position: relative"
+          >
+            <div slot="header" class="clearfix">
+              <span>备品备件</span>
+            </div>
+            <div class="sparePart">
+              <span>消耗总量 68</span>
+              <span
+                >环比-17%
+                <i
+                  class="el-icon-caret-bottom"
+                  style="color: #38994e; font-size: 1vw"
+                ></i
+              ></span>
+              <span>同比 - </span>
+              <span style="margin-top: 25px">消耗种类 20 </span>
+            </div>
+            <v-chart
+              ref="pieRef1"
+              style="height: 100%"
+              :option="pieSparePartOption"
+            />
+          </el-card>
+
+          <el-card
+            class="box-card"
+            style="height: 100%; width: calc(37% - 15px)"
+          >
+            <div slot="header" class="clearfix">
+              <span>排名</span>
+              <el-select
+                v-model="rankType"
+                placeholder="请选择"
+                style="width: 110px"
+              >
+                <el-option
+                  v-for="item in rankTypeOption"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </el-select>
+            </div>
+            <div class="scrollList">
+              <div class="tableList_header">
+                <span
+                  v-for="item in rankList"
+                  :key="item.prop"
+                  :style="{ width: item.width }"
+                >
+                  {{ item.label }}
+                </span>
+              </div>
+              <div class="tableList" ref="rankTableList">
+                <vue-seamless-scroll
+                  :data="rankData"
+                  :class-option="seamlessScrollOption2"
+                  class="scroll_box"
+                >
+                  <div
+                    v-for="(item, index) in rankData"
+                    :key="index"
+                    class="srcoll_item"
+                  >
+                    <template v-for="data in rankList">
+                      <span
+                        :style="{ width: data.width }"
+                        :key="data.prop"
+                        :title="item[data.prop]"
+                      >
+                        {{ item[data.prop] }}</span
+                      >
+                    </template>
+                  </div>
+                </vue-seamless-scroll>
+              </div>
+            </div>
+          </el-card>
         </div>
-      </div>
-    </div>
+
+        <el-card class="box-card" style="height: 35%; margin-top: 15px">
+          <div slot="header" class="clearfix">
+            <span>班组维修消耗费用趋势(万元)</span>
+          </div>
+          <v-chart ref="lineRef" style="height: 100%" :option="lineOption" />
+        </el-card>
+        <el-card class="box-card" style="height: calc(25% - 15px)">
+          <div slot="header" class="clearfix">
+            <span>待处理</span>
+          </div>
+          <div class="scrollList">
+            <div class="tableList_header">
+              <span
+                v-for="item in planList"
+                :key="item.prop"
+                :style="{ width: item.width }"
+              >
+                {{ item.label }}
+              </span>
+            </div>
+            <div class="tableList" ref="planTableList">
+              <vue-seamless-scroll
+                :data="planData"
+                :class-option="seamlessScrollOption"
+                class="scroll_box"
+              >
+                <div
+                  v-for="(item, index) in planData"
+                  :key="index"
+                  class="srcoll_item"
+                >
+                  <template v-for="data in planList">
+                    <span
+                      v-if="data.prop != 'action' && data.prop != 'code'"
+                      :style="{ width: data.width }"
+                      :key="data.prop"
+                      :title="item[data.prop]"
+                    >
+                      {{ item[data.prop] }}</span
+                    >
+                    <span
+                      v-if="data.prop == 'code'"
+                      :style="{ width: data.width }"
+                      :key="data.prop"
+                      :title="item[data.prop]"
+                      ><el-link type="primary" :underline="false">
+                        {{ item[data.prop] }}
+                      </el-link></span
+                    >
+                    <span
+                      v-if="data.prop == 'action'"
+                      :style="{ width: data.width }"
+                      :key="data.prop"
+                      ><el-link
+                        type="primary"
+                        :underline="false"
+                        icon="el-icon-edit"
+                      >
+                        审批
+                      </el-link></span
+                    >
+                  </template>
+                </div>
+              </vue-seamless-scroll>
+            </div>
+          </div>
+        </el-card>
+      </el-col>
+    </el-row>
   </div>
 </template>
 <script>
-  import * as echarts from 'echarts';
-  import vueSeamlessScroll from 'vue-seamless-scroll';
-  export default {
-    data() {
-      return {
-        echarts,
-        value: 1,
-        tabValue: 'top',
-        toDoList: [
-          {
-            title:
-              '类型:审批 申请人:系统 标题:巡点检计划标题:巡点检计划点检计划类型:审批 申请人:系统 标题:巡点检计划标题:巡点检计划点检计划....'
-          },
-          {
-            title:
-              '类型:审批 申请人:系统 标题:巡点检计划标题:巡点检计划点检计划....'
-          },
-          {
-            title:
-              '类型:审批 申请人:系统 标题:巡点检计划标题:巡点检计划点检计划....'
-          },
-          {
-            title:
-              '类型:审批 申请人:系统 标题:巡点检计划标题:巡点检计划点检计划....'
-          },
-          {
-            title:
-              '类型:审批 申请人:系统 标题:巡点检计划标题:巡点检计划点检计划....'
-          },
-          {
-            title:
-              '类型:审批 申请人:系统 标题:巡点检计划标题:巡点检计划点检计划....'
-          },
-          {
-            title:
-              '类型:审批 申请人:系统 标题:巡点检计划标题:巡点检计划点检计划....'
-          },
-          {
-            title:
-              '类型:审批 申请人:系统 标题:巡点检计划标题:巡点检计划点检计划....'
-          },
-          {
-            title:
-              '类型:审批 申请人:系统 标题:巡点检计划标题:巡点检计划点检计划....'
-          },
-          {
-            title:
-              '类型:审批 申请人:系统 标题:巡点检计划标题:巡点检计划点检计划....'
-          },
-          {
-            title:
-              '类型:审批 申请人:系统 标题:巡点检计划标题:巡点检计划点检计划....'
-          },
-          {
-            title:
-              '类型:审批 申请人:系统 标题:巡点检计划标题:巡点检计划点检计划....'
-          },
-          {
-            title:
-              '类型:审批 申请人:系统 标题:巡点检计划标题:巡点检计划点检计划....'
-          },
-          {
-            title:
-              '类型:审批 申请人:系统 标题:巡点检计划标题:巡点检计划点检计划....'
-          }
-        ],
-        listData: [
-          {
-            name: '晏银戈',
-            num: 30
-          },
-          {
-            name: '陈忠华',
-            num: 40
-          },
-          {
-            name: '杨伟庭',
-            num: 20
-          },
-          {
-            name: '谭警',
-            num: 60
-          },
-          {
-            name: '旭昇设',
-            num: 70
-          }
-        ],
-        options1: [
-          {
-            label: '按月',
-            value: 1
-          }
-        ],
-        options2: [
-          {
-            label: '成型模压',
-            value: 1
-          }
-        ],
-        dateOptions: [
-          {
-            label: '近七日',
-            value: 1
-          },
-          {
-            label: '近一个月',
-            value: 2
-          }
-        ],
-        options: [
-          {
-            title: '设备台账',
-            imgUrl: require('../../assets/icon.png')
-          },
-          {
-            title: '原始台账',
-            imgUrl: require('../../assets/icon.png')
-          },
-          {
-            title: '备品备件',
-            imgUrl: require('../../assets/icon.png')
-          },
-          {
-            title: '周转车台账',
-            imgUrl: require('../../assets/icon.png')
-          },
-          {
-            title: '舟皿台账',
-            imgUrl: require('../../assets/icon.png')
-          },
-          {
-            title: '资产台账',
-            imgUrl: require('../../assets/icon.png')
-          },
-          {
-            title: '模具台账',
-            imgUrl: require('../../assets/icon.png')
-          }
-        ],
-        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
-          }
-        ]
-      };
-    },
-    components: {
-      vueSeamlessScroll
-    },
-    computed: {
-      seamlessScrollOption() {
-        return {
-          step: 0.2, // 数值越大速度滚动越快
-          limitMoveNum: 2, // 开始无缝滚动的数据量 this.dataList.length
-          hoverStop: true, // 是否开启鼠标悬停stop
-          direction: 1, // 0向下 1向上 2向左 3向右
-          openWatch: true, // 开启数据实时监控刷新dom
-          singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
-          singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
-          waitTime: 1000 // 单步运动停止的时间(默认值1000ms)
-        };
-      }
-    },
-    mounted() {
-      let myChart = echarts.init(this.$refs.echatrs);
-      let option = {
-        grid: {
-          top: '3%',
-          left: '3%',
-          right: '4%',
-          bottom: '3%',
-          containLabel: true
+import vueSeamlessScroll from 'vue-seamless-scroll';
+
+import {
+  planList,
+  statusList,
+  rankList,
+  repaireOptions,
+  pieOption,
+  barOption,
+  pieOption1,
+  lineOption
+} from './data';
+import { use } from 'echarts/core';
+import { CanvasRenderer } from 'echarts/renderers';
+import { BarChart, PieChart, LineChart } from 'echarts/charts';
+import {
+  GridComponent,
+  TooltipComponent,
+  LegendComponent
+} from 'echarts/components';
+
+import VChart from 'vue-echarts';
+import { echartsMixin } from '@/utils/echarts-mixin';
+import { listInspection,queryRunStatus } from '@/api/main';
+// 按需加载 echarts
+use([
+  CanvasRenderer,
+  BarChart,
+  PieChart,
+  GridComponent,
+  TooltipComponent,
+  LegendComponent,
+  LineChart
+]);
+const seamlessScrollOption = {
+  step: 0.2, // 数值越大速度滚动越快
+  limitMoveNum: 5, // 开始无缝滚动的数据量 this.dataList.length
+  hoverStop: true, // 是否开启鼠标悬停stop
+  direction: 1, // 0向下 1向上 2向左 3向右
+  openWatch: true, // 开启数据实时监控刷新dom
+  singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
+  singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
+  waitTime: 1000 // 单步运动停止的时间(默认值1000ms)
+};
+export default {
+  mixins: [echartsMixin(['barRef', 'pieRef', 'lineRef'])],
+  data() {
+    return {
+      planList,
+      tabPosition: '个人',
+      planData: [
+        {
+          type: '审批',
+          code: 'XA123451',
+          title: '巡查点计划1',
+          userName: '李杰3213213123213123123'
         },
-        xAxis: {
-          type: 'category',
-          boundaryGap: false,
-          data: Array.from({ length: 30 }, (_, index) => index + 1)
+        {
+          type: '审批',
+          code: 'XA123452',
+          title: '巡查点计划2',
+          userName: '李杰'
         },
-        yAxis: {
-          type: 'value'
+        {
+          type: '审批',
+          code: 'XA123453',
+          title: '巡查点计划3',
+          userName: '李杰'
         },
-        series: [
-          {
-            name: 'Search Engine',
-            type: 'line',
-            stack: 'Total',
-            lineStyle: {
-              color: '#008000', // 折线颜色
-              width: 2 // 折线宽度
-            },
-            itemStyle: {
-              color: '#008000' // 数据点颜色
-            },
-            data: [
-              0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 0.1, 0.2, 0.3,
-              0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6,
-              0.7, 0.8, 0.9, 1
-            ]
-          }
-        ]
-      };
-      myChart.setOption(option);
+        {
+          type: '审批',
+          code: 'XA123454',
+          title: '巡查点计划4',
+          userName: '李杰'
+        },
+        {
+          type: '审批',
+          code: 'XA123455',
+          title: '巡查点计划5',
+          userName: '李杰'
+        }
+      ],
+
+      rankData: [
+        {
+          name: '备件1',
+          num: '356',
+          rank: 1
+        },
+        {
+          name: '备件2',
+          num: '356',
+          rank: 2
+        },
+        {
+          name: '备件3',
+          num: '356',
+          rank: 3
+        },
+        {
+          name: '备件4',
+          num: '356',
+          rank: 4
+        },
+        {
+          name: '备件5',
+          num: '356',
+          rank: 5
+        },
+        {
+          name: '备件6',
+          num: '356',
+          rank: 6
+        },
+        {
+          name: '备件7',
+          num: '356',
+          rank: 7
+        },
+        {
+          name: '备件8',
+          num: '356',
+          rank: 8
+        },
+        {
+          name: '备件9',
+          num: '356',
+          rank: 9
+        },
+        {
+          name: '备件10',
+          num: '356',
+          rank: 10
+        }
+      ],
+      dateOptions: [
+        {
+          label: '近七日',
+          value: 1
+        },
+        {
+          label: '近一个月',
+          value: 2
+        }
+      ],
+      rankTypeOption: [
+        {
+          value: '1',
+          label: '全厂'
+        },
+        {
+          value: '2',
+          label: '机加一'
+        },
+        {
+          value: '3',
+          label: '机加二'
+        },
+        {
+          value: '4',
+          label: '特种作业'
+        },
+        {
+          value: '5',
+          label: '总装'
+        }
+      ],
+      rankType: '1',
+      statusList,
+      rankList,
+      repaireOptions,
+      date: new Date(),
+      seamlessScrollOption: JSON.parse(JSON.stringify(seamlessScrollOption)),
+      seamlessScrollOption2: JSON.parse(JSON.stringify(seamlessScrollOption)),
+      barEquipmentFailureOption: {},
+      pieEquipmentFailureOption: {},
+      lineOption: {},
+      pieSparePartOption: {}
+    };
+  },
+  components: {
+    vueSeamlessScroll,
+    VChart
+  },
+  created() {
+    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.pieEquipmentFailureOption = pieOption([
+      { name: '部门1', value: '45' },
+      { name: '部门2', value: '25' },
+      { name: '部门3', value: '18' },
+      { name: '部门4', value: '36' },
+      { name: '部门5', value: '21' }
+    ]);
+    this.pieSparePartOption = pieOption1([
+      {
+        value: '2',
+        name: '机加一'
+      },
+      {
+        value: '3',
+        name: '机加二'
+      },
+      {
+        value: '4',
+        name: '特种作业'
+      },
+      {
+        value: '5',
+        name: '总装'
+      }
+    ]);
+    this.lineOption = lineOption();
+    this.queryRunStatus()
+  },
+  methods: {
+    //工单信息
+    async getListInspection() {
+      const arr = await Promise.all(
+        [1, 2, 3].map((item) => listInspection({ type: item }))
+      );
+      arr.forEach((item, index) => {
+        this.repaireOptions[index].total = item.numberTotal;
+        this.repaireOptions[index].num = item.finishNumber;
+      });
+    },
+    queryRunStatus(){
+      queryRunStatus().then(res=>{
+        this.statusList.forEach(item=>{
+          item.num=res[item.code]
+        })
+
+      })
+    },
+    handelRouterTo(path) {
+      window.history.pushState(null, '', path);
     }
-  };
+  },
+  mounted() {
+    this.getListInspection();
+    this.seamlessScrollOption.limitMoveNum = parseInt(
+      this.$refs.planTableList.clientHeight / 25
+    );
+    this.seamlessScrollOption2.limitMoveNum = parseInt(
+      this.$refs.rankTableList.clientHeight / 25
+    );
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  #home {
-    height: calc(100vh - 116px);
-    width: calc(100% - 20px);
-    margin: 10px;
-    background-color: #f0f3f3;
-    display: flex;
-    flex-direction: column;
-    ::v-deep .el-select .el-input.is-focus .el-input__inner {
-      border-color: #157a2c;
+@font-face {
+  font-family: 'MyFont';
+  src: url('../../../public/tinymce/skins/ui/oxide/fonts/black.ttf')
+    format('truetype');
+  font-weight: normal;
+  font-style: normal;
+}
+.clearfix {
+  font-size: 0.7vw;
+
+  > span {
+    font-weight: bold;
+    margin-left: 15px;
+    margin-right: 15px;
+  }
+  :deep(.el-radio-button__orig-radio:checked + .el-radio-button__inner) {
+    background-color: #398f4e;
+    border-color: #398f4e;
+  }
+  :deep(.el-radio-button__inner) {
+    font-size: 0.7vw;
+  }
+}
+.ele-body {
+  height: calc(100vh - 106px);
+  > .el-row {
+    height: 100%;
+  }
+  :deep(.el-calendar) {
+    font-size: 0.7vw;
+    height: 100%;
+    .el-calendar__body {
+      height: 90%;
+      padding: 0.4vw 0.7vw;
+    }
+    .el-calendar-day {
+      height: 100%;
+    }
+    .el-calendar-table {
+      height: 100%;
+    }
+    .el-calendar__header {
+      padding: 0.4vw 0.7vw;
     }
-    .title {
-      padding: 0 10px;
-      box-sizing: border-box;
+    .el-calendar-table thead th {
+      padding: 0.4vw 0;
+    }
+    .dateItem {
       width: 100%;
-      height: 40px;
+      height: 100%;
       display: flex;
       align-items: center;
-      .line {
-        width: 5px;
-        height: 20px;
-        background-color: #157a2c;
-        margin-right: 10px;
-      }
-      .text {
-        flex: 1;
-        font-size: 14px;
-        margin-right: 10px;
-      }
-      .el-icon-circle-plus-outline {
-        font-size: 16px !important;
-        margin-top: 2px;
-      }
+      justify-content: center;
     }
-    .top_bar {
-      width: 100%;
-      background-color: #fff;
-      border-radius: 8px;
-      height: 100px;
+  }
+  .el-card {
+    height: 100%;
+    // margin-top: 15px;
+
+    :deep(.el-card__body) {
+      padding: 0.3vw;
+    }
+    :deep(.el-card__header) {
+      padding: 0;
+      height: 2.5vw;
+      display: flex;
+      align-items: center;
+    }
+    :deep(.el-card__body) {
+      height: calc(100% - 2.5vw);
+    }
+    :deep(.ele-pro-table) {
+      height: 99%;
+    }
+    .sparePart {
+      font-size: 0.70vw;
+      font-weight: bold;
+      position: absolute;
       display: flex;
       flex-direction: column;
-      margin-bottom: 10px;
-      .list {
-        flex: 1;
-        display: flex;
-        > div {
-          flex: 1;
-          display: flex;
-          align-items: center;
-          margin-left: 20px;
-          > img {
-            width: 40px;
-            height: 40px;
-            margin-right: 10px;
-            background-color: #157a2c;
-            border-radius: 50%;
-            padding: 10px;
-            box-sizing: border-box;
-          }
-          > div {
-            font-size: 14px;
-          }
-        }
-      }
+      top: 20%;
+      left: 5%;
     }
-    .warning_bar {
-      height: 50px;
-      border-radius: 8px;
+  }
+
+  // :deep(.el-card + .el-card){
+  //     margin-top: 0;
+  //   }
+  .char {
+    display: flex;
+    justify-content: space-between;
+    margin-top: 15px;
+    height: calc(40% - 15px);
+    > .box-card {
+      margin-top: 0;
+    }
+  }
+  .list {
+    display: flex;
+    box-sizing: border-box;
+    height: 100%;
+    margin-top: 5px;
+    > div {
+      flex: 1;
       display: flex;
       align-items: center;
-      background-color: #ffeded;
-      padding: 10px 20px;
-      box-sizing: border-box;
-      margin-bottom: 10px;
-      color: #ff4949;
-      .el-icon-message-solid {
-        margin-top: 2px;
+      background-color: #398f4d;
+      margin-left: 7.5px;
+      margin-right: 7.5px;
+      border-radius: 8px;
+      color: #fff;
+      height: 90%;
+      cursor: pointer;
+      .img_box {
+        // flex: 0 0 130px;
+        width: 3vw;
+        height: 100%;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        border-top-right-radius: 50%;
+        border-bottom-right-radius: 50%;
+        border-top-left-radius: 8px;
+        border-bottom-left-radius: 8px;
+        background-color: #38994e;
+        > img {
+          width: 2.5vw;
+          height: 2.5vw;
+        }
       }
+
       > div {
-        margin-left: 10px;
         flex: 1;
-        font-size: 14px;
+        // font-size: 16px;
+        font-size: 0.7vw;
+
+        display: flex;
+        flex-direction: column;
+        align-items: center;
+        justify-content: center;
+        .text {
+          margin-top: 10px;
+
+          // font-size: 20px;
+        }
       }
     }
-    .info_bar {
-      flex: 1 0 auto;
-      height: 0;
-      width: 100%;
+  }
+  .statusList {
+    display: flex;
+    height: 100%;
+    color: #fff;
+    flex-wrap: wrap;
+    justify-content: space-around;
+    align-items: center;
+    > div {
+      width: 46%;
+      height: 3.3vw;
       display: flex;
-      overflow: hidden;
-      margin-bottom: 10px;
-      .echarts_box {
-        flex: 3;
-        height: 100%;
-        margin-right: 10px;
-        background-color: #fff;
-        border-radius: 8px;
-        padding: 20px;
-        box-sizing: border-box;
+      align-items: center;
+
+      > div {
+        position: relative;
         display: flex;
-        flex-direction: column;
-        .search_box {
-          display: flex;
-          .tabs {
-            flex: 1;
-          }
-          ::v-deep .el-radio-button__inner:hover {
-            color: #157a2c;
-          }
-          ::v-deep
-            .el-radio-button__orig-radio:checked
-            + .el-radio-button__inner {
-            background-color: #157a2c;
-          }
-          ::v-deep
-            .el-radio-button__orig-radio:checked
-            + .el-radio-button__inner:hover {
-            color: #fff;
-          }
-        }
-        .echatrs {
-          flex: 1;
+        height: 100%;
+        img {
+          position: absolute;
+          width: 100%;
           height: 100%;
+          top: 0;
+          left: 0;
         }
       }
-      .toDo {
-        flex: 1;
-        overflow: hidden;
-        height: 100%;
-        background-color: #fff;
-        border-radius: 8px;
-        .list {
-          flex: 1;
-          overflow: hidden;
-          .scroll_box {
-            width: 100%;
-            font-size: 15px;
-            .srcoll_item {
-              width: 100%;
-              overflow: hidden;
-              white-space: nowrap;
-              text-overflow: ellipsis;
-            }
-          }
-        }
+      .left {
+        width: 3vw;
+        font-size: 0.7vw;
+        align-items: center;
+        justify-content: center;
+        font-weight: 600;
       }
-    }
-    .worker_bar {
-      height: 200px;
-      display: flex;
-      .history {
-        flex: 3;
-        height: 100%;
-        margin-right: 10px;
-        background-color: #fff;
-        border-radius: 8px;
-        display: flex;
-        flex-direction: column;
-        .list {
-          flex: 1;
+      .right {
+        height: 2.6vw;
+        font-family: 'MyFont';
+        color: #fff;
+        margin-left: 8px;
+        width: calc(100% - 3vw - 5px);
+        align-items: center;
+        justify-content: center;
+        > div {
+          position: absolute;
+          font-size: 0.6vw;
           display: flex;
-          padding: 10px 20px;
-          box-sizing: border-box;
-          > div {
-            flex: 1;
-            display: flex;
-            align-items: center;
-            background-color: #398f4d;
-            margin-right: 30px;
-            margin-bottom: 30px;
-            border-radius: 8px;
-            color: #fff;
-            .img_box {
-              flex: 0 0 130px;
-              height: 100%;
-              display: flex;
-              align-items: center;
-              justify-content: center;
-              border-top-right-radius: 50%;
-              border-bottom-right-radius: 50%;
-              border-top-left-radius: 8px;
-              border-bottom-left-radius: 8px;
-              background-color: #38994e;
-              > img {
-                width: 80px;
-                height: 80px;
-              }
-            }
+          align-items: center;
+          span:nth-of-type(1){
+            margin-right: .6vw;
+            font-size: 0.9vw;
 
-            > div {
-              flex: 1;
-              font-size: 16px;
-              display: flex;
-              flex-direction: column;
-              align-items: center;
-              justify-content: center;
-              .text {
-                margin-top: 10px;
-                font-size: 20px;
-              }
-            }
           }
+          // top:15px
         }
       }
-      .total {
-        flex: 1;
-        height: 100%;
-        background-color: #fff;
-        border-radius: 8px;
-        display: flex;
-        flex-direction: column;
-        .list {
-          flex: 1;
-          overflow: hidden;
-          .scroll_box {
-            width: 100%;
-            .srcoll_item {
-              display: flex;
-              align-items: center;
-              justify-content: center;
-              .el-progress {
-                flex: 1;
-                margin-right: 10px;
-              }
-              .name {
-                width: 40px;
-                margin-right: 10px;
-              }
-            }
-          }
-        }
+    }
+  }
+}
+.scrollList {
+  height: 100%;
+  font-size: 0.6vw;
+  color: #333;
+  .tableList_header {
+    width: 100%;
+    display: flex;
+    font-weight: bold;
+
+    span {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      height: 2vw;
+      background: #f6f6f6;
+    }
+  }
+  .tableList {
+    height: calc(100% - 2vw);
+  }
+  .scroll_box {
+    height: 100%;
+    overflow: hidden;
+    .srcoll_item {
+      width: 100%;
+      display: flex;
+      min-height: 25px;
+
+      span {
+        text-align: center;
+        overflow: hidden;
+        white-space: nowrap;
+        text-overflow: ellipsis;
       }
     }
   }
+}
 </style>
 <style>
-  .el-select-dropdown__item.selected {
-    color: #157a2c !important;
-  }
+.el-select-dropdown__item.selected {
+  color: #157a2c !important;
+}
 </style>

+ 361 - 585
src/views/ledgerAssets/components/assetInformation.vue

@@ -2,9 +2,8 @@
   <div id="assetInformation" class="baseinfo-container">
     <el-form label-width="120px" :model="{ ...zcInfo }" ref="form">
       <div class="content">
-        <div class="basic-details-title border-none">
-          <span class="border-span">资产信息</span>
-        </div>
+        <headerTitle title="资产信息" style="margin-top: 15px"></headerTitle>
+
         <el-descriptions
           title=""
           :column="4"
@@ -51,82 +50,50 @@
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item>
-            <template slot="label"> 有效期开始 </template>
+            <template slot="label"> 出厂编码</template>
             <el-form-item label-width="0">
-              <el-date-picker
-                style="width: 100%"
-                v-model="zcInfo.startTime"
-                type="month"
-                value-format="yyyy-MM"
-                placeholder="选择有效期开始"
-              >
-              </el-date-picker>
+              <el-input class="input" v-model="zcInfo.exFactoryCode"></el-input>
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item>
-            <template slot="label"> 有效期结束 </template>
+            <template slot="label"> 制造日期 </template>
             <el-form-item label-width="0">
               <el-date-picker
                 style="width: 100%"
-                v-model="zcInfo.endTime"
-                @change="endTimeRules"
-                value-format="yyyy-MM"
-                type="month"
-                placeholder="选择有效期结束"
+                v-model="zcInfo.manufactureTime"
+                type="date"
+                placeholder="选择制造日期"
+                value-format="yyyy-MM-dd"
               >
               </el-date-picker>
             </el-form-item>
           </el-descriptions-item>
-          <!-- <el-descriptions-item>
-            <template slot="label"> 状态 </template>
-            <el-form-item label-width="0">
-              <el-input
-                v-model="zcInfo.status"
-                placeholder="请输入状态"
-              ></el-input>
-            </el-form-item>
-          </el-descriptions-item> -->
           <el-descriptions-item>
-            <template slot="label"> 入账日期 </template>
+            <template slot="label"> 始用日期 </template>
             <el-form-item label-width="0">
               <el-date-picker
                 style="width: 100%"
-                v-model="zcInfo.entryDate"
+                v-model="zcInfo.startUsingTime"
                 type="date"
-                placeholder="选择入账日期"
+                placeholder="选择始用日期"
                 value-format="yyyy-MM-dd"
               >
               </el-date-picker>
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item>
-            <template slot="label"> 周期 </template>
+            <template slot="label"> 建帐日期 </template>
             <el-form-item label-width="0">
-              <el-select
+              <el-date-picker
                 style="width: 100%"
-                v-model="zcInfo.cycle"
-                placeholder="请选择"
+                v-model="zcInfo.createAccountsTime"
+                type="date"
+                placeholder="选择建帐日期"
+                value-format="yyyy-MM-dd"
               >
-                <el-option
-                  v-for="item in options.deliveryCycle"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                >
-                </el-option>
-              </el-select>
+              </el-date-picker>
             </el-form-item>
           </el-descriptions-item>
-        </el-descriptions>
-        <el-descriptions
-          title=""
-          :column="3"
-          size="medium"
-          border
-          style="edit"
-          :label-style="labelStyle"
-          class="descriptions"
-        >
           <el-descriptions-item>
             <template slot="label"> 权属部门 </template>
             <el-form-item label-width="0">
@@ -166,174 +133,69 @@
               </el-select> -->
             </el-form-item>
           </el-descriptions-item>
-          <el-descriptions-item :span="3">
-            <template slot="label"> 所属厂房 </template>
+
+          <el-descriptions-item>
+            <template slot="label"> 所属工序 </template>
             <el-form-item label-width="0">
-              <!-- <el-select
-                v-model="zcInfo.factoryRoomId"
-                placeholder="请选择"
-                @change="change_factoryId"
-                style="width: 24%; margin-right: 1%"
-              >
-                <el-option
-                  v-for="item in factoryOptions"
-                  :key="item.id"
-                  :label="item.pathName"
-                  :value="item.id"
-                >
-                </el-option>
-              </el-select>
-              <el-select
-                v-model="zcInfo.workshopId"
-                placeholder="请选择"
-                style="width: 24%; margin-right: 1%"
-                @change="change_workshop"
-              >
-                <el-option
-                  v-for="item in workshopOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                >
-                </el-option>
-              </el-select>
-              <el-select
-                v-model="zcInfo.productionLineId"
-                placeholder="请选择"
-                style="width: 24%; margin-right: 1%"
-                @change="change_productionLineId"
-              >
-                <el-option
-                  v-for="item in productionLineOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                >
-                </el-option>
-              </el-select>
-              <el-select
-                v-model="zcInfo.stationId"
-                placeholder="请选择"
-                style="width: 24%; margin-right: 1%"
-                @change="change_stationId"
-              >
-                <el-option
-                  v-for="item in stationOptions"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                >
-                </el-option>
-              </el-select> -->
-              <el-input
-                style="margin-right: 10px; width: 20%"
-                v-model="zcInfo.workstation.workshopPlanName"
-                disabled
-                placeholder="请输入内容"
-              ></el-input>
-              <el-input
-                style="margin-right: 10px; width: 20%"
-                v-model="zcInfo.workstation.workshopName"
-                disabled
-                placeholder="请输入内容"
-              ></el-input>
-              <el-input
-                style="margin-right: 10px; width: 20%"
-                v-model="zcInfo.workstation.productionLineName"
-                disabled
-                placeholder="请输入内容"
-              ></el-input>
               <el-input
-                style="margin-right: 10px; width: 20%"
-                v-model="zcInfo.workstation.name"
+                v-model="zcInfo.workstation.taskNames"
                 disabled
                 placeholder="请输入内容"
               ></el-input>
             </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="zcInfo.workstation.taskNames"
-                disabled
+                v-model="zcInfo.alreadyServiceLife"
                 placeholder="请输入内容"
               ></el-input>
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item>
-            <template slot="label"> 设备位置 </template>
-            <el-form-item label-width="0" prop="location">
-              <div style="display: flex">
-                <el-cascader
-                  clearable
-                  v-model="zcInfo.location"
-                  :options="options.cityDataLabel"
-                ></el-cascader>
-                <el-input
-                  style="width: 60%; margin-left: 10px"
-                  placeholder="详细地址"
-                  v-model="zcInfo.deviceDetailAddress"
-                ></el-input>
-              </div>
+            <template slot="label"> 增值金额 </template>
+            <el-form-item label-width="0">
+              <el-input
+                v-model="zcInfo.incrementAmount"
+                placeholder="请输入内容"
+              ></el-input>
             </el-form-item>
           </el-descriptions-item>
-        </el-descriptions>
-        <el-descriptions
-          title=""
-          :column="5"
-          size="medium"
-          border
-          style="edit"
-          :label-style="labelStyle"
-          class="descriptions"
-        >
           <el-descriptions-item>
-            <template slot="label"> 片区负责人部门 </template>
+            <template slot="label"> 增值日期 </template>
             <el-form-item label-width="0">
-              <div class="input">
-                <DeptSelect v-model="zcInfo.repairGroupId" @input="getwhbm" />
-              </div>
+              <el-date-picker
+                style="width: 100%"
+                v-model="zcInfo.incrementTime"
+                type="date"
+                placeholder="选择增值日期"
+                value-format="yyyy-MM-dd"
+              >
+              </el-date-picker>
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item>
-            <template slot="label"> 片区负责人 </template>
+            <template slot="label"> 原值 </template>
             <el-form-item label-width="0">
-              <el-select
-                style="width: 100%"
-                v-model="zcInfo.repairUserId"
-                placeholder="请选择"
-              >
-                <el-option
-                  v-for="item in options.repairUserId"
-                  :key="item.id"
-                  :label="item.name"
-                  :value="item.id"
-                >
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="zcInfo.originalValue"
+                placeholder="请输入内容"
+              ></el-input>
             </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="zcInfo.repairsDeptPhone"
-                disabled
+                v-model="zcInfo.Import"
                 placeholder="请输入内容"
               ></el-input>
             </el-form-item>
           </el-descriptions-item>
-        </el-descriptions>
-        <el-descriptions
-          title=""
-          :column="5"
-          size="medium"
-          border
-          style="edit"
-          :label-style="labelStyle"
-          class="descriptions"
-        >
+
+      
+         
           <el-descriptions-item>
             <template slot="label"> 类型 </template>
             <el-form-item label-width="0">
@@ -341,7 +203,7 @@
                 style="width: 100%"
                 v-model="zcInfo.isPublic"
                 filterable
-                placeholder="请选择使用人"
+                placeholder="请选择类型"
               >
                 <el-option
                   v-for="item in typeOptions"
@@ -354,7 +216,7 @@
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item>
-            <template slot="label"> 使用岗位 </template>
+            <template slot="label"> 使用单位 </template>
             <el-form-item label-width="0">
               <DeptSelect v-model="zcInfo.postId" @input="auditorDeptClick" />
             </el-form-item>
@@ -402,15 +264,6 @@
               </el-select>
             </el-form-item>
           </el-descriptions-item>
-        </el-descriptions>
-        <el-descriptions
-          title=""
-          :column="3"
-          size="medium"
-          border
-          style="edit"
-          :label-style="labelStyle"
-        >
           <el-descriptions-item>
             <template slot="label"> 供应商 </template>
             <el-form-item label-width="0">
@@ -429,20 +282,43 @@
               </el-select>
             </el-form-item>
           </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 制造厂</template>
+            <el-form-item label-width="0">
+              <el-input class="input" v-model="zcInfo.manufacturer"></el-input>
+            </el-form-item>
+          </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label"> 品牌 </template>
             <el-form-item label-width="0">
               <el-input v-model="zcInfo.brand" class="input"></el-input>
             </el-form-item>
           </el-descriptions-item>
-          <el-descriptions-item>
+          <el-descriptions-item :span="2">
             <template slot="label"> 设备用途 </template>
             <el-form-item label-width="0">
               <el-input v-model="zcInfo.purpose" class="input"></el-input>
             </el-form-item>
           </el-descriptions-item>
-
-          <el-descriptions-item>
+          <el-descriptions-item :span="4">
+            <template slot="label"> 设备位置 </template>
+            <el-form-item label-width="0" prop="location">
+              <div style="display: flex">
+                <el-cascader
+                  style="width: 40%"
+                  clearable
+                  v-model="zcInfo.location"
+                  :options="options.cityDataLabel"
+                ></el-cascader>
+                <el-input
+                  style="margin-left: 10px"
+                  placeholder="详细地址"
+                  v-model="zcInfo.deviceDetailAddress"
+                ></el-input>
+              </div>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item :span="4">
             <template slot="label"> 备注 </template>
             <el-form-item label-width="0">
               <el-input
@@ -460,415 +336,315 @@
 </template>
 
 <script>
-  import {
-    listWorkshopByParentId,
-    listFactoryLine,
-    getFactoryarea,
-    listByProductionLineId,
-    getByDeviceId
-  } from '@/api/factoryModel';
-  import DeptSelect from '@/components/CommomSelect/dept-select.vue';
-  import WorkshopSelect from '@/components/CommomSelect/workshop-select.vue';
-  import FactoryAreaSelect from '@/components/CommomSelect/factory-area-select.vue';
-  import WorkingProcedureSelect from '@/components/CommomSelect/working-procedure-select.vue';
-  import factorySelect from '@/components/CommomSelect/factory-select.vue';
-  import fileUpload from '@/components/upload/fileUpload';
-  import WithView from '@/components/upload/WithView';
-  import imgUpload from '@/components/upload/imgUpload';
-  import { cityDataLabel } from 'ele-admin/packages/utils/regions';
-  import personSelect from '@/components/CommomSelect/person-select.vue';
-  import { saveOrEdit, getAssetInfo } from '@/api/ledgerAssets';
-  import { getUserPage } from '@/api/system/organization';
-  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
-  import { getByCode } from '@/api/system/dictionary-data';
-  import { data } from 'ele-admin/lib/ele-pro-table';
-  export default {
-    components: {
-      WithView,
-      WorkshopSelect,
-      FactoryAreaSelect,
-      WorkingProcedureSelect,
-      fileUpload,
-      imgUpload,
-      factorySelect,
-      DeptSelect,
-      personSelect
-    },
-    props: {
-      isEdit: {
-        type: Boolean,
-        default: true
-      }
-    },
-    data() {
-      return {
-        factoryOptions: [],
-        workshopOptions: [],
-        productionLineOptions: [],
-        stationOptions: [],
-        userList: [], // 人员列表
-        labelStyle: {
-          'min-width': '100px'
-        },
-        pageType: 'add',
-        id: '', // 设备主键id
-        rules: {
-          name: [
-            { required: true, message: '请输入设备名称', trigger: 'blur' }
-          ],
-          code: [{ required: true, message: '请输入设备编码', trigger: 'blur' }]
-        },
-        typeOptions: [
-          {
-            id: 0,
-            name: '专用'
-          },
-          {
-            id: 1,
-            name: '公用'
-          }
-        ],
-        // 资产信息
-        // zcInfo: {
-        //   // 	固定资产编码
-        //   fixCode: '',
-        //   // 颜色
-        //   color: '',
-        //   // 重量
-        //   weight: '',
-        //   // 维护部门
-        //   repairGroupId: '',
-        //   repairUserId: '',
-        //   // 设备用途
-        //   purpose: '',
-        //   // 设备位置
-        //   location: '',
-        //   //品牌
-        //   brand: '',
-        //   // 供应商code
-        //   supplierId: '',
-        //   // 编号
-        //   codeNumber: '',
-        //   // 使用人
-        //   usePersonId: '',
-        //   // 有效期开始
-        //   startTime: '',
-        //   // 有效结束
-        //   endTime: '',
-        //   // 级别
-        //   level: '',
-        //   // 状态
-        //   status: '',
-        //   // 负责人
-        //   chargePersonId: '',
-        //   // 入账日期
-        //   entryDate: '',
-        //   // 周期
-        //   cycle: '',
-        //   // 备注
-        //   remark: '',
-        //   // 使用岗位
-        //   postId: ''
-        // },
-        options: {
-          ownershipUserId: [], // 权属人
-          repairUserId: [], // 维护人
-          supplierId: [], // 供应商
-          cityDataLabel, // 设备位置
-          assetLevel: [], // 资产级别
-          deliveryCycle: [], // 送检周期
-          suppList: [] // 供应商
+import DeptSelect from '@/components/CommomSelect/dept-select.vue';
+import WorkshopSelect from '@/components/CommomSelect/workshop-select.vue';
+import FactoryAreaSelect from '@/components/CommomSelect/factory-area-select.vue';
+import WorkingProcedureSelect from '@/components/CommomSelect/working-procedure-select.vue';
+import factorySelect from '@/components/CommomSelect/factory-select.vue';
+import fileUpload from '@/components/upload/fileUpload';
+import WithView from '@/components/upload/WithView';
+import imgUpload from '@/components/upload/imgUpload';
+import { cityDataLabel } from 'ele-admin/packages/utils/regions';
+import personSelect from '@/components/CommomSelect/person-select.vue';
+import { saveOrEdit, getAssetInfo } from '@/api/ledgerAssets';
+import { getUserPage } from '@/api/system/organization';
+import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
+import { getByCode } from '@/api/system/dictionary-data';
+import { data } from 'ele-admin/lib/ele-pro-table';
+export default {
+  components: {
+    WithView,
+    WorkshopSelect,
+    FactoryAreaSelect,
+    WorkingProcedureSelect,
+    fileUpload,
+    imgUpload,
+    factorySelect,
+    DeptSelect,
+    personSelect
+  },
+  props: {
+    isEdit: {
+      type: Boolean,
+      default: true
+    }
+  },
+  data() {
+    return {
+      userList: [], // 人员列表
+      labelStyle: {
+        width: '180px'
+      },
+   
+      pageType: 'add',
+      id: '', // 设备主键id
+      rules: {
+        name: [{ required: true, message: '请输入设备名称', trigger: 'blur' }],
+        code: [{ required: true, message: '请输入设备编码', trigger: 'blur' }]
+      },
+      typeOptions: [
+        {
+          id: 0,
+          name: '专用'
         },
-        zcInfo: {
-          workstation: {}
-        }
-      };
-    },
-    props: {
-      form: {
-        type: Object,
-        default: {
-          workstation: {}
+        {
+          id: 1,
+          name: '公用'
         }
+      ],
+      // 资产信息
+      // zcInfo: {
+      //   // 	固定资产编码
+      //   fixCode: '',
+      //   // 颜色
+      //   color: '',
+      //   // 重量
+      //   weight: '',
+      //   // 维护部门
+      //   repairGroupId: '',
+      //   repairUserId: '',
+      //   // 设备用途
+      //   purpose: '',
+      //   // 设备位置
+      //   location: '',
+      //   //品牌
+      //   brand: '',
+      //   // 供应商code
+      //   supplierId: '',
+      //   // 编号
+      //   codeNumber: '',
+      //   // 使用人
+      //   usePersonId: '',
+      //   // 有效期开始
+      //   startTime: '',
+      //   // 有效结束
+      //   endTime: '',
+      //   // 级别
+      //   level: '',
+      //   // 状态
+      //   status: '',
+      //   // 负责人
+      //   chargePersonId: '',
+      //   // 入账日期
+      //   entryDate: '',
+      //   // 周期
+      //   cycle: '',
+      //   // 备注
+      //   remark: '',
+      //   // 使用岗位
+      //   postId: ''
+      // },
+      options: {
+        ownershipUserId: [], // 权属人
+        repairUserId: [], // 维护人
+        supplierId: [], // 供应商
+        cityDataLabel, // 设备位置
+        assetLevel: [], // 资产级别
+        deliveryCycle: [], // 送检周期
+        suppList: [] // 供应商
       },
-      isLock: {
-        type: Boolean,
-        default: false
+      zcInfo: {
+        workstation: {}
+      }
+    };
+  },
+  props: {
+    form: {
+      type: Object,
+      default: {
+        workstation: {}
       }
     },
-    watch: {
-      form: {
-        //监听的对象
-        deep: true, //深度监听设置为 true
-        handler: function (newValue) {
-          this.zcInfo = newValue;
-        }
+    isLock: {
+      type: Boolean,
+      default: false
+    }
+  },
+  watch: {
+    form: {
+      //监听的对象
+      deep: true, //深度监听设置为 true
+      handler: function (newValue) {
+        this.zcInfo = newValue;
+      }
+    }
+  },
+  async mounted() {
+    // 获取资产级别下拉框
+    await this.getAssetLevelOptions();
+    // 获取送检周期下拉
+    await this.getDeliveryCycleOptions();
+    // 获取供应商下拉列表
+    await this.getSuppliersList();
+
+    // 初始化数据
+    setTimeout(() => {
+      this.initData();
+    }, 500);
+  },
+  methods: {
+    usePersonIdChange(val) {
+      if (this.zcInfo.isPublic > 0 && this.isLock) {
+        this.zcInfo.chargePersonId = val;
       }
+      this.$forceUpdate();
     },
-    async mounted() {
-      // 获取资产级别下拉框
-      await this.getAssetLevelOptions();
-      // 获取送检周期下拉
-      await this.getDeliveryCycleOptions();
-      // 获取供应商下拉列表
-      await this.getSuppliersList();
-      // 获取厂房数据
-      this.getFactoryareaList();
-      // 初始化数据
-      setTimeout(() => {
-        this.initData();
-      }, 500);
+    personIdChange() {
+      this.$forceUpdate();
     },
-    methods: {
-      // 获取工厂数据
-      getFactoryareaList() {
-        getFactoryarea({
-          type: 1,
-          size: 9999,
-          type: 2
-        }).then((res) => {
-          this.factoryOptions = res.list;
-        });
-      },
-      change_factoryId(id) {
-        this.zcInfo.workshopId = '';
-        this.zcInfo.productionLineId = '';
-        this.zcInfo.stationId = '';
-        this.workshopOptions = [];
-        this.productionLineOptions = [];
-        this.stationOptions = [];
-        this.zcInfo.factoryRoomId = id;
-        this.zcInfo.factoryRoomName = this.factoryOptions.filter(
-          (item) => item.id === id
-        )[0].pathName;
-        this.getListWorkshopByParentId(id);
-      },
-      // 获取车间
-      getListWorkshopByParentId(id) {
-        listWorkshopByParentId(id).then((res) => {
-          this.workshopOptions = res;
-        });
-      },
-      change_workshop(id) {
-        this.zcInfo.productionLineId = '';
-        this.zcInfo.stationId = '';
-        this.productionLineOptions = [];
-        this.stationOptions = [];
-        this.zcInfo.workshopName = this.workshopOptions.filter(
-          (item) => item.id === id
-        )[0].name;
-        this.getlistFactoryLineByParentId(id);
-      },
-      // 获取产线
-      getlistFactoryLineByParentId(id) {
-        listFactoryLine([id]).then((res) => {
-          this.productionLineOptions = res;
-        });
-      },
-      change_productionLineId(id) {
-        this.zcInfo.stationId = '';
-        this.stationOptions = [];
-        this.zcInfo.productionLineName = this.productionLineOptions.filter(
-          (item) => item.id === id
-        )[0].name;
-        this.getlistByProductionLineId(id);
-      },
-      // 获取工位
-      getlistByProductionLineId(id) {
-        listByProductionLineId(id).then((res) => {
-          this.stationOptions = res;
-        });
-      },
-      change_stationId(id) {
-        this.$forceUpdate();
-        this.zcInfo.stationName = this.stationOptions.filter(
-          (item) => item.id === id
-        )[0].name;
-      },
-      usePersonIdChange(val) {
-        if (this.zcInfo.isPublic > 0 && this.isLock) {
-          this.zcInfo.chargePersonId = val;
-        }
-        this.$forceUpdate();
-      },
-      personIdChange() {
-        this.$forceUpdate();
-      },
-      // 限制结束时间
-      endTimeRules() {
-        if (this.zcInfo.startTime) {
-          console.log(this.zcInfo.startTime);
-          console.log(new Date(this.zcInfo.startTime).getTime());
-          let differenceTime =
-            new Date(this.zcInfo.endTime).getTime() -
-            new Date(this.zcInfo.startTime).getTime();
-          if (differenceTime <= 0) {
-            this.$message.error('请选择正确的有效结束时间');
-            this.zcInfo.endTime = '';
-          }
-        } else {
-          this.$message.error('请选择有效开始时间');
-          this.zcInfo.endTime = '';
-        }
-      },
-      // 获取资产级别下拉
-      async getAssetLevelOptions() {
-        let { data } = await getByCode('asset_level');
-        this.options.assetLevel =
-          data.length > 0
-            ? data.map((item) => {
-                return {
-                  name: Object.keys(item)[0],
-                  id: item[Object.keys(item)[0]]
-                };
-              })
-            : [];
-      },
-      // 获取送检周期下拉
-      async getDeliveryCycleOptions() {
-        let { data } = await getByCode('delivery_cycle');
-        console.log(data);
-        this.options.deliveryCycle =
-          data.length > 0
-            ? data.map((item) => {
-                return {
-                  name: item[Object.keys(item)[0]],
-                  id: +Object.keys(item)[0]
-                };
-              })
-            : [];
-      },
-      // 获取维护人下拉列表
-      async geMaintainersList() {
-        if (!this.zcInfo.repairGroupId) return;
-        let data = await getUserPage({
-          pageNum: 1,
-          size: 9999,
-          groupId: this.zcInfo.repairGroupId
-        });
-        this.options.repairUserId = data.list;
-      },
-      // 使用岗位点击事件
-      async auditorDeptClick(data) {
-        this.zcInfo.chargePersonId = '';
-        this.zcInfo.usePersonId = '';
-        this.userList = [];
-        if (data) {
-          this.getStaffList(data);
-        }
-      },
-      // 获取供应商下拉列表
-      async getSuppliersList() {
-        const rep = await warehouseDefinition.eomContact({
-          type: 2,
-          status: 1,
-          size: -1,
-          pageNum: 1
-        });
-        this.options.suppList = rep.list;
-      },
-      // 通过部门岗位获取人员列表
-      async getStaffList(id) {
-        let res = await warehouseDefinition.getUserPage({
-          groupId: id,
-          size: 9999,
-          page: 1
-        });
-        this.userList = res.list;
-      },
-      // 权属部门
-      async getqsbm() {
-        if (!this.zcInfo.ownershipGroupId) {
-          this.options.ownershipUserId = [];
-          this.zcInfo.ownershipUserId = '';
-        } else {
-          let data = await getUserPage({
-            pageNum: 1,
-            size: 9999,
-            groupId: this.zcInfo.ownershipGroupId
-          });
-          this.options.ownershipUserId = data.list;
-        }
-      },
-      // 维护部门
-      async getwhbm() {
-        if (!this.zcInfo.repairGroupId) return;
+
+    // 获取资产级别下拉
+    async getAssetLevelOptions() {
+      let { data } = await getByCode('asset_level');
+      this.options.assetLevel =
+        data.length > 0
+          ? data.map((item) => {
+              return {
+                name: Object.keys(item)[0],
+                id: item[Object.keys(item)[0]]
+              };
+            })
+          : [];
+    },
+    // 获取送检周期下拉
+    async getDeliveryCycleOptions() {
+      let { data } = await getByCode('delivery_cycle');
+      console.log(data);
+      this.options.deliveryCycle =
+        data.length > 0
+          ? data.map((item) => {
+              return {
+                name: item[Object.keys(item)[0]],
+                id: +Object.keys(item)[0]
+              };
+            })
+          : [];
+    },
+    // 获取维护人下拉列表
+    async geMaintainersList() {
+      if (!this.zcInfo.areaPersonInChargeGroupId) return;
+      let data = await getUserPage({
+        pageNum: 1,
+        size: 9999,
+        groupId: this.zcInfo.areaPersonInChargeGroupId
+      });
+      this.options.repairUserId = data.list;
+    },
+    // 使用岗位点击事件
+    async auditorDeptClick(data) {
+      this.zcInfo.chargePersonId = '';
+      this.zcInfo.usePersonId = '';
+      this.userList = [];
+      if (data) {
+        this.getStaffList(data);
+      }
+    },
+    // 获取供应商下拉列表
+    async getSuppliersList() {
+      const rep = await warehouseDefinition.eomContact({
+        type: 2,
+        status: 1,
+        size: -1,
+        pageNum: 1
+      });
+      this.options.suppList = rep.list;
+    },
+    // 通过部门岗位获取人员列表
+    async getStaffList(id) {
+      let res = await warehouseDefinition.getUserPage({
+        groupId: id,
+        size: 9999,
+        page: 1
+      });
+      this.userList = res.list;
+    },
+    // 权属部门
+    async getqsbm() {
+      if (!this.zcInfo.ownershipGroupId) {
+        this.options.ownershipUserId = [];
+        this.zcInfo.ownershipUserId = '';
+      } else {
         let data = await getUserPage({
           pageNum: 1,
           size: 9999,
-          groupId: this.zcInfo.repairGroupId
+          groupId: this.zcInfo.ownershipGroupId
         });
-        this.options.repairUserId = data.list;
-      },
-      // 初始化
-      async initData() {
-        console.log('this.zcInfo---------------------', this.zcInfo);
-        // 填充使用岗位
-        this.zcInfo.postId && this.getStaffList(this.zcInfo.postId);
-        // 获取设备绑定信息
-        this.geMaintainersList();
+        this.options.ownershipUserId = data.list;
       }
+    },
+  
+    // 初始化
+    async initData() {
+      console.log('this.zcInfo---------------------', this.zcInfo);
+      // 填充使用岗位
+      this.zcInfo.postId && this.getStaffList(this.zcInfo.postId);
+      // 获取设备绑定信息
+      this.geMaintainersList();
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  ::v-deep .descriptions {
-    margin-bottom: 10px;
+:deep(.el-descriptions-item__label.is-bordered-label) {
+  color: #606266;
+}
+::v-deep .descriptions {
+  margin-bottom: 10px;
+}
+.baseinfo-container .basic-details-title {
+  font-size: 16px;
+  margin: 15px 0;
+}
+.upload-container {
+  display: flex;
+  justify-content: flex-start;
+  .file-list {
+    margin-left: 50px;
+    flex: 1;
   }
-  .baseinfo-container .basic-details-title {
-    font-size: 16px;
-    margin: 15px 0;
-  }
-  .upload-container {
-    display: flex;
-    justify-content: flex-start;
-    .file-list {
-      margin-left: 50px;
-      flex: 1;
+}
+.equipment-container {
+  // .content {
+  //   padding: 0 20px;
+  // }
+  .label-none {
+    .el-form-item__content {
+      margin-left: 0 !important;
     }
   }
-  .equipment-container {
-    // .content {
-    //   padding: 0 20px;
-    // }
-    .label-none {
-      .el-form-item__content {
-        margin-left: 0 !important;
-      }
-    }
+}
+.sbwz {
+  .item {
+    width: 120px !important;
   }
-  .sbwz {
-    .item {
-      width: 120px !important;
-    }
-    .item + .item {
-      margin-left: 10px;
-    }
-    .item-input {
-      width: 350px !important;
-    }
+  .item + .item {
+    margin-left: 10px;
   }
-  .input {
-    width: 100%;
+  .item-input {
+    width: 350px !important;
   }
-  .kzzd {
-    width: 500px;
-    .add-col {
-      display: flex;
-      .col-input {
-        & + .col-input {
-          margin-left: 10px;
-        }
-      }
-      .del {
+}
+.input {
+  width: 100%;
+}
+.kzzd {
+  width: 500px;
+  .add-col {
+    display: flex;
+    .col-input {
+      & + .col-input {
         margin-left: 10px;
       }
     }
-  }
-  ::v-deep .el-descriptions {
-    .el-form-item {
-      margin-bottom: 0px;
+    .del {
+      margin-left: 10px;
     }
   }
+}
+::v-deep .el-descriptions {
+  .el-form-item {
+    margin-bottom: 0px;
+  }
+}
 </style>

+ 10 - 7
src/views/ledgerAssets/components/basicInfo.vue

@@ -2,13 +2,13 @@
   <!-- 基本信息 -->
   <div class="baseinfo-container" style="padding: 0">
     <div class="basic-details-title border-none">
-      <span class="border-span">基本信息</span>
+      <headerTitle title="基本信息" style="margin-top: 15px"></headerTitle>
+
     </div>
     <el-descriptions
       :label-style="labelStyle"
-      :contentStyle="contentStyle"
       title=""
-      :column="3"
+      :column="4"
       size="medium"
       border
     >
@@ -78,11 +78,11 @@
     data() {
       return {
         labelStyle: {
-          width: '200px'
-        },
-        contentStyle: {
-          width: '400px'
+          width: '180px'
         },
+        // contentStyle: {
+        //   width: '400px'
+        // },
         depInfo: {},
         idata: {}
       };
@@ -116,6 +116,9 @@
 </script>
 
 <style lang="scss" scoped>
+:deep(.el-descriptions-item__label.is-bordered-label) {
+  color: #606266;
+}
   .baseinfo-container {
     background-color: #fff;
     padding: 0px 20px 20px;

+ 491 - 82
src/views/ledgerAssets/components/businessInformation.vue

@@ -2,25 +2,121 @@
   <div id="assetInformation" class="baseinfo-container">
     <el-form label-width="120px" :model="{ ...ywInfo }" ref="form">
       <div class="content">
-        <div class="basic-details-title border-none">
-          <span class="border-span">业务信息</span>
-        </div>
+        <headerTitle title="业务信息" style="margin-top: 15px"></headerTitle>
+
         <el-descriptions
           title=""
-          :column="3"
+          :column="4"
           size="medium"
           border
           style="edit"
           :label-style="labelStyle"
-          :contentStyle="contentStyle"
           class="descriptions"
         >
+          <el-descriptions-item>
+            <template slot="label"> 牌照号码</template>
+            <el-form-item label-width="0">
+              <el-input
+                class="input"
+                v-model="ywInfo.LicensePlateNum"
+              ></el-input>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 功率</template>
+            <el-form-item label-width="0">
+              <el-input class="input" v-model="ywInfo.power"></el-input>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 考核情况</template>
+            <el-form-item label-width="0">
+              <el-input
+                class="input"
+                v-model="ywInfo.assessmentResults"
+              ></el-input>
+            </el-form-item>
+          </el-descriptions-item>
+
+          <el-descriptions-item>
+            <template slot="label"> 入账日期 </template>
+            <el-form-item label-width="0">
+              <el-date-picker
+                style="width: 100%"
+                v-model="ywInfo.entryDate"
+                type="date"
+                placeholder="选择入账日期"
+                value-format="yyyy-MM-dd"
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 使用年限</template>
+            <el-form-item label-width="0">
+              <el-input class="input" v-model="ywInfo.serviceLife"></el-input>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 片区负责人部门 </template>
+            <el-form-item label-width="0">
+              <div class="input">
+                <DeptSelect
+                  v-model="ywInfo.areaPersonInChargeGroupId"
+                  @input="getwhbm"
+                />
+              </div>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 片区负责人 </template>
+            <el-form-item label-width="0">
+              <el-select
+                style="width: 100%"
+                v-model="ywInfo.areaPersonInChargeUserId"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in options.repairUserId"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 片区负责人电话 </template>
+            <el-form-item label-width="0">
+              <el-input
+                v-model="ywInfo.areaPersonInChargePhone"
+                disabled
+                placeholder="请输入内容"
+              ></el-input>
+            </el-form-item>
+          </el-descriptions-item>
+
           <el-descriptions-item>
             <template slot="label"> 生命周期 </template>
             <el-form-item label-width="0">
-              <span>{{ sourceDICTOptions[ywInfo.sourceDICT] }}</span>
+              <DictSelection
+                dictName="设备生命周期"
+                v-model="ywInfo.lifeCycle"
+              ></DictSelection>
             </el-form-item>
           </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 精度等级</template>
+            <DictSelection
+              dictName="精度等级"
+              v-model="ywInfo.accuracyLevel"
+            ></DictSelection>
+            <!-- <el-form-item label-width="0">
+              <el-input class="input" v-model="ywInfo.accuracyLevel"></el-input>
+            </el-form-item> -->
+          </el-descriptions-item>
+
           <el-descriptions-item>
             <template slot="label"> 网络状态 </template>
             <el-form-item label-width="0">
@@ -28,11 +124,173 @@
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item>
-            <template slot="label"> 状态 </template>
+            <template slot="label">设备状态 </template>
             <el-form-item label-width="0">
               <span>{{ statusOptions[ywInfo.status] }}</span>
             </el-form-item>
           </el-descriptions-item>
+          <el-descriptions-item :span="3">
+            <template slot="label"> 工位名称 </template>
+            <el-form-item label-width="0">
+              <el-select
+                v-model="ywInfo.factoryId"
+                placeholder="请选择"
+                @change="change_factoryId"
+                style="width: 24%; margin-right: 1%"
+              >
+                <el-option
+                  v-for="item in factoryOptions"
+                  :key="item.id"
+                  :label="item.pathName"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+              <el-select
+                v-model="ywInfo.workshopId"
+                placeholder="请选择"
+                style="width: 24%; margin-right: 1%"
+                @change="change_workshop"
+              >
+                <el-option
+                  v-for="item in workshopOptions"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+              <el-select
+                v-model="ywInfo.productionLineId"
+                placeholder="请选择"
+                style="width: 24%; margin-right: 1%"
+                @change="change_productionLineId"
+              >
+                <el-option
+                  v-for="item in productionLineOptions"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+              <el-select
+                v-model="ywInfo.workstation"
+                placeholder="请选择"
+                style="width: 24%; margin-right: 1%"
+                @change="change_stationId"
+              >
+                <el-option
+                  v-for="item in stationOptions"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+              <!-- <el-input
+                style="margin-right: 10px; width: 20%"
+                v-model="ywInfo.workstation.workshopPlanName"
+                disabled
+                placeholder="请输入内容"
+              ></el-input>
+              <el-input
+                style="margin-right: 10px; width: 20%"
+                v-model="ywInfo.workstation.workshopName"
+                disabled
+                placeholder="请输入内容"
+              ></el-input>
+              <el-input
+                style="margin-right: 10px; width: 20%"
+                v-model="ywInfo.workstation.productionLineName"
+                disabled
+                placeholder="请输入内容"
+              ></el-input>
+              <el-input
+                style="margin-right: 10px; width: 20%"
+                v-model="ywInfo.workstation.name"
+                disabled
+                placeholder="请输入内容"
+              ></el-input> -->
+            </el-form-item>
+          </el-descriptions-item>
+
+          <el-descriptions-item>
+            <template slot="label"> 改造时间 </template>
+            <el-form-item label-width="0">
+              <el-date-picker
+                style="width: 100%"
+                v-model="ywInfo.reformTime"
+                type="date"
+                placeholder="选择改造时间"
+                value-format="yyyy-MM-dd"
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 改造内容</template>
+            <el-form-item label-width="0">
+              <el-input class="input" v-model="ywInfo.reformContent"></el-input>
+            </el-form-item>
+          </el-descriptions-item>
+        </el-descriptions>
+        <headerTitle title="校准/检验" style="margin-top: 15px"></headerTitle>
+
+        <el-descriptions
+          title=""
+          :column="4"
+          size="medium"
+          border
+          style="edit"
+          :label-style="labelStyle"
+          class="descriptions"
+        >
+          <el-descriptions-item :span="1">
+            <template slot="label"> 有效期开始 </template>
+            <el-form-item label-width="0">
+              <el-date-picker
+                style="width: 100%"
+                v-model="ywInfo.startTime"
+                type="month"
+                value-format="yyyy-MM"
+                placeholder="选择有效期开始"
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item :span="1">
+            <template slot="label"> 有效期结束 </template>
+            <el-form-item label-width="0">
+              <el-date-picker
+                style="width: 100%"
+                v-model="ywInfo.endTime"
+                @change="endTimeRules"
+                value-format="yyyy-MM"
+                type="month"
+                placeholder="选择有效期结束"
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item :span="2">
+            <template slot="label"> 周期 </template>
+            <el-form-item label-width="0">
+              <el-select
+                style="width: 100%"
+                v-model="ywInfo.cycle"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in options.deliveryCycle"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-descriptions-item>
         </el-descriptions>
       </div>
     </el-form>
@@ -40,91 +298,242 @@
 </template>
 
 <script>
-  import {
-    networkStatus,
-    businessStatus,
-    sourceStatus
-  } from '@/utils/dict/warehouse';
-  export default {
-    data() {
-      return {
-        labelStyle: {
-          width: '200px'
-        },
-        contentStyle: {
-          width: '400px'
-        },
-        ywInfo: {},
-        // 状态
-        statusOptions: {},
-        // 生命周期
-        sourceDICTOptions: {},
-        // 网络状态
-        networkStatusOptions: {}
-      };
-    },
-    mounted() {
-      this.initStatusMapping();
-      this.initSourceMapping();
-      this.initNetworkMapping();
-      if (this.form.networkStatus < 0) {
-        this.form.networkStatus = 0;
-      }
-      if (this.form.status < 0) {
-        this.form.status = 0;
-      }
-    },
-    methods: {
-      initStatusMapping() {
-        businessStatus.forEach((item) => {
-          this.statusOptions[item.code] = item.label;
-        });
+import { networkStatus, businessStatus } from '@/utils/dict/warehouse';
+import { getByCode } from '@/api/system/dictionary-data';
+import DeptSelect from '@/components/CommomSelect/dept-select.vue';
+import { getUserPage } from '@/api/system/organization';
+
+import {
+  getFactoryarea,
+  listWorkshopByParentId,
+  listByProductionLineId,
+  listFactoryLine
+} from '@/api/factoryModel';
+export default {
+  data() {
+    return {
+      factoryOptions: [],
+      productionLineOptions: [],
+      stationOptions: [],
+      workshopOptions: [],
+      labelStyle: {
+        width: '180px'
       },
-      initSourceMapping() {
-        sourceStatus.forEach((item) => {
-          this.sourceDICTOptions[item.code] = item.label;
-        });
+
+      options: {
+        deliveryCycle: [], // 送检周期
+        repairUserId: []
       },
-      initNetworkMapping() {
-        networkStatus.forEach((item) => {
-          this.networkStatusOptions[item.code] = item.label;
-        });
-      }
+      ywInfo: {},
+      // 状态
+      statusOptions: {},
+
+      // 网络状态
+      networkStatusOptions: {}
+    };
+  },
+  mounted() {
+    this.getFactoryareaList();
+    this.getDeliveryCycleOptions();
+    this.initStatusMapping();
+    this.initNetworkMapping();
+    this.geMaintainersList();
+    if (this.form.networkStatus < 0) {
+      this.form.networkStatus = 0;
+    }
+    if (this.form.status < 0) {
+      this.form.status = 0;
+    }
+  },
+  components: {
+    DeptSelect
+  },
+  methods: {
+    // 维护部门
+    async getwhbm() {
+      if (!this.ywInfo.areaPersonInChargeGroupId) return;
+      let data = await getUserPage({
+        pageNum: 1,
+        size: 9999,
+        groupId: this.ywInfo.areaPersonInChargeGroupId
+      });
+      this.options.repairUserId = data.list;
+    },
+    // 获取维护人下拉列表
+    async geMaintainersList() {
+      if (!this.ywInfo.areaPersonInChargeGroupId) return;
+      let data = await getUserPage({
+        pageNum: 1,
+        size: 9999,
+        groupId: this.ywInfo.areaPersonInChargeGroupId
+      });
+      this.options.repairUserId = data.list;
+    },
+    // 获取工厂数据
+    getFactoryareaList() {
+      getFactoryarea({
+        type: 1,
+        size: 9999,
+        type: 2
+      }).then((res) => {
+        this.factoryOptions = res.list;
+      });
     },
-    props: {
-      form: {
-        type: Object,
-        default: {}
+    // 获取车间
+    getListWorkshopByParentId(id) {
+      listWorkshopByParentId(id).then((res) => {
+        this.workshopOptions = res;
+      });
+    },
+
+    // 获取产线
+    getlistFactoryLineByParentId(id) {
+      listFactoryLine([id]).then((res) => {
+        this.productionLineOptions = res;
+      });
+    },
+
+    // 获取工位
+    getlistByProductionLineId(id) {
+      listByProductionLineId(id).then((res) => {
+        this.stationOptions = res;
+      });
+    },
+    change_factoryId(id) {
+      this.ywInfo.workshopId = '';
+      this.ywInfo.productionLineId = '';
+      this.ywInfo.stationId = '';
+      this.workshopOptions = [];
+      this.productionLineOptions = [];
+      this.stationOptions = [];
+      this.ywInfo.factoryRoomId = id;
+      this.ywInfo.factoryRoomName = this.factoryOptions.filter(
+        (item) => item.id === id
+      )[0].pathName;
+      this.getListWorkshopByParentId(id);
+    },
+    change_productionLineId(id) {
+      this.ywInfo.stationId = '';
+      this.stationOptions = [];
+      this.ywInfo.productionLineName = this.productionLineOptions.filter(
+        (item) => item.id === id
+      )[0].name;
+      this.getlistByProductionLineId(id);
+    },
+    change_workshop(id) {
+      this.ywInfo.productionLineId = '';
+      this.ywInfo.stationId = '';
+      this.productionLineOptions = [];
+      this.stationOptions = [];
+      this.ywInfo.workshopName = this.workshopOptions.filter(
+        (item) => item.id === id
+      )[0].name;
+      this.getlistFactoryLineByParentId(id);
+    },
+    change_stationId(id) {
+      this.$forceUpdate();
+      this.ywInfo.stationName = this.stationOptions.filter(
+        (item) => item.id === id
+      )[0].name;
+    },
+    // 获取送检周期下拉
+    async getDeliveryCycleOptions() {
+      let { data } = await getByCode('delivery_cycle');
+      console.log(data);
+      this.options.deliveryCycle =
+        data.length > 0
+          ? data.map((item) => {
+              return {
+                name: item[Object.keys(item)[0]],
+                id: +Object.keys(item)[0]
+              };
+            })
+          : [];
+    },
+
+    // 限制结束时间
+    endTimeRules() {
+      if (this.ywInfo.startTime) {
+        console.log(this.ywInfo.startTime);
+        console.log(new Date(this.ywInfo.startTime).getTime());
+        let differenceTime =
+          new Date(this.ywInfo.endTime).getTime() -
+          new Date(this.ywInfo.startTime).getTime();
+        if (differenceTime <= 0) {
+          this.$message.error('请选择正确的有效结束时间');
+          this.ywInfo.endTime = '';
+        }
+      } else {
+        this.$message.error('请选择有效开始时间');
+        this.ywInfo.endTime = '';
       }
     },
-    watch: {
-      form: {
-        deep: true, //深度监听设置为 true
-        handler: function (newV) {
-          if (!newV.networkStatus) {
-            newV.networkStatus = 0;
-          }
-          if (!newV.status) {
-            newV.status = 0;
-          }
-          this.ywInfo = newV;
+    initStatusMapping() {
+      businessStatus.forEach((item) => {
+        this.statusOptions[item.code] = item.label;
+      });
+    },
+
+    initNetworkMapping() {
+      networkStatus.forEach((item) => {
+        this.networkStatusOptions[item.code] = item.label;
+      });
+    }
+  },
+  props: {
+    form: {
+      type: Object,
+      default: {}
+    }
+  },
+  watch: {
+    form: {
+      deep: true, //深度监听设置为 true
+      handler: function (newV) {
+        if (!newV.networkStatus) {
+          newV.networkStatus = 0;
+        }
+        if (!newV.status) {
+          newV.status = 0;
+        }
+        this.ywInfo = newV;
+        if (this.options.repairUserId.length == 0) {
+          this.geMaintainersList();
+        }
+        // 获取车间
+        if (this.workshopOptions.length == 0 && this.ywInfo.productionLineId) {
+          this.getListWorkshopByParentId(this.ywInfo.factoryId);
+        }
+
+        // 获取产线
+        if (this.productionLineOptions.length == 0 && this.ywInfo.workshopId) {
+          this.getlistFactoryLineByParentId(this.ywInfo.workshopId);
+        }
+
+        // 获取工位
+        if (this.stationOptions.length == 0 && this.ywInfo.productionLineId) {
+          this.getlistByProductionLineId(this.ywInfo.productionLineId);
         }
       }
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  ::v-deep .descriptions {
-    margin-bottom: 10px;
-  }
-  .baseinfo-container .basic-details-title {
-    font-size: 16px;
-    margin: 15px 0;
-  }
-  ::v-deep .el-descriptions {
-    .el-form-item {
-      margin-bottom: 0px;
-    }
+:deep(.el-descriptions-item__label.is-bordered-label) {
+  color: #606266;
+}
+::v-deep .descriptions {
+  margin-bottom: 10px;
+}
+.baseinfo-container .basic-details-title {
+  font-size: 16px;
+  margin: 15px 0;
+}
+::v-deep .el-descriptions {
+  .el-form-item {
+    margin-bottom: 0px;
   }
+}
 </style>

+ 61 - 62
src/views/ledgerAssets/components/documentInformation.vue

@@ -1,8 +1,7 @@
 <template>
   <div>
-    <div class="basic-details-title border-none">
-      <span class="border-span">文档信息</span>
-    </div>
+    <headerTitle title="文档信息" style="margin-top: 15px"></headerTitle>
+
     <div class="upload-container">
       <WithView v-model="imageUrl" :limit="1" :assetName="type" />
       <div class="file-list">
@@ -74,70 +73,70 @@
   </div>
 </template>
 <script>
-  import fileUpload from '@/components/upload/fileUpload';
-  import WithView from '@/components/upload/WithView';
-  export default {
-    components: {
-      WithView,
-      fileUpload
-    },
-    props: ['type'],
-    data() {
-      return {
-        // 图片
-        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
-          }
+import fileUpload from '@/components/upload/fileUpload';
+import WithView from '@/components/upload/WithView';
+export default {
+  components: {
+    WithView,
+    fileUpload
+  },
+  props: ['type'],
+  data() {
+    return {
+      // 图片
+      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
         }
-      };
-    },
-    methods: {
-      async getDetailInfoAugr(data) {
-        this.attUrl = data;
       }
+    };
+  },
+  methods: {
+    async getDetailInfoAugr(data) {
+      this.attUrl = data;
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  .upload-container {
-    display: flex;
-    justify-content: flex-start;
-    .file-list {
-      margin-left: 50px;
-      flex: 1;
-    }
-  }
-  .basic-details-title {
-    font-size: 16px;
-    margin: 15px 0;
+.upload-container {
+  display: flex;
+  justify-content: flex-start;
+  .file-list {
+    margin-left: 50px;
+    flex: 1;
   }
+}
+.basic-details-title {
+  font-size: 16px;
+  margin: 15px 0;
+}
 </style>

+ 193 - 0
src/views/ledgerAssets/components/equipmentTag.vue

@@ -0,0 +1,193 @@
+<template>
+  <div id="assetInformation" class="baseinfo-container">
+    <el-form label-width="120px" :model="{ ...tagInfo }" ref="form">
+      <div class="content">
+        <headerTitle title="设备标签" style="margin-top: 15px"></headerTitle>
+        <el-descriptions
+          title=""
+          :column="4"
+          size="medium"
+          border
+          style="edit"
+          :label-style="labelStyle"
+     
+          class="descriptions"
+        >
+          <el-descriptions-item>
+            <template slot="label"> 老旧设备</template>
+            <el-form-item label-width="0">
+              <el-radio v-model="tagInfo.equipmentLabelJson[0].LJSB" label="1"
+                >是</el-radio
+              >
+              <el-radio v-model="tagInfo.equipmentLabelJson[0].LJSB" label="2"
+                >否</el-radio
+              >
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 涉火设备</template>
+            <el-form-item label-width="0">
+              <el-radio v-model="tagInfo.equipmentLabelJson[0].SHSB" label="1"
+                >是</el-radio
+              >
+              <el-radio v-model="tagInfo.equipmentLabelJson[0].SHSB" label="2"
+                >否</el-radio
+              >
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 涉火老旧设备</template>
+            <el-form-item label-width="0">
+              <el-radio v-model="tagInfo.equipmentLabelJson[0].SHLJSB" label="1"
+                >是</el-radio
+              >
+              <el-radio v-model="tagInfo.equipmentLabelJson[0].SHLJSB" label="2"
+                >否</el-radio
+              >
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 关重设备</template>
+            <el-form-item label-width="0">
+              <el-radio v-model="tagInfo.equipmentLabelJson[0].GZSB" label="1"
+                >是</el-radio
+              >
+              <el-radio v-model="tagInfo.equipmentLabelJson[0].GZSB" label="2"
+                >否</el-radio
+              >
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 关键设备</template>
+            <el-form-item label-width="0">
+              <el-radio v-model="tagInfo.equipmentLabelJson[0].GJSB" label="1"
+                >是</el-radio
+              >
+              <el-radio v-model="tagInfo.equipmentLabelJson[0].GJSB" label="2"
+                >否</el-radio
+              >
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 特种设备</template>
+            <el-form-item label-width="0">
+              <el-radio v-model="tagInfo.equipmentLabelJson[0].TZSB" label="1"
+                >是</el-radio
+              >
+              <el-radio v-model="tagInfo.equipmentLabelJson[0].TZSB" label="2"
+                >否</el-radio
+              >
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 环保设备</template>
+            <el-form-item label-width="0">
+              <el-radio v-model="tagInfo.equipmentLabelJson[0].HBSB" label="1"
+                >是</el-radio
+              >
+              <el-radio v-model="tagInfo.equipmentLabelJson[0].HBSB" label="2"
+                >否</el-radio
+              >
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 主要生产设备</template>
+            <el-form-item label-width="0">
+              <el-radio v-model="tagInfo.equipmentLabelJson[0].ZYSCSB" label="1"
+                >是</el-radio
+              >
+              <el-radio v-model="tagInfo.equipmentLabelJson[0].ZYSCSB" label="2"
+                >否</el-radio
+              >
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 辅助生产设备</template>
+            <el-form-item label-width="0">
+              <el-radio v-model="tagInfo.equipmentLabelJson[0].FZSCSB" label="1"
+                >是</el-radio
+              >
+              <el-radio v-model="tagInfo.equipmentLabelJson[0].FZSCSB" label="2"
+                >否</el-radio
+              >
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 科研设备</template>
+            <el-form-item label-width="0">
+              <el-radio v-model="tagInfo.equipmentLabelJson[0].KYSB" label="1"
+                >是</el-radio
+              >
+              <el-radio v-model="tagInfo.equipmentLabelJson[0].KYSB" label="2"
+                >否</el-radio
+              >
+            </el-form-item>
+          </el-descriptions-item>
+        </el-descriptions>
+      </div>
+    </el-form>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      labelStyle: {
+        width: '180px'
+      },
+ 
+      tagInfo: {
+        equipmentLabelJson: [
+          {
+            LJSB: '2', //老旧设备
+            SHSB: '2', //涉火设备
+            SHLJSB: '2', //涉火老旧设备
+            GZSB: '2', //关重设备
+            GJSB: '2', //关键设备
+            TZSB: '2', //特种设备
+            HBSB: '2', //环保设备
+            ZYSCSB: '2', //主要生产设备
+            FZSCSB: '2', //辅助生产设备
+            KYSB: '2' //科研设备
+          }
+        ]
+      }
+    };
+  },
+  mounted() {},
+  methods: {},
+  props: {
+    form: {
+      type: Object,
+      default: {}
+    }
+  },
+  watch: {
+    form: {
+      deep: true, //深度监听设置为 true
+      handler: function (newV) {
+        this.tagInfo = newV;
+      }
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+:deep(.el-descriptions-item__label.is-bordered-label) {
+  color: #606266;
+}
+::v-deep .descriptions {
+  margin-bottom: 10px;
+}
+.baseinfo-container .basic-details-title {
+  font-size: 16px;
+  margin: 15px 0;
+}
+::v-deep .el-descriptions {
+  .el-form-item {
+    margin-bottom: 0px;
+  }
+}
+</style>

+ 434 - 421
src/views/ledgerAssets/equipment/edit.vue

@@ -24,17 +24,18 @@
       >
         <div class="content">
           <basicInfoVue ref="basicInfoVueRef" />
+          <equipmentTag :form="form" ref="equipmentTagRef" />
           <businessInformation ref="businessInformationRef" :form="form" />
           <assetInformation ref="assetInformationRef" :form="form" />
-          <warehouseConfigVue ref="warehouseConfigRef" class="ims" />
-          <productInfoVue ref="productInfoRef" />
-          <planVue ref="planRef" />
-          <qualityConfig ref="qualityConfigRef" />
-          <footerVue ref="footerVueRef" />
+          <!-- <warehouseConfigVue ref="warehouseConfigRef" class="ims" /> -->
+          <!-- <productInfoVue ref="productInfoRef" /> -->
+          <!-- <planVue ref="planRef" /> -->
+          <!-- <qualityConfig ref="qualityConfigRef" /> -->
+          <!-- <footerVue ref="footerVueRef" /> -->
           <documentInformation ref="documentInformationRef" type="设备" />
-          <div class="basic-details-title border-none">
-            <span class="border-span">物联参数</span>
-          </div>
+
+          <headerTitle title="物联参数" style="margin-top: 15px"></headerTitle>
+
           <el-row>
             <el-col>
               <el-form-item label="是否启用物联">
@@ -52,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">
@@ -104,7 +105,7 @@
                 </el-form-item>
               </el-col>
             </el-row>
-          </div>
+          </div> -->
         </div>
       </el-form>
       <DialogGoods
@@ -117,446 +118,458 @@
 </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 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';
-  export default {
-    components: {
-      warehouseConfigVue,
-      productInfoVue,
-      planVue,
-      qualityConfig,
-      footerVue,
-      documentInformation,
-      DialogGoods,
-      assetInformation,
-      businessInformation,
-      basicInfoVue
-    },
-    props: {
-      showTitle: {
-        type: Boolean,
-        default: true
-      }
-    },
-    data() {
-      return {
-        labelStyle: {
-          width: '200px'
+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';
+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: [
+          {
+            LJSB: '2', //老旧设备
+            SHSB: '2', //涉火设备
+            SHLJSB: '2', //涉火老旧设备
+            GZSB: '2', //关重设备
+            GJSB: '2', //关键设备
+            TZSB: '2', //特种设备
+            HBSB: '2', //环保设备
+            ZYSCSB: '2', //主要生产设备
+            FZSCSB: '2', //辅助生产设备
+            KYSB: '2' //科研设备
+          }
+        ]
+      },
+      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
         },
-        contentStyle: {
-          width: '400px'
+        productionLicence: {
+          value: [],
+          sort: 2
         },
-        isLink: true,
-        title: '新建设备信息',
-        pageType: 'add',
-        btnLoading: false,
-        // 设备主键id
-        id: '',
-        form: {
-          extInfoSelf: [],
-          // 基本信息
-          code: '',
-          name: '',
-          productTime: '',
-          workstation: {}
+        explosionProofCertificate: {
+          value: [],
+          sort: 3
         },
-        rules: {
-          name: [
-            { required: true, message: '请输入设备名称', trigger: 'blur' }
-          ],
-          // location: [{ validator: addressValidation, trigger: 'change' }],
-          code: [{ required: true, message: '请输入设备编码', trigger: 'blur' }]
+        surveyReport: {
+          value: [],
+          sort: 4
         },
-        // 基本信息
-        basicInfo: {},
-        positionInfo: {
-          // 详细地址
-          deviceDetailAddress: '',
-          // 请选择产线
-          lineCode: '',
-          lineName: '',
-          // 请选择车间
-          workshopCode: '',
-          workshopName: '',
-          // 请选择工厂
-          factoryCode: '',
-          factoryName: ''
+        inspectionCycleManual: {
+          value: [],
+          sort: 5
         },
-        // 图片
-        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
-          }
+        informationDrawing: {
+          value: [],
+          sort: 6
         },
-        // 是否开始物联
-        isIotEnable: true,
-        // 物联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 '';
+        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 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 = '新增设备信息';
+    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;
+      this.form.rootCategoryLevelId = this.basicInfo.categoryLevelPathId
+        .split(',')[0]
+        .replace('[', '');
+      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();
     },
-    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 = data;
-        this.form.category = res;
-        this.basicInfo = data;
-        this.form.rootCategoryLevelId = this.basicInfo.categoryLevelPathId
-          .split(',')[0]
-          .replace('[', '');
-        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;
-        }
+    // 计算过保时间
+    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;
-            });
-            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;
-            console.log('sasasasa', par);
-            saveOrEdit(par)
-              .then((res) => {
-                this.$message.success('操作成功');
-                this.$router.go(-1);
-              })
-              .finally(() => {
-                this.btnLoading = false;
-              });
+      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 {
-            console.log('error submit!!');
-            return false;
+            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 = '';
           }
-        });
-      },
-      // 处理扩展字段
-      setKz() {
-        return this.form.extInfoSelf || [];
-      },
-      // 处理文档信息
-      setWd() {
-        return Object.values(this.attUrl).map((item) => ({
-          ...(item.value[0] || {}),
-          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 = data;
-        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;
-        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]?.storePath && [
-                this.form.attUrl[index]
-              ]) ||
-              [];
-          });
-          this.$refs.documentInformationRef.getDetailInfoAugr(this.attUrl);
-        }
-      },
-      // 设置标准产能
-      setbzcn(val) {
-        if (!val) {
-          return '';
+          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;
         }
-        let item = JSON.parse(val);
-        return item.standardCapacity || '';
+      });
+    },
+    // 处理扩展字段
+    setKz() {
+      return this.form.extInfoSelf || [];
+    },
+    // 处理文档信息
+    setWd() {
+      return Object.values(this.attUrl).map((item) => ({
+        ...(item.value[0] || {}),
+        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, 'dsadasd');
+      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;
+      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]?.storePath && [this.form.attUrl[index]]) ||
+            [];
+        });
+        this.$refs.documentInformationRef.getDetailInfoAugr(this.attUrl);
       }
+    },
+    // 设置标准产能
+    setbzcn(val) {
+      if (!val) {
+        return '';
+      }
+      let item = JSON.parse(val);
+      return item.standardCapacity || '';
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  ::v-deep .descriptions {
-    margin-bottom: 10px;
-  }
-  .baseinfo-container .basic-details-title {
-    font-size: 16px;
-    margin: 15px 0;
+::v-deep .descriptions {
+  margin-bottom: 10px;
+}
+.baseinfo-container .basic-details-title {
+  font-size: 16px;
+  margin: 15px 0;
+}
+.upload-container {
+  display: flex;
+  justify-content: flex-start;
+  .file-list {
+    margin-left: 50px;
+    flex: 1;
   }
-  .upload-container {
-    display: flex;
-    justify-content: flex-start;
-    .file-list {
-      margin-left: 50px;
-      flex: 1;
+}
+.equipment-container {
+  .label-none {
+    .el-form-item__content {
+      margin-left: 0 !important;
     }
   }
-  .equipment-container {
-    .label-none {
-      .el-form-item__content {
-        margin-left: 0 !important;
-      }
-    }
+}
+.sbwz {
+  .item {
+    width: 120px !important;
   }
-  .sbwz {
-    .item {
-      width: 120px !important;
-    }
-    .item + .item {
-      margin-left: 10px;
-    }
-    .item-input {
-      width: 350px !important;
-    }
+  .item + .item {
+    margin-left: 10px;
   }
-  .input {
-    width: 100%;
+  .item-input {
+    width: 350px !important;
   }
-  .kzzd {
-    width: 500px;
-    .add-col {
-      display: flex;
-      .col-input {
-        & + .col-input {
-          margin-left: 10px;
-        }
-      }
-      .del {
+}
+.input {
+  width: 100%;
+}
+.kzzd {
+  width: 500px;
+  .add-col {
+    display: flex;
+    .col-input {
+      & + .col-input {
         margin-left: 10px;
       }
     }
-  }
-  ::v-deep .el-descriptions {
-    .el-form-item {
-      margin-bottom: 0px;
+    .del {
+      margin-left: 10px;
     }
   }
+}
+::v-deep .el-descriptions {
+  .el-form-item {
+    margin-bottom: 0px;
+  }
+}
 </style>

+ 190 - 370
src/views/maintenance/repair/workOrder/components/AssetsDialog.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-dialog :visible.sync="visible" :title="`${title}信息`" width="80vw">
+  <el-dialog :visible.sync="visible" title="物品信息" width="80vw">
     <el-form :model="searchForm" label-width="100px">
       <el-row>
         <el-col :span="6">
@@ -14,7 +14,7 @@
                 <el-option label="物料维度" value="4"> </el-option>
                 <el-option label="包装维度" value="3"> </el-option>
                 <el-option label="批次维度" value="2"> </el-option>
-                <!-- <el-option label="物品维度" value="1"> </el-option> -->
+                <el-option label="物品维度" value="1"> </el-option>
               </el-select>
             </template>
           </el-form-item>
@@ -24,16 +24,16 @@
             <el-input
               type="text"
               placeholder="搜索物品编码"
-              v-model="searchForm.code"
+              v-model="searchForm.categoryCode"
             ></el-input>
           </el-form-item>
         </el-col>
-        <el-col :span="5">
+        <el-col :span="6">
           <el-form-item label="物品名称:">
             <el-input
               type="text"
               placeholder="搜索物品名称"
-              v-model="searchForm.assetName"
+              v-model="searchForm.categoryName"
             ></el-input>
           </el-form-item>
         </el-col>
@@ -64,21 +64,13 @@
             ></el-input>
           </el-form-item>
         </el-col>
-        <el-col v-if="dimension != 2" :span="6">
-          <el-form-item label="质检结果">
-            <el-select
-              clearable
-              v-model="searchForm.qualityResult"
-              placeholder="请选择质检结果"
-            >
-              <el-option
-                v-for="item in qualityResultOption"
-                :label="item.label"
-                :value="item.value"
-                :key="item.value"
-              >
-              </el-option>
-            </el-select>
+        <el-col :span="6">
+          <el-form-item label="牌号">
+            <el-input
+              type="text"
+              placeholder="搜索牌号"
+              v-model="searchForm.brandNum"
+            ></el-input>
           </el-form-item>
         </el-col>
         <el-col style="text-align: right">
@@ -90,12 +82,9 @@
     <el-container class="assets-dialog">
       <el-aside width="200px" class="wrapper-assets">
         <AssetTree
-          @handleNodeClick="handleNodeClick"
-          id="6"
-          :type="assetType"
           ref="treeList"
-          :init="true"
-          paramsType="type"
+          :treeIds="[6]"
+          @handleNodeClick="handleNodeClick"
         />
       </el-aside>
       <el-main>
@@ -105,7 +94,7 @@
           tooltip-effect="dark"
           height="50vh"
           border
-          row-key="oid"
+          row-key="id"
           style="width: 100%"
           :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
           @selection-change="handleSelectionChange"
@@ -115,160 +104,140 @@
             :reserve-selection="true"
             width="55"
             align="center"
-            :selectable="selectable"
           >
           </el-table-column>
           <el-table-column label="序号" type="index" width="50">
           </el-table-column>
           <el-table-column
-            prop="assetCode"
-            label="编码"
+            prop="categoryCode"
+            label="物品编码"
             min-width="120"
-            v-if="dimension != 3 || dimension != 4"
             :show-overflow-tooltip="true"
           ></el-table-column>
           <el-table-column
-            prop="name"
+            prop="categoryName"
             width="200"
-            label="名称"
+            label="物品名称"
             :show-overflow-tooltip="true"
           ></el-table-column>
           <el-table-column
-            :width="item.width"
-            :prop="item.prop"
-            :label="item.label"
-            v-for="(item, index) in tableHeader"
-            :key="index"
-          >
-            <template slot-scope="{ row }">
-              <template v-if="item.formatter">{{
-                item.formatter(row)
-              }}</template>
-              <template v-else>{{ row[item.prop] }}</template>
-            </template></el-table-column
-          >
-          <el-table-column
-            prop="manualBatchNo"
-            label="批号"
-            min-width="100"
-          ></el-table-column>
-          <el-table-column
-            v-if="dimension == 2 || dimension == 3 || dimension == 4"
-            prop="batchNo"
-            label="批次号"
-            min-width="80"
-          ></el-table-column>
-          <el-table-column
-            label="发货条码"
-            prop="barcodes"
-            width="80"
+            prop="brandNum"
+            label="牌号"
             :show-overflow-tooltip="true"
           ></el-table-column>
           <el-table-column
-            v-if="dimension == 3 || dimension == 4"
-            prop="onlyCode"
-            label="包装编码"
-            min-width="120"
+            prop="categoryModel"
+            label="型号"
             :show-overflow-tooltip="true"
           ></el-table-column>
           <el-table-column
-            v-if="dimension == 4"
-            prop="no"
-            label="物料编码"
-            min-width="120"
+            prop="specification"
+            label="规格"
             :show-overflow-tooltip="true"
           ></el-table-column>
           <el-table-column
-            v-if="dimension == 4"
-            prop="meterielCode"
-            label="物料代号"
-            min-width="100"
-          ></el-table-column>
-          <el-table-column
-            v-if="dimension == 4"
-            prop="clientCode"
-            label="客户代号"
-            min-width="100"
-          ></el-table-column>
-          <el-table-column
-            v-if="dimension == 4"
-            prop="engrave"
-            label="刻码"
-            min-width="120"
-          ></el-table-column>
-
-          <el-table-column
-            prop="packingCountBase"
-            label="包装库存数量"
-            width="120"
-            v-if="dimension != 4"
-          ></el-table-column>
+            v-if="dimension == 1"
+            label="出库数量"
+            type="index"
+            width="100"
+          >
+            <template slot-scope="{ row }">
+              <el-input
+                type="text"
+                placeholder="请输入"
+                v-model="row.outboundNum"
+                @input="handleInput(row, $event)"
+              ></el-input>
+            </template>
+          </el-table-column>
           <el-table-column
-            prop="minUnit"
-            label="包装单位"
-            v-if="dimension != 4"
-            width="90"
+            v-else
+            prop="batchNo"
+            label="批次号"
+            key="batchNo"
+            min-width="80"
           ></el-table-column>
+          <el-table-column prop="level" label="级别"></el-table-column>
           <el-table-column
-            prop="availableCountBase"
-            label="计量库存数量"
+            prop="measureQuantity"
+            label="计量数量"
             width="120"
           ></el-table-column>
           <el-table-column
-            prop="measuringUnit"
+            prop="measureUnit"
             label="计量单位"
             width="90"
           ></el-table-column>
           <el-table-column
-            v-if="dimension == 4"
             prop="weight"
             label="重量"
             min-width="120"
           ></el-table-column>
           <el-table-column
-            v-if="dimension == 4"
             prop="weightUnit"
             label="重量单位"
             min-width="120"
           ></el-table-column>
           <el-table-column
-            prop="expirationTime"
-            label="周期倒计时"
+            v-if="dimension == 3"
+            prop="packageNo"
+            label="包装编码"
             min-width="120"
             :show-overflow-tooltip="true"
           ></el-table-column>
           <el-table-column
-            v-if="dimension != 2"
-            prop="weightUnit"
-            label="质检状态"
+            v-if="dimension == 3"
+            prop="packingQuantity"
+            label="包装数量"
             min-width="120"
-          >
-            <template slot-scope="{ row }">
-              <span v-if="row.qualityStatus == 0">未质检</span>
-              <span v-else-if="row.qualityStatus == 1">已质检</span>
-              <span v-else>-</span>
-            </template>
-          </el-table-column>
+            :show-overflow-tooltip="true"
+          ></el-table-column>
           <el-table-column
-            v-if="dimension != 2"
-            prop="weightUnit"
-            label="质检结果"
+            v-if="dimension == 3"
+            prop="packingUnit"
+            label="包装单位"
             min-width="120"
-          >
-            <template slot-scope="{ row }">
-              <span v-if="row.qualityResult == 0">合格</span>
-              <span v-else-if="row.qualityResult == 1">不合格</span>
-              <span v-else>-</span>
-            </template>
-          </el-table-column>
+            :show-overflow-tooltip="true"
+          ></el-table-column>
+          <el-table-column
+            v-if="dimension == 3 || dimension == 4"
+            label="发货条码"
+            prop="barcodes"
+            width="80"
+            :show-overflow-tooltip="true"
+          ></el-table-column>
           <el-table-column
-            prop="pathName"
+            v-if="dimension == 4"
+            prop="no"
+            label="物料编码"
+            min-width="120"
+            :show-overflow-tooltip="true"
+          ></el-table-column>
+          <el-table-column
+            v-if="dimension == 3 || dimension == 4"
+            prop="materielDesignation"
+            label="物料代号"
+            min-width="100"
+          ></el-table-column>
+          <el-table-column
+            v-if="dimension == 3 || dimension == 4"
+            prop="clientCode"
+            label="客户代号"
+            min-width="100"
+          ></el-table-column>
+          <el-table-column
+            v-if="dimension == 3 || dimension == 4"
+            prop="engrave"
+            label="刻码"
+            min-width="120"
+          ></el-table-column>
+          <el-table-column
+            v-if="dimension == 3 || dimension == 4"
+            prop="warehouseName"
             label="仓库"
             min-width="200"
             :show-overflow-tooltip="true"
           ></el-table-column>
-
-          <!-- <el-table-column prop="pathName" label="仓库"> </el-table-column> -->
         </el-table>
         <div style="text-align: right; padding: 10px">
           <el-pagination
@@ -276,8 +245,8 @@
             layout="total, sizes, prev, pager, next, jumper"
             :total="total"
             :page-sizes="[5, 10, 20, 50]"
-            :page-size.sync="pages.size"
-            :current-page.sync="pages.pageNum"
+            :page-size.sync="searchForm.size"
+            :current-page.sync="searchForm.pageNum"
             @current-change="handleCurrentChange"
             @size-change="handleSizeChange"
           >
@@ -294,36 +263,16 @@
 </template>
 
 <script>
-  import AssetTree from '@/components/AssetTree';
-  // import { detailSelect } from '@/api/stockManagement/stockLedger';
-  import { deepClone } from '@/utils';
-  import { tableHeader } from './common';
-  import outin from '@/api/maintenance/outin';
-  import {
-    getBatchDetails,
-    getDetailById
-  } from '@/api/maintenance/classifyManage';
+  import storageApi from '@/api/warehouseManagement';
+  import AssetTree from './assetTree.vue';
   export default {
     components: { AssetTree },
     props: {
-      title: String,
-      assetType: {
-        type: [String, Number],
-        default: ''
-      },
-      warehousingMaterialList: {
-        type: Array,
-        default: () => []
-      }
+      treeIds: { type: Array, default: () => [] }
     },
-    computed: {
-      tableHeader() {
-        return tableHeader(this.assetType);
-      }
-    },
-
     data() {
       return {
+        isShowTable: true,
         qualityResultOption: [
           {
             value: 0,
@@ -347,279 +296,150 @@
         visible: false,
         tableData: [],
         total: 0,
-        pages: {
-          pageNum: 1,
-          size: 10
-        },
+        categoryLevelId: '',
         searchForm: {
-          code: '',
-          assetName: '',
+          categoryCode: '',
+          categoryName: '',
           batchNo: '',
+          brandNum: '',
           engrave: '',
           barcodes: '',
-          qualityResult: ''
+          categoryLevelId: '',
+          pageNum: 1,
+          size: 20
         },
         selectionList: [],
         materialType: '',
         warehouseList: [],
-        dimension: '4'
+        dimension: '1'
       };
     },
     created() {},
     methods: {
-      changeDimensionHandler(e) {
-        // this.$refs.multipleTable.clearSelection();
-        // this.selectionList = [];
-        this.pages.pageNum = 1;
-        this.changeDimension(e);
+      getRowKeys(row) {
+        return row.id;
       },
-      async changeDimension(e, is) {
-        // await this.$refs.multipleTable.clearSelection();
-        // this.selectionList = [];
-        console.log('===1', this.warehousingMaterialList);
-        console.log('===2', e);
-        // if (is != 'page') {
-        //   this.$refs.multipleTable.clearSelection();
-        // }
-        this.dimension = e;
-        let res = {};
-        const params = {
-          ...this.pages,
-          ...this.searchForm,
-          dimension: e
-        };
-        if (this.materialType) {
-          params.categoryLevelId = this.materialType;
-        }
-        const loading = this.$loading({
-          target: '.assets-dialog'
-        });
-        if (e == 2) {
-          res = await getBatchDetails(params);
-          this.tableData = res.list.map((item) => {
-            return {
-              ...item,
-              minUnit: item.packingUnit,
-              oid: item.stockBatchId,
-              assetCode: item.code
-            };
-          });
-        } else if (e == 3) {
-          res = await outin.getInventoryDetails(params);
-          this.tableData = res.list.map((item) => {
-            return {
-              ...item,
-              batchNo: item.batchNum,
-              minUnit: item.packingUnit,
-              // availableCountBase: 1,
-              packingCountBase: 1,
-              oid: item.id,
-              assetCode: item.code
-            };
-          });
-        } else if (e == 4) {
-          res = await outin.getMaterielDetails(params);
-          this.tableData = res.list.map((item, index) => {
-            return {
-              ...item,
-              availableCountBase: 1,
-              packingCountBase: 1,
-              minUnit: item.packingUnit,
-              oid: item.id + this.pages.pageNum + (index + 1)
-            };
-          });
-          console.log('===', this.tableData);
+      // 出库数量限制
+      handleInput(row, value) {
+        if (row.outboundNum <= row.measureQuantity) {
+          return (row.outboundNum = value.replace(/^(0+)|[^\d]+/g, ''));
         } else {
-          res = await outin.getRealTimeInventory(params);
-          this.tableData = res.list.map((item) => {
-            return { ...item, oid: item.id, assetCode: item.code };
-          });
-        }
-
-        if (res) {
-          this.total = res.count;
-          // this.selectionList = deepClone(this.warehousingMaterialList);
-
-          this.$nextTick(() => {
-            this.tableData.forEach((item) => {
-              const index = this.warehousingMaterialList.findIndex((i) =>
-                this.dimension == 1 || this.dimension == 3
-                  ? item.id == i.id
-                  : this.dimension == 2
-                  ? item.stockBatchId == i.stockBatchId
-                  : item.oid == i.oid
-              );
-              if (index > -1) {
-                // 删除还给 multipleSelection
-                this.$refs.multipleTable.toggleRowSelection(item, true);
-              }
-            });
-          });
+          row.outboundNum = row.measureQuantity;
         }
-        loading.close();
       },
-      selectable(row, index) {
-        if (row.canUsedCount != 0) {
-          return true;
+      // 切换维度
+      changeDimensionHandler(e) {
+        this.searchForm.pageNum = 1;
+        this.selectionList = [];
+        this.$refs.multipleTable.clearSelection();
+        this.changeDimension(e);
+      },
+      async changeDimension(e) {
+        this.dimension = e;
+        if (this.dimension == 1) {
+          // 物品维度
+          const data = await storageApi.getProductList(this.searchForm);
+          this.tableData = data.list;
+          this.total = data.count;
+        } else if (this.dimension == 2) {
+          // 批次维度
+          const data = await storageApi.getBatchList(this.searchForm);
+          this.tableData = data.list;
+          this.total = data.count;
+        } else if (this.dimension == 4) {
+          // 物料维度
+          const data = await storageApi.getMaterialList(this.searchForm);
+          this.tableData = data.list;
+          this.total = data.count;
         } else {
-          return false;
+          // 包装维度
+          const data = await storageApi.getPackingList(this.searchForm);
+          this.tableData = data.list;
+          this.total = data.count;
         }
+        console.log(this.tableData);
       },
       open() {
         this.visible = true;
         this.$nextTick(() => {
-          this.$refs.treeList.getTreeData();
-          // this.doSearch()
-        });
-      },
-      async handleExit(arr) {
-        console.log('arr=====', arr);
-        console.log('this.dimension', this.dimension);
-        let ids = null;
-        let batchIds = null;
-        let materielIds = null;
-        if (this.dimension == 3) {
-          ids = arr.map((item) => {
-            return item.id;
-          });
-        } else if (this.dimension == 2) {
-          ids = arr.map((item) => {
-            return item.recordId;
-          });
-          batchIds = arr.map((item) => {
-            return item.stockBatchId;
-          });
-        } else if (this.dimension == 4) {
-          materielIds = arr.map((item) => {
-            return item.materielId;
-          });
-          ids = arr.map((item) => {
-            return item.recordId;
-          });
-        } else {
-          ids = arr.map((item) => {
-            return item.recordId;
+          this.$refs.treeList.getTreeData().then((data) => {
+            this.handleNodeClick(data);
           });
-        }
-        let categoryIds = arr.map((item) => {
-          return item.id;
-        });
-        let batchNos = arr.map((item) => {
-          return item.batchNo;
         });
-        let outInDetailIds = arr.map((item) => {
-          return item.outInDetailId;
-        });
-        const parmas = {
-          categoryLevelId: this.materialType,
-          type: this.dimension,
-          categoryIds,
-          batchNos,
-          batchIds,
-          ids,
-          outInDetailIds,
-          materielIds
-        };
-        console.log(parmas);
-        const data = await getDetailById(parmas);
-        return data;
       },
       async confirm() {
         if (!this.selectionList.length) {
           this.$message.error('请至少选择一条数据!');
           return;
         }
-        const data = await this.handleExit(this.selectionList);
-        let arr = [];
-        if (this.dimension == 4) {
-          arr = this.selectionList.map((item) => {
-            return { ...item, assetName: item.name };
+        if (this.dimension == 1) {
+          let boolen = this.selectionList.every((item) => item.outboundNum > 0);
+          if (!boolen) {
+            this.$message.error('请输入出库数量!');
+            return;
+          }
+        }
+        console.log(this.selectionList);
+        let data = null;
+        if (this.dimension != 1) {
+          data = await storageApi.getHierarchyList({
+            ids: this.selectionList.map((item) => item.id).join(','),
+            type: this.dimension
+          });
+        } else {
+          data = await storageApi.getHierarchyFifo({
+            type: this.dimension,
+            builders: this.selectionList.map((item) => {
+              return {
+                categoryId: item.categoryId,
+                num: item.outboundNum
+              };
+            })
           });
         }
-        this.$emit('detailData', { ...data, wlList: arr }, this.dimension);
-
-        // this.$emit('selectTableData', this.selectionList);
+        console.log('data-------------------', data);
+        this.$emit('detailData', data, this.dimension);
         this.cancel();
       },
       cancel() {
-        this.multipleSelection = [];
+        this.selectionList = [];
         this.$refs.multipleTable.clearSelection();
         this.visible = false;
       },
       handleSelectionChange(val) {
-        for (const key in val) {
-          val[key].categoryId = val[key].id;
-        }
         this.selectionList = val;
       },
       handleNodeClick(data) {
-        this.materialType = data.id === data.originId ? '' : data.id;
+        console.log(data);
+        this.categoryLevelId = data.id;
+        this.searchForm.categoryLevelId = data.id;
         this.doSearch();
       },
       handleCurrentChange() {
-        // this.getList();
-        this.changeDimension(this.dimension, 'page');
+        this.changeDimension(this.dimension);
       },
       reset() {
-        this.searchForm.code = '';
-        this.searchForm.assetName = '';
-        this.searchForm.batchNo = '';
-        this.searchForm.engrave = '';
-        this.searchForm.barcodes = '';
-        this.searchForm.qualityStatus = '';
+        this.searchForm = {
+          categoryCode: '',
+          categoryName: '',
+          batchNo: '',
+          brandNum: '',
+          engrave: '',
+          barcodes: '',
+          categoryLevelId: this.categoryLevelId,
+          pageNum: 1,
+          size: 20
+        };
         this.doSearch();
       },
       doSearch() {
-        this.pages.pageNum = 1;
-        // this.getList();
+        this.searchForm.pageNum = 1;
         this.changeDimension(this.dimension);
       },
       handleSizeChange() {
-        this.pages.pageNum = 1;
-        // this.getList();
+        this.searchForm.pageNum = 1;
         this.changeDimension(this.dimension, 'page');
       }
-      // async getList() {
-      //   const params = {
-      //     ...this.pages,
-      //     ...this.searchForm,
-      //     dimension: this.dimension
-      //     // code: 5
-      //   };
-
-      //   if (this.materialType) {
-      //     params.categoryLevelId = this.materialType;
-      //   }
-
-      //   const res = await outin.getMaterielDetails(params);
-
-      //   if (res) {
-      //     this.tableData = res.list.map((item, index) => {
-      //       return {
-      //         ...item,
-      //         oid: index + 1 + (this.pages.pageNum - 1) * this.pages.size
-      //       };
-      //     });
-      //     this.total = res.count;
-      //     // this.selectionList = deepClone(this.warehousingMaterialList);
-      //     console.log(' this.tableData==', this.tableData);
-      //     this.$nextTick(() => {
-      //       this.tableData.forEach((item) => {
-      //         const index = this.warehousingMaterialList.findIndex((i) =>
-      //           this.dimension == 1 || this.dimension == 3
-      //             ? item.id == i.id
-      //             : this.dimension == 2
-      //             ? item.stockBatchId == i.stockBatchId
-      //             : item.meterielId == i.meterielId
-      //         );
-      //         if (index > -1) {
-      //           // 删除还给 multipleSelection
-      //           this.$refs.multipleTable.toggleRowSelection(item, true);
-      //         }
-      //       });
-      //     });
-      //   }
-      // }
     }
   };
 </script>

+ 124 - 0
src/views/maintenance/repair/workOrder/components/assetTree.vue

@@ -0,0 +1,124 @@
+<template>
+  <div class="tree-wrapper">
+    <el-tree
+      :data="treeList"
+      :props="defaultProps"
+      v-loading="treeLoading"
+      :node-key="nodeKey"
+      ref="tree"
+      :highlight-current="true"
+      :expand-on-click-node="false"
+      @node-click="handleNodeClick"
+      :default-expanded-keys="current && current.id ? [current.id] : []"
+    >
+    </el-tree>
+  </div>
+</template>
+
+<script>
+  import { getTreeByIds } from '@/api/classifyManage';
+
+  export default {
+    props: {
+      defaultProps: {
+        type: Object,
+        default: function () {
+          return {
+            children: 'children',
+            value: 'id',
+            label: 'name'
+          };
+        }
+      },
+
+      // 初始请求treeList
+      init: {
+        type: Boolean,
+        default: true
+      },
+
+      treeIds: {
+        type: Array,
+        default: []
+      },
+      nodeKey: {
+        type: String,
+        default: 'id'
+      }
+    },
+    data() {
+      return {
+        treeList: [],
+        treeLoading: false,
+        current: {},
+        currentKey: ''
+      };
+    },
+    mounted() {
+      if (this.init) {
+        this.getTreeData();
+      }
+    },
+    methods: {
+      // 获取树结构数据
+      getTreeData() {
+        return new Promise(async (resolve) => {
+          try {
+            this.treeLoading = true;
+
+            const res = await getTreeByIds({ ids: this.treeIds.join(',') });
+            this.treeLoading = false;
+            if (res?.code === '0') {
+              this.treeList = res.data;
+              this.$emit('setRootId', res.data[0]);
+
+              this.$nextTick(() => {
+                // 默认高亮第一级树节点
+                if (this.treeList[0]) {
+                  this.setCurrentKey(this.treeList[0]);
+                  this.current = this.treeList[0];
+                  // 默认点击加载数据
+                  // const firstNode = document.querySelector('.el-tree-node');
+                  // firstNode.click();
+                  resolve(this.current);
+                }
+              });
+              return this.treeList;
+            }
+          } catch (error) {
+            console.log(error);
+          }
+          this.treeLoading = false;
+        });
+      },
+
+      handleNodeClick(data, node) {
+        this.$emit('handleNodeClick', data, node);
+      },
+      // 设置默认高亮行
+      setCurrentKey(id) {
+        this.currentKey = id;
+        this.$refs.tree.setCurrentKey(this.currentKey);
+      },
+
+      // 获取树的选中状态
+      getSelectList() {
+        const selectList = this.$refs.tree.getCurrentNode();
+        return selectList;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .tree-wrapper {
+    width: 100%;
+    height: 100%;
+    overflow: auto;
+
+    :deep(.el-tree) {
+      display: inline-block;
+      min-width: 100%;
+    }
+  }
+</style>

+ 293 - 423
src/views/maintenance/repair/workOrder/index.vue

@@ -97,443 +97,313 @@
 </template>
 
 <script>
-  import { workorderStatus, resultStatus } from '@/utils/dict/operationManage';
-  import WorkorderSearch from './components/workorder-search.vue';
-  import AddSpareDialog from '@/components/addSpareDialog';
-  import AssetsDialog from './components/AssetsDialog.vue';
-  import RepairReportingWork from '../components/repairReportingWork.vue';
-  import RepairDetailsDialog from '../components/RepairDetailsDialog.vue';
-  import redeployOther from '@/views/maintenance/components/redeployOther.vue';
-  import { getWorkOrderList, applySpareParts } from '@/api/maintenance/repair';
-  import outin from '@/api/maintenance/outin';
-  import { getToken } from '@/utils/token-util';
-  import { download } from '@/utils/file';
-  import { API_BASE_URL } from '@/config/setting';
-  import axios from 'axios';
-  export default {
-    components: {
-      WorkorderSearch,
-      RepairDetailsDialog,
-      redeployOther,
-      AddSpareDialog,
-      RepairReportingWork,
-      AssetsDialog
-    },
-    data() {
-      return {
-        workorderStatus,
-        resultStatus,
-        currentRow: {},
-        warehousingMaterialList: [],
-        batchDetailsVOList: [],
-        materialCodeReqList: [],
-        selectionList: [],
-        wlParams: {},
-        materialObj: {},
-        // 表格列配置
-        columns: [
-          {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'left'
-          },
-          {
-            prop: 'code',
-            slot: 'code',
-            label: '工单编号',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 150
-          },
-          {
-            prop: 'planCode',
-            // label: '关联单号',
-            label: '计划单号',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'planName',
-            label: '维修名称',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'substanceDetailVO.name',
-            label: '设备名称',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'substanceDetailVO.fixCode',
-            label: '固资编码',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'substanceDetailVO.codeNumber',
-            label: '设备编号',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'executeUserName',
-            label: '执行人',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'acceptTime',
-            label: '开始时间',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'finishTime',
-            label: '结束时间',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'planFinishTime',
-            label: '计划完成时间',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            columnKey: 'orderHour',
-            label: '实际工时(分钟)',
-            align: 'center',
-            resizable: false,
-            showOverflowTooltip: true,
-            minWidth: 120,
-            formatter: (row) => {
-              if (row.finishTime && row.acceptTime) {
-                return parseInt(
-                  (new Date(row.finishTime).getTime() -
-                    new Date(row.acceptTime).getTime()) /
-                    60000
-                );
-              }
-            }
-          },
-          {
-            prop: 'orderStatus',
-            label: '状态',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (row) => {
-              return workorderStatus.filter(
-                (item) => item.code == row.orderStatus
-              )[0].label;
+import { workorderStatus, resultStatus } from '@/utils/dict/operationManage';
+import WorkorderSearch from './components/workorder-search.vue';
+import AddSpareDialog from '@/components/addSpareDialog';
+import AssetsDialog from './components/AssetsDialog.vue';
+import RepairReportingWork from '../components/repairReportingWork.vue';
+import RepairDetailsDialog from '../components/RepairDetailsDialog.vue';
+import redeployOther from '@/views/maintenance/components/redeployOther.vue';
+import { getWorkOrderList, applySpareParts } from '@/api/maintenance/repair';
+import outin from '@/api/maintenance/outin';
+import { getToken } from '@/utils/token-util';
+import { download } from '@/utils/file';
+import { API_BASE_URL } from '@/config/setting';
+import axios from 'axios';
+export default {
+  components: {
+    WorkorderSearch,
+    RepairDetailsDialog,
+    redeployOther,
+    AddSpareDialog,
+    RepairReportingWork,
+    AssetsDialog
+  },
+  data() {
+    return {
+      workorderStatus,
+      resultStatus,
+      currentRow: {},
+      warehousingMaterialList: [],
+      batchDetailsVOList: [],
+      materialCodeReqList: [],
+      selectionList: [],
+      wlParams: {},
+      materialObj: {},
+      // 表格列配置
+      columns: [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'code',
+          slot: 'code',
+          label: '工单编号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 150
+        },
+        {
+          prop: 'planCode',
+          // label: '关联单号',
+          label: '计划单号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'planName',
+          label: '维修名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'substanceDetailVO.name',
+          label: '设备名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'substanceDetailVO.fixCode',
+          label: '固资编码',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'substanceDetailVO.codeNumber',
+          label: '设备编号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'executeUserName',
+          label: '执行人',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'acceptTime',
+          label: '开始时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'finishTime',
+          label: '结束时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'planFinishTime',
+          label: '计划完成时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          columnKey: 'orderHour',
+          label: '实际工时(分钟)',
+          align: 'center',
+          resizable: false,
+          showOverflowTooltip: true,
+          minWidth: 120,
+          formatter: (row) => {
+            if (row.finishTime && row.acceptTime) {
+              return parseInt(
+                (new Date(row.finishTime).getTime() -
+                  new Date(row.acceptTime).getTime()) /
+                  60000
+              );
             }
-          },
-          {
-            prop: 'acceptanceStatus',
-            label: '执行结果',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (row) => {
-              return row.acceptanceStatus
-                ? resultStatus.filter(
-                    (item) => item.code == row.acceptanceStatus
-                  )[0].label
-                : '';
-            }
-          },
-          {
-            columnKey: 'action',
-            fixed: 'right',
-            label: '操作',
-            width: 300,
-            align: 'center',
-            resizable: false,
-            slot: 'action',
-            showOverflowTooltip: true
           }
-        ],
-        // 加载状态
-        loading: false,
-        pageType: 'add',
-        dialogTitle: '',
-        isBindPlan: false
-      };
-    },
-    methods: {
-      downLoadOrder(row) {
-        let params = {
-          id: row.id
-        };
-        // downloadAsset(params, '设备台账导出数据');
-        axios({
-          url: `${API_BASE_URL}/eam/workorder/excel?id=${row.id}`,
-          method: 'get',
-          responseType: 'blob',
-          headers: {
-            Authorization: getToken()
+        },
+        {
+          prop: 'orderStatus',
+          label: '状态',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (row) => {
+            return workorderStatus.filter(
+              (item) => item.code == row.orderStatus
+            )[0].label;
           }
-        }).then((res) => {
-          download(res.data, '维修工单');
-        });
-      },
-      async handleNewSave() {
-        let { user } = JSON.parse(sessionStorage.getItem('vuex-eam'));
-        console.log(user);
-        let userInfo = user.info;
-        let obj = {
-          fromUser: userInfo.userId,
-          bizType: '4', // 领用出库
-          extInfo: {
-            assetType: 6,
-            verifyDeptCode: userInfo.deptId[0],
-            verifyDeptName: userInfo.deptName
-          },
-          type: 2,
-          fromType: 2
-        };
-        obj = { ...obj, ...this.wlParams };
-        if (this.dimension == 4) {
-          obj.num = this.materialObj.wlList.length;
-        } else {
-          obj.num = this.materialCodeReqList.length;
-        }
-        obj.storageSource = 1;
-        try {
-          const res = await outin.saveNew(obj);
-          if (res.code == 0) {
-            let arr = obj.realTimeInventoryNewPOList.map((item) => {
-              return {
-                sparePartsId: item.id,
-                sparePartsList: JSON.stringify({
-                  ...item,
-                  inventoryDetailsNewPOList: [],
-                  inventoryDetailsVOList: [],
-                  outInIds: res.data
-                })
-              };
-            });
-            applySpareParts({
-              workOrderId: this.currentRow.id,
-              infoList: arr
-            }).then((res) => {
-              this.$message.success('申请成功!');
-            });
+        },
+        {
+          prop: 'acceptanceStatus',
+          label: '执行结果',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (row) => {
+            return row.acceptanceStatus
+              ? resultStatus.filter(
+                  (item) => item.code == row.acceptanceStatus
+                )[0].label
+              : '';
           }
-        } catch (error) {
-          console.log(error);
+        },
+        {
+          columnKey: 'action',
+          fixed: 'right',
+          label: '操作',
+          width: 300,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true
         }
-      },
-      detailData(data, dimension) {
-        this.dimension = dimension;
-        console.log('总数居', data);
-        // this.onSelectTableDataVal = data.realTimeInventoryVOList;
-        this.warehousingMaterialList = data.realTimeInventoryVOList.map(
-          (next) => {
-            delete next.updateTime;
-            delete next.createTime;
-            return {
-              ...next,
-              realInventoryAmount: 0,
-              assetType: 6,
-              outInNum: '',
-              assetCode: next.code,
-              assetName: next.name,
-              bizStatus: 2,
-              contactCode: next.contactCode
-            };
-          }
-        );
-        // this.batchDetailsVOList = data.batchDetailsVOList;
-
-        if (dimension == 4) {
-          this.materialCodeReqList = data.wlList;
-          this.selectionList = data.wlList;
-
-          let params = {
-            realTimeInventoryNewPOList: data.realTimeInventoryVOList
-          };
-
-          for (const item of params.realTimeInventoryNewPOList) {
-            item.inventoryDetailsNewPOList = item.inventoryDetailsVOList;
-
-            for (const detail of item.inventoryDetailsNewPOList) {
-              detail.outInMaterialDetailsAddPOList = [];
-
-              for (const wlItem of data.wlList) {
-                if (detail.id === wlItem.recordId) {
-                  detail.outInMaterialDetailsAddPOList.push({
-                    ...wlItem
-                  });
-                }
-              }
-            }
-          }
-          this.wlParams = params;
-          this.materialObj = data;
-        } else if (dimension == 3) {
-          //包装维度出库
-          const list = data.realTimeInventoryVOList;
-          //获取包装维度
-          let packArr = [];
-          for (const item of list) {
-            if (item.inventoryDetailsVOList.length != 0) {
-              for (const iterator of item.inventoryDetailsVOList) {
-                packArr.push({ ...iterator, batchNo: iterator.batchNum });
-              }
-            }
-          }
-          this.batchDetailsVOList = packArr.map((item) => {
-            return {
-              ...item,
-              packingCountBase:
-                dimension == 4 || dimension == 3 ? 1 : item.packingCountBase
-              // weight: 0
-            };
-          });
-          //物料维度数据
-          let meteArr = [];
-          for (const item of packArr) {
-            if (item.materialDetailsVOList.length != 0) {
-              for (const iterator of item.materialDetailsVOList) {
-                meteArr.push({
-                  ...iterator
-                });
-              }
-            }
-          }
-          this.materialCodeReqList = meteArr;
-          //再次打开选择上
-          this.selectionList = list;
-          //send数据
-          this.wlParams = { realTimeInventoryNewPOList: list };
-          this.wlParams.realTimeInventoryNewPOList.forEach((item) => {
-            item.inventoryDetailsNewPOList = item.inventoryDetailsVOList;
-            item.inventoryDetailsNewPOList.forEach((ite) => {
-              // ite.weight = 0;
-              ite.outInMaterialDetailsAddPOList = ite.materialDetailsVOList;
-            });
-          });
-        } else {
-          //   else if (dimension == 2) {
-          //   this.batchDetailsVOList = data.wlList;
-          //   this.selectionList = data.wlList;
-          // }
-          //物品维度出库
-          console.log(data);
-          const list = data.realTimeInventoryVOList;
-          //获取包装维度
-          let packArr = [];
-          for (const item of list) {
-            if (item.inventoryDetailsVOList.length != 0) {
-              for (const iterator of item.inventoryDetailsVOList) {
-                packArr.push({ ...iterator, batchNo: iterator.batchNum });
-              }
-            }
-          }
-          this.batchDetailsVOList = packArr.map((item) => {
+      ],
+      // 加载状态
+      loading: false,
+      pageType: 'add',
+      dialogTitle: '',
+      isBindPlan: false
+    };
+  },
+  methods: {
+    downLoadOrder(row) {
+      let params = {
+        id: row.id
+      };
+      // downloadAsset(params, '设备台账导出数据');
+      axios({
+        url: `${API_BASE_URL}/eam/workorder/excel?id=${row.id}`,
+        method: 'get',
+        responseType: 'blob',
+        headers: {
+          Authorization: getToken()
+        }
+      }).then((res) => {
+        download(res.data, '维修工单');
+      });
+    },
+    async handleNewSave() {
+      let { user } = JSON.parse(sessionStorage.getItem('vuex-eam'));
+      console.log(user);
+      let userInfo = user.info;
+      let obj = {
+        fromUser: userInfo.userId,
+        bizType: '4', // 领用出库
+        extInfo: {
+          assetType: 6,
+          verifyDeptCode: userInfo.deptId[0],
+          verifyDeptName: userInfo.deptName
+        },
+        type: 2,
+        fromType: 2
+      };
+      obj = { ...obj, ...this.wlParams };
+      if (this.dimension == 4) {
+        obj.num = this.materialObj.wlList.length;
+      } else {
+        obj.num = this.materialCodeReqList.length;
+      }
+      obj.storageSource = 1;
+      try {
+        const res = await outin.saveNew(obj);
+        if (res.code == 0) {
+          let arr = obj.realTimeInventoryNewPOList.map((item) => {
             return {
-              ...item,
-              packingCountBase: dimension == 3 ? 1 : item.packingCountBase
-              // weight: 0
+              sparePartsId: item.id,
+              sparePartsList: JSON.stringify({
+                ...item,
+                inventoryDetailsNewPOList: [],
+                inventoryDetailsVOList: [],
+                outInIds: res.data
+              })
             };
           });
-          //物料维度数据
-          let meteArr = [];
-          for (const item of packArr) {
-            if (item.materialDetailsVOList.length != 0) {
-              for (const iterator of item.materialDetailsVOList) {
-                meteArr.push({
-                  ...iterator
-                });
-              }
-            }
-          }
-          this.materialCodeReqList = meteArr;
-          //再次打开选择上
-          this.selectionList = list;
-          //send数据
-          this.wlParams = { realTimeInventoryNewPOList: list };
-          this.wlParams.realTimeInventoryNewPOList.forEach((item) => {
-            item.inventoryDetailsNewPOList = item.inventoryDetailsVOList;
-            item.inventoryDetailsNewPOList.forEach((ite) => {
-              // ite.weight = 0;
-              ite.outInMaterialDetailsAddPOList = ite.materialDetailsVOList;
-            });
+          applySpareParts({
+            workOrderId: this.currentRow.id,
+            infoList: arr
+          }).then((res) => {
+            this.$message.success('申请成功!');
           });
         }
-        this.handleNewSave();
-      },
-      // 添加备品备件
-      addSpareItems(row) {
-        this.currentRow = row;
-        this.$refs.assetsDialogRef.open();
-        // this.$refs.addSpareDialogRef.open();
-        // if (!this.clickedTreeNode) {
-        //   return this.$message.warning('请选择设备分类!');
-        // }
-        // this.$refs.addSpareDialogRef.open();
-        // if (this.planRuleEquiList[this.currentEquItemIndex]['sparePart']) {
-        //   this.selectedSpare =
-        //     this.planRuleEquiList[this.currentEquItemIndex]['sparePart'];
-        // } else {
-        //   this.selectedSpare = [];
-        // }
-        // console.log('this.selectedSpare',this.selectedSpare)
-      },
-      /* 表格数据源 */
-      datasource({ page, limit, where, order }) {
-        return getWorkOrderList({
-          pageNum: page,
-          size: limit,
-          ...where,
-          type: 3
+      } catch (error) {
+        console.log(error);
+      }
+    },
+    detailData(data) {
+      applySpareParts({
+        workOrderId: this.currentRow.id,
+        listId: data.map((item) => item.id),
+        listNumber: data.map((item) => item.measureQuantity)
+      }).then((res) => {
+        this.$message.success('申请成功!');
+      });
+    },
+    // 添加备品备件
+    addSpareItems(row) {
+      this.currentRow = row;
+      this.$refs.assetsDialogRef.open();
+
+      // this.$refs.addSpareDialogRef.open();
+      // if (!this.clickedTreeNode) {
+      //   return this.$message.warning('请选择设备分类!');
+      // }
+      // this.$refs.addSpareDialogRef.open();
+      // if (this.planRuleEquiList[this.currentEquItemIndex]['sparePart']) {
+      //   this.selectedSpare =
+      //     this.planRuleEquiList[this.currentEquItemIndex]['sparePart'];
+      // } else {
+      //   this.selectedSpare = [];
+      // }
+      // console.log('this.selectedSpare',this.selectedSpare)
+    },
+    /* 表格数据源 */
+    datasource({ page, limit, where, order }) {
+      return getWorkOrderList({
+        pageNum: page,
+        size: limit,
+        ...where,
+        type: 3
+      });
+    },
+    async changeEnable(row) {
+      const res = await putRoles(row);
+      if (res.code == 0) {
+        this.$message({
+          type: 'success',
+          message: '修改成功',
+          customClass: 'ele-message-border'
         });
-      },
-      async changeEnable(row) {
-        const res = await putRoles(row);
-        if (res.code == 0) {
-          this.$message({
-            type: 'success',
-            message: '修改成功',
-            customClass: 'ele-message-border'
-          });
-          this.reload();
-        }
-      },
-      /* 刷新表格 */
-      reload(where) {
-        this.$refs.table.reload({ page: 1, where });
-      },
+        this.reload();
+      }
+    },
+    /* 刷新表格 */
+    reload(where) {
+      this.$refs.table.reload({ page: 1, where });
+    },
 
-      goDetail(row) {
-        row.title = '工单详情';
-        row.tabLabel = '工单信息';
-        this.$refs.detailsDialogRef.init(row);
-      },
+    goDetail(row) {
+      row.title = '工单详情';
+      row.tabLabel = '工单信息';
+      this.$refs.detailsDialogRef.init(row);
+    },
 
-      // 转派
-      toRedeploy(row) {
-        this.$refs.redeployOtherRef.open(row);
-      },
-      // 报工
-      toReport(row) {
-        this.$refs.repairReportingWorkRef.open(row, true);
-      }
+    // 转派
+    toRedeploy(row) {
+      this.$refs.redeployOtherRef.open(row);
+    },
+    // 报工
+    toReport(row) {
+      this.$refs.repairReportingWorkRef.open(row, true);
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped></style>

+ 89 - 0
src/views/sparePartsApply/components/search.vue

@@ -0,0 +1,89 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form label-width="90px" class="ele-form-search" @keyup.enter.native="search" @submit.native.prevent>
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="工单编码:">
+          <el-input clearable v-model="where.workOrderCode" placeholder="请输入"/>
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="仓库名称:">
+          <el-input clearable v-model="where.warehouseName" placeholder="请输入"/>
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="物品名称:">
+          <el-input clearable v-model="where.categoryName" placeholder="请输入"/>
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="组织机构:">
+          <auth-selection v-model="where.deptIds" style="width: 100%"></auth-selection>
+        </el-form-item>
+      </el-col>
+
+
+      <el-col style="display: flex;justify-content: flex-end"
+              v-bind="styleResponsive ? { lg: 24, md: 24 } : { span: 24 }">
+        <el-form-item label-width="0px">
+          <el-button type="primary" icon="el-icon-search" class="ele-btn-icon" @click="search">
+            查询
+          </el-button>
+          <el-button @click="reset" icon="el-icon-refresh-left" type="primary">重置</el-button>
+        </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+
+export default {
+  props: [],
+  data() {
+    // 默认表单数据
+    const defaultWhere = {
+      workOrderCode: '',
+      warehouseName: '',
+      categoryName: '',
+      deptIds:''
+
+    };
+    return {
+      // 表单数据
+      where: {...defaultWhere},
+
+    };
+  },
+  computed: {
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
+    }
+  },
+  watch: {},
+  created() {
+
+  },
+  methods: {
+    /* 搜索 */
+    search() {
+      this.$emit('search', this.where);
+    },
+    /*  重置 */
+    reset() {
+      this.where = {...this.defaultWhere};
+      this.search();
+    },
+
+
+  }
+};
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 124 - 0
src/views/sparePartsApply/components/tgDetails.vue

@@ -0,0 +1,124 @@
+<template>
+  <ele-modal :visible.sync="visible" title="出库详情" width="1200px">
+    <ele-pro-table
+      :columns="columns"
+      :datasource="tableList"
+      cache-key="tgDetails"
+      height="calc(100vh - 350px)"
+      :need-page="false"
+    >
+      <template v-slot:packingWeight="{ row }">
+        {{ row.packingWeight }} {{ row.weightUnit }}
+      </template>
+
+      <template v-slot:materielCode="{ row }">
+        {{ row.extInfo.materielCode }}
+      </template>
+
+      <template v-slot:clientCode="{ row }">
+        {{ row.extInfo.clientCode }}
+      </template>
+
+      <template v-slot:engrave="{ row }">
+        {{ row.extInfo.engrave }}
+      </template>
+    </ele-pro-table>
+  </ele-modal>
+</template>
+
+<script>
+export default {
+  computed: {
+    clientEnvironmentId() {
+      return this.$store.state.user.info.clientEnvironmentId;
+    }
+  },
+  data() {
+    return {
+      visible: false,
+      tableList: [],
+      columns: [
+        {
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center'
+        },
+
+        {
+          label: '出库申请单id',
+          prop: 'applyStorageId'
+        },
+
+        {
+          label: '物品名称',
+          prop: 'categoryName'
+        },
+        {
+          label: '物品分类名称',
+          prop: 'categoryLevelName'
+        },
+
+        {
+          label: '牌号',
+          prop: 'brandNum'
+        },
+
+        {
+          label: '型号',
+          prop: 'modelType'
+        },
+
+        {
+          label: '包装数量',
+          prop: 'packingCount'
+        },
+
+        {
+          label: '包装单位',
+          prop: 'packingUnit'
+        },
+
+        {
+          label: '本包重量',
+          slot: 'packingWeight'
+        },
+
+        {
+          label: '包装内总数量',
+          slot: 'quantity'
+        },
+
+        {
+          label: '物料代号',
+          slot: 'materielCode'
+        },
+        {
+          label: '客户代号',
+          slot: 'clientCode'
+        },
+        {
+          label: '刻码',
+          slot: 'engrave'
+        },
+
+        {
+          label: '发货码',
+          prop: 'sendCode'
+        }
+      ],
+
+   
+    };
+  },
+  created() {},
+  methods: {
+    open(row) {
+      if (row) {
+        this.tableList = [...row.detailList];
+      }
+      this.visible = true;
+    }
+  }
+};
+</script>

+ 203 - 0
src/views/sparePartsApply/index.vue

@@ -0,0 +1,203 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never" v-loading="loading">
+      <search @search="reload" ref="searchRef"> </search>
+
+      <!-- 数据表格 -->
+      <ele-pro-table ref="table" :columns="columns" :datasource="datasource">
+        <template v-slot:totalCount="{ row }">
+          {{ row.totalCount }} {{ row.measuringUnit }}
+        </template>
+
+        <template v-slot:totalPackage="{ row }">
+          {{ row.totalPackage }}
+        </template>
+
+        <template v-slot:totalWeight="{ row }">
+          {{ row.totalWeight }} {{ row.weightUnit }}
+        </template>
+
+        <template v-slot:approvalStatus="{ row }">
+          <span :class="{ 'ele-text-danger': row.approvalStatus == 2 }">
+            {{ statusFormatter(row.approvalStatus) }}
+          </span>
+        </template>
+
+        <template v-slot:action="{ row }">
+          <el-link type="primary" :underline="false" @click="details(row)">
+            详情
+          </el-link>
+        </template>
+      </ele-pro-table>
+    </el-card>
+
+    <tgDetails ref="tgDetailsRefs"></tgDetails>
+  </div>
+</template>
+
+<script>
+import { getList } from '@/api/sparePartsApply/index.js';
+
+import search from './components/search.vue';
+import tgDetails from './components/tgDetails.vue';
+export default {
+  components: {
+    search,
+    tgDetails
+  },
+  data() {
+    return {
+      loading: false,
+      outputSceneState: [
+        { code: 1, label: '退供出库' },
+        { code: 2, label: '调拨出库' },
+        { code: 3, label: '销售出库' },
+        { code: 4, label: '领用出库' },
+        { code: 5, label: '报废出库' },
+        { code: 6, label: '外协出库' },
+        { code: 7, label: '委外出库' },
+        { code: 8, label: '受托退货出库' },
+        { code: 9, label: '仓库委外出库' },
+        { code: 10, label: '采购退货出库' },
+        { code: 11, label: '自选领用出库' },
+        { code: 12, label: '配料出库' }
+      ],
+      statusOpt: [
+        { label: '未提交', value: 0 },
+        { label: '审核中', value: 1 },
+        { label: '审核通过', value: 2 },
+        { label: '审核不通过', value: 3 }
+      ]
+    };
+  },
+  computed: {
+    // 表格列配置
+    columns() {
+      return [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'code',
+          label: '编码',
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'workOrderCode',
+          label: '工单编码',
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          prop: 'warehouseName',
+          label: '仓库名称	',
+          align: 'center'
+        },
+
+        {
+          prop: 'categoryLevelName',
+          label: '物品分类',
+          align: 'center'
+        },
+        {
+          prop: 'categoryName',
+          label: '名称',
+          align: 'center'
+        },
+        { label: '型号', prop: 'modelType', width: '150' },
+        { label: '规格', prop: 'specification', width: '150' },
+        { label: '牌号', prop: 'brandNum', width: '50' },
+        {
+          slot: 'totalCount',
+          label: '总数量',
+          align: 'center'
+        },
+
+        {
+          slot: 'totalPackage',
+          label: '总包装',
+          align: 'center'
+        },
+
+        {
+          slot: 'totalWeight',
+          label: '总重量',
+          align: 'center'
+        },
+        {
+          prop: 'type',
+          label: '出库类型',
+          align: 'center',
+          formatter: (row, column, cellValue) => {
+            return this.outputSceneState.find(item=>item.code==cellValue)?.label
+
+          }
+        },
+        {
+          prop: 'approvalUserName',
+          label: '审核人',
+          align: 'center'
+        },
+
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          slot: 'approvalStatus',
+          label: '状态',
+          align: 'center'
+        },
+
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 120,
+          align: 'center',
+          resizable: false,
+          fixed: 'right',
+          slot: 'action',
+          showOverflowTooltip: true
+        }
+      ];
+    }
+  },
+  created() {},
+  methods: {
+    statusFormatter(status) {
+      const obj = this.statusOpt.find((i) => i.value == status);
+      return obj && obj.label;
+    },
+    /* 表格数据源 */
+    datasource({ page, limit, where }) {
+      return getList({
+        pageNum: page,
+        size: limit,
+        ...where
+      });
+    },
+
+    details(row) {
+      this.$refs.tgDetailsRefs.open(row);
+    },
+
+    /* 刷新表格 */
+    reload(where) {
+      this.$nextTick(() => {
+        this.$refs.table.reload({ page: 1, where });
+      });
+    }
+  }
+};
+</script>
+

+ 1 - 1
vue.config.js

@@ -35,7 +35,7 @@ module.exports = {
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.139:18086', // 粟
         // target: 'http://192.168.1.132:18086', // 徐
-        target: 'http://192.168.1.116:18086', //本
+        target: 'http://192.168.1.107:18086', //本
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''