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()], }, }, };