Ver código fonte

feat(项目管理、竞价单管理、销售订单管理):下单表单提交去除空格和换行

snow 2 anos atrás
pai
commit
364146a497

+ 6 - 0
src/views/sellOut/project/components/buyGoodModal.vue

@@ -375,6 +375,7 @@ import {
 } from '@/utils/validate'
 import inAddrModel from '@/components/in-addr-model'
 import { ShowDataTableColumns } from './ShowDataTableColumns'
+import { replaceTextWrapAndSpace } from '@/utils'
 export default {
   name: 'BuyGoodModal',
   components: { searchStockGoodModal, inAddrModel },
@@ -714,6 +715,11 @@ export default {
         })
         model.planinfo.push(modelA)
       })
+
+      Object.keys(model).forEach(key => {
+        if (typeof model[key] === 'string') { model[key] = replaceTextWrapAndSpace(model[key]) }
+      })
+
       const res = await asyncRequest.project_place_order(model)
       this.loading = false
       if (res && res.code === 0) {

+ 2 - 15
src/views/sellOut/salesOrder/components/addForm.vue

@@ -1377,23 +1377,10 @@ export default {
           model.goodtype = key_0 === "is_activity_1" ? "1" : key_1;
           model.act_code = key_0 === "is_activity_1" ? key_1 : "";
 
-          const keys = Object.keys(model);
-          keys.forEach(key => {
-            if(typeof model[key] === 'string'){
-              model[key] = replaceTextWrapAndSpace(model[key])
-            }
+          Object.keys(model).forEach(key => {
+            if(typeof model[key] === 'string'){ model[key] = replaceTextWrapAndSpace(model[key])}
           });
 
-          if(model.addrlist && model.addrlist.length > 0){
-            model['addrlist'].forEach((_,index) => {
-              model.addrlist[index].addr = replaceTextWrapAndSpace(model.addrlist[index].addr);
-              model.addrlist[index].contactor = replaceTextWrapAndSpace(model.addrlist[index].contactor);
-              model.addrlist[index].mobile = replaceTextWrapAndSpace(model.addrlist[index].mobile);
-            })
-          }
-
-          console.log(model);
-          return
           let res = await asyncRequest.add(model);
           this.loading = false;
           if (res && res.code === 0) {

+ 6 - 0
src/views/sellOut/zixunOrder/components/buyGoodModal.vue

@@ -565,6 +565,7 @@ import {
 } from '@/utils/validate'
 import inAddrModel from '@/components/in-addr-model'
 import { ShowDataTableColumns } from './ShowDataTableColumns'
+import { replaceTextWrapAndSpace } from '@/utils'
 export default {
   name: 'BuyGoodModal',
   components: { SearchStockGoodModal, inAddrModel },
@@ -1021,6 +1022,11 @@ export default {
               return
             }
           }
+
+          Object.keys(model).forEach(key => {
+            if (typeof model[key] === 'string') { model[key] = replaceTextWrapAndSpace(model[key]) }
+          })
+
           const res = await asyncRequest.consultorder(model)
 
           if (res && res.code === 0) {