Browse Source

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

汪钰 3 years ago
parent
commit
852f212a07
43 changed files with 4374 additions and 643 deletions
  1. 22 23
      src/api/ledgerAssets/index.js
  2. 0 43
      src/api/ledgerAssets/turnovercar.js
  3. 0 0
      src/assets/upload-placeholder.svg
  4. 48 0
      src/components/CommomSelect/dept-select.vue
  5. 13 1
      src/router/index.js
  6. 5 5
      src/router/routes.js
  7. 5 5
      src/store/index.js
  8. 26 19
      src/store/modules/user.js
  9. 23 0
      src/styles/transition/common.scss
  10. 11 3
      src/views/classifyManage/itemInformation/add.vue
  11. 1 1
      src/views/classifyManage/itemInformation/components/RowForm.vue
  12. 4 0
      src/views/codeManagement/components/myTable.vue
  13. 6 8
      src/views/ledgerAssets/boat/components/baseInfo.vue
  14. 1 1
      src/views/ledgerAssets/boat/components/boat-list.vue
  15. 12 8
      src/views/ledgerAssets/boat/components/boat-search.vue
  16. 1 1
      src/views/ledgerAssets/boat/index.vue
  17. 258 0
      src/views/ledgerAssets/equipment/components/DialogGoods.vue
  18. 187 149
      src/views/ledgerAssets/equipment/components/baseInfo.vue
  19. 23 5
      src/views/ledgerAssets/equipment/components/equipment-list.vue
  20. 984 0
      src/views/ledgerAssets/equipment/edit.vue
  21. 6 2
      src/views/ledgerAssets/equipment/index.vue
  22. 6 8
      src/views/ledgerAssets/material/components/baseInfo.vue
  23. 1 1
      src/views/ledgerAssets/material/components/material-list.vue
  24. 1 1
      src/views/ledgerAssets/material/index.vue
  25. 282 0
      src/views/ledgerAssets/mould/components/baseInfo.vue
  26. 216 0
      src/views/ledgerAssets/mould/components/mould-list.vue
  27. 123 0
      src/views/ledgerAssets/mould/components/mould-search.vue
  28. 59 0
      src/views/ledgerAssets/mould/detail.vue
  29. 441 0
      src/views/ledgerAssets/mould/edit.vue
  30. 80 0
      src/views/ledgerAssets/mould/index.vue
  31. 232 0
      src/views/ledgerAssets/sparepart/components/baseInfo.vue
  32. 216 0
      src/views/ledgerAssets/sparepart/components/sparepart-list.vue
  33. 127 0
      src/views/ledgerAssets/sparepart/components/sparepart-search.vue
  34. 59 0
      src/views/ledgerAssets/sparepart/detail.vue
  35. 434 0
      src/views/ledgerAssets/sparepart/edit.vue
  36. 80 0
      src/views/ledgerAssets/sparepart/index.vue
  37. 49 75
      src/views/ledgerAssets/turnoverCar/components/baseInfo.vue
  38. 31 10
      src/views/ledgerAssets/turnoverCar/components/turnovercar-list.vue
  39. 19 17
      src/views/ledgerAssets/turnoverCar/components/turnovercar-search.vue
  40. 6 28
      src/views/ledgerAssets/turnoverCar/detail.vue
  41. 266 222
      src/views/ledgerAssets/turnoverCar/edit.vue
  42. 1 0
      src/views/ledgerAssets/turnoverCar/index.vue
  43. 9 7
      src/views/login/index.vue

+ 22 - 23
src/api/ledgerAssets/boat.js → src/api/ledgerAssets/index.js

@@ -11,15 +11,6 @@ export async function getBoatList (data) {
   return Promise.reject(new Error(res.data.message));
 }
 
-// 查询实例详情
-export async function getCategoryInfo (id) {
-  const res = await request.get(`/main/category/info/${id}`);
-  if (res.data.code == 0) {
-    return res.data;
-  }
-  return Promise.reject(new Error(res.data.message));
-}
-
 
 // 获取单个类别实体明细分页
 export async function getPageSingle (data) {
@@ -32,29 +23,37 @@ export async function getPageSingle (data) {
 }
 
 
+// 获取实体列表分页
+export async function getAssetList (data) {
+  let par = new URLSearchParams(data);
+  const res = await request.get(`/main/asset/page?` + par, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 
 
-
-
-
-
-
-
-
-
-// 删除分类
-export async function deleteCategory (id) {
-  const res = await request.get(`/main/categoryLevel/delete/${id}`);
+// 查询实例详情
+export async function getAssetInfo (id) {
+  const res = await request.get(`/main/asset/login/${id}`);
   if (res.data.code == 0) {
     return res.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
-//根据ID查询分类详情系信息
-export async function getInfoById (id) {
-  const res = await request.get(`/main/categoryLevel/getById/${id}`);
+
+// 编辑或保存
+export async function saveOrEdit (data) {
+  const res = await request.post('/main/asset/saveOrEdit',data);
   if (res.data.code == 0) {
     return res.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+
+
+
+
+

+ 0 - 43
src/api/ledgerAssets/turnovercar.js

@@ -1,43 +0,0 @@
-import request from '@/utils/request';
-
-
-// 获取实体列表分页
-export async function getAssetList (data) {
-  let par = new URLSearchParams(data);
-  const res = await request.get(`/main/asset/page?` + par, {});
-  if (res.data.code == 0) {
-    return res.data.data;
-  }
-  return Promise.reject(new Error(res.data.message));
-}
-
-// 查询实例详情
-export async function getCategoryInfo (id) {
-  const res = await request.get(`/main/category/info/${id}`);
-  if (res.data.code == 0) {
-    return res.data;
-  }
-  return Promise.reject(new Error(res.data.message));
-}
-
-
-// 获取单个类别实体明细分页
-export async function getPageSingle (data) {
-  let par = new URLSearchParams(data);
-  const res = await request.get(`/main/asset/pageSingleSubstance?` + par, {});
-  if (res.data.code == 0) {
-    return res.data.data;
-  }
-  return Promise.reject(new Error(res.data.message));
-}
-
-
-
-
-
-
-
-
-
-
-

File diff suppressed because it is too large
+ 0 - 0
src/assets/upload-placeholder.svg


+ 48 - 0
src/components/CommomSelect/dept-select.vue

@@ -0,0 +1,48 @@
+<!-- 部门树形选择下拉框 -->
+<template>
+  <ele-tree-select
+    clearable
+    :value="value || ''"
+    :data="treeData"
+    label-key="name"
+    value-key="id"
+    default-expand-all
+    :placeholder="placeholder"
+    @input="updateValue"
+    @change="handleChange"
+  />
+</template>
+
+<script>
+  import { listOrganizations } from '@/api/system/organization';
+  export default {
+    props: {
+      // 选中的数据(v-model)
+      value: [Number, String],
+      // 提示信息
+      placeholder: {
+        type: String,
+        default: '请选择'
+      }
+    },
+    data () {
+      return {
+        treeData: []
+      };
+    },
+    created () {},
+    methods: {
+      async getData (parmas = {}) {
+        const data = await listOrganizations(parmas);
+        this.treeData = data || [];
+      },
+      /* 更新选中数据 */
+      updateValue (value) {
+        this.$emit('input', value);
+      },
+      handleChange (item) {
+        console.log(item);
+      }
+    }
+  };
+</script>

+ 13 - 1
src/router/index.js

@@ -45,7 +45,19 @@ router.beforeEach((to, from, next) => {
           next();
         });
     } else {
-      next();
+      // console.log(router.getRoutes(), 'router', routes);
+      if (routes.length >= router.getRoutes()?.length) {
+        router.addRoute(
+          getMenuRoutes([
+            ...store.state.user.menus,
+            ...store.state.user.authoritiesRouter,
+            to.fullPath
+          ])
+        );
+        next({ ...to });
+      } else {
+        next();
+      }
     }
   } else if (WHITE_LIST.includes(to.path)) {
     next();

+ 5 - 5
src/router/routes.js

@@ -17,12 +17,12 @@ export const routes = [
     path: '/forget',
     component: () => import('@/views/forget/index.vue'),
     meta: { title: '忘记密码' }
-  },
-  // 404
-  {
-    path: '*',
-    component: () => import('@/views/exception/404/index.vue')
   }
+  // 404
+  // {
+  //   path: '*',
+  //   component: () => import('@/views/exception/404/index.vue')
+  // }
   // {
   //   path: '/system/role',
   //   component: () => import('@/views/system/role/index.vue'),

+ 5 - 5
src/store/index.js

@@ -7,7 +7,7 @@ import getters from './getters';
 import dict from './modules/dict';
 import user from './modules/user';
 import theme from './modules/theme';
-// import createPersistedState from 'vuex-persistedstate';
+import createPersistedState from 'vuex-persistedstate';
 
 Vue.use(Vuex);
 
@@ -22,9 +22,9 @@ export default new Vuex.Store({
   },
   getters,
   plugins: [
-    // createPersistedState({
-    //   storage: window.sessionStorage,
-    //   paths: ['']
-    // })
+    createPersistedState({
+      storage: window.sessionStorage,
+      paths: ['user']
+    })
   ] //会自动保存创建的状态。刷新还在
 });

+ 26 - 19
src/store/modules/user.js

@@ -42,24 +42,30 @@ export default {
     menus: null,
     // 当前登录用户的权限
     authorities: [],
+    // 当前登录用户的权限路由
+    authoritiesRouter: [],
     // 当前登录用户的角色
     roles: []
   },
   mutations: {
     // 设置登录用户的信息
-    setUserInfo(state, info) {
+    setUserInfo (state, info) {
       state.info = info;
     },
     // 设置登录用户的菜单
-    setMenus(state, menus) {
+    setMenus (state, menus) {
       state.menus = menus;
     },
     // 设置登录用户的权限
-    setAuthorities(state, authorities) {
+    setAuthorities (state, authorities) {
       state.authorities = authorities;
     },
+    // 设置登录用户的权限路由
+    setAuthoritiesRouter (state, authoritiesRouter) {
+      state.authoritiesRouter = authoritiesRouter;
+    },
     // 设置登录用户的角色
-    setRoles(state, roles) {
+    setRoles (state, roles) {
       state.roles = roles;
     }
   },
@@ -97,8 +103,8 @@ export default {
     //   return { menus, homePath };
     // },
     //动态路由
-    async fetchUserInfo({ commit }) {
-      const result = await getResourcesTree().catch(() => { });
+    async fetchUserInfo ({ commit }) {
+      const result = await getResourcesTree().catch(() => {});
       if (!result) {
         return {};
       }
@@ -118,23 +124,24 @@ export default {
       // 用户菜单, 过滤掉按钮类型并转为 children 形式
       const { menus, homePath } = formatMenus(
         USER_MENUS ??
-        toTreeData({
-          data: menuList,
-          idField: 'id',
-          parentIdField: 'parentId'
-        })
+          toTreeData({
+            data: menuList,
+            idField: 'id',
+            parentIdField: 'parentId'
+          })
       );
       // 用户路由按钮
       const { menus: authoritiesRouter } = formatMenus(
         USER_MENUS ??
-        toTreeData({
-          data: authorities.filter((i) => i.path),
-          idField: 'id',
-          parentIdField: 'parentId'
-        })
+          toTreeData({
+            data: authorities.filter((i) => i.path),
+            idField: 'id',
+            parentIdField: 'parentId'
+          })
       );
       console.log('menus--', menus);
       commit('setMenus', menus);
+      commit('setAuthoritiesRouter', authoritiesRouter);
       // const menus = result;
       // const homePath = '/dashboard/workplace';
       return {
@@ -147,19 +154,19 @@ export default {
     /**
      * 更新用户信息
      */
-    setInfo({ commit }, value) {
+    setInfo ({ commit }, value) {
       commit('setUserInfo', value);
     },
     /**
      * 更新菜单数据
      */
-    setMenus({ commit }, value) {
+    setMenus ({ commit }, value) {
       commit('setMenus', value);
     },
     /**
      * 更新菜单的badge
      */
-    setMenuBadge({ commit, state }, { path, value, color }) {
+    setMenuBadge ({ commit, state }, { path, value, color }) {
       const menus = formatTreeData(state.menus, (m) => {
         if (path === m.path) {
           return {

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

@@ -1,3 +1,26 @@
 .w100 {
   width: 100%;
 }
+// 页头
+.ele-body {
+  .page-title {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    border-bottom: 1px solid #eaeefb;
+    padding-bottom: 8px;
+    margin-bottom: 16px;
+  }
+}
+// ele-split-layout 左侧盒子充满
+.split-layout-right-content {
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  box-sizing: border-box;
+  border-width: 1px;
+  border-style: solid;
+  overflow: auto;
+}

+ 11 - 3
src/views/classifyManage/itemInformation/add.vue

@@ -180,14 +180,20 @@
         } else {
           this.$set(this.itemForm, 'expirationDate', 'null');
         }
-        this.$set(this.itemForm, 'info', JSON.parse(data.extendField));
+        this.$set(
+          this.itemForm,
+          'info',
+          data.extendField ? JSON.parse(data.extendField) : { angle: 'notA' }
+        );
         this.$set(this.itemForm, 'name', data.name);
         this.$set(
           this.itemForm,
           'addList',
-          JSON.parse(data.selfDefinedParameter)
+          data.selfDefinedParameter ? JSON.parse(data.selfDefinedParameter) : []
         );
-        this.itemForm.urlIdList = JSON.parse(data.categoryLevelPathId);
+        this.itemForm.urlIdList = data.categoryLevelPathId
+          ? JSON.parse(data.categoryLevelPathId)
+          : [];
         if (this.pageTitle == '编辑物品') {
           // this.itemForm.itemCode = data.code.substring(3)
           this.$set(this.itemForm, 'itemCode', data.code.substring(3));
@@ -206,6 +212,8 @@
               this.itemForm.categoryVoRelationMap
             );
         }
+
+        console.log(this.itemForm, 'itemForm');
       },
 
       // 改变物品类型

+ 1 - 1
src/views/classifyManage/itemInformation/components/RowForm.vue

@@ -234,7 +234,7 @@
           </div>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="itemForm.addList.length < 10">
+      <el-col :span="8" v-if="itemForm.addList && itemForm.addList.length < 10">
         <el-form-item label-width="20px">
           <el-button type="primary" @click="addItem">增加自定义参数</el-button>
         </el-form-item>

+ 4 - 0
src/views/codeManagement/components/myTable.vue

@@ -199,6 +199,10 @@
             {
               value: 'yyyyMMddHHmmss',
               label: '年月日时分秒'
+            },
+            {
+              value: 'yyyyMMddHHmmssSSS',
+              label: '年月日时分秒毫秒'
             }
           ]
         }

+ 6 - 8
src/views/ledgerAssets/boat/components/baseInfo.vue

@@ -74,10 +74,8 @@
 </template>
 
 <script>
-  import {
-    getCategoryInfo,
-    getPageSingle
-  } from '@/api/ledgerAssets/boat.js';
+  import {  getPageSingle } from '@/api/ledgerAssets';
+  import {  getDetails } from '@/api/classifyManage/itemInformation.js';
 export default {
   props: {
     rowId:{
@@ -112,10 +110,10 @@ export default {
   },
   methods:{
      getDetilInfo(){
-       getCategoryInfo(this.rowId).then(res=>{
-          this.information = res.data
-          if(res.data.extendField){
-            this.$set(this.information, 'extendField', JSON.parse(res.data.extendField))
+       getDetails(this.rowId).then(res=>{
+          this.information = res
+          if(res.extendField){
+            this.$set(this.information, 'extendField', JSON.parse(res.extendField))
           }
        })
      },

+ 1 - 1
src/views/ledgerAssets/boat/components/boat-list.vue

@@ -37,7 +37,7 @@
   import BoatSearch from './boat-search.vue';
   import {
     getBoatList
-  } from '@/api/ledgerAssets/boat.js';
+  } from '@/api/ledgerAssets';
 
   export default {
     components: { BoatSearch },

+ 12 - 8
src/views/ledgerAssets/boat/components/boat-search.vue

@@ -1,31 +1,34 @@
 <!-- 搜索表单 -->
 <template>
   <el-form
-    label-width="77px"
+    label-width="50px"
     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="编码:" label-width="50px">
+        <el-form-item label="编码:">
           <el-input clearable v-model="where.code" placeholder="请输入" />
         </el-form-item>
+        <el-form-item label="型号:">
+          <el-input clearable v-model="where.module" placeholder="请输入" />
+        </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="名称:" label-width="50px">
+        <el-form-item label="名称:">
           <el-input clearable v-model="where.name" placeholder="请输入" />
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="角度:" label-width="50px">
+        <el-form-item label="角度:">
           <DictSelection dictName="角度" clearable v-model="where.angle">
           </DictSelection>
         </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.spaceModule" placeholder="请输入" />
+        <el-form-item label="规格:">
+          <el-input clearable v-model="where.space" placeholder="请输入" />
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 12, md: 12 } : { span: 12 }">
@@ -58,8 +61,9 @@
       const defaultWhere = {
         name: '',
         code: '',
-        angle:'',
-        spaceModule:''
+        // angle:'',
+        module:'',
+        space:''
       };
       return {
         // 表单数据

+ 1 - 1
src/views/ledgerAssets/boat/index.vue

@@ -34,7 +34,7 @@
   import BoatList from './components/boat-list.vue';
   import {
     getBoatList
-  } from '@/api/ledgerAssets/boat.js';
+  } from '@/api/ledgerAssets';
   export default {
     components: {
       AssetTree ,

+ 258 - 0
src/views/ledgerAssets/equipment/components/DialogGoods.vue

@@ -0,0 +1,258 @@
+<template>
+  <div class="dialogBox">
+    <el-dialog
+      :close-on-click-modal="false"
+      :append-to-body="appendToBody"
+      :title="title"
+      :visible.sync="visibleSync"
+      :before-close="close"
+      :width="width"
+      :custom-class="customClass"
+    >
+      <div class="boy-main">
+        <div class="from-search-bar">
+          <el-form>
+            <el-form-item>
+              <el-input
+                type="text"
+                v-model="searchForm.searchKey"
+                size="small"
+                placeholder="搜索物品编码/名称"
+              ></el-input>
+            </el-form-item>
+          </el-form>
+          <div class="btn-wrap">
+            <el-button icon="el-icon-refresh-left" size="small" @click="rest"
+              >重置</el-button
+            >
+            <el-button
+              type="primary"
+              icon="el-icon-search"
+              size="small"
+              @click="getData"
+              >搜索</el-button
+            >
+          </div>
+        </div>
+        <div class="main">
+          <div class="tree-col">
+            <AssetTree
+              @handleNodeClick="handleNodeClick"
+              ref="AssetTree"
+              :defaultExpandAll="true"
+              :init="true"
+              type="1"
+            />
+          </div>
+          <div class="right-wrap">
+            <el-table
+              ref="multipleTable"
+              class="tableRef"
+              :data="tableData"
+              tooltip-effect="dark"
+              stripe
+              row-key="index"
+              max-height="450"
+              border
+              :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
+              @select-all="onSelectAll"
+              @selection-change="selectItem"
+              @row-click="onSelectOp"
+            >
+              <el-table-column label="序号" type="index" width="50">
+              </el-table-column>
+              <el-table-column
+                label="物品编码"
+                prop="informationCode"
+                width="120"
+              >
+              </el-table-column>
+              <el-table-column
+                label="物品名称"
+                prop="informationName"
+                width="100"
+              >
+              </el-table-column>
+              <el-table-column
+                label="规格"
+                prop="specification"
+              ></el-table-column>
+              <el-table-column label="型号" prop="modelType"> </el-table-column>
+              <el-table-column
+                label="物品类型"
+                prop="classificationCode"
+                :formatter="classificationCodeFormatter"
+              >
+              </el-table-column>
+              <el-table-column label="分类" prop="classificationUrl">
+              </el-table-column>
+              <el-table-column type="selection" width="55"> </el-table-column>
+            </el-table>
+            <div class="btn-wrap">
+              <el-button size="small" @click="close">取消</el-button>
+              <el-button type="primary" size="small" @click="submit"
+                >确认</el-button
+              >
+            </div>
+          </div>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+  import AssetTree from '@/components/AssetTree';
+  // import { getList } from "@/api/stockManagement/itemInformation";
+  export default {
+    props: {
+      // 宽度
+      width: {
+        type: String,
+        default: () => null
+      },
+      // 类名
+      customClass: {
+        type: String,
+        default: () => null
+      },
+      appendToBody: {
+        type: Boolean,
+        default: () => false
+      }
+    },
+    components: {
+      AssetTree
+    },
+    data () {
+      return {
+        visibleSync: false,
+        title: '选择物品编码',
+        searchForm: {
+          searchKey: '',
+          classificationId: ''
+        },
+        tableData: [],
+        multipleSelection: [],
+        typeList: [
+          { id: 1, value: 'w01  生产设备', prefix: 'w01', code: 1 },
+          { id: 2, value: 'w02  舟皿', prefix: 'w02', code: 2 },
+          { id: 3, value: 'w03  周转车', prefix: 'w03', code: 5 },
+          { id: 4, value: 'w04  模具', prefix: 'w04', code: 6 },
+          { id: 5, value: 'w05  备品备件', prefix: 'w05', code: 7 },
+          { id: 6, value: 'w06  物料', prefix: 'w06', code: 3 },
+          { id: 7, value: 'w07  产品', prefix: 'w07', code: 4 },
+          { id: 8, value: 'w08  耗材', prefix: 'w08', code: 8 }
+        ]
+      };
+    },
+    methods: {
+      open () {
+        this.visibleSync = true;
+      },
+      close () {
+        this.visibleSync = false;
+      },
+      rest () {
+        this.searchForm.searchKey = '';
+        this.getData();
+      },
+      async getData () {
+        let par = {
+          ...this.searchForm,
+          size: 999,
+          page: 1
+        };
+        const res = await getList(par);
+        if (res?.success) {
+          this.tableData = res.data.records;
+        }
+      },
+      handleNodeClick (info) {
+        this.searchForm.classificationId = info.id;
+        this.getData();
+      },
+
+      onSelectAll () {
+        this.$refs.multipleTable.clearSelection();
+      },
+      selectItem (rows) {
+        if (rows.length > 1) {
+          const newRows = rows.filter((it, index) => {
+            if (index == rows.length - 1) {
+              this.$refs.multipleTable.toggleRowSelection(it, true);
+              return true;
+            } else {
+              this.$refs.multipleTable.toggleRowSelection(it, false);
+              return false;
+            }
+          });
+          this.multipleSelection = newRows;
+        } else {
+          this.multipleSelection = rows;
+        }
+        this.userId = this.multipleSelection.length
+          ? this.multipleSelection[0].guid
+          : '';
+      },
+      onSelectOp (row) {
+        this.$refs.multipleTable.clearSelection();
+        this.$refs.multipleTable.toggleRowSelection(row, true);
+        this.multipleSelection = [];
+        this.multipleSelection.push(row);
+      },
+      submit () {
+        if (this.multipleSelection.length < 1) {
+          return this.$message.error('请选择物品编码');
+        }
+        this.$emit('succeed', this.multipleSelection[0]);
+        this.close();
+      },
+      // 物品类型格式化
+      classificationCodeFormatter (row) {
+        let itemName = '';
+        this.typeList.map((item) => {
+          if (item.prefix == row.classificationCode) {
+            itemName = item.value;
+          }
+        });
+        return itemName;
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped>
+  .from-search-bar {
+    display: flex;
+    .btn-wrap {
+      margin-left: 20px;
+    }
+  }
+  .main {
+    display: flex;
+    .tree-col {
+      margin-right: 10px;
+      width: 350px;
+      height: 500px;
+      overflow-y: auto;
+      padding: 0 !important;
+      background-color: #fff;
+      margin-top: 10px;
+      border: 1px solid #e6ebf5;
+      border-radius: 4px;
+      overflow-x: auto;
+      box-sizing: border-box;
+    }
+    .right-wrap {
+      width: 100%;
+      margin-top: 10px;
+      .tableRef {
+        height: 450px;
+      }
+      .btn-wrap {
+        display: flex;
+        justify-content: flex-end;
+        margin-top: 20px;
+      }
+    }
+  }
+</style>

+ 187 - 149
src/views/ledgerAssets/equipment/components/baseInfo.vue

@@ -22,39 +22,80 @@
       </el-descriptions-item>
       <el-descriptions-item :span="2">
         <template slot="label"> 分类 </template>
-        {{information.categoryLevelPath}}
+        {{ information.categoryLevelPath }}
       </el-descriptions-item>
       <el-descriptions-item>
         <template slot="label"> 长/宽/高(mm) </template>
-        {{information.extendField.length}}/{{information.extendField.width}}/{{information.extendField.high}}
+        {{ information.extendField.length }}/{{
+          information.extendField.width
+        }}/{{ information.extendField.high }}
       </el-descriptions-item>
       <el-descriptions-item>
         <template slot="label"> 计量单位</template>
-        {{information.measuringUnit}}
+        {{ information.measuringUnit }}
       </el-descriptions-item>
     </el-descriptions>
     <div class="basic-details-title border-none">
       <span class="border-span">舟皿明细</span>
     </div>
     <div>
-      <el-tabs v-model="activeName" type="card" @tab-click="tabClick" class="basic-tab">
-          <el-tab-pane :label="`在用(${countInfo.inUseSum?countInfo.inUseSum:'0'})`" name="inUse" >
-          </el-tab-pane>
-          <el-tab-pane :label="`在库(${countInfo.inLibrarySum?countInfo.inLibrarySum:'0'})`" name="inLibrary">
-          </el-tab-pane>
-          <el-tab-pane :label="`消耗(${countInfo.consumeSum?countInfo.consumeSum:'0'})`" name="hasConsume">
-          </el-tab-pane>
+      <el-tabs
+        v-model="activeName"
+        type="card"
+        @tab-click="tabClick"
+        class="basic-tab"
+      >
+        <el-tab-pane
+          :label="`在用(${countInfo.inUseSum ? countInfo.inUseSum : '0'})`"
+          name="inUse"
+        >
+        </el-tab-pane>
+        <el-tab-pane
+          :label="`在库(${
+            countInfo.inLibrarySum ? countInfo.inLibrarySum : '0'
+          })`"
+          name="inLibrary"
+        >
+        </el-tab-pane>
+        <el-tab-pane
+          :label="`消耗(${countInfo.consumeSum ? countInfo.consumeSum : '0'})`"
+          name="hasConsume"
+        >
+        </el-tab-pane>
       </el-tabs>
-      <el-table :data="tableData" class="table-box"
-         :header-cell-style="{ background: '#F0F3F3', border: 'none'}"
+      <el-table
+        :data="tableData"
+        class="table-box"
+        :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
       >
-           <el-table-column type="index" label="序号"  width="100"> </el-table-column>
-           <el-table-column prop="code" label="编码" > </el-table-column>
-           <el-table-column prop="name" label="名称" > </el-table-column>
-           <el-table-column prop="inCode" label="入库单号" v-if="activeName=='inLibrary'"> </el-table-column>
-           <el-table-column prop="inTime" label="入库时间" v-if="activeName=='inLibrary'"> </el-table-column>
-           <el-table-column prop="outCode" label="出库单号" v-if="activeName!='inLibrary'"> </el-table-column>
-           <el-table-column prop="outTime" label="出库时间" v-if="activeName!='inLibrary'"> </el-table-column>
+        <el-table-column type="index" label="序号" width="100">
+        </el-table-column>
+        <el-table-column prop="code" label="编码"> </el-table-column>
+        <el-table-column prop="name" label="名称"> </el-table-column>
+        <el-table-column
+          prop="inCode"
+          label="入库单号"
+          v-if="activeName == 'inLibrary'"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="inTime"
+          label="入库时间"
+          v-if="activeName == 'inLibrary'"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="outCode"
+          label="出库单号"
+          v-if="activeName != 'inLibrary'"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="outTime"
+          label="出库时间"
+          v-if="activeName != 'inLibrary'"
+        >
+        </el-table-column>
       </el-table>
       <div class="pagination">
         <el-pagination
@@ -74,170 +115,167 @@
 </template>
 
 <script>
-  import {
-    getCategoryInfo,
-    getPageSingle
-  } from '@/api/ledgerAssets/boat.js';
-export default {
-  props: {
-    rowId:{
-      type:String ,
-      default:''
+  import { getPageSingle } from '@/api/ledgerAssets';
+  import {  getDetails } from '@/api/classifyManage/itemInformation.js';
+  export default {
+    props: {
+      rowId: {
+        type: String,
+        default: ''
+      }
     },
-  },
-  data () {
-    return {
-      information:{
-        extendField:{}
-      },
-      activeName:'inUse',
-      tableData:[],
-      pagination: {
-        pageNum: 1,
-        size: 15
-      },
-      total: 0,
-      searchForm:{
-        categoryId:this.rowId,
-        positionType:1
-      },
-      countInfo:{}
-
-    }
-  },
-  created () {
-    this.getDetilInfo()
-    this.handleList()
-    // this.getCountNum()
-  },
-  methods:{
-     getDetilInfo(){
-       getCategoryInfo(this.rowId).then(res=>{
-          this.information = res.data
-          if(res.data.extendField){
-            this.$set(this.information, 'extendField', JSON.parse(res.data.extendField))
+    data () {
+      return {
+        information: {
+          extendField: {}
+        },
+        activeName: 'inUse',
+        tableData: [],
+        pagination: {
+          pageNum: 1,
+          size: 15
+        },
+        total: 0,
+        searchForm: {
+          categoryId: this.rowId,
+          positionType: 1
+        },
+        countInfo: {}
+      };
+    },
+    created () {
+      this.getDetilInfo();
+      this.handleList();
+      // this.getCountNum()
+    },
+    methods: {
+      getDetilInfo () {
+        getDetails(this.rowId).then((res) => {
+          this.information = res;
+          if (res.extendField) {
+            this.$set(
+              this.information,
+              'extendField',
+              JSON.parse(res.extendField)
+            );
           }
-       })
-     },
-     tabClick(val){
+        });
+      },
+      tabClick (val) {
         switch (this.activeName) {
           case 'inUse': {
-            this.searchForm.positionType = 1
+            this.searchForm.positionType = 1;
             break;
           }
           case 'inLibrary': {
-            this.searchForm.positionType = 2
+            this.searchForm.positionType = 2;
             break;
           }
           case 'hasConsume': {
-            this.searchForm.positionType = 3
+            this.searchForm.positionType = 3;
             break;
           }
           default:
             break;
         }
-        this.handleList()
-     },
+        this.handleList();
+      },
 
-     handleCurrent (page) {
-       this.pagination.pageNum = page
-       this.handleList()
-     },
-     handleSize (size) {
-       this.pagination.pageNum = 1
-       this.pagination.size = size
-       this.handleList()
-     },
+      handleCurrent (page) {
+        this.pagination.pageNum = page;
+        this.handleList();
+      },
+      handleSize (size) {
+        this.pagination.pageNum = 1;
+        this.pagination.size = size;
+        this.handleList();
+      },
 
       handleList () {
-         const params = {
-           ...this.searchForm,
-           ...this.pagination
-         }
-         getPageSingle(params).then(res=>{
-            this.tableData = res.list
-            this.total = res.count
-         })
-
+        const params = {
+          ...this.searchForm,
+          ...this.pagination
+        };
+        getPageSingle(params).then((res) => {
+          this.tableData = res.list;
+          this.total = res.count;
+        });
       },
 
-     getCountNum(){
-       const params = {
-           assetType:'ZHOUMIN',
-           informationId:this.rowInfo.id
-       }
-       getCount(params).then(res=>{
-           if(res?.success){
-               this.countInfo = res.data
-           }
-       })
-     }
-
-
-  },
-
-  watch:{
-    // 监听类别id变化
-    // rowId() {
-    //   this.getDetilInfo()
-    // }
-  },
+      getCountNum () {
+        const params = {
+          assetType: 'ZHOUMIN',
+          informationId: this.rowInfo.id
+        };
+        getCount(params).then((res) => {
+          if (res?.success) {
+            this.countInfo = res.data;
+          }
+        });
+      }
+    },
 
-}
+    watch: {
+      // 监听类别id变化
+      // rowId() {
+      //   this.getDetilInfo()
+      // }
+    }
+  };
 </script>
 
 <style lang="scss" scoped>
- .baseinfo-container {
+  .baseinfo-container {
     background-color: #fff;
     padding: 20px;
     .content {
       padding: 0 20px;
     }
-  .basic-details-title{
-    font-size: 16px;
-    margin: 15px 0;
-  }
-  .basic-tab{
-    margin-bottom: 15px;
-  }
-  .upload-container {
-    display: flex;
-    .img-box {
-      width: 280px;
-      height: 342px;
-      border: 1px solid rgba(215, 215, 215, 1);
-      display: flex;
-      justify-content: center;
-      align-items: center;
-      img {
-        max-width: 100%;
-      }
+    .basic-details-title {
+      font-size: 16px;
+      margin: 15px 0;
     }
-    .file-list {
-      margin-left: 50px;
-      flex: 1;
+    .basic-tab {
+      margin-bottom: 15px;
+    }
+    .upload-container {
       display: flex;
-      justify-content: space-between;
-      flex-wrap: wrap;
-      justify-items: baseline;
-      align-content: flex-start;
-      .file-box {
-        width: 30%;
-        margin-bottom: 20px;
-        height: 57px;
-        text-align: center;
-        line-height: 55px;
-        border: 1px solid var(--mainColor);
-        color: var(--mainColor);
-        cursor: pointer;
+      .img-box {
+        width: 280px;
+        height: 342px;
+        border: 1px solid rgba(215, 215, 215, 1);
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        img {
+          max-width: 100%;
+        }
+      }
+      .file-list {
+        margin-left: 50px;
+        flex: 1;
+        display: flex;
+        justify-content: space-between;
+        flex-wrap: wrap;
+        justify-items: baseline;
+        align-content: flex-start;
+        .file-box {
+          width: 30%;
+          margin-bottom: 20px;
+          height: 57px;
+          text-align: center;
+          line-height: 55px;
+          border: 1px solid var(--mainColor);
+          color: var(--mainColor);
+          cursor: pointer;
 
-        &.disabled {
-          cursor: not-allowed;
-          border-color: rgba(215, 215, 215, 1);
-          color: rgba(215, 215, 215, 1);
+          &.disabled {
+            cursor: not-allowed;
+            border-color: rgba(215, 215, 215, 1);
+            color: rgba(215, 215, 215, 1);
+          }
         }
       }
     }
   }
-}
 </style>

+ 23 - 5
src/views/ledgerAssets/equipment/components/equipment-list.vue

@@ -6,13 +6,22 @@
       ref="table"
       :columns="columns"
       :datasource="datasource"
-      height="calc(100vh - 265px)"
-      full-height="calc(100vh - 116px)"
+      height="calc(100vh - 265px - 102px)"
+      full-height="calc(100vh - 116px - 102px)"
       tool-class="ele-toolbar-form"
       cache-key="systemOrgUserTable"
     >
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
+        <el-button
+          size="small"
+          type="primary"
+          icon="el-icon-plus"
+          class="ele-btn-icon"
+          @click="add"
+        >
+          新建
+        </el-button>
         <el-button
           size="small"
           type="primary"
@@ -40,7 +49,7 @@
 
 <script>
   import EquipmentSearch from './equipment-search.vue';
-  import { getBoatList } from '@/api/ledgerAssets/boat.js';
+  import { getAssetList } from '@/api/ledgerAssets';
 
   export default {
     components: { EquipmentSearch },
@@ -123,7 +132,7 @@
     methods: {
       /* 表格数据源 */
       datasource ({ page, limit, where, order }) {
-        return getBoatList({
+        return getAssetList({
           ...where,
           ...order,
           pageNum: page,
@@ -140,7 +149,16 @@
       // 跳转到详情页
       handEdit ({ id }) {
         this.$router.push({
-          path: '/ledgerAssets/boat/detail',
+          path: '/ledgerAssets/equipment/detail',
+          query: {
+            id
+          }
+        });
+      },
+      // 跳转到详情页
+      add ({ id }) {
+        this.$router.push({
+          path: '/ledgerAssets/equipment/edit',
           query: {
             id
           }

+ 984 - 0
src/views/ledgerAssets/equipment/edit.vue

@@ -0,0 +1,984 @@
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <div class="page-title">
+        <el-page-header @back="$router.go(-1)">
+          <div slot="content" class="pageContent">
+            <div>{{ title }}</div>
+          </div>
+        </el-page-header>
+        <div>
+          <el-button size="small" @click="$router.go(-1)">取消</el-button>
+          <el-button
+            size="small"
+            type="primary"
+            @click="submit"
+            v-loading="btnLoading"
+            >确定</el-button
+          >
+        </div>
+      </div>
+      <el-form label-width="120px" :model="form" ref="form" :rules="rules">
+        <div class="content">
+          <div class="basic-details-title border-none">
+            <span class="border-span">基本信息</span>
+          </div>
+          <el-descriptions title="" :column="4" size="medium" border>
+            <template slot="title" v-if="pageType == 'add'">
+              <el-form-item class="label-none">
+                <span style="color: red; padding-right: 5px">*</span>
+                <el-button type="primary" plain @click="handlwpbm"
+                  >选择物品编码</el-button
+                >
+              </el-form-item>
+            </template>
+            <el-descriptions-item>
+              <template slot="label"> 设备编码 </template>
+              <el-form-item
+                prop="informationCode"
+                label-width="0"
+                v-if="pageType == 'add'"
+              >
+                <el-input
+                  v-if="basicInfo"
+                  class="input"
+                  size="small"
+                  v-model="form.informationCode"
+                ></el-input>
+              </el-form-item>
+              <span v-if="pageType == 'edit'">{{ form.informationCode }}</span>
+            </el-descriptions-item>
+            <el-descriptions-item>
+              <template slot="label"> 设备名称 </template>
+              <el-form-item
+                prop="informationName"
+                label-width="0"
+                v-if="pageType == 'add'"
+              >
+                <el-input
+                  v-if="basicInfo"
+                  class="input"
+                  size="small"
+                  v-model="form.informationName"
+                ></el-input>
+              </el-form-item>
+              <span v-if="pageType == 'edit'">{{ form.informationName }}</span>
+            </el-descriptions-item>
+            <el-descriptions-item>
+              <template slot="label"> 型号</template>
+              {{ basicInfo.modelType }}
+            </el-descriptions-item>
+            <el-descriptions-item>
+              <template slot="label"> 规格 </template>
+              {{ basicInfo.specification }}
+            </el-descriptions-item>
+            <el-descriptions-item :span="2">
+              <template slot="label"> 分类 </template>
+              {{ basicInfo.classificationUrl }}
+            </el-descriptions-item>
+            <el-descriptions-item>
+              <template slot="label"> 生产日期 </template>
+              <el-form-item
+                prop="productTime"
+                label-width="0"
+                v-if="pageType == 'add'"
+              >
+                <el-date-picker
+                  v-if="basicInfo"
+                  v-model="form.productTime"
+                  type="datetime"
+                  placeholder="选择日期时间"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                >
+                </el-date-picker>
+              </el-form-item>
+              <span v-if="pageType == 'edit'">{{ form.productTime }}</span>
+            </el-descriptions-item>
+            <el-descriptions-item>
+              <template slot="label"> 过保日期 </template>
+              <span v-if="pageType == 'add'">{{ expirationTime }}</span>
+              <span v-if="pageType == 'edit'">{{ cbexpirationTime }}</span>
+            </el-descriptions-item>
+            <el-descriptions-item>
+              <template slot="label"> 计量单位 </template>
+              {{ basicInfo.measuringUnit }}
+            </el-descriptions-item>
+            <el-descriptions-item>
+              <template slot="label"> 标准产能 </template>
+              {{ setbzcn(basicInfo.extendField) }}
+            </el-descriptions-item>
+            <!-- <el-descriptions-item v-if="pageType == 'edit'">
+            <template slot="label"> 实际产能 </template>
+            {{ basicInfo.measuringUnit }}
+          </el-descriptions-item> -->
+            <el-descriptions-item v-if="pageType == 'edit'">
+              <template slot="label"> 生命周期</template>
+              {{ sourceDICT }}
+            </el-descriptions-item>
+            <el-descriptions-item v-if="pageType == 'edit'">
+              <template slot="label"> 网络状态</template>
+              {{ networkStatus == 1 ? '在线' : '离线' }}
+            </el-descriptions-item>
+          </el-descriptions>
+
+          <div class="basic-details-title border-none">
+            <span class="border-span">资产信息</span>
+          </div>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="固资编码">
+                <el-input
+                  class="input"
+                  size="small"
+                  v-model="zcInfo.fixAssetCode"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="颜色">
+                <el-input
+                  class="input"
+                  size="small"
+                  v-model="zcInfo.color"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="重量">
+                <el-input
+                  size="small"
+                  class="input"
+                  v-model="zcInfo.weight"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="维护部门">
+                <DeptSelect v-model="zcInfo.repairDeptCode" />
+                <!-- <selectTree
+                ref="tree1"
+                class="input"
+                :options="options.deptList"
+                :initStr="zcInfo.repairDeptName"
+                :props="{
+                  value: 'code',
+                  label: 'name',
+                  children: 'children'
+                }"
+                @getValue="whDeptClick"
+              /> -->
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="维护人">
+                <el-select 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-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="权属部门">
+                <selectTree
+                  ref="tree2"
+                  class="input"
+                  :initStr="zcInfo.ownershipDeptName"
+                  :options="options.deptList"
+                  :props="{
+                    value: 'code',
+                    label: 'name',
+                    children: 'children'
+                  }"
+                  @getValue="qsDeptClick"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="权属人">
+                <el-select
+                  v-model="zcInfo.ownershipUserId"
+                  placeholder="请选择"
+                >
+                  <el-option
+                    v-for="item in options.ownershipUserId"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="设备用途">
+                <el-input
+                  v-model="zcInfo.purpose"
+                  size="small"
+                  class="input"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="所属工序">
+                <!-- <el-select v-model="zcInfo.roteCode" placeholder="请选择">
+                <el-option
+                  v-for="item in options.roteCode"
+                  :key="item.code"
+                  :label="item.name"
+                  :value="item.code"
+                >
+                </el-option>
+              </el-select> -->
+                {{ '成型工序' }}
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="品牌">
+                <el-select v-model="zcInfo.brand" placeholder="请选择">
+                  <el-option
+                    v-for="item in options.brand"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="供应商">
+                <el-select v-model="zcInfo.supplierId" placeholder="请选择">
+                  <el-option
+                    v-for="item in options.supplierId"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="所属厂房">
+                <el-select
+                  v-model="zcInfo.factoryPlantCode"
+                  placeholder="请选择"
+                >
+                  <el-option
+                    v-for="item in options.factoryPlantCode"
+                    :key="item.code"
+                    :label="item.name"
+                    :value="item.code"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="设备位置">
+                <div class="sbwz">
+                  <el-select
+                    class="item"
+                    v-model="zcInfo.factoryCode"
+                    placeholder="请选择工厂"
+                    @change="hanldFactoryCode"
+                  >
+                    <el-option
+                      v-for="item in options.factoryCode"
+                      :key="item.code"
+                      :label="item.name"
+                      :value="item.code"
+                    >
+                    </el-option>
+                  </el-select>
+                  <el-select
+                    class="item"
+                    v-model="zcInfo.workshopCode"
+                    placeholder="请选择车间"
+                    @change="hanldWorkshopCode"
+                  >
+                    <el-option
+                      v-for="item in options.workshopCode"
+                      :key="item.id"
+                      :label="item.name"
+                      :value="item.id"
+                    >
+                    </el-option>
+                  </el-select>
+                  <el-select
+                    class="item"
+                    v-model="zcInfo.lineCode"
+                    placeholder="请选择产线"
+                  >
+                    <el-option
+                      v-for="item in options.lineCode"
+                      :key="item.code"
+                      :label="item.name"
+                      :value="item.code"
+                    >
+                    </el-option>
+                  </el-select>
+                  <el-input
+                    class="item item-input"
+                    size="small"
+                    placeholder="详细地址"
+                    v-model="zcInfo.detailLocation"
+                  ></el-input>
+                </div>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <div class="basic-details-title border-none">
+            <span class="border-span">文档信息</span>
+          </div>
+          <div class="upload-container">
+            <UploadImg @getImgs="cbUploadImg" ref="UploadImg" />
+            <div class="file-list">
+              <div>
+                <el-form-item prop="image" label="使用说明书">
+                  <selectUpload
+                    @getImgs="setImgs('operatingManual', 1, $event)"
+                    :ininObj="attUrl.operatingManual"
+                  />
+                </el-form-item>
+              </div>
+              <div>
+                <el-form-item prop="image" label="生产许可证书">
+                  <selectUpload
+                    @getImgs="setImgs('productionLicence', 2, $event)"
+                    :ininObj="attUrl.productionLicence"
+                  />
+                </el-form-item>
+              </div>
+              <div>
+                <el-form-item prop="image" label="防爆合格证书">
+                  <selectUpload
+                    @getImgs="setImgs('explosionProofCertificate', 3, $event)"
+                    :ininObj="attUrl.explosionProofCertificate"
+                  />
+                </el-form-item>
+              </div>
+              <div>
+                <el-form-item prop="image" label="检验报告">
+                  <selectUpload
+                    @getImgs="setImgs('surveyReport', 4, $event)"
+                    :ininObj="attUrl.surveyReport"
+                  />
+                </el-form-item>
+              </div>
+              <div>
+                <el-form-item prop="image" label="检验周期说明">
+                  <selectUpload
+                    @getImgs="setImgs('inspectionCycleManual', 5, $event)"
+                    :ininObj="attUrl.inspectionCycleManual"
+                  />
+                </el-form-item>
+              </div>
+              <div>
+                <el-form-item prop="image" label="图纸资料">
+                  <selectUpload
+                    @getImgs="setImgs('informationDrawing', 6, $event)"
+                    :ininObj="attUrl.informationDrawing"
+                  />
+                </el-form-item>
+              </div>
+              <div>
+                <el-form-item prop="image" label="产品合格证">
+                  <selectUpload
+                    @getImgs="setImgs('productCertificate', 7, $event)"
+                    :ininObj="attUrl.productCertificate"
+                  />
+                </el-form-item>
+              </div>
+            </div>
+          </div>
+          <div class="basic-details-title border-none">
+            <span class="border-span">物联参数</span>
+          </div>
+          <el-row>
+            <el-col>
+              <el-form-item label="是否启用物联">
+                <el-switch
+                  v-model="isIotEnable"
+                  active-text="开"
+                  inactive-text="关"
+                >
+                </el-switch>
+              </el-form-item>
+            </el-col>
+            <el-col>
+              <el-form-item label="物联ID">{{ iotId }}</el-form-item>
+            </el-col>
+          </el-row>
+          <div class="basic-details-title border-none">
+            <span class="border-span">扩展信息</span>
+          </div>
+          <div class="kzzd">
+            <el-row>
+              <el-col
+                :span="24"
+                v-for="(item, index) in form.addList"
+                :key="index"
+                style="margin-bottom: 20px"
+              >
+                <el-form-item
+                  label-width="0"
+                  :prop="'addList.' + index + '.key'"
+                  :rules="{
+                    required: true,
+                    message: '自定义参数名称不能为空',
+                    trigger: 'blur'
+                  }"
+                >
+                  <div class="add-col">
+                    <el-input
+                      class="col-input"
+                      v-model="item.key"
+                      placeholder="参数名称"
+                    ></el-input>
+                    <el-input
+                      class="col-input"
+                      v-model="item.value"
+                      placeholder="参数值"
+                    ></el-input>
+                    <el-button
+                      class="del"
+                      type="text"
+                      @click="delt(item, index)"
+                    >
+                      删除
+                    </el-button>
+                  </div>
+                </el-form-item>
+              </el-col>
+              <el-col :span="24" v-if="form.addList.length < 10">
+                <el-form-item label-width="0">
+                  <el-button
+                    class="primarybutton"
+                    type="primary"
+                    @click="addItem"
+                    >增加自定义参数</el-button
+                  >
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </div>
+        </div>
+      </el-form>
+      <DialogGoods
+        ref="DialogGoods"
+        @succeed="cbDialogGoods"
+        width="1200px"
+      ></DialogGoods>
+    </el-card>
+  </div>
+</template>
+
+<script>
+  import DeptSelect from '@/components/CommomSelect/dept-select.vue';
+  // import selectUpload from "@/components/selectUpload";
+  // import UploadImg from "@/components/uploadImg/WithView.vue";
+  import DialogGoods from './components/DialogGoods';
+  // import { parseTime } from "@/utils/ruoyi.js";
+  // import org from "@/api/main/org";
+  // import user from "@/api/main/user";
+  // import selectTree from "@/components/selectTree";
+  // import dict from "@/api/main/craft/dict";
+  // import { imageView } from "@/utils";
+  // import {
+  //   getPlants,
+  //   getfactoryInfo,
+  //   getFactorys,
+  //   getProductionLine,
+  //   saveOrEdit,
+  //   getAssetNum,
+  //   getDetail,
+  //   getSupplier
+  // } from '@/api/ledgerAssets/equipment';
+  export default {
+    components: {
+      //selectUpload,
+      //UploadImg,
+      DialogGoods,
+      DeptSelect
+    },
+    data () {
+      return {
+        title: '新建设备信息',
+        pageType: 'add',
+        btnLoading: false,
+        // 设备主键id
+        id: '',
+        form: {
+          addList: [],
+          // 基本信息
+          informationCode: '',
+          informationName: '',
+          productTime: ''
+        },
+        rules: {
+          informationName: [
+            { required: true, message: '请输入设备名称', trigger: 'blur' }
+          ],
+          informationCode: [
+            { required: true, message: '请输入设备编码', trigger: 'blur' }
+          ]
+        },
+        // 基本信息
+        basicInfo: '',
+        // 资产信息
+        zcInfo: {
+          // 	固定资产编码
+          fixAssetCode: '',
+          // 颜色
+          color: '',
+          // 重量
+          weight: '',
+          // 维护部门code
+          repairDeptCode: '',
+          repairDeptName: '',
+          repairUserId: '',
+          // 权属部门
+          ownershipDeptCode: '',
+          ownershipDeptName: '',
+          ownershipUserId: '',
+          // 设备用途
+          purpose: '',
+          //品牌
+          brand: '',
+          // 	供应商code
+          supplierId: '',
+          // 详细地址
+          detailLocation: '',
+          // 请选择产线
+          lineCode: '',
+          // 请选择车间
+          workshopCode: '',
+          // 请选择工厂
+          factoryCode: '',
+          // 厂房
+          factoryPlantCode: '',
+          roteCode: ''
+        },
+        // 图片
+        imageUrl: null,
+        // 文档信息
+        attUrl: {
+          operatingManual: null,
+          productionLicence: null,
+          explosionProofCertificate: null,
+          surveyReport: null,
+          inspectionCycleManual: null,
+          informationDrawing: null,
+          productCertificate: null
+        },
+        // 是否开始物联
+        isIotEnable: true,
+        // 物联ID
+        iotId: '',
+        // 回显过保时间
+        cbexpirationTime: '',
+        // 生命周期
+        sourceDICT: '',
+        // 网络状态
+        networkStatus: '',
+        options: {
+          deptList: [],
+          repairUserId: [],
+          ownershipUserId: [],
+          supplierId: [],
+          factoryCode: [],
+          workshopCode: [],
+          lineCode: [],
+          factoryPlantCode: [],
+          brand: []
+        }
+      };
+    },
+    watch: {
+      'zcInfo.factoryCode': function (nVal) {
+        if (this.pageType == 'add') {
+          this.zcInfo.workshopCode = '';
+          this.options.workshopCode = [];
+        }
+
+        // 获取车间
+        this.getFactorys();
+      },
+      'zcInfo.workshopCode': function (nVal) {
+        if (this.pageType == 'add') {
+          this.zcInfo.lineCode = '';
+          this.options.lineCode = [];
+        }
+        // 获取产线
+        this.getProductionLine();
+      }
+      // "zcInfo.repairDeptCode": function (nVal) {
+      //   this.zcInfo.repairUserId = "";
+      //   this.options.repairUserId = [];
+      // },
+      // "zcInfo.ownershipDeptCode": function (nVal) {
+      //   this.zcInfo.ownershipUserId = "";
+      //   this.options.ownershipUserId = [];
+      // },
+    },
+    computed: {
+      // 过保时间
+      expirationTime () {
+        if (this.form.productTime && this.basicInfo.expirationDate) {
+          return this.setGbTime(
+            this.form.productTime,
+            this.basicInfo.expirationDate,
+            this.basicInfo.expirationDateUnit
+          );
+        } else {
+          return '';
+        }
+      }
+    },
+    created () {
+      // if (this.$route.query.pageType == "add") {
+      //   this.pageType = "add";
+      //   this.title = "新建设备信息";
+      // } else if (this.$route.query.pageType == "edit") {
+      //   this.pageType = "edit";
+      //   this.id = this.$route.query.id;
+      //   this.getInfo();
+      //   this.title = "编辑设备信息";
+      // }
+      // this.getTreeList();
+      // this.getgys();
+      // //this.getGxlist();
+      // this.getPlants();
+      // this.getfactoryInfo();
+    },
+    methods: {
+      setImgs (type, sort, info) {
+        if (info[0]) {
+          this.attUrl[type] = info[0];
+          this.attUrl[type].sort = sort;
+        } else {
+          this.attUrl[type] = null;
+        }
+      },
+      handlwpbm () {
+        this.$refs.DialogGoods.open();
+      },
+      async cbDialogGoods (data) {
+        this.basicInfo = data;
+        this.form.informationName = this.basicInfo.informationName;
+        let res = await getAssetNum({
+          assetCode: this.basicInfo.informationCode,
+          num: 1
+        });
+        this.form.informationCode = res.data[0].onlyCode;
+      },
+      // 计算过保时间
+      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);
+      },
+      // 维护部门点击回调
+      whDeptClick (info) {
+        this.zcInfo.repairDeptCode = info.code;
+        // 重置
+        this.zcInfo.repairUserId = '';
+        this.getwhbm();
+      },
+      async getwhbm () {
+        let res = await user.user({ deptCode: this.zcInfo.repairDeptCode });
+        this.options.repairUserId = res.data;
+      },
+      // 权属部门点击回调
+      qsDeptClick (info) {
+        this.zcInfo.ownershipDeptCode = info.code;
+        // 重置
+        this.zcInfo.ownershipUserId = '';
+        this.getqsbm();
+      },
+      async getqsbm () {
+        let res = await user.user({ deptCode: this.zcInfo.ownershipDeptCode });
+        this.options.ownershipUserId = res.data;
+      },
+      // 树形结构数据
+      getTreeList () {
+        org.tree().then((res) => {
+          this.options.deptList = res.data;
+        });
+      },
+      // 获取供应商、工序列表
+      async getgys () {
+        let muster = await getSupplier({
+          size: 999
+        });
+        console.log(muster);
+        this.options.supplierId = muster.data.items; //供应商
+      },
+      // 获取工序列表
+      async getGxlist () {
+        let data = await dict.list({
+          size: 999
+        });
+        this.options.roteCode = data.data.items;
+      },
+      // 获取厂房列表
+      async getPlants () {
+        let data = await getPlants({
+          size: 999
+        });
+        this.options.factoryPlantCode = data.data.items;
+      },
+      // 获取工厂列表
+      async getfactoryInfo () {
+        let data = await getfactoryInfo({
+          size: 999
+        });
+        this.options.factoryCode = data.data.items;
+      },
+      // 获取车间列表
+      async getFactorys () {
+        let data = await getFactorys({
+          factoryCode: this.zcInfo.factoryCode,
+          size: 999
+        });
+        this.options.workshopCode = data.data.items;
+      },
+      // 获取产线列表
+      async getProductionLine () {
+        let data = await getProductionLine({
+          factory: this.zcInfo.factoryCode,
+          workshopId: this.zcInfo.workshopCode,
+          size: 999
+        });
+        this.options.lineCode = data.data.items;
+      },
+      // 选择图片回调
+      cbUploadImg (data) {
+        if (data.length > 0) {
+          this.imageUrl = data[0];
+        } else {
+          this.imageUrl = '';
+        }
+      },
+      // 添加自定义参数
+      addItem () {
+        if (this.form.addList.length < 10) {
+          let item = { key: '', value: '' };
+          this.form.addList.push(item);
+        } else {
+          this.$message.warning('自定义参数最多添加10条');
+        }
+      },
+      // 删除自定义参数
+      delt (item, index) {
+        this.form.addList.splice(index, 1);
+      },
+      // 提交
+      submit () {
+        if (!this.basicInfo && this.pageType == 'add') {
+          return this.$message.error('请选择物品编码');
+        }
+        this.$refs.form.validate((valid) => {
+          if (valid) {
+            let par = {
+              //基本信息
+              assetCode: this.form.informationCode,
+              assetName: this.form.informationName,
+              assetType: 1,
+              informationId: this.basicInfo.id,
+              productTime: this.form.productTime,
+              expirationTime: this.expirationTime,
+              // 资产信息
+              ...this.zcInfo,
+              // 文档信息
+              attUrl: this.setWd(),
+              // 设备图片
+              imageUrl: this.imageUrl,
+              // 是否启用物联
+              isIotEnable: this.isIotEnable,
+              // 扩展字段
+              extendField: this.setKz()
+            };
+            if (this.pageType == 'edit') {
+              par.id = this.id;
+            }
+            this.btnLoading = true;
+            saveOrEdit(par)
+              .then((res) => {
+                this.$message.success('操作成功');
+                this.$router.go(-1);
+              })
+              .finally(() => {
+                this.btnLoading = false;
+              });
+          } else {
+            console.log('error submit!!');
+            return false;
+          }
+        });
+      },
+      // 处理扩展字段
+      setKz () {
+        return JSON.stringify(this.form.addList);
+      },
+      // 处理文档信息
+      setWd () {
+        let attUrl = [];
+        Object.entries(this.attUrl).forEach(([key, value], index) => {
+          if (value) {
+            attUrl.push(value);
+          } else {
+            attUrl.push({ sort: index + 1 });
+          }
+        });
+        return attUrl;
+      },
+      // 获取设备详情
+      getInfo () {
+        getDetail({
+          id: this.id
+        }).then((res) => {
+          this.$nextTick(() => {
+            let data = res.data;
+            // 基本信息
+            this.form.informationCode = data.assetCode;
+            this.form.informationName = data.assetName;
+            this.form.productTime = data.productTime;
+            this.basicInfo = data.information;
+            this.cbexpirationTime = data.expirationTime;
+            this.sourceDICT = data.sourceDICT;
+            this.networkStatus = data.networkStatus;
+            // 资产信息
+            for (const key of Object.keys(this.zcInfo)) {
+              this.zcInfo[key] = data[key];
+            }
+            this.getwhbm();
+            this.getqsbm();
+            if (data.attUrl && data.attUrl.length > 0) {
+              // 文档信息
+              Object.keys(this.attUrl).forEach((n, index) => {
+                if (data.attUrl[index].accessUrl) {
+                  this.attUrl[n] = data.attUrl[index];
+                }
+              });
+            }
+
+            // 设备图片
+            this.imageUrl = data.imageUrl;
+            if (this.imageUrl) {
+              imageView(this.imageUrl).then((res) => {
+                this.$refs.UploadImg.setImg(res);
+              });
+            }
+            // 物联参数
+            this.isIotEnable = data.isIotEnable;
+            this.iotId = data.iotId;
+            // 扩展字段
+            if (data.extendField) {
+              this.form.addList = JSON.parse(data.extendField);
+            }
+          });
+        });
+      },
+      // 设置标准产能
+      setbzcn (val) {
+        if (!val) {
+          return '';
+        }
+        let item = JSON.parse(val);
+        return item.standardCapacity || '';
+      },
+      hanldFactoryCode () {
+        // 重置
+        this.zcInfo.workshopCode = '';
+        this.zcInfo.lineCode = '';
+        this.options.workshopCode = [];
+        this.options.lineCode = [];
+        // 获取车间
+        this.getFactorys();
+      },
+      hanldWorkshopCode () {
+        // 重置
+        this.options.workshopCode = [];
+        this.options.lineCode = [];
+        // 获取产线
+        this.getProductionLine();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  ::v-deep.equipment-container {
+    // .content {
+    //   padding: 0 20px;
+    // }
+    .label-none {
+      .el-form-item__content {
+        margin-left: 0 !important;
+      }
+    }
+    .upload-container {
+      display: flex;
+      .file-list {
+        margin-left: 50px;
+        flex: 1;
+      }
+    }
+  }
+  .sbwz {
+    .item {
+      width: 120px;
+    }
+    .item + .item {
+      margin-left: 10px;
+    }
+    .item-input {
+      width: 350px;
+    }
+  }
+  .input {
+    width: 202px;
+  }
+  .kzzd {
+    width: 500px;
+    .add-col {
+      display: flex;
+      .col-input {
+        & + .col-input {
+          margin-left: 10px;
+        }
+      }
+      .del {
+        margin-left: 10px;
+      }
+    }
+  }
+</style>

+ 6 - 2
src/views/ledgerAssets/equipment/index.vue

@@ -32,7 +32,7 @@
 <script>
   import AssetTree from '@/components/AssetTree';
   import EquipmentList from './components/equipment-list.vue';
-  import { getBoatList } from '@/api/ledgerAssets/boat.js';
+  import { getBoatList } from '@/api/ledgerAssets';
   export default {
     components: {
       AssetTree,
@@ -63,7 +63,11 @@
 
 <style lang="scss" scoped>
   .sys-organization-list {
-    height: calc(100vh - 264px);
+    position: absolute;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 0;
     box-sizing: border-box;
     border-width: 1px;
     border-style: solid;

+ 6 - 8
src/views/ledgerAssets/material/components/baseInfo.vue

@@ -169,10 +169,8 @@
 // import { getAssetPage, getCount } from '@/api/ledgerAssets/asset'
 // import { batchBarPrint } from '@/api/ledgerAssets/booksList'
 // import QrPrint from '@/components/print/printPDF.vue'
-  import {
-    getCategoryInfo,
-    getPageSingle
-  } from '@/api/ledgerAssets/boat.js';
+  import { getPageSingle } from '@/api/ledgerAssets';
+  import {  getDetails } from '@/api/classifyManage/itemInformation.js';
 export default {
   props: {
      rowId:{
@@ -212,10 +210,10 @@ export default {
   },
   methods: {
     getDetilInfo(){
-      getCategoryInfo(this.rowId).then(res=>{
-         this.information = res.data
-         if(res.data.extendField){
-           this.$set(this.information, 'extendField', JSON.parse(res.data.extendField))
+      getDetails(this.rowId).then(res=>{
+         this.information = res
+         if(res.extendField){
+           this.$set(this.information, 'extendField', JSON.parse(res.extendField))
          }
       })
     },

+ 1 - 1
src/views/ledgerAssets/material/components/material-list.vue

@@ -37,7 +37,7 @@
   import MaterialSearch from './material-search.vue';
   import {
     getBoatList
-  } from '@/api/ledgerAssets/boat.js';
+  } from '@/api/ledgerAssets';
 
   export default {
     components: { MaterialSearch },

+ 1 - 1
src/views/ledgerAssets/material/index.vue

@@ -34,7 +34,7 @@
   import MaterialList from './components/material-list.vue';
   import {
     getBoatList
-  } from '@/api/ledgerAssets/boat.js';
+  } from '@/api/ledgerAssets';
   export default {
     components: {
       AssetTree ,

+ 282 - 0
src/views/ledgerAssets/mould/components/baseInfo.vue

@@ -0,0 +1,282 @@
+<template>
+  <div class="baseinfo-container">
+    <div class="basic-details-title border-none">
+      <span class="border-span">基本信息</span>
+    </div>
+    <el-descriptions title="" :column="4" size="medium" border>
+      <el-descriptions-item>
+        <template slot="label"> 编码 </template>
+        {{ info.code }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 名称 </template>
+        {{ info.name }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 牌号</template>
+        {{ info.category.brandNum }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 型号 </template>
+        {{ info.category.modelType }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 大模体型号 </template>
+        {{info.extraInfo.dieBodyModel}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 芯杆数量 </template>
+       {{info.extraInfo.mandrelNum}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 模孔数量</template>
+        {{info.extraInfo.dieHoleNum}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 收缩系数</template>
+        {{info.extraInfo.shrinkageCoefficient}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 下冲头数量 </template>
+        {{info.extraInfo.lowerPunchNum}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 上冲头数量 </template>
+        {{info.extraInfo.upperPunchNum}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 最大冲压次数</template>
+        {{info.extraInfo.maximumStampingTimes}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label" :span="2"> 分类 </template>
+        {{info.category.categoryLevelPath}}
+      </el-descriptions-item>
+      <el-descriptions-item >
+        <template slot="label"> 采购日期 </template>
+        <!-- {{info.warehouseDetail.procurementTime}} -->
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 过保日期 </template>
+       <!-- {{info.warehouseDetail.expirationTime}} -->
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 计量单位</template>
+        {{info.category.measuringUnit}}
+      </el-descriptions-item>
+    </el-descriptions>
+
+    <div class="basic-details-title border-none">
+      <span class="border-span">投产信息</span>
+    </div>
+    <el-descriptions title="" :column="4" size="medium" border>
+      <el-descriptions-item>
+        <template slot="label"> 固资编码 </template>
+        {{info.fixCode}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 出库时间</template>
+        <!-- {{info.warehouseDetail.createTime}} -->
+      </el-descriptions-item>
+      <el-descriptions-item :span="2">
+        <template slot="label"> 出库单号 </template>
+        <!-- <template slot="label">  {{queryInfo.source==2?'入库单号':'出库单号'}}  </template> -->
+        <!-- <el-link style="color: #70B603" @click="jumpDetails">{{info.warehouseDetail.bizNum}}</el-link> -->
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 所属工序</template>
+        {{info.processName}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 权属部门 </template>
+        {{info.ownershipDeptName}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 品牌 </template>
+        {{info.brand}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 供应商</template>
+        {{info.supplierName}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 供应商电话 </template>
+        {{info.supplierMobile}}
+      </el-descriptions-item>
+
+    </el-descriptions>
+    <div class="basic-details-title border-none">
+      <span class="border-span">文档信息</span>
+    </div>
+<!--    <div class="upload-container">
+      <div class="img-box">
+        <img
+          src="~@/assets/upload-placeholder.svg"
+          alt=""
+          v-if="!imageUrl"
+        />
+        <img v-else :src="imageUrl" alt="设备图片" />
+      </div>
+      <div class="file-list">
+        <div
+          :class="{ disabled: !item.accessUrl }"
+          @click="openfile(item)"
+          v-for="(item, index) in fileList"
+          :key="index"
+          class="file-box"
+        >
+          {{ item.t_name }}
+        </div>
+      </div>
+    </div> -->
+
+    <div class="basic-details-title border-none">
+      <span class="border-span">扩展信息</span>
+    </div>
+    <el-descriptions title="" :column="4" size="medium" border>
+      <el-descriptions-item
+        v-for="(item, index) in info.extInfoSelf"
+        :key="index"
+        :span="1"
+      >
+        <template slot="label"> {{ item.key }} </template>
+        <div>{{item.value}}</div>
+      </el-descriptions-item>
+    </el-descriptions>
+
+<!--    <DetailsDialog
+      ref="detailsDialogRef"
+    /> -->
+  </div>
+</template>
+
+<script>
+// import {getAssetInfo} from "@/api/ledgerAssets/asset"
+// import DetailsDialog from '@/views/ledgerAssets/components/outstoreDetailsDialog.vue'
+// import { imageView , fileSystemDownload} from "@/utils";
+  import { getAssetInfo } from '@/api/ledgerAssets';
+  import { getDetails } from '@/api/classifyManage/itemInformation';
+export default {
+  props: {
+    rowId:{
+      type:String ,
+      default:''
+    },
+  },
+  // components: { DetailsDialog },
+  data () {
+    return {
+      fileList: [
+        { t_name: '使用说明书' },
+        { t_name: '生产许可证书' },
+        { t_name: '防爆合格证书' },
+        { t_name: '检验报告' },
+        { t_name: '检验周期说明' },
+        { t_name: '图纸资料' },
+        { t_name: '产品合格证' }
+      ],
+      info:{
+        category:{},
+        extInfoSelf:[],
+        extraInfo:{}
+      },
+      // 设备图片
+      imageUrl: "",
+    }
+  },
+  created () {
+     this.getDetilInfo()
+  },
+  methods:{
+     async getDetilInfo(){
+       const res = await getAssetInfo(this.rowId)
+       if (res){
+          this.info = res.data
+          this.$set(this.info, 'extraInfo', JSON.parse(res.data.category.extendField))
+          this.$set(this.info, 'category', res.data.category)
+          this.$set(this.info, 'extInfoSelf', res.data.extInfoSelf?res.data.extInfoSelf:[])
+          // // 设备图片
+          // if (res.data.imageUrl) {
+          //   imageView(res.data.imageUrl).then((res) => {
+          //     this.imageUrl = res;
+          //   });
+          // }
+          // // 文档信息
+          // if(res.data.attUrl){
+          //   this.fileList.forEach((item, index) => {
+          //     res.data.attUrl[index].t_name = item.t_name;
+          //     this.fileList[index] = res.data.attUrl[index];
+          //   })
+          // }
+       }
+     },
+
+     // 打开详情弹窗
+     jumpDetails(){
+       if(!this.info.warehouseDetail){
+         return
+       }
+        this.$refs.detailsDialogRef.init(this.info.warehouseDetail,this.queryInfo.source)
+     },
+
+     openfile(row) {
+       if (row.accessUrl) {
+         fileSystemDownload(row)
+       }
+     }
+
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.baseinfo-container {
+  background-color: #fff;
+  padding: 20px;
+  .content {
+    padding: 0 20px;
+  }
+  .basic-details-title{
+    font-size: 16px;
+    margin: 15px 0;
+  }
+  .upload-container {
+    display: flex;
+    .img-box {
+      width: 280px;
+      height: 342px;
+      border: 1px solid rgba(215, 215, 215, 1);
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      img {
+        max-width: 100%;
+      }
+    }
+    .file-list {
+      margin-left: 50px;
+      flex: 1;
+      display: flex;
+      justify-content: space-between;
+      flex-wrap: wrap;
+      justify-items: baseline;
+      align-content: flex-start;
+      .file-box {
+        width: 30%;
+        margin-bottom: 20px;
+        height: 57px;
+        text-align: center;
+        line-height: 55px;
+        border: 1px solid var(--mainColor);
+        color: var(--mainColor);
+        cursor: pointer;
+        &.disabled {
+          cursor: not-allowed;
+          border-color: rgba(215, 215, 215, 1);
+          color: rgba(215, 215, 215, 1);
+        }
+      }
+    }
+  }
+}
+</style>

+ 216 - 0
src/views/ledgerAssets/mould/components/mould-list.vue

@@ -0,0 +1,216 @@
+<template>
+  <div>
+    <mould-search @search="reload">
+    </mould-search>
+    <!-- 数据表格 -->
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="datasource"
+      height="calc(100vh - 265px)"
+      full-height="calc(100vh - 116px)"
+      tool-class="ele-toolbar-form"
+      cache-key="systemOrgUserTable"
+    >
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar>
+          <el-checkbox v-model="checked">显示已消耗</el-checkbox>
+          <el-button
+           size="small"
+           type="primary"
+           icon="el-icon-download"
+           class="ele-btn-icon"
+         >
+           导出
+         </el-button>
+      </template>
+
+      <!-- 编码列 -->
+      <template v-slot:code="{ row }">
+        <el-link @click="details(row)">
+          {{ row.code }}
+        </el-link>
+      </template>
+      <!-- 牌号列 -->
+      <template v-slot:brandNum="{ row }">
+        <div>
+          {{ row.category.brandNum }}
+        </div>
+      </template>
+      <!-- 型号列 -->
+      <template v-slot:modelType="{ row }">
+        <div>
+          {{ row.category.modelType }}
+        </div>
+      </template>
+      <!-- 分类列 -->
+      <template v-slot:categoryLevelPath="{ row }">
+        <div>
+          {{ row.category.categoryLevelPath }}
+        </div>
+      </template>
+      <!-- 操作列 -->
+      <template v-slot:action="{ row }">
+        <el-link
+          type="primary"
+          :underline="false"
+          icon="el-icon-edit"
+          @click="goEdit(row)"
+        >
+          编辑
+        </el-link>
+      </template>
+    </ele-pro-table>
+  </div>
+</template>
+
+<script>
+  import MouldSearch from './mould-search.vue';
+  import {
+    getAssetList
+  } from '@/api/ledgerAssets';
+
+  export default {
+    components: { MouldSearch },
+    props: {
+      // 类别id
+      categoryId: [Number, String],
+      rootId: [Number, String],
+    },
+    data() {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'selection',
+            type: 'selection',
+            width: 45,
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            columnKey: 'index',
+            type: 'index',
+            label: '序号',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '编码',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            slot: 'code',
+            fixed: 'left'
+          },
+          {
+            prop: 'name',
+            label: '名称',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'fixCode',
+            label: '固资编码',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'brandNum',
+            label: '牌号',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            slot:'brandNum'
+          },
+          {
+            prop: 'modelType',
+            label: '型号',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            slot:'modelType'
+          },
+          {
+            prop: 'categoryLevelPath',
+            label: '分类',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            slot: 'categoryLevelPath'
+          },
+          {
+            prop: 'ownershipGroupName',
+            label: '所在部门',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'totalSum',
+            label: '生命周期',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 100,
+            align: 'left',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true,
+            fixed: 'right'
+          }
+        ],
+        checked:false
+      };
+    },
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getAssetList({
+          ...where,
+          ...order,
+          pageNum: page,
+          size: limit,
+          categoryId: this.categoryId,
+          rootCategoryLevelId: this.rootId
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ pageNum: 1, where: where });
+      },
+
+      // 跳转到详情页
+      details ({ id }) {
+        this.$router.push({
+          path: '/ledgerAssets/mould/detail',
+          query: {
+            id
+          }
+        })
+      },
+      // 跳转到编辑页
+      goEdit ({ id }) {
+        this.$router.push({
+          path: '/ledgerAssets/mould/edit',
+          query: {
+            id
+          }
+        })
+      }
+
+    },
+    watch: {
+      // 监听类别id变化
+      categoryId() {
+        this.reload();
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped>
+   .ele-btn-icon{
+     margin-left: 20px;
+   }
+</style>

+ 123 - 0
src/views/ledgerAssets/mould/components/mould-search.vue

@@ -0,0 +1,123 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="77px"
+    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="编码:" label-width="50px">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+        <el-form-item label="型号:" label-width="50px">
+          <el-input clearable v-model="where.module" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="名称:" label-width="50px">
+          <el-input clearable v-model="where.name" placeholder="请输入" />
+        </el-form-item>
+        <el-form-item label="所在部门:">
+           <ele-tree-select
+              clearable
+              :data="treeData"
+              v-model="where.ownershipGroupId"
+              placeholder="请选择"
+              default-expand-all
+              labelKey="name"
+              valueKey="id"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="固定资产编码:" label-width="100px">
+          <el-input clearable v-model="where.fixCode" placeholder="请输入" />
+        </el-form-item>
+        <div class="ele-form-actions">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+            size="small"
+          >
+            查询
+          </el-button>
+           <el-button @click="reset"
+             icon="el-icon-refresh-left"
+             size="small"
+             type="primary"
+           >重置</el-button>
+        </div>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+         <el-form-item label="牌号:" label-width="50px">
+           <el-input clearable v-model="where.brandNum" placeholder="请输入" />
+         </el-form-item>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  import { login } from '@/api/login';
+  import {
+    listOrganizations
+  } from '@/api/system/organization';
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        name: '',
+        code: '',
+        fixCode:'',
+        module:'',
+        brandNum:'',
+        ownershipGroupId:''
+      };
+      return {
+        // 表单数据
+        where: { ...defaultWhere },
+        treeData:[]
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    created(){
+       this.query()
+    },
+    methods: {
+      /* 搜索 */
+      search() {
+        console.log(this.where);
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      },
+
+      query() {
+        listOrganizations()
+          .then((list) => {
+            this.treeData = this.$util.toTreeData({
+              data: list,
+              idField: 'id',
+              parentIdField: 'parentId'
+            });
+          })
+          .catch((e) => {
+          });
+      },
+
+
+    }
+  };
+</script>

+ 59 - 0
src/views/ledgerAssets/mould/detail.vue

@@ -0,0 +1,59 @@
+<template>
+  <div>
+    <!-- tab切换 -->
+<!--    <div class="switch">
+      <div class="switch_left">
+        <ul>
+          <li
+            v-for="item in tabOptions"
+            :key="item.key"
+            :class="{ active: activeComp == item.key }"
+            @click="activeComp = item.key"
+          >
+            {{ item.name }}
+          </li>
+        </ul>
+        <el-button size="small" @click="$router.go(-1)">返回</el-button>
+      </div>
+    </div> -->
+    <div class="content-wrapper">
+      <component :is="activeComp" :rowId="rowId"></component>
+    </div>
+  </div>
+</template>
+
+<script>
+import baseInfo from './components/baseInfo.vue'
+export default {
+  components: {
+    baseInfo,
+  },
+  data () {
+    return {
+      activeComp: 'baseInfo',
+      tabOptions: [
+        { key: 'baseInfo', name: '基本信息' }
+      ],
+      rowId:null
+    }
+  },
+
+  created () {
+     this.rowId = this.$route.query.id
+  },
+
+}
+</script>
+
+<style lang="scss" scoped>
+.content-wrapper {
+  background-color: #fff;
+}
+.switch_left{
+  width:100%;
+  display:flex;
+  align-items:center;
+  justify-content: space-between;
+  padding-right:20px;
+}
+</style>

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

@@ -0,0 +1,441 @@
+<template>
+  <div class="page-container equipment-container">
+    <div class="page-title basic-details-title">
+      <el-page-header @back="$router.go(-1)">
+        <div slot="content" class="pageContent">
+          <div>编辑模具信息</div>
+        </div>
+      </el-page-header>
+      <div>
+        <el-button size="small" @click="$router.go(-1)">取消</el-button>
+        <el-button
+          size="small"
+          type="primary"
+           @click="toSave"
+          v-loading="btnLoading"
+          >确定</el-button
+        >
+      </div>
+    </div>
+    <div class="content">
+      <el-form label-width="100px">
+        <div class="basic-details-title border-none">
+          <span class="border-span">基本信息</span>
+        </div>
+        <el-descriptions title="" :column="4" size="medium" border>
+          <el-descriptions-item>
+            <template slot="label"> 模具编码 </template>
+            {{info.code}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 模具名称 </template>
+            {{info.name}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 牌号 </template>
+            {{info.category.brandNum}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 型号 </template>
+            {{info.category.modelType}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 大模体型号 </template>
+            {{info.extraInfo.dieBodyModel}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 芯杆数量 </template>
+            {{info.extraInfo.mandrelNum}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 模孔数量 </template>
+            {{info.extraInfo.dieHoleNum}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 收缩系数 </template>
+            {{info.extraInfo.shrinkageCoefficient}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 下冲头数量 </template>
+            {{info.extraInfo.lowerPunchNum}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 上冲头数量 </template>
+            {{info.extraInfo.upperPunchNum}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 最大冲压次数 </template>
+            {{info.extraInfo.maximumStampingTimes}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 计量单位 </template>
+            {{info.category.measuringUnit}}
+          </el-descriptions-item>
+          <el-descriptions-item :span="2">
+            <template slot="label"> 分类 </template>
+            {{info.category.categoryLevelPath}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 采购日期 </template>
+            <!-- {{info.category.procurementTime}} -->
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 过保日期 </template>
+            <!-- {{info.category.expirationTime}} -->
+          </el-descriptions-item>
+        </el-descriptions>
+
+        <div class="basic-details-title border-none">
+          <span class="border-span">资产信息</span>
+        </div>
+        <el-row>
+          <el-col :md="8" :xs="8" :sm="8">
+            <el-form-item label="固资编码">
+              <el-input size="small" v-model="info.fixCode"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :md="8" :xs="8" :sm="8">
+            <el-form-item label="权属部门" prop="ownershipGroupId" class="qsbm">
+               <ele-tree-select
+                   clearable
+                   :data="treeData"
+                   v-model="info.ownershipGroupId"
+                   placeholder="请选择"
+                   default-expand-all
+                   labelKey="name"
+                   valueKey="id"
+               />
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+
+        <div class="basic-details-title border-none">
+          <span class="border-span">文档信息</span>
+        </div>
+<!--        <div class="upload-container">
+          <UploadImg @getImgs="cbUploadImg" ref="UploadImg" :assetName="`模具`"/>
+          <div class="file-list">
+            <div>
+              <el-form-item prop="image" label="使用说明书">
+                <selectUpload
+                  @getImgs="setImgs('operatingManual', 1, $event)"
+                  :ininObj="attUrl.operatingManual"
+                />
+              </el-form-item>
+            </div>
+            <div>
+              <el-form-item prop="image" label="生产许可证书">
+                <selectUpload
+                  @getImgs="setImgs('productionLicence', 2, $event)"
+                  :ininObj="attUrl.productionLicence"
+                />
+              </el-form-item>
+            </div>
+            <div>
+              <el-form-item prop="image" label="防爆合格证书">
+                <selectUpload
+                  @getImgs="setImgs('explosionProofCertificate', 3, $event)"
+                  :ininObj="attUrl.explosionProofCertificate"
+                />
+              </el-form-item>
+            </div>
+            <div>
+              <el-form-item prop="image" label="检验报告">
+                <selectUpload
+                  @getImgs="setImgs('surveyReport', 4, $event)"
+                  :ininObj="attUrl.surveyReport"
+                />
+              </el-form-item>
+            </div>
+            <div>
+              <el-form-item prop="image" label="检验周期说明">
+                <selectUpload
+                  @getImgs="setImgs('inspectionCycleManual', 5, $event)"
+                  :ininObj="attUrl.inspectionCycleManual"
+                />
+              </el-form-item>
+            </div>
+            <div>
+              <el-form-item prop="image" label="图纸资料">
+                <selectUpload
+                  @getImgs="setImgs('informationDrawing', 6, $event)"
+                  :ininObj="attUrl.informationDrawing"
+                />
+              </el-form-item>
+            </div>
+            <div>
+              <el-form-item prop="image" label="产品合格证">
+                <selectUpload
+                  @getImgs="setImgs('productCertificate', 7, $event)"
+                  :ininObj="attUrl.productCertificate"
+                />
+              </el-form-item>
+            </div>
+          </div>
+        </div> -->
+      </el-form>
+        <div class="basic-details-title border-none">
+          <span class="border-span">扩展信息</span>
+        </div>
+        <el-row>
+           <el-form :model="itemForm" :rules="customRule" ref="formCustom" class="row-form">
+                <el-col :span="8" v-for="(item,index) in itemForm.addList" :key="index">
+                     <el-form-item
+                        :prop="'addList.' + index + '.key'"
+                        :rules="{
+                           required: true, message: '自定义参数名称不能为空', trigger: 'blur'
+                       }"
+                     >
+                       <div  class="add-col">
+                           <el-input class="col-input" v-model="item.key" placeholder="参数名称"></el-input>
+                           <el-input class="col-input" v-model="item.value" placeholder="参数值"></el-input>
+                           <el-button type="text" @click="delt(item,index)"> 删除 </el-button>
+                       </div>
+                     </el-form-item>
+                </el-col>
+                <el-col :span="8" v-if="itemForm.addList.length<10">
+                    <el-form-item label-width="20px">
+                         <el-button type="primary" @click="addItem">增加自定义参数</el-button>
+                    </el-form-item>
+                </el-col>
+           </el-form>
+        </el-row>
+      </div>
+  </div>
+</template>
+
+<script>
+  import { getAssetInfo , saveOrEdit } from '@/api/ledgerAssets';
+  import { listOrganizations } from '@/api/system/organization';
+export default {
+  data () {
+    return {
+      formData: {},
+      info:{
+        category:{},
+        extraInfo:{}
+      },
+      customRule:{},
+      itemForm:{
+        addList:[]
+      },
+      // 图片
+      imageUrl: null,
+      // 文档信息
+      attUrl: {
+        operatingManual: null,
+        productionLicence: null,
+        explosionProofCertificate: null,
+        surveyReport: null,
+        inspectionCycleManual: null,
+        informationDrawing: null,
+        productCertificate: null,
+      },
+      treeData:[],
+      btnLoading:false
+    }
+  },
+  created(){
+    let id = this.$route.query.id;
+    this.getDetilInfo(id);
+    this.query();
+  },
+  methods: {
+    // 树形结构数据
+    query() {
+      listOrganizations()
+        .then((list) => {
+          this.treeData = this.$util.toTreeData({
+            data: list,
+            idField: 'id',
+            parentIdField: 'parentId'
+          });
+        })
+        .catch((e) => {
+        });
+    },
+
+    setImgs(type, sort, info) {
+      if (info[0]) {
+        this.attUrl[type] = info[0];
+        this.attUrl[type].sort = sort;
+      } else {
+        this.attUrl[type] = null;
+      }
+    },
+    // 处理文档信息
+    setWd() {
+      let attUrl = [];
+      Object.entries(this.attUrl).forEach(([key, value], index) => {
+        if (value) {
+          attUrl.push(value);
+        } else {
+          attUrl.push({ sort: index + 1 });
+        }
+      });
+      return attUrl;
+    },
+    async getDetilInfo(id){
+      const res = await getAssetInfo(id)
+      if (res){
+         this.info = res.data
+         this.$set(this.info, 'category', res.data.category)
+         this.$set(this.info, 'extraInfo', JSON.parse(res.data.category.extendField))
+         // this.$set(this.info, 'imgUrl', res.data.imageUrl)
+         this.itemForm.addList =  this.info.extInfoSelf
+          ?  this.info.extInfoSelf
+          : [];
+         // 设备图片
+         // this.imageUrl = res.data.imageUrl;
+         // if (this.imageUrl) {
+         //   imageView(this.imageUrl).then((res) => {
+         //     this.$refs.UploadImg.setImg(res);
+         //   });
+         // }
+         // // 文档信息
+         // Object.keys(this.attUrl).forEach((n, index) => {
+         //   if (res.data.attUrl&&res.data.attUrl[index].accessUrl) {
+         //     this.attUrl[n] = res.data.attUrl[index];
+         //   }
+         // });
+      }
+    },
+
+    // 选择图片回调
+    cbUploadImg(data) {
+      if (data.length > 0) {
+        this.imageUrl = data[0];
+      } else {
+        this.imageUrl = "";
+      }
+    },
+
+    // 删除自定义参数
+    delt(item,index){
+        this.itemForm.addList.splice(index,1)
+    },
+    // 添加自定义参数
+    addItem(){
+      if(this.itemForm.addList.length<10){
+        let item = {key:'',value:''}
+         this.itemForm.addList.push(item)
+      }else{
+        this.$message.warning('自定义参数最多添加10条')
+      }
+    },
+
+      // 点击确定保存
+      toSave () {
+        let extendField = this.itemForm.addList;
+        let params = {
+          id: this.info.id,
+          code: this.info.code,
+          fixCode: this.info.fixCode,
+          // imageUrl: this.imageUrl,
+          extInfoSelf: extendField,
+          ownershipGroupId: this.info.ownershipGroupId,
+          rootCategoryLevelId:this.info.rootCategoryLevelId,
+          categoryId:this.info.categoryId,
+          positionIds: JSON.parse(this.info.category.categoryLevelPathId).join(',')
+        };
+        this.btnLoading = true;
+        this.$refs['formCustom'].validate((valid) => {
+          if (valid) {
+            saveOrEdit(params).then((res) => {
+              if (res) {
+                this.$message.success('模具编辑成功');
+                this.$router.go(-1);
+              }
+            })
+            .finally(() => {
+              this.btnLoading = false;
+            });
+          } else {
+            return false;
+          }
+        });
+      },
+
+    //使用说明书
+    operatingManual (info) {
+      if (info.length > 0) {
+        console.log(info, '------info-----')
+        this.formData.operatingManual = info[0]
+        console.log(this.formData.operatingManual, 'getImgs')
+      } else {
+        this.formData.operatingManual = null
+        console.log(this.formData.operatingManual, 'getImgs')
+      }
+    },
+    productionLicence (info) {
+      this.formData.productionLicence = info[0]
+    },
+    explosionProofCertificate (info) {
+      this.formData.explosionProofCertificate = info[0]
+    },
+    surveyReport (info) {
+      this.formData.surveyReport = info[0]
+    },
+    inspectionCycleManual (info) {
+      this.formData.inspectionCycleManual = info[0]
+    },
+    informationDrawing (info) {
+      this.formData.informationDrawing = info[0]
+    },
+    productCertificate (info) {
+      this.formData.productCertificate = info[0]
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.equipment-container {
+  background-color: #fff;
+  padding: 20px;
+  .content {
+    padding: 0 20px;
+  }
+  .page-title{
+    width:100%;
+    padding-bottom: 10px;
+    border-bottom:1px solid #ccc;
+  }
+  .basic-details-title {
+    width: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    margin: 15px 0px;
+    font-size: 16px;
+  }
+  .label-none {
+    .el-form-item__content {
+      margin-left: 0 !important;
+    }
+  }
+  .upload-container {
+    display: flex;
+    .file-list {
+      margin-left: 50px;
+      flex: 1;
+    }
+  }
+
+  .row-form{
+    width:100%;
+    .add-col{
+      display:flex;
+      align-items:center;
+      margin-left: 20px;
+      .col-input{
+        margin-right:5px;
+      }
+    }
+  }
+  .qsbm .el-select{
+    width:100%
+  }
+}
+</style>

+ 80 - 0
src/views/ledgerAssets/mould/index.vue

@@ -0,0 +1,80 @@
+<template>
+  <div class="ele-body">
+     <el-card shadow="never" v-loading="loading">
+       <ele-split-layout
+         width="266px"
+         allow-collapse
+         :right-style="{ overflow: 'hidden' }"
+       >
+         <div>
+           <div class="ele-border-lighter sys-organization-list">
+             <AssetTree
+               @handleNodeClick="handleNodeClick"
+               @setRootId="setRootId"
+               :type="'6'"
+               :paramsType="'type'"
+               ref="treeList"
+             />
+           </div>
+         </div>
+         <template v-slot:content>
+           <mould-list
+             v-if="current"
+             :category-id="current.id"
+             :root-id="rootId"
+           />
+         </template>
+       </ele-split-layout>
+     </el-card>
+  </div>
+</template>
+
+<script>
+  import AssetTree from '@/components/AssetTree';
+  import MouldList from './components/mould-list.vue';
+
+  export default {
+    components: {
+      AssetTree ,
+      MouldList
+    },
+    data () {
+      return {
+        // 加载状态
+        loading: false,
+        // 表格选中数据
+        selection: [],
+        current:null,
+        rootId:null
+      };
+    },
+    computed: {
+
+    },
+    methods: {
+      handleNodeClick (info) {
+        this.current = info
+      },
+      // 获取根节点id
+      setRootId(id){
+        this.rootId = id
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .sys-organization-list {
+    height: calc(100vh - 264px);
+    box-sizing: border-box;
+    border-width: 1px;
+    border-style: solid;
+    overflow: auto;
+  }
+  .sys-organization-list :deep(.el-tree-node__content) {
+    height: 40px;
+    & > .el-tree-node__expand-icon {
+      margin-left: 10px;
+    }
+  }
+</style>

+ 232 - 0
src/views/ledgerAssets/sparepart/components/baseInfo.vue

@@ -0,0 +1,232 @@
+<template>
+  <div class="baseinfo-container">
+    <div class="basic-details-title border-none">
+      <span class="border-span">基本信息</span>
+    </div>
+    <el-descriptions title="" :column="4" size="medium" border>
+      <el-descriptions-item>
+        <template slot="label"> 编码 </template>
+        {{ info.code }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 名称 </template>
+        {{ info.name }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 型号 </template>
+        {{ info.category.modelType }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 规格 </template>
+        {{info.category.specification}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label" :span="2"> 分类 </template>
+        {{info.category.categoryLevelPath}}
+      </el-descriptions-item>
+      <el-descriptions-item >
+        <template slot="label"> 采购日期 </template>
+        <!-- {{info.warehouseDetail.procurementTime}} -->
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 过保日期 </template>
+       <!-- {{info.warehouseDetail.expirationTime}} -->
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 计量单位</template>
+        {{info.category.measuringUnit}}
+      </el-descriptions-item>
+      <el-descriptions-item v-if="!info.category.unpack">
+        <template slot="label"> 最小包装单位</template>
+        {{info.category.measuringUnit}}{{info.category.unit}}/{{info.category.packingUnit}}
+      </el-descriptions-item>
+    </el-descriptions>
+
+    <div class="basic-details-title border-none">
+      <span class="border-span">投产信息</span>
+    </div>
+    <el-descriptions title="" :column="4" size="medium" border>
+      <el-descriptions-item>
+        <template slot="label"> 固资编码 </template>
+        {{info.fixCode}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 权属部门 </template>
+        {{info.ownershipDeptName}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 品牌</template>
+        {{info.brand}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 供应商</template>
+        {{info.supplierName}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 供应商电话 </template>
+        {{info.supplierMobile}}
+      </el-descriptions-item>
+    </el-descriptions>
+
+    <div class="basic-details-title border-none">
+      <span class="border-span">文档信息</span>
+    </div>
+<!--    <div class="upload-container">
+      <div class="img-box">
+        <img
+          src="~@/assets/upload-placeholder.svg"
+          alt=""
+          v-if="!imageUrl"
+        />
+        <img v-else :src="imageUrl" alt="设备图片" />
+      </div>
+      <div class="file-list">
+        <div
+          :class="{ disabled: !item.accessUrl }"
+          @click="openfile(item)"
+          v-for="(item, index) in fileList"
+          :key="index"
+          class="file-box"
+        >
+          {{ item.t_name }}
+        </div>
+      </div>
+    </div> -->
+
+    <div class="basic-details-title border-none">
+      <span class="border-span">扩展信息</span>
+    </div>
+    <el-descriptions title="" :column="4" size="medium" border>
+      <el-descriptions-item
+        v-for="(item, index) in info.extInfoSelf"
+        :key="index"
+        :span="1"
+      >
+        <template slot="label"> {{ item.key }} </template>
+        <div>{{item.value}}</div>
+      </el-descriptions-item>
+    </el-descriptions>
+  </div>
+</template>
+
+<script>
+  import { getAssetInfo } from '@/api/ledgerAssets';
+  import { getDetails } from '@/api/classifyManage/itemInformation';
+export default {
+  props: {
+    rowId:{
+      type:String ,
+      default:''
+    },
+  },
+  data () {
+    return {
+      fileList: [
+        { t_name: '使用说明书' },
+        { t_name: '生产许可证书' },
+        { t_name: '防爆合格证书' },
+        { t_name: '检验报告' },
+        { t_name: '检验周期说明' },
+        { t_name: '图纸资料' },
+        { t_name: '产品合格证' }
+      ],
+      info:{
+        category:{},
+        extInfoSelf:[],
+      },
+      // 设备图片
+      imageUrl: "",
+    }
+  },
+
+  created () {
+     this.getDetilInfo()
+  },
+  methods:{
+     async getDetilInfo(){
+       const res = await getAssetInfo(this.rowId)
+       if (res){
+          this.info = res.data
+          this.$set(this.info, 'category', res.data.category)
+          this.$set(this.info, 'extInfoSelf', res.data.extInfoSelf?res.data.extInfoSelf:[]) 
+          // 设备图片
+          // if (res.data.imageUrl) {
+          //   imageView(res.data.imageUrl).then((res) => {
+          //     this.imageUrl = res;
+          //   })
+          // }
+          // // 文档信息
+          // if(res.data.attUrl){
+          //    this.fileList.forEach((item, index) => {
+          //      res.data.attUrl[index].t_name = item.t_name;
+          //      this.fileList[index] = res.data.attUrl[index];
+          //    })
+          // }
+       }
+     },
+
+     openfile(row) {
+       if (row.accessUrl) {
+         fileSystemDownload(row)
+       }
+     }
+
+
+
+
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+::v-deep.baseinfo-container {
+  background-color: #fff;
+  padding: 20px;
+  .content {
+    padding: 0 20px;
+  }
+  .basic-details-title{
+    font-size: 16px;
+    margin: 15px 0;
+  }
+  .upload-container {
+    display: flex;
+    .img-box {
+      width: 280px;
+      height: 342px;
+      border: 1px solid rgba(215, 215, 215, 1);
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      img {
+        max-width: 100%;
+      }
+    }
+    .file-list {
+      margin-left: 50px;
+      flex: 1;
+      display: flex;
+      justify-content: space-between;
+      flex-wrap: wrap;
+      justify-items: baseline;
+      align-content: flex-start;
+      .file-box {
+        width: 30%;
+        margin-bottom: 20px;
+        height: 57px;
+        text-align: center;
+        line-height: 55px;
+        border: 1px solid var(--mainColor);
+        color: var(--mainColor);
+        cursor: pointer;
+
+        &.disabled {
+          cursor: not-allowed;
+          border-color: rgba(215, 215, 215, 1);
+          color: rgba(215, 215, 215, 1);
+        }
+      }
+    }
+  }
+}
+</style>

+ 216 - 0
src/views/ledgerAssets/sparepart/components/sparepart-list.vue

@@ -0,0 +1,216 @@
+<template>
+  <div>
+    <sparepart-search @search="reload">
+    </sparepart-search>
+    <!-- 数据表格 -->
+    <ele-pro-table
+      ref="table"
+      :columns="columns"
+      :datasource="datasource"
+      height="calc(100vh - 265px)"
+      full-height="calc(100vh - 116px)"
+      tool-class="ele-toolbar-form"
+      cache-key="systemOrgUserTable"
+    >
+      <!-- 表头工具栏 -->
+      <template v-slot:toolbar>
+          <el-checkbox v-model="checked">显示已消耗</el-checkbox>
+          <el-button
+           size="small"
+           type="primary"
+           icon="el-icon-download"
+           class="ele-btn-icon"
+         >
+           导出
+         </el-button>
+      </template>
+
+      <!-- 编码列 -->
+      <template v-slot:code="{ row }">
+        <el-link @click="details(row)">
+          {{ row.code }}
+        </el-link>
+      </template>
+      <!-- 规格列 -->
+      <template v-slot:specification="{ row }">
+        <div>
+          {{ row.category.specification }}
+        </div>
+      </template>
+      <!-- 型号列 -->
+      <template v-slot:modelType="{ row }">
+        <div>
+          {{ row.category.modelType }}
+        </div>
+      </template>
+      <!-- 分类列 -->
+      <template v-slot:categoryLevelPath="{ row }">
+        <div>
+          {{ row.category.categoryLevelPath }}
+        </div>
+      </template>
+      <!-- 操作列 -->
+      <template v-slot:action="{ row }">
+        <el-link
+          type="primary"
+          :underline="false"
+          icon="el-icon-edit"
+          @click="goEdit(row)"
+        >
+          编辑
+        </el-link>
+      </template>
+    </ele-pro-table>
+  </div>
+</template>
+
+<script>
+  import SparepartSearch from './sparepart-search.vue';
+  import {
+    getAssetList
+  } from '@/api/ledgerAssets';
+
+  export default {
+    components: { SparepartSearch },
+    props: {
+      // 类别id
+      categoryId: [Number, String],
+      rootId: [Number, String],
+    },
+    data() {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'selection',
+            type: 'selection',
+            width: 45,
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            columnKey: 'index',
+            type: 'index',
+            label: '序号',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '编码',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            slot: 'code',
+            fixed: 'left'
+          },
+          {
+            prop: 'name',
+            label: '名称',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'fixCode',
+            label: '固资编码',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            slot:'specification'
+          },
+          {
+            prop: 'modelType',
+            label: '型号',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            slot:'modelType'
+          },
+          {
+            prop: 'categoryLevelPath',
+            label: '分类',
+            showOverflowTooltip: true,
+            minWidth: 110,
+            slot: 'categoryLevelPath'
+          },
+          {
+            prop: 'ownershipGroupName',
+            label: '所在部门',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'totalSum',
+            label: '生命周期',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 100,
+            align: 'left',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true,
+            fixed: 'right'
+          }
+        ],
+        checked:false
+      };
+    },
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getAssetList({
+          ...where,
+          ...order,
+          pageNum: page,
+          size: limit,
+          categoryId: this.categoryId,
+          rootCategoryLevelId: this.rootId
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ pageNum: 1, where: where });
+      },
+
+      // 跳转到详情页
+      details ({ id }) {
+        this.$router.push({
+          path: '/ledgerAssets/sparepart/detail',
+          query: {
+            id
+          }
+        })
+      },
+      // 跳转到编辑页
+      goEdit ({ id }) {
+        this.$router.push({
+          path: '/ledgerAssets/sparepart/edit',
+          query: {
+            id
+          }
+        })
+      }
+
+    },
+    watch: {
+      // 监听类别id变化
+      categoryId() {
+        this.reload();
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped>
+   .ele-btn-icon{
+     margin-left: 20px;
+   }
+</style>

+ 127 - 0
src/views/ledgerAssets/sparepart/components/sparepart-search.vue

@@ -0,0 +1,127 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="77px"
+    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="编码:" label-width="50px">
+          <el-input clearable v-model="where.code" placeholder="请输入" />
+        </el-form-item>
+        <el-form-item label="型号:" label-width="50px">
+          <el-input clearable v-model="where.module" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="名称:" label-width="50px">
+          <el-input clearable v-model="where.name" placeholder="请输入" />
+        </el-form-item>
+        <el-form-item label="所在部门:">
+           <ele-tree-select
+              clearable
+              :data="treeData"
+              v-model="where.ownershipGroupId"
+              placeholder="请选择"
+              default-expand-all
+              labelKey="name"
+              valueKey="id"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="固定资产编码:" label-width="100px">
+          <el-input clearable v-model="where.fixCode" placeholder="请输入" />
+        </el-form-item>
+        <el-form-item label="生命周期:" label-width="75px">
+          <DictSelection dictName="生命周期" clearable v-model="where.source">
+          </DictSelection>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+         <el-form-item label="材质:" label-width="50px">
+           <el-input clearable v-model="where.texture" placeholder="请输入" />
+         </el-form-item>
+        <div class="ele-form-actions">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+            size="small"
+          >
+            查询
+          </el-button>
+           <el-button @click="reset"
+             icon="el-icon-refresh-left"
+             size="small"
+             type="primary"
+           >重置</el-button>
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  import { login } from '@/api/login';
+  import {
+    listOrganizations
+  } from '@/api/system/organization';
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        name: '',
+        code: '',
+        fixCode:'',
+        texture:'',
+        module:'',
+        ownershipGroupId:''
+      };
+      return {
+        // 表单数据
+        where: { ...defaultWhere },
+        treeData:[]
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    created(){
+       this.query()
+    },
+    methods: {
+      /* 搜索 */
+      search() {
+        console.log(this.where);
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      },
+
+      query() {
+        listOrganizations()
+          .then((list) => {
+            this.treeData = this.$util.toTreeData({
+              data: list,
+              idField: 'id',
+              parentIdField: 'parentId'
+            });
+          })
+          .catch((e) => {
+          });
+      },
+
+
+    }
+  };
+</script>

+ 59 - 0
src/views/ledgerAssets/sparepart/detail.vue

@@ -0,0 +1,59 @@
+<template>
+  <div>
+    <!-- tab切换 -->
+<!--    <div class="switch">
+      <div class="switch_left">
+        <ul>
+          <li
+            v-for="item in tabOptions"
+            :key="item.key"
+            :class="{ active: activeComp == item.key }"
+            @click="activeComp = item.key"
+          >
+            {{ item.name }}
+          </li>
+        </ul>
+        <el-button size="small" @click="$router.go(-1)">返回</el-button>
+      </div>
+    </div> -->
+    <div class="content-wrapper">
+      <component :is="activeComp" :rowId="rowId"></component>
+    </div>
+  </div>
+</template>
+
+<script>
+import baseInfo from './components/baseInfo.vue'
+export default {
+  components: {
+    baseInfo,
+  },
+  data () {
+    return {
+      activeComp: 'baseInfo',
+      tabOptions: [
+        { key: 'baseInfo', name: '基本信息' }
+      ],
+      rowId:null
+    }
+  },
+
+  created () {
+     this.rowId = this.$route.query.id
+  },
+
+}
+</script>
+
+<style lang="scss" scoped>
+.content-wrapper {
+  background-color: #fff;
+}
+.switch_left{
+  width:100%;
+  display:flex;
+  align-items:center;
+  justify-content: space-between;
+  padding-right:20px;
+}
+</style>

+ 434 - 0
src/views/ledgerAssets/sparepart/edit.vue

@@ -0,0 +1,434 @@
+<template>
+  <div class="page-container equipment-container">
+    <div class="page-title basic-details-title">
+      <el-page-header @back="$router.go(-1)">
+        <div slot="content" class="pageContent">
+          <div>编辑模具信息</div>
+        </div>
+      </el-page-header>
+      <div>
+        <el-button size="small" @click="$router.go(-1)">取消</el-button>
+        <el-button
+          size="small"
+          type="primary"
+           @click="toSave"
+          v-loading="btnLoading"
+          >确定</el-button
+        >
+      </div>
+    </div>
+    <div class="content">
+      <el-form label-width="120px">
+        <div class="basic-details-title border-none">
+          <span class="border-span">基本信息</span>
+        </div>
+        <el-descriptions title="" :column="4" size="medium" border>
+          <el-descriptions-item>
+            <template slot="label"> 编码 </template>
+            {{info.code}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 名称 </template>
+            {{info.name}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 型号 </template>
+            {{info.category.modelType}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 规格 </template>
+            {{info.category.specification}}
+          </el-descriptions-item>
+          <el-descriptions-item :span="2">
+            <template slot="label"> 分类 </template>
+            {{info.category.categoryLevelPath}}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 采购日期 </template>
+            <!-- {{info.warehouseDetail.procurementTime}} -->
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 过保日期 </template>
+            <!-- {{info.warehouseDetail.expirationTime}} -->
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 计量单位 </template>
+            {{info.category.measuringUnit}}
+          </el-descriptions-item>
+          <el-descriptions-item v-if="!info.category.unpack">
+            <template slot="label"> 最小包装单位 </template>
+            {{info.category.measuringUnit}}{{info.category.unit}}/{{info.category.packingUnit}}
+          </el-descriptions-item>
+        </el-descriptions>
+
+        <div class="basic-details-title border-none">
+          <span class="border-span">资产信息</span>
+        </div>
+        <el-row>
+          <el-col :md="8" :xs="8" :sm="8">
+            <el-form-item label="固资编码">
+              <el-input size="small" v-model="info.fixCode"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :md="8" :xs="8" :sm="8">
+             <!-- :initStr="info.ownershipDeptCode" -->
+            <el-form-item label="权属部门" prop="ownershipGroupId" class="qsbm">
+               <ele-tree-select
+                   clearable
+                   :data="treeData"
+                   v-model="info.ownershipGroupId"
+                   placeholder="请选择"
+                   default-expand-all
+                   labelKey="name"
+                   valueKey="id"
+               />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <div class="basic-details-title border-none">
+          <span class="border-span">文档信息</span>
+        </div>
+<!--        <div class="upload-container">
+          <UploadImg @getImgs="cbUploadImg" ref="UploadImg" :assetName="`备品备件`"/>
+          <div class="file-list">
+            <div>
+              <el-form-item prop="image" label="使用说明书">
+                <selectUpload
+                  @getImgs="setImgs('operatingManual', 1, $event)"
+                  :ininObj="attUrl.operatingManual"
+                />
+              </el-form-item>
+            </div>
+            <div>
+              <el-form-item prop="image" label="生产许可证书">
+                <selectUpload
+                  @getImgs="setImgs('productionLicence', 2, $event)"
+                  :ininObj="attUrl.productionLicence"
+                />
+              </el-form-item>
+            </div>
+            <div>
+              <el-form-item prop="image" label="防爆合格证书">
+                <selectUpload
+                  @getImgs="setImgs('explosionProofCertificate', 3, $event)"
+                  :ininObj="attUrl.explosionProofCertificate"
+                />
+              </el-form-item>
+            </div>
+            <div>
+              <el-form-item prop="image" label="检验报告">
+                <selectUpload
+                  @getImgs="setImgs('surveyReport', 4, $event)"
+                  :ininObj="attUrl.surveyReport"
+                />
+              </el-form-item>
+            </div>
+            <div>
+              <el-form-item prop="image" label="检验周期说明">
+                <selectUpload
+                  @getImgs="setImgs('inspectionCycleManual', 5, $event)"
+                  :ininObj="attUrl.inspectionCycleManual"
+                />
+              </el-form-item>
+            </div>
+            <div>
+              <el-form-item prop="image" label="图纸资料">
+                <selectUpload
+                  @getImgs="setImgs('informationDrawing', 6, $event)"
+                  :ininObj="attUrl.informationDrawing"
+                />
+              </el-form-item>
+            </div>
+            <div>
+              <el-form-item prop="image" label="产品合格证">
+                <selectUpload
+                  @getImgs="setImgs('productCertificate', 7, $event)"
+                  :ininObj="attUrl.productCertificate"
+                />
+              </el-form-item>
+            </div>
+          </div>
+        </div> -->
+
+       </el-form>
+        <div class="basic-details-title border-none">
+          <span class="border-span">扩展信息</span>
+        </div>
+        <el-row>
+           <el-form :model="itemForm" :rules="customRule" ref="formCustom" class="row-form">
+                <el-col :span="8" v-for="(item,index) in itemForm.addList" :key="index">
+                     <el-form-item
+                        :prop="'addList.' + index + '.key'"
+                        :rules="{
+                           required: true, message: '自定义参数名称不能为空', trigger: 'blur'
+                       }"
+                     >
+                       <div  class="add-col">
+                           <el-input class="col-input" v-model="item.key" placeholder="参数名称"></el-input>
+                           <el-input class="col-input" v-model="item.value" placeholder="参数值"></el-input>
+                           <el-button type="text" @click="delt(item,index)"> 删除 </el-button>
+                       </div>
+                     </el-form-item>
+                </el-col>
+                <el-col :span="8" v-if="itemForm.addList.length<10">
+                    <el-form-item label-width="20px">
+                         <el-button type="primary" @click="addItem">增加自定义参数</el-button>
+                    </el-form-item>
+                </el-col>
+           </el-form>
+        </el-row>
+      </div>
+  </div>
+</template>
+
+<script>
+// import selectUpload from '@/components/selectUpload'
+// import UploadImg from '@/components/uploadImg/WithView.vue'
+// import {getAssetInfo,toSaveAsset} from "@/api/ledgerAssets/asset"
+// import { imageView } from "@/utils";
+// import org from "@/api/main/org";
+// import selectTree from "@/components/selectTree";
+  import { getAssetInfo , saveOrEdit } from '@/api/ledgerAssets';
+  import { listOrganizations } from '@/api/system/organization';
+export default {
+  // components: { selectUpload, UploadImg , selectTree},
+  data () {
+    return {
+      formData: {},
+      info:{
+        category:{},
+        extraInfo:{}
+      },
+      customRule:{},
+      itemForm:{
+        addList:[]
+      },
+      // 图片
+      imageUrl: null,
+      // 文档信息
+      attUrl: {
+        operatingManual: null,
+        productionLicence: null,
+        explosionProofCertificate: null,
+        surveyReport: null,
+        inspectionCycleManual: null,
+        informationDrawing: null,
+        productCertificate: null,
+      },
+      treeData:[],
+      btnLoading:false,
+    }
+  },
+  created(){
+    let id = this.$route.query.id;
+    this.getDetilInfo(id);
+    this.query();
+  },
+  methods: {
+    // 树形结构数据
+    query() {
+      listOrganizations()
+        .then((list) => {
+          this.treeData = this.$util.toTreeData({
+            data: list,
+            idField: 'id',
+            parentIdField: 'parentId'
+          });
+        })
+        .catch((e) => {
+        });
+    },
+
+    setImgs(type, sort, info) {
+      if (info[0]) {
+        this.attUrl[type] = info[0];
+        this.attUrl[type].sort = sort;
+      } else {
+        this.attUrl[type] = null;
+      }
+    },
+    // 处理文档信息
+    setWd() {
+      let attUrl = [];
+      Object.entries(this.attUrl).forEach(([key, value], index) => {
+        if (value) {
+          attUrl.push(value);
+        } else {
+          attUrl.push({ sort: index + 1 });
+        }
+      });
+      return attUrl;
+    },
+    // 选择图片回调
+    cbUploadImg(data) {
+      if (data.length > 0) {
+        this.imageUrl = data[0];
+      } else {
+        this.imageUrl = "";
+      }
+    },
+
+    async getDetilInfo(id){
+      const res = await getAssetInfo(id)
+      if (res){
+         this.info = res.data
+         this.$set(this.info, 'category', res.data.category)
+         this.$set(this.info, 'extraInfo', JSON.parse(res.data.category.extendField))
+         this.itemForm.addList =  this.info.extInfoSelf
+          ?  this.info.extInfoSelf
+          : [];
+         // 设备图片
+         // this.imageUrl = res.data.imageUrl;
+         // if (this.imageUrl) {
+         //   imageView(this.imageUrl).then((res) => {
+         //     this.$refs.UploadImg.setImg(res);
+         //   });
+         // }
+         // // 文档信息
+         // Object.keys(this.attUrl).forEach((n, index) => {
+         //   if (res.data.attUrl&&res.data.attUrl[index].accessUrl) {
+         //     this.attUrl[n] = res.data.attUrl[index];
+         //   }
+         // });
+      }
+    },
+
+    // 删除自定义参数
+    delt(item,index){
+        this.itemForm.addList.splice(index,1)
+    },
+    // 添加自定义参数
+    addItem(){
+      if(this.itemForm.addList.length<10){
+        let item = {key:'',value:''}
+         this.itemForm.addList.push(item)
+      }else{
+        this.$message.warning('自定义参数最多添加10条')
+      }
+    },
+
+    // 获取上传图片信息
+    getImgs(info){
+       if(info.length){
+         this.info.imgUrl = info[0]
+         // this.info.showUrl = window.URL.createObjectURL(new Blob([param.file]))
+       }else{
+         this.info.imgUrl = {}
+       }
+    },
+
+    // 点击确定保存
+
+      // 点击确定保存
+      toSave () {
+        let extendField = this.itemForm.addList;
+        let params = {
+          id: this.info.id,
+          code: this.info.code,
+          fixCode: this.info.fixCode,
+          // imageUrl: this.imageUrl,
+          extInfoSelf: extendField,
+          ownershipGroupId: this.info.ownershipGroupId,
+          rootCategoryLevelId:this.info.rootCategoryLevelId,
+          categoryId:this.info.categoryId,
+          positionIds: JSON.parse(this.info.category.categoryLevelPathId).join(',')
+        };
+        this.btnLoading = true;
+        this.$refs['formCustom'].validate((valid) => {
+          if (valid) {
+            saveOrEdit(params).then((res) => {
+              if (res) {
+                this.$message.success('备品备件编辑成功');
+                this.$router.go(-1);
+              }
+            })
+            .finally(() => {
+              this.btnLoading = false;
+            });
+          } else {
+            return false;
+          }
+        });
+      },
+
+    //使用说明书
+    operatingManual (info) {
+      if (info.length > 0) {
+        console.log(info, '------info-----')
+        this.formData.operatingManual = info[0]
+        console.log(this.formData.operatingManual, 'getImgs')
+      } else {
+        this.formData.operatingManual = null
+        console.log(this.formData.operatingManual, 'getImgs')
+      }
+    },
+    productionLicence (info) {
+      this.formData.productionLicence = info[0]
+    },
+    explosionProofCertificate (info) {
+      this.formData.explosionProofCertificate = info[0]
+    },
+    surveyReport (info) {
+      this.formData.surveyReport = info[0]
+    },
+    inspectionCycleManual (info) {
+      this.formData.inspectionCycleManual = info[0]
+    },
+    informationDrawing (info) {
+      this.formData.informationDrawing = info[0]
+    },
+    productCertificate (info) {
+      this.formData.productCertificate = info[0]
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.equipment-container {
+  background-color: #fff;
+  padding: 20px;
+  .content {
+    padding: 0 20px;
+  }
+  .label-none {
+    .el-form-item__content {
+      margin-left: 0 !important;
+    }
+  }
+  .page-title{
+    width:100%;
+    padding-bottom: 10px;
+    border-bottom:1px solid #ccc;
+  }
+  .basic-details-title {
+    width: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    margin: 15px 0px;
+    font-size: 16px;
+  }
+  .upload-container {
+    display: flex;
+    .file-list {
+      margin-left: 50px;
+      flex: 1;
+    }
+  }
+  .row-form{
+    width:100%;
+    .add-col{
+      display:flex;
+      align-items:center;
+      margin-left: 20px;
+      .col-input{
+        margin-right:5px;
+      }
+    }
+  }
+  .qsbm .el-select{
+    width:100%
+  }
+}
+</style>

+ 80 - 0
src/views/ledgerAssets/sparepart/index.vue

@@ -0,0 +1,80 @@
+<template>
+  <div class="ele-body">
+     <el-card shadow="never" v-loading="loading">
+       <ele-split-layout
+         width="266px"
+         allow-collapse
+         :right-style="{ overflow: 'hidden' }"
+       >
+         <div>
+           <div class="ele-border-lighter sys-organization-list">
+             <AssetTree
+               @handleNodeClick="handleNodeClick"
+               @setRootId="setRootId"
+               :type="'7'"
+               :paramsType="'type'"
+               ref="treeList"
+             />
+           </div>
+         </div>
+         <template v-slot:content>
+           <sparepart-list
+             v-if="current"
+             :category-id="current.id"
+             :root-id="rootId"
+           />
+         </template>
+       </ele-split-layout>
+     </el-card>
+  </div>
+</template>
+
+<script>
+  import AssetTree from '@/components/AssetTree';
+  import SparepartList from './components/sparepart-list.vue';
+
+  export default {
+    components: {
+      AssetTree ,
+      SparepartList
+    },
+    data () {
+      return {
+        // 加载状态
+        loading: false,
+        // 表格选中数据
+        selection: [],
+        current:null,
+        rootId:null
+      };
+    },
+    computed: {
+
+    },
+    methods: {
+      handleNodeClick (info) {
+        this.current = info
+      },
+      // 获取根节点id
+      setRootId(id){
+        this.rootId = id
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .sys-organization-list {
+    height: calc(100vh - 264px);
+    box-sizing: border-box;
+    border-width: 1px;
+    border-style: solid;
+    overflow: auto;
+  }
+  .sys-organization-list :deep(.el-tree-node__content) {
+    height: 40px;
+    & > .el-tree-node__expand-icon {
+      margin-left: 10px;
+    }
+  }
+</style>

+ 49 - 75
src/views/ledgerAssets/turnoverCar/components/baseInfo.vue

@@ -5,42 +5,42 @@
     </div>
     <el-descriptions title="" :column="4" size="medium" border>
       <el-descriptions-item>
-        <template slot="label"> 周转编码 </template>
-        {{ info.assetCode }}
+        <template slot="label"> 编码 </template>
+        {{ info.code }}
       </el-descriptions-item>
       <el-descriptions-item>
-        <template slot="label"> 周转车名称 </template>
-        {{ info.assetName }}
+        <template slot="label"> 名称 </template>
+        {{ info.name }}
       </el-descriptions-item>
       <el-descriptions-item>
         <template slot="label"> 材质</template>
-        {{info.extraInfo.texture?info.extraInfo.texture:''}}
+        {{ info.category.extendField && JSON.parse(info.category.extendField).texture }}
       </el-descriptions-item>
       <el-descriptions-item>
         <template slot="label"> 型号 </template>
-        {{info.information.modelType}}
+        {{info.category.modelType}}
       </el-descriptions-item>
       <el-descriptions-item :span="2">
         <template slot="label"> 分类 </template>
-        {{info.information.classificationUrl}}
+        {{info.category.categoryLevelPath}}
       </el-descriptions-item>
       <el-descriptions-item>
         <template slot="label"> 采购日期 </template>
-       {{info.warehouseDetail.procurementTime}}
+       <!-- {{info.warehouseDetail.procurementTime}} -->
       </el-descriptions-item>
       <el-descriptions-item>
         <template slot="label"> 过保日期</template>
-        {{info.warehouseDetail.expirationTime}}
+        <!-- {{info.warehouseDetail.expirationTime}} -->
       </el-descriptions-item>
       <el-descriptions-item>
         <template slot="label"> 计量单位</template>
-        {{info.information.measuringUnit}}
+        {{info.category.measuringUnit}}
       </el-descriptions-item>
-      <el-descriptions-item>
+     <el-descriptions-item>
         <template slot="label"> 生命周期</template>
-        <div v-if="queryInfo.source==1" style="color: #70B603">在用</div>
+       <!-- <div v-if="queryInfo.source==1" style="color: #70B603">在用</div>
         <div v-if="queryInfo.source==2" style="color: #F59A23">在库</div>
-        <div v-if="queryInfo.source==3" style="color: #AAAAAA">消耗</div>
+        <div v-if="queryInfo.source==3" style="color: #AAAAAA">消耗</div> -->
       </el-descriptions-item>
     </el-descriptions>
 
@@ -50,7 +50,7 @@
     <el-descriptions title="" :column="4" size="medium" border>
       <el-descriptions-item>
         <template slot="label"> 固资编码 </template>
-        {{info.fixAssetCode}}
+        {{info.fixCode}}
       </el-descriptions-item>
       <el-descriptions-item>
         <template slot="label"> 品牌 </template>
@@ -66,7 +66,7 @@
       </el-descriptions-item>
       <el-descriptions-item :span="2">
         <template slot="label"> {{queryInfo.source==2?'入库单号':'出库单号'}} </template>
-        <el-link style="color: #70B603" @click="jumpDetails">{{info.warehouseDetail.bizNum}}</el-link>
+        <!-- <el-link style="color: #70B603" @click="jumpDetails">{{info.warehouseDetail.bizNum}}</el-link> -->
       </el-descriptions-item>
       <el-descriptions-item>
         <template slot="label"> 所在部门 </template>
@@ -92,10 +92,10 @@
     <div class="basic-details-title border-none">
       <span class="border-span">图文信息</span>
     </div>
-<!--    <div class="upload-container">
+<!--   <div class="upload-container">
        <div class="img-box">
          <img
-           src="~@/assets/img/upload-placeholder.svg"
+           src="~@/assets/upload-placeholder.svg"
            alt=""
            v-if="!imageUrl"
          />
@@ -107,7 +107,7 @@
     </div>
     <el-descriptions title="" :column="4" size="medium" border>
       <el-descriptions-item
-        v-for="(item, index) in info.extendField"
+        v-for="(item, index) in info.extInfoSelf"
         :key="index"
         :span="1"
       >
@@ -116,9 +116,9 @@
       </el-descriptions-item>
     </el-descriptions>
 
-    <DetailsDialog
+ <!--   <DetailsDialog
       ref="detailsDialogRef"
-    />
+    /> -->
   </div>
 </template>
 
@@ -126,79 +126,49 @@
 // import {getAssetInfo} from "@/api/ledgerAssets/asset"
 // import DetailsDialog from '@/views/ledgerAssets/components/outstoreDetailsDialog.vue'
 // import { imageView } from "@/utils"
+  import {
+    getAssetInfo
+  } from '@/api/ledgerAssets';
+  import {
+    getDetails
+  } from '@/api/classifyManage/itemInformation';
 export default {
   props: {
-    queryInfo:{
-      type:Object,
-      default:{}
+    rowId:{
+      type:String ,
+      default:''
     },
   },
   // components: { DetailsDialog },
   data () {
     return {
-      baseOpt: [
-        { label: '周转编码', key: 'assetCode' },
-        { label: '周转车名称', key: 'assetName' },
-        { label: '材质', key: 'texture' },
-        { label: '型号', key: 'modelType' },
-        { label: '分类', key: 'classificationUrl', span: 2 },
-        { label: '采购日期', key: 'procurementTime' },
-        { label: '过保日期', key: 'expirationTime' },
-        { label: '计量单位', key: 'measuringUnit' },
-        { label: '生命周期', key: 'source' }
-      ],
-      prodOpt: [
-        { label: '固资编码', key: 'fixAssetCode' },
-        { label: '品牌', key: 'brand' },
-        { label: '供应商', key: 'supplierName' },
-        { label: '供应商电话', key: 'supplierMobile' },
-        { label: '出库单号', key: 'bizNum' },
-        { label: '所在部门', key: 'ownershipDeptName' },
-        { label: '所在工序', key: 'processName' },
-        { label: '当前权属人', key: 'ownershipUserName' },
-        { label: '权属人电话', key: 'ownershipUserMobile' },
-        // { label: '生产订单号', key: '' },
-        // { label: '舟皿数量', key: ''},
-        // { label: '产品数量', key: '' },
-      ],
-      fileList: [
-        { name: '使用说明书' },
-        { name: '生产许可证书' },
-        { name: '防爆合格证书' },
-        { name: '检验报告' },
-        { name: '检验周期说明' },
-        { name: '图纸资料' },
-        { name: '产品合格证' }
-      ],
       info:{
-        information:{},
-        warehouseDetail:{},
-        extendField:[],
-        extraInfo:{},
+        category:{},
+        extInfoSelf:[]
       },
       // 设备图片
       imageUrl: "",
+      queryInfo:{}
 
     }
   },
   created () {
-     let id = this.queryInfo.id
-     this.getDetilInfo(id)
+     // let id = this.queryInfo.id
+     this.getDetilInfo()
   },
   methods:{
-     async getDetilInfo(id){
-       const res = await getAssetInfo({id:id})
-       if (res.success){
+     async getDetilInfo(){
+       const res = await getAssetInfo(this.rowId)
+       if (res){
           this.info = res.data
-          this.$set(this.info, 'information', res.data.information)
-          this.$set(this.info, 'warehouseDetail', res.data.warehouseDetail)
-          this.$set(this.info, 'extraInfo', JSON.parse(res.data.information.extendField))
-          this.$set(this.info, 'extendField', JSON.parse(res.data.extendField))
-          if (res.data.imageUrl) {
-            imageView(res.data.imageUrl).then((res) => {
-              this.imageUrl = res;
-            });
-          }
+          this.$set(this.info, 'category', res.data.category)
+          this.$set(this.info, 'extInfoSelf', res.data.extInfoSelf?res.data.extInfoSelf:[])
+          // this.$set(this.info, 'warehouseDetail', res.data.warehouseDetail)
+          // if (res.data.imageUrl) {
+          //   imageView(res.data.imageUrl).then((res) => {
+          //     this.imageUrl = res;
+          //   });
+          // }
        }
      },
      // 打开详情弹窗
@@ -223,6 +193,10 @@ export default {
   .content {
     padding: 0 20px;
   }
+  .basic-details-title{
+    font-size: 16px;
+    margin: 15px 0;
+  }
   .upload-container {
     width:100%;
     display: flex;

+ 31 - 10
src/views/ledgerAssets/turnoverCar/components/turnovercar-list.vue

@@ -31,6 +31,24 @@
           {{ row.code }}
         </el-link>
       </template>
+      <!-- 材质列 -->
+      <template v-slot:texture="{ row }">
+        <div>
+          {{ row.category.extendField && JSON.parse(row.category.extendField).texture }}
+        </div>
+      </template>
+      <!-- 型号列 -->
+      <template v-slot:modelType="{ row }">
+        <div>
+          {{ row.category.modelType }}
+        </div>
+      </template>
+      <!-- 分类列 -->
+      <template v-slot:categoryLevelPath="{ row }">
+        <div>
+          {{ row.category.categoryLevelPath }}
+        </div>
+      </template>
       <!-- 操作列 -->
       <template v-slot:action="{ row }">
         <el-link
@@ -50,7 +68,7 @@
   import TurnovercarSearch from './turnovercar-search.vue';
   import {
     getAssetList
-  } from '@/api/ledgerAssets/turnovercar.js';
+  } from '@/api/ledgerAssets';
 
   export default {
     components: { TurnovercarSearch },
@@ -94,31 +112,34 @@
             minWidth: 110
           },
           {
-            prop: 'brandNum',
+            prop: 'fixCode',
             label: '固资编码',
             showOverflowTooltip: true,
             minWidth: 110
           },
           {
-            prop: 'categoryLevelPath',
+            prop: 'texture',
             label: '材质',
             showOverflowTooltip: true,
-            minWidth: 110
+            minWidth: 110,
+            slot: 'texture'
           },
           {
-            prop: 'inUseSum',
+            prop: 'modelType',
             label: '型号',
             showOverflowTooltip: true,
-            minWidth: 110
+            minWidth: 110,
+            slot:'modelType'
           },
           {
-            prop: 'inLibrarySum',
+            prop: 'categoryLevelPath',
             label: '分类',
             showOverflowTooltip: true,
-            minWidth: 110
+            minWidth: 110,
+            slot: 'categoryLevelPath'
           },
           {
-            prop: 'consumeSum',
+            prop: 'ownershipGroupName',
             label: '所在部门',
             showOverflowTooltip: true,
             minWidth: 110
@@ -182,7 +203,7 @@
     },
     watch: {
       // 监听类别id变化
-      rootId() {
+      categoryId() {
         this.reload();
       }
     }

+ 19 - 17
src/views/ledgerAssets/turnoverCar/components/turnovercar-search.vue

@@ -1,7 +1,7 @@
 <!-- 搜索表单 -->
 <template>
   <el-form
-    label-width="77px"
+    label-width="75px"
     class="ele-form-search"
     @keyup.enter.native="search"
     @submit.native.prevent
@@ -11,28 +11,19 @@
         <el-form-item label="编码:" label-width="50px">
           <el-input clearable v-model="where.code" placeholder="请输入" />
         </el-form-item>
-        <el-form-item label="名称:" label-width="50px">
-          <el-input clearable v-model="where.name" placeholder="请输入" />
-        </el-form-item>
-      </el-col>
-      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="生命周期:">
-          <DictSelection dictName="生命周期" clearable v-model="where.source">
-          </DictSelection>
-        </el-form-item>
-        <el-form-item label="材质:">
-          <el-input clearable v-model="where.texture" placeholder="请输入" />
+        <el-form-item label="型号:" label-width="50px">
+          <el-input clearable v-model="where.module" 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.spaceModule" placeholder="请输入" />
+        <el-form-item label="名称:" label-width="50px">
+          <el-input clearable v-model="where.name" placeholder="请输入" />
         </el-form-item>
         <el-form-item label="所在部门:">
            <ele-tree-select
               clearable
               :data="treeData"
-              v-model="where.dept"
+              v-model="where.ownershipGroupId"
               placeholder="请选择"
               default-expand-all
               labelKey="name"
@@ -42,7 +33,16 @@
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="固定资产编码:" label-width="100px">
-          <el-input clearable v-model="where.fixAssetCode" placeholder="请输入" />
+          <el-input clearable v-model="where.fixCode" placeholder="请输入" />
+        </el-form-item>
+        <el-form-item label="生命周期:">
+          <DictSelection dictName="生命周期" clearable v-model="where.source">
+          </DictSelection>
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="材质:" label-width="50px">
+          <el-input clearable v-model="where.texture" placeholder="请输入" />
         </el-form-item>
         <div class="ele-form-actions">
           <el-button
@@ -75,7 +75,9 @@
       // 默认表单数据
       const defaultWhere = {
         name: '',
-        groupId: ''
+        code: '',
+        fixCode:'',
+        ownershipGroupId:''
       };
       return {
         // 表单数据

+ 6 - 28
src/views/ledgerAssets/turnoverCar/detail.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <!-- tab切换 -->
-    <div class="switch">
+<!--    <div class="switch">
       <div class="switch_left">
         <ul>
           <li
@@ -15,53 +15,31 @@
         </ul>
         <el-button size="small" @click="$router.go(-1)">返回</el-button>
       </div>
-    </div>
+    </div> -->
     <div class="content-wrapper">
-      <component :is="activeComp" :queryInfo="queryInfo"></component>
+      <component :is="activeComp" :rowId="rowId"></component>
     </div>
   </div>
 </template>
 
 <script>
 import baseInfo from './components/baseInfo.vue'
-// import mould from '../components/details/mould.vue'
-// import maintain from '../components/details/maintain.vue'
-// import repair from '../components/details/repair.vue'
-// import malfunction from '../components/details/malfunction.vue'
-// import InternetRecord from '../components/details/InternetRecord.vue'
-// import production from '../components/details/production.vue'
-// import pointInspection from '../components/details/point-inspection.vue'
 export default {
   components: {
     baseInfo,
-    // mould,
-    // pointInspection,
-    // maintain,
-    // repair,
-    // production,
-    // InternetRecord,
-    // malfunction
   },
   data () {
     return {
       activeComp: 'baseInfo',
       tabOptions: [
-        { key: 'baseInfo', name: '基本信息' },
-        // { key: 'mould', name: '关联模具' },
-        // { key: 'pointInspection', name: '点巡检记录' },
-        // { key: 'maintain', name: '保养记录' },
-        // { key: 'repair', name: '维修记录' },
-        // { key: 'malfunction', name: '故障记录' },
-        // { key: 'production', name: '生产记录' },
-        // { key: 'internet', name: '物联数据' },
-        // { key: 'InternetRecord', name: '物联记录' }
+        { key: 'baseInfo', name: '基本信息' }
       ],
-      queryInfo:null
+      rowId:null
     }
   },
 
   created () {
-     this.queryInfo = JSON.parse(this.$route.query.row)
+     this.rowId = this.$route.query.id
   },
 
 }

+ 266 - 222
src/views/ledgerAssets/turnoverCar/edit.vue

@@ -1,10 +1,20 @@
 <template>
   <div class="page-container equipment-container">
-    <div class="basic-details-title">
-      <span class="border-span">编辑周转车信息</span>
+    <div class="page-title basic-details-title">
+      <el-page-header @back="$router.go(-1)">
+        <div slot="content" class="pageContent">
+          <div>编辑周转车信息</div>
+        </div>
+      </el-page-header>
       <div>
         <el-button size="small" @click="$router.go(-1)">取消</el-button>
-        <el-button size="small" type="primary" @click="toSave">确定</el-button>
+        <el-button
+          size="small"
+          type="primary"
+           @click="toSave"
+          v-loading="btnLoading"
+          >确定</el-button
+        >
       </div>
     </div>
     <div label-width="120px">
@@ -14,32 +24,32 @@
         </div>
         <el-descriptions title="" :column="4" size="medium" border>
           <el-descriptions-item>
-            <template slot="label"> 周转车编码 </template>
-            {{info.assetCode}}
+            <template slot="label"> 编码 </template>
+            {{ info.code }}
           </el-descriptions-item>
           <el-descriptions-item>
-            <template slot="label"> 周转车名称 </template>
-            {{info.assetName}}
+            <template slot="label"> 名称 </template>
+            {{ info.name }}
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label"> 材质 </template>
-            {{info.textureInfo.texture?info.textureInfo.texture:''}}
+            {{ info.category.extendField && JSON.parse(info.category.extendField).texture }}
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label"> 型号 </template>
-            {{info.information.modelType}}
+            {{ info.category.modelType }}
           </el-descriptions-item>
           <el-descriptions-item :span="2">
             <template slot="label"> 分类 </template>
-            {{info.information.classificationUrl}}
+            {{ info.category.categoryLevelPath }}
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label"> 采购日期 </template>
-            {{info.warehouseDetail.procurementTime}}
+            <!-- {{ info.warehouseDetail.procurementTime }} -->
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label"> 过保日期 </template>
-            {{info.warehouseDetail.expirationTime}}
+            <!-- {{ info.warehouseDetail.expirationTime }} -->
           </el-descriptions-item>
         </el-descriptions>
 
@@ -50,9 +60,9 @@
         <el-form label-width="90px">
           <el-row>
             <el-col :md="8" :xs="8" :sm="8">
-              <el-form-item label="固资编码" prop="fixAssetCode">
+              <el-form-item label="固资编码" prop="fixCode">
                 <el-input
-                  v-model="info.fixAssetCode"
+                  v-model="info.fixCode"
                   type="text"
                   size="small"
                   placeholder="请输入"
@@ -60,23 +70,15 @@
               ></el-form-item>
             </el-col>
             <el-col :md="8" :xs="8" :sm="8">
-               <!-- :initStr="info.ownershipDeptCode" -->
               <el-form-item label="权属部门" prop="name" class="qsbm">
-                <el-input
-                  v-model="info.ownershipDeptCode"
-                  v-show="false"
-                ></el-input>
-                <selectTree
-                  ref="tree2"
-                  class="input"
-                  :value="info.ownershipDeptCode"
-                  :options="deptList"
-                  :props="{
-                    value: 'code',
-                    label: 'name',
-                    children: 'children',
-                  }"
-                  @getValue="qsDeptClick"
+                <ele-tree-select
+                    clearable
+                    :data="treeData"
+                    v-model="info.ownershipGroupId"
+                    placeholder="请选择"
+                    default-expand-all
+                    labelKey="name"
+                    valueKey="id"
                 />
               </el-form-item>
             </el-col>
@@ -86,33 +88,60 @@
           <span class="border-span">文档信息</span>
         </div>
         <div class="upload-container">
-          <UploadImg  @getImgs="cbUploadImg" :assetName="`周转车`" ref="UploadImg"/>
+          <!-- <UploadImg
+            @getImgs="cbUploadImg"
+            :assetName="`周转车`"
+            ref="UploadImg"
+          /> -->
         </div>
         <div class="basic-details-title border-none">
           <span class="border-span">扩展信息</span>
         </div>
         <el-row>
-           <el-form :model="itemForm" :rules="customRule" ref="formCustom" class="row-form">
-                <el-col :span="8" v-for="(item,index) in itemForm.addList" :key="index">
-                     <el-form-item
-                        :prop="'addList.' + index + '.key'"
-                        :rules="{
-                           required: true, message: '自定义参数名称不能为空', trigger: 'blur'
-                       }"
-                     >
-                       <div  class="add-col">
-                           <el-input class="col-input" v-model="item.key" placeholder="参数名称"></el-input>
-                           <el-input class="col-input" v-model="item.value" placeholder="参数值"></el-input>
-                           <el-button type="text" @click="delt(item,index)"> 删除 </el-button>
-                       </div>
-                     </el-form-item>
-                </el-col>
-                <el-col :span="8" v-if="itemForm.addList.length<10">
-                    <el-form-item label-width="20px">
-                         <el-button type="primary" @click="addItem">增加自定义参数</el-button>
-                    </el-form-item>
-                </el-col>
-           </el-form>
+          <el-form
+            :model="itemForm"
+            :rules="customRule"
+            ref="formCustom"
+            class="row-form"
+          >
+            <el-col
+              :span="8"
+              v-for="(item, index) in itemForm.addList"
+              :key="index"
+            >
+              <el-form-item
+                :prop="'addList.' + index + '.key'"
+                :rules="{
+                  required: true,
+                  message: '自定义参数名称不能为空',
+                  trigger: 'blur'
+                }"
+              >
+                <div class="add-col">
+                  <el-input
+                    class="col-input"
+                    v-model="item.key"
+                    placeholder="参数名称"
+                  ></el-input>
+                  <el-input
+                    class="col-input"
+                    v-model="item.value"
+                    placeholder="参数值"
+                  ></el-input>
+                  <el-button type="text" @click="delt(item, index)">
+                    删除
+                  </el-button>
+                </div>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8" v-if="itemForm.addList.length < 10">
+              <el-form-item label-width="20px">
+                <el-button type="primary" @click="addItem"
+                  >增加自定义参数</el-button
+                >
+              </el-form-item>
+            </el-col>
+          </el-form>
         </el-row>
       </div>
     </div>
@@ -120,191 +149,206 @@
 </template>
 
 <script>
-// import selectUpload from '@/components/selectUpload'
-// import UploadImg from '@/components/uploadImg/WithView.vue'
-// import {getAssetInfo,toSaveAsset} from "@/api/ledgerAssets/asset"
-// import { imageView } from "@/utils";
-// import org from "@/api/main/org";
-// import selectTree from "@/components/selectTree";
-export default {
-  // components: { selectUpload, UploadImg , selectTree},
-  data () {
-    return {
-      formData: {},
-      info:{
-        textureInfo:{},
-        information:{},
-        warehouseDetail:{},
-        extendField:[],
-      },
-      customRule:{},
-      itemForm:{
-        addList:[]
-      },
-
-      imageUrl: null,
-      deptList:[]
-
-    }
-  },
-  created(){
-    let id =  this.$route.query.id
-    this.getDetilInfo(id)
-    this.getTreeList()
-  },
-  methods: {
-    // 树形结构数据
-    getTreeList() {
-      org.tree().then((res) => {
-        this.deptList = res.data;
-      });
-    },
-    // 权属部门点击回调
-    qsDeptClick(info) {
-      this.info.ownershipDeptCode = info.code;
-      this.info.ownershipDeptName = info.name
+  import { getAssetInfo , saveOrEdit } from '@/api/ledgerAssets';
+  import { listOrganizations } from '@/api/system/organization';
+  export default {
+    data () {
+      return {
+        formData: {},
+        info: {
+          category: {},
+          warehouseDetail: {},
+        },
+        customRule: {},
+        itemForm: {
+          addList: []
+        },
+        imageUrl: null,
+        treeData:[],
+        btnLoading: false,
+      };
     },
-    async getDetilInfo(id){
-      const res = await getAssetInfo({id:id})
-      if (res.success){
-         this.info = res.data
-         this.$set(this.info, 'information', res.data.information)
-         this.$set(this.info, 'warehouseDetail', res.data.warehouseDetail)
-         this.$set(this.info, 'textureInfo', JSON.parse(res.data.information.extendField))
-         this.$set(this.info, 'extendField', JSON.parse(res.data.extendField))
-         // this.$set(this.info, 'imgUrl', res.data.imageUrl)
-         this.itemForm.addList = this.info.extendField?this.info.extendField:[]
-         // 设备图片
-         this.imageUrl = res.data.imageUrl;
-         if (this.imageUrl) {
-           imageView(this.imageUrl).then((res) => {
-             this.$refs.UploadImg.setImg(res);
-           });
-         }
-      }
+    created () {
+      let id = this.$route.query.id;
+      this.getDetilInfo(id);
+      this.query();
     },
+    methods: {
+      // 树形结构数据
+      query() {
+        listOrganizations()
+          .then((list) => {
+            this.treeData = this.$util.toTreeData({
+              data: list,
+              idField: 'id',
+              parentIdField: 'parentId'
+            });
+          })
+          .catch((e) => {
+          });
+      },
 
-    // 删除自定义参数
-    delt(item,index){
-        this.itemForm.addList.splice(index,1)
-    },
-    // 添加自定义参数
-    addItem(){
-      if(this.itemForm.addList.length<10){
-        let item = {key:'',value:''}
-         this.itemForm.addList.push(item)
-      }else{
-        this.$message.warning('自定义参数最多添加10条')
-      }
-    },
+      async getDetilInfo (id) {
+        const res = await getAssetInfo(id);
+        if (res) {
+          this.info = res.data;
+          this.$set(this.info, 'category', res.data.category);
+          // this.$set(this.info, 'warehouseDetail', res.data.warehouseDetail);
+          // this.$set(this.info, 'imgUrl', res.data.imageUrl)
+          this.itemForm.addList = this.info.extInfoSelf
+            ? this.info.extInfoSelf
+            : [];
+          // 设备图片
+          this.imageUrl = res.data.imageUrl;
+          if (this.imageUrl) {
+            imageView(this.imageUrl).then((res) => {
+              this.$refs.UploadImg.setImg(res);
+            });
+          }
+        }
+      },
 
-    // 选择图片回调
-    cbUploadImg(data) {
-      if (data.length > 0) {
-        this.imageUrl = data[0];
-      } else {
-        this.imageUrl = "";
-      }
-    },
+      // 删除自定义参数
+      delt (item, index) {
+        this.itemForm.addList.splice(index, 1);
+      },
+      // 添加自定义参数
+      addItem () {
+        if (this.itemForm.addList.length < 10) {
+          let item = { key: '', value: '' };
+          this.itemForm.addList.push(item);
+        } else {
+          this.$message.warning('自定义参数最多添加10条');
+        }
+      },
 
-    // 点击确定保存
-    toSave(){
-      let extendField = this.itemForm.addList
-      let params = {
-         id:this.info.id,
-         assetCode: this.info.assetCode,
-         imageUrl: this.imageUrl,
-         extendField:JSON.stringify(extendField),
-         fixAssetCode:this.info.fixAssetCode,
-         isIotEnable:false,
-         ownershipDeptCode:this.info.ownershipDeptCode,
-         ownershipDeptName:this.info.ownershipDeptName
-      }
-      this.$refs['formCustom'].validate((valid) => {
-        if (valid) {
-          toSaveAsset(params).then(res=>{
-             if(res.success){
-                 this.$message.success('周转车编辑成功')
-                 this.$router.go(-1)
-             }
-          })
+      // 选择图片回调
+      cbUploadImg (data) {
+        if (data.length > 0) {
+          this.imageUrl = data[0];
         } else {
-          return false;
+          this.imageUrl = '';
         }
-      });
-    },
+      },
 
+      // 点击确定保存
+      toSave () {
+        let extendField = this.itemForm.addList;
+        let params = {
+          id: this.info.id,
+          code: this.info.code,
+          fixCode: this.info.fixCode,
+          // imageUrl: this.imageUrl,
+          extInfoSelf: extendField,
+          ownershipGroupId: this.info.ownershipGroupId,
+          rootCategoryLevelId:this.info.rootCategoryLevelId,
+          categoryId:this.info.categoryId,
+          positionIds: JSON.parse(this.info.category.categoryLevelPathId).join(',')
+        };
+        this.btnLoading = true;
+        this.$refs['formCustom'].validate((valid) => {
+          if (valid) {
+            saveOrEdit(params).then((res) => {
+              if (res) {
+                this.$message.success('周转车编辑成功');
+                this.$router.go(-1);
+              }
+            })
+            .finally(() => {
+              this.btnLoading = false;
+            });
+          } else {
+            return false;
+          }
+        });
+      }
 
-    // //使用说明书
-    // operatingManual (info) {
-    //   if (info.length > 0) {
-    //     console.log(info, '------info-----')
-    //     this.formData.operatingManual = info[0]
-    //     console.log(this.formData.operatingManual, 'getImgs')
-    //   } else {
-    //     this.formData.operatingManual = null
-    //     console.log(this.formData.operatingManual, 'getImgs')
-    //   }
-    // },
-    // productionLicence (info) {
-    //   this.formData.productionLicence = info[0]
-    // },
-    // explosionProofCertificate (info) {
-    //   this.formData.explosionProofCertificate = info[0]
-    // },
-    // surveyReport (info) {
-    //   this.formData.surveyReport = info[0]
-    // },
-    // inspectionCycleManual (info) {
-    //   this.formData.inspectionCycleManual = info[0]
-    // },
-    // informationDrawing (info) {
-    //   this.formData.informationDrawing = info[0]
-    // },
-    // productCertificate (info) {
-    //   this.formData.productCertificate = info[0]
-    // }
-  }
-}
+      // //使用说明书
+      // operatingManual (info) {
+      //   if (info.length > 0) {
+      //     console.log(info, '------info-----')
+      //     this.formData.operatingManual = info[0]
+      //     console.log(this.formData.operatingManual, 'getImgs')
+      //   } else {
+      //     this.formData.operatingManual = null
+      //     console.log(this.formData.operatingManual, 'getImgs')
+      //   }
+      // },
+      // productionLicence (info) {
+      //   this.formData.productionLicence = info[0]
+      // },
+      // explosionProofCertificate (info) {
+      //   this.formData.explosionProofCertificate = info[0]
+      // },
+      // surveyReport (info) {
+      //   this.formData.surveyReport = info[0]
+      // },
+      // inspectionCycleManual (info) {
+      //   this.formData.inspectionCycleManual = info[0]
+      // },
+      // informationDrawing (info) {
+      //   this.formData.informationDrawing = info[0]
+      // },
+      // productCertificate (info) {
+      //   this.formData.productCertificate = info[0]
+      // }
+    }
+  };
 </script>
 
 <style lang="scss" scoped>
-.equipment-container {
-  background-color: #fff;
-  padding: 20px;
-  .content {
-    padding: 0 20px;
-  }
-  .label-none {
+  .equipment-container {
+    background-color: #fff;
+    padding: 20px;
+    .page-title{
+      width:100%;
+      padding-bottom: 10px;
+      border-bottom:1px solid #ccc;
+    }
+    .basic-details-title {
+      width: 100%;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      margin: 15px 0px;
+      font-size: 16px;
+    }
+    .basic-details-title:first-child {
+      margin: 0px 0px 15px;
+    }
+    .content {
+      padding: 0 20px;
+    }
+    .label-none {
+      .el-form-item__content {
+        margin-left: 0 !important;
+      }
+    }
+    .upload-container {
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      // .file-list {
+      //   margin-left: 50px;
+      //   flex: 1;
+      // }
+    }
     .el-form-item__content {
-      margin-left: 0 !important;
+      display: flex;
     }
-  }
-  .upload-container {
-    display: flex;
-    align-items:center;
-    justify-content:center;
-    // .file-list {
-    //   margin-left: 50px;
-    //   flex: 1;
-    // }
-  }
-  .el-form-item__content{
-    display:flex;
-  }
-  .row-form{
-    width:100%;
-    .add-col{
-      display:flex;
-      align-items:center;
-      margin-left: 20px;
-      .col-input{
-        margin-right:5px;
+    .row-form {
+      width: 100%;
+      .add-col {
+        display: flex;
+        align-items: center;
+        margin-left: 20px;
+        .col-input {
+          margin-right: 5px;
+        }
       }
     }
+    .qsbm .el-select {
+      width: 100%;
+    }
   }
-  .qsbm .el-select{
-    width:100%
-  }
-}
 </style>

+ 1 - 0
src/views/ledgerAssets/turnoverCar/index.vue

@@ -10,6 +10,7 @@
            <div class="ele-border-lighter sys-organization-list">
              <AssetTree
                @handleNodeClick="handleNodeClick"
+               @setRootId="setRootId"
                :type="'5'"
                :paramsType="'type'"
                ref="treeList"

+ 9 - 7
src/views/login/index.vue

@@ -115,7 +115,7 @@
     // eslint-disable-next-line vue/multi-word-component-names
     name: 'Login',
     components: { I18nIcon },
-    data() {
+    data () {
       return {
         // 登录框方向, 0居中, 1居右, 2居左
         direction: 0,
@@ -135,7 +135,7 @@
     },
     computed: {
       // 表单验证规则
-      rules() {
+      rules () {
         return {
           loginName: [
             {
@@ -156,14 +156,17 @@
         };
       }
     },
-    created() {
+    created () {
       if (getToken()) {
         this.goHome();
+      } else {
+        // 重置菜单权限
+        this.$store.commit('user/setMenus', null);
       }
     },
     methods: {
       /* 提交 */
-      submit() {
+      submit () {
         this.$refs.form.validate((valid) => {
           if (!valid) {
             return false;
@@ -172,7 +175,6 @@
           login(this.form)
             .then((res) => {
               localStorage.setItem('userId', res.data.userId);
-
               // 用户信息
               this.$store.commit('user/setUserInfo', res.data);
               this.loading = false;
@@ -186,11 +188,11 @@
         });
       },
       /* 跳转到首页 */
-      goHome() {
+      goHome () {
         this.$router.push(this.$route?.query?.from ?? '/').catch(() => {});
       },
       /* 更换图形验证码 */
-      changeCaptcha() {
+      changeCaptcha () {
         // 这里演示的验证码是后端返回base64格式的形式, 如果后端地址直接是图片请参考忘记密码页面
         getCaptcha()
           .then((data) => {

Some files were not shown because too many files changed in this diff