huang_an преди 1 година
родител
ревизия
f51a6b175f

+ 13 - 0
src/api/ruleManagement/plan.js

@@ -144,6 +144,19 @@ export async function getBatchList(params) {
   return Promise.reject(new Error(res.data.message));
 }
 
+// 根据仓库ID查询产品分类
+export async function getCategoryLevelIdByWarehouseId(params) {
+  const res = await request.get(
+    `/wms/outInDetailRecordTwo/getCategoryLevelIdByWarehouseId`,
+    {
+      params
+    }
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 // // 更新或保存
 // export async function saveOrUpdate (data) {
 //   const res = await request.post('/main/ruleinfo/saveOrEdit', data);

+ 25 - 76
src/views/rulesManagement/warehouseInventory/components/addInventoryDialog.vue

@@ -141,28 +141,6 @@
             </el-select>
           </el-form-item>
         </el-col> -->
-
-        <el-col :span="8">
-          <el-form-item
-            :label="type == 2 ? '产品分类' : '资产分类'"
-            prop="categoryLevelId"
-          >
-            <ele-tree-select
-              multiple
-              clearable
-              :disabled="isBindPlan"
-              :data="codeList"
-              @change="codeListValue"
-              v-model="addForm.categoryLevelId"
-              valueKey="id"
-              labelKey="name"
-              :show-checkbox="true"
-              :check-strictly="true"
-              filterable
-              placeholder="请选择"
-            />
-          </el-form-item>
-        </el-col>
         <el-col :span="8">
           <el-form-item label="紧急程度" prop="urgent">
             <DictSelection
@@ -242,7 +220,6 @@
       </el-row>
       <HeaderTitle title="盘点物品信息" size="16px">
         <el-select
-          style="margin-right: 10px"
           :disabled="isBindPlan"
           @change="dimensionChange"
           v-model="dimension"
@@ -251,7 +228,13 @@
           <el-option label="物品维度" :value="1"> </el-option>
           <el-option label="批次维度" :value="2"> </el-option>
         </el-select>
-        <el-button type="primary" @click="addProducts">添加物品</el-button>
+        <el-button
+          v-if="!isBindPlan"
+          style="margin-left: 10px"
+          type="primary"
+          @click="addProducts"
+          >添加物品</el-button
+        >
       </HeaderTitle>
       <el-table
         ref="table"
@@ -360,7 +343,7 @@
     </div>
     <selectType
       :visibleDialog.sync="visibleDialog"
-      :treeIds="addForm.categoryLevelId"
+      :treeIds="productType"
       :dimension="dimension"
       :warehouseId="addForm.warehouseId"
       :selectionIds="selectionIds"
@@ -385,12 +368,12 @@
   import { fieldModel } from '@/api/codeManagement';
   import {
     getRule,
-    getProductList,
     getBatchList,
     getWarehouseList,
     saveStocktakingPlan,
     updateStocktakingPlan,
-    getInventoryDetailById
+    getInventoryDetailById,
+    getCategoryLevelIdByWarehouseId
   } from '@/api/ruleManagement/plan';
   import { getUserPage } from '@/api/system/organization';
   import deptSelect from '@/components/CommomSelect/dept-select.vue';
@@ -445,13 +428,13 @@
         size: 10,
         loadTree: true,
         productList: [],
+        productType: [],
         addForm: {
           code: '', // 计划配置单号
           planName: '', // 计划配置名称
           categoryId: 0, // 类别ID
           autoOrder: 1, // 是否自动派单
           ruleId: '', // 规则名称
-          categoryLevelId: [], // 物品Ids
           inventoryType: 1, // 盘点类型
           bizTypeId: '', // 盘点仓库Id
           bizTypeName: '', // 盘点仓库name
@@ -493,13 +476,6 @@
           inventoryType: [
             { required: true, message: '请选择盘点类型', trigger: 'change' }
           ],
-          // plantId: [
-          //   {
-          //     required: true,
-          //     message: '请选择厂房',
-          //     trigger: 'change'
-          //   }
-          // ],
           warehouseId: [
             { required: true, message: '请选择盘点仓库', trigger: 'change' }
           ],
@@ -511,9 +487,6 @@
           ],
           executorId: [
             { required: true, message: '请选择选择执行人员', trigger: 'change' }
-          ],
-          assetDict: [
-            { required: true, message: '请选择资产分类', trigger: 'change' }
           ]
         },
         ruleNameList: []
@@ -542,15 +515,14 @@
               console.log(res);
               res.warehouseId = res.warehouseId > 0 ? res.warehouseId : '';
               res.urgent = String(res.urgent);
-              res.categoryLevelId = res.categoryLevelId
-                ? res.categoryLevelId.split(',')
-                : [];
               this.addForm = res;
               this.dimension = res.planConfigDetailVOList[0].batch_no ? 2 : 1;
               if (this.addForm.executeGroupId) {
                 this.getUserList({ groupId: this.addForm.executeGroupId });
               }
-              this.productList = res.planConfigDetailVOList;
+              this.productList = res.planConfigDetailVOList.map(
+                (item) => item.info
+              );
             });
           } else {
             this.productList = [];
@@ -560,7 +532,6 @@
               categoryId: 0, // 类别ID
               autoOrder: 1, // 是否自动派单
               ruleId: '', // 规则名称
-              categoryLevelId: [], // 物品Ids
               inventoryType: 1, // 盘点类型
               bizTypeId: '', // 盘点仓库Id
               bizTypeName: '', // 盘点仓库name
@@ -639,7 +610,11 @@
         this.productList = this.productList.concat(productList);
       },
       addProducts() {
-        this.visibleDialog = true;
+        if (this.addForm.warehouseId) {
+          this.visibleDialog = true;
+        } else {
+          this.$message.warning('请选择盘点仓库');
+        }
       },
       deleted(row, index) {
         this.productList.splice(index, 1);
@@ -653,28 +628,6 @@
       checkSelectable(row) {
         return true;
       },
-      async getProductList() {
-        let data = null;
-        if (this.dimension == 1) {
-          data = await getProductList({
-            keyWord: this.keyWord,
-            warehouseId: this.type == 2 ? this.addForm?.warehouseId : '',
-            categoryLevelIds: this.addForm?.categoryLevelId.join(','),
-            pageNum: this.page,
-            size: this.size
-          });
-        } else {
-          data = await getBatchList({
-            keyWord: this.keyWord,
-            warehouseId: this.type == 2 ? this.addForm?.warehouseId : '',
-            categoryLevelIds: this.addForm?.categoryLevelId.join(','),
-            pageNum: this.page,
-            size: this.size
-          });
-        }
-        this.total = data.count;
-        this.productList = data.list;
-      },
       // 改变规则名称
       change_ruleId(val) {
         this.addForm.ruleName = this.ruleNameList.filter(
@@ -746,13 +699,6 @@
           (item) => item.id === id
         )[0].name;
       },
-      // 物品类型选择
-      async codeListValue(val) {
-        if (this.addForm.warehouseId) {
-          console.log('val---------', val);
-          this.addForm.categoryLevelId = val;
-        }
-      },
       // 获取物品类型列表
       async getGoodsList() {
         const { data } = await getTreeByGroup({ type: this.type });
@@ -787,6 +733,10 @@
           this.addForm.warehouseName = this.warehouseList.filter(
             (item) => item.id === val
           )[0].name;
+          this.productList = [];
+          getCategoryLevelIdByWarehouseId({ warehouseId: val }).then((data) => {
+            this.productType = Array.from(new Set(data));
+          });
         }
       },
       // 关闭弹窗
@@ -936,7 +886,6 @@
           this.stationOptions = [];
           this.type = 2;
         }
-        this.addForm.categoryLevelId = [];
         this.getGoodsList();
       },
       // 提交
@@ -1004,12 +953,12 @@
           if (valid) {
             let params = {
               ...this.addForm,
-              categoryLevelId: this.addForm.categoryLevelId.join(','),
               details: this.productList.map((item) => {
                 return {
                   batchNo: item.batchNo,
                   categoryId: item.categoryId,
-                  categoryName: item.categoryName
+                  categoryName: item.categoryName,
+                  info: item
                 };
               })
             };

+ 7 - 4
src/views/rulesManagement/warehouseInventory/components/assetTree.vue

@@ -16,7 +16,7 @@
 </template>
 
 <script>
-  import { getTreeByIds } from '@/api/classifyManage';
+  import { getTreeByIds, getTreeByGroup } from '@/api/classifyManage';
 
   export default {
     props: {
@@ -36,7 +36,6 @@
         type: Boolean,
         default: true
       },
-
       treeIds: {
         type: Array,
         default: []
@@ -65,8 +64,12 @@
         return new Promise(async (resolve) => {
           try {
             this.treeLoading = true;
-
-            const res = await getTreeByIds({ ids: this.treeIds.join(',') });
+            let res = null;
+            if (this.treeIds.length > 0) {
+              res = await getTreeByIds({ ids: this.treeIds.join(',') });
+            } else {
+              res = await getTreeByGroup({ type: 2 });
+            }
             this.treeLoading = false;
             if (res?.code === '0') {
               this.treeList = res.data;

+ 15 - 3
src/views/rulesManagement/warehouseInventory/components/inventory-search.vue

@@ -9,7 +9,11 @@
     <el-row :gutter="15">
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="计划配置单号:">
-          <el-input clearable v-model.trim="where.planCode" placeholder="请输入" />
+          <el-input
+            clearable
+            v-model.trim="where.planCode"
+            placeholder="请输入"
+          />
         </el-form-item>
         <el-form-item label="分类:">
           <selectTree
@@ -19,6 +23,7 @@
             style="width: 100%"
             clearable
             :options="codeList"
+            :value="where.categoryLevelId"
             :props="{
               value: 'id',
               label: 'name',
@@ -33,7 +38,11 @@
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="盘点名称:">
-          <el-input clearable v-model.trim="where.planName" placeholder="请输入" />
+          <el-input
+            clearable
+            v-model.trim="where.planName"
+            placeholder="请输入"
+          />
         </el-form-item>
         <el-form-item label="规则名称:">
           <el-select
@@ -61,7 +70,10 @@
           />
         </el-form-item>
         <el-form-item label="组织机构:">
-          <auth-selection v-model.trim="where.deptIds" style="width: 100%"></auth-selection>
+          <auth-selection
+            v-model.trim="where.deptIds"
+            style="width: 100%"
+          ></auth-selection>
         </el-form-item>
       </el-col>
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">

+ 20 - 14
src/views/rulesManagement/warehouseInventory/components/selectType.vue

@@ -78,7 +78,7 @@
             >
             </el-table-column>
             <el-table-column
-              prop="categoryId"
+              prop="categoryCode"
               label="物品编码"
               fixed="left"
               :show-overflow-tooltip="true"
@@ -89,13 +89,19 @@
               fixed="left"
               :show-overflow-tooltip="true"
             ></el-table-column>
+            <el-table-column
+              v-if="dimension == 2"
+              prop="batchNo"
+              label="批次号"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
             <el-table-column
               prop="brandNum"
               label="牌号"
               :show-overflow-tooltip="true"
             ></el-table-column>
             <el-table-column
-              prop="modelType"
+              prop="categoryModel"
               label="型号"
               :show-overflow-tooltip="true"
             ></el-table-column>
@@ -112,35 +118,35 @@
               :show-overflow-tooltip="item.showOverflowTooltip"
             ></el-table-column>
             <el-table-column
-              prop="measuringUnit"
-              label="计量单位"
+              prop="measureQuantity"
+              label="计量数量"
               :show-overflow-tooltip="true"
             ></el-table-column>
             <el-table-column
-              prop="weightUnit"
-              label="量单位"
+              prop="measureUnit"
+              label="量单位"
               :show-overflow-tooltip="true"
             ></el-table-column>
             <el-table-column
-              prop="roughWeight"
-              label="重"
+              prop="weightUnit"
+              label="重量单位"
               :show-overflow-tooltip="true"
             ></el-table-column>
             <el-table-column
-              prop="netWeight"
-              label="重"
+              prop="weight"
+              label="重"
               :show-overflow-tooltip="true"
             ></el-table-column>
             <el-table-column
-              prop="packingUnit"
-              label="包装单位"
+              prop="weightUnit"
+              label="重量单位"
               :show-overflow-tooltip="true"
             ></el-table-column>
-            <el-table-column
+            <!-- <el-table-column
               prop="categoryLevelPath"
               label="分类"
               :show-overflow-tooltip="true"
-            ></el-table-column>
+            ></el-table-column> -->
           </el-table>
           <div class="right mt10">
             <el-pagination

+ 1 - 1
vue.config.js

@@ -33,7 +33,7 @@ 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.116:18086',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {