mahao 1 year ago
parent
commit
9c4409ba08
  1. 10
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/utils/validation.js
  2. 18
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js

10
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.messages, messages);
//Object.assign(Schema.validators, validators); //Object.assign(Schema.validators, validators);
export { getRules }; function required() {
return { required: true };
}
function trim(message) {
return { pattern: "^(?!\\s).*(?<!\\s)$", message: message ?? "无效的空格字符", trigger: "blur" };
}
export { getRules, required, trim };

18
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js

@ -6,8 +6,8 @@ import AppForm from "../../components/form/index.js";
import AppTable from "../../components/table/index.js"; import AppTable from "../../components/table/index.js";
import extraProperties from "../../models/_extraProperties.js"; import extraProperties from "../../models/_extraProperties.js";
import { getUrl } from "../../request/index.js"; import { getUrl } from "../../request/index.js";
import { ElMessage } from "element-plus";
import businessTypes from "../../models/_options.js"; import businessTypes from "../../models/_options.js";
import { required, trim } from "../../utils/validation.js";
export default { export default {
components: { AppForm, AppTable }, components: { AppForm, AppTable },
@ -54,7 +54,7 @@ export default {
</span> </span>
</template> </template>
</el-drawer> </el-drawer>
<el-dialog class="re-open" v-model="setupDialogVisable" :close-on-click-modal="false" align-center destroy-on-close style="width:100%;height:100%" @closed="drawerClosed"> <el-dialog class="re-open" v-model="setupDialogVisable" :close-on-click-modal="false" align-center destroy-on-close style="width:100%;height:100%">
<template #header>发票重开</template> <template #header>发票重开</template>
<el-steps :active="setupRef" align-center style="height:60px;"> <el-steps :active="setupRef" align-center style="height:60px;">
<el-step title="调整明细列表" /> <el-step title="调整明细列表" />
@ -193,7 +193,7 @@ export default {
} }
</style>`, </style>`,
props: ["modelValue", "row", "data", "isBusiness", "businessType"], props: ["modelValue", "row", "data", "isBusiness", "businessType"],
emit: ["update:modelValue", "complete"], emits: ["update:modelValue", "complete"],
setup(props, context) { setup(props, context) {
const show = ref(props.modelValue); const show = ref(props.modelValue);
watch(show, (value) => context.emit("update:modelValue", value)); watch(show, (value) => context.emit("update:modelValue", value));
@ -452,35 +452,35 @@ export default {
invBillNum: { invBillNum: {
type: "string", type: "string",
title: "发票号", title: "发票号",
rules: [{ required: true }], rules: [required(), trim()],
default: props.data.invbillNum, default: props.data.invbillNum,
}, },
settleDate: { settleDate: {
type: "string", type: "string",
title: "下线日期", title: "下线日期",
input: "datetime", input: "datetime",
rules: [{ required: true }], rules: [required()],
}, },
lu: { lu: {
type: "string", type: "string",
title: "零件号", title: "零件号",
rules: [{ required: true }], rules: [required(), trim()],
}, },
pn: { pn: {
type: "string", type: "string",
title: "标识号", title: "标识号",
rules: [{ required: true }], rules: [required(), trim()],
}, },
qty: { qty: {
type: "string", type: "string",
title: "数量", title: "数量",
input: "number", input: "number",
rules: [{ required: true }], rules: [required()],
}, },
groupNum: { groupNum: {
type: "string", type: "string",
title: "结算分组", title: "结算分组",
rules: [{ required: true }], rules: [required(), trim()],
}, },
}, },
}; };

Loading…
Cancel
Save