xiaodai2022 2 years ago
parent
commit
b55f27ea89

File diff suppressed because it is too large
+ 0 - 0
dist/static/js/0.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.js


+ 3 - 1
src/utils/validate.js

@@ -396,7 +396,9 @@ export function accMul(arg1, arg2) {
 }
 
 export function isSpecialSymbol(s) {
-  const str = (s ?? "").replace(/\"/g, "");
+  console.log(s);
+  const str = (s ?? "").replace(/\\|\/|\*|\"|\'|\<|\>|\{|\}|\[|\]|\:|\.|\^|\$|\!|\~|\`|\|/g, "");
+  console.log(str);
   const pattern = new RegExp("[`~!@#$^&*()=|{}':;',.<>/?]");
   let specialStr = "";
   for (let i = 0; i < str.length; i++) {

+ 1 - 1
src/views/goodStore/goodsCost/columns.js

@@ -246,7 +246,7 @@ const rules = {
   good_name: [
     {
       required: true,
-      message: "请输入商品名称",
+      validator: validate_desc,
       trigger: "blur",
     },
   ],

+ 33 - 20
src/views/purchaseIn/workbench/columns.js

@@ -3,56 +3,56 @@ import { isSpecialSymbol } from "@/utils/validate";
 const options1 = [
   { id: "0", name: "否" },
   { id: "1", name: "是" },
-]
+];
 //专属类型
 const options2 = [
   { id: "0", name: "非泰康" },
   { id: "1", name: "泰康" },
-]
+];
 //销售权限
 const options3 = [
   { id: "0", name: "无销售权限" },
   { id: "1", name: "有销售权限" },
-]
+];
 
 //是否库存品
 const options4 = [
   { id: "0", name: "非库存品" },
   { id: "1", name: "库存品" },
-]
+];
 //是否启用实时金价
 const options5 = [
   { id: "0", name: "否" },
   { id: "1", name: "是" },
-]
+];
 //供货区域
 const options6 = [
   { id: "1", name: "全国" },
   { id: "2", name: "全国除偏远" },
-]
+];
 //是否启用阶梯
 const options7 = [
   { id: "0", name: "否" },
   { id: "1", name: "是" },
-]
+];
 //有无工差
 const options8 = [
   { id: "0", name: "无工差" },
   { id: "1", name: "有工差" },
-]
+];
 //配置要求
-const options9 = ["证书", "包装盒", "绒布袋", "标签", "其他"]
+const options9 = ["证书", "包装盒", "绒布袋", "标签", "其他"];
 //付款方式
 const options10 = [
   { id: "0", name: "现结" },
   { id: "1", name: "月清" },
   { id: "2", name: "双月清" },
-]
+];
 //发货方式
 const options11 = [
   { id: "0", name: "公司自提" },
   { id: "1", name: "供应商包邮" },
-]
+];
 const listCol = [
   {
     prop: "cgdNo",
@@ -109,7 +109,7 @@ const listCol = [
     width: "52px",
     _slot_: "operation",
   },
-]
+];
 
 const validate_num = (rule, value, callback) => {
   if (value === "") {
@@ -121,7 +121,8 @@ const validate_num = (rule, value, callback) => {
 const validate_num_0 = (rule, value, callback) => {
   if (value === "") {
     callback(new Error("不能为空!"));
-  } else if (value === "0" ||
+  } else if (
+    value === "0" ||
     value === "0." ||
     value === "0.0" ||
     value === "0.00" ||
@@ -134,6 +135,7 @@ const validate_num_0 = (rule, value, callback) => {
 };
 const validate_desc = (rule, value, callback) => {
   const { required } = rule;
+  console.log(required, value);
   if (required && value === "") {
     callback(new Error("不能为空!"));
   } else if (value.length > 0 && isSpecialSymbol(value)) {
@@ -178,7 +180,7 @@ const rules = {
   pname: [
     {
       required: true,
-      message: "请输入商品名称",
+      validator: validate_desc,
       trigger: "blur",
     },
   ],
@@ -356,7 +358,7 @@ const rules = {
   config: [
     {
       required: true,
-      type: 'array',
+      type: "array",
       message: "请选择配置要求",
       trigger: "change",
     },
@@ -404,8 +406,19 @@ const rules = {
       trigger: "change",
     },
   ],
-
-
-
-}
-export { options1, options2, options3, options4, options5, options6, options7, options8, options9, options10, options11, listCol, rules }
+};
+export {
+  options1,
+  options2,
+  options3,
+  options4,
+  options5,
+  options6,
+  options7,
+  options8,
+  options9,
+  options10,
+  options11,
+  listCol,
+  rules,
+};

+ 3 - 2
src/views/purchaseIn/workbench/components/baseForm.vue

@@ -720,7 +720,7 @@ export default {
       options10: options10,
       options11: options11,
       ruleForm: {},
-      rules: JSON.parse(JSON.stringify(rules)),
+      rules,
       //乘法处理
       r1: "",
       r2: "",
@@ -802,7 +802,7 @@ export default {
         this.title = "采返商品详情";
       }
       this.resetFormData();
-      this.rulesThis = this.rules;
+
       await this.resetForm();
 
       if (this.type === "edit" || this.type === "view") {
@@ -812,6 +812,7 @@ export default {
       this.golpricelast();
       //调用成本合算计算函数
       // this.computedCost()
+      this.rulesThis = this.rules;
       this.setrules();
       this.loading = false;
     },

+ 1 - 1
src/views/sellOut/zixunOrder/columns.js

@@ -119,7 +119,7 @@ const rules = {
       trigger: "change",
     },
   ],
-  good_name: [{ required: true, message: "商品名称不能为空", trigger: "blur" }],
+  good_name: [{ required: true, validator: validate_desc, trigger: "blur" }],
 
   model: [
     {

Some files were not shown because too many files changed in this diff