Ver código fonte

添加location

liujixin 3 meses atrás
pai
commit
18b0b4a06d

+ 7 - 0
src/api/oms/inventory/warehouse.js

@@ -119,5 +119,12 @@ export function getReturnWarehouseInfo(id) {
     method: 'get'
   })
 }
+export function getLocation(date) {
+  return request({
+    url:  '/storeLocations/getLocation',
+    method: 'get',
+    params: date
+  })
+}
 
 

+ 53 - 2
src/views/oms/inventory/inventory/warehouseList.vue

@@ -278,6 +278,28 @@
           </el-checkbox-group>
         </el-form-item>
 
+        <el-form-item
+          v-if="showLocationFlag"
+          label="请选择location"
+          prop="inventoryProtection"
+        >
+          <el-select
+            v-model="warehouseForm.locationId"
+            filterable
+            placeholder="请选择location"
+            style="width: 360px;"
+            clearable
+          >
+            <el-option
+              v-for="item in locationList"
+              :key="item.locationId"
+              :label="item.name"
+              :value="item.locationId"
+            />
+          </el-select>
+        </el-form-item>
+
+
         <el-form-item
           :label="$t('label.inventoryProtection')"
           prop="inventoryProtection"
@@ -320,7 +342,7 @@ import {
   getById,
   editStatus,
   typeKeyValue,
-  statusKeyValue
+  statusKeyValue, getLocation
 } from "@/api/oms/inventory/warehouse";
 import inventoryProtectingDialog from "@/views/oms/basicConfig/components/inventoryProtectingDialog";
 
@@ -357,11 +379,17 @@ export default {
         status: ""
       },
       checkAll: false,
+      showLocationFlag:false,
       storeCheckAll: [],
       store: [],
       isIndeterminate: true,
       isStoreIndeterminate: true,
       flag: false,
+      locationList:{
+        storeId:"",
+        locationId:"",
+        name:""
+      },
       warehouseForm: {
         warehouseId: "",
         warehouseCode: "",
@@ -370,7 +398,8 @@ export default {
         status: "",
         supportStocking: "",
         checkedStore: [],
-        inventoryProtection: ""
+        inventoryProtection: "",
+        locationId:""
       },
       warehouseTypes: [
         { value: "10", label: "歌莉娅WMS(香港)" },
@@ -417,6 +446,7 @@ export default {
   created() {
     this.getList();
     this.getStockStore();
+    this.getLocations();
   },
   activated() {
     this.getList();
@@ -456,6 +486,15 @@ export default {
       //分页
       this.getList();
     },
+    getLocations(){
+      getLocation({storeId:2200}).then(res => {
+        if (200 == res.code) {
+          console.log(res.data)
+          this.locationList = res.data;
+          console.log(this.locationList)
+        }
+      });
+    },
     getStockStore() {
       getStoreList().then(res => {
         if (200 == res.code) {
@@ -469,10 +508,21 @@ export default {
       });
     },
     storeHandleCheckAllChange(val) {
+      if(val==true && this.warehouseForm.supportStocking==1){
+        this.showLocationFlag=true;
+      }else{
+        this.showLocationFlag=false;
+      }
+
       this.warehouseForm.checkedStore = val ? this.stockStoreId : [];
       this.isStoreIndeterminate = false;
     },
     handleCheckedStoresChange(value) {
+      if(value.findIndex(item => (item===2200))!=-1 && this.warehouseForm.supportStocking==1){
+        this.showLocationFlag=true;
+      }else{
+        this.showLocationFlag=false;
+      }
       if (value) {
         let checkedCount = value.length;
         this.storeCheckAll = checkedCount === this.stockStoreId.length;
@@ -481,6 +531,7 @@ export default {
       }
     },
 
+
     editWarehouseSubmit() {
       this.$refs["warehouseForm"].validate(valid => {
         //表单提交时的验证