Commit 923b2ed65e83236c556d5d1175c2257407390518

Authored by sanmu
1 parent bf93cc5f

feat: 联调订单

src/api/project/account.ts
... ... @@ -3,9 +3,9 @@ import { defHttp } from '/@/utils/http/axios';
3 3 enum Api {
4 4 ROLE_LIST = '/order/erp/roles/all',
5 5 USER_LIST = '/order/erp/users/list_by_page',
6   - USER_ADD = '/order/erp/roles/add',
7   - USER_EDIT = '/order/erp/roles/edit',
8   - USER_DELETE = '/order/erp/roles/delete',
  6 + USER_ADD = '/order/erp/users/add',
  7 + USER_EDIT = '/order/erp/users/edit',
  8 + USER_DELETE = '/order/erp/users/delete',
9 9 }
10 10  
11 11 export const getRoleList = async (params: any) => {
... ... @@ -21,7 +21,10 @@ export const getUserList = async (params: any) => {
21 21 params,
22 22 });
23 23 return new Promise((resolve) => {
24   - resolve(res.records);
  24 + resolve({
  25 + items: res.records,
  26 + total: res.total,
  27 + });
25 28 });
26 29 };
27 30  
... ... @@ -33,17 +36,23 @@ export const getUserList = async (params: any) => {
33 36 // };
34 37  
35 38 export const userAdd = async (params: any) => {
36   - return defHttp.post<any>({
37   - url: Api.USER_ADD,
38   - params,
39   - });
  39 + return defHttp.post<any>(
  40 + {
  41 + url: Api.USER_ADD,
  42 + params,
  43 + },
  44 + { message: '保存成功' },
  45 + );
40 46 };
41 47  
42 48 export const userEdit = async (params: any) => {
43   - return defHttp.post<any>({
44   - url: Api.USER_EDIT,
45   - params,
46   - });
  49 + return defHttp.post<any>(
  50 + {
  51 + url: Api.USER_EDIT,
  52 + params,
  53 + },
  54 + { message: '保存成功' },
  55 + );
47 56 };
48 57  
49 58 export const userDelete = async (params: any) => {
... ...
src/api/project/approve.ts
... ... @@ -28,35 +28,11 @@ export const getWaitListApi = async (params: DemoParams) =&gt; {
28 28 });
29 29  
30 30 res.records = res.records.map((item) => {
31   - item.fields = [];
32   - !isEmpty(item.fieldInfos.baseFields) &&
33   - Object.entries(item.fieldInfos.baseFields).map(([key, value]) => {
34   - if (value === 'UN_LOCKED') {
35   - const obj = find(FIELDS_BASE_INFO, { field: key });
36   - item.fields.push(obj?.label);
37   - }
38   - });
39   - !isEmpty(item.fieldInfos.reportFields) &&
40   - Object.entries(item.fieldInfos.reportFields).map(([key, value]) => {
41   - if (value === 'UN_LOCKED') {
42   - const obj = find(FIELDS_REPORT_INFO, { field: key });
43   - item.fields.push(obj?.label);
44   - }
45   - });
46   - !isEmpty(item.fieldInfos.reportFields) &&
47   - Object.entries(item.fieldInfos.reportFields).map(([key, value]) => {
48   - if (value === 'UN_LOCKED') {
49   - const obj = find(FIELDS_PROFIT_INFO, { field: key });
50   - item.fields.push(obj?.label);
51   - }
52   - });
53   -
54   - item.fields = item.fields.join(',');
55 31 return item;
56 32 });
57 33  
58 34 return new Promise((resolve) => {
59   - resolve(res.records);
  35 + resolve({ items: res.records, total: res.total });
60 36 });
61 37 };
62 38  
... ... @@ -67,33 +43,10 @@ export const getApprovedListApi = async (params: any) =&gt; {
67 43 });
68 44  
69 45 res.records = res.records.map((item) => {
70   - item.fields = [];
71   - !isEmpty(item.fieldInfos.baseFields) &&
72   - Object.entries(item.fieldInfos.baseFields).map(([key, value]) => {
73   - if (value === 'UN_LOCKED') {
74   - const obj = find(FIELDS_BASE_INFO, { field: key });
75   - item.fields.push(obj?.label);
76   - }
77   - });
78   - !isEmpty(item.fieldInfos.reportFields) &&
79   - Object.entries(item.fieldInfos.reportFields).map(([key, value]) => {
80   - if (value === 'UN_LOCKED') {
81   - const obj = find(FIELDS_REPORT_INFO, { field: key });
82   - item.fields.push(obj?.label);
83   - }
84   - });
85   - !isEmpty(item.fieldInfos.reportFields) &&
86   - Object.entries(item.fieldInfos.reportFields).map(([key, value]) => {
87   - if (value === 'UN_LOCKED') {
88   - const obj = find(FIELDS_PROFIT_INFO, { field: key });
89   - item.fields.push(obj?.label);
90   - }
91   - });
92   - item.fields = item.fields.join(',');
93 46 return item;
94 47 });
95 48  
96 49 return new Promise((resolve) => {
97   - resolve(res.records);
  50 + resolve({ items: res.records, total: res.total });
98 51 });
99 52 };
... ...
src/api/project/order.ts
... ... @@ -9,7 +9,7 @@ enum Api {
9 9 ORDER = '/order/erp/order/list_by_page',
10 10 FIELD_AUTH = '/order/erp/order/field_unlock_apply',
11 11 EXPORT = '/order/erp/order/export',
12   - UPLOAD = '/api/localStorage/upload',
  12 + UPLOAD = '/api/localStorage/uploadOss',
13 13  
14 14 DICT_INIT = '/order/erp/dictionary/get_all',
15 15 DICT_ADD = '/order/erp/dictionary/add',
... ... @@ -26,7 +26,7 @@ export const orderCreate = async (data: any) =&gt; {
26 26 };
27 27  
28 28 export const orderUpdate = async (data: any) => {
29   - const res = await defHttp.post<any>({ url: Api.UPDATE, data });
  29 + const res = await defHttp.post<any>({ url: Api.UPDATE, data }, { message: '操作成功' });
30 30 return res;
31 31 };
32 32  
... ...
src/components/FieldUpload/src/FieldUpload.vue
... ... @@ -5,7 +5,7 @@
5 5 list-type="picture-card"
6 6 class="avatar-uploader"
7 7 :show-upload-list="false"
8   - action="/api/localStorage/upload"
  8 + action="/api/localStorage/upload_oss"
9 9 accept=".jpg,.jpeg,.gif,.png,.webp"
10 10 :data="handleData"
11 11 >
... ...
src/views/dashboard/analysis/components/GrowCard.vue
... ... @@ -73,7 +73,7 @@
73 73 {
74 74 title: '订单初始化',
75 75 icon: 'transaction|svg',
76   - value: 5000,
  76 + value: data?.orderCount || 0,
77 77 total: 50000,
78 78 color: 'purple',
79 79 action: '年',
... ...
src/views/project/account/AccountModal.vue
... ... @@ -49,7 +49,10 @@
49 49 setModalProps({ confirmLoading: true });
50 50  
51 51 closeModal();
52   - emit('success', { isUpdate: unref(isUpdate), values: { ...values, id: rowId.value } });
  52 + emit('success', {
  53 + isUpdate: unref(isUpdate),
  54 + values: { ...values, id: rowId.value || undefined },
  55 + });
53 56 } finally {
54 57 setModalProps({ confirmLoading: false });
55 58 }
... ...
src/views/project/account/account.data.ts
... ... @@ -80,7 +80,7 @@ export const accountFormSchema: FormSchema[] = [
80 80 // },
81 81 {
82 82 label: '角色',
83   - field: 'roleName',
  83 + field: 'roleId',
84 84 component: 'ApiSelect',
85 85 componentProps: {
86 86 api: getRoleList,
... ...
src/views/project/account/index.vue
... ... @@ -19,16 +19,16 @@
19 19 tooltip: '编辑用户资料',
20 20 onClick: handleEdit.bind(null, record),
21 21 },
22   - {
23   - icon: 'ant-design:delete-outlined',
24   - color: 'error',
25   - tooltip: '删除此账号',
26   - popConfirm: {
27   - title: '是否确认删除',
28   - placement: 'left',
29   - confirm: handleDelete.bind(null, record),
30   - },
31   - },
  22 + // {
  23 + // icon: 'ant-design:delete-outlined',
  24 + // color: 'error',
  25 + // tooltip: '删除此账号',
  26 + // popConfirm: {
  27 + // title: '是否确认删除',
  28 + // placement: 'left',
  29 + // confirm: handleDelete.bind(null, record),
  30 + // },
  31 + // },
32 32 ]"
33 33 />
34 34 </template>
... ...
src/views/project/approve/FieldPanel.vue 0 → 100644
  1 +<template>
  2 + <PageWrapper contentBackground>
  3 + <BasicTable @register="registerTable">
  4 + <template #form-custom> custom-slot </template>
  5 + <template #bodyCell="{ column, record }">
  6 + <template v-if="column.key === 'action'">
  7 + <TableAction
  8 + :actions="[
  9 + {
  10 + label: '详情',
  11 + // icon: 'ic:outline-delete-outline',
  12 + onClick: handleDetail.bind(null, record),
  13 + },
  14 + ]"
  15 + />
  16 + </template>
  17 + </template>
  18 + </BasicTable>
  19 + <BasicDrawer
  20 + :showFooter="!isApproved"
  21 + @register="registerDrawer"
  22 + title="申请信息"
  23 + okText="通过"
  24 + @ok="handleTrue"
  25 + >
  26 + <h2>基本信息</h2>
  27 + <div v-for="field in baseInfos" :key="field">
  28 + <span className="w-[140px] inline-block text-right mr-3">{{ field.label }}:</span
  29 + ><span>{{ field.value }}</span>
  30 + </div>
  31 + <h2 className="mt-8">基本信息申请字段</h2>
  32 + <div>{{ fieldInfos.baseFields.join(' , ') }}</div>
  33 + <h2 className="mt-8">利润分析表申请字段</h2>
  34 + <div>
  35 + {{ fieldInfos.profitFields.join(' , ') }}
  36 + </div>
  37 + <h2 className="mt-8">项目报告书申请字段</h2>
  38 + <div>
  39 + <span>{{ fieldInfos.reportFields.join(' , ') }}</span>
  40 + </div>
  41 + <template #appendFooter>
  42 + <a-button @click="handleFalse"> 不通过</a-button>
  43 + </template>
  44 + </BasicDrawer>
  45 + </PageWrapper>
  46 +</template>
  47 +<script lang="ts">
  48 + import { defineComponent, ref } from 'vue';
  49 + import { BasicTable, useTable, TableAction } from '/@/components/Table';
  50 + import { PageWrapper } from '/@/components/Page';
  51 + import { BasicDrawer, useDrawer } from '/@/components/Drawer';
  52 +
  53 + import { approveAuditApi, getApprovedListApi, getWaitListApi } from '/@/api/project/approve';
  54 + import { FIELDS_BASE_INFO, FIELDS_PROFIT_INFO, FIELDS_REPORT_INFO } from '../order/tableData';
  55 + import { find, isEmpty } from 'lodash-es';
  56 +
  57 + export default defineComponent({
  58 + components: {
  59 + PageWrapper,
  60 + BasicTable,
  61 + BasicDrawer,
  62 + TableAction,
  63 + },
  64 + props: {
  65 + isApproved: { type: Boolean },
  66 + },
  67 + setup(props) {
  68 + const checkedKeys = ref<Array<string | number>>([]);
  69 + const currentKey = ref('1');
  70 + const [registerDrawer, { openDrawer, closeDrawer }] = useDrawer();
  71 + const fieldInfos = ref({
  72 + baseFields: [],
  73 + reportFields: [],
  74 + profitFields: [],
  75 + });
  76 + const baseInfos = ref({});
  77 + const id = ref('');
  78 +
  79 + const [registerTable, { reload }] = useTable({
  80 + api: props.isApproved ? getApprovedListApi : getWaitListApi,
  81 + searchInfo: { type: 0 },
  82 +
  83 + columns: [
  84 + {
  85 + title: '申请人',
  86 + dataIndex: 'createBy',
  87 + width: 150,
  88 + },
  89 + ],
  90 + // useSearchForm: true,
  91 + // formConfig: getFormConfig(),
  92 + rowKey: 'id',
  93 + actionColumn: {
  94 + width: 160,
  95 + title: 'Action',
  96 + dataIndex: 'action',
  97 + // slots: { customRender: 'action' },
  98 + },
  99 + });
  100 +
  101 + function onSelect(record, selected) {
  102 + if (selected) {
  103 + checkedKeys.value = [...checkedKeys.value, record.id];
  104 + } else {
  105 + checkedKeys.value = checkedKeys.value.filter((id) => id !== record.id);
  106 + }
  107 + }
  108 + function onSelectAll(selected, selectedRows, changeRows) {
  109 + const changeIds = changeRows.map((item) => item.id);
  110 + if (selected) {
  111 + checkedKeys.value = [...checkedKeys.value, ...changeIds];
  112 + } else {
  113 + checkedKeys.value = checkedKeys.value.filter((id) => {
  114 + return !changeIds.includes(id);
  115 + });
  116 + }
  117 + }
  118 + function handleEdit(record, e) {
  119 + e?.stopPropagation();
  120 + return false;
  121 + }
  122 +
  123 + function handleProfitModal() {}
  124 +
  125 + async function handleDetail(data) {
  126 + fieldInfos.value = {
  127 + baseFields: [],
  128 + reportFields: [],
  129 + profitFields: [],
  130 + };
  131 + openDrawer(true, { data });
  132 +
  133 + !isEmpty(data.fieldInfos.baseFields) &&
  134 + Object.entries(data.fieldInfos.baseFields)?.map(([key, value]) => {
  135 + if (value === 'UN_LOCKED') {
  136 + const obj = find(FIELDS_BASE_INFO, { field: key });
  137 + fieldInfos.value.baseFields.push(obj?.label);
  138 + }
  139 + });
  140 + !isEmpty(data.fieldInfos.reportFields) &&
  141 + Object.entries(data.fieldInfos.reportFields).map(([key, value]) => {
  142 + if (value === 'UN_LOCKED') {
  143 + const obj = find(FIELDS_REPORT_INFO, { field: key });
  144 + fieldInfos.value.reportFields.push(obj?.label);
  145 + }
  146 + });
  147 + !isEmpty(data.fieldInfos.profitAnalysisFields) &&
  148 + Object.entries(data.fieldInfos.profitAnalysisFields).map(([key, value]) => {
  149 + if (value === 'UN_LOCKED') {
  150 + const obj = find(FIELDS_PROFIT_INFO, { field: key });
  151 + fieldInfos.value.profitFields.push(obj?.label);
  152 + }
  153 + });
  154 +
  155 + id.value = data.id;
  156 + baseInfos.value = FIELDS_BASE_INFO.map((field) => {
  157 + return {
  158 + label: field.label,
  159 + value: data.orderBaseInfo[field.field],
  160 + };
  161 + }).filter((item) => !!item.value);
  162 + }
  163 +
  164 + async function handleTrue() {
  165 + await approveAuditApi({ status: 10, id: id.value });
  166 + reload();
  167 + closeDrawer();
  168 + }
  169 +
  170 + async function handleFalse() {
  171 + await approveAuditApi({ status: 20, id: id.value });
  172 + reload();
  173 + closeDrawer();
  174 + }
  175 + return {
  176 + handleProfitModal,
  177 + registerTable,
  178 + checkedKeys,
  179 + currentKey,
  180 + onSelect,
  181 + handleEdit,
  182 + onSelectAll,
  183 + handleDetail,
  184 + registerDrawer,
  185 + fieldInfos,
  186 + baseInfos,
  187 + handleTrue,
  188 + handleFalse,
  189 + };
  190 + },
  191 + });
  192 +</script>
... ...
src/views/project/approve/ProfitPanel.vue
... ... @@ -7,44 +7,67 @@
7 7 <TableAction
8 8 :actions="[
9 9 {
10   - label: '通过',
  10 + label: '详情',
11 11 // icon: 'ic:outline-delete-outline',
12   - onClick: handleTrue.bind(null, record),
13   - },
14   - {
15   - label: '拒绝',
16   - // icon: 'ic:outline-delete-outline',
17   - onClick: handleFalse.bind(null, record),
  12 + onClick: handleDetail.bind(null, record),
18 13 },
19 14 ]"
20 15 />
21 16 </template>
22 17 </template>
23 18 </BasicTable>
  19 + <BasicDrawer
  20 + :showFooter="!isApproved"
  21 + @register="registerDrawer"
  22 + title="申请信息"
  23 + okText="通过"
  24 + @ok="handleTrue"
  25 + >
  26 + <h2>基本信息</h2>
  27 + <div v-for="field in baseInfos" :key="field" className="mb-8">
  28 + <span className="w-[140px] inline-block text-right mr-3">{{ field.label }}:</span
  29 + ><span>{{ field.value }}</span>
  30 + </div>
  31 + <h2>项目报告书信息</h2>
  32 + <div v-for="field in fieldInfos" :key="field">
  33 + <span className="w-[140px] inline-block text-right mr-3">{{ field.label }}:</span
  34 + ><span>{{ field.value }}</span>
  35 + </div>
  36 + <template #appendFooter>
  37 + <a-button @click="handleFalse"> 不通过</a-button>
  38 + </template>
  39 + </BasicDrawer>
24 40 </PageWrapper>
25 41 </template>
26 42 <script lang="ts">
27 43 import { defineComponent, ref } from 'vue';
28 44 import { BasicTable, useTable, TableAction } from '/@/components/Table';
29   - import { Tabs } from 'ant-design-vue';
30 45 import { PageWrapper } from '/@/components/Page';
  46 + import { BasicDrawer, useDrawer } from '/@/components/Drawer';
31 47  
32   - import { approveAuditApi, getWaitListApi } from '/@/api/project/approve';
  48 + import { approveAuditApi, getApprovedListApi, getWaitListApi } from '/@/api/project/approve';
  49 + import { FIELDS_BASE_INFO, FIELDS_PROFIT_INFO, FIELDS_REPORT_INFO } from '../order/tableData';
33 50  
34 51 export default defineComponent({
35 52 components: {
36 53 PageWrapper,
37 54 BasicTable,
  55 + BasicDrawer,
38 56 TableAction,
39   - [Tabs.name]: Tabs,
40   - [Tabs.TabPane.name]: Tabs.TabPane,
41 57 },
42   - setup() {
  58 + props: {
  59 + isApproved: { type: Boolean },
  60 + },
  61 + setup(props) {
43 62 const checkedKeys = ref<Array<string | number>>([]);
44 63 const currentKey = ref('1');
  64 + const [registerDrawer, { openDrawer, closeDrawer }] = useDrawer();
  65 + const fieldInfos = ref({});
  66 + const baseInfos = ref({});
  67 + const id = ref('');
45 68  
46 69 const [registerTable, { reload }] = useTable({
47   - api: getWaitListApi,
  70 + api: props.isApproved ? getApprovedListApi : getWaitListApi,
48 71 searchInfo: { type: 10 },
49 72  
50 73 columns: [
... ... @@ -53,32 +76,6 @@
53 76 dataIndex: 'createBy',
54 77 width: 150,
55 78 },
56   - {
57   - title: '申请字段',
58   - dataIndex: 'fields',
59   - width: 600,
60   - },
61   - {
62   - title: '订单号',
63   - dataIndex: 'no6',
64   - },
65   - {
66   - title: '订单字段1',
67   - dataIndex: 'no5',
68   - },
69   - {
70   - title: '订单字段2',
71   - dataIndex: 'no4',
72   - },
73   - {
74   - title: '订单字段3',
75   - dataIndex: 'no3',
76   - },
77   -
78   - {
79   - title: '订单字段5',
80   - dataIndex: 'no1',
81   - },
82 79 ],
83 80 // useSearchForm: true,
84 81 // formConfig: getFormConfig(),
... ... @@ -115,16 +112,34 @@
115 112  
116 113 function handleProfitModal() {}
117 114  
118   - async function handleTrue(record) {
119   - await approveAuditApi({ status: 10, id: record.id });
120   - reload();
  115 + async function handleDetail(data) {
  116 + openDrawer(true, { data });
  117 + id.value = data.id;
  118 + fieldInfos.value = FIELDS_PROFIT_INFO.map((field) => {
  119 + return {
  120 + label: field.label,
  121 + value: data.fieldInfos.profitAnalysisFields[field.field],
  122 + };
  123 + }).filter((item) => !!item.value);
  124 + baseInfos.value = FIELDS_BASE_INFO.map((field) => {
  125 + return {
  126 + label: field.label,
  127 + value: data.orderBaseInfo[field.field],
  128 + };
  129 + }).filter((item) => !!item.value);
121 130 }
122 131  
123   - async function handleFalse(record) {
124   - await approveAuditApi({ status: 20, id: record.id });
  132 + async function handleTrue() {
  133 + await approveAuditApi({ status: 10, id: id.value });
125 134 reload();
  135 + closeDrawer();
126 136 }
127 137  
  138 + async function handleFalse() {
  139 + await approveAuditApi({ status: 20, id: id.value });
  140 + reload();
  141 + closeDrawer();
  142 + }
128 143 return {
129 144 handleProfitModal,
130 145 registerTable,
... ... @@ -133,6 +148,10 @@
133 148 onSelect,
134 149 handleEdit,
135 150 onSelectAll,
  151 + handleDetail,
  152 + registerDrawer,
  153 + fieldInfos,
  154 + baseInfos,
136 155 handleTrue,
137 156 handleFalse,
138 157 };
... ...
src/views/project/approve/ReportPanel.vue
... ... @@ -7,44 +7,67 @@
7 7 <TableAction
8 8 :actions="[
9 9 {
10   - label: '通过',
  10 + label: '详情',
11 11 // icon: 'ic:outline-delete-outline',
12   - onClick: handleTrue.bind(null, record),
13   - },
14   - {
15   - label: '拒绝',
16   - // icon: 'ic:outline-delete-outline',
17   - onClick: handleFalse.bind(null, record),
  12 + onClick: handleDetail.bind(null, record),
18 13 },
19 14 ]"
20 15 />
21 16 </template>
22 17 </template>
23 18 </BasicTable>
  19 + <BasicDrawer
  20 + :showFooter="!isApproved"
  21 + @register="registerDrawer"
  22 + title="申请信息"
  23 + okText="通过"
  24 + @ok="handleTrue"
  25 + >
  26 + <h2>基本信息</h2>
  27 + <div v-for="field in baseInfos" :key="field" className="mb-8">
  28 + <span className="w-[140px] inline-block text-right mr-3">{{ field.label }}:</span
  29 + ><span>{{ field.value }}</span>
  30 + </div>
  31 + <h2>项目报告书信息</h2>
  32 + <div v-for="field in fieldInfos" :key="field">
  33 + <span className="w-[140px] inline-block text-right mr-3">{{ field.label }}:</span
  34 + ><span>{{ field.value }}</span>
  35 + </div>
  36 + <template #appendFooter>
  37 + <a-button @click="handleFalse"> 不通过</a-button>
  38 + </template>
  39 + </BasicDrawer>
24 40 </PageWrapper>
25 41 </template>
26 42 <script lang="ts">
27 43 import { defineComponent, ref } from 'vue';
28 44 import { BasicTable, useTable, TableAction } from '/@/components/Table';
29   - import { Tabs } from 'ant-design-vue';
30 45 import { PageWrapper } from '/@/components/Page';
  46 + import { BasicDrawer, useDrawer } from '/@/components/Drawer';
31 47  
32   - import { approveAuditApi, getWaitListApi, getApprovedListApi } from '/@/api/project/approve';
  48 + import { approveAuditApi, getApprovedListApi, getWaitListApi } from '/@/api/project/approve';
  49 + import { FIELDS_BASE_INFO, FIELDS_REPORT_INFO } from '../order/tableData';
33 50  
34 51 export default defineComponent({
35 52 components: {
36 53 PageWrapper,
37 54 BasicTable,
  55 + BasicDrawer,
38 56 TableAction,
39   - [Tabs.name]: Tabs,
40   - [Tabs.TabPane.name]: Tabs.TabPane,
41 57 },
42   - setup() {
  58 + props: {
  59 + isApproved: { type: Boolean },
  60 + },
  61 + setup(props) {
43 62 const checkedKeys = ref<Array<string | number>>([]);
44 63 const currentKey = ref('1');
  64 + const [registerDrawer, { openDrawer, closeDrawer }] = useDrawer();
  65 + const fieldInfos = ref({});
  66 + const baseInfos = ref({});
  67 + const id = ref('');
45 68  
46 69 const [registerTable, { reload }] = useTable({
47   - api: getWaitListApi,
  70 + api: props.isApproved ? getApprovedListApi : getWaitListApi,
48 71 searchInfo: { type: 20 },
49 72  
50 73 columns: [
... ... @@ -53,32 +76,6 @@
53 76 dataIndex: 'createBy',
54 77 width: 150,
55 78 },
56   - {
57   - title: '申请字段',
58   - dataIndex: 'fields',
59   - width: 600,
60   - },
61   - {
62   - title: '订单号',
63   - dataIndex: 'no6',
64   - },
65   - {
66   - title: '订单字段1',
67   - dataIndex: 'no5',
68   - },
69   - {
70   - title: '订单字段2',
71   - dataIndex: 'no4',
72   - },
73   - {
74   - title: '订单字段3',
75   - dataIndex: 'no3',
76   - },
77   -
78   - {
79   - title: '订单字段5',
80   - dataIndex: 'no1',
81   - },
82 79 ],
83 80 // useSearchForm: true,
84 81 // formConfig: getFormConfig(),
... ... @@ -115,16 +112,34 @@
115 112  
116 113 function handleProfitModal() {}
117 114  
118   - async function handleTrue(record) {
119   - await approveAuditApi({ status: 10, id: record.id });
120   - reload();
  115 + async function handleDetail(data) {
  116 + openDrawer(true, { data });
  117 + id.value = data.id;
  118 + fieldInfos.value = FIELDS_REPORT_INFO.map((field) => {
  119 + return {
  120 + label: field.label,
  121 + value: data.fieldInfos.reportFields[field.field],
  122 + };
  123 + }).filter((item) => !!item.value);
  124 + baseInfos.value = FIELDS_BASE_INFO.map((field) => {
  125 + return {
  126 + label: field.label,
  127 + value: data.orderBaseInfo[field.field],
  128 + };
  129 + }).filter((item) => !!item.value);
121 130 }
122 131  
123   - async function handleFalse(record) {
124   - await approveAuditApi({ status: 20, id: record.id });
  132 + async function handleTrue() {
  133 + await approveAuditApi({ status: 10, id: id.value });
125 134 reload();
  135 + closeDrawer();
126 136 }
127 137  
  138 + async function handleFalse() {
  139 + await approveAuditApi({ status: 20, id: id.value });
  140 + reload();
  141 + closeDrawer();
  142 + }
128 143 return {
129 144 handleProfitModal,
130 145 registerTable,
... ... @@ -133,6 +148,10 @@
133 148 onSelect,
134 149 handleEdit,
135 150 onSelectAll,
  151 + handleDetail,
  152 + registerDrawer,
  153 + fieldInfos,
  154 + baseInfos,
136 155 handleTrue,
137 156 handleFalse,
138 157 };
... ...
src/views/project/approve/Text.vue 0 → 100644
src/views/project/approve/index.vue
1 1 <template>
2 2 <PageWrapper contentBackground>
3   - <template #footer>
4   - <a-tabs default-active-key="1" v-model:activeKey="currentKey">
5   - <a-tab-pane key="1" tab="申请/待审核列表"
6   - ><BasicTable @register="registerTable1">
7   - <template #form-custom> custom-slot </template>
8   - <template #bodyCell="{ column, record }">
9   - <template v-if="column.key === 'action'">
10   - <TableAction
11   - :actions="[
12   - {
13   - label: '通过',
14   - // icon: 'ic:outline-delete-outline',
15   - onClick: handleTrue.bind(null, record),
16   - },
17   - {
18   - label: '拒绝',
19   - // icon: 'ic:outline-delete-outline',
20   - onClick: handleFalse.bind(null, record),
21   - },
22   - ]"
23   - />
24   - </template>
25   - </template> </BasicTable
26   - ></a-tab-pane>
27   - <a-tab-pane key="2" tab="已审核列表">
28   - <BasicTable @register="registerTable2" />
29   - </a-tab-pane>
30   - <a-tab-pane key="3" tab="利润分析申请">
31   - <ProfitPanel />
32   - </a-tab-pane>
33   - <a-tab-pane key="4" tab="项目报告书申请">
34   - <ReportPanel />
35   - </a-tab-pane>
36   - </a-tabs>
37   - </template>
  3 + <a-tabs default-active-key="1" v-model:activeKey="currentKey">
  4 + <a-tab-pane key="1" tab="字段待审核">
  5 + <FieldPanel />
  6 + </a-tab-pane>
  7 + <a-tab-pane key="2" tab="字段已审核">
  8 + <FieldPanel isApproved />
  9 + </a-tab-pane>
  10 + <a-tab-pane key="3" tab="利润分析待审核">
  11 + <ProfitPanel />
  12 + </a-tab-pane>
  13 + <a-tab-pane key="4" tab="利润分析已审核">
  14 + <ProfitPanel isApproved />
  15 + </a-tab-pane>
  16 + <a-tab-pane key="5" tab="项目报告书待审核">
  17 + <ReportPanel />
  18 + </a-tab-pane>
  19 + <a-tab-pane key="6" tab="项目报告书已审核">
  20 + <ReportPanel isApproved />
  21 + </a-tab-pane>
  22 + </a-tabs>
38 23 </PageWrapper>
39 24 </template>
40 25 <script lang="ts">
... ... @@ -44,6 +29,7 @@
44 29 import { PageWrapper } from '/@/components/Page';
45 30 import ReportPanel from './ReportPanel.vue';
46 31 import ProfitPanel from './ProfitPanel.vue';
  32 + import FieldPanel from './FieldPanel.vue';
47 33 import { approveAuditApi, getWaitListApi, getApprovedListApi } from '/@/api/project/approve';
48 34  
49 35 export default defineComponent({
... ... @@ -54,6 +40,7 @@
54 40 [Tabs.name]: Tabs,
55 41 [Tabs.TabPane.name]: Tabs.TabPane,
56 42 ReportPanel,
  43 + FieldPanel,
57 44 ProfitPanel,
58 45 },
59 46 setup() {
... ... @@ -114,32 +101,11 @@
114 101 dataIndex: 'createBy',
115 102 width: 150,
116 103 },
117   - {
118   - title: '申请字段',
119   - dataIndex: 'fields',
120   - width: 600,
121   - },
122   - {
123   - title: '订单号',
124   - dataIndex: 'no6',
125   - },
126   - {
127   - title: '订单字段1',
128   - dataIndex: 'no5',
129   - },
130   - {
131   - title: '订单字段2',
132   - dataIndex: 'no4',
133   - },
134   - {
135   - title: '订单字段3',
136   - dataIndex: 'no3',
137   - },
138   -
139   - {
140   - title: '订单字段5',
141   - dataIndex: 'no1',
142   - },
  104 + // {
  105 + // title: '申请字段',
  106 + // dataIndex: 'fields',
  107 + // width: 600,
  108 + // },
143 109 ],
144 110 rowKey: 'id',
145 111 });
... ...
src/views/project/order/FormDetail.vue
... ... @@ -13,23 +13,25 @@
13 13 :mask="false"
14 14 class="z-20"
15 15 >
16   - <Tabs v-model:activeKey="activeKey">
17   - <TabPanel key="1" tab="基本信息" :forceRender="true">
18   - <BasicForm @register="registerForm" />
19   - </TabPanel>
20   - <TabPanel key="2" tab="利润分析" :forceRender="true">
21   - <ProfitFormPanel ref="profitFormPanelRef" :id="id" />
22   - </TabPanel>
23   - <TabPanel key="3" tab="项目报告书" :forceRender="true">
24   - <ReportFormPanel ref="reportFormPanelRef" :id="id" />
25   - </TabPanel>
26   - <TabPanel key="4" tab="跟单信息" :forceRender="true">
27   - <TrackFormPanel ref="trackFormPanelRef" :id="id" />
28   - </TabPanel>
29   - <TabPanel key="5" tab="质检信息" :forceRender="true">
30   - <InspectionFormPanel ref="inspectionFormRef" :id="id" />
31   - </TabPanel>
32   - </Tabs>
  16 + <div className="mt-[-16px]">
  17 + <Tabs v-model:activeKey="activeKey">
  18 + <TabPanel key="1" tab="基本信息" :forceRender="true">
  19 + <BaseFormPanel ref="baseFormPanelRef" :id="id" />
  20 + </TabPanel>
  21 + <TabPanel key="2" tab="利润分析" :forceRender="true" v-if="!!id">
  22 + <ProfitFormPanel ref="profitFormPanelRef" :id="id" />
  23 + </TabPanel>
  24 + <TabPanel key="3" tab="项目报告书" :forceRender="true" v-if="!!id">
  25 + <ReportFormPanel ref="reportFormPanelRef" :id="id" />
  26 + </TabPanel>
  27 + <TabPanel key="4" tab="跟单信息" :forceRender="true" v-if="!!id">
  28 + <TrackFormPanel ref="trackFormPanelRef" :id="id" />
  29 + </TabPanel>
  30 + <TabPanel key="5" tab="质检信息" :forceRender="true" v-if="!!id">
  31 + <InspectionFormPanel ref="inspectionFormRef" :id="id" />
  32 + </TabPanel>
  33 + </Tabs>
  34 + </div>
33 35 <!-- <BasicForm @register="registerForm" />
34 36 <BasicForm @register="registerForm" />
35 37 <BasicForm @register="registerForm" /> -->
... ... @@ -53,6 +55,7 @@
53 55 import ReportFormPanel from './component/ReportFormPanel.vue';
54 56 import TrackFormPanel from './component/TrackFormPanel.vue';
55 57 import InspectionFormPanel from './component/InspectionFormPanel.vue';
  58 + import BaseFormPanel from './component/BaseFormPanel.vue';
56 59  
57 60 import { Tabs } from 'ant-design-vue';
58 61  
... ... @@ -62,6 +65,7 @@
62 65 components: {
63 66 BasicDrawer,
64 67 BasicForm,
  68 + BaseFormPanel,
65 69 Tabs,
66 70 TabPanel,
67 71 ProfitFormPanel,
... ... @@ -84,8 +88,9 @@
84 88 const activeKey = ref('1');
85 89 const profitFormPanelRef = ref();
86 90 const reportFormPanelRef = ref();
87   - const trackFormPanelRef = ref(null);
88   - const inspectionFormPanelRef = ref(null);
  91 + const trackFormPanelRef = ref();
  92 + const inspectionFormPanelRef = ref();
  93 + const baseFormPanelRef = ref();
89 94  
90 95 const {
91 96 customerCode,
... ... @@ -119,12 +124,6 @@
119 124 };
120 125  
121 126 const schemas = computed(() => {
122   - console.log(
123   - '%c [ fields?.baseFields ]-134',
124   - 'font-size:13px; background:pink; color:#bf2c9f;',
125   - fields?.baseFields,
126   - );
127   -
128 127 return [
129 128 {
130 129 field: 'baseInfo.customerCode',
... ... @@ -376,7 +375,7 @@
376 375 id.value = '';
377 376 picUrl.value = '';
378 377 // 新建
379   - resetFields();
  378 + baseFormPanelRef?.value?.resetFields();
380 379 profitFormPanelRef?.value?.resetFields();
381 380 reportFormPanelRef?.value?.resetFields();
382 381 trackFormPanelRef?.value?.resetFields();
... ... @@ -402,62 +401,69 @@
402 401 setFieldsValue({
403 402 baseInfo: { ...toRaw(data) },
404 403 });
  404 + setTimeout(() => {
  405 + baseFormPanelRef.value.fields = { ...data.lockFields?.baseFields } || {};
  406 + baseFormPanelRef.value.setFieldsValue({
  407 + ...toRaw(data),
  408 + });
405 409  
406   - profitFormPanelRef.value.fields = { ...data.lockFields?.profitAnalysisFields } || {};
407   -
408   - profitFormPanelRef?.value?.setFieldsValue({
409   - ...toRaw(data.profitAnalysisInfo),
410   - });
  410 + profitFormPanelRef.value.fields = { ...data.lockFields?.profitAnalysisFields } || {};
  411 + profitFormPanelRef?.value?.setFieldsValue({
  412 + ...toRaw(data.profitAnalysisInfo),
  413 + });
411 414  
412   - reportFormPanelRef.value.fields = { ...data.lockFields?.reportFields } || {};
413   - reportFormPanelRef?.value?.setFieldsValue({
414   - ...toRaw(data.reportInfo),
415   - });
  415 + reportFormPanelRef.value.fields = { ...data.lockFields?.reportFields } || {};
  416 + reportFormPanelRef?.value?.setFieldsValue({
  417 + ...toRaw(data.reportInfo),
  418 + });
  419 + }, 100);
416 420 } else {
417 421 setFieldsValue({});
418 422 }
419 423 });
420 424  
421 425 const handleSubmit = async () => {
422   - const values = getFieldsValue() || {};
423   -
424   - values.baseInfo = {
425   - ...values.baseInfo,
426   - picUrl: picUrl?.value || '',
427   - };
428 426 if (id.value) {
429 427 const forms = { orderId: id.value } as any;
430 428 if (activeKey.value === '1') {
431   - forms.baseInfo = { ...values.baseInfo };
  429 + forms.baseInfo = baseFormPanelRef?.value?.getFieldsValue() || {};
432 430 } else if (activeKey.value === '2') {
433   - const v = profitFormPanelRef?.value?.getFieldsValue() || {};
434   - forms.profitAnalysisInfo = { ...v };
  431 + forms.profitAnalysisInfo = profitFormPanelRef?.value?.getFieldsValue() || {};
435 432 } else if (activeKey.value === '3') {
436   - const v = reportFormPanelRef?.value?.getFieldsValue() || {};
437   - forms.reportInfo = { ...v };
  433 + forms.reportInfo = reportFormPanelRef?.value?.getFieldsValue() || {};
438 434 }
439 435  
440 436 await orderUpdate(forms);
441 437 } else {
442   - const v2 = profitFormPanelRef?.value?.getFieldsValue() || {};
443   - const v3 = reportFormPanelRef?.value?.getFieldsValue() || {};
444   - const v4 = trackFormPanelRef?.value?.getFieldsValue() || {};
445   - const v5 = inspectionFormPanelRef?.value?.getFieldsValue() || {};
  438 + // const v2 = profitFormPanelRef?.value?.getFieldsValue() || {};
  439 + // const v3 = reportFormPanelRef?.value?.getFieldsValue() || {};
  440 + // const v4 = trackFormPanelRef?.value?.getFieldsValue() || {};
  441 + // const v5 = inspectionFormPanelRef?.value?.getFieldsValue() || {};
  442 +
  443 + // values.profitAnalysisInfo = { ...v2 };
  444 + // values.reportInfo = { ...v3 };
  445 + // values.trackStageInfo = { ...v4 };
  446 + // values.inspectionStageInfo = { ...v5 };
  447 + const values = baseFormPanelRef?.value?.getFieldsValue() || {};
446 448  
447   - values.profitAnalysisInfo = { ...v2 };
448   - values.reportInfo = { ...v3 };
449   - values.trackStageInfo = { ...v4 };
450   - values.inspectionStageInfo = { ...v5 };
451   - await orderCreate(values);
  449 + const forms = {
  450 + baseInfo: {
  451 + ...values,
  452 + picUrl: baseFormPanelRef?.value?.picUrl || '',
  453 + smallPicUrl: baseFormPanelRef?.value?.smallPicUrl || '',
  454 + },
  455 + };
  456 + await orderCreate(forms);
452 457 }
453 458 closeDrawer();
454   - // emit('success', {});
  459 + emit('success', {});
455 460 };
456 461 return {
457 462 id,
458 463 profitFormPanelRef,
459 464 reportFormPanelRef,
460 465 trackFormPanelRef,
  466 + baseFormPanelRef,
461 467 inspectionFormPanelRef,
462 468 activeKey,
463 469 formRef,
... ... @@ -470,7 +476,7 @@
470 476 });
471 477 </script>
472 478  
473   -<style>
  479 +<style scoped>
474 480 .ant-drawer {
475 481 position: fixed;
476 482 z-index: 9999;
... ...
src/views/project/order/component/BaseFormPanel.vue 0 → 100644
  1 +<template>
  2 + <BasicForm @register="registerForm" />
  3 +</template>
  4 +<script lang="ts">
  5 + import { computed, defineComponent, ref } from 'vue';
  6 + import { BasicForm, useForm } from '/@/components/Form/index';
  7 + import { FIELDS_BASE_INFO } from '../tableData';
  8 + import { getDisable } from '/@/utils/project';
  9 + import { useOrderStoreWithOut } from '/@/store/modules/order';
  10 +
  11 + import { useOrderInfo } from '/@/hooks/component/order';
  12 +
  13 + export default defineComponent({
  14 + components: { BasicForm },
  15 +
  16 + props: {
  17 + detailData: {
  18 + type: Object,
  19 + },
  20 + onGoCheckDetail: {
  21 + type: Function,
  22 + },
  23 + id: {
  24 + type: String,
  25 + },
  26 + },
  27 + emits: ['success'],
  28 + setup(props) {
  29 + let fields = ref({});
  30 + const picUrl = ref('');
  31 + const smallPicUrl = ref('');
  32 +
  33 + const orderStore = useOrderStoreWithOut();
  34 + const {
  35 + customerCode,
  36 + projectNo,
  37 + productionDepartment,
  38 + innerNo,
  39 + poColor,
  40 + cnColor,
  41 + productStyle,
  42 + outboundType,
  43 + packetType,
  44 + } = useOrderInfo(orderStore);
  45 +
  46 + const schemas = computed(() => {
  47 + const options = {
  48 + customerCode,
  49 + projectNo,
  50 + productionDepartment,
  51 + innerNo,
  52 + poColor,
  53 + cnColor,
  54 + productStyle,
  55 + outboundType,
  56 + packetType,
  57 + };
  58 +
  59 + const res = FIELDS_BASE_INFO.map((item) => {
  60 + if (item.field === 'picUrl') {
  61 + return {
  62 + field: 'picUrl',
  63 + component: 'FieldUpload',
  64 + label: '图片',
  65 + rules: [{ required: true }],
  66 + colProps: {
  67 + span: 24,
  68 + },
  69 + componentProps: {
  70 + imgUrl: picUrl,
  71 + disabled: getDisable(fields.value?.baseFields?.picUrl),
  72 + onChange: (res) => {
  73 + if (res.file?.response?.data) {
  74 + picUrl.value = res.file?.response?.data?.picUrl;
  75 + smallPicUrl.value = res.file?.response?.data?.smallPicUrl;
  76 + }
  77 + },
  78 + },
  79 + };
  80 + }
  81 + return {
  82 + ...item,
  83 + field: `${item.field}`,
  84 + componentProps: {
  85 + ...(item.component === 'Select' && { options: options[item.field] }),
  86 + disabled: getDisable(fields.value[item.field], props.id),
  87 + },
  88 + colProps: {
  89 + span: 24,
  90 + },
  91 + };
  92 + });
  93 + return res;
  94 + });
  95 +
  96 + const [registerForm, { setFieldsValue, getFieldsValue, resetFields }] = useForm({
  97 + labelWidth: 120,
  98 + schemas,
  99 + showActionButtonGroup: false,
  100 + actionColOptions: {
  101 + span: 24,
  102 + },
  103 + });
  104 +
  105 + return {
  106 + fields,
  107 + schemas,
  108 + registerForm,
  109 + getFieldsValue,
  110 + setFieldsValue,
  111 + resetFields,
  112 + picUrl,
  113 + smallPicUrl,
  114 + };
  115 + },
  116 + });
  117 +</script>
... ...
src/views/project/order/tableData.tsx
... ... @@ -383,6 +383,12 @@ export const FIELDS_BASE_INFO = [
383 383 rules: [{ required: true }],
384 384 },
385 385 {
  386 + field: 'modeleLo',
  387 + component: 'Input',
  388 + label: 'Modelo(REFERENCE)',
  389 + rules: [{ required: true }],
  390 + },
  391 + {
386 392 field: 'innerNo',
387 393 component: 'Select',
388 394 label: '内部编号',
... ... @@ -666,7 +672,7 @@ export const FIELDS_PROFIT_INFO = [
666 672 {
667 673 field: 'productionDepartmentPrice',
668 674 component: 'InputNumber',
669   - label: '生成科单价',
  675 + label: '生成科单价',
670 676 rules: [{ required: true }],
671 677 },
672 678 // {
... ... @@ -682,7 +688,7 @@ export const FIELDS_PROFIT_INFO = [
682 688 // rules: [{ required: true }],
683 689 // },
684 690 {
685   - label: '包装费用合计$',
  691 + label: '包装费用合计',
686 692 component: 'InputNumber',
687 693 field: 'packetTotalPrice',
688 694 rules: [{ required: true }],
... ...