Browse Source

Merge commit 'd3e04431ae6a8f41b178c7d0a915e1dc983e7e71' into HEAD

gitadmin 5 months ago
parent
commit
6f5f6936de

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 17301713560000
+  "version": 1734511158046
 }

+ 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('系统参数查询')
+    }
+  })
+}

+ 20 - 12
src/components/Select/index.js

@@ -33,21 +33,29 @@ export default {
       }
     }
   }),
-  created () {
-    const _this = this
-    const allLookup = JSON.parse(sessionStorage.getItem('allLookup'))
-    const data = allLookup.find(item => item.code == _this.code)
-    // 判断是否是省仓用户
-    _this.dataList = _this.$store.state.user.dealerSupplierFlag == '1' ? data.itemList : data.itemList.filter(item => item.dispName != '省级批发价')
-    // 判断是否不显示指定选项
-    if (_this.notIn) {
-      _this.dataList = _this.dataList.filter(item => _this.notIn.indexOf(item.code) < 0)
+  watch: {
+    notIn (newVal, oldVal) {
+      this.getDataList()
     }
-    setTimeout(() => {
-      _this.$emit('loadDataFinish', _this.dataList)
-    }, 100)
+  },
+  created () {
+    this.getDataList()
   },
   methods: {
+    getDataList () {
+      const _this = this
+      const allLookup = JSON.parse(sessionStorage.getItem('allLookup'))
+      const data = allLookup.find(item => item.code == _this.code)
+      // 判断是否是省仓用户
+      _this.dataList = _this.$store.state.user.dealerSupplierFlag == '1' ? data.itemList : data.itemList.filter(item => item.dispName != '省级批发价')
+      // 判断是否不显示指定选项
+      if (_this.notIn) {
+        _this.dataList = _this.dataList.filter(item => _this.notIn.indexOf(item.code) < 0)
+      }
+      setTimeout(() => {
+        _this.$emit('loadDataFinish', _this.dataList)
+      }, 100)
+    },
     // 根据code 获取名称
     getNameByCode (code) {
       const a = this.dataList.find(item => {

+ 3 - 3
src/views/common/shopingCatModal.vue

@@ -10,8 +10,8 @@
     wrapClassName="shopingCat-drawer jg-drawer-wrap">
     <div slot="title">
       <strong>{{ title }}</strong>
-      <span style="color: #ed1c24;;margin-left:10px;font-size: 12px;" v-if="purchaseTargetType&&(purchaseTargetType=='DEALER_UP'||purchaseTargetType=='DEALER_SUPPLIER')">注意:仅可添加本供应商有权限的产品</span>
-      <span style="color: #ed1c24;;margin-left:10px;font-size: 12px;" v-else-if="purchaseTargetType&&purchaseTargetType=='SUPPLIER_SYS'">注意:仅可添加本供应商有经销权且总部已上线的产品</span>
+      <span style="color: #ed1c24;;margin-left:10px;font-size: 12px;" v-if="orderType">注意:仅可添加本供应商有经销权且总部已上线的{{ orderType=='TIRE'?'轮胎':'非轮胎' }}产品</span>
+      <span style="color: #ed1c24;;margin-left:10px;font-size: 12px;" v-else>注意:仅可添加本供应商有权限的产品</span>
     </div>
     <shopingCat ref="shopingCat" :purchaseType="purchaseTargetType" modes="modals" @ok="handleok"></shopingCat>
   </a-drawer>
@@ -42,7 +42,7 @@ export default {
     paramsData: {
       type: Object
     },
-    purchaseTargetType: {
+    orderType: {// 是否是轮胎产品
       type: String,
       default: null
     }

+ 52 - 4
src/views/purchasingManagement/purchaseOrder/basicInfoModal.vue

@@ -27,6 +27,17 @@
           </a-radio-group>
           <span v-else>没有可选择的供应商</span>
         </a-form-model-item>
+        <a-form-model-item label="产品类型" prop="orderType" v-if="systemFlag==1">
+          <v-select
+            code="ORDER_TYPE"
+            id="purchaseOrder-basicInfo-orderType"
+            v-model="form.orderType"
+            allowClear
+            placeholder="请选择产品类型"
+            :notIn="notShowIn"
+            showType="radio"
+          ></v-select>
+        </a-form-model-item>
         <a-form-model-item label="支付方式" prop="settleStyleSn">
           <v-select
             code="SETTLE_STYLE"
@@ -58,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 },
@@ -87,12 +99,14 @@ export default {
         consigneeName: '', // 联系人名称
         settleStyleSn: undefined, //  支付方式
         purchaseTargetSn: undefined, // 供应商
-        purchaseTargetName: '' // 供应商名称
+        purchaseTargetName: '', // 供应商名称
+        orderType: undefined // 产品类型
       },
       rules: {
         purchaseTargetSn: [
           { required: true, message: '请选择供应商', trigger: 'change' }
         ],
+        orderType: [{ required: true, message: '请选择产品类型', trigger: 'change' }],
         settleStyleSn: [
           { required: true, message: '请选择支付方式', trigger: 'change' }
         ],
@@ -104,7 +118,9 @@ export default {
       addressVal: '选择地址', //  选择地址/更换地址
       chooseAddr: '', //  当前已选地址信息
       addressId: undefined, // 地址id
-      openAddrModal: false // 选择地址弹框是否显示
+      openAddrModal: false, // 选择地址弹框是否显示
+      notShowIn: [], // 产品类型选项不显示
+      systemFlag: null// 产品类型显示不显示
     }
   },
   methods: {
@@ -122,6 +138,7 @@ export default {
       this.form.purchaseTargetType = ''
       this.form.purchaseTargetSn = undefined
       this.form.purchaseTargetName = ''
+      this.form.orderType = undefined
     },
     // 供应商change
     tragetTypeChange (e) {
@@ -131,6 +148,15 @@ export default {
         this.form.purchaseTargetType = this.purchaseTragetType[ind].purchaseTargetType
         this.form.purchaseTargetName = this.purchaseTragetType[ind].purchaseTargetName
       }
+      if (this.systemFlag == 1) {
+        // 经销商向“上级”或“省仓”采购时,默认勾选“非轮胎产品”,不显示轮胎产品
+        if (this.form.purchaseTargetType != 'SUPPLIER_SYS') {
+          this.notShowIn = ['TIRE']
+        } else {
+          this.notShowIn = []
+        }
+        this.form.orderType = 'OTHER'
+      }
     },
     //  保存
     handleSubmit (e) {
@@ -208,12 +234,35 @@ export default {
             }
             return item
           })
+          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.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 => {
@@ -261,10 +310,9 @@ export default {
         this.$emit('close')
         this.resetForm()
       } else {
-        // 获取上级列表
-        this.getParentDealer()
         // 获取默认地址
         this.getDefaultAddress()
+        this.getSystemInfo()
       }
     }
   }

+ 39 - 12
src/views/purchasingManagement/purchaseOrder/edit.vue

@@ -63,35 +63,48 @@
               <!-- 搜索条件 -->
               <div class="table-page-search-wrapper">
                 <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-                  <a-row type="flex" :gutter="12" justify="start">
-                    <a-col flex="250px">
+                  <a-row :gutter="12">
+                    <a-col :md="6" :sm="24">
                       <a-form-model-item label="产品编码">
                         <a-input id="purchaseOrderEdit-code" ref="searchProductCode" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
                       </a-form-model-item>
                     </a-col>
-                    <a-col flex="350px">
+                    <a-col :md="6" :sm="24">
                       <a-form-model-item label="产品名称">
                         <a-input id="purchaseOrderEdit-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
                       </a-form-model-item>
                     </a-col>
-                    <a-col flex="250px">
+                    <a-col :md="6" :sm="24">
                       <a-form-model-item label="原厂编码">
                         <a-input id="purchaseOrderEdit-origCode" v-model.trim="queryParam.origCode" allowClear placeholder="请输入原厂编码"/>
                       </a-form-model-item>
                     </a-col>
                     <template v-if="advanced">
-                      <a-col flex="250px">
+                      <a-col :md="6" :sm="24">
                         <a-form-item label="产品分类">
                           <ProductType id="purchaseOrderEdit-productType" :isDealer="true" :tenantId="$route.params.dealerSn" @change="changeProductType" v-model="productType"></ProductType>
                         </a-form-item>
                       </a-col>
-                      <a-col flex="250px">
+                      <a-col :md="6" :sm="24">
                         <a-form-item label="产品品牌">
                           <ProductBrand id="purchaseOrderEdit-productBrand" :tenantId="$route.params.dealerSn" v-model="queryParam.productBrandSn"></ProductBrand>
                         </a-form-item>
                       </a-col>
+                      <a-col :md="6" :sm="24">
+                        <a-form-item label="可用库存小于等于">
+                          <a-input-number
+                            style="width:100%;"
+                            id="purchaseOrderEdit-stockQty"
+                            v-model.trim="queryParam.stockQty"
+                            :min="0"
+                            :step="1"
+                            :precision="0"
+                            :max="99999999"
+                            placeholder="请输入库存数量"/>
+                        </a-form-item>
+                      </a-col>
                     </template>
-                    <a-col flex="auto" style="margin-bottom: 10px;">
+                    <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
                       <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseOrderEdit-refresh">查询</a-button>
                       <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="purchaseOrderEdit-reset">重置</a-button>
                       <a @click="advanced=!advanced" style="margin:0 30px 0 10px" id="purchaseOrderEdit-advanced-btn">
@@ -206,7 +219,7 @@
                   </a-col>
                   <a-col :span="6">
                     <div style="float:right;overflow: hidden;">
-                      <a-button v-if="!isDealerUp" type="primary" class="button-primary" id="purchaseOrderEdit-cp-importQh-btn" @click="handleOutStock">导入缺货</a-button>
+                      <a-button v-if="(systemFlag==0&&!isDealerUp)||(systemFlag==1&&!isDealerUp&&detail&&detail.orderType==='OTHER')" type="primary" class="button-primary" id="purchaseOrderEdit-cp-importQh-btn" @click="handleOutStock">导入缺货</a-button>
                       <a-button id="purchaseOrderEdit-cp-importCp-btn" @click="openGuideModal=true">导入产品</a-button>
                     </div>
                   </a-col>
@@ -268,9 +281,9 @@
     <!-- 上次缺货 -->
     <outStockModal
       ref="outStock"
-      :purchaseTargetType="detail?detail.purchaseTargetType:null"
       :paramsSn="$route.params.sn"
       :openModal="openOutStockModal"
+      :orderType="detail&&detail.orderType"
       :chooseData="chooseData"
       @close="openOutStockModal=false"
       @ok="hanldeOkOutStock" />
@@ -298,6 +311,7 @@ import ProductBrand from '../../common/productBrand.js'
 import { purchaseDetailBySn, purchaseWriteSubmit, purchaseDetailPrint, purchaseDetailExport, purchaseDetailAddress } from '@/api/purchase'
 import { purchaseDetailList, purchaseDetailSave, purchaseDetailDel } from '@/api/purchaseDetail'
 import { productListPurchase } from '@/api/product'
+import { getParamValue } from '@/api/data'
 
 export default {
   name: 'PurchaseEdit',
@@ -321,7 +335,8 @@ export default {
         origCode: '', //  原厂编码
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
-        productTypeSn3: '' //  产品三级分类
+        productTypeSn3: '', //  产品三级分类
+        stockQty: ''// 可用库存小于等于
       },
       typeData: [], //    下拉数据
       advanced: false, //  高级搜索 展开/关闭
@@ -370,7 +385,8 @@ export default {
       openGuideModal: false, //  导入产品引导
       openOutStockModal: false, // 上次缺货弹框
       openAddrModal: false, // 选择地址弹框是否显示
-      openOutStockListModal: false // 导入缺货弹框
+      openOutStockListModal: false, // 导入缺货弹框
+      systemFlag: null// 是否是转单产品
     }
   },
   computed: {
@@ -390,6 +406,7 @@ export default {
         // { title: '成本价', dataIndex: 'purchasePrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
         { title: '终端会员价', dataIndex: 'terminalPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
         { title: '车主零售价', dataIndex: 'carOwnersPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
+        { title: '可用库存', dataIndex: 'currentStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '采购数量', dataIndex: 'qty', scopedSlots: { customRender: 'storageQuantity' }, width: '6%', align: 'center' },
         { title: '产品图片', scopedSlots: { customRender: 'imageUrl' }, width: '6%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
@@ -490,7 +507,8 @@ export default {
         origCode: '', //  原厂编码
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
-        productTypeSn3: '' //  产品三级分类
+        productTypeSn3: '', //  产品三级分类
+        stockQty: ''// 可用库存小于等于
       }
       this.productType = []
       this.$refs.table.refresh(true)
@@ -663,6 +681,14 @@ export default {
         _this.spinning = false
       })
     },
+    // 获取系统参数  判断是否显示产品类型
+    getSystemInfo () {
+      getParamValue({ code: 'TIRE_OPEN' }).then(res => {
+        if (res.status == 200) {
+          this.systemFlag = res.data
+        }
+      })
+    },
     //  返回列表
     handleBack () {
       this.$router.push({ path: '/purchasingManagement/purchaseOrder/list' })
@@ -675,6 +701,7 @@ export default {
         this.resetSearchForm()
         this.$refs.searchProductCode.focus()
       })
+      this.getSystemInfo()
     }
   },
   mounted () {

+ 3 - 3
src/views/purchasingManagement/purchaseOrder/outStockModal.vue

@@ -9,8 +9,8 @@
     :width="900">
     <div slot="title">
       <strong>采购缺货产品明细</strong>
-      <span style="color: #ed1c24;;margin-left:10px;font-size: 12px;" v-if="purchaseTargetType&&(purchaseTargetType=='DEALER_UP'||purchaseTargetType=='DEALER_SUPPLIER')">注意:仅可添加本供应商有权限的产品</span>
-      <span style="color: #ed1c24;;margin-left:10px;font-size: 12px;" v-else-if="purchaseTargetType&&purchaseTargetType=='SUPPLIER_SYS'">注意:仅可添加本供应商有经销权且总部已上线的产品</span>
+      <span style="color: #ed1c24;;margin-left:10px;font-size: 12px;" v-if="orderType">注意:仅可添加本供应商有经销权且总部已上线的{{ orderType=='TIRE'?'轮胎':'非轮胎' }}产品</span>
+      <span style="color: #ed1c24;;margin-left:10px;font-size: 12px;" v-else>注意:仅可添加本供应商有权限的产品</span>
     </div>
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="outStock-con">
@@ -120,7 +120,7 @@ export default {
         return []
       }
     },
-    purchaseTargetType: { // 采购类型
+    orderType: {// 是否是轮胎产品
       type: String,
       default: null
     }

+ 52 - 3
src/views/purchasingManagement/purchaseOrderNew/basicInfoModal.vue

@@ -27,6 +27,17 @@
           </a-radio-group>
           <span v-else>没有可选择的供应商</span>
         </a-form-model-item>
+        <a-form-model-item label="产品类型" prop="orderType" v-if="systemFlag==1">
+          <v-select
+            code="ORDER_TYPE"
+            id="purchaseOrder-basicInfo-orderType"
+            v-model="form.orderType"
+            allowClear
+            placeholder="请选择产品类型"
+            :notIn="notShowIn"
+            showType="radio"
+          ></v-select>
+        </a-form-model-item>
         <a-form-model-item label="支付方式" prop="settleStyleSn">
           <v-select
             code="SETTLE_STYLE"
@@ -57,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 },
@@ -86,12 +99,14 @@ export default {
         consigneeName: '', // 联系人名称
         settleStyleSn: undefined, //  支付方式
         purchaseTargetSn: undefined, // 供应商sn
-        purchaseTargetName: '' // 供应商名称
+        purchaseTargetName: '', // 供应商名称
+        orderType: undefined // 产品类型
       },
       rules: {
         purchaseTargetSn: [
           { required: true, message: '请选择供应商', trigger: 'change' }
         ],
+        orderType: [{ required: true, message: '请选择产品类型', trigger: 'change' }],
         settleStyleSn: [
           { required: true, message: '请选择支付方式', trigger: 'change' }
         ],
@@ -103,7 +118,9 @@ export default {
       addressVal: '选择地址', //  选择地址/更换地址
       chooseAddr: '', //  当前已选地址信息
       addressId: undefined, // 地址id
-      openAddrModal: false // 选择地址弹框是否显示
+      openAddrModal: false, // 选择地址弹框是否显示
+      notShowIn: [], // 产品类型不显示
+      systemFlag: null// 产品类型显示不显示
     }
   },
   methods: {
@@ -121,6 +138,7 @@ export default {
       this.form.purchaseTargetType = ''
       this.form.purchaseTargetSn = undefined
       this.form.purchaseTargetName = ''
+      this.form.orderType = undefined
     },
     // 选择供应商change
     tragetTypeChange (e) {
@@ -130,6 +148,15 @@ export default {
         this.form.purchaseTargetType = this.purchaseTragetType[ind].purchaseTargetType
         this.form.purchaseTargetName = this.purchaseTragetType[ind].purchaseTargetName
       }
+      if (this.systemFlag == 1) {
+        // 经销商向“上级”或“省仓”采购时,默认勾选“非轮胎产品”,不显示轮胎产品
+        if (this.form.purchaseTargetType != 'SUPPLIER_SYS') {
+          this.notShowIn = ['TIRE']
+        } else {
+          this.notShowIn = []
+        }
+        this.form.orderType = 'OTHER'
+      }
     },
     //  保存
     handleSubmit (e) {
@@ -207,12 +234,34 @@ export default {
             }
             return item
           })
+          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.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 => {
@@ -260,8 +309,8 @@ export default {
         this.$emit('close')
         this.resetForm()
       } else {
-        this.getParentDealer()
         this.getDefaultAddress()
+        this.getSystemInfo()
       }
     }
   }

+ 36 - 14
src/views/purchasingManagement/purchaseOrderNew/chooseProductModal.vue

@@ -14,13 +14,13 @@
         <!-- 搜索条件 -->
         <div ref="searchBox" class="table-page-search-wrapper">
           <a-form layout="inline" @keyup.enter.native="searchForm">
-            <a-row type="flex" :gutter="12" justify="start">
-              <a-col flex="auto">
+            <a-row :gutter="12">
+              <a-col :md="6" :sm="24">
                 <a-form-model-item label="产品编码">
                   <a-input id="purchaseOrderEdit-code" ref="searchProductCode" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
                 </a-form-model-item>
               </a-col>
-              <a-col flex="auto">
+              <a-col :md="6" :sm="24">
                 <a-form-model-item label="产品名称">
                   <a-input id="purchaseOrderEdit-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
                 </a-form-model-item>
@@ -30,17 +30,30 @@
                   <a-input id="purchaseOrderEdit-origCode" v-model.trim="queryParam.origCode" allowClear placeholder="请输入原厂编码"/>
                 </a-form-model-item>
               </a-col> -->
-              <a-col flex="250px">
+              <a-col :md="6" :sm="24">
                 <a-form-item label="产品分类">
                   <ProductType id="purchaseOrderEdit-productType" :isDealer="true" :tenantId="$route.params.dealerSn" @change="changeProductType" v-model="productType"></ProductType>
                 </a-form-item>
               </a-col>
-              <a-col flex="250px">
+              <a-col :md="6" :sm="24">
                 <a-form-item label="产品品牌">
                   <ProductBrand id="purchaseOrderEdit-productBrand" :tenantId="$route.params.dealerSn" v-model="queryParam.productBrandSn"></ProductBrand>
                 </a-form-item>
               </a-col>
-              <a-col flex="auto">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="可用库存小于等于">
+                  <a-input-number
+                    style="width:100%;"
+                    id="purchaseOrderEdit-stockQty"
+                    v-model.trim="queryParam.stockQty"
+                    :min="0"
+                    :step="1"
+                    :precision="0"
+                    :max="99999999"
+                    placeholder="请输入库存数量"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
                 <a-button type="primary" @click="searchForm" id="purchaseOrderEdit-refresh">查询</a-button>
                 <a-button style="margin-left: 5px" @click="resetSearchForm" id="purchaseOrderEdit-reset">重置</a-button>
               </a-col>
@@ -186,7 +199,8 @@ export default {
         origCode: '', //  原厂编码
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
-        productTypeSn3: '' //  产品三级分类
+        productTypeSn3: '', //  产品三级分类
+        stockQty: undefined
       },
       advanced: false, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
@@ -213,7 +227,7 @@ export default {
   computed: {
     // 是否有筛选条件,至少一个
     hasVaild () {
-      return this.queryParam.code || this.queryParam.name || this.queryParam.productBrandSn || this.queryParam.productTypeSn1
+      return this.queryParam.code || this.queryParam.name || this.queryParam.productBrandSn || this.queryParam.productTypeSn1 || this.queryParam.stockQty || this.queryParam.stockQty == 0
     },
     // 动态计算表格宽度
     tableWidth () {
@@ -234,12 +248,12 @@ export default {
         { title: '产品名称', dataIndex: 'name', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'origCode', width: '150px', align: 'center', customRender: function (text) { return text && text != ' ' ? text : '--' } },
         { title: '在途数', dataIndex: 'transitQty', width: '60px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '可用库存', dataIndex: 'currentStockQty', width: '60px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '产品图片', scopedSlots: { customRender: 'imageUrl' }, width: '60px', align: 'center' },
         { title: '单位', dataIndex: 'unit', width: '60px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '包装数', scopedSlots: { customRender: 'baozh' }, width: '60px', align: 'center' },
-        { title: '终端会员价', dataIndex: 'terminalPrice', width: '80px', align: 'right', fixed: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
-        { title: '车主零售价', dataIndex: 'carOwnersPrice', width: '80px', align: 'right', fixed: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
+        { title: '终端会员价', dataIndex: 'terminalPrice', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
+        { title: '车主零售价', dataIndex: 'carOwnersPrice', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
+        { title: '可用库存', dataIndex: 'currentStockQty', width: '70px', align: 'center', fixed: 'right', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '采购数量', dataIndex: 'qty', scopedSlots: { customRender: 'storageQuantity' }, width: '80px', align: 'center', fixed: 'right' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '80px', align: 'center', fixed: 'right' }
       ]
@@ -252,7 +266,7 @@ export default {
       }
       // 成本价权限
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(this.isDealerUp ? 10 : 9, 0, { title: '成本价', dataIndex: 'purchasePrice', width: '80px', align: 'right', fixed: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
+        arr.splice(this.isDealerUp ? 12 : 11, 0, { title: '成本价', dataIndex: 'purchasePrice', width: '80px', align: 'right', fixed: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
       }
       return arr
     }
@@ -288,7 +302,8 @@ export default {
         origCode: '', //  原厂编码
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
-        productTypeSn3: '' //  产品三级分类
+        productTypeSn3: '', //  产品三级分类
+        stockQty: undefined
       }
       this.productType = []
       this.showTable = false
@@ -313,7 +328,7 @@ export default {
 }
 </script>
 
-<style lang="less">
+<style lang="less" scoped>
 .chooseProduct-drawer {
   .ant-drawer-header{
     padding: 13px 20px;
@@ -336,4 +351,11 @@ export default {
     }
   }
 }
+.chooseProduct-drawer-box{
+  /deep/.ant-input-number{
+     border: 0;
+     -webkit-box-shadow: none !important;
+     box-shadow: none !important;
+   }
+}
 </style>

+ 22 - 5
src/views/purchasingManagement/purchaseOrderNew/edit.vue

@@ -24,7 +24,7 @@
               <a-menu-item key="3" v-if="$hasPermissions('M_shoppingCart')" id="purchaseNewOrderEdit-more-3">
                 <a-icon type="shopping" /> 购物车
               </a-menu-item>
-              <a-menu-item key="2" v-if="!isDealerUp" id="purchaseNewOrderEdit-more-2">
+              <a-menu-item key="2" v-if="(systemFlag==0&&!isDealerUp)||(systemFlag==1&&!isDealerUp&&detail&&detail.orderType==='OTHER')" id="purchaseNewOrderEdit-more-2">
                 <a-icon type="funnel-plot" />导入缺货
               </a-menu-item>
               <a-menu-item key="1" id="purchaseNewOrderEdit-more-1">
@@ -170,12 +170,17 @@
       ref="outStock"
       :paramsSn="$route.params.sn"
       :chooseData="chooseData"
+      :orderType="detail&&detail.orderType"
       :openModal="openOutStockModal"
-      :purchaseTargetType="detail?detail.purchaseTargetType:null"
       @close="openOutStockModal=false"
       @ok="hanldeOkOutStock" />
     <!-- 购物车 -->
-    <shopingCatModal :showModal="openShopCatModal" :paramsData="paramsData" :purchaseTargetType="detail?detail.purchaseTargetType:null" @close="openShopCatModal=false" @ok="getOrderDetail(false, true)"></shopingCatModal>
+    <shopingCatModal
+      :showModal="openShopCatModal"
+      :orderType="detail&&detail.orderType"
+      :paramsData="paramsData"
+      @close="openShopCatModal=false"
+      @ok="getOrderDetail(false, true)"></shopingCatModal>
   </div>
 </template>
 
@@ -190,6 +195,7 @@ import chooseAddressModal from '@/views/common/receivingAddress/chooseAddressMod
 // 接口
 import { purchaseDetailBySn, purchaseWriteSubmit, purchaseDetailPrint, purchaseDetailExport, purchaseDetailAddress } from '@/api/purchase'
 import { purchaseDetailList, purchaseDetailSave, purchaseDetailDel } from '@/api/purchaseDetail'
+import { getParamValue } from '@/api/data'
 // 选择产品
 import chooseProductModal from './chooseProductModal.vue'
 // 打印
@@ -272,7 +278,8 @@ export default {
       openOutStockModal: false, // 上次缺货弹框
       paramsData: null, // 传递购物车的参数
       openAddrModal: false, // 选择地址弹框是否显示
-      openOutStockListModal: false // 导入缺货
+      openOutStockListModal: false, // 导入缺货
+      systemFlag: null// 是否是转单产品
     }
   },
   computed: {
@@ -528,7 +535,8 @@ export default {
     hanldCart () {
       this.paramsData = {
         purchaseBillSn: this.$route.params.sn,
-        purchaseBillNo: this.detail && this.detail.purchaseBillNo ? this.detail.purchaseBillNo : undefined
+        purchaseBillNo: this.detail && this.detail.purchaseBillNo ? this.detail.purchaseBillNo : undefined,
+        orderType: this.detail && this.detail.orderType ? this.detail.orderType : undefined
       }
       this.openShopCatModal = true
     },
@@ -594,6 +602,14 @@ export default {
         _this.$refs.printBox.hovered = false
       })
     },
+    // 获取系统参数  判断是否显示产品类型
+    getSystemInfo () {
+      getParamValue({ code: 'TIRE_OPEN' }).then(res => {
+        if (res.status == 200) {
+          this.systemFlag = res.data
+        }
+      })
+    },
     //  返回列表
     handleBack () {
       this.$router.push({ name: 'purchaseOrderNewList' })
@@ -608,6 +624,7 @@ export default {
         this.setTableH()
         this.getOrderDetail(false, true)
       })
+      this.getSystemInfo()
     }
   },
   watch: {

+ 6 - 5
src/views/purchasingManagement/purchaseOrderNew/outStockModal.vue

@@ -11,8 +11,8 @@
   >
     <div slot="title">
       <strong>采购缺货产品明细</strong>
-      <span style="color: #ed1c24;;margin-left:10px;font-size: 12px;" v-if="purchaseTargetType&&(purchaseTargetType=='DEALER_UP'||purchaseTargetType=='DEALER_SUPPLIER')">注意:仅可添加本供应商有权限的产品</span>
-      <span style="color: #ed1c24;;margin-left:10px;font-size: 12px;" v-else-if="purchaseTargetType&&purchaseTargetType=='SUPPLIER_SYS'">注意:仅可添加本供应商有经销权且总部已上线的产品</span>
+      <span style="color: #ed1c24;;margin-left:10px;font-size: 12px;" v-if="orderType">注意:仅可添加本供应商有经销权且总部已上线的{{ orderType=='TIRE'?'轮胎':'非轮胎' }}产品</span>
+      <span style="color: #ed1c24;;margin-left:10px;font-size: 12px;" v-else>注意:仅可添加本供应商有权限的产品</span>
     </div>
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="outStock-con jg-drawer-wrap">
@@ -122,9 +122,10 @@ export default {
       type: Number,
       default: 100
     },
-    // 1向总部采购的提示语:注意:仅可添加本供应商有经销权且总部已上线的产品
-    // 2向上级与省仓采购的提示语:注意:仅可添加本供应商有权限的产品
-    purchaseTargetType: {
+    // 采购对象无订单来源提示:注意:仅可添加本供应商有权限的产品
+    // 订单来源是轮胎:注意:仅可添加本供应商有经销权且总部已上线的轮胎产品
+    // 订单来源非轮胎:注意:仅可添加本供应商有经销权且总部已上线的非轮胎产品
+    orderType: {// 是否是轮胎产品
       type: String,
       default: null
     }

+ 10 - 10
src/views/salesManagement/salesQuery/detail.vue

@@ -216,28 +216,28 @@ export default {
         { title: '单位', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '售价小计', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '折后小计', dataIndex: 'discountedAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '折扣金额', dataIndex: 'discountAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '折扣金额', dataIndex: 'discountAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
         // { title: '仓库', dataIndex: 'warehouseName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         // { title: '仓位', dataIndex: 'warehouseLocationName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '是否急件', dataIndex: 'oosFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
+        // { title: '是否急件', dataIndex: 'oosFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
       ]
       // 实际总成本
       if (this.showCost) {
-        arr.splice(11, 0, { slots: { title: 'costTitle' }, dataIndex: 'totalCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-      } else {
-        arr.splice(11, 1)
+        arr.push({ slots: { title: 'costTitle' }, dataIndex: 'totalCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       if (this.detailData && this.detailData.sourceType && this.detailData.sourceType === 'XPRH_PURCHASE') {
-        arr.splice(11, 1, { title: <a-tooltip placement="bottom" title='返券金额以销售单完结时的活动规则为准'>返券金额&nbsp;<a-icon type="question-circle" /></a-tooltip>, dataIndex: 'giveAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.push({ title: <a-tooltip placement="bottom" title='返券金额以销售单完结时的活动规则为准'>返券金额&nbsp;<a-icon type="question-circle" /></a-tooltip>, dataIndex: 'giveAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       // 下级创建,不显示仓库仓位
       if (!this.isOwerEdit) {
-        arr.splice(this.showCost ? 12 : 11, 0, { title: '库存数量', dataIndex: 'currentStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.push({ title: '库存数量', dataIndex: 'currentStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       } else {
-        arr.splice(this.showCost ? 12 : 11, 0, { title: '仓库', dataIndex: 'warehouseName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } })
-        arr.splice(this.showCost ? 13 : 12, 0, { title: '仓位', dataIndex: 'warehouseLocationName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } })
+        arr.push({ title: '仓库', dataIndex: 'warehouseName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } })
+        arr.push({ title: '仓位', dataIndex: 'warehouseLocationName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } })
       }
+      arr.push({ title: '是否急件', dataIndex: 'oosFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } })
+      arr.push({ title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' })
       return arr
     }
   },

+ 1 - 1
src/views/salesManagement/salesQuery/edit.vue

@@ -682,7 +682,7 @@ export default {
             // 客户sn
             const buyerSn = (vm.detailData && vm.detailData.buyerSn && vm.detailData.sourceType && vm.detailData.sourceType == 'PURCHASE') ? '' : vm.detailData.buyerSn
             const priceType = vm.$route.params.priceType // 价格类型
-            vm.$refs.partQuery.pageInit(buyerSn, priceType, vm.salesBillSn)
+            vm.$refs.partQuery.pageInit(buyerSn, priceType, vm.salesBillSn, vm.detailData.sourceType)
             // 查询关联的客户
             if (vm.detailData && vm.detailData.buyerSn) {
               this.getShelfQueryByCustomer()

+ 2 - 2
src/views/salesManagement/salesQuery/list.vue

@@ -218,7 +218,7 @@
             type="link"
             :id="'salesManagementList-edit-'+record.salesBillNo"
             class="button-primary"
-            v-if="((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING'||record.sourceType == 'XPRH_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && $hasPermissions('B_salesEdit')"
+            v-if="(((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING'||record.sourceType == 'XPRH_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT'))||(record.sourceType === 'TRANSFER_ORDER'&&record.billStatus == 'WAIT_AUDIT')) && $hasPermissions('B_salesEdit')"
             @click="handleEdit(record)"
           >
             编辑
@@ -249,7 +249,7 @@
             type="link"
             :id="'salesManagementList-cancel-'+record.salesBillNo"
             class="button-error"
-            v-if="((record.sourceType == 'CHILD_PURCHASE'||record.sourceType == 'DEALER_PURCHASE'||record.sourceType =='XPRH_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesDel')"
+            v-if="((record.sourceType == 'CHILD_PURCHASE'||record.sourceType == 'DEALER_PURCHASE'||record.sourceType =='XPRH_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && record.sourceType != 'TRANSFER_ORDER'&& $hasPermissions('B_salesDel')"
             @click="handleDel(record, 'cancel')"
           >
             取消

+ 9 - 2
src/views/salesManagement/salesQuery/queryPart.vue

@@ -221,8 +221,9 @@ export default {
         productTypeSn3: '', //  产品三级分类
         warehouseSn: undefined, //  仓库、
         enableFlag: '1', // 启用禁用
-        existStockFlag: undefined // 是否存在库存
+        existStockFlag: undefined// 是否存在库存
       },
+      sourceType: null, // 单据来源
       priceType: '', // 价格类型
       buyerSn: '', // 客户sn
       rules: { // 校验
@@ -253,6 +254,10 @@ export default {
           parameter.sortField = 'warehouseSn'
           parameter.sortAlias = 'sd'
         }
+        // 转单时,productTypeSn3:543766811373752320
+        if (_this.sourceType === 'TRANSFER_ORDER') {
+          _this.queryParam.productTypeSn3 = '543766811373752320'
+        }
         const params = Object.assign(parameter, _this.queryParam)
         //  输入vin,查出vin码信息后请求列表数据
         if (_this.queryParam.vinCode && _this.queryParam.vinCode.length == 17 && !this.onlyList) {
@@ -407,10 +412,12 @@ export default {
       this.vinInfoData = null
     },
     // 初始页面
-    pageInit (buyerSn, priceType, salesBillSn) {
+    pageInit (buyerSn, priceType, salesBillSn, sourceType) {
+      this.sourceType = sourceType
       this.priceType = priceType || ''
       this.buyerSn = buyerSn || ''
       this.queryParam.salesBillSn = salesBillSn || ''
+
       if (this.onlyList) { // 不清空查询条件
         this.$refs.table.refresh()
       } else {

+ 8 - 0
src/views/salesManagement/salesQueryNew/chooseProductModal.vue

@@ -249,6 +249,10 @@ export default {
     checkedList: { // 已选产品列表
       type: Array,
       default: () => []
+    },
+    sourceType: {
+      type: String,
+      default: ''
     }
   },
   watch: {
@@ -321,6 +325,10 @@ export default {
           parameter.sortField = 'warehouseSn'
           parameter.sortAlias = 'sd'
         }
+        // 转单时,productTypeSn3:543766811373752320
+        if (_this.sourceType === 'TRANSFER_ORDER') {
+          _this.queryParam.productTypeSn3 = '543766811373752320'
+        }
         const params = Object.assign(parameter, _this.queryParam)
         if (_this.queryParam.vinCode && _this.queryParam.vinCode.length == 17 && !this.onlyList) { //  输入vin,查出vin码信息后请求列表数据
           _this.disabled = true

+ 1 - 0
src/views/salesManagement/salesQueryNew/edit.vue

@@ -310,6 +310,7 @@
       :newLoading="isInster"
       :showModal="openChooseProduct"
       :checkedList="checkedProductList"
+      :sourceType="detailData.sourceType"
       @viewRecord="hanldSalesRecord"
       @close="openChooseProduct=false"
       @add="insterProduct"

+ 2 - 2
src/views/salesManagement/salesQueryNew/list.vue

@@ -223,7 +223,7 @@
               size="small"
               type="link"
               class="button-primary"
-              v-if="((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING'||record.sourceType == 'XPRH_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && $hasPermissions('B_salesEdit')"
+              v-if="(((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING'||record.sourceType == 'XPRH_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT'))||(record.sourceType === 'TRANSFER_ORDER'&&record.billStatus == 'WAIT_AUDIT')) && $hasPermissions('B_salesEdit')"
               @click="handleEdit(record)"
             >
               编辑
@@ -253,7 +253,7 @@
               size="small"
               type="link"
               class="button-error"
-              v-if="((record.sourceType == 'CHILD_PURCHASE'||record.sourceType == 'DEALER_PURCHASE'||record.sourceType =='XPRH_PURCHASE' ) && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesDel')"
+              v-if="((record.sourceType == 'CHILD_PURCHASE'||record.sourceType == 'DEALER_PURCHASE'||record.sourceType =='XPRH_PURCHASE') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && record.sourceType != 'TRANSFER_ORDER'&& $hasPermissions('B_salesDel')"
               @click="handleDel(record, 'cancel')"
             >
               取消

+ 23 - 3
src/views/supplierManagement/supplierInfo/editModal.vue

@@ -202,6 +202,10 @@ export default {
           if (res.data.citySn) { this.getArea('district', res.data.citySn) }
           this.form = Object.assign(this.form, res.data)
           this.form.enabledFlag = Number(this.form.enabledFlag)
+          if (!this.itemId) {
+            this.form.supplierSn = undefined
+            this.form.sysFlag = undefined
+          }
         }
       })
     },
@@ -288,6 +292,24 @@ export default {
           }
         }
       })
+    },
+    resetSearchForm () {
+      this.form.supplierName = ''
+      this.form.provinceSn = undefined
+      this.form.provinceName = ''
+      this.form.citySn = undefined
+      this.form.cityName = ''
+      this.form.countySn = undefined
+      this.form.countyName = ''
+      this.form.supplierAddress = ''
+      this.form.contactPerson = ''
+      this.form.contactTel = ''
+      this.form.businessScope = undefined
+      this.form.enabledFlag = 1
+      this.form.supplierSn = undefined
+      this.addrCityList = []
+      this.addrDistrictList = []
+      this.$refs.ruleForm.resetFields()
     }
   },
   watch: {
@@ -299,9 +321,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-        this.$refs.ruleForm.resetFields()
-        this.addrCityList = []
-        this.addrDistrictList = []
+        this.resetSearchForm()
       } else {
         this.getArea('province')
       }