From acfd05815f462c52d041315ceda64e2ea05a1ac8 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Mon, 11 Sep 2023 11:34:25 +0800 Subject: [PATCH] update --- .../wwwroot/utils/validation.js | 10 +++++++++- .../wwwroot/views/settle/_check.js | 18 +++++++++--------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/utils/validation.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/utils/validation.js index 4c8aa116..53494b3b 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/utils/validation.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/utils/validation.js @@ -159,4 +159,12 @@ const getRules = (parentSchema, property, data) => { //Object.assign(Schema.messages, messages); //Object.assign(Schema.validators, validators); -export { getRules }; +function required() { + return { required: true }; +} + +function trim(message) { + return { pattern: "^(?!\\s).*(? - + @@ -193,7 +193,7 @@ export default { } `, props: ["modelValue", "row", "data", "isBusiness", "businessType"], - emit: ["update:modelValue", "complete"], + emits: ["update:modelValue", "complete"], setup(props, context) { const show = ref(props.modelValue); watch(show, (value) => context.emit("update:modelValue", value)); @@ -452,35 +452,35 @@ export default { invBillNum: { type: "string", title: "发票号", - rules: [{ required: true }], + rules: [required(), trim()], default: props.data.invbillNum, }, settleDate: { type: "string", title: "下线日期", input: "datetime", - rules: [{ required: true }], + rules: [required()], }, lu: { type: "string", title: "零件号", - rules: [{ required: true }], + rules: [required(), trim()], }, pn: { type: "string", title: "标识号", - rules: [{ required: true }], + rules: [required(), trim()], }, qty: { type: "string", title: "数量", input: "number", - rules: [{ required: true }], + rules: [required()], }, groupNum: { type: "string", title: "结算分组", - rules: [{ required: true }], + rules: [required(), trim()], }, }, };