diff --git a/src/api/system/user.js b/src/api/system/user.js index 87bd534..1334f0c 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -61,6 +61,13 @@ export const getUser = id => { }); }; +export const getCustomerOptions = () => { + return request({ + url: '/blade-system/user/customer-options', + method: 'get', + }); +}; + export const getUserPlatform = id => { return request({ url: '/blade-system/user/platform-detail', diff --git a/src/api/transportCapacity/transport-vehicle.js b/src/api/transportCapacity/transport-vehicle.js index 8c8b741..23cf472 100644 --- a/src/api/transportCapacity/transport-vehicle.js +++ b/src/api/transportCapacity/transport-vehicle.js @@ -51,6 +51,14 @@ export const changeStatus = (id, status) => { }); }; +export const auditCertification = (id, certificationStatus, rejectReason) => { + return request({ + url: '/blade-transport/transport-vehicle/audit-certification', + method: 'post', + params: { id, certificationStatus, rejectReason }, + }); +}; + export const getExpiryStat = params => { return request({ url: '/blade-transport/transport-vehicle/expiry-stat', diff --git a/src/api/vehicle/equipment-ledger.js b/src/api/vehicle/equipment-ledger.js new file mode 100644 index 0000000..b8d66aa --- /dev/null +++ b/src/api/vehicle/equipment-ledger.js @@ -0,0 +1,23 @@ +import request from '@/axios'; + +export const getList = (current, size, params) => + request({ + url: '/blade-transport/equipment-ledger/list', + method: 'get', + params: { ...params, current, size }, + }); + +export const getDetail = id => + request({ url: '/blade-transport/equipment-ledger/detail', method: 'get', params: { id } }); + +export const getNextEquipmentCode = () => + request({ url: '/blade-transport/equipment-ledger/next-equipment-code', method: 'get' }); + +export const add = row => + request({ url: '/blade-transport/equipment-ledger/submit', method: 'post', data: row }); + +export const update = row => + request({ url: '/blade-transport/equipment-ledger/submit', method: 'post', data: row }); + +export const remove = ids => + request({ url: '/blade-transport/equipment-ledger/remove', method: 'post', params: { ids } }); diff --git a/src/option/system/user.js b/src/option/system/user.js index 153c82b..cef9c75 100644 --- a/src/option/system/user.js +++ b/src/option/system/user.js @@ -1,4 +1,3 @@ -import website from '@/config/website'; import { getDeptLazyTree } from '@/api/system/dept'; export const userOption = safe => { @@ -25,42 +24,41 @@ export const userOption = safe => { searchShow: true, searchMenuSpan: 24, searchIcon: true, - searchIndex: 8, + searchIndex: 4, searchMenuPosition: 'right', border: true, index: true, selection: true, addBtn: false, viewBtn: true, - dialogType: 'drawer', - dialogWidth: 1000, + dialogType: 'dialog', + dialogWidth: '90%', + labelPosition: 'right', + labelWidth: 120, dialogClickModal: false, column: [ { - label: '登录账号', + label: '账号名', prop: 'account', search: true, + searchOrder: 2, display: false, }, { - label: '所属租户', - prop: 'tenantName', - slot: true, - display: false, - }, - { - label: '用户姓名', + label: '姓名', prop: 'realName', search: true, + searchOrder: 4, display: false, }, { - label: '所属角色', - prop: 'roleName', - slot: true, - overHidden: true, + label: '手机号', + prop: 'phone', + search: true, + searchOrder: 3, display: false, }, + { label: '工号', prop: 'code', display: false }, { label: '所属部门', prop: 'deptName', @@ -68,33 +66,22 @@ export const userOption = safe => { overHidden: true, display: false, }, + { label: '岗位', prop: 'postName', overHidden: true, display: false }, + { label: '性别', prop: 'sexName', width: 80, display: false }, + { label: 'OA人员id', prop: 'oaPersonId', minWidth: 120, overHidden: true, display: false }, + { label: '备注', prop: 'remark', minWidth: 160, overHidden: true, display: false }, { - label: '用户平台', - prop: 'userTypeName', - width: 100, - slot: true, - display: false, - }, - { - label: '用户平台', + label: '状态', + prop: 'status', type: 'select', - dicUrl: '/blade-system/dict/dictionary?code=user_type', - props: { - label: 'dictValue', - value: 'dictKey', - }, + dicData: [ + { label: '启用', value: 1 }, + { label: '禁用', value: 0 }, + ], dataType: 'number', search: true, - hide: true, + searchOrder: 1, display: false, - prop: 'userType', - rules: [ - { - required: true, - message: '请选择用户平台', - trigger: 'blur', - }, - ], }, ], group: [ @@ -104,53 +91,13 @@ export const userOption = safe => { icon: 'el-icon-user-solid', column: [ { - label: '所属租户', - prop: 'tenantId', - type: 'tree', - dicUrl: '/blade-system/tenant/select', - props: { - label: 'tenantName', - value: 'tenantId', - }, - hide: !website.tenantMode, - addDisplay: website.tenantMode, - editDisplay: website.tenantMode, - viewDisplay: website.tenantMode, - rules: [ - { - required: true, - message: '请输入所属租户', - trigger: 'click', - }, - ], - span: 24, - }, - { - label: '登录账号', + label: '账号名', prop: 'account', + span: 6, rules: [ { required: true, - message: '请输入登录账号', - trigger: 'blur', - }, - ], - }, - { - label: '用户平台', - type: 'select', - dicUrl: '/blade-system/dict/dictionary?code=user_type', - props: { - label: 'dictValue', - value: 'dictKey', - }, - dataType: 'number', - slot: true, - prop: 'userType', - rules: [ - { - required: true, - message: '请选择用户平台', + message: '请输入账号名', trigger: 'blur', }, ], @@ -161,6 +108,7 @@ export const userOption = safe => { hide: true, editDisplay: false, viewDisplay: false, + addDisplay: false, rules: [{ required: true, validator: validatePass, trigger: 'blur' }], }, { @@ -169,6 +117,7 @@ export const userOption = safe => { hide: true, editDisplay: false, viewDisplay: false, + addDisplay: false, rules: [{ required: true, validator: validatePass2, trigger: 'blur' }], }, ], @@ -191,12 +140,13 @@ export const userOption = safe => { ], }, { - label: '用户姓名', + label: '姓名', prop: 'realName', + span: 6, rules: [ { required: true, - message: '请输入用户姓名', + message: '请输入姓名', trigger: 'blur', }, { @@ -209,12 +159,14 @@ export const userOption = safe => { { label: '手机号码', prop: 'phone', + span: 6, + rules: [{ required: true, message: '请输入手机号码', trigger: 'blur' }], overHidden: true, }, { label: '电子邮箱', prop: 'email', - hide: true, + span: 6, overHidden: true, }, { @@ -235,7 +187,7 @@ export const userOption = safe => { value: 3, }, ], - hide: true, + span: 6, }, { label: '用户生日', @@ -261,6 +213,8 @@ export const userOption = safe => { { label: '用户编号', prop: 'code', + label: '工号', + span: 6, }, { label: '所属角色', @@ -273,13 +227,7 @@ export const userOption = safe => { }, checkStrictly: true, slot: true, - rules: [ - { - required: true, - message: '请选择所属角色', - trigger: 'click', - }, - ], + display: false, }, { label: '所属部门', @@ -292,6 +240,7 @@ export const userOption = safe => { }, checkStrictly: true, slot: true, + span: 6, rules: [ { required: true, @@ -304,7 +253,7 @@ export const userOption = safe => { label: '所属岗位', prop: 'postId', type: 'tree', - multiple: true, + multiple: false, dicData: [], props: { label: 'postName', @@ -317,6 +266,7 @@ export const userOption = safe => { trigger: 'click', }, ], + span: 6, }, { label: '直属主管', @@ -330,6 +280,7 @@ export const userOption = safe => { value: 'id', }, clearable: true, + display: false, }, { label: '是否主管', @@ -346,6 +297,49 @@ export const userOption = safe => { }, ], value: 0, + display: false, + }, + { + label: '人员类别', + prop: 'personCategory', + type: 'select', + span: 6, + value: 1, + dicData: [ + { label: '内部员工', value: 1 }, + { label: '承运商', value: 2 }, + ], + }, + { + label: '数据权限范围', + prop: 'dataScopeRange', + type: 'radio', + span: 24, + value: 1, + dicData: [ + { label: '仅所属组织', value: 1 }, + { label: '全部组织', value: 2 }, + { label: '自定义', value: 3 }, + ], + }, + { + label: '数据层级范围', + prop: 'dataLevelRange', + type: 'radio', + span: 24, + value: 1, + dicData: [ + { label: '包含下级', value: 1 }, + { label: '仅本级', value: 2 }, + ], + }, + { + label: '备注', + prop: 'remark', + type: 'textarea', + span: 24, + maxlength: 200, + showWordLimit: true, }, ], }, diff --git a/src/option/transportCapacity/driver.js b/src/option/transportCapacity/driver.js index b503553..951568b 100644 --- a/src/option/transportCapacity/driver.js +++ b/src/option/transportCapacity/driver.js @@ -20,58 +20,63 @@ export const option = { dialogClickModal: false, column: [ { - label: '姓名', + label: '姓名身份证号', prop: 'driverName', search: true, searchOrder: 7, slot: true, - minWidth: 120, + minWidth: 220, }, { - label: '手机号', + label: '手机号码', prop: 'mobile', search: true, searchOrder: 6, minWidth: 130, }, { - label: '准驾车型', - prop: 'drivingType', + label: '性别', + prop: 'gender', + width: 80, + align: 'center', + }, + { + label: '司机类型', + prop: 'driverType', search: true, - searchOrder: 5, - hide: true, + searchOrder: 3, type: 'select', dicData: [ { - label: 'A1', - value: 'A1', + label: '自有员工', + value: '自有', }, { - label: 'A2', - value: 'A2', + label: '外协', + value: '外协', }, { - label: 'A3', - value: 'A3', - }, - { - label: 'B1', - value: 'B1', - }, - { - label: 'B2', - value: 'B2', - }, - { - label: 'C1', - value: 'C1', - }, - { - label: 'C2', - value: 'C2', + label: '承运管理员', + value: '承运管理员', }, ], minWidth: 110, + align: 'center', + }, + { + label: '岗位', + prop: 'posts', + minWidth: 150, + }, + { + label: '所属组织', + prop: 'organizationName', + search: true, + searchOrder: 1, + type: 'select', + filterable: true, + dicData: [], + minWidth: 160, }, { label: '状态', @@ -94,65 +99,52 @@ export const option = { align: 'center', }, { - label: '司机类型', - prop: 'driverType', - search: true, - searchOrder: 3, - type: 'select', - dicData: [ - { - label: '自有员工', - value: '自有', - }, - { - label: '外协', - value: '外协', - }, - ], - minWidth: 110, - align: 'center', - }, - { - label: '身份证号', - prop: 'idCardNo', - search: true, - searchOrder: 2, - minWidth: 190, - }, - { - label: '所属组织', - prop: 'organizationName', - search: true, - searchOrder: 1, - type: 'select', - filterable: true, - dicData: [], - minWidth: 160, - }, - { - label: '性别', - prop: 'gender', - width: 80, - align: 'center', - }, - { - label: '岗位', - prop: 'posts', - minWidth: 150, - }, - { - label: '驾驶认证', + label: '驾驶认证(日期)', prop: 'drivingLicenseEndDate', slot: true, minWidth: 140, align: 'center', }, { - label: '从业资格认证', + label: '从业资格认证(日期)', prop: 'qualificationEndDate', slot: true, - minWidth: 150, - align: 'center', + minWidth: 160, + }, + { + label: '身份证号', + prop: 'idCardNo', + search: true, + searchOrder: 2, + hide: true, + }, + { + label: '准驾车型', + prop: 'drivingType', + search: true, + searchOrder: 5, + hide: true, + type: 'select', + dicData: [ + { label: 'A1', value: 'A1' }, + { label: 'A2', value: 'A2' }, + { label: 'A3', value: 'A3' }, + { label: 'B1', value: 'B1' }, + { label: 'B2', value: 'B2' }, + { label: 'C1', value: 'C1' }, + { label: 'C2', value: 'C2' }, + ], + }, + { + label: '', + prop: 'expireStatus', + search: true, + searchOrder: 0, + searchSpan: 6, + hide: true, + addDisplay: false, + editDisplay: false, + viewDisplay: false, }, ], }; diff --git a/src/option/transportCapacity/transport-ship.js b/src/option/transportCapacity/transport-ship.js index 5cca6b3..d7b9834 100644 --- a/src/option/transportCapacity/transport-ship.js +++ b/src/option/transportCapacity/transport-ship.js @@ -14,7 +14,7 @@ export const option = { editBtn: false, delBtn: false, viewBtn: false, - menuWidth: 180, + menuWidth: 320, dialogClickModal: false, column: [ { @@ -32,6 +32,16 @@ export const option = { searchOrder: 4, minWidth: 140, }, + { + label: '所属组织', + prop: 'organizationName', + search: true, + searchOrder: 1, + type: 'select', + filterable: true, + dicData: [], + minWidth: 160, + }, { label: '船检登记号', prop: 'shipInspectionNo', @@ -54,28 +64,6 @@ export const option = { minWidth: 110, align: 'center', }, - { - label: '所属组织', - prop: 'organizationName', - search: true, - searchOrder: 1, - type: 'select', - filterable: true, - dicData: [], - minWidth: 160, - }, - { - label: '状态', - prop: 'status', - type: 'select', - slot: true, - dicData: [ - { label: '启用', value: 1 }, - { label: '停用', value: 2 }, - ], - minWidth: 90, - align: 'center', - }, { label: '国籍证有效期至', prop: 'nationalityCertEndDate', @@ -104,5 +92,16 @@ export const option = { minWidth: 140, align: 'center', }, + { + label: '', + prop: 'expireStatus', + search: true, + searchOrder: 0, + searchSpan: 6, + hide: true, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, ], }; diff --git a/src/option/transportCapacity/transport-vehicle.js b/src/option/transportCapacity/transport-vehicle.js index c6bb753..dc3249f 100644 --- a/src/option/transportCapacity/transport-vehicle.js +++ b/src/option/transportCapacity/transport-vehicle.js @@ -9,22 +9,38 @@ export const option = { searchMenuPosition: 'right', border: true, index: true, - selection: true, + selection: false, addBtn: false, editBtn: false, delBtn: false, viewBtn: false, - menuWidth: 180, + menuWidth: 320, dialogClickModal: false, column: [ { label: '车牌号', prop: 'plateNo', search: true, - searchOrder: 5, + searchOrder: 6, slot: true, minWidth: 120, }, + { + label: '业务关系', + prop: 'businessRelation', + search: true, + searchOrder: 5, + searchValue: '', + type: 'select', + dicData: [ + { label: '全部', value: '' }, + { label: '自有', value: '自有' }, + { label: '管理挂靠', value: '管理挂靠' }, + { label: '业务合作', value: '业务合作' }, + ], + minWidth: 120, + align: 'center', + }, { label: '所属组织', prop: 'organizationName', @@ -35,26 +51,11 @@ export const option = { dicData: [], minWidth: 150, }, - { - label: '业务关系', - prop: 'businessRelation', - search: true, - searchOrder: 4, - type: 'select', - dicData: [ - { label: '全部', value: '' }, - { label: '自有', value: '自有' }, - { label: '管理挂靠', value: '管理挂靠' }, - { label: '业务合作', value: '业务合作' }, - ], - minWidth: 120, - align: 'center', - }, { label: '车辆类型', prop: 'vehicleType', search: true, - searchOrder: 3, + searchOrder: 4, type: 'select', dicData: [ { label: '全部', value: '' }, @@ -74,11 +75,41 @@ export const option = { minWidth: 140, align: 'right', }, + { + label: '绑定司机', + prop: 'boundDriver', + slot: true, + minWidth: 120, + align: 'center', + }, + { + label: '车辆类型', + prop: 'vehicleType', + minWidth: 110, + align: 'center', + }, + { + label: '认证状态', + prop: 'certificationStatus', + slot: true, + search: true, + searchOrder: 2, + searchValue: '', + type: 'select', + dicData: [ + { label: '全部', value: '' }, + { label: '认证中', value: 0 }, + { label: '已认证', value: 1 }, + { label: '已驳回', value: 2 }, + ], + minWidth: 110, + align: 'center', + }, { label: '车辆状态', prop: 'status', search: true, - searchOrder: 2, + searchOrder: 3, type: 'select', slot: true, dicData: [ @@ -89,25 +120,41 @@ export const option = { align: 'center', }, { - label: '行驶证有效期', + label: '道路运输证号', + prop: 'roadTransportCertNo', + minWidth: 160, + }, + { + label: '行驶证认证', prop: 'drivingLicenseEndDate', slot: true, minWidth: 140, align: 'center', }, { - label: '道路运输证有效期', + label: '道路运输证认证', prop: 'roadTransportCertEndDate', slot: true, minWidth: 160, align: 'center', }, { - label: '年审有效期', + label: '道路运输证年审', prop: 'annualReviewEndDate', slot: true, minWidth: 130, align: 'center', }, + { + label: '', + prop: 'expireStatus', + search: true, + searchOrder: 0, + searchSpan: 6, + hide: true, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, ], }; diff --git a/src/option/vehicle/accident-record.js b/src/option/vehicle/accident-record.js index 7be011f..d4ddb7e 100644 --- a/src/option/vehicle/accident-record.js +++ b/src/option/vehicle/accident-record.js @@ -49,6 +49,7 @@ export const option = { searchMenuPosition: 'right', border: true, index: true, + indexLabel: '序号', viewBtn: true, selection: true, dialogClickModal: false, @@ -124,9 +125,8 @@ export const option = { { label: '直接经济损失', prop: 'directEconomicLoss', - type: 'number', - precision: 2, - append: '元', + type: 'input', + formslot: true, minWidth: 140, span: 12, placeholder: '请输入', @@ -135,9 +135,8 @@ export const option = { { label: '保险理赔金额', prop: 'insuranceClaimAmount', - type: 'number', - precision: 2, - append: '元', + type: 'input', + formslot: true, minWidth: 140, span: 12, placeholder: '请输入', diff --git a/src/option/vehicle/annual-inspection-record.js b/src/option/vehicle/annual-inspection-record.js index 7a5f29c..35e638b 100644 --- a/src/option/vehicle/annual-inspection-record.js +++ b/src/option/vehicle/annual-inspection-record.js @@ -48,6 +48,7 @@ export const option = { searchMenuPosition: 'right', border: true, index: true, + indexLabel: '序号', viewBtn: true, selection: true, dialogClickModal: false, @@ -140,9 +141,8 @@ export const option = { { label: '费用', prop: 'fee', - type: 'number', - precision: 2, - append: '元', + type: 'input', + formslot: true, minWidth: 100, span: 12, placeholder: '请输入', @@ -155,6 +155,7 @@ export const option = { label: '评定(复核)单位', prop: 'assessmentUnit', minWidth: 160, + overHidden: true, span: 12, placeholder: '请输入', rules: [{ max: 50, message: '最多 50 个字符', trigger: 'blur' }], diff --git a/src/option/vehicle/equipment-ledger.js b/src/option/vehicle/equipment-ledger.js new file mode 100644 index 0000000..0951367 --- /dev/null +++ b/src/option/vehicle/equipment-ledger.js @@ -0,0 +1,226 @@ +import { formatUpdateUserName } from '@/utils/audit'; + +export const vehicleTypeDic = [ + { label: '车辆', value: '车辆' }, + { label: '船舶', value: '船舶' }, +]; + +export const onlineStatusDic = [ + { label: '否', value: 0 }, + { label: '是', value: 1 }, +]; + +export const option = { + height: 'auto', + calcHeight: 32, + dialogWidth: 960, + labelPosition: 'right', + labelWidth: 'auto', + searchLabelWidth: 160, + tip: false, + searchBtnText: '查询', + emptyBtnText: '重置', + saveBtnText: '提交', + updateBtnText: '提交', + searchShow: true, + searchMenuSpan: 24, + searchIcon: true, + searchIndex: 4, + searchMenuPosition: 'right', + border: true, + index: true, + indexLabel: '序号', + viewBtn: true, + selection: true, + dialogClickModal: false, + menuWidth: 160, + menuFixed: 'right', + column: [ + { + label: '车船类型', + prop: 'vehicleType', + type: 'radio', + dicData: vehicleTypeDic, + value: '车辆', + search: true, + searchOrder: 3, + span: 24, + order: 1, + minWidth: 110, + rules: [{ required: true, message: '请选择车船类型', trigger: 'change' }], + }, + { + label: '车牌号/船号', + prop: 'vehicleNo', + slot: true, + formslot: true, + search: true, + searchOrder: 4, + span: 12, + order: 2, + minWidth: 140, + rules: [{ required: true, message: '请输入车牌号/船号', trigger: 'blur' }], + }, + { + label: '设备号', + prop: 'equipmentCode', + formslot: true, + search: true, + searchOrder: 2, + span: 12, + order: 3, + minWidth: 150, + rules: [{ required: true, message: '设备编号由系统生成', trigger: 'blur' }], + }, + { + label: '设备名称', + prop: 'equipmentName', + span: 12, + order: 4, + minWidth: 150, + rules: [ + { required: true, message: '请输入设备名称', trigger: 'blur' }, + { max: 100, message: '最多 100 个字符', trigger: 'blur' }, + ], + }, + { + label: '出厂日期', + prop: 'factoryDate', + type: 'date', + format: 'YYYY-MM-DD', + valueFormat: 'YYYY-MM-DD', + span: 12, + order: 8, + minWidth: 130, + }, + { + label: '设备品牌', + prop: 'equipmentBrand', + span: 12, + order: 5, + minWidth: 130, + rules: [{ max: 50, message: '最多 50 个字符', trigger: 'blur' }], + }, + { + label: '设备类型', + prop: 'equipmentType', + type: 'select', + dicData: [], + span: 12, + order: 6, + minWidth: 130, + rules: [{ max: 50, message: '最多 50 个字符', trigger: 'change' }], + }, + { + label: '规格型号', + prop: 'specificationModel', + span: 12, + order: 7, + minWidth: 150, + rules: [{ max: 100, message: '最多 100 个字符', trigger: 'blur' }], + }, + { + label: '备注', + prop: 'remark', + type: 'textarea', + minRows: 3, + span: 24, + order: 10, + minWidth: 180, + overHidden: true, + rules: [{ max: 200, message: '最多 200 个字符', trigger: 'blur' }], + }, + { + label: '更新时间', + prop: 'updateTime', + type: 'datetime', + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + addDisplay: false, + editDisplay: false, + viewDisplay: false, + minWidth: 170, + }, + { + label: '创建时间', + prop: 'createTime', + type: 'datetime', + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + addDisplay: false, + editDisplay: false, + viewDisplay: false, + minWidth: 170, + }, + { + label: '是否在线', + prop: 'onlineStatus', + type: 'select', + dicData: onlineStatusDic, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + minWidth: 100, + }, + { + label: '原厂设备号', + prop: 'originalEquipmentNo', + span: 12, + order: 9, + hide: true, + rules: [{ max: 100, message: '最多 100 个字符', trigger: 'blur' }], + }, + { + label: '附件', + prop: 'attachments', + slot: true, + formslot: true, + span: 24, + order: 11, + hide: true, + }, + { + label: '组织', + prop: 'createDept', + type: 'tree', + dicData: [], + props: { label: 'title', value: 'id' }, + checkStrictly: true, + search: true, + searchOrder: 1, + hide: true, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, + { + label: '更新人', + prop: 'updateUserName', + formatter: formatUpdateUserName, + display: false, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, + ], +}; + +export const excelOption = { + labelPosition: 'right', + submitBtn: false, + emptyBtn: false, + column: [ + { + label: '模板上传', + prop: 'excelFile', + type: 'upload', + drag: true, + loadText: '模板上传中,请稍等', + span: 24, + propsHttp: { res: 'data' }, + tip: '请上传 .xls,.xlsx 标准格式文件', + action: '/blade-transport/equipment-ledger/import-equipment-ledger', + }, + { label: '模板下载', prop: 'excelTemplate', formslot: true, span: 24 }, + ], +}; diff --git a/src/option/vehicle/etc-record.js b/src/option/vehicle/etc-record.js index 6282217..6ef9827 100644 --- a/src/option/vehicle/etc-record.js +++ b/src/option/vehicle/etc-record.js @@ -38,6 +38,7 @@ export const option = { searchMenuPosition: 'right', border: true, index: true, + indexLabel: '序号', viewBtn: true, selection: true, dialogClickModal: false, @@ -103,9 +104,8 @@ export const option = { { label: '交易金额', prop: 'transactionAmount', - type: 'number', - precision: 2, - append: '元', + type: 'input', + formslot: true, minWidth: 130, span: 12, placeholder: '请输入', diff --git a/src/option/vehicle/insurance-record.js b/src/option/vehicle/insurance-record.js index 163cedd..492fa7d 100644 --- a/src/option/vehicle/insurance-record.js +++ b/src/option/vehicle/insurance-record.js @@ -46,6 +46,7 @@ export const option = { searchMenuPosition: 'right', border: true, index: true, + indexLabel: '序号', viewBtn: true, selection: true, dialogClickModal: false, @@ -128,8 +129,8 @@ export const option = { { label: '保额', prop: 'insuredAmount', - type: 'number', - precision: 2, + type: 'input', + formslot: true, append: '元', minWidth: 120, rules: [{ validator: validateNonNegative, trigger: 'blur' }], @@ -137,8 +138,8 @@ export const option = { { label: '保费', prop: 'premium', - type: 'number', - precision: 2, + type: 'input', + formslot: true, append: '元', minWidth: 120, rules: [ @@ -181,19 +182,6 @@ export const option = { display: false, minWidth: 170, }, - { - label: '创建时间', - prop: 'createTimeRange', - type: 'date', - format: 'YYYY-MM-DD', - valueFormat: 'YYYY-MM-DD', - searchRange: true, - search: true, - hide: true, - addDisplay: false, - editDisplay: false, - viewDisplay: false, - }, { label: '组织', prop: 'createDept', @@ -210,6 +198,19 @@ export const option = { editDisplay: false, viewDisplay: false, }, + { + label: '创建时间', + prop: 'createTimeRange', + type: 'date', + format: 'YYYY-MM-DD', + valueFormat: 'YYYY-MM-DD', + searchRange: true, + search: true, + hide: true, + addDisplay: false, + editDisplay: false, + viewDisplay: false, + }, { label: '更新人', prop: 'updateUserName', diff --git a/src/option/vehicle/mileage-record.js b/src/option/vehicle/mileage-record.js index 74c5ff3..bd162d8 100644 --- a/src/option/vehicle/mileage-record.js +++ b/src/option/vehicle/mileage-record.js @@ -34,6 +34,7 @@ export const option = { searchMenuPosition: 'right', border: true, index: true, + indexLabel: '序号', viewBtn: true, selection: true, dialogClickModal: false, @@ -67,9 +68,8 @@ export const option = { { label: '上月统计里程数', prop: 'previousMonthMileage', - type: 'number', - precision: 2, - append: '公里', + type: 'input', + formslot: true, minWidth: 210, slot: true, rules: [{ validator: validateNonNegative, trigger: 'blur' }], @@ -77,9 +77,8 @@ export const option = { { label: '本月统计里程数', prop: 'currentMonthMileage', - type: 'number', - precision: 2, - append: '公里', + type: 'input', + formslot: true, minWidth: 210, slot: true, rules: [{ validator: validateNonNegative, trigger: 'blur' }], @@ -87,9 +86,8 @@ export const option = { { label: '本月行驶里程数', prop: 'monthlyMileage', - type: 'number', - precision: 2, - append: '公里', + type: 'input', + formslot: true, minWidth: 170, slot: true, rules: [{ validator: validateNonNegative, trigger: 'blur' }], @@ -97,9 +95,8 @@ export const option = { { label: '累计行驶里程数', prop: 'totalMileage', - type: 'number', - precision: 2, - append: '公里', + type: 'input', + formslot: true, minWidth: 170, slot: true, rules: [{ validator: validateNonNegative, trigger: 'blur' }], diff --git a/src/option/vehicle/oil-electric-record.js b/src/option/vehicle/oil-electric-record.js index 1a8e8f7..a8c710e 100644 --- a/src/option/vehicle/oil-electric-record.js +++ b/src/option/vehicle/oil-electric-record.js @@ -35,6 +35,7 @@ export const option = { searchMenuPosition: 'right', border: true, index: true, + indexLabel: '序号', viewBtn: true, selection: true, dialogClickModal: false, @@ -111,25 +112,24 @@ export const option = { { label: '数量', prop: 'quantity', - type: 'number', - precision: 2, + type: 'input', + formslot: true, minWidth: 110, rules: [{ validator: validateNonNegative, trigger: 'blur' }], }, { label: '单价', prop: 'unitPrice', - type: 'number', - precision: 2, + type: 'input', + formslot: true, minWidth: 120, - append: '元/升', rules: [{ validator: validateNonNegative, trigger: 'blur' }], }, { label: '交易金额', prop: 'transactionAmount', - type: 'number', - precision: 2, + type: 'input', + formslot: true, minWidth: 130, rules: [ { required: true, message: '请输入交易金额', trigger: 'blur' }, @@ -139,8 +139,8 @@ export const option = { { label: '余额', prop: 'balance', - type: 'number', - precision: 2, + type: 'input', + formslot: true, minWidth: 110, rules: [{ validator: validateNonNegative, trigger: 'blur' }], }, diff --git a/src/option/vehicle/other-expense-record.js b/src/option/vehicle/other-expense-record.js index 69d189b..b3bb1cf 100644 --- a/src/option/vehicle/other-expense-record.js +++ b/src/option/vehicle/other-expense-record.js @@ -46,6 +46,7 @@ export const option = { searchMenuPosition: 'right', border: true, index: true, + indexLabel: '序号', viewBtn: true, selection: true, dialogClickModal: false, @@ -102,9 +103,8 @@ export const option = { { label: '金额', prop: 'amount', - type: 'number', - precision: 2, - append: '元', + type: 'input', + formslot: true, minWidth: 120, span: 12, placeholder: '请输入', diff --git a/src/option/vehicle/tire-replacement-record.js b/src/option/vehicle/tire-replacement-record.js index 311394a..c434617 100644 --- a/src/option/vehicle/tire-replacement-record.js +++ b/src/option/vehicle/tire-replacement-record.js @@ -39,6 +39,7 @@ export const option = { searchMenuPosition: 'right', border: true, index: true, + indexLabel: '序号', viewBtn: true, selection: true, dialogClickModal: false, @@ -88,8 +89,8 @@ export const option = { { label: '换胎数量', prop: 'tireQuantity', - type: 'number', - precision: 0, + type: 'input', + formslot: true, minWidth: 110, span: 12, placeholder: '请输入', @@ -98,9 +99,8 @@ export const option = { { label: '换胎费用', prop: 'replacementCost', - type: 'number', - precision: 2, - append: '元', + type: 'input', + formslot: true, minWidth: 120, span: 12, placeholder: '请输入', diff --git a/src/option/vehicle/transport-change-record.js b/src/option/vehicle/transport-change-record.js index adf3a15..1480147 100644 --- a/src/option/vehicle/transport-change-record.js +++ b/src/option/vehicle/transport-change-record.js @@ -26,6 +26,7 @@ export const option = { searchMenuPosition: 'right', border: true, index: true, + indexLabel: '序号', viewBtn: true, selection: true, dialogClickModal: false, diff --git a/src/option/vehicle/violation-record.js b/src/option/vehicle/violation-record.js index 6d79223..81008d4 100644 --- a/src/option/vehicle/violation-record.js +++ b/src/option/vehicle/violation-record.js @@ -25,14 +25,6 @@ export const vehicleTypeDic = [ { label: '船舶', value: '船舶' }, ]; -export const violationTypeDic = [ - { label: '闯红灯', value: '闯红灯' }, - { label: '超速', value: '超速' }, - { label: '违停', value: '违停' }, - { label: '压线', value: '压线' }, - { label: '其他', value: '其他' }, -]; - export const processStatusDic = [ { label: '未处理', value: '未处理' }, { label: '已处理', value: '已处理' }, @@ -57,6 +49,7 @@ export const option = { searchMenuPosition: 'right', border: true, index: true, + indexLabel: '序号', viewBtn: true, selection: true, dialogClickModal: false, @@ -104,11 +97,11 @@ export const option = { label: '类型', prop: 'violationType', type: 'select', - dicData: violationTypeDic, + dicData: [], minWidth: 120, span: 12, placeholder: '请选择', - rules: [{ required: true, message: '请选择类型', trigger: 'change' }], + rules: [], }, { label: '事项', @@ -118,10 +111,7 @@ export const option = { display: false, span: 12, placeholder: '请输入', - rules: [ - { required: true, message: '请输入事项', trigger: 'blur' }, - { max: 100, message: '最多 100 个字符', trigger: 'blur' }, - ], + rules: [{ max: 100, message: '最多 100 个字符', trigger: 'blur' }], }, { label: '日期', @@ -149,8 +139,8 @@ export const option = { { label: '罚款', prop: 'fineAmount', - type: 'number', - precision: 2, + type: 'input', + formslot: true, append: '元', minWidth: 100, span: 12, @@ -160,8 +150,8 @@ export const option = { { label: '被扣分数', prop: 'deductPoints', - type: 'number', - precision: 0, + type: 'input', + formslot: true, minWidth: 110, span: 12, placeholder: '请输入', diff --git a/src/views/system/dept.vue b/src/views/system/dept.vue index 5bddb89..86a82d3 100644 --- a/src/views/system/dept.vue +++ b/src/views/system/dept.vue @@ -40,23 +40,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 搜索 + 清空 + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
- + diff --git a/src/views/system/user.vue b/src/views/system/user.vue index bb09a37..b393fd5 100644 --- a/src/views/system/user.vue +++ b/src/views/system/user.vue @@ -37,7 +37,7 @@ v-if="permission.user_add && !auditMode" type="primary" icon="el-icon-plus" - @click="$refs.crud.rowAdd()" + @click="openUserDialog('add')" >新 增 编辑 @@ -147,12 +147,6 @@ 角色配置 - - 平台配置 - 认证日志 @@ -172,20 +166,62 @@ - - + + + + + + + + + + + + + + 仅所属组织全部组织自定义 + 包含下级仅本级 + + + + + + + + + + + + + + + + +
包含新增的客商
+ +
+
+ +
+ - - + + @@ -246,17 +287,6 @@ - - - - - - - + @@ -296,10 +326,8 @@ import { getList, getUser, - getUserPlatform, remove, update, - updatePlatform, add, grant, resetPassword, @@ -308,6 +336,7 @@ import { auditRefuse, setLeader, getLeaderList, + getCustomerOptions, } from '@/api/system/user'; import { exportBlob } from '@/api/common'; import { getDeptTree } from '@/api/system/dept'; @@ -315,14 +344,13 @@ import { getRoleTree } from '@/api/system/role'; import { getPostList } from '@/api/system/post'; import { mapGetters } from 'vuex'; import { h } from 'vue'; -import website from '@/config/website'; import { getToken } from '@/utils/auth'; import { downloadXls } from '@/utils/util'; import NProgress from 'nprogress'; import 'nprogress/nprogress.css'; import func from '@/utils/func'; import { sensitive } from '@/utils/sensitive'; -import { excelOption, platformFormOption, treeOption, userOption } from '@/option/system/user'; +import { excelOption, treeOption, userOption } from '@/option/system/user'; import AuthLog from './authlog.vue'; import AuthLock from './authlock.vue'; @@ -331,13 +359,15 @@ export default { data() { return { form: {}, + userDialog: false, + userDialogMode: 'add', search: {}, sensitiveManager: null, roleBox: false, roleLinked: false, + roleFormMode: false, grantUserId: '', excelBox: false, - platformBox: false, passwordBox: false, initFlag: true, auditMode: false, @@ -357,11 +387,12 @@ export default { roleTreeObj: [], treeDeptId: '', treeData: [], + permissionDeptTree: [], + postList: [], + customerList: [], treeOption: treeOption, userOption: userOption(this), - platformFormOption: platformFormOption, data: [], - platformForm: {}, passwordForm: {}, passwordRules: { password: [ @@ -373,16 +404,17 @@ export default { { validator: this.validatePassword2, trigger: 'blur' }, ], }, + userRules: { + account: [{ required: true, message: '请输入账号名', trigger: 'blur' }], + realName: [{ required: true, message: '请输入姓名', trigger: 'blur' }], + phone: [{ required: true, message: '请输入手机号', trigger: 'blur' }], + deptId: [{ required: true, message: '请选择所属组织', trigger: 'change' }], + }, excelForm: {}, excelOption: excelOption, }; }, watch: { - 'form.tenantId'() { - if (this.form.tenantId !== '' && this.initFlag) { - this.initData(this.form.tenantId); - } - }, 'excelForm.isCovered'() { if (this.excelForm.isCovered !== '') { const column = this.findColumn(this.excelOption.column, 'excelFile'); @@ -407,14 +439,20 @@ export default { }); return ids.join(','); }, + formRoleList() { + const selected = new Set(func.split(this.form.roleId || '').map(String)); + const roles = []; + const walk = nodes => + (nodes || []).forEach(node => { + if (selected.has(String(node.id))) roles.push(node); + walk(node.children); + }); + walk(this.roleGrantList); + return roles; + }, }, mounted() { - // 非租户模式默认加载管理组数据 - if (!website.tenantMode) { - this.initData(website.tenantId); - } else { - this.initData(); - } + this.initData(this.userInfo.tenantId || this.website.tenantId); }, created() { // 创建脱敏工具实例 @@ -437,8 +475,6 @@ export default { this.$refs.authLog.openUserAuthLog(row.id, row.name); } else if (command === 'lockUser') { this.$refs.authLock.openLockUser(row.id, row.account); - } else if (command === 'platformConfig') { - this.handlePlatformForRow(row); } else if (command === 'resetPassword') { this.handleResetForRow(row); } else if (command === 'setPassword') { @@ -488,14 +524,17 @@ export default { }, initData(tenantId) { getRoleTree(tenantId).then(res => { + this.roleGrantList = res.data.data; const column = this.findColumn(this.userOption.group, 'roleId'); column.dicData = res.data.data; }); getDeptTree(tenantId).then(res => { + this.permissionDeptTree = res.data.data; const column = this.findColumn(this.userOption.group, 'deptId'); column.dicData = res.data.data; }); getPostList(tenantId).then(res => { + this.postList = res.data.data; const column = this.findColumn(this.userOption.group, 'postId'); column.dicData = res.data.data; }); @@ -503,9 +542,18 @@ export default { const column = this.findColumn(this.userOption.group, 'leaderId'); column.dicData = res.data.data; }); + getCustomerOptions().then(res => { + this.customerList = res.data.data || []; + }); }, submitRole() { const roleList = this.$refs.treeRole.getCheckedKeys().join(','); + if (this.roleFormMode) { + this.form.roleId = roleList; + this.roleBox = false; + this.roleFormMode = false; + return; + } grant(this.grantUserId, roleList).then(() => { this.roleBox = false; this.$message({ @@ -515,6 +563,98 @@ export default { this.onLoad(this.page); }); }, + handleAddRole() { + this.roleFormMode = true; + this.roleTreeObj = func.split(this.form.roleId || ''); + this.roleLinked = false; + getRoleTree(this.userInfo.tenantId).then(res => { + this.roleGrantList = res.data.data; + this.roleBox = true; + this.$nextTick(() => this.applyCheckedKeys('treeRole', this.roleTreeObj)); + }); + }, + removeFormRole(roleId) { + this.form.roleId = func + .split(this.form.roleId || '') + .filter(id => String(id) !== String(roleId)); + }, + handleDataScopeCheck(_, checked) { + this.form.dataScopeDeptIds = checked.checkedKeys; + }, + handleCustomerSelection(rows) { + this.form.customerIds = rows.map(row => row.id); + }, + openUserDialog(mode, row = {}) { + this.userDialogMode = mode; + if (mode === 'add') { + this.form = { + account: '', + realName: '', + phone: '', + email: '', + sex: 3, + postId: '', + deptId: [], + code: '', + personCategory: 1, + dataScopeRange: 1, + dataLevelRange: 1, + remark: '', + roleId: '', + dataScopeDeptIds: [], + customerIds: [], + includeNewCustomer: 0, + }; + this.userDialog = true; + this.$nextTick(() => this.$refs.userFormRef && this.$refs.userFormRef.clearValidate()); + return; + } + getUser(row.id).then(res => { + const user = res.data.data; + this.form = { + ...user, + deptId: func.split(user.deptId || ''), + postId: func.split(user.postId || '')[0] || '', + roleId: func.join(user.roleId || ''), + dataScopeDeptIds: user.dataScopeDeptIds || [], + customerIds: user.customerIds || [], + includeNewCustomer: user.includeNewCustomer || 0, + personCategory: user.personCategory || 1, + dataScopeRange: user.dataScopeRange || 1, + dataLevelRange: user.dataLevelRange || 1, + }; + this.sensitiveManager.saveInitialData(this.form); + this.userDialog = true; + this.$nextTick(() => { + this.$refs.userFormRef && this.$refs.userFormRef.clearValidate(); + (this.form.customerIds || []).forEach(id => { + const customer = this.customerList.find(item => String(item.id) === String(id)); + if (customer) this.$refs.customerTable && this.$refs.customerTable.toggleRowSelection(customer, true); + }); + }); + }); + }, + submitUserForm() { + this.$refs.userFormRef.validate(valid => { + if (!valid) return; + const row = { + ...this.form, + deptId: func.join(this.form.deptId), + postId: func.join(this.form.postId), + roleId: func.join(this.form.roleId), + leaderId: func.join(this.form.leaderId), + }; + const request = this.userDialogMode === 'add' ? add(row) : update(this.sensitiveManager.getSubmitData(row)); + request.then(() => { + this.userDialog = false; + this.onLoad(this.page); + this.$message.success('操作成功!'); + }); + }); + }, + resetDialogPassword() { + this.handleResetForRow(this.form); + }, rowSave(row, done, loading) { row.deptId = func.join(row.deptId); row.roleId = func.join(row.roleId); @@ -779,23 +919,6 @@ export default { if (!tree) return; tree.setCheckedKeys(keys); }, - // ========== 平台配置(行级别) ========== - handlePlatformForRow(row) { - getUserPlatform(row.id).then(res => { - this.platformForm = { ...res.data.data, account: row.account }; - this.platformBox = true; - }); - }, - submitPlatformConfig() { - updatePlatform( - this.platformForm.id, - this.platformForm.userType, - this.platformForm.userExt - ).then(() => { - this.platformBox = false; - this.$message({ type: 'success', message: '操作成功!' }); - }); - }, handlePasswordForRow(row) { this.passwordForm = { userId: row.id, @@ -902,12 +1025,11 @@ export default { }, onLoad(page, params = {}) { this.loading = true; - getList( - page.currentPage, - page.pageSize, - Object.assign(params, this.query, { status: this.auditMode ? 0 : 1 }), - this.treeDeptId - ).then(res => { + const queryParams = { ...this.query, ...params }; + if (this.auditMode) { + queryParams.status = 0; + } + getList(page.currentPage, page.pageSize, queryParams, this.treeDeptId).then(res => { const data = res.data.data; this.page.total = data.total; this.data = data.records; @@ -931,4 +1053,62 @@ export default { .box .el-scrollbar__wrap { overflow: scroll; } + +.user-permission-tabs { + width: 100%; + margin-top: 8px; +} + +.user-edit-dialog .dialog-title { + display: inline-flex; + align-items: center; + font-size: 16px; + font-weight: 600; +} + +.user-edit-dialog .dialog-title::before { + width: 4px; + height: 18px; + margin-right: 8px; + background: #409eff; + content: ''; +} + +.user-edit-dialog .el-form-item { + margin-bottom: 16px; +} + +.user-edit-dialog .el-form-item__label { + white-space: nowrap; +} + +.user-edit-dialog .el-radio-group { + white-space: nowrap; +} + +.full-width { + width: 100%; +} + +.user-permission-tabs .el-tabs__header { + margin-bottom: 12px; +} + +.permission-toolbar { + display: flex; + justify-content: flex-end; + margin-bottom: 12px; +} + +.customer-toolbar { + justify-content: flex-start; +} + +.avue-dialog .el-form-item__label { + white-space: nowrap; +} + +.avue-dialog .el-radio-group { + white-space: nowrap; +} diff --git a/src/views/transportCapacity/components/ship-ledger.vue b/src/views/transportCapacity/components/ship-ledger.vue new file mode 100644 index 0000000..e25ae95 --- /dev/null +++ b/src/views/transportCapacity/components/ship-ledger.vue @@ -0,0 +1,90 @@ + + + + + diff --git a/src/views/transportCapacity/components/vehicle-ledger.vue b/src/views/transportCapacity/components/vehicle-ledger.vue new file mode 100644 index 0000000..1374a0e --- /dev/null +++ b/src/views/transportCapacity/components/vehicle-ledger.vue @@ -0,0 +1,141 @@ + + + + + diff --git a/src/views/transportCapacity/driver.vue b/src/views/transportCapacity/driver.vue index 640a927..a3c17f6 100644 --- a/src/views/transportCapacity/driver.vue +++ b/src/views/transportCapacity/driver.vue @@ -41,23 +41,23 @@ >批量删除
- + @@ -209,6 +220,13 @@ export default { isEmpty(value) { return value === undefined || value === null || value === ''; }, + normalizeDecimalInput(prop, value) { + const sanitized = String(value ?? '').replace(/[^\d.]/g, ''); + const [integerPart, ...decimalParts] = sanitized.split('.'); + this.form[prop] = decimalParts.length + ? `${integerPart || '0'}.${decimalParts.join('').slice(0, 2)}` + : integerPart; + }, normalizeRow(row) { const values = { ...row }; values.dataSource = values.dataSource || '手工录入'; @@ -379,11 +397,9 @@ export default { type: 'warning', }).then(() => { NProgress.start(); - exportBlob( - '/blade-transport/etc-record/export-etc-record', - this.buildExportParams(), - { feedback: true } - ) + exportBlob('/blade-transport/etc-record/export-etc-record', this.buildExportParams(), { + feedback: true, + }) .then(res => { downloadXls(res.data, `ETC记录${this.$dayjs().format('YYYY-MM-DD HH:mm:ss')}.xlsx`); }) diff --git a/src/views/vehicle/insurance-record.vue b/src/views/vehicle/insurance-record.vue index d7e8ae2..6c80e84 100644 --- a/src/views/vehicle/insurance-record.vue +++ b/src/views/vehicle/insurance-record.vue @@ -69,6 +69,28 @@ class="insurance-record-page__vehicle-input" /> + + + + + @@ -169,6 +202,7 @@ export default { searchMenuPosition: 'right', border: true, index: true, + indexLabel: '序号', viewBtn: true, selection: true, dialogClickModal: false, @@ -223,12 +257,10 @@ export default { { label: '里程/航程数', prop: 'mileage', - type: 'number', - precision: 2, + type: 'input', minWidth: 130, slot: true, span: 12, - append: '公里', placeholder: '请输入', rules: [{ validator: validateNonNegative, trigger: 'blur' }], }, @@ -255,9 +287,8 @@ export default { { label: '费用', prop: 'cost', - type: 'number', - precision: 2, - append: '元', + type: 'input', + slot: true, span: 12, placeholder: '请输入', rules: [ @@ -302,12 +333,10 @@ export default { { label: '下次保养里程/航程', prop: 'nextMaintenanceMileage', - type: 'number', - precision: 2, + type: 'input', minWidth: 170, slot: true, span: 12, - append: '公里', placeholder: '请输入', rules: [{ validator: validateNonNegative, trigger: 'blur' }], }, @@ -531,6 +560,13 @@ export default { if (!value || typeof value === 'string') return value; return JSON.stringify(value); }, + normalizeDecimalInput(prop, value) { + const sanitized = String(value ?? '').replace(/[^\d.]/g, ''); + const [integerPart, ...decimalParts] = sanitized.split('.'); + this.form[prop] = decimalParts.length + ? `${integerPart || '0'}.${decimalParts.join('').slice(0, 2)}` + : integerPart; + }, initDeptTree() { getDeptTree(this.userInfo.tenantId).then(res => { const column = this.findColumn(this.option.column, 'createDept'); diff --git a/src/views/vehicle/maintenance-record.vue b/src/views/vehicle/maintenance-record.vue index de1eb63..7828e9c 100644 --- a/src/views/vehicle/maintenance-record.vue +++ b/src/views/vehicle/maintenance-record.vue @@ -70,6 +70,28 @@ class="maintenance-record-page__input" /> + + @@ -167,6 +189,7 @@ export default { searchMenuPosition: 'right', border: true, index: true, + indexLabel: '序号', viewBtn: true, selection: true, dialogClickModal: false, @@ -239,9 +262,8 @@ export default { { label: '费用', prop: 'cost', - type: 'number', - precision: 2, - append: '元', + type: 'input', + slot: true, span: 12, placeholder: '请输入', rules: [ @@ -287,10 +309,8 @@ export default { { label: '里程/航程数', prop: 'mileage', - type: 'number', - precision: 2, + type: 'input', minWidth: 130, - append: '公里', slot: true, span: 12, placeholder: '请输入', @@ -526,6 +546,13 @@ export default { if (!value || typeof value === 'string') return value; return JSON.stringify(value); }, + normalizeDecimalInput(prop, value) { + const sanitized = String(value ?? '').replace(/[^\d.]/g, ''); + const [integerPart, ...decimalParts] = sanitized.split('.'); + this.form[prop] = decimalParts.length + ? `${integerPart || '0'}.${decimalParts.join('').slice(0, 2)}` + : integerPart; + }, initDeptTree() { getDeptTree(this.userInfo.tenantId).then(res => { const column = this.findColumn(this.option.column, 'createDept'); diff --git a/src/views/vehicle/mileage-record.vue b/src/views/vehicle/mileage-record.vue index 7c5b875..ec42494 100644 --- a/src/views/vehicle/mileage-record.vue +++ b/src/views/vehicle/mileage-record.vue @@ -82,6 +82,50 @@ class="mileage-record-page__input" /> + + + + + + + + @@ -190,9 +232,7 @@ export default { }, updateFeeType(feeType) { const oilProductColumn = this.findColumn(this.option.column, 'oilProduct'); - const unitPriceColumn = this.findColumn(this.option.column, 'unitPrice'); oilProductColumn.display = feeType !== '充电'; - unitPriceColumn.append = feeType === '充电' ? '元/度' : '元/升'; if (feeType === '充电') { this.form.oilProduct = undefined; } @@ -249,6 +289,13 @@ export default { isEmpty(value) { return value === undefined || value === null || value === ''; }, + normalizeDecimalInput(prop, value) { + const sanitized = String(value ?? '').replace(/[^\d.]/g, ''); + const [integerPart, ...decimalParts] = sanitized.split('.'); + this.form[prop] = decimalParts.length + ? `${integerPart || '0'}.${decimalParts.join('').slice(0, 2)}` + : integerPart; + }, normalizeRow(row) { const values = { ...row }; values.vehicleType = values.vehicleType || '车辆'; diff --git a/src/views/vehicle/other-expense-record.vue b/src/views/vehicle/other-expense-record.vue index 848d71a..cd5812e 100644 --- a/src/views/vehicle/other-expense-record.vue +++ b/src/views/vehicle/other-expense-record.vue @@ -70,6 +70,17 @@ class="other-expense-record-page__input" /> + @@ -234,6 +245,13 @@ export default { isEmpty(value) { return value === undefined || value === null || value === ''; }, + normalizeDecimalInput(prop, value) { + const sanitized = String(value ?? '').replace(/[^\d.]/g, ''); + const [integerPart, ...decimalParts] = sanitized.split('.'); + this.form[prop] = decimalParts.length + ? `${integerPart || '0'}.${decimalParts.join('').slice(0, 2)}` + : integerPart; + }, normalizeRow(row) { const values = { ...row }; values.vehicleType = values.vehicleType || '车辆'; diff --git a/src/views/vehicle/tire-replacement-record.vue b/src/views/vehicle/tire-replacement-record.vue index 6f2d6c4..e282262 100644 --- a/src/views/vehicle/tire-replacement-record.vue +++ b/src/views/vehicle/tire-replacement-record.vue @@ -70,6 +70,26 @@ class="tire-replacement-record-page__input" /> + + @@ -225,6 +245,16 @@ export default { if (!value || typeof value === 'string') return value; return JSON.stringify(value); }, + normalizeDecimalInput(prop, value) { + const sanitized = String(value ?? '').replace(/[^\d.]/g, ''); + const [integerPart, ...decimalParts] = sanitized.split('.'); + this.form[prop] = decimalParts.length + ? `${integerPart || '0'}.${decimalParts.join('').slice(0, 2)}` + : integerPart; + }, + normalizeIntegerInput(prop, value) { + this.form[prop] = String(value ?? '').replace(/\D/g, ''); + }, normalizeRow(row) { const values = { ...row }; if (values.vehicleNo) { diff --git a/src/views/vehicle/violation-record.vue b/src/views/vehicle/violation-record.vue index 74c483f..b6df5ca 100644 --- a/src/views/vehicle/violation-record.vue +++ b/src/views/vehicle/violation-record.vue @@ -90,6 +90,26 @@ placeholder="请输入船长" /> + +