|
@@ -134,6 +134,23 @@ export default {
|
|
|
return verification;
|
|
|
}
|
|
|
return verification;
|
|
|
+ },
|
|
|
+ /* 校验导入的购买方列表编码(开头必须为KH) **/
|
|
|
+ validatePoCode(value, row) {
|
|
|
+ const verification = createFieldVerification();
|
|
|
+ const len = value.length
|
|
|
+ if (value === '') {
|
|
|
+ verification.isValid = false;
|
|
|
+ verification.message = `第 ${row} 行,平台订单编号不能为空`;
|
|
|
+ } else if (len < 0 || len > 255) {
|
|
|
+ verification.isValid = false;
|
|
|
+ verification.message = `第 ${row} 行,平台订单编号仅支持大写字母数字组合,多个编号使用逗号分隔(0~255位)!`;
|
|
|
+ } else if (/^(?=.*[A-Z])(?=.*\d)[A-Z\d]+(?:,[A-Z\d]+)*$/.test(value) == false) {
|
|
|
+ verification.isValid = false;
|
|
|
+ verification.message = `第 ${row} 行,平台订单编号仅支持大写字母数字组合,多个编号使用逗号分隔(0~255位)!`;
|
|
|
+ }
|
|
|
+
|
|
|
+ return verification;
|
|
|
},
|
|
|
formatDate2(serialNumber, format = "-", mao = ":") {
|
|
|
var timestamp = (serialNumber - 25569 - 8 / 24) * 86400 * 1000; // 转换为时间戳
|
|
@@ -330,6 +347,18 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if(field === PROPERTYS.PO_CODE){
|
|
|
+ verification = this.validatePoCode(tableItem[field], index);
|
|
|
+ if (!verification.isValid) {
|
|
|
+ MessageBox({
|
|
|
+ type: "warning",
|
|
|
+ title: "数据填写错误",
|
|
|
+ message: verification.message
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (field === PROPERTYS.COMPANY_NO) {
|
|
|
verification = this.validateCompanyNo(tableItem[field], index);
|
|
|
if (!verification.isValid) {
|