chenrui преди 6 месеца
родител
ревизия
cb727bdc07

+ 18 - 7
src/api/data.js

@@ -5,7 +5,7 @@ export function login (parameter) {
     url: '/auth/login',
     method: 'post',
     data: parameter,
-    headers:{
+    headers: {
       'module': encodeURIComponent('登录')
     }
   })
@@ -18,7 +18,7 @@ export const findAllLookup = params => {
     url: url,
     data: params,
     method: 'POST',
-    headers:{
+    headers: {
       'module': encodeURIComponent('数据字典查询')
     }
   })
@@ -41,8 +41,8 @@ export const getLookUpData = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-      'module': encodeURIComponent('数据字典('+params.lookupCode+')项查询')
+    headers: {
+      'module': encodeURIComponent('数据字典(' + params.lookupCode + ')项查询')
     }
   })
 }
@@ -151,7 +151,7 @@ export const bizStateCount = (params) => {
     url: `/home/queryBizStateCount`,
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('待处理数据')
     }
   })
@@ -162,7 +162,7 @@ export const bizData = (params) => {
     url: `/home/queryBizData`,
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('数据看板信息')
     }
   })
@@ -173,8 +173,19 @@ export const dealerData = (params) => {
     url: `/dealer/findCurrentDealer`,
     data: params,
     method: 'get',
-    headers:{
+    headers: {
       'module': encodeURIComponent('商户信息')
     }
   })
 }
+// 系统参数查询
+export const getParamValue = (params) => {
+  return axios({
+    url: `/sysVersion/getParamValue/${params.code}`,
+    data: params,
+    method: 'get',
+    headers: {
+      'module': encodeURIComponent('系统参数查询')
+    }
+  })
+}

+ 35 - 18
src/views/purchasingManagement/purchaseOrder/basicInfoModal.vue

@@ -27,7 +27,7 @@
           </a-radio-group>
           <span v-else>没有可选择的供应商</span>
         </a-form-model-item>
-        <a-form-model-item label="产品类型" prop="orderType">
+        <a-form-model-item label="产品类型" prop="orderType" v-if="systemFlag==1">
           <v-select
             code="ORDER_TYPE"
             id="purchaseOrder-basicInfo-orderType"
@@ -69,6 +69,7 @@ import chooseAddressModal from '@/views/common/receivingAddress/chooseAddressMod
 // 接口
 import { shippingAddressQuery } from '@/api/shippingAddress'
 import { purchaseSave, purchaseTargetList } from '@/api/purchase'
+import { getParamValue } from '@/api/data'
 export default {
   name: 'BasicInfoModal',
   components: { VSelect, chooseAddressModal },
@@ -118,7 +119,8 @@ export default {
       chooseAddr: '', //  当前已选地址信息
       addressId: undefined, // 地址id
       openAddrModal: false, // 选择地址弹框是否显示
-      notShowIn: []// 产品类型不显示
+      notShowIn: [], // 产品类型选项不显示
+      systemFlag: null// 产品类型显示不显示
     }
   },
   methods: {
@@ -146,13 +148,15 @@ export default {
         this.form.purchaseTargetType = this.purchaseTragetType[ind].purchaseTargetType
         this.form.purchaseTargetName = this.purchaseTragetType[ind].purchaseTargetName
       }
-      // 经销商向“上级”或“省仓”采购时,默认勾选“非轮胎产品”,不显示轮胎产品
-      if (this.form.purchaseTargetType != 'SUPPLIER_SYS') {
-        this.notShowIn = ['TIRE']
-      } else {
-        this.notShowIn = []
+      if (this.systemFlag == 1) {
+        // 经销商向“上级”或“省仓”采购时,默认勾选“非轮胎产品”,不显示轮胎产品
+        if (this.form.purchaseTargetType != 'SUPPLIER_SYS') {
+          this.notShowIn = ['TIRE']
+        } else {
+          this.notShowIn = []
+        }
+        this.form.orderType = 'OTHER'
       }
-      this.form.orderType = 'OTHER'
     },
     //  保存
     handleSubmit (e) {
@@ -230,21 +234,35 @@ export default {
             }
             return item
           })
-          this.form.purchaseTargetSn = purchaseList[0].purchaseTargetSn
-          this.form.purchaseTargetName = purchaseList[0].purchaseTargetName
-          this.form.purchaseTargetType = purchaseList[0].purchaseTargetType
-          if (purchaseList[0].purchaseTargetType != 'SUPPLIER_SYS') {
-            this.notShowIn = ['TIRE']
-          } else {
-            this.notShowIn = []
+          if (this.systemFlag == 1) {
+            this.form.purchaseTargetSn = purchaseList[0].purchaseTargetSn
+            this.form.purchaseTargetName = purchaseList[0].purchaseTargetName
+            this.form.purchaseTargetType = purchaseList[0].purchaseTargetType
+            if (purchaseList[0].purchaseTargetType != 'SUPPLIER_SYS') {
+              this.notShowIn = ['TIRE']
+            } else {
+              this.notShowIn = []
+            }
+            this.form.orderType = 'OTHER'
           }
-          this.form.orderType = 'OTHER'
           this.purchaseTragetType = purchaseList
         } else {
           this.purchaseTragetType = []
         }
       })
     },
+    // 获取系统参数  判断是否显示产品类型
+    getSystemInfo () {
+      getParamValue({ code: 'TIRE_OPEN' }).then(res => {
+        if (res.status == 200) {
+          this.systemFlag = res.data
+          this.$nextTick(() => {
+            // 获取上级列表
+            this.getParentDealer()
+          })
+        }
+      })
+    },
     // 获取默认地址
     getDefaultAddress () {
       shippingAddressQuery({ defaultFlag: 1 }).then(res => {
@@ -292,10 +310,9 @@ export default {
         this.$emit('close')
         this.resetForm()
       } else {
-        // 获取上级列表
-        this.getParentDealer()
         // 获取默认地址
         this.getDefaultAddress()
+        this.getSystemInfo()
       }
     }
   }

+ 35 - 17
src/views/purchasingManagement/purchaseOrderNew/basicInfoModal.vue

@@ -27,7 +27,7 @@
           </a-radio-group>
           <span v-else>没有可选择的供应商</span>
         </a-form-model-item>
-        <a-form-model-item label="产品类型" prop="orderType">
+        <a-form-model-item label="产品类型" prop="orderType" v-if="systemFlag==1">
           <v-select
             code="ORDER_TYPE"
             id="purchaseOrder-basicInfo-orderType"
@@ -68,6 +68,8 @@ import { VSelect } from '@/components'
 import chooseAddressModal from '@/views/common/receivingAddress/chooseAddressModal.vue'
 import { shippingAddressQuery } from '@/api/shippingAddress'
 import { purchaseSave, purchaseTargetList } from '@/api/purchase'
+import { getParamValue } from '@/api/data'
+
 export default {
   name: 'BasicInfoModal',
   components: { VSelect, chooseAddressModal },
@@ -117,7 +119,8 @@ export default {
       chooseAddr: '', //  当前已选地址信息
       addressId: undefined, // 地址id
       openAddrModal: false, // 选择地址弹框是否显示
-      notShowIn: []// 产品类型不显示
+      notShowIn: [], // 产品类型不显示
+      systemFlag: null// 产品类型显示不显示
     }
   },
   methods: {
@@ -145,13 +148,15 @@ export default {
         this.form.purchaseTargetType = this.purchaseTragetType[ind].purchaseTargetType
         this.form.purchaseTargetName = this.purchaseTragetType[ind].purchaseTargetName
       }
-      // 经销商向“上级”或“省仓”采购时,默认勾选“非轮胎产品”,不显示轮胎产品
-      if (this.form.purchaseTargetType != 'SUPPLIER_SYS') {
-        this.notShowIn = ['TIRE']
-      } else {
-        this.notShowIn = []
+      if (this.systemFlag == 1) {
+        // 经销商向“上级”或“省仓”采购时,默认勾选“非轮胎产品”,不显示轮胎产品
+        if (this.form.purchaseTargetType != 'SUPPLIER_SYS') {
+          this.notShowIn = ['TIRE']
+        } else {
+          this.notShowIn = []
+        }
+        this.form.orderType = 'OTHER'
       }
-      this.form.orderType = 'OTHER'
     },
     //  保存
     handleSubmit (e) {
@@ -229,21 +234,34 @@ export default {
             }
             return item
           })
-          this.form.purchaseTargetSn = purchaseList[0].purchaseTargetSn
-          this.form.purchaseTargetName = purchaseList[0].purchaseTargetName
-          this.form.purchaseTargetType = purchaseList[0].purchaseTargetType
-          if (purchaseList[0].purchaseTargetType != 'SUPPLIER_SYS') {
-            this.notShowIn = ['TIRE']
-          } else {
-            this.notShowIn = []
+          if (this.systemFlag == 1) {
+            this.form.purchaseTargetSn = purchaseList[0].purchaseTargetSn
+            this.form.purchaseTargetName = purchaseList[0].purchaseTargetName
+            this.form.purchaseTargetType = purchaseList[0].purchaseTargetType
+            if (purchaseList[0].purchaseTargetType != 'SUPPLIER_SYS') {
+              this.notShowIn = ['TIRE']
+            } else {
+              this.notShowIn = []
+            }
+            this.form.orderType = 'OTHER'
           }
-          this.form.orderType = 'OTHER'
           this.purchaseTragetType = purchaseList
         } else {
           this.purchaseTragetType = []
         }
       })
     },
+    // 获取系统参数  判断是否显示产品类型
+    getSystemInfo () {
+      getParamValue({ code: 'TIRE_OPEN' }).then(res => {
+        if (res.status == 200) {
+          this.systemFlag = res.data
+          this.$nextTick(() => {
+            this.getParentDealer()
+          })
+        }
+      })
+    },
     // 获取默认地址
     getDefaultAddress () {
       shippingAddressQuery({ defaultFlag: 1 }).then(res => {
@@ -291,8 +309,8 @@ export default {
         this.$emit('close')
         this.resetForm()
       } else {
-        this.getParentDealer()
         this.getDefaultAddress()
+        this.getSystemInfo()
       }
     }
   }