Commit 32aef76f076337087a36823e8eaac28ce2048b67
1 parent
19fbba75
feat: 增加业务员搜索
Showing
2 changed files
with
39 additions
and
8 deletions
src/views/project/order/index.vue
... | ... | @@ -133,6 +133,7 @@ |
133 | 133 | import { useOrderStoreWithOut } from '/@/store/modules/order'; |
134 | 134 | import { useUserStoreWithOut } from '/@/store/modules/user'; |
135 | 135 | import { ROLE } from './type.d'; |
136 | + import { getUserList } from '/@/api/project/account'; | |
136 | 137 | |
137 | 138 | const orderStore = useOrderStoreWithOut(); |
138 | 139 | const userStore = useUserStoreWithOut(); |
... | ... | @@ -168,11 +169,26 @@ |
168 | 169 | return user?.roleSmallVO?.code; |
169 | 170 | }); |
170 | 171 | |
172 | + // 业务员列表 | |
173 | + const businessUsers = ref([]); | |
174 | + | |
171 | 175 | const [checkModalRegister, { openDrawer: openCheckDetailDrawer }] = useDrawer(); |
172 | 176 | onMounted(async () => { |
173 | 177 | await orderStore.getDict(); |
174 | 178 | }); |
175 | 179 | |
180 | + onMounted(async () => { | |
181 | + // 获取业务员 | |
182 | + const res = await getUserList({ page: 1, pageSize: 1000 }); | |
183 | + businessUsers.value = res.items | |
184 | + .filter((item) => item.roleCode === ROLE.BUSINESS) | |
185 | + .map((item) => ({ value: item.userName, label: item.userName })); | |
186 | + }); | |
187 | + | |
188 | + const formConfig = computed(() => { | |
189 | + return getFormConfig(businessUsers.value); | |
190 | + }); | |
191 | + | |
176 | 192 | const [registerTable, { getForm, reload, getColumns }] = useTable({ |
177 | 193 | api: getOrderList, |
178 | 194 | title: '订单列表', |
... | ... | @@ -181,7 +197,7 @@ |
181 | 197 | }, |
182 | 198 | columns: getOrderColumns(user?.roleSmallVO?.code), |
183 | 199 | useSearchForm: true, |
184 | - formConfig: getFormConfig(), | |
200 | + formConfig: formConfig, | |
185 | 201 | showTableSetting: true, |
186 | 202 | // tableSetting: { fullScreen: true }, |
187 | 203 | showIndexColumn: false, | ... | ... |
src/views/project/order/tableData.tsx
... | ... | @@ -30,7 +30,7 @@ export const SELECT_FIELD_COLUMNS = [ |
30 | 30 | 'midCheckResult', |
31 | 31 | 'endCheckResult', |
32 | 32 | // 'exchangeRate', |
33 | - 'businessPerson', | |
33 | + // 'businessPerson', | |
34 | 34 | ]; |
35 | 35 | |
36 | 36 | /** |
... | ... | @@ -146,11 +146,11 @@ export const ORDER_LIST_BASE_FIELDS = [ |
146 | 146 | width: 150, |
147 | 147 | dataIndex: 'packetType', |
148 | 148 | }, |
149 | - // { | |
150 | - // title: '业务员', | |
151 | - // width: 150, | |
152 | - // dataIndex: 'businessPerson', | |
153 | - // }, | |
149 | + { | |
150 | + title: '业务员', | |
151 | + width: 150, | |
152 | + dataIndex: 'businessPerson', | |
153 | + }, | |
154 | 154 | ]; |
155 | 155 | |
156 | 156 | export const ORDER_LIST_REPORT_FIELDS = [ |
... | ... | @@ -1210,7 +1210,7 @@ export const FIELDS_INSPECTION_INFO = [ |
1210 | 1210 | }, |
1211 | 1211 | ]; |
1212 | 1212 | |
1213 | -export function getFormConfig(): Partial<FormProps> { | |
1213 | +export function getFormConfig(businessUsers: any[]): Partial<FormProps> { | |
1214 | 1214 | const orderStore = useOrderStoreWithOut(); |
1215 | 1215 | |
1216 | 1216 | const { |
... | ... | @@ -1551,6 +1551,21 @@ export function getFormConfig(): Partial<FormProps> { |
1551 | 1551 | options: endCheckResult, |
1552 | 1552 | }, |
1553 | 1553 | }, |
1554 | + { | |
1555 | + field: `businessPerson`, | |
1556 | + label: `业务员`, | |
1557 | + component: 'Select', | |
1558 | + colProps: { | |
1559 | + span: 6, | |
1560 | + }, | |
1561 | + labelWidth: 150, | |
1562 | + | |
1563 | + componentProps: { | |
1564 | + mode: 'multiple', | |
1565 | + showSearch: true, | |
1566 | + options: businessUsers, | |
1567 | + }, | |
1568 | + }, | |
1554 | 1569 | ], |
1555 | 1570 | }; |
1556 | 1571 | } | ... | ... |