| | |
| | | import {usePagePlus} from "@/hooks/usePagePlus"; |
| | | import {hasPermission} from "@/utils/permissionUtils"; |
| | | import {getTmsServiceProvider, listTmsServiceProvider} from "@/api/tms/tmsServiceProvider"; |
| | | import {getTmsSettlementEntity, listTmsSettlementEntity} from "@/api/tms/tmsSettlementEntity"; |
| | | |
| | | const {proxy} = useCurrentInstance(); |
| | | const crudRef = ref(); |
| | |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "产权归属不能为空", trigger: "blur" |
| | | message: "产权归属不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | type: 'table', suffixIcon: 'search', |
| | | change: (val: any) => { |
| | | const table = crudRef.value?.getPropRef?.('ownerTeamId')?.$refs?.temp; |
| | | if (!table) return; |
| | | let active = table.active; |
| | | if (Array.isArray(active)) active = active[0]; |
| | | if (active) { |
| | | Object.assign(form.value, { |
| | | ownerTeamId: active.id, |
| | | ownerTeamName: active.customerShortName, |
| | | }); |
| | | } |
| | | }, |
| | | children: { |
| | | border: true, |
| | | searchLabelWidth: 100, |
| | | searchMenuSpan: 5, |
| | | column: { |
| | | serviceCode: { |
| | | label: '服务商编码', minWidth: 130, |
| | | customerType: { |
| | | label: '客户类型', |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/customer_type', |
| | | display: false, |
| | | hide: false,minWidth:150, |
| | | search: true, |
| | | }, |
| | | serviceShortName: { |
| | | label: '服务商简称', minWidth: 120, |
| | | customerShortName: { |
| | | label: '客户简称', |
| | | display: false, |
| | | hide: false,minWidth:150, |
| | | search: true, |
| | | }, |
| | | serviceType: { |
| | | label: '服务类型', multiple: true, |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/service_type', |
| | | minWidth: 150, |
| | | }, |
| | | isTransport: { |
| | | label: '是否运输服务商', |
| | | type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/sys_number_is', |
| | | minWidth: 150, |
| | | }, |
| | | isStorage: { |
| | | label: '是否仓储服务商', |
| | | type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/sys_number_is', |
| | | minWidth: 150, |
| | | }, |
| | | isExpress: { |
| | | label: '是否快递服务商', |
| | | type: 'radio', dataType: 'string', dicUrl: '/system/dict/data/type/sys_number_is', |
| | | minWidth: 150, |
| | | customerCode: { |
| | | label: '客户编号', |
| | | display: false, |
| | | hide: false,minWidth:150, |
| | | search: true, |
| | | }, |
| | | contactName: { |
| | | label: '联系人姓名', minWidth: 120, |
| | | label: '联系人姓名', |
| | | display: false, |
| | | hide: false,minWidth:150, |
| | | search: true, |
| | | }, |
| | | }, |
| | | |
| | | }, |
| | | props: { |
| | | label: 'serviceShortName', |
| | | label: 'customerShortName', |
| | | value: 'id' |
| | | }, |
| | | onLoad: ({page, value, data}: { page: any, value: any, data: any }, callback: any) => { |
| | |
| | | if (Array.isArray(value)) { |
| | | id = value[0] |
| | | } |
| | | getTmsServiceProvider(id).then(res => { |
| | | getTmsSettlementEntity(id).then(res => { |
| | | return callback(res.data || {}) |
| | | }) |
| | | } else { |
| | | listTmsServiceProvider({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => { |
| | | listTmsSettlementEntity({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => { |
| | | return callback({ |
| | | total: res.total, |
| | | data: res.rows || [], |
| | |
| | | } |
| | | }) |
| | | |
| | | onMounted(() => { |
| | | watch(() => form.value.ownerTeamId, () => { |
| | | |
| | | if (!form.value.ownerTeamId){ |
| | | return; |
| | | } |
| | | const table = crudRef.value?.getPropRef?.('ownerTeamId')?.$refs?.temp; |
| | | if (!table) return; |
| | | |
| | | let active = table.active; |
| | | if (Array.isArray(active)) active = active[0]; |
| | | |
| | | if (active) { |
| | | Object.assign(form.value, { |
| | | ownerTeamId: active.id, |
| | | ownerTeamName: active.serviceShortName, |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | </script> |