|
@@ -159,14 +159,6 @@
|
|
|
}
|
|
}
|
|
|
return str
|
|
return str
|
|
|
}
|
|
}
|
|
|
- let isIncludeChinese = function (str) {
|
|
|
|
|
- for (let i = 0; i < str.length; i++) {
|
|
|
|
|
- if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
|
|
|
|
|
- return true
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return false
|
|
|
|
|
- }
|
|
|
|
|
export default {
|
|
export default {
|
|
|
data () {
|
|
data () {
|
|
|
return {
|
|
return {
|
|
@@ -187,9 +179,7 @@
|
|
|
// encapsulation: true,
|
|
// encapsulation: true,
|
|
|
// produceDate: true,
|
|
// produceDate: true,
|
|
|
amount: true,
|
|
amount: true,
|
|
|
- deadline: true,
|
|
|
|
|
- brandChinese: true,
|
|
|
|
|
- codeChinese: true
|
|
|
|
|
|
|
+ deadline: true
|
|
|
},
|
|
},
|
|
|
pickerOptions: {
|
|
pickerOptions: {
|
|
|
disabledDate (time) {
|
|
disabledDate (time) {
|
|
@@ -250,17 +240,9 @@
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
if (!this.validObj.code) {
|
|
if (!this.validObj.code) {
|
|
|
- if (!this.validObj.codeChinese) {
|
|
|
|
|
- this.$message.error('请勿填中文符号')
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$message.error('型号不能为空')
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.$message.error('型号不能为空')
|
|
|
} else if (!this.validObj.brand) {
|
|
} else if (!this.validObj.brand) {
|
|
|
- if (!this.validObj.brandChinese) {
|
|
|
|
|
- this.$message.error('请勿填中文符号')
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$message.error('品牌不能为空')
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.$message.error('品牌不能为空')
|
|
|
} else if (!this.validObj.deadline) {
|
|
} else if (!this.validObj.deadline) {
|
|
|
this.$message.error('截止日期不能为空')
|
|
this.$message.error('截止日期不能为空')
|
|
|
} else if (!this.validObj.amount || !this.validObj.unitPrice) {
|
|
} else if (!this.validObj.amount || !this.validObj.unitPrice) {
|
|
@@ -288,34 +270,16 @@
|
|
|
},
|
|
},
|
|
|
checkCode: function () {
|
|
checkCode: function () {
|
|
|
this.validObj.code = this.applyObj.code && this.applyObj.code !== ''
|
|
this.validObj.code = this.applyObj.code && this.applyObj.code !== ''
|
|
|
- if (isIncludeChinese(this.applyObj.code)) {
|
|
|
|
|
- this.validObj.code = false
|
|
|
|
|
- this.validObj.codeChinese = false
|
|
|
|
|
- } else {
|
|
|
|
|
- this.validObj.codeChinese = true
|
|
|
|
|
- }
|
|
|
|
|
return this.validObj.code
|
|
return this.validObj.code
|
|
|
},
|
|
},
|
|
|
checkBrand: function () {
|
|
checkBrand: function () {
|
|
|
this.validObj.brand = this.applyObj.brand && this.applyObj.brand !== ''
|
|
this.validObj.brand = this.applyObj.brand && this.applyObj.brand !== ''
|
|
|
- if (isIncludeChinese(this.applyObj.brand)) {
|
|
|
|
|
- this.validObj.brand = false
|
|
|
|
|
- this.validObj.brandChinese = false
|
|
|
|
|
- } else {
|
|
|
|
|
- this.validObj.brandChinese = true
|
|
|
|
|
- }
|
|
|
|
|
return this.validObj.brand
|
|
return this.validObj.brand
|
|
|
},
|
|
},
|
|
|
checkUnitPrice: function () {
|
|
checkUnitPrice: function () {
|
|
|
this.validObj.unitPrice = this.applyObj.unitPrice === '' ? true : this.applyObj.unitPrice > 0 && this.applyObj.unitPrice < 100000000
|
|
this.validObj.unitPrice = this.applyObj.unitPrice === '' ? true : this.applyObj.unitPrice > 0 && this.applyObj.unitPrice < 100000000
|
|
|
return this.validObj.unitPrice
|
|
return this.validObj.unitPrice
|
|
|
},
|
|
},
|
|
|
-// checkEncapsulation: function () {
|
|
|
|
|
-// this.validObj.encapsulation = this.applyObj.encapsulation && this.applyObj.encapsulation !== ''
|
|
|
|
|
-// },
|
|
|
|
|
-// checkProduceDate: function () {
|
|
|
|
|
-// this.validObj.produceDate = this.applyObj.produceDate && this.applyObj.produceDate !== ''
|
|
|
|
|
-// },
|
|
|
|
|
checkAmount: function () {
|
|
checkAmount: function () {
|
|
|
this.validObj.amount = this.applyObj.amount === '' ? true : this.applyObj.amount > 0 && this.applyObj.amount < 100000000
|
|
this.validObj.amount = this.applyObj.amount === '' ? true : this.applyObj.amount > 0 && this.applyObj.amount < 100000000
|
|
|
return this.validObj.amount
|
|
return this.validObj.amount
|
|
@@ -350,7 +314,7 @@
|
|
|
},
|
|
},
|
|
|
onEncapsulationChange: function () {
|
|
onEncapsulationChange: function () {
|
|
|
if (this.applyObj.encapsulation && getRealLen(this.applyObj.encapsulation) > 20) {
|
|
if (this.applyObj.encapsulation && getRealLen(this.applyObj.encapsulation) > 20) {
|
|
|
- this.applyObj.encapsulation = this.applyObj.encapsulation.substring(0, this.applyObj.encapsulation.length - 1)
|
|
|
|
|
|
|
+ this.applyObj.encapsulation = cutOutString(this.applyObj.encapsulation, 20)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onCodeChange: function () {
|
|
onCodeChange: function () {
|