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

Merge remote-tracking branch 'origin/dev' into dev

Z 1 год назад
Родитель
Сommit
41f0e107f6

+ 10 - 0
src/api/material/list.js

@@ -109,3 +109,13 @@ export async function importCategorySparePart(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+// 删除包装规格
+export async function deletePackageDisposition(data) {
+  const res = await request.delete(`/main/categoryPackageDisposition/delete`, {
+    data
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 5 - 0
src/enum/dict.js

@@ -51,6 +51,11 @@ export default {
   生产类型: 'productionType',
   质检标准类型: 'quality_testing_code',
   质检方式: 'quality_method_code',
+  质检项标准单位: 'quality_inspection_standard_unit',
+  数学字符: 'mathematical_symbol',
+  质检类型: 'inspection_type',
+  不良品处理类型: 'unqualified_products_type',
+  质检计划类型: 'inspection_plan_type',
   预警类型: 'warning_type'
 
 };

+ 3 - 0
src/utils/eventBus.js

@@ -0,0 +1,3 @@
+// eventBus.js
+import Vue from 'vue';
+export const EventBus = new Vue()

+ 31 - 0
src/views/material/BOMmanage/components/detailedList.vue

@@ -14,6 +14,19 @@
         class="dict-table"
         tool-class="ele-toolbar-actions"
       >
+      
+      <template v-slot:toolbar>
+    
+        <div class="toolbar_box">
+                <div
+                  ><span>基本数量</span>
+                  <el-input placeholder="请输入" v-model.number="attributeData.baseCount">
+                  </el-input>
+                  <DictSelection dictName="计量单位" v-model="attributeData.baseCountUnit"
+                /></div>
+              </div>
+        </template>
+
         <!-- 表头工具栏 -->
         <template v-slot:action="{ row }">
           <el-switch
@@ -196,4 +209,22 @@
       }
     }
   }
+
+
+  .toolbar_box {
+    float: right;
+    margin-right: 10px;
+    > div {
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      > span {
+        width: 150px;
+      }
+      > div {
+        margin-left: 10px;
+      }
+    }
+  }
+  
 </style>

+ 14 - 3
src/views/material/BOMmanage/components/workingProcedure.vue

@@ -158,7 +158,7 @@
           </ele-pro-table>
         </el-tab-pane>
         <el-tab-pane label="质检项参数" name="质检项参数">
-          <term></term>
+          <term :qualityParam="qualityParam" ref="qualityParamRef"></term>
         </el-tab-pane>
         <el-tab-pane label="生产节拍" name="生产节拍">
           <el-form label-width="100px" ref="form" :model="beatParam">
@@ -1305,7 +1305,9 @@
         currentIndex: 0,
         tableData: {},
         beatParam: {},
-        normalHours: {}
+        normalHours: {},
+        qualityParam: [],
+        qualityPointParam: []
       };
     },
     created() {
@@ -1550,7 +1552,11 @@
           this.$refs.table.setData(
             this.tableData.taskParam[this.currentIndex].produceList || []
           );
-        } else if (this.activeName === '生产节拍') {
+        }  else  if (this.activeName === '质检项参数') {
+           this.qualityParam =  this.tableData.taskParam[this.currentIndex].qualityParam  || []
+        } 
+        
+        else if (this.activeName === '生产节拍') {
           console.log(this.tableData.taskParam[this.currentIndex].beatParam);
           this.beatParam =
             this.tableData.taskParam[this.currentIndex].beatParam || {};
@@ -1750,6 +1756,11 @@
           this.tableData.taskParam[this.currentIndex].baseCountUnit2 =
             this.baseCountUnit2;
 
+            if(this.$refs.qualityParamRef) {
+              this.tableData.taskParam[this.currentIndex].qualityParam =  this.$refs.qualityParamRef.getDate()  || []
+             
+            }
+
           workingProcedureUpdate({
             id: this.tableData.id,
             categoryId: this.treeData.categoryId,

+ 3 - 7
src/views/material/BOMmanage/components/workmanship.vue

@@ -22,21 +22,17 @@
             <el-form-item label="版本:" label-width="100px">
               <el-input
                 clearable
-                v-model.trim="where.fixCode"
+                v-model.trim="where.versions"
                 placeholder="请输入"
               />
             </el-form-item>
           </el-col>
-          <el-col :span="6">
-            <el-form-item label="状态:" label-width="100px">
-              <el-input clearable v-model.trim="where.name" placeholder="请输入" />
-            </el-form-item>
-          </el-col>
+
         </el-row>
         <el-row type="flex" :gutter="15">
           <el-col :span="6">
             <el-form-item label="所属工作中心" label-width="100px">
-              <el-input clearable v-model.trim="where.name" placeholder="请输入" />
+              <el-input clearable v-model.trim="where.workCenterName" placeholder="请输入" />
             </el-form-item>
           </el-col>
           <el-col :span="18">

+ 134 - 120
src/views/material/BOMmanage/qualityTesting/inspectionClassify/components/edit.vue

@@ -2,7 +2,7 @@
 <template>
   <el-dialog
     class="ele-dialog-form"
-    :title="title"
+    title="质检项"
     :visible.sync="visible"
     :before-close="handleClose"
     :close-on-click-modal="false"
@@ -11,118 +11,97 @@
     append-to-body
   >
     <el-form ref="form" :model="form" :rules="rules" label-width="100px">
-      <el-row>
-        <el-col :span="24">
-          <el-tabs v-model="activeName" type="card">
-            <el-tab-pane
-              :label="item.name"
-              :name="item.name"
-              v-for="item in activeList"
-              :key="item.name"
-            >
-              <el-table
-                v-show="activeName == '质检项' "
-                style="margin-top: 15px"
-                :data="form.parameterStandards"
-                border
-                height="40vh"
-              >
-                <el-table-column
-                  :label="form.singleWeightDivision"
-                  align="center"
-                >
-                  <el-table-column
-                    label="参数上限"
-                    align="center"
-                    v-if="form.parameterType == 3"
-                  >
-                    <template slot-scope="scope">
-                      <el-form-item label-width="0" prop="finalValue">
-                        <el-input
-                          clearable
-                          :disabled="type == 'detail'"
-                          v-model="scope.row.finalValue"
-                          placeholder="请输入"
-                        />
-                      </el-form-item>
-                    </template>
-                  </el-table-column>
-                  <el-table-column
-                    label="参数下限"
-                    align="center"
-                    v-if="form.parameterType == 3"
-                  >
-                    <template slot-scope="scope">
-                      <el-form-item label-width="0" prop="initialValue">
-                        <el-input
-                          :disabled="type == 'detail'"
-                          clearable
-                          v-model="scope.row.initialValue"
-                          placeholder="请输入"
-                        />
-                      </el-form-item>
-                    </template>
-                  </el-table-column>
-                  <el-table-column
-                    label="默认值"
-                    align="center"
-                    v-if="form.parameterType != 3"
-                  >
-                    <template slot-scope="scope">
-                      <el-form-item label-width="0" prop="defaultValue">
-                        <el-input
-                          clearable
-                          :disabled="type == 'detail'"
-                          v-model="scope.row.defaultValue"
-                          placeholder="请输入"
-                        />
-                      </el-form-item>
-                    </template>
-                  </el-table-column>
-                </el-table-column>
-                <el-table-column :label="form.tolerance" align="center">
-                  <el-table-column label="质检标准" align="center">
-                    <template slot-scope="scope">
-                      <el-form-item label-width="0" prop="inspectionStandard">
-                        <el-input
-                          clearable
-                          v-model="scope.row.toleranceValue"
-                          placeholder="请输入"
-                          :disabled="type == 'detail'"
-                        >
-                          <DictSelection
-                            style="width: 100px"
-                            slot="prepend"
-                            clearable
-                            :disabled="type == 'detail'"
-                            dictName="数学字符"
-                            v-model="scope.row.symbol"
-                          ></DictSelection>
-                        </el-input>
-                        <!-- </el-form-item> -->
-                      </el-form-item>
-                    </template>
-                  </el-table-column>
-           
-                </el-table-column>
-              </el-table>
-
-            </el-tab-pane></el-tabs
-          >
+      <el-table
+        style="margin-top: 15px"
+        :data="form.parameterStandards"
+        border
+        height="40vh"
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column type="selection" align="center" width="55">
+        </el-table-column>
 
+        <el-table-column :label="form.singleWeightDivision" align="center">
+          <el-table-column
+            label="参数上限"
+            align="center"
+            v-if="form.parameterType == 3"
+          >
+            <template slot-scope="scope">
+              <el-form-item label-width="0" prop="finalValue">
+                <el-input
+                  clearable
+                  :disabled="type == 'detail'"
+                  v-model="scope.row.finalValue"
+                  placeholder="请输入"
+                />
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="参数下限"
+            align="center"
+            v-if="form.parameterType == 3"
+          >
+            <template slot-scope="scope">
+              <el-form-item label-width="0" prop="initialValue">
+                <el-input
+                  :disabled="type == 'detail'"
+                  clearable
+                  v-model="scope.row.initialValue"
+                  placeholder="请输入"
+                />
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="默认值"
+            align="center"
+            v-if="form.parameterType != 3"
+          >
+            <template slot-scope="scope">
+              <el-form-item label-width="0" prop="defaultValue">
+                <el-input
+                  clearable
+                  :disabled="type == 'detail'"
+                  v-model="scope.row.defaultValue"
+                  placeholder="请输入"
+                />
+              </el-form-item>
+            </template>
+          </el-table-column>
+        </el-table-column>
 
-        </el-col>
-      </el-row>
+        <el-table-column :label="form.tolerance" align="center">
+          <el-table-column label="质检标准" align="center">
+            <template slot-scope="scope">
+              <el-form-item label-width="0" prop="inspectionStandard">
+                <el-input
+                  clearable
+                  v-model="scope.row.toleranceValue"
+                  placeholder="请输入"
+                  :disabled="type == 'detail'"
+                >
+                  <DictSelection
+                    style="width: 100px"
+                    slot="prepend"
+                    clearable
+                    :disabled="type == 'detail'"
+                    dictName="数学字符"
+                    v-model="scope.row.symbol"
+                  ></DictSelection>
+                </el-input>
+                <!-- </el-form-item> -->
+              </el-form-item>
+            </template>
+          </el-table-column>
+        </el-table-column>
+      </el-table>
     </el-form>
 
     <template v-slot:footer>
       <el-button @click="handleClose">取消</el-button>
-      <el-button
-        type="primary"
-        :loading="loading"
-        @click="save"
-        v-if="type != 'detail'"
-      >
+      <el-button type="primary" :loading="loading" @click="save">
         保存
       </el-button>
     </template>
@@ -130,6 +109,7 @@
 </template>
 
 <script>
+  import { EventBus } from '@/utils/eventBus';
   export default {
     components: {},
 
@@ -144,32 +124,66 @@
         defaultForm,
         // 表单数据
         form: { ...defaultForm() },
-        activeName: '质检项',
-        activeList: [{ name: '质检项' }],
+
         // 表单验证规则
-        rules: {
-     
-        },
+        rules: {},
         visible: false,
 
-        title: null,
-        loading: false
+        type: '',
+        loading: false,
+
+        multipleSelection: [],
+        rowObj: {}
       };
     },
 
     created() {},
     methods: {
-      open(row) {
-        this.form = JSON.parse(JSON.stringify(row));
+      open(type, rowItem) {
+        this.rowObj = rowItem;
+        let row = rowItem.qualityStandard || {};
+        this.type = type;
+        if (this.type != 'add') {
+          row.linePoints = row.linePoints || [];
+          if (!row.parameterStandards) {
+            row.parameterStandards = [];
+          } else {
+            row.singleWeightDivision =
+              row.parameterStandards[0]?.singleWeightDivision;
+            row.tolerance = row.parameterStandards[0]?.tolerance;
+            row.parameterType = row.parameterStandards[0]?.parameterType;
+          }
+          this.form = JSON.parse(JSON.stringify(row));
+  
+        }
         this.visible = true;
       },
- 
 
-      handleDeleteItem(index, list) {
-        this.form[list].splice(index, 1);
+      handleSelectionChange(val) {
+        this.multipleSelection = val;
       },
+
       /* 保存编辑 */
-      save() {},
+      save() {
+        let _row = JSON.parse(JSON.stringify(this.rowObj));
+        let row = _row.qualityStandard || {};
+
+        if (!row.parameterStandards) {
+          row.parameterStandards = [];
+        } else {
+          row.singleWeightDivision =
+            row.parameterStandards[0]?.singleWeightDivision;
+          row.tolerance = row.parameterStandards[0]?.tolerance;
+          row.parameterType = row.parameterStandards[0]?.parameterType;
+        }
+
+
+        row.parameterStandards = this.multipleSelection;
+        _row.qualityStandard = row;
+        EventBus.$emit('inspectionSelection', { message: _row });
+
+        this.handleClose();
+      },
       restForm() {
         this.form = { ...this.defaultForm() };
         this.$nextTick(() => {

+ 15 - 10
src/views/material/BOMmanage/qualityTesting/inspectionClassify/components/user-list.vue

@@ -2,6 +2,7 @@
   <div>
     <user-search @search="reload" ref="searchRef"> </user-search>
     <!-- 数据表格 -->
+
     <ele-pro-table
       ref="table"
       :columns="columns"
@@ -14,29 +15,29 @@
       <!-- 编码列 -->
 
       <template v-slot:name="{ row }">
-        {{ row.qualityStandard.name }}
+        {{  row.qualityStandard && row.qualityStandard.name }}
       </template>
 
       <template v-slot:code="{ row }">
         <el-link
-          @click="openDetail(row.qualityStandard)"
+          @click="openDetail(row)"
           type="primary"
           :underline="false"
         >
-          {{ row.qualityStandard.code }}
+          {{  row.qualityStandard && row.qualityStandard.code }}
         </el-link>
       </template>
 
       <template v-slot:type="{ row }">
-        {{ getDictValue('质检标准类型', row.qualityStandard.type) }}
+        {{ getDictValue('质检标准类型',  row.qualityStandard && row.qualityStandard.type) }}
       </template>
 
       <template v-slot:standardCode="{ row }">
-        {{ row.qualityStandard.standardCode }}
+        {{  row.qualityStandard && row.qualityStandard.standardCode }}
       </template>
 
       <template v-slot:status="{ row }">
-        {{ row.qualityStandard.status == 1 ? '启用' : '停用' }}
+        {{  row.qualityStandard && row.qualityStandard.status == 1 ? '启用' : '停用' }}
       </template>
 
       <template v-slot:mode="{ row }">
@@ -44,11 +45,11 @@
       </template>
 
       <template v-slot:version="{ row }">
-        {{ row.qualityStandard.version }}
+        {{  row.qualityStandard && row.qualityStandard.version }}
       </template>
     </ele-pro-table>
 
-    <Detail ref="detailRef"></Detail>
+    <Detail ref="detailRef" ></Detail>
   </div>
 </template>
 
@@ -133,13 +134,17 @@
     methods: {
       /* 表格数据源 */
       datasource({ page, limit, where }) {
-        return getList({
+      let _data = null;
+      _data = getList({
           ...where,
           pageNum: page,
           size: limit,
           categoryLevelId: this.categoryLevelId || 12,
           rootCategoryLevelId: this.rootId
         });
+
+   
+        return _data
       },
       /* 刷新表格 */
       reload(where) {
@@ -158,7 +163,7 @@
       },
 
       openDetail(row) {
-        this.$refs.detailRef.open(row);
+        this.$refs.detailRef.open('detail',row);
       }
     }
   };

+ 7 - 1
src/views/material/BOMmanage/qualityTesting/inspectionClassify/index.vue

@@ -42,6 +42,7 @@
 <script>
   import AssetTree from '@/components/AssetTree';
   import userList from './components/user-list.vue';
+  import { EventBus } from '@/utils/eventBus';
 
   export default {
     components: {
@@ -59,7 +60,12 @@
         visible: false
       };
     },
-    computed: {},
+
+    created() {
+      EventBus.$on('inspectionSelection', (data) => {
+        this.handleClose();
+      });
+    },
     methods: {
       handleNodeClick(info) {
         this.current = info;

+ 256 - 9
src/views/material/BOMmanage/qualityTesting/term.vue

@@ -1,20 +1,267 @@
 <template>
-    <div>
-        质检项
-        <el-button @click="() => this.$refs.termRef.open()">弹出</el-button>
+  <div>
+    <el-button
+      @click="() => this.$refs.termRef.open()"
+      size="small"
+      type="primary"
+      >新增</el-button
+    >
 
-        <termPop ref="termRef"></termPop>
+    <div class="content_box" v-if="list.length > 0">
+      <div class="content_box_list" v-for="(item, idx) in list" :key="idx">
+        <div class="content_ll">
+          <div class="name">质检类型</div>
+          <div>
+            <DictSelection
+              dictName="质检标准类型"
+              v-model="item.qualityStandard.type + ''"
+              disabled
+            ></DictSelection>
+          </div>
+        </div>
+
+        <div class="content_ll">
+          <div class="name">标准编码</div>
+          <div class="">{{
+            item.qualityStandard && item.qualityStandard.code
+          }}</div>
+        </div>
+
+        <div class="content_ll">
+          <div class="name">标准名称</div>
+          <div class="">{{
+            item.qualityStandard && item.qualityStandard.name
+          }}</div>
+        </div>
+
+        <el-link
+          type="danger"
+          :underline="false"
+          icon="el-icon-delete"
+          @click="handDel(idx)"
+        >
+          删除
+        </el-link>
+
+        <el-form ref="form" style="width: 100%">
+          <el-table
+            style="margin-top: 15px"
+            :data="
+              item.qualityStandard && item.qualityStandard.parameterStandards
+            "
+            border
+          >
+            <el-table-column
+              :label="
+                item.qualityStandard &&
+                item.qualityStandard.singleWeightDivision
+              "
+              align="center"
+            >
+              <el-table-column
+                label="参数上限"
+                align="center"
+                v-if="
+                  item.qualityStandard &&
+                  item.qualityStandard.parameterType == 3
+                "
+              >
+                <template slot-scope="scope">
+                  <el-form-item label-width="0" prop="finalValue">
+                    <el-input
+                      clearable
+                      :disabled="type == 'detail'"
+                      v-model="scope.row.finalValue"
+                      placeholder="请输入"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="参数下限"
+                align="center"
+                v-if="
+                  item.qualityStandard &&
+                  item.qualityStandard.parameterType == 3
+                "
+              >
+                <template slot-scope="scope">
+                  <el-form-item label-width="0" prop="initialValue">
+                    <el-input
+                      clearable
+                      v-model="scope.row.initialValue"
+                      placeholder="请输入"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="默认值"
+                align="center"
+                v-if="
+                  item.qualityStandard &&
+                  item.qualityStandard.parameterType != 3
+                "
+              >
+                <template slot-scope="scope">
+                  <el-form-item label-width="0" prop="defaultValue">
+                    <el-input
+                      clearable
+                      v-model="scope.row.defaultValue"
+                      placeholder="请输入"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+            </el-table-column>
+
+            <el-table-column
+              :label="item.qualityStandard && item.qualityStandard.tolerance"
+              align="center"
+            >
+              <el-table-column label="质检标准" align="center">
+                <template slot-scope="scope">
+                  <el-form-item label-width="0" prop="inspectionStandard">
+                    <el-input
+                      clearable
+                      v-model="scope.row.toleranceValue"
+                      placeholder="请输入"
+                    >
+                      <DictSelection
+                        style="width: 100px"
+                        slot="prepend"
+                        clearable
+                        dictName="数学字符"
+                        v-model="scope.row.symbol"
+                      ></DictSelection>
+                    </el-input>
+                    <!-- </el-form-item> -->
+                  </el-form-item>
+                </template>
+              </el-table-column>
+            </el-table-column>
+
+            <el-table-column label="操作" align="center" width="70">
+              <template slot-scope="scope">
+                <el-link
+                  type="danger"
+                  :underline="false"
+                  icon="el-icon-delete"
+                  @click="handDel2(idx, scope.$index)"
+                >
+                  删除
+                </el-link>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-form>
+      </div>
     </div>
+
+    <termPop ref="termRef"></termPop>
+  </div>
 </template>
 
 <script>
-import termPop from './inspectionClassify/index.vue'
-export default {
+  import termPop from './inspectionClassify/index.vue';
+  import { EventBus } from '@/utils/eventBus';
+  export default {
     components: { termPop },
+
+    props: {
+      qualityParam: {
+        type: Array
+      }
+    },
+
+    watch: {
+      qualityParam: {
+        handler(val) {
+          this.list = val;
+          this.$forceUpdate();
+        },
+        deep: true,
+        immediate: true
+      }
+    },
+
     data() {
-        return {};
+      return {
+        list: []
+      };
     },
-};
+
+    created() {
+      EventBus.$on('inspectionSelection', (data) => {
+        let _arr = this.updateOrCreateObjectInArray(this.list, data.message);
+        this.list = JSON.parse(JSON.stringify(_arr));
+        this.$forceUpdate();
+      });
+    },
+
+    methods: {
+      updateOrCreateObjectInArray(array, newObj, idKey = 'id') {
+        // 用来检查是否已存在具有特定 id 的对象
+        const exists = array.some((obj) => obj[idKey] === newObj[idKey]);
+
+        if (exists) {
+          // 如果存在,使用 map 来替换找到的对象
+          return array.map((obj) =>
+            obj[idKey] === newObj[idKey] ? newObj : obj
+          );
+        } else {
+          // 如果不存在,将新对象添加到数组中
+          return [...array, newObj];
+        }
+      },
+
+      handDel(index) {
+        this.$confirm('是否删除该质检项', '删除', {
+          type: 'warning'
+        })
+          .then(() => {
+            this.list.splice(index, 1);
+          })
+          .catch(() => {});
+      },
+
+      handDel2(idx, index) {
+        this.list[idx].qualityStandard.parameterStandards.splice(index, 1);
+      },
+
+      getDate() {
+        return this.list;
+      }
+    }
+  };
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+  .content_box {
+    width: 100%;
+    margin-top: 12px;
+    max-height: 42vh;
+    overflow-y: scroll;
+  }
+
+  .content_box_list {
+    display: flex;
+    flex-wrap: wrap;
+    margin-bottom: 30px;
+  }
+
+  .content_ll {
+    width: 31%;
+    display: flex;
+    flex-direction: row;
+
+    margin: auto;
+    margin-top: 10px;
+
+    .name {
+      width: 130px;
+      color: #000;
+      font-weight: 500;
+    }
+  }
+</style>

+ 341 - 4
src/views/material/product/components/WarehouseInfo.vue

@@ -77,26 +77,344 @@
           </el-form-item>
         </el-col>
       </el-row>
+      <div class="rules_box">
+        <el-button type="primary" @click="addPackingRules"
+          >添加包装组</el-button
+        >
+        <el-tabs
+          v-model="packingRules"
+          editable
+          @tab-click="handleClick"
+          @edit="handleTabsEdit"
+        >
+          <el-tab-pane
+            v-for="(items, indexs) in packagingSpecification"
+            :label="items.name"
+            :name="items.code"
+          >
+            <div class="rules_box_tabs">
+              <el-row :gutter="24">
+                <el-col :span="8">
+                  <el-form-item label="编码">
+                    <el-input disabled v-model="items.code"></el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                  <el-form-item label="名称">
+                    <el-input v-model="items.name"></el-input>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="8">
+                  <el-form-item label="是否启用">
+                    <el-radio-group
+                      v-model="items.status"
+                      @input="statusChange($event, indexs)"
+                    >
+                      <el-radio :label="1">是</el-radio>
+                      <el-radio :label="0">否</el-radio>
+                    </el-radio-group>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                  <el-form-item label="最小包装单元">
+                    <el-input
+                      class="packingUnit"
+                      v-model="items.minPackageCell"
+                      placeholder="请输入内容"
+                    ></el-input>
+                    <div class="packingUnit">
+                      <DictSelection
+                        dictName="计量单位"
+                        clearable
+                        v-model="items.packageUnit"
+                        :isProhibit="true"
+                      >
+                      </DictSelection>
+                    </div>
+                    <span>/</span>
+                    <div class="lastPackingUnit">
+                      <DictSelection
+                        dictName="计量单位"
+                        clearable
+                        v-model="items.minConversionUnit"
+                      >
+                      </DictSelection>
+                    </div>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                  <el-form-item label="内包装单元">
+                    <el-input
+                      class="packingUnit"
+                      v-model="items.inPackageCell"
+                      placeholder="请输入内容"
+                    ></el-input>
+                    <div class="packingUnit">
+                      <DictSelection
+                        dictName="计量单位"
+                        clearable
+                        v-model="items.minConversionUnit"
+                      >
+                      </DictSelection>
+                    </div>
+                    <span>/</span>
+                    <div class="lastPackingUnit">
+                      <DictSelection
+                        dictName="计量单位"
+                        clearable
+                        v-model="items.inConversionUnit"
+                      >
+                      </DictSelection>
+                    </div>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="24">
+                  <el-form-item label="外包装单元">
+                    <el-input
+                      class="packingUnit"
+                      v-model="items.outPackageCell"
+                      placeholder="请输入内容"
+                    ></el-input>
+                    <div class="packingUnit">
+                      <DictSelection
+                        dictName="计量单位"
+                        clearable
+                        v-model="items.inConversionUnit"
+                      >
+                      </DictSelection>
+                    </div>
+                    <span>/</span>
+                    <div class="lastPackingUnit">
+                      <DictSelection
+                        dictName="计量单位"
+                        clearable
+                        v-model="items.outConversionUnit"
+                      >
+                      </DictSelection>
+                    </div>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+            </div>
+          </el-tab-pane>
+        </el-tabs>
+      </div>
     </el-form>
+    <el-dialog title="添加包装组" :visible.sync="dialogVisible" width="50%">
+      <el-form label-width="120px" ref="form" :model="ruleItem">
+        <el-row :gutter="24">
+          <el-col :span="12">
+            <el-form-item label="包装名称">
+              <el-input v-model="ruleItem.name"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="包装编码">
+              <el-input disabled v-model="ruleItem.code"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="ruleConig">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
 <script>
   import deptSelect from '@/components/CommomSelect/dept-select.vue';
   import personSelect from '@/components/CommomSelect/person-select.vue';
+  import { deletePackageDisposition } from '@/api/material/list.js';
+  import { getCode } from '@/api/codeManagement/index.js';
   export default {
+    components: { deptSelect, personSelect },
     props: {
       form: {
         type: Object,
-        default: {}
+        default: () => {}
+      },
+      packageDispositionVOList: {
+        type: Array,
+        default: () => []
+      },
+      measuringUnit: {
+        type: String,
+        default() {
+          return '';
+        }
+      }
+    },
+    watch: {
+      measuringUnit(val) {
+        this.packagingSpecification = this.packagingSpecification.map(
+          (item) => {
+            return { ...item, packageUnit: val };
+          }
+        );
+      },
+      packagingSpecification: {
+        handler(val) {
+          this.$emit('change', val);
+        },
+        deep: true
+      },
+      packageDispositionVOList: {
+        handler(packageDispositionVOList) {
+          if (packageDispositionVOList.length > 0) {
+            let codeList = new Set(
+              packageDispositionVOList.map((item) => item.code)
+            );
+            console.log(codeList);
+            let arr = [];
+            codeList.forEach((code) => {
+              let obj = {};
+              let filters = packageDispositionVOList.filter(
+                (item) => item.code == code
+              );
+              this.idsList.push({
+                code,
+                ids: filters.map((item) => item.id)
+              });
+              filters.map((item) => {
+                switch (item.sort) {
+                  case '0':
+                    obj.code = item.code;
+                    obj.name = item.name;
+                    obj.status = Number(item.status);
+                    break;
+                  case '1':
+                    obj.minPackageCell = item.packageCell;
+                    obj.packageUnit = item.packageUnit;
+                    obj.minConversionUnit = item.conversionUnit;
+                  case '2':
+                    obj.inPackageCell = item.packageCell;
+                    obj.inConversionUnit = item.conversionUnit;
+                    break;
+                  case '3':
+                    obj.outPackageCell = item.packageCell;
+                    obj.outConversionUnit = item.conversionUnit;
+                    break;
+                }
+              });
+              arr.push(obj);
+            });
+            this.packagingSpecification = arr;
+            this.packingRules = arr[0].code;
+          } else {
+            this.packagingSpecification = [];
+          }
+        },
+        deep: true
       }
     },
-    components: { deptSelect, personSelect },
     data() {
-      return {};
+      return {
+        idsList: [],
+        packagingSpecification: [],
+        packingRules: '',
+        dialogVisible: false,
+        ruleItem: {
+          code: '',
+          name: '',
+          status: 0,
+          minPackageCell: '',
+          packageUnit: this.measuringUnit,
+          minConversionUnit: '',
+          inPackageCell: '',
+          inConversionUnit: '',
+          outPackageCell: '',
+          inConversionUnit: '',
+          outConversionUnit: ''
+        },
+        option: [
+          {
+            label: 'KG',
+            value: 'KG'
+          }
+        ]
+      };
+    },
+    created() {
+      console.log(
+        'this.packageDispositionVOList-',
+        this.packageDispositionVOList
+      );
     },
-
     methods: {
+      statusChange(value, indexs) {
+        console.log(value);
+        console.log(this.packagingSpecification);
+        if (value == 1) {
+          this.packagingSpecification = this.packagingSpecification.map(
+            (item, index) => {
+              if (indexs == index) {
+                item.status = 1;
+              } else {
+                item.status = 0;
+              }
+              return item;
+            }
+          );
+        }
+      },
+      ruleConig() {
+        console.log(this.ruleItem);
+        if (this.packagingSpecification.length == 0) {
+          this.ruleItem.status = 1;
+        } else {
+          this.ruleItem.status = 0;
+        }
+        this.packagingSpecification.push(this.ruleItem);
+        this.dialogVisible = false;
+        this.packingRules = this.ruleItem.code;
+      },
+      async addPackingRules() {
+        let code = await getCode('package_disposition');
+        this.ruleItem = {
+          code: code,
+          name: '',
+          status: 0,
+          minPackageCell: '',
+          packageUnit: this.measuringUnit,
+          minConversionUnit: '',
+          inPackageCell: '',
+          inConversionUnit: '',
+          outPackageCell: '',
+          inConversionUnit: '',
+          outConversionUnit: ''
+        };
+        this.dialogVisible = true;
+      },
+      handleClick(val) {
+        console.log(val);
+        this.packingRules = val.name;
+      },
+      // 删除tab
+      handleTabsEdit(targetName, action) {
+        if (action == 'remove') {
+          let index = this.packagingSpecification.findIndex(
+            (item) => item.code == targetName
+          );
+          let idsIndex = this.idsList.findIndex(
+            (item) => item.code == targetName
+          );
+          if (this.idsList.length > 0 && idsIndex > -1) {
+            let ids = this.idsList.filter(
+              (item) => item.code == this.packagingSpecification[index].code
+            )[0].ids;
+            deletePackageDisposition(ids).then(() => {
+              this.idsList = this.idsList.filter(
+                (item) => item.code != this.packagingSpecification[index].code
+              );
+              this.packagingSpecification.splice(index, 1);
+            });
+          } else {
+            this.packagingSpecification.splice(index, 1);
+          }
+        }
+      },
       inventoryModeChange(value) {
         if (value == 1) {
           this.form.isUnpack = 1;
@@ -151,4 +469,23 @@
       margin-left: 15px;
     }
   }
+  .rules_box {
+    margin: 0px 20px 20px 20px;
+    .rules_box_tabs {
+      margin: 20px 0;
+      :deep(.el-form-item__content) {
+        > div {
+          display: inline-block;
+        }
+      }
+    }
+  }
+  .packingUnit {
+    width: 200px;
+    margin-right: 10px;
+  }
+  .lastPackingUnit {
+    width: 200px;
+    margin-left: 10px;
+  }
 </style>

+ 1 - 1
src/views/material/product/components/index-data.vue

@@ -100,7 +100,7 @@
 
         <el-link
           type="primary"
-          v-if="row.isProduct == 1"
+          v-if="row.isProduct == 1 || row.categoryLevelPathIdParent == 1"
           :underline="false"
           @click="toBomManager(row)"
         >

+ 473 - 368
src/views/material/product/detail.vue

@@ -10,8 +10,7 @@
         <headerTitle title="基本信息">
           <el-button @click="cancel">返回</el-button>
           <el-button type="primary" @click="submit" :loading="loading"
-          >保存
-          </el-button
+            >保存</el-button
           >
         </headerTitle>
 
@@ -38,19 +37,19 @@
 
           <el-col :span="8" v-else key="2">
             <el-form-item label="编码" prop="code">
-              <el-input v-model="form.code" :disabled="status == 0"/>
+              <el-input v-model="form.code" :disabled="status == 0" />
             </el-form-item>
           </el-col>
 
           <el-col :span="8">
             <el-form-item label="名称" prop="name">
-              <el-input v-model="form.name"/>
+              <el-input v-model="form.name" />
             </el-form-item>
           </el-col>
 
           <el-col :span="8">
             <el-form-item label="图号/件号" prop="imgCode">
-              <el-input v-model="form.imgCode"/>
+              <el-input v-model="form.imgCode" />
             </el-form-item>
           </el-col>
 
@@ -90,18 +89,18 @@
 
           <el-col :span="8">
             <el-form-item label="牌号" prop="brandNum">
-              <el-input v-model="form.brandNum"/>
+              <el-input v-model="form.brandNum" />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="型号" prop="modelType">
-              <el-input v-model="form.modelType"/>
+              <el-input v-model="form.modelType" />
             </el-form-item>
           </el-col>
 
           <el-col :span="8">
             <el-form-item label="规格" prop="specification">
-              <el-input v-model="form.specification"/>
+              <el-input v-model="form.specification" />
             </el-form-item>
           </el-col>
 
@@ -141,7 +140,7 @@
           <el-col :span="8">
             <el-form-item label="体积">
               <div class="form-line">
-                <el-input v-model="form.volume"/>
+                <el-input v-model="form.volume" />
                 <DictSelection
                   class="line-select"
                   dictName="体积单位"
@@ -153,11 +152,10 @@
             </el-form-item>
           </el-col>
 
-
           <el-col :span="8">
             <el-form-item label="毛重">
               <div class="form-line">
-                <el-input v-model="form.roughWeight"/>
+                <el-input v-model="form.roughWeight" />
               </div>
             </el-form-item>
           </el-col>
@@ -165,7 +163,7 @@
           <el-col :span="8">
             <el-form-item label="净重">
               <div class="form-line">
-                <el-input v-model="form.netWeight"/>
+                <el-input v-model="form.netWeight" />
               </div>
             </el-form-item>
           </el-col>
@@ -194,13 +192,25 @@
             <el-form-item :label="f.label">
               <template>
                 <div class="form-line">
-                  <el-input v-model="form.extField[f.prop]"/>
+                  <div
+                    style="width: 100%"
+                    v-if="f.prop === 'packingSpecification'"
+                  >
+                    <template v-if="form.extField.packingSpecification">
+                      <el-tag
+                        v-for="item in form.extField.packingSpecification.split(
+                          ','
+                        )"
+                        >{{ item }}</el-tag
+                      >
+                    </template>
+                    <el-input v-else disabled v-model="form.extField[f.prop]" />
+                  </div>
+                  <el-input v-else v-model="form.extField[f.prop]" />
                 </div>
               </template>
             </el-form-item>
           </el-col>
-
-
         </el-row>
       </el-form>
     </el-card>
@@ -213,23 +223,29 @@
       @chooseCode="chooseCode"
     ></CodeDialog>
     <!-- 分类选择弹窗 -->
-    <CategoryDialog ref="categoryRefs" @chooseCategory="confirmCategory"/>
+    <CategoryDialog ref="categoryRefs" @chooseCategory="confirmCategory" />
     <!-- 仓储配置 -->
-    <WarehouseInfo ref="warehouseRefs" :form="categoryWms"/>
+    <WarehouseInfo
+      ref="warehouseRefs"
+      :form="categoryWms"
+      :measuringUnit="form.measuringUnit"
+      :packageDispositionVOList="packageDispositionVOList"
+      @change="changePackagingSpecification"
+    />
     <!-- 生产信息 -->
-    <ProductionInfo ref="productionRefs" :form="categoryMes"/>
+    <ProductionInfo ref="productionRefs" :form="categoryMes" />
     <!-- 计划 -->
-    <PlanInfo ref="planRefs" :form="categoryAps"/>
+    <PlanInfo ref="planRefs" :form="categoryAps" />
     <!-- 质量配置 -->
-    <QualityInfo ref="qualityRefs" :form="categoryQms"/>
+    <QualityInfo ref="qualityRefs" :form="categoryQms" />
     <!-- 舟皿信息 -->
-    <BoatInfo ref="qualityRefs" :form="categoryPallet"/>
+    <BoatInfo ref="qualityRefs" :form="categoryPallet" />
     <!-- 周转车信息 -->
-    <TurnoverInfo ref="turnoverRefs" :form="categoryVehicle"/>
+    <TurnoverInfo ref="turnoverRefs" :form="categoryVehicle" />
     <!-- 模具信息 -->
-    <MoldInfo ref="moldRefs" :form="categoryMold"/>
+    <MoldInfo ref="moldRefs" :form="categoryMold" />
     <!-- 备注信息 -->
-    <RemarkInfo ref="remarkRefs" :form="remarkform"/>
+    <RemarkInfo ref="remarkRefs" :form="remarkform" />
     <!-- 关联信息 -->
     <linkMsg
       ref="linkMsgRef"
@@ -241,396 +257,485 @@
 </template>
 
 <script>
-import GroupDialog from './components/GroupDialog.vue';
-import CodeDialog from './components/codeDialog.vue';
-import CategoryDialog from './components/CategoryDialog.vue';
-import WarehouseInfo from './components/WarehouseInfo.vue';
-import ProcureInfo from './components/ProcureInfo.vue';
-import ProductionInfo from './components/ProductionInfo.vue';
-import PlanInfo from './components/PlanInfo.vue';
-import SalesInfo from './components/SalesInfo.vue';
-import QualityInfo from './components/QualityInfo.vue';
-import BoatInfo from './components/BoatInfo.vue';
-import TurnoverInfo from './components/TurnoverInfo.vue';
-import MoldInfo from './components/MoldInfo.vue';
-import RemarkInfo from './components/RemarkInfo.vue';
-import deptSelect from '@/components/CommomSelect/dept-select.vue';
-import personSelect from '@/components/CommomSelect/person-select.vue';
-import linkMsg from './components/link-msg.vue';
-import {getDetails} from '@/api/classifyManage/itemInformation';
-import {getByCode} from '@/api/system/dictionary-data';
-import {getCode, rootCategoryCode, fieldModel} from '@/api/codeManagement';
-
-import {addMaterial} from '@/api/material/list.js';
-import {deepClone} from '@/utils/index';
-import {finishPageTab, reloadPageTab} from '@/utils/page-tab-util';
-
-export default {
-  name: 'ManageMaterial',
-  components: {
-    linkMsg,
-    GroupDialog,
-    deptSelect,
-    personSelect,
-    WarehouseInfo,
-    ProcureInfo,
-    ProductionInfo,
-    PlanInfo,
-    SalesInfo,
-    QualityInfo,
-    BoatInfo,
-    TurnoverInfo,
-    MoldInfo,
-    RemarkInfo,
-    CategoryDialog,
-    CodeDialog
-  },
-  data() {
-    return {
-      loading: false,
-      levelOptions: [
-        {
-          label: '特级',
-          value: '特级'
+  import GroupDialog from './components/GroupDialog.vue';
+  import CodeDialog from './components/codeDialog.vue';
+  import CategoryDialog from './components/CategoryDialog.vue';
+  import WarehouseInfo from './components/WarehouseInfo.vue';
+  import ProcureInfo from './components/ProcureInfo.vue';
+  import ProductionInfo from './components/ProductionInfo.vue';
+  import PlanInfo from './components/PlanInfo.vue';
+  import SalesInfo from './components/SalesInfo.vue';
+  import QualityInfo from './components/QualityInfo.vue';
+  import BoatInfo from './components/BoatInfo.vue';
+  import TurnoverInfo from './components/TurnoverInfo.vue';
+  import MoldInfo from './components/MoldInfo.vue';
+  import RemarkInfo from './components/RemarkInfo.vue';
+  import deptSelect from '@/components/CommomSelect/dept-select.vue';
+  import personSelect from '@/components/CommomSelect/person-select.vue';
+  import linkMsg from './components/link-msg.vue';
+  import { getDetails } from '@/api/classifyManage/itemInformation';
+  import { getByCode } from '@/api/system/dictionary-data';
+  import { getCode, rootCategoryCode, fieldModel } from '@/api/codeManagement';
+
+  import { addMaterial } from '@/api/material/list.js';
+  import { deepClone } from '@/utils/index';
+  import { finishPageTab, reloadPageTab } from '@/utils/page-tab-util';
+
+  export default {
+    name: 'ManageMaterial',
+    components: {
+      linkMsg,
+      GroupDialog,
+      deptSelect,
+      personSelect,
+      WarehouseInfo,
+      ProcureInfo,
+      ProductionInfo,
+      PlanInfo,
+      SalesInfo,
+      QualityInfo,
+      BoatInfo,
+      TurnoverInfo,
+      MoldInfo,
+      RemarkInfo,
+      CategoryDialog,
+      CodeDialog
+    },
+    data() {
+      return {
+        packagingSpecificationList: [],
+        loading: false,
+        levelOptions: [
+          {
+            label: '特级',
+            value: '特级'
+          },
+          {
+            label: '一级',
+            value: '一级'
+          },
+          {
+            label: '二级',
+            value: '二级'
+          },
+          {
+            label: '三级',
+            value: '三级'
+          }
+        ],
+        form: {
+          categoryLevelGroupName: '',
+          categoryLevelName: '',
+          isConsumable: 1,
+
+          extField: {}
         },
-        {
-          label: '一级',
-          value: '一级'
+
+        remarkform: {
+          remarkAttach: []
         },
-        {
-          label: '二级',
-          value: '二级'
+        categoryAps: {},
+        categoryMes: {},
+        categoryMold: {},
+        categoryPallet: {},
+        categoryQms: {},
+        categoryVehicle: {},
+        categoryWms: {
+          isUnpack: 1
         },
-        {
-          label: '三级',
-          value: '三级'
-        }
-      ],
-      form: {
-        categoryLevelGroupName: '',
-        categoryLevelName: '',
-        isConsumable: 1,
+        packageDispositionVOList: [],
+        categoryLevelPathId: null,
+
+        dictList: [],
+
+        fileList: [],
+        // 表单验证规则
+        rules: {
+          categoryLevelGroupName: [
+            { required: true, message: '请选择所属物料组', trigger: 'change' }
+          ],
+          code: [{ required: true, message: '请输入编码', trigger: 'blur' }],
+          name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
+          categoryLevelName: [
+            { required: true, message: '请选择所属分类', trigger: 'change' }
+          ],
+          measuringUnit: [
+            { required: true, message: '请选择计量单位', trigger: 'change' }
+          ],
+
+          weightUnit: [
+            { required: true, message: '请选择重量单位', trigger: 'change' }
+          ],
+
+          packingUnit: [
+            { required: true, message: '请选择包装单位', trigger: 'change' }
+          ],
+
+          netWeight: [
+            { required: true, message: '请输入净重', trigger: 'blur' }
+          ]
+        },
+        PathInfo: {},
+        id: null,
 
-        extField: {}
-      },
+        ruleCode: null,
+        codeShow: false,
 
-      remarkform: {
-        remarkAttach: []
-      },
-      categoryAps: {},
-      categoryMes: {},
-      categoryMold: {},
-      categoryPallet: {},
-      categoryQms: {},
-      categoryVehicle: {},
-      categoryWms: {
-        isUnpack: 1
+        status: null
+      };
+    },
+    watch: {
+      '$route.query.id': {
+        handler(id) {
+          console.log('id-------------', id);
+          if (id) {
+            this._getDetails();
+          }
+        },
+        deep: true,
+        immediate: true
+      }
+    },
+    async created() {
+      this.getFieldModel();
+      this.status = this.$route.query.status;
+      // if (this.$route.query.id) {
+      //   this._getDetails();
+      // }
+      this.getDictList('productionType');
+    },
+    methods: {
+      changePackagingSpecification(val) {
+        this.packagingSpecificationList = val;
       },
+      async _getDetails() {
+        const data = await getDetails(this.$route.query.id);
+        const info = deepClone(data);
 
-      categoryLevelPathId: null,
-
-      dictList: [],
-
-      fileList: [],
-      // 表单验证规则
-      rules: {
-        categoryLevelGroupName: [
-          {required: true, message: '请选择所属物料组', trigger: 'change'}
-        ],
-        code: [{required: true, message: '请输入编码', trigger: 'blur'}],
-        name: [{required: true, message: '请输入名称', trigger: 'blur'}],
-        categoryLevelName: [
-          {required: true, message: '请选择所属分类', trigger: 'change'}
-        ],
-        measuringUnit: [
-          {required: true, message: '请选择计量单位', trigger: 'change'}
-        ],
+        this.form = {
+          ...info.category
+        };
+        let productType_ = this.form.produceType;
+        if (productType_ != undefined && productType_ != null) {
+          let intproductType = [];
+          for (const [index, value] of productType_.entries()) {
+            intproductType.push(value.toString());
+          }
+          this.form.produceType = intproductType;
+        }
 
-        weightUnit: [
-          {required: true, message: '请选择重量单位', trigger: 'change'}
-        ],
+        this.categoryLevelPathId = info.category.categoryLevelPathIdParent;
+        this.judgeSet(info);
 
-        packingUnit: [
-          {required: true, message: '请选择包装单位', trigger: 'change'}
-        ],
+        if (this.status == 1) {
+          rootCategoryCode(this.categoryLevelPathId).then((res) => {
+            this.$set(this.form, 'code', res);
+          });
+        }
 
-        netWeight: [
-          {required: true, message: '请输入净重', trigger: 'blur'}
-        ]
+        this.$forceUpdate();
       },
-      PathInfo: {},
-      id: null,
-
-      ruleCode: null,
-      codeShow: false,
-
-      status: null
-    };
-  },
-
-  async created() {
-    this.getFieldModel();
-    this.status = this.$route.query.status;
-
-    if (this.$route.query.id) {
-      this._getDetails();
-    }
-    this.getDictList('productionType');
-  },
-  methods: {
-    async _getDetails() {
-      const data = await getDetails(this.$route.query.id);
-      const info = deepClone(data);
-
-      this.form = {
-        ...info.category
-      };
-      let productType_ = this.form.produceType;
-      if (productType_ != undefined && productType_ != null) {
-        let intproductType = [];
-        for (const [index, value] of productType_.entries()) {
-          intproductType.push(value.toString());
+      // 判断字段类型并赋值
+      judgeSet(info) {
+        console.log('info-------', info);
+        if (typeof info.categoryAps == 'string') {
+          this.categoryAps = {};
+        } else {
+          this.categoryAps = info.categoryAps;
         }
-        this.form.produceType = intproductType;
-      }
-
-      this.categoryLevelPathId = info.category.categoryLevelPathIdParent;
-      this.judgeSet(info);
-
-      if (this.status == 1) {
-        rootCategoryCode(this.categoryLevelPathId).then((res) => {
-          this.$set(this.form, 'code', res);
-        });
-      }
-
-      this.$forceUpdate();
-    },
-    // 判断字段类型并赋值
-    judgeSet(info) {
-      if (typeof info.categoryAps == 'string') {
-        this.categoryAps = {};
-      } else {
-        this.categoryAps = info.categoryAps;
-      }
-      if (typeof info.categoryMes == 'string') {
-        this.categoryMes = {};
-      } else {
-        this.categoryMes = info.categoryMes;
-      }
-      if (typeof info.categoryMold == 'string') {
-        this.categoryMold = {};
-      } else {
-        this.categoryMold = info.categoryMold;
-      }
-      if (typeof info.categoryPallet == 'string') {
-        this.categoryPallet = {};
-      } else {
-        this.categoryPallet = info.categoryPallet;
-      }
-      if (typeof info.categoryQms == 'string') {
-        this.categoryQms = {};
-      } else {
-        this.categoryQms = info.categoryQms;
-      }
-      if (typeof info.categoryVehicle == 'string') {
-        this.categoryVehicle = {};
-      } else {
-        this.categoryVehicle = info.categoryVehicle;
-      }
-      if (typeof info.categoryWms == 'string') {
-        this.categoryWms = {};
-      } else {
-        this.categoryWms = info.categoryWms;
-      }
-    },
+        if (typeof info.categoryMes == 'string') {
+          this.categoryMes = {};
+        } else {
+          this.categoryMes = info.categoryMes;
+        }
+        if (typeof info.categoryMold == 'string') {
+          this.categoryMold = {};
+        } else {
+          this.categoryMold = info.categoryMold;
+        }
+        if (typeof info.categoryPallet == 'string') {
+          this.categoryPallet = {};
+        } else {
+          this.categoryPallet = info.categoryPallet;
+        }
+        if (typeof info.categoryQms == 'string') {
+          this.categoryQms = {};
+        } else {
+          this.categoryQms = info.categoryQms;
+        }
+        if (typeof info.categoryVehicle == 'string') {
+          this.categoryVehicle = {};
+        } else {
+          this.categoryVehicle = info.categoryVehicle;
+        }
+        if (typeof info.categoryWms == 'string') {
+          this.categoryWms = {};
+        } else {
+          this.categoryWms = info.categoryWms;
+        }
+        if (typeof info.packageDispositionVOList == 'string') {
+          this.packageDispositionVOList = [];
+        } else {
+          this.packageDispositionVOList = info.packageDispositionVOList;
+          console.log(
+            'this.packageDispositionVOList---!!!----',
+            this.packageDispositionVOList
+          );
+        }
+      },
 
-    getFieldModel() {
-      fieldModel({fieldModel: 't_main_category'}).then((res) => {
-        this.fileList = res;
+      getFieldModel() {
+        fieldModel({ fieldModel: 't_main_category' }).then((res) => {
+          this.fileList = res;
 
-        this.fileList.forEach((f) => {
-          this.$set(this.form.extField, f.prop, ''); // 初始化动态模型属性
+          this.fileList.forEach((f) => {
+            this.$set(this.form.extField, f.prop, ''); // 初始化动态模型属性
+          });
         });
-      });
-    },
+      },
 
-    // 确定分类
-    async confirmCategory(node, title, PathInfo, ruleCode) {
-      if (this.status != 0) {
-        this.$set(this.form, 'code', null);
-      }
-      this.categoryLevelPathId = PathInfo.categoryLevelPathId.split(',')[0];
-
-      if (title == '选择产品分类') {
-        this.$set(this.form, 'productCategoryLevelName', node.name);
-        this.$set(this.form, 'productCategoryLevelId', node.id);
-      } else {
-        this.$set(this.form, 'categoryLevelName', node.name);
-        this.$set(this.form, 'categoryLevelId', node.id);
-        this.$set(this.form, 'categoryLevelPath', node.name);
-        this.$set(this.form, 'categoryLevelPathId', node.id);
-        this.PathInfo = PathInfo;
-
-        this.ruleCode = ruleCode;
-
-        if (ruleCode && ruleCode != '自定义' && this.status != 0) {
-          const code = await getCode(ruleCode);
-          this.$set(this.form, 'code', code);
+      // 确定分类
+      async confirmCategory(node, title, PathInfo, ruleCode) {
+        if (this.status != 0) {
+          this.$set(this.form, 'code', null);
+        }
+        this.categoryLevelPathId = PathInfo.categoryLevelPathId.split(',')[0];
+
+        if (title == '选择产品分类') {
+          this.$set(this.form, 'productCategoryLevelName', node.name);
+          this.$set(this.form, 'productCategoryLevelId', node.id);
+        } else {
+          this.$set(this.form, 'categoryLevelName', node.name);
+          this.$set(this.form, 'categoryLevelId', node.id);
+          this.$set(this.form, 'categoryLevelPath', node.name);
+          this.$set(this.form, 'categoryLevelPathId', node.id);
+          this.PathInfo = PathInfo;
+
+          this.ruleCode = ruleCode;
+
+          if (ruleCode && ruleCode != '自定义' && this.status != 0) {
+            const code = await getCode(ruleCode);
+            this.$set(this.form, 'code', code);
+          }
         }
-      }
 
-      this.$forceUpdate();
-    },
+        this.$forceUpdate();
+      },
 
-    async getDictList(code) {
-      let {data: res} = await getByCode(code);
-      this.dictList = res.map((item) => {
-        let values = Object.keys(item);
-        return {
-          value: Number(values[0]),
-          label: item[values[0]]
-        };
-      });
-    },
+      async getDictList(code) {
+        let { data: res } = await getByCode(code);
+        this.dictList = res.map((item) => {
+          let values = Object.keys(item);
+          return {
+            value: Number(values[0]),
+            label: item[values[0]]
+          };
+        });
+      },
 
-    openCategory() {
-      this.$refs.categoryRefs.open();
-    },
+      openCategory() {
+        this.$refs.categoryRefs.open();
+      },
 
-    openCode() {
-      this.codeShow = true;
-    },
+      openCode() {
+        this.codeShow = true;
+      },
 
-    chooseCode(code) {
-      this.$set(this.form, 'code', code);
-      this.codeShow = false;
-      this.$forceUpdate();
-    },
+      chooseCode(code) {
+        this.$set(this.form, 'code', code);
+        this.codeShow = false;
+        this.$forceUpdate();
+      },
 
-    cancel() {
-      finishPageTab();
-      this.$router.go(-1);
-    },
+      cancel() {
+        finishPageTab();
+        this.$router.go(-1);
+      },
 
-    // 保存
-    submit() {
-      this.$refs.manageForm.validate(async (valid) => {
-        let productionValid = await this.$refs.productionRefs.getFormValid()
-        console.log(productionValid);
-        if (!valid||!productionValid) {
-          return false;
-        }
+      // 保存
+      submit() {
+        this.$refs.manageForm.validate(async (valid) => {
+          let productionValid = await this.$refs.productionRefs.getFormValid();
+          console.log(productionValid);
+          if (!valid || !productionValid) {
+            return false;
+          }
 
-        this.loading = true;
-        // const imgList = this.remarkform.imgList;
-        // const arr = [];
-        // if (imgList.length) {
-        //   imgList.map((item) => {
-        //     arr.push(item.storePath);
-        //   });
-        //   this.form.remarkAttach = arr.join(',');
-        // }
-        // this.form.remark = this.remarkform.remark
-        //   ? this.remarkform.remark
-        //   : '';
-
-        const data = {
-          categoryWms: this.categoryWms,
-          categoryAps: this.categoryAps,
-          categoryMes: this.categoryMes,
-          categoryMold: this.categoryMold,
-          categoryPallet: this.categoryPallet,
-          categoryQms: this.categoryQms,
-          categoryVehicle: this.categoryVehicle,
-          category: {
-            ...this.form,
-            ...this.remarkform,
-            ...this.PathInfo
+          let packageDispositionVOList = [];
+          if (this.packagingSpecificationList.length > 0) {
+            packageDispositionVOList = this.packagingSpecificationList.map(
+              (item) => {
+                let obj = {
+                  code: item.code,
+                  name: item.name
+                };
+                return [
+                  {
+                    ...obj,
+                    sort: 0,
+                    status: item.status
+                  },
+                  {
+                    ...obj,
+                    sort: 1,
+                    packageCell: item.minPackageCell,
+                    packageUnit: item.packageUnit,
+                    conversionUnit: item.minConversionUnit
+                  },
+                  {
+                    ...obj,
+                    sort: 2,
+                    packageCell: item.inPackageCell,
+                    packageUnit: item.minConversionUnit,
+                    conversionUnit: item.inConversionUnit
+                  },
+                  {
+                    ...obj,
+                    sort: 3,
+                    packageCell: item.outPackageCell,
+                    packageUnit: item.inConversionUnit,
+                    conversionUnit: item.outConversionUnit
+                  }
+                ];
+              }
+            );
+            let packagingSpecificationList =
+              this.packagingSpecificationList.filter(
+                (item) => item.status == 1
+              );
+            this.form.extField.packingSpecification = packagingSpecificationList
+              .map((item) => {
+                return [
+                  `${item.minPackageCell}${item.packageUnit}/${item.minConversionUnit}`,
+                  `${item.inPackageCell}${item.minConversionUnit}/${item.inConversionUnit}`,
+                  `${item.outPackageCell}${item.inConversionUnit}/${item.outConversionUnit}`
+                ];
+              })
+              .flat()
+              .join(',');
+          } else {
+            this.form.extField.packingSpecification = '';
           }
-        };
 
-        if (this.$route.query.status == 1) {
-          data.category.id = null;
-          data.categoryWms.id = null;
-          data.categoryAps.id = null;
-          data.categoryMes.id = null;
-          data.categoryMold.id = null;
-          data.categoryPallet.id = null;
-          data.categoryQms.id = null;
-          data.categoryVehicle.id = null;
-        }
+          this.loading = true;
+          // const imgList = this.remarkform.imgList;
+          // const arr = [];
+          // if (imgList.length) {
+          //   imgList.map((item) => {
+          //     arr.push(item.storePath);
+          //   });
+          //   this.form.remarkAttach = arr.join(',');
+          // }
+          // this.form.remark = this.remarkform.remark
+          //   ? this.remarkform.remark
+          //   : '';
+
+          const data = {
+            categoryWms: this.categoryWms,
+            categoryAps: this.categoryAps,
+            categoryMes: this.categoryMes,
+            categoryMold: this.categoryMold,
+            categoryPallet: this.categoryPallet,
+            categoryQms: this.categoryQms,
+            categoryVehicle: this.categoryVehicle,
+            category: {
+              ...this.form,
+              ...this.remarkform,
+              ...this.PathInfo
+            },
+            packageDispositionVOList: packageDispositionVOList.flat()
+          };
+
+          if (this.$route.query.status == 1) {
+            data.category.id = null;
+            data.categoryWms.id = null;
+            data.categoryAps.id = null;
+            data.categoryMes.id = null;
+            data.categoryMold.id = null;
+            data.categoryPallet.id = null;
+            data.categoryQms.id = null;
+            data.categoryVehicle.id = null;
+            data.packageDispositionVOList = data.packageDispositionVOList.map(
+              (item) => {
+                return {
+                  ...item,
+                  id: null
+                };
+              }
+            );
+          }
 
-        addMaterial(data)
-          .then((msg) => {
-            this.loading = false;
-            this.$message.success(msg);
-            reloadPageTab({fullPath: '/material/product'});
-            this.$router.go(-1);
-          })
-          .catch((e) => {
-            this.loading = false;
-          });
-      });
+          addMaterial(data)
+            .then((msg) => {
+              this.loading = false;
+              this.$message.success(msg);
+              reloadPageTab({ fullPath: '/material/product' });
+              this.$router.go(-1);
+            })
+            .catch((e) => {
+              this.loading = false;
+            });
+        });
+      }
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped>
-.ele-page-header {
-  border: none;
-}
-
-.body-top {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-  background: #fff;
+  .ele-page-header {
+    border: none;
+  }
 
-  .top-left {
+  .body-top {
     display: flex;
     align-items: center;
-    justify-content: flex-start;
-    margin-left: -25px;
+    justify-content: space-between;
+    background: #fff;
+
+    .top-left {
+      display: flex;
+      align-items: center;
+      justify-content: flex-start;
+      margin-left: -25px;
 
-    .el-form-item {
-      margin-bottom: 0;
+      .el-form-item {
+        margin-bottom: 0;
+      }
     }
   }
-}
 
-.divider {
-  margin: 20px 0;
+  .divider {
+    margin: 20px 0;
 
-  .title {
-    display: flex;
-    align-items: center;
-    margin-bottom: 10px;
+    .title {
+      display: flex;
+      align-items: center;
+      margin-bottom: 10px;
 
-    div {
-      width: 8px;
-      height: 20px;
-      margin-right: 10px;
-    }
+      div {
+        width: 8px;
+        height: 20px;
+        margin-right: 10px;
+      }
 
-    span {
-      font-size: 20px;
+      span {
+        font-size: 20px;
+      }
     }
-  }
 
-  .ele-width {
-    width: 100%;
-    height: 2px;
+    .ele-width {
+      width: 100%;
+      height: 2px;
+    }
   }
-}
 
-.form-line {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
+  .form-line {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
 
-  .line-select {
-    margin-left: 15px;
+    .line-select {
+      margin-left: 15px;
+    }
   }
-}
 </style>

+ 6 - 5
src/views/system/menu/components/menu-search.vue

@@ -17,11 +17,11 @@
           <el-input clearable v-model.trim="where.url" 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.trim="where.authority" placeholder="请输入" />
+     <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="权限编码:">
+          <el-input clearable v-model.trim="where.permissionCode" placeholder="请输入" />
         </el-form-item>
-      </el-col> -->
+      </el-col> 
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <div class="ele-form-actions">
           <el-button
@@ -45,7 +45,8 @@
       // 默认表单数据
       const defaultWhere = {
         name: '',
-        url: ''
+        url: '',
+        permissionCode:''
       };
       return {
         // 表单数据

+ 2 - 2
vue.config.js

@@ -33,8 +33,8 @@ module.exports = {
       '/api': {
         // target: 'http://192.168.1.124:50001',
         // target: 'http://192.168.1.147:18086',
-        // target: 'http://192.168.1.125:18086',
-        target: 'http://192.168.1.116:18086',
+        target: 'http://192.168.1.125:18086',
+        // target: 'http://192.168.1.116:18086',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''