lilei 2 سال پیش
والد
کامیت
29acdd80dc

+ 9 - 0
src/api/warehouse.js

@@ -11,6 +11,15 @@ export const warehouseList = (params) => {
     method: 'post'
   })
 }
+
+// 获取默认仓库
+export const getDefaultWarehouse = (params) => {
+  return axios({
+    url: '/warehouse/getDefaultWithExt',
+    data: params,
+    method: 'get'
+  })
+}
 //  仓库列表  无分页 有权限
 export const queryAuthWarehouse = (params) => {
   return axios({

+ 0 - 4
src/views/allocationManagement/transferReturn/editGrp.vue

@@ -383,8 +383,6 @@ export default {
           'allocateNo': item.allocateNo,
           'allocateSn': item.allocateSn,
           'oldPrice': item.oldPrice,
-          'cost': item.cost,
-          'returnQty': item.returnQty,
           'price': item.returnPrice,
           'productSn': item.productSn,
           'productCode': item.productCode
@@ -507,8 +505,6 @@ export default {
       const params = {
         allocateReturnSn: this.$route.params.sn,
         productSn: row.productSn,
-        cost: row.cost,
-        returnQty: row.returnQty,
         price: isEdit ? row.price : row.returnPrice,
         allocateNo: row.allocateNo,
         allocateSn: row.allocateSn

+ 2 - 2
src/views/common/chooseWarehouse.js

@@ -80,10 +80,10 @@ const warehouse = {
       const ajaxName = this.isPermission ? queryAuthWarehouse : warehouseAllList
       ajaxName({}).then(res => {
         if (res.status == 200) {
+          // 有权限控制的
           if(this.isPermission){
             this.$store.state.app.isWarehouse = res.data && res.data.length > 1
-            const defWarehouse = res.data.find(item => item.defaultFlag == 1)
-            this.$store.state.app.defWarehouse = this.isPermission ? res.data && res.data[0] : defWarehouse
+            this.$store.state.app.defWarehouse = res.data && res.data[0]
           }
           this.warehouseData = res.data || []
         } else {

+ 9 - 5
src/views/salesReturnManagement/salesReturn/chooseCustomModal.vue

@@ -55,6 +55,7 @@
           <a-form-model-item label="退货仓库" prop="warehouseSn">
               <warehouse
                 v-model="form.warehouseSn"
+                showDef
                 disabled
                 id="chooseCustom-basicInfo-warehouseSn"
                 placeholder="请选择退货仓库"
@@ -76,6 +77,7 @@ import { commonMixin } from '@/utils/mixin'
 import { VSelect } from '@/components'
 import warehouse from '@/views/common/chooseWarehouse.js'
 import { dealerSubareaScopeList, dealerDetailBySn } from '@/api/dealer'
+import { getDefaultWarehouse } from '@/api/warehouse'
 import { salesReturnInsert } from '@/api/salesReturn'
 export default {
   name: 'SalesReturnChooseCustomModal',
@@ -189,6 +191,11 @@ export default {
         }
       })
     },
+    getDefaultWarehouse(){
+      getDefaultWarehouse().then(res => {
+        this.form.warehouseSn = res.data ? res.data.warehouseSn : undefined
+      })
+    },
     cancel () {
       this.opened = false
       this.form = {
@@ -215,12 +222,9 @@ export default {
   watch: {
     show (newValue, oldValue) {
       this.opened = newValue
-      if (newValue) {
-        this.form.warehouseSn = this.defWarehouse&&this.defWarehouse.warehouseSn
+      if(newValue){
+        this.getDefaultWarehouse()
       }
-    },
-    defWarehouse(a,b){
-      this.form.warehouseSn = a&&a.warehouseSn
     }
   }
 }