| | |
| | | import {usePagePlus} from "@/hooks/usePagePlus"; |
| | | import {hasPermission} from "@/utils/permissionUtils"; |
| | | import router from "@/router"; |
| | | import {getTmsProject, listTmsProject} from "@/api/tms/tmsProject"; |
| | | const {proxy} = useCurrentInstance(); |
| | | const crudRef = ref(); |
| | | |
| | |
| | | } |
| | | ], |
| | | }, |
| | | customerId: { |
| | | label: '所属客户', |
| | | display: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "所属客户不能为空", trigger: "blur" |
| | | } |
| | | ], |
| | | }, |
| | | projectId: { |
| | | label: '关联项目', |
| | | display: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "关联项目不能为空", trigger: "blur" |
| | | message: "关联项目不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | change: (val: any) => { |
| | | const table = crudRef.value?.getPropRef?.('projectId')?.$refs?.temp; |
| | | if (!table) return; |
| | | let active = table.active; |
| | | if (Array.isArray(active)) active = active[0]; |
| | | if (active) { |
| | | Object.assign(form.value, { |
| | | projectId: active.id, |
| | | projectName: active.projectName, |
| | | customerId: active.relatedCustomerId, |
| | | customerName: active.relatedCustomerName, |
| | | contractId: active.relatedContractId, |
| | | contractName: active.relatedContractName, |
| | | }); |
| | | } |
| | | }, |
| | | type: 'table',suffixIcon:'search', |
| | | children:{ |
| | | border: true, |
| | | searchMenuSpan: 5, |
| | | column:{ |
| | | projectName: { |
| | | label: '项目名称', minWidth: 130, |
| | | search: true, |
| | | }, |
| | | projectCode: { |
| | | label: '项目编号',minWidth: 120, |
| | | search: true, |
| | | }, |
| | | relatedContractName: { |
| | | label: '关联合同', |
| | | display: false,minWidth: 150, |
| | | search: true, |
| | | }, |
| | | |
| | | relatedCustomerName: { |
| | | label: '关联客户', |
| | | display: false,minWidth: 150, |
| | | search: true, |
| | | }, |
| | | status: { |
| | | label: '状态',dataType: 'string', |
| | | type: 'radio', dicUrl: '/system/dict/data/type/data_status', |
| | | addDisplay: false,minWidth: 150, |
| | | editDisplay: false, |
| | | viewDisplay: true, |
| | | hide: false, |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "状态不能为空", trigger: "blur" |
| | | } |
| | | ], |
| | | }, |
| | | }, |
| | | |
| | | }, |
| | | props:{ |
| | | label: 'projectName', |
| | | 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] |
| | | } |
| | | getTmsProject(id).then(res=>{ |
| | | return callback(res.data||{}) |
| | | }) |
| | | }else{ |
| | | listTmsProject({pageSize:page.pageSize,pageNum:page.currentPage,...data}).then(res=>{ |
| | | return callback({ |
| | | total: res.total, |
| | | data: res.rows||[], |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | } |
| | | |
| | | }, |
| | | contractId: { |
| | | label: '关联合同', |
| | | display: true, |
| | | customerName: { |
| | | label: '所属客户', |
| | | display: true,disabled:true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "关联合同不能为空", trigger: "blur" |
| | | message: "所属客户不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | }, |
| | | contractName: { |
| | | label: '关联合同', |
| | | display: true,disabled:true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "关联合同不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | }, |
| | |
| | | }) |
| | | |
| | | const goToDetail = (row?:any) => { |
| | | router.push("/basic/tmsQuoteDetail?quotePlanId=" + row.id); |
| | | router.push("/basic/tmsQuoteDetail?quotePlanType=1"ePlanId=" + row.id); |
| | | } |
| | | |
| | | </script> |