Browse Source

Merge branch 'develop_yh13' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh13

chenrui 2 years ago
parent
commit
cb56e495e2

+ 7 - 0
src/libs/tools.js

@@ -481,3 +481,10 @@ export const checkIdNumberValid = (tex) => {
   }
   return true
 }
+// 清除空格和特殊字符
+export const removeEmptyStr = function(str){
+  var strs=str.toString()
+  strs= strs.replace(/^\s+|\s+$/gm,'');
+  strs=strs.replace(/[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘',。、]/im,'');
+  return strs;
+}

+ 10 - 5
src/views/allocationManagement/transferOut/list.vue

@@ -23,7 +23,7 @@
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-item label="收货客户名称">
-                  <dealerSubareaScopeList ref="receiverSn" defValKey="buyerSn" @change="custChange" v-model="queryParam.receiverSn" />
+                  <dealerSearchList ref="receiverSn" @change="custChange" />
                 </a-form-item>
               </a-col>
               <a-col :md="4" :sm="24">
@@ -187,7 +187,7 @@ import { STable, VSelect } from '@/components'
 import basicInfoModal from './basicInfoModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
 import auditModal from '@/views/common/auditModal.vue'
-import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import dealerSearchList from '@/views/common/dealerSearchList.vue'
 import { allocateBillList, allocateBillDel, allocateBillAudit, allocateBillExport, allocateBillAblePrint } from '@/api/allocateBill'
 import AllocateType from '@/views/common/allocateType.js'
 import { hdExportExcel } from '@/libs/exportExcel'
@@ -195,7 +195,7 @@ import printModal from './printStatusModal.vue'
 export default {
   name: 'TransferOutList',
   mixins: [commonMixin],
-  components: { STable, VSelect, basicInfoModal, printModal, rangeDate, auditModal, AllocateType, dealerSubareaScopeList },
+  components: { STable, VSelect, basicInfoModal, printModal, rangeDate, auditModal, AllocateType, dealerSearchList },
   data () {
     return {
       spinning: false,
@@ -288,8 +288,13 @@ export default {
       this.$refs.table.refresh(true)
     },
     custChange (val) {
-      this.queryParam.receiverSn = val.key || ''
-      // this.queryParam.receiverName = val.name || ''
+      if(val.row){
+        this.queryParam.receiverSn = val.row.dealerSn
+        this.queryParam.receiverName = undefined
+      }else{
+        this.queryParam.receiverSn = undefined
+        this.queryParam.receiverName = val.key
+      }
     },
     //  创建时间  change
     dateChange (date) {

+ 7 - 6
src/views/common/returnReason.js

@@ -1,3 +1,4 @@
+import { removeEmptyStr } from '@/libs/tools'
 const ReturnReason = {
   template: `
         <a-select
@@ -52,7 +53,7 @@ const ReturnReason = {
   },
   watch: {
     value(newValue, oldValue) {
-      this.defaultVal = newValue
+      this.defaultVal = removeEmptyStr(newValue)
     },
   },
   methods: {
@@ -64,14 +65,14 @@ const ReturnReason = {
     onChange(value) {
       console.log(value,'----')
       this.open = true;
-      const ret = value?value.substr(0,50):''
-      this.defaultVal = ret;
-      this.$emit('change', ret);
-      this.$emit('input', ret);
+      const ret = value?value.substr(0,50):'';
+      this.defaultVal = removeEmptyStr(ret);
+      this.$emit('input', this.defaultVal);
+      this.$emit('change', this.defaultVal);
     },
     onBlur(value){
       this.open = false;
-      this.$emit('blur', value);
+      this.$emit('blur', removeEmptyStr(value));
     }
   },
 };

+ 1 - 1
src/views/salesReturnManagement/salesReturn/queryPart.vue

@@ -64,7 +64,7 @@
       <!-- 退货原因 -->
       <template slot="returnReason" slot-scope="text, record">
         <div @dblclick.stop>
-          <returnReason v-model="record.returnReason"></returnReason>
+          <returnReason v-model.trim="record.returnReason"></returnReason>
         </div>
       </template>
       <span slot="customTitle">

+ 2 - 0
src/views/salesReturnManagement/salesReturn/salesReturnEdit.vue

@@ -149,6 +149,7 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import { printFun, exportExcel } from '@/libs/JGPrint.js'
+import { removeEmptyStr } from '@/libs/tools'
 import ImportGuideModal from './importGuideModal.vue'
 import queryPart from './queryPart.vue'
 import commonModal from '@/views/common/commonModal.vue'
@@ -296,6 +297,7 @@ export default {
     // 修改退货原因
     updateReason (row) {
       console.log(row.returnReason)
+      row.returnReason = removeEmptyStr(row.returnReason)
       // 空或没有改变时不保存数据
       if (!row.returnReason || row.returnReason == row.returnReasonBackups) {
         row.returnReason = row.returnReasonBackups