Commit b9cfd93cb754f81956eb02adf89c0bf070aa69dc
1 parent
1b499e8a
删除按钮接口配置
Showing
3 changed files
with
16 additions
and
3 deletions
src/api/project/order.ts
... | ... | @@ -9,6 +9,7 @@ enum Api { |
9 | 9 | ORDER_CREATE = '/order/erp/order/add', |
10 | 10 | UPDATE = '/order/erp/order/edit', |
11 | 11 | ORDER = '/order/erp/order/list_by_page', |
12 | + ORDER_DELETE = '/order/erp/order/delete_by_id', | |
12 | 13 | FIELD_AUTH = '/order/erp/order/field_unlock_apply', |
13 | 14 | QUERY_PROJECT_NO_AND_INNER_NO = '/order/erp/order/queryProjectNoAndInnerNo', //查询项目号和内部编号 |
14 | 15 | EXPORT = '/order/erp/order/export', |
... | ... | @@ -52,6 +53,11 @@ export const formatSearchData = (params) => { |
52 | 53 | return params; |
53 | 54 | }; |
54 | 55 | |
56 | +export const orderDelete = async (data: any) => { | |
57 | + const res = await defHttp.post<any>({ url: Api.ORDER_DELETE, data }, { message: '删除成功' }); | |
58 | + return res; | |
59 | +}; | |
60 | + | |
55 | 61 | export const orderCreate = async (data: any) => { |
56 | 62 | const res = await defHttp.post<any>({ url: Api.ORDER_CREATE, data }, { message: '保存成功' }); |
57 | 63 | return res; | ... | ... |
src/views/project/order/index.vue
... | ... | @@ -127,7 +127,7 @@ |
127 | 127 | import HistoryDetail from './HistoryDetail.vue'; |
128 | 128 | import FieldDetail from './FieldDetail.vue'; |
129 | 129 | import { createImgPreview } from '/@/components/Preview/index'; |
130 | - import { getOrderList } from '/@/api/project/order'; | |
130 | + import { getOrderList, orderDelete } from '/@/api/project/order'; | |
131 | 131 | import { useOrderStoreWithOut } from '/@/store/modules/order'; |
132 | 132 | import { useUserStoreWithOut } from '/@/store/modules/user'; |
133 | 133 | import { ROLE } from './type.d'; |
... | ... | @@ -286,7 +286,14 @@ |
286 | 286 | reload(); |
287 | 287 | }; |
288 | 288 | |
289 | - function handleDelete(id: string) {} | |
289 | + async function handleDelete(id: string) { | |
290 | + try { | |
291 | + await orderDelete({ ids: [id] }); | |
292 | + reload(); | |
293 | + } catch (error) { | |
294 | + console.log(error); | |
295 | + } | |
296 | + } | |
290 | 297 | |
291 | 298 | return { |
292 | 299 | user, | ... | ... |
vite.config.ts
... | ... | @@ -20,7 +20,7 @@ export default defineApplicationConfig({ |
20 | 20 | server: { |
21 | 21 | proxy: { |
22 | 22 | '/basic-api/order': { |
23 | - target: 'http://localhost:8000', | |
23 | + target: 'http://localhost:8001', | |
24 | 24 | // target: 'http://39.108.227.113:8000', |
25 | 25 | // target: 'http://39.108.227.113:3000/mock/35', |
26 | 26 | // http://39.108.227.113:8000/order/erp/captcha/get_img_captcha_code | ... | ... |