Przeglądaj źródła

物品信息管理

quwangxin 3 lat temu
rodzic
commit
4235efc41e

+ 1 - 1
src/api/classifyManage/itemInformation.js

@@ -27,7 +27,7 @@ export async function informationEdit (data) {
 
 // 物品信息详情
 export async function getDetails (id) {
-  const res = await request.get(`/category/info/${id}`);
+  const res = await request.get(`/main/category/info/${id}`);
   if (res.data.code == 0) {
     return res.data.data;
   }

+ 8 - 1
src/api/codeManagement/index.js

@@ -38,7 +38,14 @@ export async function getCodeDetail (id) {
   }
   return Promise.reject(new Error(res.data.message));
 }
-
+// 生成编码
+export async function getCode (code) {
+  const res = await request.get(`/main/codemanage/getCode/` + code, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 
 /**
  * 检查编码是否存在

+ 3 - 1
src/enum/dict.js

@@ -4,5 +4,7 @@ export default {
   分隔符: 'separate',
   任务类型: 'taskCategory',
   流程分类: 'processCategory',
-  角度: 'angle'
+  角度: 'angle',
+  金额单位: 'money_unit',
+  时间单位: 'time_unit'
 };

+ 75 - 119
src/views/classifyManage/itemInformation/add.vue

@@ -31,6 +31,7 @@
           <ItemForm
             ref="itemFormRef"
             :itemForm="itemForm"
+            :prefix="prefix"
             :defaultNum="defaultNum"
           />
         </div>
@@ -68,9 +69,9 @@
   import {
     informationAdd,
     getDetails,
-    informationEdit,
-    getOrderNo
+    informationEdit
   } from '@/api/classifyManage/itemInformation';
+  import { getCode } from '@/api/codeManagement';
   export default {
     components: { ItemForm, RowForm, ItemMatch },
     mixins: [dictMixins],
@@ -78,11 +79,12 @@
       return {
         pageTitle: '',
         itemForm: {
-          classificationUrlId: [],
+          categoryLevelPathId: [],
           addList: [],
           info: {
             angle: 'notA'
           },
+          unpack: 0,
           urlIdList: [],
           univalenceUnit: 'yuan',
           expirationDateUnit: 'minute',
@@ -99,6 +101,13 @@
       };
     },
     computed: {
+      prefix () {
+        const obj =
+          (this.dict[this.dictEnum['分类编号']] || []).find(
+            (itm) => itm.dictCode === this.defaultNum
+          ) || {};
+        return obj && obj.dictValue;
+      },
       typeList () {
         const noList = this.dict[this.dictEnum['分类编号']] || [];
 
@@ -115,22 +124,20 @@
         });
       }
     },
-    created () {
-      this.requestDict('分类编号');
-      this.requestDict('类型用途');
+    async created () {
+      await this.requestDict('分类编号');
+      await this.requestDict('类型用途');
       this.pageTitle = this.$route.query.pageTitle;
       if (this.pageTitle == '新建物品') {
         this.selectNode = JSON.parse(this.$route.query.selectNode);
         console.log('selectNode', this.selectNode);
         if (this.selectNode) {
-          this.itemForm.classificationId = this.selectNode.id;
-          let code = 1;
+          this.itemForm.categoryLevelPathId = this.selectNode.id;
           if (this.selectNode.id != '0') {
             this.defaultNum = this.selectNode.type;
             this.setDefault(this.defaultNum);
           }
           this.itemForm.urlIdList = this.selectNode.urlIdList;
-          this.getTreeData(code);
         }
       } else {
         this.getDetilInfo(this.$route.query.id);
@@ -144,12 +151,9 @@
     },
     methods: {
       async getOrderCode () {
-        const res = await getOrderNo(this.defaultNum);
-        if (res.success) {
-          this.newCode = res.data;
-          this.$set(this.itemForm, 'itemCode', res.data.substring(3));
-          // console.log('itemCode',res.data)
-        }
+        const data = await getCode('material_management');
+        this.newCode = data;
+        this.$set(this.itemForm, 'itemCode', data);
       },
 
       // 在 Input 值改变时触发
@@ -163,51 +167,44 @@
 
       // 获取详情
       async getDetilInfo (id) {
-        const res = await getDetails(id);
-        if (res.success) {
-          this.defaultNum = res.data.classificationCode;
-          this.chooseItem(res.data.classificationCode);
-          this.itemForm = res.data;
-          if (res.data.univalence) {
-            this.$set(this.itemForm, 'univalence', res.data.univalence);
-          } else {
-            this.$set(this.itemForm, 'univalence', 'null');
-          }
-          if (res.data.expirationDate) {
-            this.$set(this.itemForm, 'expirationDate', res.data.expirationDate);
-          } else {
-            this.$set(this.itemForm, 'expirationDate', 'null');
-          }
-          this.$set(this.itemForm, 'info', JSON.parse(res.data.extendField));
-          this.$set(this.itemForm, 'informationName', res.data.informationName);
-          this.$set(
-            this.itemForm,
-            'addList',
-            JSON.parse(res.data.selfDefinedParameter)
-          );
-          this.itemForm.urlIdList = JSON.parse(res.data.classificationUrlId);
-          if (this.pageTitle == '编辑物品') {
-            // this.itemForm.itemCode = res.data.informationCode.substring(3)
-            this.$set(
-              this.itemForm,
-              'itemCode',
-              res.data.informationCode.substring(3)
+        const data = await getDetails(id);
+        this.chooseItem({ code: data.type });
+        this.itemForm = data;
+        if (data.univalence) {
+          this.$set(this.itemForm, 'univalence', data.univalence);
+        } else {
+          this.$set(this.itemForm, 'univalence', 'null');
+        }
+        if (data.expirationDate) {
+          this.$set(this.itemForm, 'expirationDate', data.expirationDate);
+        } else {
+          this.$set(this.itemForm, 'expirationDate', 'null');
+        }
+        this.$set(this.itemForm, 'info', JSON.parse(data.extendField));
+        this.$set(this.itemForm, 'name', data.name);
+        this.$set(
+          this.itemForm,
+          'addList',
+          JSON.parse(data.selfDefinedParameter)
+        );
+        this.itemForm.urlIdList = JSON.parse(data.categoryLevelPathId);
+        if (this.pageTitle == '编辑物品') {
+          // this.itemForm.itemCode = data.code.substring(3)
+          this.$set(this.itemForm, 'itemCode', data.code.substring(3));
+        } else {
+          this.$set(this.itemForm, 'isCitation', false);
+          this.$set(this.itemForm, 'itemCode', this.newCode.substring(3));
+        }
+        this.$set(this.itemForm, 'unpack', data.unpack);
+        // this.itemForm.isTransferAssets = data.isTransferAssets
+        //   ? 'true'
+        //   : 'false';
+        for (const key in this.itemForm.categoryVoRelationMap) {
+          this.$refs.itemMatchRef &&
+            this.$refs.itemMatchRef.matchList(
+              key,
+              this.itemForm.categoryVoRelationMap
             );
-          } else {
-            this.$set(this.itemForm, 'isCitation', false);
-            this.$set(this.itemForm, 'itemCode', this.newCode.substring(3));
-          }
-          this.itemForm.isTransferAssets = res.data.isTransferAssets
-            ? 'true'
-            : 'false';
-          this.itemForm.isUnpack = res.data.isUnpack ? 'true' : 'false';
-          for (const key in this.itemForm.informationRelationMap) {
-            this.$refs.itemMatchRef &&
-              this.$refs.itemMatchRef.matchList(
-                key,
-                this.itemForm.informationRelationMap
-              );
-          }
         }
       },
 
@@ -217,9 +214,8 @@
         this.initItemForm();
         this.$refs.itemFormRef.$refs.formName.resetFields();
         this.getOrderCode();
-        this.itemForm.classificationCode = item.prefix;
+        this.itemForm.type = item.code;
         this.selectNode = null;
-        this.getTreeData(item.code);
         this.setDefault(item.code);
       },
 
@@ -239,20 +235,16 @@
 
           this.requestData = this.itemForm;
           const { pathName, pathId } = this.$refs.itemFormRef.getText();
-          this.requestData.classificationUrl = pathName;
-          this.requestData.classificationId = pathId;
-          this.requestData.isTransferAssets =
-            this.requestData.isTransferAssets == 'true' ? true : false;
-          this.requestData.isUnpack =
-            this.requestData.isUnpack == 'true' ? true : false;
+          this.requestData.categoryLevelPath = pathName;
+          this.requestData.categoryLevelId = pathId;
+          this.requestData.type = this.defaultNum;
           this.requestData.selfDefinedParameter = JSON.stringify(
             this.requestData.addList
           );
           this.requestData.extendField = JSON.stringify(this.requestData.info);
-          this.requestData.informationCode =
-            this.defaultNum + this.requestData.itemCode;
+          this.requestData.code = this.prefix + this.requestData.itemCode;
           this.requestData.classificationCode = this.defaultNum;
-          this.requestData.classificationUrlId = JSON.stringify(
+          this.requestData.categoryLevelPathId = JSON.stringify(
             this.requestData.urlIdList
           );
           this.requestData.expirationDate = this.itemForm.expirationDate
@@ -261,13 +253,15 @@
           this.requestData.univalence = this.itemForm.univalence
             ? this.itemForm.univalence
             : null;
-          this.requestData.informationRelation =
+          this.requestData.categoryVoRelation =
             (this.$refs.itemMatchRef && this.$refs.itemMatchRef.getMapList()) ||
             [];
 
+          //不传报错
+          this.requestData.iotProductSchema = '{}';
           if (this.pageTitle == '编辑物品') {
             this.requestData.mainInformationId = this.$route.query.id;
-            delete this.requestData.informationRelationMap;
+            delete this.requestData.categoryVoRelationMap;
             this.$confirm(
               '参数信息有变更,与当前已存在的台账信息参数不一致,确定后将同步已存在的台账信息参数 !',
               '重要提示!',
@@ -280,52 +274,24 @@
             )
               .then(() => {
                 informationEdit(this.requestData).then((res) => {
-                  if (res.success) {
-                    this.$message.success('物品编辑成功');
-                    this.$router.push({
-                      path: '/warehouseManagement/itemInformation'
-                    });
-                  }
+                  this.$message.success('物品编辑成功');
+                  this.$router.push({
+                    path: '/classifyManage/itemInformation'
+                  });
                 });
               })
               .catch(() => {});
           } else {
             informationAdd(this.requestData).then((res) => {
-              if (res.success) {
-                this.$message.success('物品新增成功');
-                this.$router.push({
-                  path: '/warehouseManagement/itemInformation'
-                });
-              }
+              this.$message.success('物品新增成功');
+              this.$router.push({
+                path: '/classifyManage/itemInformation'
+              });
             });
           }
         });
       },
 
-      async getTreeData (code) {
-        // try {
-        //   const res = await common.getClassify({
-        //     type: code,
-        //     id: '0'
-        //   });
-        //   if (res.success) {
-        //     this.classList = res.data;
-        //     if (this.selectNode) {
-        //       this.$nextTick(() => {
-        //         this.convertTreeData(res.data);
-        //         if (!this.selectNode.hasOwnProperty('children')) {
-        //           this.urlIdList = [];
-        //           this.urlIdList.push(this.selectNode.id);
-        //           let parentId = this.selectNode.parentId;
-        //           this.deepEach(parentId);
-        //           this.itemForm.urlIdList = this.urlIdList.reverse();
-        //         }
-        //       });
-        //     }
-        //   }
-        // } catch (error) {}
-      },
-
       convertTreeData (data) {
         this.changeData = data;
         for (let i = 0; i < this.changeData.length; i++) {
@@ -337,23 +303,13 @@
         }
       },
 
-      // 子节点处理
-      deepEach (parentId) {
-        this.changeData.map((item, index) => {
-          if (item.id == parentId) {
-            this.urlIdList.push(item.id);
-            this.deepEach(item.parentId); // 递归
-          }
-        });
-      },
-
       setDefault (val) {
         this.$refs.itemMatchRef && this.$refs.itemMatchRef.setDefault(val);
       },
 
       initItemForm () {
         this.itemForm = {
-          classificationUrlId: [],
+          categoryLevelPathId: [],
           addList: [],
           info: { angle: 'notA' },
           urlIdList: [],

+ 3 - 6
src/views/classifyManage/itemInformation/components/AddDialog.vue

@@ -67,13 +67,10 @@
             ></el-table-column>
             <el-table-column
               label="物品编码"
-              prop="informationCode"
+              prop="code"
               width="130"
             ></el-table-column>
-            <el-table-column
-              label="物品名称"
-              prop="informationName"
-            ></el-table-column>
+            <el-table-column label="物品名称" prop="name"></el-table-column>
             <el-table-column
               label="牌号"
               prop="brandNum"
@@ -238,7 +235,7 @@
       handleNodeClick (data, node) {
         if (data.id === this.currentTreeData.id) return;
         this.currentTreeData = data;
-        this.searchForm.classificationId = data.id;
+        this.searchForm.categoryLevelPathId = data.id;
         this.handleList();
       },
 

+ 8 - 8
src/views/classifyManage/itemInformation/components/ItemDetail.vue

@@ -1,13 +1,13 @@
 <template>
   <el-form label-width="90px" class="formBox">
     <el-form-item label="分类">
-      <span>{{ customForm.classificationUrl }}</span>
+      <span>{{ customForm.categoryLevelPath }}</span>
     </el-form-item>
     <el-form-item label="物品编码">
-      <span>{{ customForm.informationCode }}</span>
+      <span>{{ customForm.code }}</span>
     </el-form-item>
     <el-form-item label="物品名称">
-      <span>{{ customForm.informationName }}</span>
+      <span>{{ customForm.name }}</span>
     </el-form-item>
     <el-form-item label="计量单位">
       <span>{{ customForm.measuringUnit }}</span>
@@ -34,8 +34,8 @@
     <!-- <el-form-item label="允许转资产" prop="isTransferAssets">
              <span>{{customForm.isTransferAssets?'允许':'不允许'}}</span>
          </el-form-item> -->
-    <el-form-item label="允许拆包" prop="isUnpack">
-      <span>{{ customForm.isUnpack ? '允许' : '不允许' }}</span>
+    <el-form-item label="允许拆包" prop="unpack">
+      <span>{{ customForm.unpack ? '允许' : '不允许' }}</span>
     </el-form-item>
     <el-form-item label="描述" prop="itemRemark">
       <span>{{ customForm.description }}</span>
@@ -52,7 +52,7 @@
       }
     },
     components: {},
-    data() {
+    data () {
       return {
         inventoryMode: ['逐个盘点', '批量盘点', '混合模式'],
         priceList: [
@@ -71,7 +71,7 @@
       };
     },
     watch: {
-      customForm(val) {
+      customForm (val) {
         if (val) {
           this.priceList.map((item) => {
             if (item.name == val.univalenceUnit) {
@@ -86,7 +86,7 @@
         }
       }
     },
-    created() {},
+    created () {},
     methods: {}
   };
 </script>

+ 45 - 24
src/views/classifyManage/itemInformation/components/ItemForm.vue

@@ -27,14 +27,11 @@
         maxlength="9"
         :disabled="itemForm.isCitation"
       >
-        <template slot="prepend">{{ defaultNum }}</template>
+        <template slot="prepend">{{ prefix }}</template>
       </el-input>
     </el-form-item>
-    <el-form-item label="物品名称" prop="informationName">
-      <el-input
-        placeholder="请输入"
-        v-model="itemForm.informationName"
-      ></el-input>
+    <el-form-item label="物品名称" prop="name">
+      <el-input placeholder="请输入" v-model="itemForm.name"></el-input>
     </el-form-item>
     <el-form-item label="计量单位" prop="measuringUnit">
       <el-input
@@ -54,7 +51,12 @@
           :min="0"
           style="width: 80%; margin-right: 10px"
         ></el-input-number>
-        <el-select
+        <DictSelection
+          dictName="金额单位"
+          v-model="itemForm.univalenceUnit"
+          class="w40"
+        ></DictSelection>
+        <!-- <el-select
           v-model="itemForm.univalenceUnit"
           placeholder="请选择"
           class="w40"
@@ -66,7 +68,7 @@
             :value="item.name"
           >
           </el-option>
-        </el-select>
+        </el-select> -->
       </div>
     </el-form-item>
     <el-form-item label="保质期" prop="expirationDate">
@@ -78,7 +80,12 @@
           :min="0"
           style="width: 80%; margin-right: 10px"
         ></el-input-number>
-        <el-select
+        <DictSelection
+          dictName="时间单位"
+          v-model="itemForm.expirationDateUnit"
+          class="w40"
+        ></DictSelection>
+        <!-- <el-select
           v-model="itemForm.expirationDateUnit"
           placeholder="请选择"
           class="w40"
@@ -90,7 +97,7 @@
             :value="item.name"
           >
           </el-option>
-        </el-select>
+        </el-select> -->
       </div>
     </el-form-item>
     <el-form-item label="安全库存" prop="safeStock">
@@ -109,11 +116,11 @@
                 inactive-value="false"
              > </el-switch>
          </el-form-item> -->
-    <el-form-item label="允许拆包" prop="isUnpack">
+    <el-form-item label="允许拆包" prop="unpack">
       <el-switch
-        v-model="itemForm.isUnpack"
-        active-value="true"
-        inactive-value="false"
+        v-model="itemForm.unpack"
+        :active-value="1"
+        :inactive-value="0"
         :disabled="itemForm.isCitation"
       >
       </el-switch>
@@ -131,19 +138,27 @@
 </template>
 
 <script>
-  import { getTreeByPid, getTreeByType } from '@/api/classifyManage';
+  import { getTreeByType } from '@/api/classifyManage';
+  import { debounce } from 'throttle-debounce';
+  // import dictMixins from "@/mixins/dictMixins"
+
   export default {
+    // mixins:[dictMixins],
     props: {
       itemForm: {
         type: Object,
         default: {}
       },
+      prefix: {
+        type: String,
+        default: ''
+      },
       defaultNum: {
         type: String,
-        default: '1'
+        default: ''
       }
     },
-    components: {},
+
     data () {
       let validateCode = (rule, value, callback) => {
         let reg = /[\u4e00-\u9fa5]/;
@@ -169,7 +184,7 @@
             { required: true, message: '请输入物品编码', trigger: 'blur' },
             { validator: validateCode, trigger: 'blur' }
           ],
-          informationName: [
+          name: [
             { required: true, message: '请输入物品名称', trigger: 'blur' }
           ],
           measuringUnit: [
@@ -205,16 +220,22 @@
       };
     },
     watch: {
-      classList (val) {
-        this.keyValue++;
+      defaultNum: {
+        immediate: true,
+        handler () {
+          this.keyValue++;
+          this.getTreeList();
+        }
       }
     },
     created () {
-      this.getTreeList();
+      // this.requestDict('金额单位')
+      // this.requestDict('时间单位')
+      this.getTreeList = debounce(500, this.getTreeList);
     },
     methods: {
       async getTreeList () {
-        const res = await getTreeByPid(0);
+        const res = await getTreeByType(this.defaultNum);
         if (res.code === '0') {
           this.classList = res.data;
         }
@@ -270,8 +291,8 @@
     .el-select.el-select--medium {
       width: 100%;
     }
-    .w40.el-select.el-select--medium {
-      width: 40%;
+    .w40 {
+      width: 40% !important;
     }
     .el-radio {
       display: block;

+ 30 - 21
src/views/classifyManage/itemInformation/components/item-list.vue

@@ -29,7 +29,7 @@
           type="primary"
           :underline="false"
           icon="el-icon-unlock"
-          @click="toUnBind(row)"
+          @click="openClone(row)"
         >
           克隆
         </el-link>
@@ -110,12 +110,12 @@
             fixed: 'left'
           },
           {
-            prop: 'informationCode',
+            prop: 'code',
             label: '物品编码',
             showOverflowTooltip: true
           },
           {
-            prop: 'informationName',
+            prop: 'name',
             label: '物品名称',
             showOverflowTooltip: true
           },
@@ -137,7 +137,7 @@
             align: 'center'
           },
           {
-            prop: 'classificationUrl',
+            prop: 'categoryLevelPath',
             label: '分类',
             showOverflowTooltip: true
           },
@@ -155,6 +155,7 @@
     methods: {
       /* 表格数据源 */
       datasource ({ page, limit, where }) {
+        console.log(this.where);
         return getList({
           ...where,
           pageNum: page,
@@ -163,24 +164,32 @@
       },
       /* 刷新表格 */
       reload (where) {
-        this.$refs.table.reload({ pageNum: 1, where: where });
+        this.$nextTick(() => {
+          this.$refs.table.reload({
+            pageNum: 1,
+            where: { ...where, categoryLevelId: this.current?.data?.id }
+          });
+        });
       },
       /* 显示编辑 */
-      openEdit (row) {},
-
-      // 解除绑定
-      toUnBind (row) {
-        const loading = this.$loading({ lock: true });
-        unbindLoginName(row.id)
-          .then((res) => {
-            loading.close();
-            this.$message.success('解绑成功');
-            this.reload();
-          })
-          .catch((e) => {
-            loading.close();
-            this.$message.error(e.message);
-          });
+      openEdit (row) {
+        this.$router.push({
+          path: '/classifyManage/itemInformation/add',
+          query: {
+            pageTitle: '编辑物品',
+            id: row.id
+          }
+        });
+      },
+      /* 显示编辑 */
+      openClone (row) {
+        this.$router.push({
+          path: '/classifyManage/itemInformation/add',
+          query: {
+            pageTitle: '克隆物品',
+            id: row.id
+          }
+        });
       },
       /* 删除 */
       remove (row) {
@@ -209,8 +218,8 @@
     watch: {
       // 监听机构id变化
       current: {
+        immediate: true,
         handler () {
-          console.log(this.current);
           this.reload();
         }
       }

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

@@ -355,7 +355,7 @@
         }
       },
       handleDelete (index, row) {
-        this.$confirm(`确认删除[${row.informationName}]吗?`)
+        this.$confirm(`确认删除[${row.name}]吗?`)
           .then(async () => {
             switch (this.activeName) {
               case 'product': {

+ 10 - 7
src/views/classifyManage/itemInformation/components/item-search.vue

@@ -8,19 +8,19 @@
   >
     <el-row :gutter="15">
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="物品编码:">
+        <el-form-item label="物品编码:" prop="informationCode">
           <el-input
             clearable
             placeholder="请输入"
-            v-model.trim="params.code"
+            v-model.trim="params.informationCode"
           ></el-input>
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
-        <el-form-item label="物品名称:">
+        <el-form-item label="物品名称:" prop="informationName">
           <el-input
             clearable
-            v-model="params.name"
+            v-model="params.informationName"
             placeholder="请输入"
           ></el-input>
         </el-form-item>
@@ -46,8 +46,8 @@
     data () {
       // 默认表单数据
       const defaultParams = {
-        name: '',
-        code: ''
+        informationName: '',
+        informationCode: ''
       };
       return {
         // 表单数据
@@ -63,7 +63,10 @@
     methods: {
       /* 搜索 */
       search () {
-        this.$emit('search', this.params);
+        console.log(this.current);
+        this.$emit('search', {
+          ...this.params
+        });
       },
       /*  重置 */
       reset () {

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

@@ -14,11 +14,11 @@ export default {
           width: 80
         },
         {
-          prop: 'informationCode',
+          prop: 'code',
           label: '物品编码'
         },
         {
-          prop: 'informationName',
+          prop: 'name',
           label: '物品名称'
         },
         {
@@ -35,7 +35,7 @@ export default {
           formatter: this.classificationCodeFormatter
         },
         {
-          prop: 'classificationUrl',
+          prop: 'categoryLevelPath',
           label: '分类'
         },
         {
@@ -54,11 +54,11 @@ export default {
           width: 50
         },
         {
-          prop: 'informationCode',
+          prop: 'code',
           label: '物品编码'
         },
         {
-          prop: 'informationName',
+          prop: 'name',
           label: '物品名称'
         },
         {
@@ -85,7 +85,7 @@ export default {
           formatter: this.classificationCodeFormatter
         },
         {
-          prop: 'classificationUrl',
+          prop: 'categoryLevelPath',
           label: '分类'
         },
         {
@@ -104,11 +104,11 @@ export default {
           width: 50
         },
         {
-          prop: 'informationCode',
+          prop: 'code',
           label: '物品编码'
         },
         {
-          prop: 'informationName',
+          prop: 'name',
           label: '物品名称'
         },
         {
@@ -121,7 +121,7 @@ export default {
           formatter: this.classificationCodeFormatter
         },
         {
-          prop: 'classificationUrl',
+          prop: 'categoryLevelPath',
           label: '分类'
         },
         {
@@ -140,11 +140,11 @@ export default {
           width: 50
         },
         {
-          prop: 'informationCode',
+          prop: 'code',
           label: '物品编码'
         },
         {
-          prop: 'informationName',
+          prop: 'name',
           label: '物品名称'
         },
         {
@@ -157,7 +157,7 @@ export default {
           formatter: this.classificationCodeFormatter
         },
         {
-          prop: 'classificationUrl',
+          prop: 'categoryLevelPath',
           label: '分类'
         },
         {
@@ -182,11 +182,11 @@ export default {
           width: 50
         },
         {
-          prop: 'informationCode',
+          prop: 'code',
           label: '物品编码'
         },
         {
-          prop: 'informationName',
+          prop: 'name',
           label: '物品名称'
         },
         {
@@ -195,7 +195,7 @@ export default {
           formatter: this.classificationCodeFormatter
         },
         {
-          prop: 'classificationUrl',
+          prop: 'categoryLevelPath',
           label: '分类'
         },
         {

+ 17 - 17
src/views/classifyManage/itemInformation/details.vue

@@ -39,9 +39,9 @@
               >
                 <el-table-column type="index" label="序号" width="50">
                 </el-table-column>
-                <el-table-column prop="informationCode" label="物品编码">
+                <el-table-column prop="code" label="物品编码">
                 </el-table-column>
-                <el-table-column prop="informationName" label="物品名称">
+                <el-table-column prop="name" label="物品名称">
                 </el-table-column>
                 <el-table-column prop="brandNum" label="牌号">
                 </el-table-column>
@@ -53,7 +53,7 @@
                   :formatter="classificationCodeFormatter"
                 >
                 </el-table-column>
-                <el-table-column prop="classificationUrl" label="分类">
+                <el-table-column prop="categoryLevelPath" label="分类">
                 </el-table-column>
               </el-table>
             </el-tab-pane>
@@ -69,9 +69,9 @@
               >
                 <el-table-column type="index" label="序号" width="50">
                 </el-table-column>
-                <el-table-column prop="informationCode" label="物品编码">
+                <el-table-column prop="code" label="物品编码">
                 </el-table-column>
-                <el-table-column prop="informationName" label="物品名称">
+                <el-table-column prop="name" label="物品名称">
                 </el-table-column>
                 <el-table-column prop="brandNum" label="牌号">
                 </el-table-column>
@@ -83,7 +83,7 @@
                   :formatter="classificationCodeFormatter"
                 >
                 </el-table-column>
-                <el-table-column prop="classificationUrl" label="分类">
+                <el-table-column prop="categoryLevelPath" label="分类">
                 </el-table-column>
               </el-table>
             </el-tab-pane>
@@ -99,9 +99,9 @@
               >
                 <el-table-column type="index" label="序号" width="50">
                 </el-table-column>
-                <el-table-column prop="informationCode" label="物品编码">
+                <el-table-column prop="code" label="物品编码">
                 </el-table-column>
-                <el-table-column prop="informationName" label="物品名称">
+                <el-table-column prop="name" label="物品名称">
                 </el-table-column>
                 <el-table-column prop="modelType" label="型号">
                 </el-table-column>
@@ -111,7 +111,7 @@
                   :formatter="classificationCodeFormatter"
                 >
                 </el-table-column>
-                <el-table-column prop="classificationUrl" label="分类">
+                <el-table-column prop="categoryLevelPath" label="分类">
                 </el-table-column>
               </el-table>
             </el-tab-pane>
@@ -130,9 +130,9 @@
               >
                 <el-table-column type="index" label="序号" width="50">
                 </el-table-column>
-                <el-table-column prop="informationCode" label="物品编码">
+                <el-table-column prop="code" label="物品编码">
                 </el-table-column>
-                <el-table-column prop="informationName" label="物品名称">
+                <el-table-column prop="name" label="物品名称">
                 </el-table-column>
                 <el-table-column prop="brandNum" label="牌号">
                 </el-table-column>
@@ -142,7 +142,7 @@
                   :formatter="classificationCodeFormatter"
                 >
                 </el-table-column>
-                <el-table-column prop="classificationUrl" label="分类">
+                <el-table-column prop="categoryLevelPath" label="分类">
                 </el-table-column>
                 <el-table-column prop="num" label="数量"> </el-table-column>
                 <el-table-column prop="date" label="计量单位">
@@ -161,9 +161,9 @@
               >
                 <el-table-column type="index" label="序号" width="50">
                 </el-table-column>
-                <el-table-column prop="informationCode" label="物品编码">
+                <el-table-column prop="code" label="物品编码">
                 </el-table-column>
-                <el-table-column prop="informationName" label="物品名称">
+                <el-table-column prop="name" label="物品名称">
                 </el-table-column>
                 <el-table-column prop="modelType" label="型号">
                 </el-table-column>
@@ -173,7 +173,7 @@
                   :formatter="classificationCodeFormatter"
                 >
                 </el-table-column>
-                <el-table-column prop="classificationUrl" label="分类">
+                <el-table-column prop="categoryLevelPath" label="分类">
                 </el-table-column>
               </el-table>
             </el-tab-pane>
@@ -248,8 +248,8 @@
           this.defaultNum = res.data.classificationCode;
           this.formatterValue(res.data.classificationCode);
           this.setDefault(res.data.classificationCode);
-          for (const key in this.customForm.informationRelationMap) {
-            this.matchList(key, this.customForm.informationRelationMap);
+          for (const key in this.customForm.categoryVoRelationMap) {
+            this.matchList(key, this.customForm.categoryVoRelationMap);
           }
         }
       },

+ 1 - 1
src/views/classifyManage/itemInformation/index.vue

@@ -80,7 +80,7 @@
             urlIdList.unshift(node.parent?.data?.id);
             node = node.parent;
           }
-          data.urlIdList = urlIdList;
+          data.urlIdList = urlIdList.filter((i) => i !== '0');
         }
         this.$router.push({
           path: '/classifyManage/itemInformation/add',

+ 4 - 3
vue.config.js

@@ -2,7 +2,7 @@ const CompressionWebpackPlugin = require('compression-webpack-plugin');
 const { transformElementScss } = require('ele-admin/lib/utils/dynamic-theme');
 const path = require('path');
 
-function resolve(dir) {
+function resolve (dir) {
   return path.join(__dirname, dir);
 }
 
@@ -22,10 +22,11 @@ module.exports = {
       '/api': {
         // target: 'http://192.168.3.51:86', // 测试
 
-        target: 'http://192.168.3.35:8080', // kang杨威
+        // target: 'http://192.168.3.35:8080', // kang杨威
         // target: 'http://192.168.3.25:8080', // 黄峥嵘
         // target: 'http://192.168.3.41:8080', // 何江鹏
         // target: 'http://192.168.3.33:8080', // 谢一平
+        target: 'http://192.168.3.34:8080', // 刘毅
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
@@ -34,7 +35,7 @@ module.exports = {
       }
     }
   },
-  chainWebpack(config) {
+  chainWebpack (config) {
     config.plugins.delete('prefetch');
     // set svg-sprite-loader
     // config.module.rule('svg').exclude.add(resolve('./src/icons')).end();