| | |
| | | import {hasPermission} from "@/utils/permissionUtils"; |
| | | import {getTmsCustomerInfo, listTmsCustomerInfo} from "@/api/tms/tmsCustomerInfo"; |
| | | import {getTmsServiceProvider, listTmsServiceProvider} from "@/api/tms/tmsServiceProvider"; |
| | | import {getTmsSettlementEntity, listTmsSettlementEntity} from "@/api/tms/tmsSettlementEntity"; |
| | | |
| | | const {proxy} = useCurrentInstance(); |
| | | const crudRef = ref(); |
| | |
| | | } |
| | | ], |
| | | }, |
| | | carrierType:{ |
| | | carrierType: { |
| | | label: '车辆服务商类型', |
| | | display: true, |
| | | type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/carrier_type', |
| | | type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/carrier_type', value: '0', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "车辆服务商类型不能为空", trigger: "blur" |
| | | } |
| | | ], |
| | | change: ({value}: any) => { |
| | | option.value.group.forEach((item: any) => { |
| | | if (item.prop == 'jbxx') { |
| | | item.column.serviceProviderId.display = value == 1 |
| | | item.column.settlementId.display = value != 1 |
| | | } |
| | | }) |
| | | console.log(value) |
| | | } |
| | | }, |
| | | settlementId: { |
| | | label: '所属运营主体', |
| | | minWidth: 150, |
| | | display: true, |
| | | hide: false, |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "所属运营主体不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | type: 'table', suffixIcon: 'search',dataType: 'string', |
| | | children: { |
| | | border: true, |
| | | searchLabelWidth: 100, |
| | | searchMenuSpan: 5, |
| | | column: { |
| | | customerCode: { |
| | | label: '运营主体编号', minWidth: 130, |
| | | search: true, |
| | | }, |
| | | customerShortName: { |
| | | label: '运营主体简称', minWidth: 120, |
| | | search: true, |
| | | }, |
| | | customerFullName: { |
| | | label: '运营主体全称', minWidth: 120, |
| | | search: true, |
| | | }, |
| | | contactName: { |
| | | label: '联系人姓名', |
| | | display: false, |
| | | hide: false, minWidth: 150, |
| | | search: true, |
| | | }, |
| | | operatingStatus: { |
| | | label: '经营状态', |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/business_status', |
| | | display: false, |
| | | hide: false, minWidth: 150, |
| | | search: true, |
| | | }, |
| | | }, |
| | | |
| | | }, |
| | | props: { |
| | | label: 'customerFullName', |
| | | value: 'id' |
| | | }, |
| | | onLoad: ({page, value, data}: { page: any, value: any, data: any }, callback: any) => { |
| | | if (value) { |
| | | let id = value; |
| | | if (Array.isArray(value)) { |
| | | id = value[0] |
| | | } |
| | | getTmsSettlementEntity(id).then(res => { |
| | | return callback(res.data || {}) |
| | | }) |
| | | } else { |
| | | listTmsSettlementEntity({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => { |
| | | return callback({ |
| | | total: res.total, |
| | | data: res.rows || [], |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | change: (val: any) => { |
| | | const table = crudRef.value?.getPropRef?.('settlementId')?.$refs?.temp; |
| | | if (!table) return; |
| | | let active = table.active; |
| | | if (Array.isArray(active)) active = active[0]; |
| | | if (active) { |
| | | Object.assign(form.value, { |
| | | settlementId: active.id, |
| | | settlementName: active.customerFullName, |
| | | }); |
| | | } |
| | | }, |
| | | }, |
| | | serviceProviderId: { |
| | | label: '车辆服务商', |
| | | addDisplay: true, minWidth: 150, |
| | | editDisplay: true, |
| | | viewDisplay: true, |
| | | minWidth: 150, |
| | | display: true, |
| | | hide: false, |
| | | search: true, |
| | | rules: [ |
| | |
| | | message: "车辆服务商不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | type: 'table', suffixIcon: 'search', |
| | | type: 'table', suffixIcon: 'search',dataType: 'string', |
| | | children: { |
| | | border: true, |
| | | searchLabelWidth: 100, |
| | |
| | | }, |
| | | }, |
| | | |
| | | }, |
| | | props: { |
| | | label: 'serviceShortName', |
| | | value: 'id' |
| | | }, |
| | | onLoad: ({page, value, data}: { page: any, value: any, data: any }, callback: any) => { |
| | | if (value) { |
| | | let id = value; |
| | | if (Array.isArray(value)) { |
| | | id = value[0] |
| | | } |
| | | getTmsServiceProvider(id).then(res => { |
| | | return callback(res.data || {}) |
| | | }) |
| | | } else { |
| | | listTmsServiceProvider({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => { |
| | | return callback({ |
| | | total: res.total, |
| | | data: res.rows || [], |
| | | }, |
| | | props: { |
| | | label: 'serviceShortName', |
| | | value: 'id' |
| | | }, |
| | | onLoad: ({page, value, data}: { page: any, value: any, data: any }, callback: any) => { |
| | | if (value) { |
| | | let id = value; |
| | | if (Array.isArray(value)) { |
| | | id = value[0] |
| | | } |
| | | getTmsServiceProvider(id).then(res => { |
| | | return callback(res.data || {}) |
| | | }) |
| | | }) |
| | | } else { |
| | | listTmsServiceProvider({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => { |
| | | return callback({ |
| | | total: res.total, |
| | | data: res.rows || [], |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | change: (val: any) => { |
| | | const table = crudRef.value?.getPropRef?.('serviceProviderId')?.$refs?.temp; |
| | | if (!table) return; |
| | | let active = table.active; |
| | | if (Array.isArray(active)) active = active[0]; |
| | | if (active) { |
| | | Object.assign(form.value, { |
| | | serviceProviderId: active.id, |
| | | serviceProviderName: active.serviceShortName, |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | }, |
| | | vehicleType: { |
| | | label: '车辆类型', |
| | | addDisplay: true, minWidth: 150, |
| | | editDisplay: true, |
| | | viewDisplay: true, |
| | | hide: false, |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "车辆类型不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | vehicleType: { |
| | | label: '车辆类型', |
| | | addDisplay: true, minWidth: 150, |
| | | editDisplay: true, |
| | | viewDisplay: true, |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/vehicle_type', |
| | | |
| | | }, |
| | | internalCode: { |
| | | label: '车辆内部编码', |
| | |
| | | hide: true, |
| | | search: false, |
| | | }, |
| | | carKeyNo: { |
| | | label: '车辆钥匙编号', |
| | | addDisplay: true, |
| | | editDisplay: true, |
| | | viewDisplay: true, |
| | | }, |
| | | isBlacklist: { |
| | | label: '是否黑名单', value: '1', dataType: 'string', |
| | | type: 'radio', dicUrl: '/system/dict/data/type/sys_number_is', |
| | |
| | | ], |
| | | }, |
| | | isTrailer: { |
| | | label: '是否挂车', minWidth: 150, dataType: 'string', |
| | | label: '是否挂车', minWidth: 150, dataType: 'string',value: '1', |
| | | type: 'radio', dicUrl: '/system/dict/data/type/sys_number_is', |
| | | addDisplay: true, |
| | | editDisplay: true, |
| | |
| | | } |
| | | ], |
| | | }, |
| | | |
| | | } |
| | | }, |
| | | { |
| | |
| | | viewDisplay: true, |
| | | hide: false, |
| | | search: false, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "主驾驶员不能为空", trigger: "blur" |
| | | } |
| | | ], |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "主驾驶员不能为空", trigger: "blur" |
| | | // } |
| | | // ], |
| | | }, |
| | | mainDriverPhone: { |
| | | label: '主驾驶员联系方式', |
| | |
| | | }, |
| | | { |
| | | label: '实时信息', |
| | | prop: 'ssxx',addDisplay: false,editDisplay: false, |
| | | prop: 'ssxx', addDisplay: false, editDisplay: false, |
| | | column: { |
| | | hasTask: { |
| | | label: '是否有任务', |
| | |
| | | }, |
| | | } |
| | | }, |
| | | { |
| | | { |
| | | label: '车辆详细信息', |
| | | prop: 'clxqxx', |
| | | column: { |
| | |
| | | }, |
| | | emptyLoadFuel: { |
| | | label: '空载油耗', |
| | | addDisplay: true,append:'L/Km', |
| | | addDisplay: true, append: 'L/Km', |
| | | editDisplay: true, |
| | | viewDisplay: true, minWidth: 150, |
| | | hide: true, |
| | |
| | | }, |
| | | fullLoadFuel: { |
| | | label: '重载油耗', |
| | | addDisplay: true,append:'L/Km', |
| | | addDisplay: true, append: 'L/Km', |
| | | editDisplay: true, minWidth: 150, |
| | | viewDisplay: true, |
| | | hide: true, |
| | |
| | | purchasePrice: { |
| | | label: '车辆购置价', minWidth: 150, |
| | | addDisplay: true, |
| | | editDisplay: true,append:'万元', |
| | | editDisplay: true, append: '万元', |
| | | viewDisplay: true, |
| | | hide: true, |
| | | search: false, |
| | |
| | | actualLength: { |
| | | label: '实际长', |
| | | addDisplay: true, |
| | | editDisplay: true,append:'mm', |
| | | editDisplay: true, append: 'mm', |
| | | viewDisplay: true, |
| | | hide: true, |
| | | search: false, |
| | |
| | | actualWidth: { |
| | | label: '实际宽', |
| | | addDisplay: true, |
| | | editDisplay: true,append:'mm', |
| | | editDisplay: true, append: 'mm', |
| | | viewDisplay: true, |
| | | hide: true, |
| | | search: false, |
| | |
| | | actualHeight: { |
| | | label: '实际高', |
| | | addDisplay: true, |
| | | editDisplay: true,append:'mm', |
| | | editDisplay: true, append: 'mm', |
| | | viewDisplay: true, |
| | | hide: true, |
| | | search: false, |
| | |
| | | loadVolume: { |
| | | label: '装载体积', |
| | | addDisplay: true, |
| | | editDisplay: true,append:'m³', |
| | | editDisplay: true, append: 'm³', |
| | | viewDisplay: true, |
| | | hide: true, |
| | | search: false, |
| | |
| | | loadWeight: { |
| | | label: '装载重量', |
| | | addDisplay: true, |
| | | editDisplay: true,append:'Kg', |
| | | editDisplay: true, append: 'Kg', |
| | | viewDisplay: true, |
| | | hide: true, |
| | | search: false, |
| | |
| | | prop: 'qtxx', |
| | | column: { |
| | | status: { |
| | | label: '状态',row:true,span:24, |
| | | label: '状态', row: true, span: 24, |
| | | type: 'radio', dicUrl: '/system/dict/data/type/sys_normal_disable', |
| | | addDisplay: false, |
| | | editDisplay: false, dataType: 'string', |
| | |
| | | }, |
| | | serviceProviderName: { |
| | | label: '车辆服务商', |
| | | minWidth: 150, |
| | | minWidth: 150, |
| | | display: false, |
| | | hide: false, |
| | | search: true, |
| | |
| | | display: false, |
| | | hide: false, |
| | | search: true, |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/vehicle_type', |
| | | |
| | | }, |
| | | internalCode: { |
| | | label: '车辆内部编码',minWidth: 150, |
| | | label: '车辆内部编码', minWidth: 150, |
| | | display: false, |
| | | hide: false, |
| | | search: false, |
| | |
| | | search: false, |
| | | }, |
| | | licenseMo: { |
| | | label: '澳门牌照',minWidth: 150, |
| | | label: '澳门牌照', minWidth: 150, |
| | | display: false, |
| | | hide: false, |
| | | search: false, |
| | | }, |
| | | hasTask: { |
| | | label: '是否有任务', |
| | | type: 'select', |
| | | type: 'select', |
| | | dataType: 'string', |
| | | minWidth: 150, dicUrl: '/system/dict/data/type/sys_number_is', |
| | | minWidth: 150, dicUrl: '/system/dict/data/type/sys_number_is', |
| | | display: false, |
| | | search: true, |
| | | rules: [ |
| | |
| | | label: '状态', |
| | | type: 'radio', dicUrl: '/system/dict/data/type/sys_normal_disable', |
| | | display: false, dataType: 'string', |
| | | minWidth: 150, |
| | | minWidth: 150, |
| | | hide: false, |
| | | search: true, |
| | | rules: [ |
| | |
| | | search: false, |
| | | }, |
| | | updateTime: { |
| | | label: '更新时间',minWidth: 180, |
| | | label: '更新时间', minWidth: 180, |
| | | display: false, |
| | | hide: false, |
| | | search: false, |
| | |
| | | selectionList.value = selection; |
| | | } |
| | | }) |
| | | onMounted(() => { |
| | | watch(() => form.value.serviceProviderId, () => { |
| | | |
| | | if (!form.value.serviceProviderId){ |
| | | return; |
| | | } |
| | | const table = crudRef.value?.getPropRef?.('serviceProviderId')?.$refs?.temp; |
| | | if (!table) return; |
| | | |
| | | let active = table.active; |
| | | if (Array.isArray(active)) active = active[0]; |
| | | |
| | | if (active) { |
| | | Object.assign(form.value, { |
| | | serviceProviderId: active.id, |
| | | serviceProviderName: active.serviceShortName, |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | </script> |