chenrui hace 9 meses
padre
commit
41977860b4
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. 7 0
      src/views/productManagement/productInfo/edit.vue

+ 7 - 0
src/views/productManagement/productInfo/edit.vue

@@ -354,6 +354,10 @@ export default {
         }
       })
     },
+    // 去除产品编码、产品名称、原厂编码  文字中间2个以上连续空格转化为一个空格
+    mergeSpaces (text) {
+      return text.replace(/\s+/g, ' ')
+    },
     //  保存
     handleSubmit (e) {
       e.preventDefault()
@@ -375,6 +379,9 @@ export default {
           form.carOwnersPrice = !form.carOwnersPrice ? '' : form.carOwnersPrice
           form.specialPrice = !form.specialPrice ? '' : form.specialPrice
           form.terminalPrice = !form.terminalPrice ? '' : form.terminalPrice
+          form.name = _this.mergeSpaces(form.name)
+          form.code = _this.mergeSpaces(form.code)
+          form.origCode = _this.mergeSpaces(form.origCode)
           dealerProductSave(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)