Просмотр исходного кода

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

汪钰 3 лет назад
Родитель
Сommit
b0b100404a
34 измененных файлов с 2556 добавлено и 1060 удалено
  1. 54 0
      package-lock.json
  2. 32 16
      src/api/classifyManage/itemInformation.js
  3. 58 0
      src/api/ledgerAssets/boat.js
  4. 8 0
      src/components/AssetTree/index.vue
  5. 3 1
      src/enum/dict.js
  6. 2 2
      src/router/routes.js
  7. 191 681
      src/views/classifyManage/itemInformation/add.vue
  8. 31 40
      src/views/classifyManage/itemInformation/components/AddDialog.vue
  9. 16 50
      src/views/classifyManage/itemInformation/components/ItemForm.vue
  10. 26 26
      src/views/classifyManage/itemInformation/components/RowDetail.vue
  11. 60 64
      src/views/classifyManage/itemInformation/components/RowForm.vue
  12. 31 17
      src/views/classifyManage/itemInformation/components/item-list.vue
  13. 425 0
      src/views/classifyManage/itemInformation/components/item-match.vue
  14. 243 0
      src/views/classifyManage/itemInformation/components/match-mixins.js
  15. 38 40
      src/views/classifyManage/itemInformation/details.vue
  16. 34 4
      src/views/classifyManage/itemInformation/index.vue
  17. 0 0
      src/views/classifyManage/treeClassify/components/addDialog.vue
  18. 0 0
      src/views/classifyManage/treeClassify/components/classifyManageEdit.vue
  19. 0 0
      src/views/classifyManage/treeClassify/components/classifyManageSearch.vue
  20. 12 20
      src/views/classifyManage/treeClassify/components/list-edit.vue
  21. 0 0
      src/views/classifyManage/treeClassify/details.vue
  22. 1 1
      src/views/classifyManage/treeClassify/index.vue
  23. 8 88
      src/views/codeManagement/components/addDialog.vue
  24. 4 4
      src/views/codeManagement/components/myTable.vue
  25. 259 0
      src/views/ledgerAssets/boat/components/baseInfo.vue
  26. 167 0
      src/views/ledgerAssets/boat/components/boat-list.vue
  27. 96 0
      src/views/ledgerAssets/boat/components/boat-search.vue
  28. 66 0
      src/views/ledgerAssets/boat/detail.vue
  29. 54 6
      src/views/ledgerAssets/boat/index.vue
  30. 259 0
      src/views/ledgerAssets/material/components/baseInfo.vue
  31. 149 0
      src/views/ledgerAssets/material/components/material-list.vue
  32. 88 0
      src/views/ledgerAssets/material/components/material-search.vue
  33. 66 0
      src/views/ledgerAssets/material/detail.vue
  34. 75 0
      src/views/ledgerAssets/material/index.vue

+ 54 - 0
package-lock.json

@@ -1666,12 +1666,15 @@
       "resolved": "https://registry.npmmirror.com/@types/parse5/-/parse5-6.0.3.tgz",
       "integrity": "sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g=="
     },
+<<<<<<< HEAD
+=======
     "@types/q": {
       "version": "1.5.5",
       "resolved": "https://registry.npmmirror.com/@types/q/-/q-1.5.5.tgz",
       "integrity": "sha512-L28j2FcJfSZOnL1WBjDYp2vUHCeIFlyYI/53EwD/rKUBQ7MtUUfbQWiyKJGpcnv4/WgrhWsFKrcPstcAt/J0tQ==",
       "dev": true
     },
+>>>>>>> 33a1a8d1a265418b200ca2c39eb854da215a9986
     "@types/qs": {
       "version": "6.9.7",
       "resolved": "https://registry.npmmirror.com/@types/qs/-/qs-6.9.7.tgz",
@@ -2034,6 +2037,8 @@
         "webpack-merge": "^5.7.3",
         "webpack-virtual-modules": "^0.4.2",
         "whatwg-fetch": "^3.6.2"
+<<<<<<< HEAD
+=======
       },
       "dependencies": {
         "@vue/vue-loader-v15": {
@@ -2057,6 +2062,7 @@
             }
           }
         }
+>>>>>>> 33a1a8d1a265418b200ca2c39eb854da215a9986
       }
     },
     "@vue/cli-shared-utils": {
@@ -2206,6 +2212,30 @@
         }
       }
     },
+<<<<<<< HEAD
+    "@vue/vue-loader-v15": {
+      "version": "npm:vue-loader@15.10.1",
+      "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.10.1.tgz",
+      "integrity": "sha512-SaPHK1A01VrNthlix6h1hq4uJu7S/z0kdLUb6klubo738NeQoLbS6V9/d8Pv19tU0XdQKju3D1HSKuI8wJ5wMA==",
+      "dev": true,
+      "requires": {
+        "@vue/component-compiler-utils": "^3.1.0",
+        "hash-sum": "^1.0.2",
+        "loader-utils": "^1.1.0",
+        "vue-hot-reload-api": "^2.3.0",
+        "vue-style-loader": "^4.1.0"
+      },
+      "dependencies": {
+        "hash-sum": {
+          "version": "1.0.2",
+          "resolved": "https://registry.npmjs.org/hash-sum/-/hash-sum-1.0.2.tgz",
+          "integrity": "sha512-fUs4B4L+mlt8/XAtSOGMUO1TXmAelItBPtJG7CyHJfYTdDjwisntGO2JQz7oUsatOY9o68+57eziUVNw/mRHmA==",
+          "dev": true
+        }
+      }
+    },
+=======
+>>>>>>> 33a1a8d1a265418b200ca2c39eb854da215a9986
     "@vue/web-component-wrapper": {
       "version": "1.3.0",
       "resolved": "https://registry.npmmirror.com/@vue/web-component-wrapper/-/web-component-wrapper-1.3.0.tgz",
@@ -2521,6 +2551,8 @@
       "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
       "dev": true
     },
+<<<<<<< HEAD
+=======
     "arr-diff": {
       "version": "4.0.0",
       "resolved": "https://registry.npmmirror.com/arr-diff/-/arr-diff-4.0.0.tgz",
@@ -2549,6 +2581,7 @@
         "is-array-buffer": "^3.0.1"
       }
     },
+>>>>>>> 33a1a8d1a265418b200ca2c39eb854da215a9986
     "array-flatten": {
       "version": "2.1.2",
       "resolved": "https://registry.npmmirror.com/array-flatten/-/array-flatten-2.1.2.tgz",
@@ -2561,6 +2594,8 @@
       "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
       "dev": true
     },
+<<<<<<< HEAD
+=======
     "array-unique": {
       "version": "0.3.2",
       "resolved": "https://registry.npmmirror.com/array-unique/-/array-unique-0.3.2.tgz",
@@ -2586,6 +2621,7 @@
       "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==",
       "dev": true
     },
+>>>>>>> 33a1a8d1a265418b200ca2c39eb854da215a9986
     "async": {
       "version": "2.6.4",
       "resolved": "https://registry.npmmirror.com/async/-/async-2.6.4.tgz",
@@ -2614,12 +2650,15 @@
       "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==",
       "dev": true
     },
+<<<<<<< HEAD
+=======
     "atob": {
       "version": "2.1.2",
       "resolved": "https://registry.npmmirror.com/atob/-/atob-2.1.2.tgz",
       "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==",
       "dev": true
     },
+>>>>>>> 33a1a8d1a265418b200ca2c39eb854da215a9986
     "autoprefixer": {
       "version": "10.4.8",
       "resolved": "https://registry.npmmirror.com/autoprefixer/-/autoprefixer-10.4.8.tgz",
@@ -2634,12 +2673,15 @@
         "postcss-value-parser": "^4.2.0"
       }
     },
+<<<<<<< HEAD
+=======
     "available-typed-arrays": {
       "version": "1.0.5",
       "resolved": "https://registry.npmmirror.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz",
       "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==",
       "dev": true
     },
+>>>>>>> 33a1a8d1a265418b200ca2c39eb854da215a9986
     "axios": {
       "version": "0.27.2",
       "resolved": "https://registry.npmmirror.com/axios/-/axios-0.27.2.tgz",
@@ -2750,6 +2792,8 @@
       "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
       "dev": true
     },
+<<<<<<< HEAD
+=======
     "base": {
       "version": "0.11.2",
       "resolved": "https://registry.npmmirror.com/base/-/base-0.11.2.tgz",
@@ -2765,6 +2809,7 @@
         "pascalcase": "^0.1.1"
       }
     },
+>>>>>>> 33a1a8d1a265418b200ca2c39eb854da215a9986
     "base64-js": {
       "version": "1.5.1",
       "resolved": "https://registry.npmmirror.com/base64-js/-/base64-js-1.5.1.tgz",
@@ -3018,6 +3063,8 @@
       "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==",
       "dev": true
     },
+<<<<<<< HEAD
+=======
     "cache-base": {
       "version": "1.0.1",
       "resolved": "https://registry.npmmirror.com/cache-base/-/cache-base-1.0.1.tgz",
@@ -3035,6 +3082,7 @@
         "unset-value": "^1.0.0"
       }
     },
+>>>>>>> 33a1a8d1a265418b200ca2c39eb854da215a9986
     "call-bind": {
       "version": "1.0.2",
       "resolved": "https://registry.npmmirror.com/call-bind/-/call-bind-1.0.2.tgz",
@@ -10242,12 +10290,15 @@
       "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
       "dev": true
     },
+<<<<<<< HEAD
+=======
     "strict-uri-encode": {
       "version": "1.1.0",
       "resolved": "https://registry.npmmirror.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz",
       "integrity": "sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ==",
       "dev": true
     },
+>>>>>>> 33a1a8d1a265418b200ca2c39eb854da215a9986
     "string-width": {
       "version": "4.2.3",
       "resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz",
@@ -10259,6 +10310,8 @@
         "strip-ansi": "^6.0.1"
       }
     },
+<<<<<<< HEAD
+=======
     "string.prototype.trim": {
       "version": "1.2.7",
       "resolved": "https://registry.npmmirror.com/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz",
@@ -10292,6 +10345,7 @@
         "es-abstract": "^1.20.4"
       }
     },
+>>>>>>> 33a1a8d1a265418b200ca2c39eb854da215a9986
     "string_decoder": {
       "version": "1.3.0",
       "resolved": "https://registry.npmmirror.com/string_decoder/-/string_decoder-1.3.0.tgz",

+ 32 - 16
src/api/classifyManage/itemInformation.js

@@ -7,20 +7,32 @@ export async function getList (data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
-// // 物品信息保存
-// export const informationAdd = (data) => {
-//   return http.asyncCall('/information/add', data, 'post', 'json');
-// };
+// 物品信息保存
+export async function informationAdd (data) {
+  const res = await request.post('/main/category/add', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 
-// // 物品信息编辑
-// export const informationEdit = (data) => {
-//   return http.asyncCall('/information/edit', data, 'post', 'json');
-// };
+// 物品信息编辑
+export async function informationEdit (data) {
+  const res = await request.post('/main/category/edit', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 
-// // 物品信息详情
-// export const getDetails = (data) => {
-//   return http.asyncCall(`/information/info/${data.id}`, {}, 'get');
-// };
+// 物品信息详情
+export async function getDetails (id) {
+  const res = await request.get(`/category/info/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 
 // 物品信息删除
 export async function removeItem (id) {
@@ -31,7 +43,11 @@ export async function removeItem (id) {
   return Promise.reject(new Error(res.data.message));
 }
 
-// // 物品信息获取编码
-// export const getOrderNo = (data) => {
-//   return http.asyncCall(`/information/createOrderNo/${data.prefix}`, {}, 'get');
-// };
+// 物品信息获取编码
+export async function getOrderNo (prefix) {
+  const res = await request.get(`/main/category/createOrderNo/${prefix}`, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 58 - 0
src/api/ledgerAssets/boat.js

@@ -0,0 +1,58 @@
+import request from '@/utils/request';
+
+
+// 获取类别实体分页
+export async function getBoatList (data) {
+  let par = new URLSearchParams(data);
+  const res = await request.get(`/main/category/pageSubstance?` + par, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+// 根据父级id查分类树
+export async function getTreeByPid (parentId) {
+  const res = await request.get(`/main/categoryLevel/getTreeByPid/${parentId}`);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 根据类型查分类树
+export async function getTreeByType (type) {
+  const res = await request.get(`/main/categoryLevel/getTreeByType/${type}`);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 删除分类
+export async function deleteCategory (id) {
+  const res = await request.get(`/main/categoryLevel/delete/${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}`);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 8 - 0
src/components/AssetTree/index.vue

@@ -7,8 +7,10 @@
       :node-key="nodeKey"
       ref="tree"
       :highlight-current="true"
+      :expand-on-click-node="false"
       @node-click="handleNodeClick"
       v-bind="$attrs"
+      :default-expand-all="defaultExpandAll"
     >
     </el-tree>
   </div>
@@ -35,6 +37,12 @@
           };
         }
       },
+      defaultExpandAll: {
+        type: Boolean,
+        default: function () {
+          return true
+        }
+      },
       // 初始请求treeList
       init: {
         type: Boolean,

+ 3 - 1
src/enum/dict.js

@@ -1,6 +1,8 @@
 export default {
   类型用途: 'type_use',
+  分类编号: 'classify_no',
   分隔符: 'separate',
   任务类型: 'taskCategory',
-  流程分类: 'processCategory'
+  流程分类: 'processCategory',
+  角度: 'angle'
 };

+ 2 - 2
src/router/routes.js

@@ -24,8 +24,8 @@ export const routes = [
     component: () => import('@/views/exception/404/index.vue')
   }
   // {
-  //   path: '/codeManagement/details',
-  //   component: () => import('@/views/codeManagement/details.vue'),
+  //   path: '/system/role',
+  //   component: () => import('@/views/system/role/index.vue'),
   //   meta: { title: '编码信息' }
   // }
 ];

+ 191 - 681
src/views/classifyManage/itemInformation/add.vue

@@ -1,361 +1,70 @@
 <template>
-  <div class="content-height p20">
-    <div class="page-title">
-      <el-page-header @back="goBack">
-        <div slot="content" class="pageContent">
-          <div>{{ pageTitle }}</div>
-          <el-form class="topform">
-            <el-form-item label="物品类型" label-width="70px">
-              <el-select
-                v-model="defaultNum"
-                placeholder="请选择"
-                @change="chooseItem"
-                :disabled="uneditable"
-              >
-                <el-option
-                  v-for="item in typeList"
-                  :key="item.id"
-                  :label="item.value"
-                  :value="item.prefix"
+  <div class="ele-body">
+    <el-card shadow="never">
+      <div class="page-title">
+        <el-page-header @back="goBack">
+          <div slot="content" class="pageContent">
+            <div>{{ pageTitle }}</div>
+            <el-form class="topform">
+              <el-form-item label="物品类型" label-width="70px">
+                <el-select
+                  v-model="defaultNum"
+                  placeholder="请选择"
+                  :disabled="uneditable"
                 >
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-form>
-        </div>
-      </el-page-header>
-    </div>
-    <div class="table-container">
-      <div class="tree-col">
-        <ItemForm
-          ref="itemFormRef"
-          :itemForm="itemForm"
-          :defaultNum="defaultNum"
-          :classList="[]"
-        />
+                  <el-option
+                    v-for="item in typeList"
+                    :key="item.id"
+                    :label="item.value"
+                    :value="item.code"
+                    @click.native="chooseItem(item)"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-form>
+          </div>
+        </el-page-header>
       </div>
-      <div class="attribute-row">
-        <RowForm
-          ref="customFormRef"
-          :itemForm="itemForm"
-          :defaultNum="defaultNum"
-        />
-        <div
-          class="row-table"
-          v-if="
-            defaultNum != 'w08' && defaultNum != 'w02' && defaultNum != 'w03'
-          "
-        >
-          <el-tabs v-model="activeName" type="card">
-            <el-tab-pane
-              label="匹配产品"
-              name="product"
-              v-if="defaultNum == 'w06' || defaultNum == 'w04'"
-            >
-              <el-button type="primary" @click="clickAdd([4], '选择产品')"
-                >添加</el-button
-              >
-              <el-table
-                :data="productData"
-                class="table-box"
-                :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
-              >
-                <el-table-column type="index" label="序号" width="50">
-                </el-table-column>
-                <el-table-column prop="informationCode" label="物品编码">
-                </el-table-column>
-                <el-table-column
-                  prop="informationName"
-                  label="物品名称"
-                  show-overflow-tooltip
-                >
-                </el-table-column>
-                <el-table-column prop="brandNum" label="牌号">
-                </el-table-column>
-                <el-table-column prop="modelType" label="型号">
-                </el-table-column>
-                <el-table-column
-                  label="物品类型"
-                  prop="classificationCode"
-                  :formatter="classificationCodeFormatter"
-                >
-                </el-table-column>
-                <el-table-column
-                  prop="classificationUrl"
-                  show-overflow-tooltip
-                  label="分类"
-                >
-                </el-table-column>
-                <el-table-column label="操作">
-                  <template slot-scope="scope">
-                    <el-button
-                      type="text"
-                      @click="handleDelete(scope.$index, scope.row)"
-                      >删除</el-button
-                    >
-                  </template>
-                </el-table-column>
-              </el-table>
-            </el-tab-pane>
-            <el-tab-pane
-              label="匹配模具"
-              name="mould"
-              v-if="defaultNum == 'w01' || defaultNum == 'w07'"
-            >
-              <el-button type="primary" @click="clickAdd([6], '选择模具')"
-                >添加</el-button
-              >
-              <el-table
-                :data="mouldData"
-                class="table-box"
-                :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
-              >
-                <el-table-column type="index" label="序号" width="50">
-                </el-table-column>
-                <el-table-column
-                  prop="informationCode"
-                  label="物品编码"
-                  width="120"
-                >
-                </el-table-column>
-                <el-table-column
-                  prop="informationName"
-                  label="物品名称"
-                  show-overflow-tooltip
-                >
-                </el-table-column>
-                <el-table-column prop="brandNum" label="牌号">
-                </el-table-column>
-                <el-table-column prop="modelType" label="型号">
-                </el-table-column>
-                <el-table-column
-                  prop="shrinkageCoefficient"
-                  label="收缩系数"
-                  :formatter="shrinkFormatter"
-                >
-                </el-table-column>
-                <el-table-column
-                  prop="dieBodyModel"
-                  width="120"
-                  label="大模体型号"
-                  :formatter="modleFormatter"
-                >
-                </el-table-column>
-                <el-table-column
-                  label="物品类型"
-                  prop="classificationCode"
-                  :formatter="classificationCodeFormatter"
-                >
-                </el-table-column>
-                <el-table-column
-                  prop="classificationUrl"
-                  show-overflow-tooltip
-                  label="分类"
-                >
-                </el-table-column>
-                <el-table-column label="操作">
-                  <template slot-scope="scope">
-                    <el-button
-                      type="text"
-                      @click="handleDelete(scope.$index, scope.row)"
-                      >删除</el-button
-                    >
-                  </template>
-                </el-table-column>
-              </el-table>
-            </el-tab-pane>
-            <el-tab-pane
-              label="匹配备品备件"
-              name="part"
-              v-if="defaultNum == 'w01'"
-            >
-              <el-button type="primary" @click="clickAdd([7], '选择备品备件')"
-                >添加</el-button
-              >
-              <el-table
-                :data="partData"
-                class="table-box"
-                :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
-              >
-                <el-table-column type="index" label="序号" width="50">
-                </el-table-column>
-                <el-table-column prop="informationCode" label="物品编码">
-                </el-table-column>
-                <el-table-column
-                  prop="informationName"
-                  label="物品名称"
-                  show-overflow-tooltip
-                >
-                </el-table-column>
-                <el-table-column prop="modelType" label="型号">
-                </el-table-column>
-                <el-table-column
-                  label="物品类型"
-                  prop="classificationCode"
-                  :formatter="classificationCodeFormatter"
-                >
-                </el-table-column>
-                <el-table-column
-                  prop="classificationUrl"
-                  show-overflow-tooltip
-                  label="分类"
-                >
-                </el-table-column>
-                <el-table-column label="操作">
-                  <template slot-scope="scope">
-                    <el-button
-                      type="text"
-                      @click="handleDelete(scope.$index, scope.row)"
-                      >删除</el-button
-                    >
-                  </template>
-                </el-table-column>
-              </el-table>
-            </el-tab-pane>
-            <el-tab-pane label="BOM表" name="bom" v-if="defaultNum == 'w07'">
-              <div class="bom-top">
-                <el-button type="primary" @click="clickAdd([3], '选择物料')"
-                  >添加</el-button
-                >
-                <div class="top-input">
-                  <span>基本数量</span>
-                  <el-input
-                    class="input-box"
-                    @input="handleEdit"
-                    v-model="itemForm.basicNum"
-                    placeholder="请输入"
-                  ></el-input>
-                  <span>{{ itemForm.measuringUnit }}</span>
-                </div>
-              </div>
-              <el-table
-                :data="bomData"
-                class="table-box"
-                :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
-              >
-                <el-table-column type="index" label="序号" width="50">
-                </el-table-column>
-                <el-table-column
-                  prop="informationCode"
-                  label="物品编码"
-                  width="120"
-                >
-                </el-table-column>
-                <el-table-column
-                  prop="informationName"
-                  label="物品名称"
-                  show-overflow-tooltip
-                >
-                </el-table-column>
-                <el-table-column prop="brandNum" label="牌号">
-                </el-table-column>
-                <el-table-column
-                  label="物品类型"
-                  prop="classificationCode"
-                  :formatter="classificationCodeFormatter"
-                >
-                </el-table-column>
-                <el-table-column
-                  prop="classificationUrl"
-                  label="分类"
-                  show-overflow-tooltip
-                >
-                </el-table-column>
-                <el-table-column prop="num" label="数量" width="120">
-                  <template slot-scope="scope">
-                    <el-input
-                      type="number"
-                      v-model="scope.row.num"
-                      placeholder="请输入"
-                      oninput="value=value.replace(/[^0-9.]/g,'')"
-                    ></el-input>
-                  </template>
-                </el-table-column>
-                <el-table-column label="计量单位" prop="measuringUnit">
-                </el-table-column>
-                <el-table-column label="操作">
-                  <template slot-scope="scope">
-                    <el-button
-                      type="text"
-                      @click="handleDelete(scope.$index, scope.row)"
-                      >删除</el-button
-                    >
-                  </template>
-                </el-table-column>
-              </el-table>
-            </el-tab-pane>
-            <el-tab-pane
-              label="匹配设备"
-              name="facility"
-              v-if="defaultNum == 'w04' || defaultNum == 'w05'"
-            >
-              <el-button type="primary" @click="clickAdd([1], '选择设备')"
-                >添加</el-button
-              >
-              <el-table
-                :data="facilityData"
-                class="table-box"
-                :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
-              >
-                <el-table-column type="index" label="序号" width="50">
-                </el-table-column>
-                <el-table-column prop="informationCode" label="物品编码">
-                </el-table-column>
-                <el-table-column
-                  prop="informationName"
-                  label="物品名称"
-                  show-overflow-tooltip
-                >
-                </el-table-column>
-                <el-table-column prop="modelType" label="型号">
-                </el-table-column>
-                <el-table-column
-                  label="物品类型"
-                  prop="classificationCode"
-                  :formatter="classificationCodeFormatter"
-                >
-                </el-table-column>
-                <el-table-column
-                  prop="classificationUrl"
-                  label="分类"
-                  show-overflow-tooltip
-                >
-                </el-table-column>
-                <el-table-column label="操作">
-                  <template slot-scope="scope">
-                    <el-button
-                      type="text"
-                      @click="handleDelete(scope.$index, scope.row)"
-                      >删除</el-button
-                    >
-                  </template>
-                </el-table-column>
-              </el-table>
-            </el-tab-pane>
-          </el-tabs>
+      <div class="table-container">
+        <div class="tree-col">
+          <ItemForm
+            ref="itemFormRef"
+            :itemForm="itemForm"
+            :defaultNum="defaultNum"
+          />
         </div>
-        <div class="page-footer-btn mt20">
-          <el-button @click="goBack">取消</el-button>
-          <el-button type="primary" @click="submit">确定</el-button>
+        <div class="attribute-row">
+          <RowForm
+            ref="customFormRef"
+            :itemForm="itemForm"
+            :defaultNum="defaultNum"
+          />
+          <div
+            class="row-table"
+            v-if="defaultNum != '8' && defaultNum != '2' && defaultNum != '5'"
+          >
+            <ItemMatch
+              ref="itemMatchRef"
+              :defaultNum="defaultNum"
+              :typeList="typeList"
+            ></ItemMatch>
+          </div>
+          <div class="page-footer-btn mt20">
+            <el-button @click="goBack">取消</el-button>
+            <el-button type="primary" @click="submit">确定</el-button>
+          </div>
         </div>
       </div>
-    </div>
-
-    <!-- 选择添加 -->
-    <AddDialog
-      ref="addDialogRef"
-      @submit="selectedEquipment"
-      :typeValue="typeValue"
-      :dialogTitle="dialogTitle"
-      :mapList="mapList"
-    />
+    </el-card>
   </div>
 </template>
 
 <script>
   import ItemForm from './components/ItemForm';
   import RowForm from './components/RowForm';
-  import AddDialog from './components/AddDialog.vue';
+  import ItemMatch from './components/item-match';
+  import dictMixins from '@/mixins/dictMixins';
   import {
     informationAdd,
     getDetails,
@@ -363,38 +72,11 @@
     getOrderNo
   } from '@/api/classifyManage/itemInformation';
   export default {
-    components: { ItemForm, RowForm, AddDialog },
-    data() {
+    components: { ItemForm, RowForm, ItemMatch },
+    mixins: [dictMixins],
+    data () {
       return {
         pageTitle: '',
-        typeList: [
-          {
-            id: 1,
-            value: 'w01  生产设备',
-            name: '生产设备',
-            prefix: 'w01',
-            code: 1
-          },
-          { id: 2, value: 'w02  舟皿', name: '舟皿', prefix: 'w02', code: 2 },
-          {
-            id: 3,
-            value: 'w03  周转车',
-            name: '周转车',
-            prefix: 'w03',
-            code: 5
-          },
-          { id: 4, value: 'w04  模具', name: '模具', prefix: 'w04', code: 6 },
-          {
-            id: 5,
-            value: 'w05  备品备件',
-            name: '备品备件',
-            prefix: 'w05',
-            code: 7
-          },
-          { id: 6, value: 'w06  原料', name: '物料', prefix: 'w06', code: 3 },
-          { id: 7, value: 'w07  产品', name: '产品', prefix: 'w07', code: 4 },
-          { id: 8, value: 'w08  耗材', name: '耗材', prefix: 'w08', code: 8 }
-        ],
         itemForm: {
           classificationUrlId: [],
           addList: [],
@@ -406,28 +88,36 @@
           expirationDateUnit: 'minute',
           takeStockPattern: 1
         },
-        activeName: 'mould',
-        productData: [],
-        mouldData: [],
-        partData: [],
-        bomData: [],
-        facilityData: [],
-        bomNumber: null,
-        defaultNum: 'w01',
+        defaultNum: '1',
         selectNode: null,
         classList: [],
         changeData: [],
         urlIdList: [],
         requestData: {},
-        typeValue: [],
-        mapList: [],
         uneditable: false,
-        currentItem: null,
-        dialogTitle: '',
         newCode: ''
       };
     },
-    created() {
+    computed: {
+      typeList () {
+        const noList = this.dict[this.dictEnum['分类编号']] || [];
+
+        return (this.dict[this.dictEnum['类型用途']] || []).map((item) => {
+          const obj =
+            noList.find((itm) => itm.dictCode === item.dictCode) || {};
+          return {
+            ...item,
+            value: `${obj.dictValue} ${item.dictValue}`,
+            name: item.dictValue,
+            prefix: obj.dictValue,
+            code: item.dictCode
+          };
+        });
+      }
+    },
+    created () {
+      this.requestDict('分类编号');
+      this.requestDict('类型用途');
       this.pageTitle = this.$route.query.pageTitle;
       if (this.pageTitle == '新建物品') {
         this.selectNode = JSON.parse(this.$route.query.selectNode);
@@ -436,22 +126,10 @@
           this.itemForm.classificationId = this.selectNode.id;
           let code = 1;
           if (this.selectNode.id != '0') {
-            code = this.selectNode.type;
-            this.typeList.map((item) => {
-              if (item.code == code) {
-                this.currentItem = item;
-                this.defaultNum = item.prefix;
-                this.setDefault(this.defaultNum);
-              }
-            });
-          } else {
-            this.currentItem = {
-              id: 1,
-              value: 'w01  生产设备',
-              prefix: 'w01',
-              code: 1
-            };
+            this.defaultNum = this.selectNode.type;
+            this.setDefault(this.defaultNum);
           }
+          this.itemForm.urlIdList = this.selectNode.urlIdList;
           this.getTreeData(code);
         }
       } else {
@@ -465,8 +143,8 @@
       }
     },
     methods: {
-      async getOrderCode() {
-        const res = await getOrderNo({ prefix: this.defaultNum });
+      async getOrderCode () {
+        const res = await getOrderNo(this.defaultNum);
         if (res.success) {
           this.newCode = res.data;
           this.$set(this.itemForm, 'itemCode', res.data.substring(3));
@@ -474,27 +152,18 @@
         }
       },
 
-      getCode(code) {
-        this.typeList.map((item) => {
-          if (item.code == code) {
-            this.defaultNum = item.prefix;
-            this.setDefault(this.defaultNum);
-          }
-        });
-      },
-
       // 在 Input 值改变时触发
-      handleEdit(e) {
+      handleEdit (e) {
         let value = e.replace(/^(0+)|[^\d]+/g, ''); // 以0开头或者输入非数字,会被替换成空
         value = value.replace(/(\d{15})\d*/, '$1'); // 最多保留15位整数
       },
-      goBack() {
+      goBack () {
         this.$router.go(-1);
       },
 
       // 获取详情
-      async getDetilInfo(id) {
-        const res = await getDetails({ id: id });
+      async getDetilInfo (id) {
+        const res = await getDetails(id);
         if (res.success) {
           this.defaultNum = res.data.classificationCode;
           this.chooseItem(res.data.classificationCode);
@@ -533,31 +202,28 @@
             : 'false';
           this.itemForm.isUnpack = res.data.isUnpack ? 'true' : 'false';
           for (const key in this.itemForm.informationRelationMap) {
-            this.matchList(key, this.itemForm.informationRelationMap);
+            this.$refs.itemMatchRef &&
+              this.$refs.itemMatchRef.matchList(
+                key,
+                this.itemForm.informationRelationMap
+              );
           }
         }
       },
 
       // 改变物品类型
-      chooseItem(val) {
-        if (this.currentItem && this.currentItem.prefix != val) {
-          this.initItemForm();
-          this.$refs.itemFormRef.$refs.formName.resetFields();
-          this.getOrderCode();
-        }
-        this.typeList.map((item) => {
-          if (item.prefix == val) {
-            this.currentItem = item;
-            this.defaultNum = item.prefix;
-            this.itemForm.classificationCode = this.defaultNum;
-            this.selectNode = null;
-            this.getTreeData(item.code);
-          }
-        });
-        this.setDefault(this.defaultNum);
+      chooseItem (item) {
+        this.defaultNum = item.code;
+        this.initItemForm();
+        this.$refs.itemFormRef.$refs.formName.resetFields();
+        this.getOrderCode();
+        this.itemForm.classificationCode = item.prefix;
+        this.selectNode = null;
+        this.getTreeData(item.code);
+        this.setDefault(item.code);
       },
 
-      submit() {
+      submit () {
         const a1 = new Promise((resolve, reject) => {
           this.$refs.itemFormRef.validateForm((valid) => {
             if (valid) resolve();
@@ -569,7 +235,8 @@
           });
         });
         Promise.all([a1, a2]).then(() => {
-          this.mapAddList();
+          this.$refs.itemMatchRef && this.$refs.itemMatchRef.mapAddList();
+
           this.requestData = this.itemForm;
           const { pathName, pathId } = this.$refs.itemFormRef.getText();
           this.requestData.classificationUrl = pathName;
@@ -594,11 +261,10 @@
           this.requestData.univalence = this.itemForm.univalence
             ? this.itemForm.univalence
             : null;
-          this.mapList.map((item) => {
-            item.informationId = item.id;
-            delete item.id;
-          });
-          this.requestData.informationRelation = this.mapList;
+          this.requestData.informationRelation =
+            (this.$refs.itemMatchRef && this.$refs.itemMatchRef.getMapList()) ||
+            [];
+
           if (this.pageTitle == '编辑物品') {
             this.requestData.mainInformationId = this.$route.query.id;
             delete this.requestData.informationRelationMap;
@@ -636,77 +302,7 @@
         });
       },
 
-      handleDelete(index, row) {
-        this.$confirm(`确认删除[${row.informationName}]吗?`)
-          .then(async () => {
-            switch (this.activeName) {
-              case 'product': {
-                this.productData.splice(index, 1);
-                break;
-              }
-              case 'mould': {
-                this.mouldData.splice(index, 1);
-                break;
-              }
-              case 'part': {
-                this.partData.splice(index, 1);
-                break;
-              }
-              case 'bom': {
-                this.bomData.splice(index, 1);
-                break;
-              }
-              case 'facility': {
-                this.facilityData.splice(index, 1);
-                break;
-              }
-              default:
-                break;
-            }
-            this.mapAddList();
-          })
-          .catch(() => {});
-      },
-
-      //点击添加打开弹窗
-      clickAdd(val, name) {
-        this.$refs.addDialogRef.equipmentdialog = true;
-        if (val) {
-          this.typeValue = val;
-          this.dialogTitle = name;
-          this.mapAddList();
-        }
-      },
-
-      // 选择的设备
-      selectedEquipment(val) {
-        switch (this.activeName) {
-          case 'product': {
-            this.productData = val;
-            break;
-          }
-          case 'mould': {
-            this.mouldData = val;
-            break;
-          }
-          case 'part': {
-            this.partData = val;
-            break;
-          }
-          case 'bom': {
-            this.bomData = val;
-            break;
-          }
-          case 'facility': {
-            this.facilityData = val;
-            break;
-          }
-          default:
-            break;
-        }
-      },
-
-      async getTreeData(code) {
+      async getTreeData (code) {
         // try {
         //   const res = await common.getClassify({
         //     type: code,
@@ -730,7 +326,7 @@
         // } catch (error) {}
       },
 
-      convertTreeData(data) {
+      convertTreeData (data) {
         this.changeData = data;
         for (let i = 0; i < this.changeData.length; i++) {
           if (this.changeData[i].children != undefined) {
@@ -742,7 +338,7 @@
       },
 
       // 子节点处理
-      deepEach(parentId) {
+      deepEach (parentId) {
         this.changeData.map((item, index) => {
           if (item.id == parentId) {
             this.urlIdList.push(item.id);
@@ -751,106 +347,11 @@
         });
       },
 
-      setDefault(val) {
-        switch (val) {
-          case 'w06': {
-            this.activeName = 'product';
-            break;
-          }
-          case 'w01': {
-            this.activeName = 'mould';
-            break;
-          }
-          case 'w07': {
-            this.activeName = 'mould';
-            break;
-          }
-          case 'w04': {
-            this.activeName = 'product';
-            break;
-          }
-          case 'w05': {
-            this.activeName = 'facility';
-            break;
-          }
-          default:
-            break;
-        }
-      },
-
-      // 物品类型格式化
-      classificationCodeFormatter(row) {
-        let itemName = '';
-        this.typeList.map((item) => {
-          if (item.prefix == row.classificationCode) {
-            itemName = item.name;
-          }
-        });
-        return itemName;
-      },
-
-      // 收缩系数格式化
-      shrinkFormatter(row) {
-        let shrink = '';
-        let extendField = JSON.parse(row.extendField);
-        if (extendField.hasOwnProperty('shrinkageCoefficient')) {
-          shrink = extendField.shrinkageCoefficient;
-        }
-        return shrink;
-      },
-
-      modleFormatter(row) {
-        let modle = '';
-        let extendField = JSON.parse(row.extendField);
-        if (extendField.hasOwnProperty('dieBodyModel')) {
-          modle = extendField.dieBodyModel;
-        }
-        return modle;
-      },
-
-      mapAddList() {
-        this.mapList = [];
-        if (this.defaultNum == 'w01') {
-          this.mapList = this.partData.concat(this.mouldData);
-        } else if (this.defaultNum == 'w04') {
-          this.mapList = this.facilityData.concat(this.productData);
-        } else if (this.defaultNum == 'w05') {
-          this.mapList = this.facilityData;
-        } else if (this.defaultNum == 'w06') {
-          this.mapList = this.productData;
-        } else if (this.defaultNum == 'w07') {
-          this.mapList = this.mouldData.concat(this.bomData);
-        }
-      },
-
-      matchList(key, data) {
-        switch (key) {
-          case 'w01': {
-            this.facilityData = data[key];
-            break;
-          }
-          case 'w04': {
-            this.mouldData = data[key];
-            break;
-          }
-          case 'w05': {
-            this.partData = data[key];
-            break;
-          }
-          case 'w07': {
-            this.productData = data[key];
-            break;
-          }
-          case 'w06': {
-            this.bomData = data[key];
-            break;
-          }
-          default:
-            break;
-        }
+      setDefault (val) {
+        this.$refs.itemMatchRef && this.$refs.itemMatchRef.setDefault(val);
       },
 
-      initItemForm() {
+      initItemForm () {
         this.itemForm = {
           classificationUrlId: [],
           addList: [],
@@ -866,90 +367,99 @@
 </script>
 
 <style lang="scss" scoped>
-  :deep(.page-title) {
-    border-bottom: 1px solid #eaeefb;
-    padding-bottom: 8px;
-    margin-bottom: 16px;
-    display: flex;
-    align-items: center;
-    .el-page-header__left {
+  .ele-body {
+    :deep(.page-title) {
+      border-bottom: 1px solid #eaeefb;
+      padding-bottom: 8px;
+      margin-bottom: 16px;
       display: flex;
       align-items: center;
+      .el-page-header__left {
+        display: flex;
+        align-items: center;
+      }
+      .pageContent {
+        display: flex;
+        align-items: center;
+        font-size: 18px;
+        color: #303133;
+        .topform {
+          // margin: 5px 0 0 30px;
+          margin-left: 30px;
+          display: flex;
+          align-items: center;
+
+          .el-form-item {
+            margin-bottom: 0;
+          }
+        }
+      }
     }
-    .pageContent {
+    .table-container {
+      flex: 1;
       display: flex;
-      align-items: center;
-      font-size: 18px;
-      color: #303133;
-      .topform {
-        margin: 5px 0 0 30px;
+      overflow: hidden;
+      .tree-col {
+        margin-right: 10px;
+        width: 30%;
+        min-width: 250px;
+        overflow: auto;
+        padding: 20px 20px 20px 0px;
+        background-color: #fff;
+        margin-top: 10px;
+        border: 1px solid #e6ebf5;
+        border-radius: 4px;
+        box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
       }
     }
-  }
-  .table-container {
-    flex: 1;
-    display: flex;
-    overflow: hidden;
-    .tree-col {
-      margin-right: 10px;
-      width: 30%;
-      min-width: 250px;
-      overflow: auto;
-      padding: 20px 20px 20px 0px;
-      background-color: #fff;
+
+    :deep(.attribute-row) {
+      padding: 20px 5px;
+      background: #fff;
       margin-top: 10px;
+      overflow: auto;
+      width: 70%;
       border: 1px solid #e6ebf5;
       border-radius: 4px;
       box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
-    }
-  }
-
-  :deep(.attribute-row) {
-    padding: 20px 5px;
-    background: #fff;
-    margin-top: 10px;
-    overflow: auto;
-    width: 70%;
-    border: 1px solid #e6ebf5;
-    border-radius: 4px;
-    box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
-    position: relative;
-    .row-table {
-      width: 100%;
-      margin: 20px auto 80px;
-      .table-box {
-        width: 100%;
-        margin: 10px auto;
-        // max-height:400px;
-        // overflow-y: auto;
-      }
-      .bom-top {
+      position: relative;
+      .row-table {
         width: 100%;
-        display: flex;
-        align-items: center;
-        justify-content: flex-start;
-        .top-input {
-          margin-left: 20px;
+        margin: 20px auto 80px;
+        .table-box {
+          width: 100%;
+          margin: 10px auto;
+          // max-height:400px;
+          // overflow-y: auto;
+        }
+        .bom-top {
+          width: 100%;
           display: flex;
           align-items: center;
           justify-content: flex-start;
-          .input-box {
-            width: 150px;
-            margin: 0 10px;
+          .top-input {
+            margin-left: 20px;
+            display: flex;
+            align-items: center;
+            justify-content: flex-start;
+            .input-box {
+              width: 150px;
+              margin: 0 10px;
+            }
           }
         }
       }
-    }
-    .page-footer-btn {
-      background: #fff;
-      z-index: 1;
-      position: absolute;
-      bottom: 20px;
-      right: 0px;
-      text-align: right;
-      width: 100%;
-      border-top: 1px solid #e6ebf5;
-      padding: 20px 20px 0 0;
+      .page-footer-btn {
+        background: #fff;
+        z-index: 1;
+        position: absolute;
+        bottom: 20px;
+        right: 0px;
+        text-align: right;
+        width: 100%;
+        border-top: 1px solid #e6ebf5;
+        padding: 20px 20px 0 0;
+      }
     }
   }
 </style>

+ 31 - 40
src/views/classifyManage/itemInformation/components/AddDialog.vue

@@ -38,15 +38,16 @@
             :type="typeValue"
           /> -->
           <AssetTree
-            :data="treeList"
             :props="defaultProps"
             :default-expanded-keys="defaultExpandedKeys"
             :expand-on-click-node="false"
-            v-loading="treeLoading"
             node-key="id"
+            paramsType="type"
+            :type="typeValue"
+            :init="false"
             ref="tree"
             :highlight-current="true"
-            @node-click="handleNodeClick"
+            @handleNodeClick="handleNodeClick"
           />
         </el-col>
         <el-col :span="18" class="table_col">
@@ -137,8 +138,8 @@
     components: { AssetTree },
     props: {
       typeValue: {
-        type: Array,
-        default: []
+        type: String,
+        default: ''
       },
       mapList: {
         type: Array,
@@ -149,7 +150,7 @@
         default: ''
       }
     },
-    data() {
+    data () {
       return {
         treeLoading: false,
         equipmentdialog: false,
@@ -172,86 +173,76 @@
       };
     },
     watch: {
-      equipmentdialog(val) {
+      equipmentdialog (val) {
         if (val) {
-          if (this.tableData.length) this.$refs.tableRef.clearSelection();
           this.$nextTick(() => {
-            this.mapList.forEach((item) => {
-              const row = this.tableData.find((i) => i.id === item.id);
-              if (row) {
-                this.$refs.tableRef.toggleRowSelection(row, true);
-              }
+            this.$refs.tree.getTreeData().then(() => {
+              if (this.tableData.length) this.$refs.tableRef.clearSelection();
+              this.$nextTick(() => {
+                this.mapList.forEach((item) => {
+                  const row = this.tableData.find((i) => i.id === item.id);
+                  if (row) {
+                    this.$refs.tableRef.toggleRowSelection(row, true);
+                  }
+                });
+              });
             });
           });
           // if(this.tableData.length)  this.$refs.tableRef.clearSelection()
         }
       },
-      typeValue(val) {
+      typeValue (val) {
         if (val) {
           this.currentKey = null;
         }
-      },
-      mapList(val) {
-        if (val) {
-          // if(this.tableData.length)  this.$refs.tableRef.clearSelection()
-          // this.$nextTick(() => {
-          //     this.mapList.forEach(item => {
-          //       const row = this.tableData.find(i => i.id === item.id)
-          //       console.log('row',row)
-          //       if (row) {
-          //         this.$refs.tableRef.toggleRowSelection(row, true)
-          //       }
-          //     })
-          // })
-        }
       }
     },
     methods: {
-      handleClose() {
+      handleClose () {
         this.equipmentdialog = false;
         this.tableSelectionList = [];
       },
 
-      handleCurrent(page) {
+      handleCurrent (page) {
         this.pagination.page = page;
         this.handleList();
       },
-      handleSize(size) {
+      handleSize (size) {
         this.pagination.page = 1;
         this.pagination.size = size;
         this.handleList();
       },
 
-      handleSelectionChange(val) {
+      handleSelectionChange (val) {
         this.tableSelectionList = val;
       },
       // handleCurSelectionChange (selection, row) {
 
       // },
 
-      toDelete(val) {
+      toDelete (val) {
         console.log('触发删除', val);
       },
 
-      getRowKeys(row) {
+      getRowKeys (row) {
         return row.id;
       },
 
       // 确定
-      selected() {
+      selected () {
         this.$emit('submit', this.tableSelectionList);
         this.handleClose();
       },
 
       // 树点击事件
-      handleNodeClick(data, node) {
+      handleNodeClick (data, node) {
         if (data.id === this.currentTreeData.id) return;
         this.currentTreeData = data;
         this.searchForm.classificationId = data.id;
         this.handleList();
       },
 
-      async handleList() {
+      async handleList () {
         const params = {
           ...this.searchForm,
           ...this.pagination
@@ -273,7 +264,7 @@
       },
 
       // 弹窗 - 按关键字搜索
-      searchByKeyWords() {
+      searchByKeyWords () {
         if (!this.currentTreeData) {
           this.$message.warning('请先选择设备!');
           return;
@@ -282,14 +273,14 @@
         this.handleList();
       },
       // 重置
-      reset() {
+      reset () {
         this.pagination.page = 1;
         this.searchForm.searchKey = '';
         this.handleList();
       },
 
       // 设置默认高亮行
-      setCurrentKey(id) {
+      setCurrentKey (id) {
         this.currentKey = id;
         this.$refs.tree.setCurrentKey(this.currentKey);
       }

+ 16 - 50
src/views/classifyManage/itemInformation/components/ItemForm.vue

@@ -15,7 +15,6 @@
         :props="defaultProps"
         separator="-"
         filterable
-        @change="chooseClassify"
         ref="cascader"
       >
       </el-cascader>
@@ -132,6 +131,7 @@
 </template>
 
 <script>
+  import { getTreeByPid, getTreeByType } from '@/api/classifyManage';
   export default {
     props: {
       itemForm: {
@@ -140,15 +140,11 @@
       },
       defaultNum: {
         type: String,
-        default: 'w01'
-      },
-      classList: {
-        type: Array,
-        default: []
+        default: '1'
       }
     },
     components: {},
-    data() {
+    data () {
       let validateCode = (rule, value, callback) => {
         let reg = /[\u4e00-\u9fa5]/;
         // console.log('reg.test(value)',reg.test(value))
@@ -159,6 +155,7 @@
         }
       };
       return {
+        classList: [],
         rules: {
           urlIdList: [
             {
@@ -196,16 +193,6 @@
           { id: 3, value: '月', name: 'month' },
           { id: 4, value: '年', name: 'year' }
         ],
-        typeList: [
-          { id: 1, value: 'w01  原料', prefix: 'w01' },
-          { id: 2, value: 'w02  耗材', prefix: 'w02' },
-          { id: 3, value: 'w03  设备', prefix: 'w03' },
-          { id: 4, value: 'w04  产品', prefix: 'w04' },
-          { id: 5, value: 'w05  舟皿', prefix: 'w05' },
-          { id: 6, value: 'w06  周转车', prefix: 'w06' },
-          { id: 7, value: 'w07  模具', prefix: 'w07' },
-          { id: 8, value: 'w08  备品备件', prefix: 'w08' }
-        ],
         // itemForm:{
         //   priceType:1, dateType:1
         // },
@@ -218,51 +205,30 @@
       };
     },
     watch: {
-      defaultNum(val) {
-        if (val) {
-        }
-      },
-
-      itemForm(val) {},
-
-      classList(val) {
+      classList (val) {
         this.keyValue++;
       }
     },
-    created() {},
+    created () {
+      this.getTreeList();
+    },
     methods: {
-      // // 在 Input 值改变时触发
-      handleEdit(e) {
-        // let value = e.replace(/^(0+)|[^\d]+/g,''); // 以0开头或者输入非数字,会被替换成空
-        // value = value.replace(/(\d{15})\d*/, '$1') // 最多保留15位整数
-        // this.itemForm.expirationDate = value
+      async getTreeList () {
+        const res = await getTreeByPid(0);
+        if (res.code === '0') {
+          this.classList = res.data;
+        }
       },
-
       //子组件接收callback为父组件传过来的next()方法
-      validateForm(callback) {
+      validateForm (callback) {
         // let flag = true;
         //开始表单校验
         this.$refs.formName.validate((valid) => {
           callback(valid);
-          // if (valid) {
-          //   this.itemForm.informationCode = this.defaultNum + this.itemForm.informationCode
-          //   console.log('itemForm',this.itemForm)
-          //   flag = true
-          // } else {
-          //   console.log('error submit!!');
-          //   return false;
-          // }
         });
-        // 如果flag为true,则执行callback()
-        // if (flag) {
-        // callback();
-        // }
       },
 
-      // 选择分类
-      chooseClassify(val) {},
-
-      getText() {
+      getText () {
         // 获取节点下的汉字
         let pathName = this.$refs.cascader
           .getCheckedNodes()[0]
@@ -282,7 +248,7 @@
 </script>
 
 <style lang="scss" scoped>
-  :deep(.formBox .el-form-item) {
+  .formBox :deep(.el-form-item) {
     margin-bottom: 17px;
     .twobox {
       width: 100%;

+ 26 - 26
src/views/classifyManage/itemInformation/components/RowDetail.vue

@@ -3,7 +3,7 @@
     <el-row>
       <el-col
         :span="8"
-        v-if="defaultNum == 'w06' || defaultNum == 'w07' || defaultNum == 'w04'"
+        v-if="defaultNum == '3' || defaultNum == '4' || defaultNum == '6'"
       >
         <el-form-item label="牌号" prop="brandNumber" label-width="60px">
           <span>{{ customForm.brandNum }}</span>
@@ -12,28 +12,28 @@
       <el-col
         :span="8"
         v-if="
-          defaultNum == 'w08' ||
-          defaultNum == 'w01' ||
-          defaultNum == 'w02' ||
-          defaultNum == 'w03' ||
-          defaultNum == 'w05'
+          defaultNum == '8' ||
+          defaultNum == '1' ||
+          defaultNum == '2' ||
+          defaultNum == '5' ||
+          defaultNum == '7'
         "
       >
         <el-form-item label="规格" prop="gg" label-width="60px">
           <span>{{ customForm.specification }}</span>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum != 'w06'">
+      <el-col :span="8" v-if="defaultNum != '3'">
         <el-form-item label="型号" prop="xh" label-width="60px">
           <span>{{ customForm.modelType }}</span>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w03'">
+      <el-col :span="8" v-if="defaultNum == '5'">
         <el-form-item label="材质" prop="xh" label-width="60px">
           <span>{{ extendField.texture }}</span>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w01'">
+      <el-col :span="8" v-if="defaultNum == '1'">
         <el-form-item label="标准产能" prop="bzcn" label-width="85px">
           <span
             >{{
@@ -42,7 +42,7 @@
           >
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w07'">
+      <el-col :span="8" v-if="defaultNum == '4'">
         <el-form-item label="标准单重" prop="bzcn" label-width="85px">
           <span
             >{{
@@ -51,7 +51,7 @@
           >
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w07'">
+      <el-col :span="8" v-if="defaultNum == '4'">
         <el-form-item label="不良品率" prop="bzcn" label-width="85px">
           <span
             >{{
@@ -60,57 +60,57 @@
           >
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w02'">
+      <el-col :span="8" v-if="defaultNum == '2'">
         <el-form-item label="角度" prop="bzcn" label-width="60px">
           <span>{{ extendField.angle }}</span>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w02' || defaultNum == 'w03'">
+      <el-col :span="8" v-if="defaultNum == '2' || defaultNum == '5'">
         <el-form-item label="长" prop="bzcn" label-width="60px">
           <span>{{ extendField.length ? extendField.length : '-' }}mm</span>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w02' || defaultNum == 'w03'">
+      <el-col :span="8" v-if="defaultNum == '2' || defaultNum == '5'">
         <el-form-item label="宽" prop="bzcn" label-width="60px">
           <span>{{ extendField.width ? extendField.width : '-' }}mm</span>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w02' || defaultNum == 'w03'">
+      <el-col :span="8" v-if="defaultNum == '2' || defaultNum == '5'">
         <el-form-item label="高" prop="bzcn" label-width="60px">
           <span>{{ extendField.high ? extendField.high : '-' }}mm</span>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w04'">
+      <el-col :span="8" v-if="defaultNum == '6'">
         <el-form-item label="大模体型号" prop="bzcn" label-width="95px">
           <span>{{ extendField.dieBodyModel }}</span>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w04'">
+      <el-col :span="8" v-if="defaultNum == '6'">
         <el-form-item label="收缩系数" prop="bzcn" label-width="85px">
           <span>{{ extendField.shrinkageCoefficient }}</span>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w04'">
+      <el-col :span="8" v-if="defaultNum == '6'">
         <el-form-item label="芯杆数量" prop="bzcn" label-width="85px">
           <span>{{ extendField.mandrelNum }}</span>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w04'">
+      <el-col :span="8" v-if="defaultNum == '6'">
         <el-form-item label="模孔数量" prop="bzcn" label-width="85px">
           <span>{{ extendField.dieHoleNum }}</span>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w04'">
+      <el-col :span="8" v-if="defaultNum == '6'">
         <el-form-item label="上冲头数量" prop="bzcn" label-width="95px">
           <span>{{ extendField.upperPunchNum }}</span>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w04'">
+      <el-col :span="8" v-if="defaultNum == '6'">
         <el-form-item label="下冲头数量" prop="bzcn" label-width="95px">
           <span>{{ extendField.lowerPunchNum }}</span>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w04'">
+      <el-col :span="8" v-if="defaultNum == '6'">
         <el-form-item label="最大冲压次数" prop="bzcn" label-width="105px">
           <span>{{ extendField.maximumStampingTimes }}</span>
         </el-form-item>
@@ -140,11 +140,11 @@
       },
       defaultNum: {
         type: String,
-        default: 'w01'
+        default: '1'
       }
     },
     components: {},
-    data() {
+    data () {
       return {
         angleList: [
           { id: 0, value: '非A' },
@@ -155,14 +155,14 @@
       };
     },
     watch: {
-      customForm(val) {
+      customForm (val) {
         if (val) {
           this.extendField = JSON.parse(val.extendField);
           this.selfDefinedParameter = JSON.parse(val.selfDefinedParameter);
         }
       }
     },
-    created() {},
+    created () {},
     methods: {}
   };
 </script>

+ 60 - 64
src/views/classifyManage/itemInformation/components/RowForm.vue

@@ -5,15 +5,15 @@
     ref="formCustom"
     class="row-form"
   >
-    <el-row>
+    <el-row class="row-box">
       <el-col
         :span="8"
-        v-if="defaultNum == 'w06' || defaultNum == 'w07' || defaultNum == 'w04'"
+        v-if="defaultNum == '3' || defaultNum == '4' || defaultNum == '6'"
       >
         <el-form-item
           label="牌号"
           label-width="60px"
-          :prop="defaultNum == 'w06' ? 'brandNum' : ''"
+          :prop="defaultNum == '3' ? 'brandNum' : ''"
         >
           <el-input v-model="itemForm.brandNum" placeholder="请输入"></el-input>
         </el-form-item>
@@ -21,11 +21,11 @@
       <el-col
         :span="8"
         v-if="
-          defaultNum == 'w08' ||
-          defaultNum == 'w01' ||
-          defaultNum == 'w02' ||
-          defaultNum == 'w03' ||
-          defaultNum == 'w05'
+          defaultNum == '8' ||
+          defaultNum == '1' ||
+          defaultNum == '2' ||
+          defaultNum == '5' ||
+          defaultNum == '7'
         "
       >
         <el-form-item label="规格" prop="specification" label-width="60px">
@@ -35,7 +35,7 @@
           ></el-input>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum != 'w06'">
+      <el-col :span="8" v-if="defaultNum != '3'">
         <el-form-item label="型号" prop="modelType" label-width="60px">
           <el-input
             v-model="itemForm.modelType"
@@ -43,7 +43,7 @@
           ></el-input>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w03'">
+      <el-col :span="8" v-if="defaultNum == '5'">
         <el-form-item label="材质" prop="texture" label-width="60px">
           <el-input
             :disabled="itemForm.isCitation"
@@ -52,19 +52,19 @@
           ></el-input>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w01'">
+      <el-col :span="8" v-if="defaultNum == '1'">
         <el-form-item label="标准产能" label-width="85px">
           <div class="row-col">
             <el-input
               type="number"
               v-model="itemForm.info.standardCapacity"
               placeholder="请输入"
-            ></el-input>
-            <span>/小时</span>
+              ><span slot="suffix">/小时</span></el-input
+            >
           </div>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w07'">
+      <el-col :span="8" v-if="defaultNum == '4'">
         <el-form-item label="标准单重" label-width="85px">
           <el-input-number
             style="width: 80%"
@@ -76,7 +76,7 @@
           <span class="spanbox">KG</span>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w07'">
+      <el-col :span="8" v-if="defaultNum == '4'">
         <el-form-item label="不良品率" label-width="85px">
           <el-input-number
             style="width: 85%"
@@ -89,7 +89,7 @@
           <span class="spanbox">%</span>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w02'">
+      <el-col :span="8" v-if="defaultNum == '2'">
         <el-form-item label="角度" label-width="60px">
           <el-select v-model="itemForm.info.angle" placeholder="请选择">
             <el-option
@@ -102,7 +102,7 @@
           </el-select>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w02' || defaultNum == 'w03'">
+      <el-col :span="8" v-if="defaultNum == '2' || defaultNum == '5'">
         <el-form-item label="长" label-width="60px">
           <div>
             <el-input-number
@@ -116,7 +116,7 @@
           </div>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w02' || defaultNum == 'w03'">
+      <el-col :span="8" v-if="defaultNum == '2' || defaultNum == '5'">
         <el-form-item label="宽" label-width="60px">
           <div>
             <el-input-number
@@ -130,7 +130,7 @@
           </div>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w02' || defaultNum == 'w03'">
+      <el-col :span="8" v-if="defaultNum == '2' || defaultNum == '5'">
         <el-form-item label="高" label-width="60px">
           <div>
             <el-input-number
@@ -144,7 +144,7 @@
           </div>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w04'">
+      <el-col :span="8" v-if="defaultNum == '6'">
         <el-form-item label="大模体型号" label-width="95px">
           <el-input
             v-model="itemForm.info.dieBodyModel"
@@ -152,7 +152,7 @@
           ></el-input>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w04'">
+      <el-col :span="8" v-if="defaultNum == '6'">
         <el-form-item label="收缩系数" label-width="85px">
           <el-input
             v-model="itemForm.info.shrinkageCoefficient"
@@ -160,7 +160,7 @@
           ></el-input>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w04'">
+      <el-col :span="8" v-if="defaultNum == '6'">
         <el-form-item label="芯杆数量" label-width="85px">
           <el-input
             v-model="itemForm.info.mandrelNum"
@@ -170,7 +170,7 @@
           ></el-input>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w04'">
+      <el-col :span="8" v-if="defaultNum == '6'">
         <el-form-item label="模孔数量" label-width="85px">
           <el-input
             v-model="itemForm.info.dieHoleNum"
@@ -180,7 +180,7 @@
           ></el-input>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w04'">
+      <el-col :span="8" v-if="defaultNum == '6'">
         <el-form-item label="上冲头数量" label-width="95px">
           <el-input
             v-model="itemForm.info.upperPunchNum"
@@ -190,7 +190,7 @@
           ></el-input>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w04'">
+      <el-col :span="8" v-if="defaultNum == '6'">
         <el-form-item label="下冲头数量" label-width="95px">
           <el-input
             v-model="itemForm.info.lowerPunchNum"
@@ -200,7 +200,7 @@
           ></el-input>
         </el-form-item>
       </el-col>
-      <el-col :span="8" v-if="defaultNum == 'w04'">
+      <el-col :span="8" v-if="defaultNum == '6'">
         <el-form-item label="最大冲压次数" label-width="105px">
           <el-input
             v-model="itemForm.info.maximumStampingTimes"
@@ -252,11 +252,11 @@
       },
       defaultNum: {
         type: String,
-        default: 'w01'
+        default: '1'
       }
     },
     components: {},
-    data() {
+    data () {
       return {
         // customForm:{
         //   addList:[]
@@ -270,20 +270,14 @@
         ]
       };
     },
-    watch: {
-      itemForm(val) {
-        if (val) {
-        }
-      }
-    },
-    created() {},
+    created () {},
     methods: {
       // 在 Input 值改变时触发
-      handleEdit(e) {
+      handleEdit (e) {
         let value = e.replace(/^(0+)|[^\d]+/g, ''); // 以0开头或者输入非数字,会被替换成空
       },
       // 添加自定义参数
-      addItem() {
+      addItem () {
         if (this.itemForm.addList.length < 10) {
           let item = { key: '', value: '' };
           this.itemForm.addList.push(item);
@@ -293,12 +287,12 @@
       },
 
       // 删除自定义参数
-      delt(item, index) {
+      delt (item, index) {
         this.itemForm.addList.splice(index, 1);
       },
 
       //子组件接收callback为父组件传过来的next()方法
-      validateForm(callback) {
+      validateForm (callback) {
         // let flag = true;
         //开始表单校验
         this.$refs.formCustom.validate((valid) => {
@@ -319,38 +313,40 @@
 </script>
 
 <style lang="scss" scoped>
-  :deep(.row-form) {
+  .row-form {
     width: 100%;
     display: flex;
     align-items: center;
     justify-content: flex-start;
     flex-wrap: wrap;
     border-bottom: 1px dashed #ccc;
-    .el-row {
-      width: 100%;
-    }
-    .el-form-item {
-      margin-bottom: 15px;
-    }
-    .row-col {
-      display: flex;
-      align-items: center;
-      justify-content: flex-start;
-      .el-input--medium {
-        width: 75%;
-        margin-right: 10px;
+    :deep(.row-box) {
+      .el-row {
+        width: 100%;
       }
-    }
-    .spanbox {
-      display: inline-block;
-      margin-left: 10px;
-    }
-    .add-col {
-      display: flex;
-      align-items: center;
-      margin-left: 20px;
-      .col-input {
-        margin-right: 5px;
+      .el-form-item {
+        margin-bottom: 15px;
+      }
+      .row-col {
+        display: flex;
+        align-items: center;
+        justify-content: flex-start;
+        .el-input--medium {
+          width: 75%;
+          margin-right: 10px;
+        }
+      }
+      .spanbox {
+        display: inline-block;
+        margin-left: 10px;
+      }
+      .add-col {
+        display: flex;
+        align-items: center;
+        margin-left: 20px;
+        .col-input {
+          margin-right: 5px;
+        }
       }
     }
   }

+ 31 - 17
src/views/classifyManage/itemInformation/components/item-list.vue

@@ -78,6 +78,28 @@
       columns () {
         const privateColumn = [];
 
+        if (!['8', '1', '2', '5', '6', '7'].includes(this.current?.type)) {
+          privateColumn.push({
+            prop: 'brandNum',
+            label: '牌号',
+            showOverflowTooltip: true
+          });
+        }
+        if (!['3'].includes(this.current?.type)) {
+          privateColumn.push({
+            prop: 'modelType',
+            label: '型号',
+            showOverflowTooltip: true
+          });
+        }
+        if (!['3', '4'].includes(this.current?.type)) {
+          privateColumn.push({
+            prop: 'specification',
+            label: '规格',
+            showOverflowTooltip: true
+          });
+        }
+
         return [
           {
             columnKey: 'index',
@@ -88,25 +110,19 @@
             fixed: 'left'
           },
           {
-            prop: 'name',
+            prop: 'informationCode',
             label: '物品编码',
-            sortable: 'custom',
-            showOverflowTooltip: true,
-            minWidth: 110
+            showOverflowTooltip: true
           },
           {
-            prop: 'jobNumber',
+            prop: 'informationName',
             label: '物品名称',
-            sortable: 'custom',
-            showOverflowTooltip: true,
-            minWidth: 110
+            showOverflowTooltip: true
           },
           {
-            prop: 'loginName',
+            prop: 'classificationCode',
             label: '物品类型',
-            sortable: 'custom',
-            showOverflowTooltip: true,
-            minWidth: 110
+            showOverflowTooltip: true
           },
           ...privateColumn,
           {
@@ -123,8 +139,7 @@
           {
             prop: 'classificationUrl',
             label: '分类',
-            showOverflowTooltip: true,
-            minWidth: 110
+            showOverflowTooltip: true
           },
           {
             columnKey: 'action',
@@ -132,8 +147,7 @@
             width: 200,
             align: 'left',
             resizable: false,
-            slot: 'action',
-            showOverflowTooltip: true
+            slot: 'action'
           }
         ];
       }
@@ -171,7 +185,7 @@
       /* 删除 */
       remove (row) {
         const loading = this.$loading({ lock: true });
-        removeItem(row.id).then((msg) => {
+        removeItem(id).then((msg) => {
           loading.close();
           this.$message.success(msg);
           this.reload();

+ 425 - 0
src/views/classifyManage/itemInformation/components/item-match.vue

@@ -0,0 +1,425 @@
+<template>
+  <div class="match-body">
+    <el-tabs v-model="activeName" type="card">
+      <el-tab-pane
+        label="匹配产品"
+        name="product"
+        v-if="defaultNum == '3' || defaultNum == '6'"
+      >
+        <!-- 数据表格 -->
+        <ele-pro-table
+          ref="table"
+          :columns="columns_product"
+          :datasource="productData"
+          :needPage="false"
+          height="calc(100vh - 265px)"
+          full-height="calc(100vh - 116px)"
+          tool-class="ele-toolbar-form"
+          cache-key="systemOrgUserTable"
+        >
+          <!-- 表头工具栏 -->
+          <template v-slot:toolbar>
+            <el-button type="primary" @click="clickAdd('4', '选择产品')"
+              >添加</el-button
+            >
+          </template>
+
+          <!-- 操作列 -->
+          <template v-slot:action="{ row, $index }">
+            <el-popconfirm
+              class="ele-action"
+              title="确定要删除此物品?"
+              @confirm="remove(row)"
+            >
+              <template v-slot:reference>
+                <el-link
+                  @click="handleDelete($index, row)"
+                  type="danger"
+                  :underline="false"
+                  icon="el-icon-delete"
+                >
+                  删除
+                </el-link>
+              </template>
+            </el-popconfirm>
+          </template>
+        </ele-pro-table>
+      </el-tab-pane>
+      <el-tab-pane
+        label="匹配模具"
+        name="mould"
+        v-if="defaultNum == '1' || defaultNum == '4'"
+      >
+        <!-- 数据表格 -->
+        <ele-pro-table
+          ref="table"
+          :columns="columns_mould"
+          :datasource="mouldData"
+          :needPage="false"
+          height="calc(100vh - 265px)"
+          full-height="calc(100vh - 116px)"
+          tool-class="ele-toolbar-form"
+          cache-key="systemOrgUserTable"
+        >
+          <!-- 表头工具栏 -->
+          <template v-slot:toolbar>
+            <el-button type="primary" @click="clickAdd('6', '选择模具')"
+              >添加</el-button
+            >
+          </template>
+
+          <!-- 操作列 -->
+          <template v-slot:action="{ row, $index }">
+            <el-popconfirm
+              class="ele-action"
+              title="确定要删除此物品?"
+              @confirm="remove(row)"
+            >
+              <template v-slot:reference>
+                <el-link
+                  @click="handleDelete($index, row)"
+                  type="danger"
+                  :underline="false"
+                  icon="el-icon-delete"
+                >
+                  删除
+                </el-link>
+              </template>
+            </el-popconfirm>
+          </template>
+        </ele-pro-table>
+      </el-tab-pane>
+      <el-tab-pane label="匹配备品备件" name="part" v-if="defaultNum == '1'">
+        <!-- 数据表格 -->
+        <ele-pro-table
+          ref="table"
+          :columns="columns_part"
+          :datasource="partData"
+          :needPage="false"
+          height="calc(100vh - 265px)"
+          full-height="calc(100vh - 116px)"
+          tool-class="ele-toolbar-form"
+          cache-key="systemOrgUserTable"
+        >
+          <!-- 表头工具栏 -->
+          <template v-slot:toolbar>
+            <el-button type="primary" @click="clickAdd('7', '选择备品备件')"
+              >添加</el-button
+            >
+          </template>
+
+          <!-- 操作列 -->
+          <template v-slot:action="{ row, $index }">
+            <el-popconfirm
+              class="ele-action"
+              title="确定要删除此物品?"
+              @confirm="remove(row)"
+            >
+              <template v-slot:reference>
+                <el-link
+                  @click="handleDelete($index, row)"
+                  type="danger"
+                  :underline="false"
+                  icon="el-icon-delete"
+                >
+                  删除
+                </el-link>
+              </template>
+            </el-popconfirm>
+          </template>
+        </ele-pro-table>
+      </el-tab-pane>
+      <el-tab-pane label="BOM表" name="bom" v-if="defaultNum == '4'">
+        <!-- 数据表格 -->
+        <ele-pro-table
+          ref="table"
+          :columns="columns_bom"
+          :datasource="bomData"
+          :needPage="false"
+          height="calc(100vh - 265px)"
+          full-height="calc(100vh - 116px)"
+          tool-class="ele-toolbar-form"
+          cache-key="systemOrgUserTable"
+        >
+          <!-- 表头工具栏 -->
+          <template v-slot:toolbar>
+            <div class="bom-top">
+              <el-button type="primary" @click="clickAdd('3', '选择物料')"
+                >添加</el-button
+              >
+              <div class="top-input">
+                <span>基本数量</span>
+                <el-input
+                  class="input-box"
+                  @input="handleEdit"
+                  v-model="itemForm.basicNum"
+                  placeholder="请输入"
+                ></el-input>
+                <span>{{ itemForm.measuringUnit }}</span>
+              </div>
+            </div>
+          </template>
+
+          <!-- 操作列 -->
+          <template v-slot:action="{ row, $index }">
+            <el-popconfirm
+              class="ele-action"
+              title="确定要删除此物品?"
+              @confirm="remove(row)"
+            >
+              <template v-slot:reference>
+                <el-link
+                  @click="handleDelete($index, row)"
+                  type="danger"
+                  :underline="false"
+                  icon="el-icon-delete"
+                >
+                  删除
+                </el-link>
+              </template>
+            </el-popconfirm>
+          </template>
+          <!-- 操作列 -->
+          <template v-slot:num="{ row, $index }">
+            <el-input
+              type="number"
+              v-model="row.num"
+              placeholder="请输入"
+              oninput="value=value.replace(/[^0-9.]/g,'')"
+            ></el-input>
+          </template>
+        </ele-pro-table>
+      </el-tab-pane>
+      <el-tab-pane
+        label="匹配设备"
+        name="facility"
+        v-if="defaultNum == '6' || defaultNum == '7'"
+      >
+        <!-- 数据表格 -->
+        <ele-pro-table
+          ref="table"
+          :columns="columns_facility"
+          :datasource="facilityData"
+          :needPage="false"
+          height="calc(100vh - 265px)"
+          full-height="calc(100vh - 116px)"
+          tool-class="ele-toolbar-form"
+          cache-key="systemOrgUserTable"
+        >
+          <!-- 表头工具栏 -->
+          <template v-slot:toolbar>
+            <el-button type="primary" @click="clickAdd('1', '选择设备')"
+              >添加</el-button
+            >
+          </template>
+
+          <!-- 操作列 -->
+          <template v-slot:action="{ row, $index }">
+            <el-popconfirm
+              class="ele-action"
+              title="确定要删除此物品?"
+              @confirm="remove(row)"
+            >
+              <template v-slot:reference>
+                <el-link
+                  @click="handleDelete($index, row)"
+                  type="danger"
+                  :underline="false"
+                  icon="el-icon-delete"
+                >
+                  删除
+                </el-link>
+              </template>
+            </el-popconfirm>
+          </template>
+        </ele-pro-table>
+      </el-tab-pane>
+    </el-tabs>
+
+    <!-- 选择添加 -->
+    <AddDialog
+      ref="addDialogRef"
+      @submit="selectedEquipment"
+      :typeValue="typeValue"
+      :dialogTitle="dialogTitle"
+      :mapList="mapList"
+    />
+  </div>
+</template>
+
+<script>
+  import matchMixins from './match-mixins';
+  import AddDialog from './AddDialog.vue';
+  export default {
+    components: { AddDialog },
+    props: {
+      defaultNum: String
+    },
+    mixins: [matchMixins],
+    data () {
+      return {
+        activeName: 'mould',
+        typeValue: '',
+        productData: [],
+        mouldData: [],
+        partData: [],
+        bomData: [],
+        facilityData: [],
+        dialogTitle: '',
+        mapList: []
+      };
+    },
+    methods: {
+      getMapList () {
+        return this.mapList.map((item) => {
+          const obj = item;
+
+          obj.informationId = obj.id;
+          delete obj.id;
+          return obj;
+        });
+      },
+      setDefault (val) {
+        switch (val) {
+          case '3': {
+            this.activeName = 'product';
+            break;
+          }
+          case '1': {
+            this.activeName = 'mould';
+            break;
+          }
+          case '4': {
+            this.activeName = 'mould';
+            break;
+          }
+          case '6': {
+            this.activeName = 'product';
+            break;
+          }
+          case '7': {
+            this.activeName = 'facility';
+            break;
+          }
+          default:
+            break;
+        }
+      },
+      matchList (key, data) {
+        switch (key) {
+          case '1': {
+            this.facilityData = data[key];
+            break;
+          }
+          case '6': {
+            this.mouldData = data[key];
+            break;
+          }
+          case '7': {
+            this.partData = data[key];
+            break;
+          }
+          case '4': {
+            this.productData = data[key];
+            break;
+          }
+          case '3': {
+            this.bomData = data[key];
+            break;
+          }
+          default:
+            break;
+        }
+      },
+      //点击添加打开弹窗
+      clickAdd (val, name) {
+        this.$refs.addDialogRef.equipmentdialog = true;
+        if (val) {
+          this.typeValue = val;
+          this.dialogTitle = name;
+          this.mapAddList();
+        }
+      },
+      mapAddList () {
+        this.mapList = [];
+        if (this.defaultNum == '1') {
+          this.mapList = this.partData.concat(this.mouldData);
+        } else if (this.defaultNum == '6') {
+          this.mapList = this.facilityData.concat(this.productData);
+        } else if (this.defaultNum == '7') {
+          this.mapList = this.facilityData;
+        } else if (this.defaultNum == '3') {
+          this.mapList = this.productData;
+        } else if (this.defaultNum == '4') {
+          this.mapList = this.mouldData.concat(this.bomData);
+        }
+      },
+      handleDelete (index, row) {
+        this.$confirm(`确认删除[${row.informationName}]吗?`)
+          .then(async () => {
+            switch (this.activeName) {
+              case 'product': {
+                this.productData.splice(index, 1);
+                break;
+              }
+              case 'mould': {
+                this.mouldData.splice(index, 1);
+                break;
+              }
+              case 'part': {
+                this.partData.splice(index, 1);
+                break;
+              }
+              case 'bom': {
+                this.bomData.splice(index, 1);
+                break;
+              }
+              case 'facility': {
+                this.facilityData.splice(index, 1);
+                break;
+              }
+              default:
+                break;
+            }
+            this.mapAddList();
+          })
+          .catch(() => {});
+      },
+      // 选择的设备
+      selectedEquipment (val) {
+        switch (this.activeName) {
+          case 'product': {
+            this.productData = val;
+            break;
+          }
+          case 'mould': {
+            this.mouldData = val;
+            break;
+          }
+          case 'part': {
+            this.partData = val;
+            break;
+          }
+          case 'bom': {
+            this.bomData = val;
+            break;
+          }
+          case 'facility': {
+            this.facilityData = val;
+            break;
+          }
+          default:
+            break;
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .match-body {
+    :deep(.el-tabs__header) {
+      margin: 0 0 15px;
+    }
+  }
+</style>

+ 243 - 0
src/views/classifyManage/itemInformation/components/match-mixins.js

@@ -0,0 +1,243 @@
+export default {
+  props: {
+    typeList: {
+      type: Array,
+      default: () => []
+    }
+  },
+  data () {
+    return {
+      columns_product: [
+        {
+          type: 'index',
+          label: '序号',
+          width: 80
+        },
+        {
+          prop: 'informationCode',
+          label: '物品编码'
+        },
+        {
+          prop: 'informationName',
+          label: '物品名称'
+        },
+        {
+          prop: 'brandNum',
+          label: '牌号'
+        },
+        {
+          prop: 'modelType',
+          label: '型号'
+        },
+        {
+          prop: 'classificationCode',
+          label: '物品类型',
+          formatter: this.classificationCodeFormatter
+        },
+        {
+          prop: 'classificationUrl',
+          label: '分类'
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 150,
+          align: 'center',
+          slot: 'action',
+          fixed: 'right'
+        }
+      ],
+      columns_mould: [
+        {
+          type: 'index',
+          label: '序号',
+          width: 50
+        },
+        {
+          prop: 'informationCode',
+          label: '物品编码'
+        },
+        {
+          prop: 'informationName',
+          label: '物品名称'
+        },
+        {
+          prop: 'brandNum',
+          label: '牌号'
+        },
+        {
+          prop: 'modelType',
+          label: '型号'
+        },
+        {
+          prop: 'shrinkageCoefficient',
+          label: '收缩系数',
+          formatter: this.shrinkFormatter
+        },
+        {
+          prop: 'dieBodyModel',
+          label: '大模体型号',
+          formatter: this.modleFormatter
+        },
+        {
+          prop: 'classificationCode',
+          label: '物品类型',
+          formatter: this.classificationCodeFormatter
+        },
+        {
+          prop: 'classificationUrl',
+          label: '分类'
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 150,
+          align: 'center',
+          slot: 'action',
+          fixed: 'right'
+        }
+      ],
+      columns_part: [
+        {
+          type: 'index',
+          label: '序号',
+          width: 50
+        },
+        {
+          prop: 'informationCode',
+          label: '物品编码'
+        },
+        {
+          prop: 'informationName',
+          label: '物品名称'
+        },
+        {
+          prop: 'modelType',
+          label: '型号'
+        },
+        {
+          prop: 'classificationCode',
+          label: '物品类型',
+          formatter: this.classificationCodeFormatter
+        },
+        {
+          prop: 'classificationUrl',
+          label: '分类'
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 150,
+          align: 'center',
+          slot: 'action',
+          fixed: 'right'
+        }
+      ],
+      columns_bom: [
+        {
+          type: 'index',
+          label: '序号',
+          width: 50
+        },
+        {
+          prop: 'informationCode',
+          label: '物品编码'
+        },
+        {
+          prop: 'informationName',
+          label: '物品名称'
+        },
+        {
+          prop: 'brandNum',
+          label: '牌号'
+        },
+        {
+          prop: 'classificationCode',
+          label: '物品类型',
+          formatter: this.classificationCodeFormatter
+        },
+        {
+          prop: 'classificationUrl',
+          label: '分类'
+        },
+        {
+          label: '数量',
+          columnKey: 'num',
+          width: 120,
+          slot: 'num'
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 150,
+          align: 'center',
+          slot: 'action',
+          fixed: 'right'
+        }
+      ],
+      columns_facility: [
+        {
+          type: 'index',
+          label: '序号',
+          width: 50
+        },
+        {
+          prop: 'informationCode',
+          label: '物品编码'
+        },
+        {
+          prop: 'informationName',
+          label: '物品名称'
+        },
+        {
+          prop: 'classificationCode',
+          label: '物品类型',
+          formatter: this.classificationCodeFormatter
+        },
+        {
+          prop: 'classificationUrl',
+          label: '分类'
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 150,
+          align: 'center',
+          slot: 'action',
+          fixed: 'right'
+        }
+      ]
+    };
+  },
+  methods: {
+    // 物品类型格式化
+    classificationCodeFormatter (row) {
+      let itemName = '';
+      this.typeList.map((item) => {
+        if (item.prefix == row.classificationCode) {
+          itemName = item.name;
+        }
+      });
+      return itemName;
+    },
+
+    // 收缩系数格式化
+    shrinkFormatter (row) {
+      let shrink = '';
+      let extendField = JSON.parse(row.extendField);
+      if (extendField.hasOwnProperty('shrinkageCoefficient')) {
+        shrink = extendField.shrinkageCoefficient;
+      }
+      return shrink;
+    },
+
+    modleFormatter (row) {
+      let modle = '';
+      let extendField = JSON.parse(row.extendField);
+      if (extendField.hasOwnProperty('dieBodyModel')) {
+        modle = extendField.dieBodyModel;
+      }
+      return modle;
+    }
+  }
+};

+ 38 - 40
src/views/classifyManage/itemInformation/details.vue

@@ -24,15 +24,13 @@
         />
         <div
           class="row-table"
-          v-if="
-            defaultNum != 'w08' && defaultNum != 'w02' && defaultNum != 'w03'
-          "
+          v-if="defaultNum != '8' && defaultNum != '2' && defaultNum != '5'"
         >
           <el-tabs v-model="activeName" type="card">
             <el-tab-pane
               label="匹配产品"
               name="product"
-              v-if="defaultNum == 'w06' || defaultNum == 'w04'"
+              v-if="defaultNum == '3' || defaultNum == '6'"
             >
               <el-table
                 :data="productData"
@@ -62,7 +60,7 @@
             <el-tab-pane
               label="匹配模具"
               name="mould"
-              v-if="defaultNum == 'w01' || defaultNum == 'w07'"
+              v-if="defaultNum == '1' || defaultNum == '4'"
             >
               <el-table
                 :data="mouldData"
@@ -92,7 +90,7 @@
             <el-tab-pane
               label="匹配备品备件"
               name="part"
-              v-if="defaultNum == 'w01'"
+              v-if="defaultNum == '1'"
             >
               <el-table
                 :data="partData"
@@ -117,7 +115,7 @@
                 </el-table-column>
               </el-table>
             </el-tab-pane>
-            <el-tab-pane label="BOM表" name="bom" v-if="defaultNum == 'w07'">
+            <el-tab-pane label="BOM表" name="bom" v-if="defaultNum == '4'">
               <div class="bom-top">
                 <div class="top-input">
                   <span>基本数量</span>
@@ -154,7 +152,7 @@
             <el-tab-pane
               label="匹配设备"
               name="facility"
-              v-if="defaultNum == 'w04' || defaultNum == 'w05'"
+              v-if="defaultNum == '6' || defaultNum == '7'"
             >
               <el-table
                 :data="facilityData"
@@ -205,20 +203,20 @@
   import { getDetails } from '@/api/classifyManage/itemInformation';
   export default {
     components: { ItemDetail, RowDetail },
-    data() {
+    data () {
       return {
         pageTitle: '',
         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 }
+          { id: 1, value: '1  生产设备', prefix: '1', code: 1 },
+          { id: 2, value: '2  舟皿', prefix: '2', code: 2 },
+          { id: 3, value: '5  周转车', prefix: '5', code: 5 },
+          { id: 4, value: '6  模具', prefix: '6', code: 6 },
+          { id: 5, value: '7  备品备件', prefix: '7', code: 7 },
+          { id: 6, value: '3  物料', prefix: '3', code: 3 },
+          { id: 7, value: '4  产品', prefix: '4', code: 4 },
+          { id: 8, value: '8  耗材', prefix: '8', code: 8 }
         ],
-        defaultNum: 'w01',
+        defaultNum: '1',
         // itemForm:{
         //   priceType:0, dateType:0,
         // },
@@ -239,12 +237,12 @@
         itemValue: ''
       };
     },
-    created() {
+    created () {
       this.getDetilInfo(this.$route.query.id);
     },
     methods: {
-      async getDetilInfo(id) {
-        const res = await getDetails({ id: id });
+      async getDetilInfo (id) {
+        const res = await getDetails(id);
         if (res.success) {
           this.customForm = res.data;
           this.defaultNum = res.data.classificationCode;
@@ -256,7 +254,7 @@
         }
       },
 
-      formatterValue(code) {
+      formatterValue (code) {
         this.typeList.map((item) => {
           if (item.prefix == code) {
             this.itemValue = item.value;
@@ -264,29 +262,29 @@
         });
       },
 
-      goBack() {
+      goBack () {
         this.$router.go(-1);
       },
       // 显示默认选中的tab
-      setDefault(val) {
+      setDefault (val) {
         switch (val) {
-          case 'w06': {
+          case '3': {
             this.activeName = 'product';
             break;
           }
-          case 'w01': {
+          case '1': {
             this.activeName = 'mould';
             break;
           }
-          case 'w07': {
+          case '4': {
             this.activeName = 'mould';
             break;
           }
-          case 'w04': {
+          case '6': {
             this.activeName = 'product';
             break;
           }
-          case 'w05': {
+          case '7': {
             this.activeName = 'facility';
             break;
           }
@@ -295,25 +293,25 @@
         }
       },
 
-      matchList(key, data) {
+      matchList (key, data) {
         switch (key) {
-          case 'w01': {
+          case '1': {
             this.facilityData = data[key];
             break;
           }
-          case 'w04': {
+          case '6': {
             this.mouldData = data[key];
             break;
           }
-          case 'w05': {
+          case '7': {
             this.partData = data[key];
             break;
           }
-          case 'w07': {
+          case '4': {
             this.productData = data[key];
             break;
           }
-          case 'w06': {
+          case '3': {
             this.bomData = data[key];
             break;
           }
@@ -322,25 +320,25 @@
         }
       },
 
-      handleDelete(index, row) {},
+      handleDelete (index, row) {},
 
       //点击添加打开弹窗
-      clickAdd() {
+      clickAdd () {
         this.$refs.addDialogRef.equipmentdialog = true;
       },
 
-      handleCurrent(page) {
+      handleCurrent (page) {
         this.pagination.page = page;
         // this._getList(this.params)
       },
-      handleSize(size) {
+      handleSize (size) {
         this.pagination.page = 1;
         this.pagination.size = size;
         // this._getList(this.params)
       },
 
       // 物品类型格式化
-      classificationCodeFormatter(row) {
+      classificationCodeFormatter (row) {
         let itemName = '';
         this.typeList.map((item) => {
           if (item.prefix == row.classificationCode) {

+ 34 - 4
src/views/classifyManage/itemInformation/index.vue

@@ -22,7 +22,27 @@
             </div>
           </ele-toolbar>
           <div class="ele-border-lighter sys-organization-list">
-            <asset-tree @handleNodeClick="onNodeClick" />
+            <asset-tree
+              @handleNodeClick="onNodeClick"
+              ref="commonTree"
+              :treeFormate="
+                (list) => {
+                  return [
+                    {
+                      children: list,
+                      id: '0',
+                      level: 0,
+                      name: '物品信息表',
+                      originId: null,
+                      originType: {},
+                      parentId: null,
+                      type: '',
+                      weight: 0
+                    }
+                  ];
+                }
+              "
+            />
           </div>
         </div>
         <template v-slot:content>
@@ -51,12 +71,22 @@
         this.current = node;
       },
       openEdit () {
-        // const selectList = this.$refs.commonTree.getSelectList()
+        const data = this.$refs.commonTree.getSelectList();
+
+        if (data?.id) {
+          let node = this.$refs.commonTree.getInstance().getNode(data.id);
+          const urlIdList = [data.id];
+          while (node.parent?.data?.id) {
+            urlIdList.unshift(node.parent?.data?.id);
+            node = node.parent;
+          }
+          data.urlIdList = urlIdList;
+        }
         this.$router.push({
           path: '/classifyManage/itemInformation/add',
           query: {
-            pageTitle: '新建物品'
-            // selectNode: JSON.stringify(selectList)
+            pageTitle: '新建物品',
+            selectNode: JSON.stringify(data)
           }
         });
       }

+ 0 - 0
src/views/classifyManage/components/addDialog.vue → src/views/classifyManage/treeClassify/components/addDialog.vue


+ 0 - 0
src/views/classifyManage/components/classifyManageEdit.vue → src/views/classifyManage/treeClassify/components/classifyManageEdit.vue


+ 0 - 0
src/views/classifyManage/components/classifyManageSearch.vue → src/views/classifyManage/treeClassify/components/classifyManageSearch.vue


+ 12 - 20
src/views/classifyManage/components/list-edit.vue → src/views/classifyManage/treeClassify/components/list-edit.vue

@@ -83,7 +83,11 @@
           />
         </el-form-item>
         <el-form-item label="与下层分隔:" prop="separate">
-          <DictSelection dictName="分隔符" clearable v-model="formData.type">
+          <DictSelection
+            dictName="分隔符"
+            clearable
+            v-model="formData.separate"
+          >
           </DictSelection>
         </el-form-item>
         <el-form-item label="本层排序:" prop="sort">
@@ -118,7 +122,7 @@
       }
     },
     mixins: [dictMixins],
-    data() {
+    data () {
       const defaultForm = {
         name: '',
         code: '',
@@ -133,18 +137,6 @@
         defaultForm,
         // 表单数据
         formData: { ...defaultForm },
-        // typeList: [
-        //   { label: '产品分类', code: 3 },
-        //   { label: '摸具分类', code: 4 },
-        //   { label: '设备分类', code: 5 },
-        //   { label: '舟皿分类', code: 6 }
-        // ],
-        // splitList: [
-        //   { label: '无分隔符', code: '' },
-        //   { label: '-', code: '-' },
-        //   { label: '~', code: '~' },
-        //   { label: '/', code: '/' }
-        // ],
         // 表单验证规则
         rules: {
           name: [
@@ -178,7 +170,7 @@
       };
     },
     computed: {
-      fullName() {
+      fullName () {
         let str = '';
         let codeStr = '';
         let node = this.curNode;
@@ -194,15 +186,15 @@
         );
       }
     },
-    created() {},
+    created () {},
     methods: {
-      open(data, parentData) {
+      open (data, parentData) {
         this.parentData = parentData;
         this.data = data;
         this.visible = true;
       },
       /* 保存编辑 */
-      save() {
+      save () {
         this.$refs.formRef.validate((valid) => {
           if (!valid) {
             return false;
@@ -233,12 +225,12 @@
         });
       },
       /* 更新visible */
-      updateVisible(value) {
+      updateVisible (value) {
         this.visible = value;
       }
     },
     watch: {
-      visible(visible) {
+      visible (visible) {
         if (visible) {
           if (this.data) {
             this.$util.assignObject(this.formData, this.data);

+ 0 - 0
src/views/classifyManage/details.vue → src/views/classifyManage/treeClassify/details.vue


+ 1 - 1
src/views/classifyManage/index.vue → src/views/classifyManage/treeClassify/index.vue

@@ -111,7 +111,7 @@
       // 编辑
       junmpEdit ({ id }) {
         this.$router.push({
-          path: '/classifyManage/details',
+          path: '/classifyManage/treeClassify/details',
           query: {
             id
           }

+ 8 - 88
src/views/codeManagement/components/addDialog.vue

@@ -136,6 +136,14 @@
       // this.getrecipientDep()
     },
     methods: {
+      handleClose(){
+         this.addRoleDialog = false
+         this.addForm = {
+           name: '',
+           code: '',
+           remark: ''
+         }
+      },
       open(type, row) {
         if (type == 'add') {
           this.dialogTitle = '新建编码规则';
@@ -152,23 +160,6 @@
         this.addRoleDialog = true;
         this.openType = type;
       },
-      data() {
-        return {
-          addRoleDialog: false,
-          dialogTitle: '新建编码规则',
-          addForm: {
-            name: '',
-            code: '',
-            remark: ''
-          },
-          addFormRules: {
-            name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
-            code: [{ required: true, message: '请输入编码', trigger: 'blur' }]
-          },
-          codeConfigurationList: [],
-          openType: 'add'
-        };
-      },
       submitAdd() {
         const a1 = new Promise((resolve, reject) => {
           this.$refs.addForm.validate((valid) => {
@@ -214,77 +205,6 @@
             });
         });
       },
-      methods: {
-        open(type, row) {
-          if (type == 'add') {
-            this.dialogTitle = '新建编码规则';
-            this.codeConfigurationList = [];
-          } else if (type == 'edit') {
-            this.dialogTitle = '编辑编码规则';
-            getCodeDetail(row.id).then((res) => {
-              this.addForm = { ...res };
-              if (this.addForm.codeConfigurationList)
-                delete this.addForm.codeConfigurationList;
-              this.codeConfigurationList = res.codeConfigurationList;
-            });
-          }
-          this.addRoleDialog = true;
-          this.openType = type;
-        },
-        handleClose() {
-          this.restForm();
-          this.addRoleDialog = false;
-        },
-        restForm() {
-          this.$refs.myTable.handleReset(); //清空表格校验
-          this.$refs.addForm.resetFields();
-          this.addForm = {
-            name: '',
-            code: '',
-            remark: ''
-          };
-        },
-        submitAdd() {
-          const a1 = new Promise((resolve, reject) => {
-            this.$refs.addForm.validate((valid) => {
-              if (valid) resolve();
-            });
-          });
-          const a2 = new Promise((resolve, reject) => {
-            this.$refs.myTable.validateForm((valid) => {
-              if (valid) resolve();
-            });
-          });
-          Promise.all([a1, a2]).then(() => {
-            const codeConfigurationList = this.$refs.myTable.getTableValue();
-            // codeConfigurationList.map(item=>{
-            //    item.type = item.type.code
-            // })
-            let par = {
-              code: this.addForm.code,
-              name: this.addForm.name,
-              remark: this.addForm.remark,
-              codeConfigurationList: codeConfigurationList,
-              codeManageTreeId: 1
-            };
-            if (this.openType == 'edit') {
-              par.id = this.addForm.id;
-            }
-            saveNew(par)
-              .then((res) => {
-                console.log('res', res);
-                this.loading = false;
-                this.addRoleDialog = false;
-                this.$message.success(res);
-                this.$emit('done');
-              })
-              .catch((e) => {
-                this.loading = false;
-                // this.$message.error(e.message);
-              });
-          });
-        }
-      }
     }
   };
 </script>

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

@@ -185,19 +185,19 @@
               label: '年'
             },
             {
-              value: 'yyyymm',
+              value: 'yyyyMM',
               label: '年月'
             },
             {
-              value: 'yyyymmdd',
+              value: 'yyyyMMdd',
               label: '年月日'
             },
             {
-              value: 'yyyymmddhh',
+              value: 'yyyyMMddHH',
               label: '年月日时'
             },
             {
-              value: 'yyyymmddhhmmss',
+              value: 'yyyyMMddHHmmss',
               label: '年月日时分秒'
             }
           ]

+ 259 - 0
src/views/ledgerAssets/boat/components/baseInfo.vue

@@ -0,0 +1,259 @@
+<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>
+        {{ information.informationCode }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 舟皿名称 </template>
+        {{ information.informationName }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 型号</template>
+        {{ information.modelType }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 规格 </template>
+        {{ information.specification }}
+      </el-descriptions-item>
+      <el-descriptions-item :span="2">
+        <template slot="label"> 分类 </template>
+        {{information.classificationUrl}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 长/宽/高(mm) </template>
+        {{information.extendField.length}}/{{information.extendField.width}}/{{information.extendField.high}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 计量单位</template>
+        {{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>
+      <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="assetCode" 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
+          background
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="total"
+          :page-sizes="[15, 30, 50, 100, 500]"
+          :page-size="pagination.size"
+          :current-page.sync="pagination.page"
+          @current-change="handleCurrent"
+          @size-change="handleSize"
+        >
+        </el-pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+// import {
+//   getDetails
+// } from '@/api/stockManagement/itemInformation'
+// import {getAssetPage , getCount} from "@/api/ledgerAssets/asset"
+export default {
+  props: {
+    rowInfo:{
+      type:Object ,
+      default:{}
+    },
+  },
+  data () {
+    return {
+      baseOpt: [
+        { label: '物品编码', key: 'informationCode' },
+        { label: '舟皿名称', key: 'informationName' },
+        { label: '型号', key: 'modelType' },
+        { label: '规格', key: 'specification' },
+        { label: '分类', key: 'classificationUrl', span: 2 },
+        { label: '长/宽/高(mm)', key: 'mm' },
+        { label: '计量单位', key: 'measuringUnit' },
+      ],
+      information:{
+        extendField:{}
+      },
+      activeName:'inUse',
+      tableData:[],
+      pagination: {
+        page: 1,
+        size: 15
+      },
+      total: 0,
+      searchForm:{
+        assetType:'ZHOUMIN',
+        informationId:'',
+        source:1
+      },
+      countInfo:{}
+
+    }
+  },
+  watch:{
+
+
+  },
+  created () {
+    // this.searchForm.informationId = this.rowInfo.id
+    // this.getDetilInfo(this.rowInfo.id)
+    // this.handleList()
+    // this.getCountNum()
+  },
+  methods:{
+     async getDetilInfo(id){
+       const res = await getDetails({id:id})
+       if (res.success){
+          this.information = res.data
+          this.$set(this.information, 'extendField', JSON.parse(res.data.extendField))
+       }
+     },
+
+     tabClick(val){
+        switch (this.activeName) {
+          case 'inUse': {
+            this.searchForm.source = 1
+            break;
+          }
+          case 'inLibrary': {
+            this.searchForm.source = 2
+            break;
+          }
+          case 'hasConsume': {
+            this.searchForm.source = 3
+            break;
+          }
+          default:
+            break;
+        }
+        this.handleList()
+     },
+
+     handleCurrent (page) {
+       this.pagination.page = page
+       this.handleList()
+     },
+     handleSize (size) {
+       this.pagination.page = 1
+       this.pagination.size = size
+       this.handleList()
+     },
+
+     async handleList () {
+       const params = {
+         ...this.searchForm,
+         ...this.pagination
+       }
+       const res = await getAssetPage(params)
+       if (res?.success) {
+         this.tableData = res.data.records
+         this.total = res.data.total
+         // if(this.tableData.length)  this.$refs.tableRef.clearSelection()
+         // this.$nextTick(() => {
+         //     this.mapList.forEach(item => {
+         //       const row = this.tableData.find(i => i.id === item.id)
+         //       if (row) {
+         //         this.$refs.tableRef.toggleRowSelection(row, true)
+         //       }
+         //     })
+         // })
+       }
+     },
+
+     getCountNum(){
+       const params = {
+           assetType:'ZHOUMIN',
+           informationId:this.rowInfo.id
+       }
+       getCount(params).then(res=>{
+           if(res?.success){
+               this.countInfo = res.data
+           }
+       })
+     }
+
+
+  }
+
+}
+</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;
+  }
+  .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%;
+      }
+    }
+    .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>

+ 167 - 0
src/views/ledgerAssets/boat/components/boat-list.vue

@@ -0,0 +1,167 @@
+<template>
+  <div>
+    <!-- 数据表格 -->
+    <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>
+        <boat-search @search="reload">
+        </boat-search>
+      </template>
+      <!-- 角色列 -->
+      <template v-slot:roles="{ row }">
+        <el-tag
+          v-for="item in row.roles"
+          :key="item.roleId"
+          type="primary"
+          size="mini"
+          :disable-transitions="true"
+        >
+          {{ item.roleName }}
+        </el-tag>
+      </template>
+      <!-- 状态列 -->
+      <template v-slot:code="{ row }">
+        <el-link
+          @click="details(row)"
+         >{{ row.code }}</el-link>
+      </template>
+    </ele-pro-table>
+  </div>
+</template>
+
+<script>
+  import BoatSearch from './boat-search.vue';
+  import {
+    getBoatList
+  } from '@/api/ledgerAssets/boat.js';
+
+  export default {
+    components: { BoatSearch },
+    props: {
+      // 类别id
+      rootId: [Number, String],
+    },
+    data() {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            type: 'index',
+            label: '序号',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '类别编码',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'name',
+            label: '类别名称',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'module',
+            label: '型号',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'angle',
+            label: '角度',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          // {
+          //   prop: 'angle',
+          //   label: '长*宽*高',
+          //   showOverflowTooltip: true,
+          //   minWidth: 110
+          // },
+          {
+            prop: 'categoryLevelPath',
+            label: '分类',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'inUseSum',
+            label: '在用',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'inLibrarySum',
+            label: '在库',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'consumeSum',
+            label: '消耗',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'totalSum',
+            label: '总数量',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+        ]
+      };
+    },
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getBoatList({
+          ...where,
+          ...order,
+          pageNum: page,
+          size: limit,
+          rootCategoryLevelId: this.rootId
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ pageNum: 1, where: where });
+      },
+
+      // 跳转到详情页
+      details ({ id }) {
+        this.$router.push({
+          path: '/ledgerAssets/material/detail',
+          query: {
+            id
+          }
+        })
+      }
+    },
+    watch: {
+      // 监听类别id变化
+      rootId() {
+        this.reload();
+      }
+    }
+  };
+</script>

+ 96 - 0
src/views/ledgerAssets/boat/components/boat-search.vue

@@ -0,0 +1,96 @@
+<!-- 搜索表单 -->
+<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-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-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="角度:" label-width="50px">
+          <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>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 12, md: 12 } : { span: 12 }">
+        <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>
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-download"
+            class="ele-btn-icon"
+          >
+            导出
+          </el-button>
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  import { login } from '@/api/login';
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        name: '',
+        code: '',
+        angle:'',
+        spaceModule:''
+      };
+      return {
+        // 表单数据
+        where: { ...defaultWhere }
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search() {
+        console.log(this.where);
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
+    }
+  };
+</script>

+ 66 - 0
src/views/ledgerAssets/boat/detail.vue

@@ -0,0 +1,66 @@
+<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" :rowInfo="rowInfo"></component>
+    </div>
+  </div>
+</template>
+
+<script>
+import baseInfo from './components/baseInfo.vue'
+export default {
+  components: {
+    baseInfo
+  },
+  data () {
+    return {
+      activeComp: 'baseInfo',
+      tabOptions: [
+        { key: 'baseInfo', name: '舟皿信息' },
+      ],
+      rowInfo:null,
+    }
+  },
+  created () {
+     // this.rowInfo = JSON.parse(this.$route.query.row)
+  },
+  methods:{
+     // async getDetilInfo(id){
+     //   const res = await getDetails({id:id})
+     //   if (res.success){
+
+     //   }
+     // },
+  }
+
+}
+</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>

+ 54 - 6
src/views/ledgerAssets/boat/index.vue

@@ -1,27 +1,75 @@
 <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"
+               :type="'2'"
+               :paramsType="'type'"
+               ref="treeList"
+             />
+           </div>
+         </div>
+         <template v-slot:content>
+           <boat-list
+             v-if="current"
+             :root-id="current.id"
+           />
+         </template>
+       </ele-split-layout>
+     </el-card>
   </div>
 </template>
 
 <script>
+  import AssetTree from '@/components/AssetTree';
+  import BoatList from './components/boat-list.vue';
+  import {
+    getBoatList
+  } from '@/api/ledgerAssets/boat.js';
   export default {
-    // name: 'boatLedger',
-    components: {},
+    components: {
+      AssetTree ,
+      BoatList
+    },
     data () {
       return {
-
+        // 加载状态
+        loading: false,
+        // 表格选中数据
+        selection: [],
+        current:null
       };
     },
     computed: {
 
     },
     methods: {
-
+      handleNodeClick (info) {
+        this.current = info
+      },
     }
   };
 </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>

+ 259 - 0
src/views/ledgerAssets/material/components/baseInfo.vue

@@ -0,0 +1,259 @@
+<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>
+        {{ information.informationCode }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 舟皿名称 </template>
+        {{ information.informationName }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 型号</template>
+        {{ information.modelType }}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 规格 </template>
+        {{ information.specification }}
+      </el-descriptions-item>
+      <el-descriptions-item :span="2">
+        <template slot="label"> 分类 </template>
+        {{information.classificationUrl}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 长/宽/高(mm) </template>
+        {{information.extendField.length}}/{{information.extendField.width}}/{{information.extendField.high}}
+      </el-descriptions-item>
+      <el-descriptions-item>
+        <template slot="label"> 计量单位</template>
+        {{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>
+      <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="assetCode" 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
+          background
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="total"
+          :page-sizes="[15, 30, 50, 100, 500]"
+          :page-size="pagination.size"
+          :current-page.sync="pagination.page"
+          @current-change="handleCurrent"
+          @size-change="handleSize"
+        >
+        </el-pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+// import {
+//   getDetails
+// } from '@/api/stockManagement/itemInformation'
+// import {getAssetPage , getCount} from "@/api/ledgerAssets/asset"
+export default {
+  props: {
+    rowInfo:{
+      type:Object ,
+      default:{}
+    },
+  },
+  data () {
+    return {
+      baseOpt: [
+        { label: '物品编码', key: 'informationCode' },
+        { label: '舟皿名称', key: 'informationName' },
+        { label: '型号', key: 'modelType' },
+        { label: '规格', key: 'specification' },
+        { label: '分类', key: 'classificationUrl', span: 2 },
+        { label: '长/宽/高(mm)', key: 'mm' },
+        { label: '计量单位', key: 'measuringUnit' },
+      ],
+      information:{
+        extendField:{}
+      },
+      activeName:'inUse',
+      tableData:[],
+      pagination: {
+        page: 1,
+        size: 15
+      },
+      total: 0,
+      searchForm:{
+        assetType:'ZHOUMIN',
+        informationId:'',
+        source:1
+      },
+      countInfo:{}
+
+    }
+  },
+  watch:{
+
+
+  },
+  created () {
+    // this.searchForm.informationId = this.rowInfo.id
+    // this.getDetilInfo(this.rowInfo.id)
+    // this.handleList()
+    // this.getCountNum()
+  },
+  methods:{
+     async getDetilInfo(id){
+       const res = await getDetails({id:id})
+       if (res.success){
+          this.information = res.data
+          this.$set(this.information, 'extendField', JSON.parse(res.data.extendField))
+       }
+     },
+
+     tabClick(val){
+        switch (this.activeName) {
+          case 'inUse': {
+            this.searchForm.source = 1
+            break;
+          }
+          case 'inLibrary': {
+            this.searchForm.source = 2
+            break;
+          }
+          case 'hasConsume': {
+            this.searchForm.source = 3
+            break;
+          }
+          default:
+            break;
+        }
+        this.handleList()
+     },
+
+     handleCurrent (page) {
+       this.pagination.page = page
+       this.handleList()
+     },
+     handleSize (size) {
+       this.pagination.page = 1
+       this.pagination.size = size
+       this.handleList()
+     },
+
+     async handleList () {
+       const params = {
+         ...this.searchForm,
+         ...this.pagination
+       }
+       const res = await getAssetPage(params)
+       if (res?.success) {
+         this.tableData = res.data.records
+         this.total = res.data.total
+         // if(this.tableData.length)  this.$refs.tableRef.clearSelection()
+         // this.$nextTick(() => {
+         //     this.mapList.forEach(item => {
+         //       const row = this.tableData.find(i => i.id === item.id)
+         //       if (row) {
+         //         this.$refs.tableRef.toggleRowSelection(row, true)
+         //       }
+         //     })
+         // })
+       }
+     },
+
+     getCountNum(){
+       const params = {
+           assetType:'ZHOUMIN',
+           informationId:this.rowInfo.id
+       }
+       getCount(params).then(res=>{
+           if(res?.success){
+               this.countInfo = res.data
+           }
+       })
+     }
+
+
+  }
+
+}
+</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;
+  }
+  .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%;
+      }
+    }
+    .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>

+ 149 - 0
src/views/ledgerAssets/material/components/material-list.vue

@@ -0,0 +1,149 @@
+<template>
+  <div>
+    <!-- 数据表格 -->
+    <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>
+        <material-search @search="reload">
+        </material-search>
+      </template>
+      <!-- 角色列 -->
+      <template v-slot:roles="{ row }">
+        <el-tag
+          v-for="item in row.roles"
+          :key="item.roleId"
+          type="primary"
+          size="mini"
+          :disable-transitions="true"
+        >
+          {{ item.roleName }}
+        </el-tag>
+      </template>
+      <!-- 状态列 -->
+      <template v-slot:code="{ row }">
+        <el-link
+          @click="details(row)"
+         >{{ row.code }}</el-link>
+      </template>
+    </ele-pro-table>
+  </div>
+</template>
+
+<script>
+  import MaterialSearch from './material-search.vue';
+  import {
+    getBoatList
+  } from '@/api/ledgerAssets/boat.js';
+
+  export default {
+    components: { MaterialSearch },
+    props: {
+      // 类别id
+      rootId: [Number, String],
+    },
+    data() {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            type: 'index',
+            label: '序号',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '类别编码',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'name',
+            label: '类别名称',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'brandNum',
+            label: '牌号',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'categoryLevelPath',
+            label: '分类',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'inUseSum',
+            label: '在用',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'inLibrarySum',
+            label: '在库',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'consumeSum',
+            label: '消耗',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'totalSum',
+            label: '总数量',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+        ]
+      };
+    },
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getBoatList({
+          ...where,
+          ...order,
+          pageNum: page,
+          size: limit,
+          rootCategoryLevelId: this.rootId
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ pageNum: 1, where: where });
+      },
+
+      // 跳转到详情页
+      details ({ id }) {
+        this.$router.push({
+          path: '/ledgerAssets/material/detail',
+          query: {
+            id
+          }
+        })
+      }
+    },
+    watch: {
+      // 监听类别id变化
+      rootId() {
+        this.reload();
+      }
+    }
+  };
+</script>

+ 88 - 0
src/views/ledgerAssets/material/components/material-search.vue

@@ -0,0 +1,88 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    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-input clearable v-model="where.code" 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-col>
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="牌号:">
+          <el-input clearable v-model="where.modle" placeholder="请输入" />
+        </el-form-item>
+      </el-col>
+      <el-col v-bind="styleResponsive ? { lg: 7, md: 12 } : { span: 7 }">
+        <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>
+           <el-button
+             size="small"
+             type="primary"
+             icon="el-icon-download"
+             class="ele-btn-icon"
+           >
+             导出
+           </el-button>
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+
+<script>
+  import { login } from '@/api/login';
+  export default {
+    data() {
+      // 默认表单数据
+      const defaultWhere = {
+        name: '',
+        groupId: ''
+      };
+      return {
+        // 表单数据
+        where: { ...defaultWhere }
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive() {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search() {
+        console.log(this.where);
+        this.$emit('search', this.where);
+      },
+      /*  重置 */
+      reset() {
+        this.where = { ...this.defaultWhere };
+        this.search();
+      }
+    }
+  };
+</script>

+ 66 - 0
src/views/ledgerAssets/material/detail.vue

@@ -0,0 +1,66 @@
+<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" :rowInfo="rowInfo"></component>
+    </div>
+  </div>
+</template>
+
+<script>
+import baseInfo from './components/baseInfo.vue'
+export default {
+  components: {
+    baseInfo
+  },
+  data () {
+    return {
+      activeComp: 'baseInfo',
+      tabOptions: [
+        { key: 'baseInfo', name: '舟皿信息' },
+      ],
+      rowInfo:null,
+    }
+  },
+  created () {
+     // this.rowInfo = JSON.parse(this.$route.query.row)
+  },
+  methods:{
+     // async getDetilInfo(id){
+     //   const res = await getDetails({id:id})
+     //   if (res.success){
+
+     //   }
+     // },
+  }
+
+}
+</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>

+ 75 - 0
src/views/ledgerAssets/material/index.vue

@@ -0,0 +1,75 @@
+<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"
+               :type="'2'"
+               :paramsType="'type'"
+               ref="treeList"
+             />
+           </div>
+         </div>
+         <template v-slot:content>
+           <material-list
+             v-if="current"
+             :root-id="current.id"
+           />
+         </template>
+       </ele-split-layout>
+     </el-card>
+  </div>
+</template>
+
+<script>
+  import AssetTree from '@/components/AssetTree';
+  import MaterialList from './components/material-list.vue';
+  import {
+    getBoatList
+  } from '@/api/ledgerAssets/boat.js';
+  export default {
+    components: {
+      AssetTree ,
+      MaterialList
+    },
+    data () {
+      return {
+        // 加载状态
+        loading: false,
+        // 表格选中数据
+        selection: [],
+        current:null
+      };
+    },
+    computed: {
+
+    },
+    methods: {
+      handleNodeClick (info) {
+        this.current = info
+      },
+    }
+  };
+</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>