From cf21910feaa58932a457fc9758766864a238ad53 Mon Sep 17 00:00:00 2001 From: sunzehua Date: Tue, 10 Sep 2024 16:52:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/taskmanage/columns.tsx | 200 ++++++++++++++++++++++++------- src/views/taskmanage/index.vue | 82 ++++++++++++- 2 files changed, 233 insertions(+), 49 deletions(-) diff --git a/src/views/taskmanage/columns.tsx b/src/views/taskmanage/columns.tsx index 6ecd34ad..eb97fd6e 100644 --- a/src/views/taskmanage/columns.tsx +++ b/src/views/taskmanage/columns.tsx @@ -4,7 +4,27 @@ import { BasicColumn, FormSchema } from '/@/components/Table' import { GetTaskPlatEnumDict } from './api' import { GetClientListByCode,GetCarrierSelectList } from '/@/api/common' import { pl } from 'element-plus/es/locales.mjs' - +import { + GetControllerClientList, + GetCustomerServiceList, + GetSaleList, + GetVesselSelectList, + GetVoynoSelectList, + GetClientPortSelectList, + GetCarrierlist, + GetClientLanesSelectList, + GetYardClientList, + GetAgentCnClientList, + GetSaleUserList, + GetCustomClientList, + GetTruckClientList, + GetDeptList, + GetAgentClientList, + GetVouchingClerkList, + GetClientSourceSelectList, + GetClientSourceDetailSelectList, + GetShipAgencyClientList, +} from '/@/views/operation/seaexport/api/BookingLedger' export const searchFormSchema: FormSchema[] = [ { field: 'businessNo', @@ -83,48 +103,142 @@ export const searchFormSchema: FormSchema[] = [ } }, }, - // { - // field: 'taskCategory', - // label: '任务分类', - // component: 'Select', - // required: false, - // dynamicDisabled: false, - // colProps: { span: 4 }, - // componentProps: ({ formModel }) => { - // return { - // options: categoryData.value, - // fieldNames: { - // label: 'name', - // value: 'code' - // }, - // showSearch: true, - // filterOption: (input: string, option: any) => { - // return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 - // }, - // } - // }, - // }, - // { - // field: 'status', - // label: '任务状态', - // component: 'Select', - // required: false, - // dynamicDisabled: false, - // colProps: { span: 4 }, - // componentProps: ({ formModel }) => { - // return { - // options: statusData.value, - // fieldNames: { - // label: 'name', - // value: 'code' - // }, - // showSearch: true, - // filterOption: (input: string, option: any) => { - // return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 - // }, - // } - // }, - // }, + { + label: '客户', + field: 'customerId', + component: 'ApiSelect', + required: false, + dynamicDisabled: false, + colProps: { span: 4 }, + componentProps: () => { + return { + api: () => { + return new Promise((resolve) => { + GetControllerClientList().then((res) => { + res.data.forEach((item) => { + if (item.codeName) item.shortName = item.codeName + '/' + item.shortName + }) + resolve(res) + }) + }) + }, + immediate: false, + labelField: 'shortName', + valueField: 'codeName', + resultField: 'data', + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + } + }, + }, + { + label: '客服', + field: 'customerService', + component: 'ApiSelect', + required: false, + dynamicDisabled: false, + colProps: { span: 4 }, + componentProps: () => { + return { + api: GetCustomerServiceList, + labelField: 'pinYinCode', + valueField: 'userCode', + showName: 'userName', + immediate: false, + resultField: 'data' + } + }, + }, + { + label: '揽货人', + field: 'saleId', + component: 'ApiSelect', + required: false, + dynamicDisabled: false, + colProps: { span: 4 }, + componentProps: () => { + return { + api: GetSaleList, + labelField: 'pinYinCode', + valueField: 'id', + showName: 'userName', + immediate: false, + resultField: 'data' + } + }, + }, + { + label: '操作', + field: 'operatorId', + component: 'ApiSelect', + required: false, + dynamicDisabled: false, + colProps: { span: 4 }, + componentProps: () => { + return { + api: GetCustomerServiceList, + labelField: 'pinYinCode', + valueField: 'id', + showName: 'userName', + immediate: false, + resultField: 'data' + } + }, + }, + { + label: '船公司', + field: 'carrieR_CODE', + component: 'ApiSelect', + required: false, + dynamicDisabled: false, + colProps: { span: 5 }, + componentProps: () => { + return { + api: GetCarrierSelectList, + immediate: false, + labelField: 'ediCode', + valueField: 'ediCode', + resultField: 'data' + } + }, + }, + { + label: '装货港', + field: 'portloaD_CODE', + component: 'ApiSelect', + required: false, + dynamicDisabled: false, + colProps: { span: 4 }, + componentProps: () => { + return { + api: GetClientPortSelectList, + resultField: 'data', + labelField: 'pinYinCode', + showName: 'portName', + valueField: 'ediCode', + immediate: false + } + }, + }, + { + label: '卸货港', + field: 'portdischargE_CODE', + component: 'ApiSelect', + required: false, + dynamicDisabled: false, + colProps: { span: 4 }, + componentProps: () => { + return { + api: GetClientPortSelectList, + resultField: 'data', + labelField: 'pinYinCode', + showName: 'portName', + valueField: 'ediCode', + immediate: false + } + }, + }, diff --git a/src/views/taskmanage/index.vue b/src/views/taskmanage/index.vue index 8fc72795..02b64f20 100644 --- a/src/views/taskmanage/index.vue +++ b/src/views/taskmanage/index.vue @@ -394,21 +394,52 @@ function getCurrentTotalStat() { levelTreeAll.value = [] levelTree.value = [] let bussObj = '' + let str1 = '' + let str2 = '' let queryData = formatParams(getForm().getFieldsValue()).queryCondition if (queryData) { queryData = JSON.parse(queryData) - for (let i = 0; i < queryData.length; i++) { + let i = queryData.length; + while (i--) { if (queryData[i].FieldName === 'businessNo') { bussObj = queryData[i].FieldValue - queryData.splice(i, 1) + queryData.splice(i, 1); + } else + if (queryData[i].FieldName === 'portloaD_CODE') { + str1 = queryData[i].FieldValue + queryData.splice(i, 1); + } else + if (queryData[i].FieldName === 'portdischargE_CODE') { + str2 = queryData[i].FieldValue + queryData.splice(i, 1); } } + // for (let i = 0; i < queryData.length; i++) { + // if (queryData[i].FieldName === 'businessNo') { + // bussObj = queryData[i].FieldValue + // queryData.splice(i, 1) + // i-- + // } + // if (queryData[i].FieldName === 'portloaD_CODE') { + // str1 = queryData[i].FieldValue + // queryData.splice(i, 1) + // i-- + // } + // if (queryData[i].FieldName === 'portdischargE_CODE') { + // str2 = queryData[i].FieldValue + // queryData.splice(i, 1) + // i-- + // } + // } + console.log(queryData, 123123); } const data = { isReCalc: false, queryCondition: JSON.stringify(queryData), - otherQueryCondition:{ - businessNo:bussObj + otherQueryCondition: { + businessNo: bussObj, + portloaD_CODE: str1, + portdischargE_CODE: str2 } } GetCurrentTotalStat(data) @@ -648,6 +679,8 @@ const [registerTable, { reload, setProps, getForm, getSelectRows, setColumns }] const queryData = JSON.parse(formatParams(p).queryCondition) data.pageCondition = formatParams(p).pageCondition let bussObj = '' as any + let str1 = '' as any + let str2 = '' as any for (let i = 0; i < queryData.length; i++) { if (queryData[i].FieldName === 'task_TYPE') { queryData[i].ConditionalType = 0 @@ -658,12 +691,43 @@ const [registerTable, { reload, setProps, getForm, getSelectRows, setColumns }] if (queryData[i].FieldName === 'taskSource') { queryData[i].ConditionalType = 0 } + // if (queryData[i].FieldName === 'businessNo') { + // bussObj = queryData[i].FieldValue + // queryData.splice(i, 1) + // } + // if (queryData[i].FieldName === 'portloaD_CODE') { + // str1 = queryData[i].FieldValue + // queryData.splice(i, 1) + // } + // if (queryData[i].FieldName === 'portdischargE_CODE') { + // str2 = queryData[i].FieldValue + // queryData.splice(i, 1) + // } + } + let i = queryData.length; + while (i--) { if (queryData[i].FieldName === 'businessNo') { bussObj = queryData[i].FieldValue - queryData.splice(i, 1) + queryData.splice(i, 1); + } else + if (queryData[i].FieldName === 'portloaD_CODE') { + str1 = queryData[i].FieldValue + queryData.splice(i, 1); + } else + if (queryData[i].FieldName === 'portdischargE_CODE') { + str2 = queryData[i].FieldValue + queryData.splice(i, 1); + } else + if (queryData[i].FieldName === 'task_TYPE') { + queryData[i].ConditionalType = 0 + } else + if (queryData[i].FieldName === 'taskRecvName') { + queryData[i].ConditionalType = 0 + } else + if (queryData[i].FieldName === 'taskSource') { + queryData[i].ConditionalType = 0 } } - console.log(bussObj) data.queryCondition = JSON.stringify(queryData) data.otherQueryCondition = {} if (activeTopKey.value) { @@ -678,6 +742,12 @@ const [registerTable, { reload, setProps, getForm, getSelectRows, setColumns }] if (bussObj) { data.otherQueryCondition.businessNo = bussObj } + if (str1) { + data.otherQueryCondition.portloaD_CODE = str1 + } + if (str2) { + data.otherQueryCondition.portdischargE_CODE = str2 + } return data }, immediate: false,