Commit 1b499e8abe1ede82f7d676693d243c5aee1e6989
1 parent
2084655f
项目编号和内部编号选项远程搜索
Showing
4 changed files
with
61 additions
and
19 deletions
src/api/project/order.ts
@@ -10,6 +10,7 @@ enum Api { | @@ -10,6 +10,7 @@ enum Api { | ||
10 | UPDATE = '/order/erp/order/edit', | 10 | UPDATE = '/order/erp/order/edit', |
11 | ORDER = '/order/erp/order/list_by_page', | 11 | ORDER = '/order/erp/order/list_by_page', |
12 | FIELD_AUTH = '/order/erp/order/field_unlock_apply', | 12 | FIELD_AUTH = '/order/erp/order/field_unlock_apply', |
13 | + QUERY_PROJECT_NO_AND_INNER_NO = '/order/erp/order/queryProjectNoAndInnerNo', //查询项目号和内部编号 | ||
13 | EXPORT = '/order/erp/order/export', | 14 | EXPORT = '/order/erp/order/export', |
14 | UPLOAD = '/api/localStorage/uploadOss', | 15 | UPLOAD = '/api/localStorage/uploadOss', |
15 | 16 | ||
@@ -56,6 +57,11 @@ export const orderCreate = async (data: any) => { | @@ -56,6 +57,11 @@ export const orderCreate = async (data: any) => { | ||
56 | return res; | 57 | return res; |
57 | }; | 58 | }; |
58 | 59 | ||
60 | +export const queryProjectNoAndInnerNo = async (data: any) => { | ||
61 | + const res = await defHttp.post<any>({ url: Api.QUERY_PROJECT_NO_AND_INNER_NO, data }); | ||
62 | + return res; | ||
63 | +}; | ||
64 | + | ||
59 | export const getOrderOptLog = async (data: any) => { | 65 | export const getOrderOptLog = async (data: any) => { |
60 | return defHttp.post<any>({ url: Api.OPT_LOG, data }); | 66 | return defHttp.post<any>({ url: Api.OPT_LOG, data }); |
61 | }; | 67 | }; |
@@ -77,6 +83,30 @@ export const orderAnalysis = async (data: any) => { | @@ -77,6 +83,30 @@ export const orderAnalysis = async (data: any) => { | ||
77 | return res; | 83 | return res; |
78 | }; | 84 | }; |
79 | 85 | ||
86 | +/** | ||
87 | + * 查询编号选项 | ||
88 | + * @param noType 是项目编号还是内部编号 | ||
89 | + * @param value keyword | ||
90 | + * @returns select的选项 | ||
91 | + */ | ||
92 | +export const queryNoOptions = async (noType: any, value: any) => { | ||
93 | + let options = []; | ||
94 | + let res; | ||
95 | + if (noType === 'projectNo') { | ||
96 | + res = await queryProjectNoAndInnerNo({ projectNo: value }); | ||
97 | + options = res.map((item: any) => { | ||
98 | + return { label: item.projectNo, value: item.projectNo }; | ||
99 | + }); | ||
100 | + } else { | ||
101 | + res = await queryProjectNoAndInnerNo({ innerNo: value }); | ||
102 | + options = res.map((item: any) => { | ||
103 | + return { label: item.innerNo, value: item.innerNo }; | ||
104 | + }); | ||
105 | + } | ||
106 | + | ||
107 | + return options; | ||
108 | +}; | ||
109 | + | ||
80 | export const orderGravity = async (data: any) => { | 110 | export const orderGravity = async (data: any) => { |
81 | data = formatSearchData(data); | 111 | data = formatSearchData(data); |
82 | 112 |
src/views/project/order/index.vue
@@ -55,16 +55,16 @@ | @@ -55,16 +55,16 @@ | ||
55 | label: '历史记录', | 55 | label: '历史记录', |
56 | onClick: handleHistory.bind(null, record), | 56 | onClick: handleHistory.bind(null, record), |
57 | }, | 57 | }, |
58 | - // { | ||
59 | - // ...(role === ROLE.ADMIN && { | ||
60 | - // label: '删除', | ||
61 | - // popConfirm: { | ||
62 | - // title: '是否确认删除', | ||
63 | - // placement: 'left', | ||
64 | - // confirm: handleDelete.bind(null, record?.id), | ||
65 | - // }, | ||
66 | - // }), | ||
67 | - // }, | 58 | + { |
59 | + ...(role === ROLE.ADMIN && { | ||
60 | + label: '删除', | ||
61 | + popConfirm: { | ||
62 | + title: '是否确认删除', | ||
63 | + placement: 'left', | ||
64 | + confirm: handleDelete.bind(null, record?.id), | ||
65 | + }, | ||
66 | + }), | ||
67 | + }, | ||
68 | ] | 68 | ] |
69 | : [] | 69 | : [] |
70 | " | 70 | " |
@@ -286,7 +286,7 @@ | @@ -286,7 +286,7 @@ | ||
286 | reload(); | 286 | reload(); |
287 | }; | 287 | }; |
288 | 288 | ||
289 | - // function handleDelete(id: string) {} | 289 | + function handleDelete(id: string) {} |
290 | 290 | ||
291 | return { | 291 | return { |
292 | user, | 292 | user, |
@@ -318,7 +318,7 @@ | @@ -318,7 +318,7 @@ | ||
318 | handleFormSuccess, | 318 | handleFormSuccess, |
319 | handleRateModal, | 319 | handleRateModal, |
320 | openExportModal, | 320 | openExportModal, |
321 | - // handleDelete, | 321 | + handleDelete, |
322 | role, | 322 | role, |
323 | ROLE, | 323 | ROLE, |
324 | }; | 324 | }; |
src/views/project/order/tableData.tsx
1 | +import { ref } from 'vue'; | ||
1 | import { ROLE } from './type.d'; | 2 | import { ROLE } from './type.d'; |
3 | +import { queryNoOptions } from '/@/api/project/order'; | ||
2 | import { useOrderInfo } from '/@/hooks/component/order'; | 4 | import { useOrderInfo } from '/@/hooks/component/order'; |
3 | import { useOrderStoreWithOut } from '/@/store/modules/order'; | 5 | import { useOrderStoreWithOut } from '/@/store/modules/order'; |
4 | import { formatToDate } from '/@/utils/dateUtil'; | 6 | import { formatToDate } from '/@/utils/dateUtil'; |
@@ -8,12 +10,15 @@ import { formatToDate } from '/@/utils/dateUtil'; | @@ -8,12 +10,15 @@ import { formatToDate } from '/@/utils/dateUtil'; | ||
8 | // 跟单员- 查看利润分析(单价和总金额),跟单,质检,编辑 | 10 | // 跟单员- 查看利润分析(单价和总金额),跟单,质检,编辑 |
9 | // 质检员- 查看跟单,质检,编辑质检 | 11 | // 质检员- 查看跟单,质检,编辑质检 |
10 | 12 | ||
13 | +const innerNoOptions = ref([]); | ||
14 | +const projectNoOptions = ref([]); | ||
15 | + | ||
11 | // 可选择的列 | 16 | // 可选择的列 |
12 | export const SELECT_FIELD_COLUMNS = [ | 17 | export const SELECT_FIELD_COLUMNS = [ |
13 | - // 'projectNo', | 18 | + 'projectNo', |
14 | 'customerCode', | 19 | 'customerCode', |
15 | 'productionDepartment', | 20 | 'productionDepartment', |
16 | - // 'innerNo', | 21 | + 'innerNo', |
17 | 'poColor', | 22 | 'poColor', |
18 | 'cnColor', | 23 | 'cnColor', |
19 | 'productStyle', | 24 | 'productStyle', |
@@ -1237,9 +1242,12 @@ export function getFormConfig(): Partial<FormProps> { | @@ -1237,9 +1242,12 @@ export function getFormConfig(): Partial<FormProps> { | ||
1237 | labelWidth: 150, | 1242 | labelWidth: 150, |
1238 | 1243 | ||
1239 | componentProps: { | 1244 | componentProps: { |
1240 | - options: projectNo, | 1245 | + options: projectNoOptions, |
1241 | showSearch: true, | 1246 | showSearch: true, |
1242 | - // mode: 'multiple', | 1247 | + mode: 'multiple', |
1248 | + onSearch: async (value: any) => { | ||
1249 | + projectNoOptions.value = await queryNoOptions('projectNo', value); | ||
1250 | + }, | ||
1243 | }, | 1251 | }, |
1244 | }, | 1252 | }, |
1245 | { | 1253 | { |
@@ -1252,9 +1260,12 @@ export function getFormConfig(): Partial<FormProps> { | @@ -1252,9 +1260,12 @@ export function getFormConfig(): Partial<FormProps> { | ||
1252 | labelWidth: 150, | 1260 | labelWidth: 150, |
1253 | 1261 | ||
1254 | componentProps: { | 1262 | componentProps: { |
1255 | - options: innerNo, | 1263 | + options: innerNoOptions, |
1256 | showSearch: true, | 1264 | showSearch: true, |
1257 | - // mode: 'multiple', | 1265 | + mode: 'multiple', |
1266 | + onSearch: async (value: any) => { | ||
1267 | + innerNoOptions.value = await queryNoOptions('innerNo', value); | ||
1268 | + }, | ||
1258 | }, | 1269 | }, |
1259 | }, | 1270 | }, |
1260 | { | 1271 | { |
vite.config.ts
@@ -20,7 +20,8 @@ export default defineApplicationConfig({ | @@ -20,7 +20,8 @@ export default defineApplicationConfig({ | ||
20 | server: { | 20 | server: { |
21 | proxy: { | 21 | proxy: { |
22 | '/basic-api/order': { | 22 | '/basic-api/order': { |
23 | - target: 'http://39.108.227.113:8000', | 23 | + target: 'http://localhost:8000', |
24 | + // target: 'http://39.108.227.113:8000', | ||
24 | // target: 'http://39.108.227.113:3000/mock/35', | 25 | // target: 'http://39.108.227.113:3000/mock/35', |
25 | // http://39.108.227.113:8000/order/erp/captcha/get_img_captcha_code | 26 | // http://39.108.227.113:8000/order/erp/captcha/get_img_captcha_code |
26 | changeOrigin: true, | 27 | changeOrigin: true, |