소스 검색

Merge branch 'develop_temp0509' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into develop_yh05

lilei 3 년 전
부모
커밋
aed03ca85b

+ 1 - 1
public/version.json

@@ -1,4 +1,4 @@
 {
-    "version": "1.1.4",
+    "version": "1.1.5",
     "message": "发现有新版本发布,确定更新系统?"
 }

+ 4 - 2
src/views/bulkManagement/bulkWarehousingOrder/edit.vue

@@ -407,7 +407,9 @@ export default {
           onOk () {
             _this.paramsData = {
               supplierName: _this.basicInfoData.supplierName,
-              code: _this.queryParam.queryWord,
+              code: _this.queryParam.code,
+              name: _this.queryParam.name,
+              origCode: _this.queryParam.origCode,
               putCost: 0,
               putQty: 1,
               warehouse: []
@@ -432,7 +434,7 @@ export default {
     // 添加产品成功
     saveProductOk (data) {
       this.paramsData = data
-      this.queryParam.queryWord = data.code
+      this.queryParam.code = data.code
       this.$refs.table.refresh(true)
     },
     //  重置

+ 1 - 1
src/views/productManagement/productBrand/editModal.vue

@@ -107,7 +107,7 @@ export default {
           dealerProductBrandSave(formData).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
-              _this.$emit('ok')
+              _this.$emit('ok', formData.brandName)
               _this.isShow = false
               _this.spinning = false
             } else {

+ 40 - 50
src/views/productManagement/productInfo/edit.vue

@@ -50,7 +50,7 @@
           <a-form-model-item label="基本单位" prop="unit">
             <a-input-group compact>
               <a-input
-                style="width: 80%"
+                style="width: 70%"
                 v-model.trim="form.unit"
                 id="productInfoEdit-unit-input"
                 placeholder="请输入基本单位"
@@ -58,7 +58,7 @@
                 @keydown.enter.native="nextFocus('unit', 'UNIT', $event, 'vSelect')"
                 allowClear/>
               <v-select
-                style="width: 20%"
+                style="width: 30%"
                 code="UNIT"
                 @change="unitChange"
                 id="productInfoEdit-unit"
@@ -69,14 +69,14 @@
           </a-form-model-item>
           <a-form-model-item label="产品品牌" prop="productBrandSn">
             <a-select
-              show-search
+              :showSearch="true"
               id="productInfoEdit-productBrand"
               v-model="form.productBrandSn"
-              placeholder="请输入名称或拼音查询,如果没有请点击 '+' 新增"
+              placeholder="请输入名称搜索,如果没有请点击 '+' 新增"
               :disabled="isEdit"
-              :filter-option="false"
-              :not-found-content="fetching ? undefined : null"
-              @search="fetchUser"
+              :filter-option="filterOption"
+              option-filter-prop="children"
+              allowClear
               style="width: 90%;"
               ref="productBrandSn"
               @keydown.enter.native="nextFocus('productBrandSn', 'productType', $event)"
@@ -294,25 +294,31 @@ export default {
       this.$refs.ruleForm.clearValidate('warehouse')
     },
     // 搜索品牌
-    fetchUser (value) {
+    searchBrand (value, defval) {
       console.log('fetching user', value)
       this.fetching = true
       dealerProductBrandQuery({ 'queryWord': value }).then(res => {
         if (res.status == 200) {
           this.productBrandList = res.data || []
           this.fetching = false
+          // 默认值
+          if (defval) {
+            const row = this.productBrandList.find(item => item.brandName == defval)
+            this.form.productBrandSn = row.brandSn
+            this.$refs.ruleForm.clearValidate('productBrandSn')
+          }
         } else {
           this.productBrandList = []
           this.fetching = false
         }
       })
     },
-    filterEmpty () {
-      let str = this.form.name
-      str = str.replace(/\ +/g, '')
-      str = str.replace(/[ ]/g, '')
-      str = str.replace(/[\r\n]/g, '')
-      this.form.name = str
+    filterOption (input, option) {
+      console.log(input, option.data.attrs.pinyin)
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
+        option.data.attrs.pinyin && option.data.attrs.pinyin.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
     },
     // 选择单位
     unitChange (a, b) {
@@ -328,7 +334,7 @@ export default {
           const productTypeSn3 = res.data.productTypeSn3 ? res.data.productTypeSn3 : ''
           this.form.productType = [productTypeSn1, productTypeSn2, productTypeSn3]
           if (res.data.productBrandName) {
-            this.fetchUser(res.data.productBrandName)
+            this.searchBrand(res.data.productBrandName)
           }
         } else {
           this.$refs.ruleForm.resetFields()
@@ -392,14 +398,10 @@ export default {
       this.form.productTypeSn3 = val[2] ? val[2] : ''
     },
     //  新增品牌  成功
-    handleOk () {
-      //  获取品牌数据列表,并赋值
-      this.getProductBrand('val')
-    },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
+    handleOk (val) {
+      if (val) { //  需将新增加的品牌回填到产品品牌的地方,即不需要用户再选一下
+        this.searchBrand('', val)
+      }
     },
     //  返回
     handleBack () {
@@ -409,18 +411,6 @@ export default {
         this.$emit('cansel')
       }
     },
-    //  产品品牌  列表
-    getProductBrand (val) {
-      dealerProductBrandQuery({}).then(res => {
-        if (res.status == 200) {
-          this.productBrandList = res.data
-          if (val) { //  需将新增加的品牌回填到产品品牌的地方,即不需要用户再选一下
-            this.form.productBrandSn = this.productBrandList[0].brandSn
-            this.$refs.ruleForm.clearValidate('productBrandSn')
-          }
-        }
-      })
-    },
     //  产品分类  列表
     getProductType () {
       dealerProductTypeList({}).then(res => {
@@ -432,25 +422,25 @@ export default {
       })
     },
     pageInit () {
-      this.getProductType()
       this.$refs.ruleForm.resetFields()
-      // 默认首项获取焦点
-      const _this = this
-      setTimeout(() => {
-        if (_this.$refs['name']) {
-          _this.$refs['name'].focus()
-        }
-      }, 300)
-      if (this.$route.params.id) { //  编辑页
+      this.getProductType()
+      this.searchBrand('')
+
+      //  编辑页
+      if (this.$route.params.id && this.pageType == 'pages') {
         this.getGoodsDetail()
       }
-      // 如果是其它页面新建产品
-      if (this.pageType == 'modal') {
-        this.form = Object.assign(this.form, this.formData)
-        this.$nextTick(() => {
+
+      this.$nextTick(() => {
+        // 默认首项获取焦点
+        this.$refs['name'].focus()
+        // 如果是其它页面新建产品
+        if (this.pageType == 'modal') {
+          console.log(this.paramsData)
+          this.form = Object.assign(this.form, this.paramsData)
           this.$refs.warehouse.setDefaultVal()
-        })
-      }
+        }
+      })
     }
   },
   mounted () {