调整基础数据、车船务、项目、合同

This commit is contained in:
2026-09-03 22:40:11 +08:00
parent 024e77801e
commit c63c7c3e33
43 changed files with 821 additions and 239 deletions
+28
View File
@@ -55,6 +55,19 @@
{{ row.createUserName || row.createUser || '' }}
</template>
<template #remark-form>
<el-input
v-model="form.remark"
class="remark-input"
type="textarea"
:rows="2"
:disabled="dialogType === 'view'"
maxlength="200"
show-word-limit
placeholder="请输入"
/>
</template>
<template #parentId-form>
<el-select
v-model="form.parentId"
@@ -644,3 +657,18 @@ export default {
}
}
</style>
<style lang="scss">
/* 货物类型新增/编辑弹窗:footer 不上移,避免覆盖备注文本域底部内容 */
.cargo-type-dialog.avue-dialog.avue-crud__dialog .avue-dialog__footer {
margin-top: 0 !important;
}
.cargo-type-dialog.avue-dialog.avue-crud__dialog .el-dialog__body {
padding-bottom: 16px !important;
}
.cargo-type-dialog .remark-input {
width: 100%;
}
</style>
+50
View File
@@ -50,6 +50,19 @@
/>
</el-select>
</template>
<template #taxRate="{ row }">{{ formatTaxRate(row.taxRate) }}</template>
<template #taxRate-form>
<el-input
v-model="form.taxRate"
inputmode="decimal"
maxlength="6"
clearable
placeholder="请输入税率"
@input="handleTaxRateInput"
>
<template #append>%</template>
</el-input>
</template>
<template #englishName-form>
<el-input
v-model="form.englishName"
@@ -156,6 +169,30 @@ export default {
maxlength: 100,
rules: [{ required: true, message: '请输入费用项代码', trigger: 'blur' }],
},
{
label: '税率',
prop: 'taxRate',
type: 'input',
formslot: true,
slot: true,
minWidth: 100,
span: 12,
rules: [
{ required: true, message: '请输入税率', trigger: 'blur' },
{
validator: (rule, value, callback) => {
const text = String(value ?? '').trim();
const rate = Number(text);
if (!/^\d+(\.\d{1,2})?$/.test(text) || rate < 0 || rate > 100) {
callback(new Error('税率必须是0到100之间且最多保留2位小数的数字'));
return;
}
callback();
},
trigger: 'blur',
},
],
},
{
label: '费用项',
prop: 'name',
@@ -326,6 +363,9 @@ export default {
);
return option ? `${option.dictValue}/${option.dictKey}` : feeCategory;
},
formatTaxRate(value) {
return value === undefined || value === null || value === '' ? '' : `${value}%`;
},
getFeeItemCodeSuffix(code, feeCategory) {
const value = String(code || '').trim();
const prefix = this.getFeeCategoryPrefix(feeCategory);
@@ -347,6 +387,7 @@ export default {
const code = this.getFeeItemCodeSuffix(values.englishName, values.feeCategory);
values.feeCategory = String(values.feeCategory || '').trim();
values.name = String(values.name || '').trim();
values.taxRate = Number(values.taxRate);
values.englishName = prefix ? `${prefix}${code}` : code;
values.remark = String(values.remark || '').trim() || undefined;
if (!values.status) values.status = 1;
@@ -455,6 +496,15 @@ export default {
this.form.englishName = '';
done();
},
handleTaxRateInput(value) {
let normalized = String(value || '').replace(/[^\d.]/g, '');
normalized = normalized.replace(/(\..*)\./g, '$1');
if (normalized.startsWith('.')) normalized = `0${normalized}`;
const [integerPart, decimalPart] = normalized.split('.');
normalized =
decimalPart === undefined ? integerPart : `${integerPart}.${decimalPart.slice(0, 2)}`;
this.form.taxRate = normalized;
},
searchReset() {
this.query = {};
this.onLoad(this.page);