Commit 16f449811fcb69a9a0a2a3c84ca1dcdab2e5bde5
1 parent
c04647c3
feat: finish
Showing
32 changed files
with
1357 additions
and
1204 deletions
src/api/demo/table.ts
1 | import { defHttp } from '/@/utils/http/axios'; | 1 | import { defHttp } from '/@/utils/http/axios'; |
2 | import { DemoParams, DemoListGetResultModel } from './model/tableModel'; | 2 | import { DemoParams, DemoListGetResultModel } from './model/tableModel'; |
3 | import { find } from 'lodash-es'; | 3 | import { find } from 'lodash-es'; |
4 | -import { FIELDS_BASE_INFO } from '/@/views/project/order/tableData'; | 4 | +import { FIELDS_BASE_INFO } from '../../views/project/order/constant'; |
5 | 5 | ||
6 | enum Api { | 6 | enum Api { |
7 | DEMO_LIST = '/table/getDemoList', | 7 | DEMO_LIST = '/table/getDemoList', |
src/api/project/approve.ts
@@ -4,7 +4,7 @@ import { | @@ -4,7 +4,7 @@ import { | ||
4 | FIELDS_BASE_INFO, | 4 | FIELDS_BASE_INFO, |
5 | FIELDS_PROFIT_INFO, | 5 | FIELDS_PROFIT_INFO, |
6 | FIELDS_REPORT_INFO, | 6 | FIELDS_REPORT_INFO, |
7 | -} from '/@/views/project/order/tableData'; | 7 | +} from '../../views/project/order/constant'; |
8 | 8 | ||
9 | enum Api { | 9 | enum Api { |
10 | APPROVE = '/order/erp/audit/wait_audit_list', | 10 | APPROVE = '/order/erp/audit/wait_audit_list', |
src/api/project/order.ts
@@ -19,6 +19,9 @@ enum Api { | @@ -19,6 +19,9 @@ enum Api { | ||
19 | DICT_LIST = '/order/erp/dictionary/list_by_page', | 19 | DICT_LIST = '/order/erp/dictionary/list_by_page', |
20 | 20 | ||
21 | ANALYSIS = '/order/erp/profit/analysis', | 21 | ANALYSIS = '/order/erp/profit/analysis', |
22 | + | ||
23 | + OPT_LOG = '/order/erp/opt/log/list_by_page', // 操作日志 | ||
24 | + AUDIT_LOG = '/order/erp/audit/log/list_by_page', //审批日志 | ||
22 | } | 25 | } |
23 | 26 | ||
24 | export const orderCreate = async (data: any) => { | 27 | export const orderCreate = async (data: any) => { |
@@ -26,6 +29,14 @@ export const orderCreate = async (data: any) => { | @@ -26,6 +29,14 @@ export const orderCreate = async (data: any) => { | ||
26 | return res; | 29 | return res; |
27 | }; | 30 | }; |
28 | 31 | ||
32 | +export const getOrderOptLog = async (data: any) => { | ||
33 | + return defHttp.post<any>({ url: Api.OPT_LOG, data }); | ||
34 | +}; | ||
35 | + | ||
36 | +export const getOrderAuditLog = async (data: any) => { | ||
37 | + return defHttp.post<any>({ url: Api.AUDIT_LOG, data }); | ||
38 | +}; | ||
39 | + | ||
29 | export const orderUpdate = async (data: any) => { | 40 | export const orderUpdate = async (data: any) => { |
30 | const res = await defHttp.post<any>({ url: Api.UPDATE, data }, { message: '操作成功' }); | 41 | const res = await defHttp.post<any>({ url: Api.UPDATE, data }, { message: '操作成功' }); |
31 | return res; | 42 | return res; |
src/components/FieldUpload/src/FieldUpload.vue
1 | <template> | 1 | <template> |
2 | + <img :src="imgUrl" v-if="disableImg" width="100" height="100" /> | ||
2 | <Upload | 3 | <Upload |
4 | + v-else | ||
3 | v-model:file-list="fileList" | 5 | v-model:file-list="fileList" |
4 | name="file" | 6 | name="file" |
5 | list-type="picture-card" | 7 | list-type="picture-card" |
@@ -18,7 +20,7 @@ | @@ -18,7 +20,7 @@ | ||
18 | </Upload> | 20 | </Upload> |
19 | </template> | 21 | </template> |
20 | <script lang="ts" setup> | 22 | <script lang="ts" setup> |
21 | - import { defineProps, ref } from 'vue'; | 23 | + import { defineProps, ref, watch } from 'vue'; |
22 | 24 | ||
23 | import { Upload, message } from 'ant-design-vue'; | 25 | import { Upload, message } from 'ant-design-vue'; |
24 | import { PlusOutlined, LoadingOutlined } from '@ant-design/icons-vue'; | 26 | import { PlusOutlined, LoadingOutlined } from '@ant-design/icons-vue'; |
@@ -26,8 +28,15 @@ | @@ -26,8 +28,15 @@ | ||
26 | 28 | ||
27 | const props = defineProps({ | 29 | const props = defineProps({ |
28 | imgUrl: String, // 期望 'value' 是一个字符串。根据您的需求调整类型。 | 30 | imgUrl: String, // 期望 'value' 是一个字符串。根据您的需求调整类型。 |
31 | + disabled: Boolean, | ||
29 | }); | 32 | }); |
30 | - console.log('%c [ props ]-29', 'font-size:13px; background:pink; color:#bf2c9f;', props); | 33 | + const disableImg = ref(false); |
34 | + watch( | ||
35 | + () => props.disabled, | ||
36 | + (newValue) => { | ||
37 | + disableImg.value = newValue; | ||
38 | + }, | ||
39 | + ); | ||
31 | 40 | ||
32 | function getBase64(img: Blob, callback: (base64Url: string) => void) { | 41 | function getBase64(img: Blob, callback: (base64Url: string) => void) { |
33 | const reader = new FileReader(); | 42 | const reader = new FileReader(); |
@@ -41,7 +50,6 @@ | @@ -41,7 +50,6 @@ | ||
41 | 50 | ||
42 | const fileList = ref([]); | 51 | const fileList = ref([]); |
43 | const loading = ref<boolean>(false); | 52 | const loading = ref<boolean>(false); |
44 | - const imageUrl = ref<string>(''); | ||
45 | 53 | ||
46 | const handleChange = (info: UploadChangeParam) => { | 54 | const handleChange = (info: UploadChangeParam) => { |
47 | // if (info.file.status === 'uploading') { | 55 | // if (info.file.status === 'uploading') { |
src/components/Table/src/components/settings/ColumnSetting.vue
@@ -24,13 +24,14 @@ | @@ -24,13 +24,14 @@ | ||
24 | {{ t('component.table.settingIndexColumnShow') }} | 24 | {{ t('component.table.settingIndexColumnShow') }} |
25 | </Checkbox> --> | 25 | </Checkbox> --> |
26 | 26 | ||
27 | - <Checkbox | 27 | + <!-- <Checkbox |
28 | v-model:checked="checkSelect" | 28 | v-model:checked="checkSelect" |
29 | @change="handleSelectCheckChange" | 29 | @change="handleSelectCheckChange" |
30 | :disabled="!defaultRowSelection" | 30 | :disabled="!defaultRowSelection" |
31 | > | 31 | > |
32 | {{ t('component.table.settingSelectColumnShow') }} | 32 | {{ t('component.table.settingSelectColumnShow') }} |
33 | - </Checkbox> | 33 | + </Checkbox> --> |
34 | + <span></span> | ||
34 | 35 | ||
35 | <a-button size="small" type="link" @click="reset"> | 36 | <a-button size="small" type="link" @click="reset"> |
36 | {{ t('common.resetText') }} | 37 | {{ t('common.resetText') }} |
@@ -109,6 +110,7 @@ | @@ -109,6 +110,7 @@ | ||
109 | nextTick, | 110 | nextTick, |
110 | unref, | 111 | unref, |
111 | computed, | 112 | computed, |
113 | + onMounted, | ||
112 | } from 'vue'; | 114 | } from 'vue'; |
113 | import { Tooltip, Popover, Checkbox, Divider } from 'ant-design-vue'; | 115 | import { Tooltip, Popover, Checkbox, Divider } from 'ant-design-vue'; |
114 | import type { CheckboxChangeEvent } from 'ant-design-vue/lib/checkbox/interface'; | 116 | import type { CheckboxChangeEvent } from 'ant-design-vue/lib/checkbox/interface'; |
@@ -124,6 +126,9 @@ | @@ -124,6 +126,9 @@ | ||
124 | import { cloneDeep, omit } from 'lodash-es'; | 126 | import { cloneDeep, omit } from 'lodash-es'; |
125 | import Sortablejs from 'sortablejs'; | 127 | import Sortablejs from 'sortablejs'; |
126 | import type Sortable from 'sortablejs'; | 128 | import type Sortable from 'sortablejs'; |
129 | + import { getAuthCache, setAuthCache } from '/@/utils/auth'; | ||
130 | + | ||
131 | + import { ORDER_COLUMN } from '/@/enums/cacheEnum'; | ||
127 | 132 | ||
128 | interface State { | 133 | interface State { |
129 | checkAll: boolean; | 134 | checkAll: boolean; |
@@ -133,6 +138,7 @@ | @@ -133,6 +138,7 @@ | ||
133 | } | 138 | } |
134 | 139 | ||
135 | interface Options { | 140 | interface Options { |
141 | + children: any; | ||
136 | label: string; | 142 | label: string; |
137 | value: string; | 143 | value: string; |
138 | fixed?: boolean | 'left' | 'right'; | 144 | fixed?: boolean | 'left' | 'right'; |
@@ -188,17 +194,37 @@ | @@ -188,17 +194,37 @@ | ||
188 | return unref(table?.getBindValues) || {}; | 194 | return unref(table?.getBindValues) || {}; |
189 | }); | 195 | }); |
190 | 196 | ||
197 | + onMounted(() => { | ||
198 | + init(); | ||
199 | + }); | ||
200 | + | ||
191 | watchEffect(() => { | 201 | watchEffect(() => { |
192 | const columns = table.getColumns(); | 202 | const columns = table.getColumns(); |
193 | - setTimeout(() => { | 203 | + |
204 | + setTimeout(async () => { | ||
194 | if (isSetColumnsFromThis) { | 205 | if (isSetColumnsFromThis) { |
195 | isSetColumnsFromThis = false; | 206 | isSetColumnsFromThis = false; |
196 | } else if (columns.length) { | 207 | } else if (columns.length) { |
197 | - init(); | 208 | + updateColumns(); |
209 | + | ||
210 | + // setTimeout(() => { | ||
211 | + // const cacheColumns = getAuthCache(ORDER_COLUMN); | ||
212 | + // setColumns(cacheColumns); | ||
213 | + // }, 1000); | ||
198 | } | 214 | } |
199 | }, 0); | 215 | }, 0); |
200 | }); | 216 | }); |
201 | 217 | ||
218 | + // onMounted(() => { | ||
219 | + // const cacheColumns = getAuthCache(ORDER_COLUMN); | ||
220 | + // console.log( | ||
221 | + // '%c [ cacheColumns ]-210', | ||
222 | + // 'font-size:13px; background:pink; color:#bf2c9f;', | ||
223 | + // cacheColumns, | ||
224 | + // ); | ||
225 | + // setColumns(cacheColumns); | ||
226 | + // }); | ||
227 | + | ||
202 | watchEffect(() => { | 228 | watchEffect(() => { |
203 | const values = unref(getValues); | 229 | const values = unref(getValues); |
204 | if (isSetPropsFromThis) { | 230 | if (isSetPropsFromThis) { |
@@ -222,17 +248,64 @@ | @@ -222,17 +248,64 @@ | ||
222 | return ret; | 248 | return ret; |
223 | } | 249 | } |
224 | 250 | ||
225 | - async function init(isReset = false) { | 251 | + async function init() { |
252 | + plainOptions.value = []; | ||
253 | + | ||
254 | + // 获取所有列并设置 plainOptions | ||
255 | + const allColumns = getColumns(); | ||
256 | + table.setCacheColumns?.(allColumns); | ||
257 | + | ||
258 | + plainSortOptions.value = allColumns; | ||
259 | + plainOptions.value = allColumns | ||
260 | + .map((item) => { | ||
261 | + if (item.children) { | ||
262 | + return item.children.map((item) => ({ | ||
263 | + ...item, | ||
264 | + label: item.title, | ||
265 | + value: item.dataIndex || item.title, | ||
266 | + })); | ||
267 | + } | ||
268 | + return item; | ||
269 | + }) | ||
270 | + .flat(); | ||
271 | + | ||
272 | + // 从缓存中获取选中的列 | ||
273 | + const cacheColumns = | ||
274 | + getAuthCache(ORDER_COLUMN) || | ||
275 | + (allColumns | ||
276 | + .map((item) => { | ||
277 | + if (item.children) { | ||
278 | + return item.children.map((item) => { | ||
279 | + if (item.defaultHidden) { | ||
280 | + return ''; | ||
281 | + } | ||
282 | + return item.dataIndex || item.title; | ||
283 | + }); | ||
284 | + } else { | ||
285 | + if (item.defaultHidden) { | ||
286 | + return ''; | ||
287 | + } | ||
288 | + return item.dataIndex || item.title; | ||
289 | + } | ||
290 | + }) | ||
291 | + .flat() | ||
292 | + .filter(Boolean) as string[]); | ||
293 | + | ||
294 | + state.checkedList = cacheColumns; | ||
295 | + setColumns(cacheColumns); | ||
296 | + } | ||
297 | + | ||
298 | + async function updateColumns(isReset = false) { | ||
226 | // Sortablejs存在bug,不知道在哪个步骤中会向el append了一个childNode,因此这里先清空childNode | 299 | // Sortablejs存在bug,不知道在哪个步骤中会向el append了一个childNode,因此这里先清空childNode |
227 | // 有可能复现上述问题的操作:拖拽一个元素,快速的上下移动,最后放到最后的位置中松手 | 300 | // 有可能复现上述问题的操作:拖拽一个元素,快速的上下移动,最后放到最后的位置中松手 |
228 | - plainOptions.value = []; | ||
229 | - const columnListEl = unref(columnListRef); | ||
230 | - if (columnListEl && (columnListEl as any).$el) { | ||
231 | - const el = (columnListEl as any).$el as Element; | ||
232 | - Array.from(el.children).forEach((item) => el.removeChild(item)); | ||
233 | - } | ||
234 | - await nextTick(); | ||
235 | - const columns = isReset ? cloneDeep(cachePlainOptions.value) : getColumns(); | 301 | + |
302 | + // const columnListEl = unref(columnListRef); | ||
303 | + // if (columnListEl && (columnListEl as any).$el) { | ||
304 | + // const el = (columnListEl as any).$el as Element; | ||
305 | + // Array.from(el.children).forEach((item) => el.removeChild(item)); | ||
306 | + // } | ||
307 | + // await nextTick(); | ||
308 | + // const columns = isReset ? cloneDeep(cachePlainOptions.value) : getColumns(); | ||
236 | 309 | ||
237 | const checkList = table | 310 | const checkList = table |
238 | .getColumns({ ignoreAction: true, ignoreIndex: true }) | 311 | .getColumns({ ignoreAction: true, ignoreIndex: true }) |
@@ -254,28 +327,17 @@ | @@ -254,28 +327,17 @@ | ||
254 | .flat() | 327 | .flat() |
255 | .filter(Boolean) as string[]; | 328 | .filter(Boolean) as string[]; |
256 | 329 | ||
257 | - // plainOptions.value = columns; | ||
258 | - plainSortOptions.value = columns; | ||
259 | - plainOptions.value = columns | ||
260 | - .map((item) => { | ||
261 | - if (item.children) { | ||
262 | - return item.children.map((item) => ({ | ||
263 | - ...item, | ||
264 | - label: item.title, | ||
265 | - value: item.dataIndex || item.title, | ||
266 | - })); | ||
267 | - } | ||
268 | - return item; | ||
269 | - }) | ||
270 | - .flat(); | ||
271 | // 更新缓存配置 | 330 | // 更新缓存配置 |
272 | - table.setCacheColumns?.(columns); | ||
273 | - !isReset && (cachePlainOptions.value = cloneDeep(columns)); | ||
274 | - state.defaultCheckList = checkList; | 331 | + // !isReset && (cachePlainOptions.value = cloneDeep(columns)); |
332 | + // setColumns(cacheColumns); | ||
333 | + // state.defaultCheckList = checkList; | ||
275 | state.checkedList = checkList; | 334 | state.checkedList = checkList; |
276 | // 是否列展示全选 | 335 | // 是否列展示全选 |
277 | - state.checkAll = checkList.length === columns.length; | 336 | + // state.checkAll = checkList.length === columns.length; |
278 | inited = false; | 337 | inited = false; |
338 | + | ||
339 | + setColumns(checkList); | ||
340 | + | ||
279 | handleVisibleChange(); | 341 | handleVisibleChange(); |
280 | } | 342 | } |
281 | 343 | ||
@@ -330,7 +392,7 @@ | @@ -330,7 +392,7 @@ | ||
330 | // reset columns | 392 | // reset columns |
331 | function reset() { | 393 | function reset() { |
332 | setColumns(cachePlainOptions.value); | 394 | setColumns(cachePlainOptions.value); |
333 | - init(true); | 395 | + updateColumns(true); |
334 | checkIndex.value = !!cacheTableProps.showIndexColumn; | 396 | checkIndex.value = !!cacheTableProps.showIndexColumn; |
335 | checkSelect.value = !!cacheTableProps.rowSelection; | 397 | checkSelect.value = !!cacheTableProps.rowSelection; |
336 | table.setProps({ | 398 | table.setProps({ |
@@ -371,6 +433,7 @@ | @@ -371,6 +433,7 @@ | ||
371 | } | 433 | } |
372 | 434 | ||
373 | plainSortOptions.value = columns; | 435 | plainSortOptions.value = columns; |
436 | + | ||
374 | setColumns(columns.filter((item) => state.checkedList.includes(item.value))); | 437 | setColumns(columns.filter((item) => state.checkedList.includes(item.value))); |
375 | }, | 438 | }, |
376 | }); | 439 | }); |
@@ -420,6 +483,7 @@ | @@ -420,6 +483,7 @@ | ||
420 | } | 483 | } |
421 | 484 | ||
422 | function setColumns(columns: BasicColumn[] | string[]) { | 485 | function setColumns(columns: BasicColumn[] | string[]) { |
486 | + setAuthCache(ORDER_COLUMN, columns); | ||
423 | isSetPropsFromThis = true; | 487 | isSetPropsFromThis = true; |
424 | isSetColumnsFromThis = true; | 488 | isSetColumnsFromThis = true; |
425 | 489 |
src/enums/cacheEnum.ts
@@ -25,6 +25,8 @@ export const APP_LOCAL_CACHE_KEY = 'COMMON__LOCAL__KEY__'; | @@ -25,6 +25,8 @@ export const APP_LOCAL_CACHE_KEY = 'COMMON__LOCAL__KEY__'; | ||
25 | // base global session key | 25 | // base global session key |
26 | export const APP_SESSION_CACHE_KEY = 'COMMON__SESSION__KEY__'; | 26 | export const APP_SESSION_CACHE_KEY = 'COMMON__SESSION__KEY__'; |
27 | 27 | ||
28 | +export const ORDER_COLUMN = 'ORDER_COLUMN'; | ||
29 | + | ||
28 | export enum CacheTypeEnum { | 30 | export enum CacheTypeEnum { |
29 | SESSION, | 31 | SESSION, |
30 | LOCAL, | 32 | LOCAL, |
src/layouts/default/header/index.vue
@@ -49,7 +49,7 @@ | @@ -49,7 +49,7 @@ | ||
49 | /> --> | 49 | /> --> |
50 | 50 | ||
51 | <UserDropDown :theme="getHeaderTheme" /> | 51 | <UserDropDown :theme="getHeaderTheme" /> |
52 | - | 52 | + <span className="text-gray-900">{{ nickName }}</span> |
53 | <!-- <SettingDrawer v-if="getShowSetting" :class="`${prefixCls}-action__item`" /> --> | 53 | <!-- <SettingDrawer v-if="getShowSetting" :class="`${prefixCls}-action__item`" /> --> |
54 | </div> | 54 | </div> |
55 | </Header> | 55 | </Header> |
@@ -77,6 +77,9 @@ | @@ -77,6 +77,9 @@ | ||
77 | 77 | ||
78 | import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'; | 78 | import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'; |
79 | import { useLocale } from '/@/locales/useLocale'; | 79 | import { useLocale } from '/@/locales/useLocale'; |
80 | + import { useUserStoreWithOut } from '/@/store/modules/user'; | ||
81 | + | ||
82 | + const userStore = useUserStoreWithOut(); | ||
80 | 83 | ||
81 | export default defineComponent({ | 84 | export default defineComponent({ |
82 | name: 'LayoutHeader', | 85 | name: 'LayoutHeader', |
@@ -167,6 +170,10 @@ | @@ -167,6 +170,10 @@ | ||
167 | return unref(getSplit) ? MenuModeEnum.HORIZONTAL : null; | 170 | return unref(getSplit) ? MenuModeEnum.HORIZONTAL : null; |
168 | }); | 171 | }); |
169 | 172 | ||
173 | + const nickName = computed(() => { | ||
174 | + return userStore.getUserInfo?.nickName; | ||
175 | + }); | ||
176 | + | ||
170 | return { | 177 | return { |
171 | prefixCls, | 178 | prefixCls, |
172 | getHeaderClass, | 179 | getHeaderClass, |
@@ -189,6 +196,7 @@ | @@ -189,6 +196,7 @@ | ||
189 | getShowSettingButton, | 196 | getShowSettingButton, |
190 | getShowSetting, | 197 | getShowSetting, |
191 | getShowSearch, | 198 | getShowSearch, |
199 | + nickName, | ||
192 | }; | 200 | }; |
193 | }, | 201 | }, |
194 | }); | 202 | }); |
src/store/modules/user.ts
@@ -92,8 +92,11 @@ export const useUserStore = defineStore({ | @@ -92,8 +92,11 @@ export const useUserStore = defineStore({ | ||
92 | const { mode, ...loginParams } = params; | 92 | const { mode, ...loginParams } = params; |
93 | const data = await loginApi(loginParams, mode); | 93 | const data = await loginApi(loginParams, mode); |
94 | const { token, user } = data; | 94 | const { token, user } = data; |
95 | + console.log('%c [ user ]-95', 'font-size:13px; background:pink; color:#bf2c9f;', user); | ||
95 | 96 | ||
96 | this.setToken(token); | 97 | this.setToken(token); |
98 | + this.setUserInfo(user); | ||
99 | + | ||
97 | // this.setToken( | 100 | // this.setToken( |
98 | // 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImF1dGgiOiJkZXB0OmVkaXQsdXNlcjpsaXN0LHJvbGVzOmFkZCx1c2VyOmFkZCxkZXB0OmFkZCxtZW51OmRlbCxyb2xlczpkZWwsbWVudTplZGl0LG1lbnU6bGlzdCxzdG9yYWdlOmxpc3Qsam9iOmVkaXQscm9sZXM6bGlzdCx1c2VyOmRlbCxkaWN0OmFkZCxkZXB0Omxpc3QsbWVudTphZGQsam9iOmRlbCxqb2I6bGlzdCx1c2VyOmVkaXQscm9sZXM6ZWRpdCxkaWN0OmRlbCxqb2I6YWRkLGRpY3Q6ZWRpdCxkZXB0OmRlbCIsImV4cCI6MTY5NjE0NTUzN30.Q9hcwnG9uJP3HHjwpd_3ZrV7LrZlMIL6JJBe0rcfqldE8SPq8JkBKElrGeu7GoCAc5EyN6wUUYcriwV5VhpZqQ', | 101 | // 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImF1dGgiOiJkZXB0OmVkaXQsdXNlcjpsaXN0LHJvbGVzOmFkZCx1c2VyOmFkZCxkZXB0OmFkZCxtZW51OmRlbCxyb2xlczpkZWwsbWVudTplZGl0LG1lbnU6bGlzdCxzdG9yYWdlOmxpc3Qsam9iOmVkaXQscm9sZXM6bGlzdCx1c2VyOmRlbCxkaWN0OmFkZCxkZXB0Omxpc3QsbWVudTphZGQsam9iOmRlbCxqb2I6bGlzdCx1c2VyOmVkaXQscm9sZXM6ZWRpdCxkaWN0OmRlbCxqb2I6YWRkLGRpY3Q6ZWRpdCxkZXB0OmRlbCIsImV4cCI6MTY5NjE0NTUzN30.Q9hcwnG9uJP3HHjwpd_3ZrV7LrZlMIL6JJBe0rcfqldE8SPq8JkBKElrGeu7GoCAc5EyN6wUUYcriwV5VhpZqQ', |
99 | // ); | 102 | // ); |
src/utils/cache/persistent.ts
@@ -13,6 +13,7 @@ import { | @@ -13,6 +13,7 @@ import { | ||
13 | APP_LOCAL_CACHE_KEY, | 13 | APP_LOCAL_CACHE_KEY, |
14 | APP_SESSION_CACHE_KEY, | 14 | APP_SESSION_CACHE_KEY, |
15 | MULTIPLE_TABS_KEY, | 15 | MULTIPLE_TABS_KEY, |
16 | + ORDER_COLUMN, | ||
16 | } from '/@/enums/cacheEnum'; | 17 | } from '/@/enums/cacheEnum'; |
17 | import { DEFAULT_CACHE_TIME } from '/@/settings/encryptionSetting'; | 18 | import { DEFAULT_CACHE_TIME } from '/@/settings/encryptionSetting'; |
18 | import { toRaw } from 'vue'; | 19 | import { toRaw } from 'vue'; |
@@ -25,6 +26,7 @@ interface BasicStore { | @@ -25,6 +26,7 @@ interface BasicStore { | ||
25 | [LOCK_INFO_KEY]: LockInfo; | 26 | [LOCK_INFO_KEY]: LockInfo; |
26 | [PROJ_CFG_KEY]: ProjectConfig; | 27 | [PROJ_CFG_KEY]: ProjectConfig; |
27 | [MULTIPLE_TABS_KEY]: RouteLocationNormalized[]; | 28 | [MULTIPLE_TABS_KEY]: RouteLocationNormalized[]; |
29 | + [ORDER_COLUMN]: any; | ||
28 | } | 30 | } |
29 | 31 | ||
30 | type LocalStore = BasicStore; | 32 | type LocalStore = BasicStore; |
src/utils/http/axios/Axios.ts
@@ -234,7 +234,8 @@ export class VAxios { | @@ -234,7 +234,8 @@ export class VAxios { | ||
234 | return router.push('/login'); | 234 | return router.push('/login'); |
235 | } | 235 | } |
236 | if (res.data.result !== 0 && res.data.message) { | 236 | if (res.data.result !== 0 && res.data.message) { |
237 | - return createMessage.error(res.data.message); | 237 | + createMessage.error(res.data.message); |
238 | + return reject(res.data); | ||
238 | } | 239 | } |
239 | 240 | ||
240 | if (message && res.data.result === 0) { | 241 | if (message && res.data.result === 0) { |
src/views/project/approve/BaseInfo.vue
0 → 100644
1 | +<template> | ||
2 | + <h2>基本信息</h2> | ||
3 | + <div v-for="field in baseInfos" :key="field.label"> | ||
4 | + <span className="w-[140px] inline-block text-right mr-3">{{ field.label }}:</span> | ||
5 | + <span v-if="field.label !== '图片'">{{ field.value }}</span> | ||
6 | + <span v-else><img :src="field.value" height="100" /></span> | ||
7 | + </div> | ||
8 | +</template> | ||
9 | + | ||
10 | +<script setup lang="ts"> | ||
11 | + defineProps({ | ||
12 | + baseInfos: Object, | ||
13 | + }); | ||
14 | +</script> |
src/views/project/approve/FieldPanel.vue
@@ -17,28 +17,36 @@ | @@ -17,28 +17,36 @@ | ||
17 | </template> | 17 | </template> |
18 | </BasicTable> | 18 | </BasicTable> |
19 | <BasicDrawer | 19 | <BasicDrawer |
20 | - :showFooter="!isApproved" | 20 | + width="500" |
21 | + :showFooter="!isApproved && role === ROLE.ADMIN" | ||
21 | @register="registerDrawer" | 22 | @register="registerDrawer" |
22 | title="申请信息" | 23 | title="申请信息" |
23 | okText="通过" | 24 | okText="通过" |
24 | @ok="handleTrue" | 25 | @ok="handleTrue" |
25 | > | 26 | > |
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 v-if="field.label !== '图片'">{{ field.value }}</span | ||
30 | - ><span v-else><img :src="field.value" height="100" /></span> | ||
31 | - </div> | 27 | + <BaseInfo :baseInfos="baseInfos" /> |
32 | <h2 className="mt-8">基本信息申请字段</h2> | 28 | <h2 className="mt-8">基本信息申请字段</h2> |
33 | <div>{{ fieldInfos.baseFields.join(' , ') }}</div> | 29 | <div>{{ fieldInfos.baseFields.join(' , ') }}</div> |
30 | + | ||
34 | <h2 className="mt-8">利润分析表申请字段</h2> | 31 | <h2 className="mt-8">利润分析表申请字段</h2> |
35 | <div> | 32 | <div> |
36 | {{ fieldInfos.profitFields.join(' , ') }} | 33 | {{ fieldInfos.profitFields.join(' , ') }} |
37 | </div> | 34 | </div> |
35 | + | ||
38 | <h2 className="mt-8">项目报告书申请字段</h2> | 36 | <h2 className="mt-8">项目报告书申请字段</h2> |
39 | <div> | 37 | <div> |
40 | <span>{{ fieldInfos.reportFields.join(' , ') }}</span> | 38 | <span>{{ fieldInfos.reportFields.join(' , ') }}</span> |
41 | </div> | 39 | </div> |
40 | + | ||
41 | + <h2 className="mt-8">跟单信息申请字段</h2> | ||
42 | + <div> | ||
43 | + <span>{{ fieldInfos.trackStageFields.join(' , ') }}</span> | ||
44 | + </div> | ||
45 | + | ||
46 | + <h2 className="mt-8">质量检测申请字段</h2> | ||
47 | + <div> | ||
48 | + <span>{{ fieldInfos.inspectionStageFields.join(' , ') }}</span> | ||
49 | + </div> | ||
42 | <template #appendFooter> | 50 | <template #appendFooter> |
43 | <a-button @click="handleFalse"> 不通过</a-button> | 51 | <a-button @click="handleFalse"> 不通过</a-button> |
44 | </template> | 52 | </template> |
@@ -46,14 +54,25 @@ | @@ -46,14 +54,25 @@ | ||
46 | </PageWrapper> | 54 | </PageWrapper> |
47 | </template> | 55 | </template> |
48 | <script lang="ts"> | 56 | <script lang="ts"> |
49 | - import { defineComponent, ref } from 'vue'; | 57 | + import { computed, defineComponent, ref } from 'vue'; |
50 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 58 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
51 | import { PageWrapper } from '/@/components/Page'; | 59 | import { PageWrapper } from '/@/components/Page'; |
52 | import { BasicDrawer, useDrawer } from '/@/components/Drawer'; | 60 | import { BasicDrawer, useDrawer } from '/@/components/Drawer'; |
53 | 61 | ||
54 | import { approveAuditApi, getApprovedListApi, getWaitListApi } from '/@/api/project/approve'; | 62 | import { approveAuditApi, getApprovedListApi, getWaitListApi } from '/@/api/project/approve'; |
55 | - import { FIELDS_BASE_INFO, FIELDS_PROFIT_INFO, FIELDS_REPORT_INFO } from '../order/tableData'; | 63 | + import { |
64 | + FIELDS_BASE_INFO, | ||
65 | + FIELDS_INSPECTION_INFO, | ||
66 | + FIELDS_PROFIT_INFO, | ||
67 | + FIELDS_REPORT_INFO, | ||
68 | + FIELDS_TRACK_STAGE_INFO, | ||
69 | + } from '../order/tableData'; | ||
56 | import { find, isEmpty } from 'lodash-es'; | 70 | import { find, isEmpty } from 'lodash-es'; |
71 | + import { ROLE } from '../order//type.d'; | ||
72 | + import { useUserStoreWithOut } from '/@/store/modules/user'; | ||
73 | + import BaseInfo from './BaseInfo.vue'; | ||
74 | + | ||
75 | + const userStore = useUserStoreWithOut(); | ||
57 | 76 | ||
58 | export default defineComponent({ | 77 | export default defineComponent({ |
59 | components: { | 78 | components: { |
@@ -61,6 +80,7 @@ | @@ -61,6 +80,7 @@ | ||
61 | BasicTable, | 80 | BasicTable, |
62 | BasicDrawer, | 81 | BasicDrawer, |
63 | TableAction, | 82 | TableAction, |
83 | + BaseInfo, | ||
64 | }, | 84 | }, |
65 | props: { | 85 | props: { |
66 | isApproved: { type: Boolean }, | 86 | isApproved: { type: Boolean }, |
@@ -73,6 +93,8 @@ | @@ -73,6 +93,8 @@ | ||
73 | baseFields: [], | 93 | baseFields: [], |
74 | reportFields: [], | 94 | reportFields: [], |
75 | profitFields: [], | 95 | profitFields: [], |
96 | + inspectionStageFields: [], | ||
97 | + trackStageFields: [], | ||
76 | }); | 98 | }); |
77 | const baseInfos = ref({}); | 99 | const baseInfos = ref({}); |
78 | const id = ref(''); | 100 | const id = ref(''); |
@@ -128,6 +150,8 @@ | @@ -128,6 +150,8 @@ | ||
128 | baseFields: [], | 150 | baseFields: [], |
129 | reportFields: [], | 151 | reportFields: [], |
130 | profitFields: [], | 152 | profitFields: [], |
153 | + inspectionStageFields: [], | ||
154 | + trackStageFields: [], | ||
131 | }; | 155 | }; |
132 | openDrawer(true, { data }); | 156 | openDrawer(true, { data }); |
133 | 157 | ||
@@ -153,6 +177,22 @@ | @@ -153,6 +177,22 @@ | ||
153 | } | 177 | } |
154 | }); | 178 | }); |
155 | 179 | ||
180 | + !isEmpty(data.fieldInfos.trackStageFields) && | ||
181 | + Object.entries(data.fieldInfos.trackStageFields).map(([key, value]) => { | ||
182 | + if (value === 'UN_LOCKED') { | ||
183 | + const obj = find(FIELDS_TRACK_STAGE_INFO, { field: key }); | ||
184 | + fieldInfos.value.trackStageFields.push(obj?.label); | ||
185 | + } | ||
186 | + }); | ||
187 | + | ||
188 | + !isEmpty(data.fieldInfos.inspectionStageFields) && | ||
189 | + Object.entries(data.fieldInfos.inspectionStageFields).map(([key, value]) => { | ||
190 | + if (value === 'UN_LOCKED') { | ||
191 | + const obj = find(FIELDS_INSPECTION_INFO, { field: key }); | ||
192 | + fieldInfos.value.inspectionStageFields.push(obj?.label); | ||
193 | + } | ||
194 | + }); | ||
195 | + | ||
156 | id.value = data.id; | 196 | id.value = data.id; |
157 | baseInfos.value = FIELDS_BASE_INFO.map((field) => { | 197 | baseInfos.value = FIELDS_BASE_INFO.map((field) => { |
158 | return { | 198 | return { |
@@ -173,6 +213,10 @@ | @@ -173,6 +213,10 @@ | ||
173 | reload(); | 213 | reload(); |
174 | closeDrawer(); | 214 | closeDrawer(); |
175 | } | 215 | } |
216 | + | ||
217 | + const role = computed(() => { | ||
218 | + return userStore.getUserInfo?.roleSmallVO?.code; | ||
219 | + }); | ||
176 | return { | 220 | return { |
177 | handleProfitModal, | 221 | handleProfitModal, |
178 | registerTable, | 222 | registerTable, |
@@ -187,7 +231,10 @@ | @@ -187,7 +231,10 @@ | ||
187 | baseInfos, | 231 | baseInfos, |
188 | handleTrue, | 232 | handleTrue, |
189 | handleFalse, | 233 | handleFalse, |
234 | + ROLE, | ||
235 | + role, | ||
190 | }; | 236 | }; |
191 | }, | 237 | }, |
192 | }); | 238 | }); |
193 | </script> | 239 | </script> |
240 | +../order/constant |
src/views/project/approve/ProfitPanel.vue
@@ -17,17 +17,13 @@ | @@ -17,17 +17,13 @@ | ||
17 | </template> | 17 | </template> |
18 | </BasicTable> | 18 | </BasicTable> |
19 | <BasicDrawer | 19 | <BasicDrawer |
20 | - :showFooter="!isApproved" | 20 | + :showFooter="!isApproved && role === ROLE.ADMIN" |
21 | @register="registerDrawer" | 21 | @register="registerDrawer" |
22 | title="申请信息" | 22 | title="申请信息" |
23 | okText="通过" | 23 | okText="通过" |
24 | @ok="handleTrue" | 24 | @ok="handleTrue" |
25 | > | 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> | 26 | + <BaseInfo :baseInfos="baseInfos" /> |
31 | <h2>项目报告书信息</h2> | 27 | <h2>项目报告书信息</h2> |
32 | <div v-for="field in fieldInfos" :key="field"> | 28 | <div v-for="field in fieldInfos" :key="field"> |
33 | <span className="w-[140px] inline-block text-right mr-3">{{ field.label }}:</span | 29 | <span className="w-[140px] inline-block text-right mr-3">{{ field.label }}:</span |
@@ -40,13 +36,18 @@ | @@ -40,13 +36,18 @@ | ||
40 | </PageWrapper> | 36 | </PageWrapper> |
41 | </template> | 37 | </template> |
42 | <script lang="ts"> | 38 | <script lang="ts"> |
43 | - import { defineComponent, ref } from 'vue'; | 39 | + import { computed, defineComponent, ref } from 'vue'; |
44 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 40 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
45 | import { PageWrapper } from '/@/components/Page'; | 41 | import { PageWrapper } from '/@/components/Page'; |
46 | import { BasicDrawer, useDrawer } from '/@/components/Drawer'; | 42 | import { BasicDrawer, useDrawer } from '/@/components/Drawer'; |
47 | 43 | ||
48 | import { approveAuditApi, getApprovedListApi, getWaitListApi } from '/@/api/project/approve'; | 44 | import { approveAuditApi, getApprovedListApi, getWaitListApi } from '/@/api/project/approve'; |
49 | import { FIELDS_BASE_INFO, FIELDS_PROFIT_INFO, FIELDS_REPORT_INFO } from '../order/tableData'; | 45 | import { FIELDS_BASE_INFO, FIELDS_PROFIT_INFO, FIELDS_REPORT_INFO } from '../order/tableData'; |
46 | + import { ROLE } from '../order//type.d'; | ||
47 | + import { useUserStoreWithOut } from '/@/store/modules/user'; | ||
48 | + import BaseInfo from './BaseInfo.vue'; | ||
49 | + | ||
50 | + const userStore = useUserStoreWithOut(); | ||
50 | 51 | ||
51 | export default defineComponent({ | 52 | export default defineComponent({ |
52 | components: { | 53 | components: { |
@@ -54,6 +55,7 @@ | @@ -54,6 +55,7 @@ | ||
54 | BasicTable, | 55 | BasicTable, |
55 | BasicDrawer, | 56 | BasicDrawer, |
56 | TableAction, | 57 | TableAction, |
58 | + BaseInfo, | ||
57 | }, | 59 | }, |
58 | props: { | 60 | props: { |
59 | isApproved: { type: Boolean }, | 61 | isApproved: { type: Boolean }, |
@@ -140,6 +142,10 @@ | @@ -140,6 +142,10 @@ | ||
140 | reload(); | 142 | reload(); |
141 | closeDrawer(); | 143 | closeDrawer(); |
142 | } | 144 | } |
145 | + | ||
146 | + const role = computed(() => { | ||
147 | + return userStore.getUserInfo?.roleSmallVO?.code; | ||
148 | + }); | ||
143 | return { | 149 | return { |
144 | handleProfitModal, | 150 | handleProfitModal, |
145 | registerTable, | 151 | registerTable, |
@@ -154,7 +160,10 @@ | @@ -154,7 +160,10 @@ | ||
154 | baseInfos, | 160 | baseInfos, |
155 | handleTrue, | 161 | handleTrue, |
156 | handleFalse, | 162 | handleFalse, |
163 | + role, | ||
164 | + ROLE, | ||
157 | }; | 165 | }; |
158 | }, | 166 | }, |
159 | }); | 167 | }); |
160 | </script> | 168 | </script> |
169 | +../order/constant |
src/views/project/approve/ReportPanel.vue
@@ -17,17 +17,13 @@ | @@ -17,17 +17,13 @@ | ||
17 | </template> | 17 | </template> |
18 | </BasicTable> | 18 | </BasicTable> |
19 | <BasicDrawer | 19 | <BasicDrawer |
20 | - :showFooter="!isApproved" | 20 | + :showFooter="!isApproved && role === ROLE.ADMIN" |
21 | @register="registerDrawer" | 21 | @register="registerDrawer" |
22 | title="申请信息" | 22 | title="申请信息" |
23 | okText="通过" | 23 | okText="通过" |
24 | @ok="handleTrue" | 24 | @ok="handleTrue" |
25 | > | 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> | 26 | + <BaseInfo :baseInfos="baseInfos" /> |
31 | <h2>项目报告书信息</h2> | 27 | <h2>项目报告书信息</h2> |
32 | <div v-for="field in fieldInfos" :key="field"> | 28 | <div v-for="field in fieldInfos" :key="field"> |
33 | <span className="w-[140px] inline-block text-right mr-3">{{ field.label }}:</span | 29 | <span className="w-[140px] inline-block text-right mr-3">{{ field.label }}:</span |
@@ -40,19 +36,25 @@ | @@ -40,19 +36,25 @@ | ||
40 | </PageWrapper> | 36 | </PageWrapper> |
41 | </template> | 37 | </template> |
42 | <script lang="ts"> | 38 | <script lang="ts"> |
43 | - import { defineComponent, ref } from 'vue'; | 39 | + import { computed, defineComponent, ref } from 'vue'; |
44 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 40 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
45 | import { PageWrapper } from '/@/components/Page'; | 41 | import { PageWrapper } from '/@/components/Page'; |
46 | import { BasicDrawer, useDrawer } from '/@/components/Drawer'; | 42 | import { BasicDrawer, useDrawer } from '/@/components/Drawer'; |
47 | 43 | ||
48 | import { approveAuditApi, getApprovedListApi, getWaitListApi } from '/@/api/project/approve'; | 44 | import { approveAuditApi, getApprovedListApi, getWaitListApi } from '/@/api/project/approve'; |
49 | import { FIELDS_BASE_INFO, FIELDS_REPORT_INFO } from '../order/tableData'; | 45 | import { FIELDS_BASE_INFO, FIELDS_REPORT_INFO } from '../order/tableData'; |
46 | + import { ROLE } from '../order//type.d'; | ||
47 | + import { useUserStoreWithOut } from '/@/store/modules/user'; | ||
48 | + import BaseInfo from './BaseInfo.vue'; | ||
49 | + | ||
50 | + const userStore = useUserStoreWithOut(); | ||
50 | 51 | ||
51 | export default defineComponent({ | 52 | export default defineComponent({ |
52 | components: { | 53 | components: { |
53 | PageWrapper, | 54 | PageWrapper, |
54 | BasicTable, | 55 | BasicTable, |
55 | BasicDrawer, | 56 | BasicDrawer, |
57 | + BaseInfo, | ||
56 | TableAction, | 58 | TableAction, |
57 | }, | 59 | }, |
58 | props: { | 60 | props: { |
@@ -140,6 +142,10 @@ | @@ -140,6 +142,10 @@ | ||
140 | reload(); | 142 | reload(); |
141 | closeDrawer(); | 143 | closeDrawer(); |
142 | } | 144 | } |
145 | + | ||
146 | + const role = computed(() => { | ||
147 | + return userStore.getUserInfo?.roleSmallVO?.code; | ||
148 | + }); | ||
143 | return { | 149 | return { |
144 | handleProfitModal, | 150 | handleProfitModal, |
145 | registerTable, | 151 | registerTable, |
@@ -154,7 +160,10 @@ | @@ -154,7 +160,10 @@ | ||
154 | baseInfos, | 160 | baseInfos, |
155 | handleTrue, | 161 | handleTrue, |
156 | handleFalse, | 162 | handleFalse, |
163 | + role, | ||
164 | + ROLE, | ||
157 | }; | 165 | }; |
158 | }, | 166 | }, |
159 | }); | 167 | }); |
160 | </script> | 168 | </script> |
169 | +../order/constant |
src/views/project/order/CheckDetail.vue
@@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
5 | showFooter | 5 | showFooter |
6 | title="字段编辑权限申请" | 6 | title="字段编辑权限申请" |
7 | width="60%" | 7 | width="60%" |
8 | + :destroyOnClose="true" | ||
8 | :isDetail="true" | 9 | :isDetail="true" |
9 | @ok="handleSubmit" | 10 | @ok="handleSubmit" |
10 | :showDetailBack="false" | 11 | :showDetailBack="false" |
@@ -13,10 +14,22 @@ | @@ -13,10 +14,22 @@ | ||
13 | <div> | 14 | <div> |
14 | <h3>基本信息</h3> | 15 | <h3>基本信息</h3> |
15 | <BasicForm @register="registerForm" /> | 16 | <BasicForm @register="registerForm" /> |
16 | - <h3>利润分析</h3> | ||
17 | - <BasicForm @register="registerProfitForm" /> | ||
18 | - <h3>项目报告书</h3> | ||
19 | - <BasicForm @register="registerReportForm" /> | 17 | + <template v-if="role === ROLE.ADMIN || role === ROLE.BUSINESS"> |
18 | + <h3>利润分析</h3> | ||
19 | + <BasicForm @register="registerProfitForm" /> | ||
20 | + </template> | ||
21 | + <template v-if="role === ROLE.ADMIN || role === ROLE.BUSINESS"> | ||
22 | + <h3>项目报告书</h3> | ||
23 | + <BasicForm @register="registerReportForm" /> | ||
24 | + </template> | ||
25 | + <template v-if="role === ROLE.ADMIN || role === ROLE.TRACKER"> | ||
26 | + <h3>跟单信息</h3> | ||
27 | + <BasicForm @register="registerTrackForm" /> | ||
28 | + </template> | ||
29 | + <template v-if="role === ROLE.ADMIN || role === ROLE.INSPECT"> | ||
30 | + <h3>质量信息</h3> | ||
31 | + <BasicForm @register="registryInspectForm" /> | ||
32 | + </template> | ||
20 | </div> | 33 | </div> |
21 | <!-- <template #titleToolbar> <a-button type="primary"> 申请编辑权限 </a-button></template> --> | 34 | <!-- <template #titleToolbar> <a-button type="primary"> 申请编辑权限 </a-button></template> --> |
22 | 35 | ||
@@ -26,13 +39,22 @@ | @@ -26,13 +39,22 @@ | ||
26 | </BasicDrawer> | 39 | </BasicDrawer> |
27 | </template> | 40 | </template> |
28 | <script lang="ts"> | 41 | <script lang="ts"> |
29 | - import { defineComponent, reactive, ref } from 'vue'; | 42 | + import { computed, defineComponent, reactive, ref } from 'vue'; |
30 | import { BasicForm, useForm } from '/@/components/Form/index'; | 43 | import { BasicForm, useForm } from '/@/components/Form/index'; |
31 | import { orderAuth } from '/@/api/project/order'; | 44 | import { orderAuth } from '/@/api/project/order'; |
45 | + import { ROLE } from './type.d'; | ||
32 | 46 | ||
33 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; | 47 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
34 | - import { FIELDS_BASE_INFO, FIELDS_PROFIT_INFO, FIELDS_REPORT_INFO } from './tableData'; | 48 | + import { |
49 | + FIELDS_BASE_INFO, | ||
50 | + FIELDS_INSPECTION_INFO, | ||
51 | + FIELDS_PROFIT_INFO, | ||
52 | + FIELDS_REPORT_INFO, | ||
53 | + FIELDS_TRACK_STAGE_INFO, | ||
54 | + } from './tableData'; | ||
55 | + import { useUserStoreWithOut } from '/@/store/modules/user'; | ||
35 | 56 | ||
57 | + const userStore = useUserStoreWithOut(); | ||
36 | const getSchema = (fields) => | 58 | const getSchema = (fields) => |
37 | fields.map((item) => ({ | 59 | fields.map((item) => ({ |
38 | field: `${item.field}`, | 60 | field: `${item.field}`, |
@@ -60,6 +82,8 @@ | @@ -60,6 +82,8 @@ | ||
60 | const schemas = getSchema(FIELDS_BASE_INFO); | 82 | const schemas = getSchema(FIELDS_BASE_INFO); |
61 | const profitSchemas = getSchema(FIELDS_PROFIT_INFO); | 83 | const profitSchemas = getSchema(FIELDS_PROFIT_INFO); |
62 | const reportSchemas = getSchema(FIELDS_REPORT_INFO); | 84 | const reportSchemas = getSchema(FIELDS_REPORT_INFO); |
85 | + const inspecSchemas = getSchema(FIELDS_INSPECTION_INFO); | ||
86 | + const trackSchemas = getSchema(FIELDS_TRACK_STAGE_INFO); | ||
63 | const [registerForm, { getFieldsValue }] = useForm({ | 87 | const [registerForm, { getFieldsValue }] = useForm({ |
64 | labelWidth: 120, | 88 | labelWidth: 120, |
65 | schemas, | 89 | schemas, |
@@ -84,34 +108,73 @@ | @@ -84,34 +108,73 @@ | ||
84 | span: 24, | 108 | span: 24, |
85 | }, | 109 | }, |
86 | }); | 110 | }); |
111 | + const [registryInspectForm, { getFieldsValue: getInspectFieldsValue }] = useForm({ | ||
112 | + labelWidth: 120, | ||
113 | + schemas: inspecSchemas, | ||
114 | + showActionButtonGroup: false, | ||
115 | + actionColOptions: { | ||
116 | + span: 24, | ||
117 | + }, | ||
118 | + }); | ||
119 | + const [registerTrackForm, { getFieldsValue: getTrackFieldsValue }] = useForm({ | ||
120 | + labelWidth: 120, | ||
121 | + schemas: trackSchemas, | ||
122 | + showActionButtonGroup: false, | ||
123 | + actionColOptions: { | ||
124 | + span: 24, | ||
125 | + }, | ||
126 | + }); | ||
87 | const lockFields = reactive({}); | 127 | const lockFields = reactive({}); |
88 | const [register, { closeDrawer }] = useDrawerInner((data) => { | 128 | const [register, { closeDrawer }] = useDrawerInner((data) => { |
89 | Object.assign(lockFields, data.lockFields); | 129 | Object.assign(lockFields, data.lockFields); |
90 | id.value = data.id; | 130 | id.value = data.id; |
91 | }); | 131 | }); |
92 | 132 | ||
133 | + const role = computed(() => { | ||
134 | + return userStore.getUserInfo?.roleSmallVO?.code; | ||
135 | + }); | ||
136 | + | ||
93 | const handleSubmit = async () => { | 137 | const handleSubmit = async () => { |
94 | const baseFieldValues = getFieldsValue(); | 138 | const baseFieldValues = getFieldsValue(); |
95 | const profitFieldValues = getProfitFieldsValue(); | 139 | const profitFieldValues = getProfitFieldsValue(); |
96 | const reportFieldValues = getReportFieldsValue(); | 140 | const reportFieldValues = getReportFieldsValue(); |
141 | + const inspectFieldValues = getInspectFieldsValue(); | ||
142 | + const trackFieldValues = getTrackFieldsValue(); | ||
97 | 143 | ||
98 | - FIELDS_BASE_INFO.map( | ||
99 | - ({ field }) => | ||
100 | - (baseFieldValues[field] = | ||
101 | - baseFieldValues[field] === 'UN_LOCKED' ? 'UN_LOCKED' : 'LOCKED'), | ||
102 | - ); | 144 | + if (baseFieldValues) { |
145 | + FIELDS_BASE_INFO.map( | ||
146 | + ({ field }) => | ||
147 | + (baseFieldValues[field] = | ||
148 | + baseFieldValues[field] === 'UN_LOCKED' ? 'UN_LOCKED' : 'LOCKED'), | ||
149 | + ); | ||
150 | + } | ||
103 | 151 | ||
104 | - FIELDS_REPORT_INFO.map( | ||
105 | - ({ field }) => | ||
106 | - (reportFieldValues[field] = | ||
107 | - reportFieldValues[field] === 'UN_LOCKED' ? 'UN_LOCKED' : 'LOCKED'), | ||
108 | - ); | 152 | + if (reportFieldValues) |
153 | + FIELDS_REPORT_INFO.map( | ||
154 | + ({ field }) => | ||
155 | + (reportFieldValues[field] = | ||
156 | + reportFieldValues[field] === 'UN_LOCKED' ? 'UN_LOCKED' : 'LOCKED'), | ||
157 | + ); | ||
109 | 158 | ||
110 | - FIELDS_PROFIT_INFO.map( | ||
111 | - ({ field }) => | ||
112 | - (profitFieldValues[field] = | ||
113 | - profitFieldValues[field] === 'UN_LOCKED' ? 'UN_LOCKED' : 'LOCKED'), | ||
114 | - ); | 159 | + if (profitFieldValues) |
160 | + FIELDS_PROFIT_INFO.map( | ||
161 | + ({ field }) => | ||
162 | + (profitFieldValues[field] = | ||
163 | + profitFieldValues[field] === 'UN_LOCKED' ? 'UN_LOCKED' : 'LOCKED'), | ||
164 | + ); | ||
165 | + if (trackFieldValues) | ||
166 | + FIELDS_TRACK_STAGE_INFO.map( | ||
167 | + ({ field }) => | ||
168 | + (trackFieldValues[field] = | ||
169 | + trackFieldValues[field] === 'UN_LOCKED' ? 'UN_LOCKED' : 'LOCKED'), | ||
170 | + ); | ||
171 | + | ||
172 | + if (inspectFieldValues) | ||
173 | + FIELDS_INSPECTION_INFO.map( | ||
174 | + ({ field }) => | ||
175 | + (inspectFieldValues[field] = | ||
176 | + inspectFieldValues[field] === 'UN_LOCKED' ? 'UN_LOCKED' : 'LOCKED'), | ||
177 | + ); | ||
115 | 178 | ||
116 | // !isEmpty(baseFieldValues) && | 179 | // !isEmpty(baseFieldValues) && |
117 | // Object.keys(baseFieldValues.baseFields)?.map((key) => { | 180 | // Object.keys(baseFieldValues.baseFields)?.map((key) => { |
@@ -141,6 +204,8 @@ | @@ -141,6 +204,8 @@ | ||
141 | { baseFields: baseFieldValues }, | 204 | { baseFields: baseFieldValues }, |
142 | { profitAnalysisFields: profitFieldValues }, | 205 | { profitAnalysisFields: profitFieldValues }, |
143 | { reportFields: reportFieldValues }, | 206 | { reportFields: reportFieldValues }, |
207 | + { trackStageFields: trackFieldValues }, | ||
208 | + { inspectionStageFields: inspectFieldValues }, | ||
144 | ); | 209 | ); |
145 | await orderAuth(values); | 210 | await orderAuth(values); |
146 | closeDrawer(); | 211 | closeDrawer(); |
@@ -151,7 +216,11 @@ | @@ -151,7 +216,11 @@ | ||
151 | registerForm, | 216 | registerForm, |
152 | registerProfitForm, | 217 | registerProfitForm, |
153 | registerReportForm, | 218 | registerReportForm, |
219 | + registryInspectForm, | ||
220 | + registerTrackForm, | ||
154 | handleSubmit, | 221 | handleSubmit, |
222 | + ROLE, | ||
223 | + role, | ||
155 | }; | 224 | }; |
156 | }, | 225 | }, |
157 | }); | 226 | }); |
src/views/project/order/FieldDetail.vue
src/views/project/order/FormDetail.vue deleted
100644 → 0
1 | -<template> | ||
2 | - <BasicDrawer | ||
3 | - v-bind="$attrs" | ||
4 | - showFooter | ||
5 | - @register="register" | ||
6 | - @ok="handleSubmit" | ||
7 | - title="" | ||
8 | - width="28%" | ||
9 | - ref="formRef" | ||
10 | - :isDetail="true" | ||
11 | - :showDetailBack="false" | ||
12 | - okText="保存" | ||
13 | - :mask="false" | ||
14 | - class="z-20" | ||
15 | - > | ||
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="inspectionFormPanelRef" :id="id" /> | ||
32 | - </TabPanel> | ||
33 | - </Tabs> | ||
34 | - </div> | ||
35 | - <!-- <BasicForm @register="registerForm" /> | ||
36 | - <BasicForm @register="registerForm" /> | ||
37 | - <BasicForm @register="registerForm" /> --> | ||
38 | - <!-- <template #titleToolbar> <a-button type="primary"> 申请编辑权限 </a-button></template> --> | ||
39 | - | ||
40 | - <!-- <template #appendFooter> | ||
41 | - <a-button type="primary" @click="onGoCheckDetail"> 申请权限</a-button> | ||
42 | - </template> --> | ||
43 | - </BasicDrawer> | ||
44 | -</template> | ||
45 | -<script lang="ts"> | ||
46 | - import { computed, defineComponent, reactive, ref, toRaw, watch, toRefs } from 'vue'; | ||
47 | - import { BasicForm, FormActionType, FormSchema, useForm } from '/@/components/Form/index'; | ||
48 | - import { orderCreate, orderUpdate, uploadImg } from '/@/api/project/order'; | ||
49 | - import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; | ||
50 | - import { useOrderStoreWithOut } from '/@/store/modules/order'; | ||
51 | - import { useOrderInfo } from '/@/hooks/component/order'; | ||
52 | - import { dateUtil } from '/@/utils/dateUtil'; | ||
53 | - import {} from './tableData'; | ||
54 | - import ProfitFormPanel from './component/ProfitFormPanel.vue'; | ||
55 | - import ReportFormPanel from './component/ReportFormPanel.vue'; | ||
56 | - import TrackFormPanel from './component/TrackFormPanel.vue'; | ||
57 | - import InspectionFormPanel from './component/InspectionFormPanel.vue'; | ||
58 | - import BaseFormPanel from './component/BaseFormPanel.vue'; | ||
59 | - | ||
60 | - import { Tabs } from 'ant-design-vue'; | ||
61 | - | ||
62 | - const TabPanel = Tabs.TabPane; | ||
63 | - | ||
64 | - export default defineComponent({ | ||
65 | - components: { | ||
66 | - BasicDrawer, | ||
67 | - BasicForm, | ||
68 | - BaseFormPanel, | ||
69 | - Tabs, | ||
70 | - TabPanel, | ||
71 | - ProfitFormPanel, | ||
72 | - ReportFormPanel, | ||
73 | - TrackFormPanel, | ||
74 | - InspectionFormPanel, | ||
75 | - }, | ||
76 | - | ||
77 | - props: { | ||
78 | - detailData: { | ||
79 | - type: Object, | ||
80 | - }, | ||
81 | - onGoCheckDetail: { | ||
82 | - type: Function, | ||
83 | - }, | ||
84 | - }, | ||
85 | - emits: ['success'], | ||
86 | - setup(_, { emit }) { | ||
87 | - const orderStore = useOrderStoreWithOut(); | ||
88 | - const activeKey = ref('1'); | ||
89 | - const profitFormPanelRef = ref(); | ||
90 | - const reportFormPanelRef = ref(); | ||
91 | - const trackFormPanelRef = ref(); | ||
92 | - const inspectionFormPanelRef = ref(); | ||
93 | - const baseFormPanelRef = ref(); | ||
94 | - | ||
95 | - const { | ||
96 | - customerCode, | ||
97 | - projectNo, | ||
98 | - productionDepartment, | ||
99 | - innerNo, | ||
100 | - poColor, | ||
101 | - cnColor, | ||
102 | - productStyle, | ||
103 | - outboundType, | ||
104 | - packetType, | ||
105 | - } = useOrderInfo(orderStore); | ||
106 | - | ||
107 | - const formRef = ref<FormActionType | null>(null); | ||
108 | - const id = ref(''); | ||
109 | - | ||
110 | - // const customerCode = computed(() => { | ||
111 | - // const dictInfo = orderStore.getDictInfo; | ||
112 | - // return map(dictInfo?.customerCode, transformDictInfo); | ||
113 | - // }); | ||
114 | - | ||
115 | - // const projectNo = computed(() => { | ||
116 | - // const dictInfo = orderStore.getDictInfo; | ||
117 | - // return map(dictInfo?.projectNo, transformDictInfo); | ||
118 | - // }); | ||
119 | - | ||
120 | - const picUrl = ref(''); | ||
121 | - let fields = reactive({ baseFields: {} }); | ||
122 | - const getDisable = (code) => { | ||
123 | - return code === 'LOCKED' && !!id.value; | ||
124 | - }; | ||
125 | - | ||
126 | - const schemas = computed(() => { | ||
127 | - return [ | ||
128 | - { | ||
129 | - field: 'baseInfo.customerCode', | ||
130 | - component: 'Select', | ||
131 | - label: '客户编码', | ||
132 | - rules: [{ required: true }], | ||
133 | - colProps: { | ||
134 | - span: 24, | ||
135 | - }, | ||
136 | - componentProps: { | ||
137 | - options: customerCode, | ||
138 | - disabled: getDisable(fields?.baseFields.customerCode), | ||
139 | - }, | ||
140 | - }, | ||
141 | - { | ||
142 | - field: 'baseInfo.projectNo', | ||
143 | - component: 'Select', | ||
144 | - componentProps: { | ||
145 | - options: projectNo, | ||
146 | - disabled: getDisable(fields?.baseFields?.projectNo), | ||
147 | - }, | ||
148 | - label: '项目号', | ||
149 | - rules: [{ required: true }], | ||
150 | - colProps: { | ||
151 | - span: 24, | ||
152 | - }, | ||
153 | - }, | ||
154 | - { | ||
155 | - field: 'baseInfo.productionDepartment', | ||
156 | - component: 'Select', | ||
157 | - label: '生产科', | ||
158 | - rules: [{ required: true }], | ||
159 | - colProps: { | ||
160 | - span: 24, | ||
161 | - }, | ||
162 | - componentProps: { | ||
163 | - options: productionDepartment, | ||
164 | - disabled: getDisable(fields?.baseFields?.productionDepartment), | ||
165 | - }, | ||
166 | - }, | ||
167 | - { | ||
168 | - field: 'baseInfo.innerNo', | ||
169 | - component: 'Select', | ||
170 | - label: '内部编号', | ||
171 | - rules: [{ required: true }], | ||
172 | - | ||
173 | - colProps: { | ||
174 | - span: 24, | ||
175 | - }, | ||
176 | - componentProps: { | ||
177 | - options: innerNo, | ||
178 | - disabled: getDisable(fields?.baseFields?.innerNo), | ||
179 | - }, | ||
180 | - }, | ||
181 | - { | ||
182 | - field: 'baseInfo.customerPo', | ||
183 | - component: 'Input', | ||
184 | - label: '客户po号', | ||
185 | - rules: [{ required: true }], | ||
186 | - componentProps: { | ||
187 | - disabled: getDisable(fields?.baseFields?.customerPo), | ||
188 | - }, | ||
189 | - colProps: { | ||
190 | - span: 24, | ||
191 | - }, | ||
192 | - }, | ||
193 | - { | ||
194 | - field: 'baseInfo.customerStyle', | ||
195 | - component: 'Input', | ||
196 | - label: '客户STYLE', | ||
197 | - rules: [{ required: true }], | ||
198 | - | ||
199 | - colProps: { | ||
200 | - span: 24, | ||
201 | - }, | ||
202 | - componentProps: { | ||
203 | - disabled: getDisable(fields?.baseFields?.customerStyle), | ||
204 | - }, | ||
205 | - }, | ||
206 | - { | ||
207 | - field: 'baseInfo.collection', | ||
208 | - component: 'Input', | ||
209 | - label: 'COLLECTION (style description)', | ||
210 | - rules: [{ required: true }], | ||
211 | - | ||
212 | - colProps: { | ||
213 | - span: 24, | ||
214 | - }, | ||
215 | - componentProps: { | ||
216 | - disabled: getDisable(fields?.baseFields?.collection), | ||
217 | - }, | ||
218 | - }, | ||
219 | - { | ||
220 | - field: 'baseInfo.poColor', | ||
221 | - component: 'Select', | ||
222 | - label: 'PO COLOR', | ||
223 | - rules: [{ required: true }], | ||
224 | - | ||
225 | - colProps: { | ||
226 | - span: 24, | ||
227 | - }, | ||
228 | - componentProps: { | ||
229 | - options: poColor, | ||
230 | - disabled: getDisable(fields?.baseFields?.poColor), | ||
231 | - }, | ||
232 | - }, | ||
233 | - { | ||
234 | - field: 'baseInfo.cnColor', | ||
235 | - component: 'Select', | ||
236 | - label: '颜色中文', | ||
237 | - rules: [{ required: true }], | ||
238 | - | ||
239 | - colProps: { | ||
240 | - span: 24, | ||
241 | - }, | ||
242 | - componentProps: { | ||
243 | - options: cnColor, | ||
244 | - disabled: getDisable(fields?.baseFields?.cnColor), | ||
245 | - }, | ||
246 | - }, | ||
247 | - { | ||
248 | - field: 'baseInfo.picUrl', | ||
249 | - component: 'FieldUpload', | ||
250 | - label: '图片', | ||
251 | - rules: [{ required: true }], | ||
252 | - colProps: { | ||
253 | - span: 24, | ||
254 | - }, | ||
255 | - componentProps: { | ||
256 | - imgUrl: picUrl, | ||
257 | - disabled: getDisable(fields?.baseFields?.picUrl), | ||
258 | - onChange: (res) => { | ||
259 | - if (res.file?.response?.data) picUrl.value = res.file?.response?.data; | ||
260 | - }, | ||
261 | - }, | ||
262 | - }, | ||
263 | - { | ||
264 | - field: 'baseInfo.productionComment', | ||
265 | - component: 'Input', | ||
266 | - rules: [{ required: true }], | ||
267 | - label: '生产要求', | ||
268 | - componentProps: { | ||
269 | - disabled: getDisable(fields?.baseFields?.productionComment), | ||
270 | - }, | ||
271 | - colProps: { | ||
272 | - span: 24, | ||
273 | - }, | ||
274 | - }, | ||
275 | - { | ||
276 | - field: 'baseInfo.orderCount', | ||
277 | - component: 'InputNumber', | ||
278 | - rules: [{ required: true }], | ||
279 | - label: '数量', | ||
280 | - colProps: { | ||
281 | - span: 24, | ||
282 | - }, | ||
283 | - componentProps: { | ||
284 | - disabled: getDisable(fields?.baseFields?.orderCount), | ||
285 | - }, | ||
286 | - }, | ||
287 | - { | ||
288 | - field: 'baseInfo.orderComposition', | ||
289 | - component: 'Input', | ||
290 | - rules: [{ required: true }], | ||
291 | - label: '订单成分', | ||
292 | - colProps: { | ||
293 | - span: 24, | ||
294 | - }, | ||
295 | - componentProps: { | ||
296 | - disabled: getDisable(fields?.baseFields?.orderComposition), | ||
297 | - }, | ||
298 | - }, | ||
299 | - { | ||
300 | - field: 'baseInfo.productStyle', | ||
301 | - component: 'Select', | ||
302 | - rules: [{ required: true }], | ||
303 | - label: '款式类型', | ||
304 | - colProps: { | ||
305 | - span: 24, | ||
306 | - }, | ||
307 | - componentProps: { | ||
308 | - options: productStyle, | ||
309 | - disabled: getDisable(fields?.baseFields?.productStyle), | ||
310 | - }, | ||
311 | - }, | ||
312 | - { | ||
313 | - field: 'baseInfo.productionDepartmentConsignTime', | ||
314 | - component: 'DatePicker', | ||
315 | - label: '生成科拖货时间', | ||
316 | - colProps: { | ||
317 | - span: 24, | ||
318 | - }, | ||
319 | - componentProps: { | ||
320 | - disabled: getDisable(fields?.baseFields?.productionDepartmentConsignTime), | ||
321 | - }, | ||
322 | - rules: [{ required: true }], | ||
323 | - }, | ||
324 | - { | ||
325 | - field: 'baseInfo.orderHodTime', | ||
326 | - component: 'DatePicker', | ||
327 | - label: '订单上HOD时间', | ||
328 | - colProps: { | ||
329 | - span: 24, | ||
330 | - }, | ||
331 | - componentProps: { | ||
332 | - disabled: getDisable(fields?.baseFields?.orderHodTime), | ||
333 | - }, | ||
334 | - rules: [{ required: true }], | ||
335 | - }, | ||
336 | - { | ||
337 | - field: 'baseInfo.outboundType', | ||
338 | - component: 'Select', | ||
339 | - label: '出库类型', | ||
340 | - colProps: { | ||
341 | - span: 24, | ||
342 | - }, | ||
343 | - rules: [{ required: true }], | ||
344 | - componentProps: { | ||
345 | - disabled: getDisable(fields?.baseFields?.outboundType), | ||
346 | - options: outboundType, | ||
347 | - }, | ||
348 | - }, | ||
349 | - { | ||
350 | - field: 'baseInfo.packetType', | ||
351 | - component: 'Select', | ||
352 | - label: '包装类型', | ||
353 | - colProps: { | ||
354 | - span: 24, | ||
355 | - }, | ||
356 | - rules: [{ required: true }], | ||
357 | - componentProps: { | ||
358 | - options: packetType, | ||
359 | - disabled: getDisable(fields?.baseFields?.packetType), | ||
360 | - }, | ||
361 | - }, | ||
362 | - ]; | ||
363 | - }); | ||
364 | - const [registerForm, { setFieldsValue, getFieldsValue, resetFields }] = useForm({ | ||
365 | - labelWidth: 120, | ||
366 | - schemas, | ||
367 | - showActionButtonGroup: false, | ||
368 | - actionColOptions: { | ||
369 | - span: 24, | ||
370 | - }, | ||
371 | - }); | ||
372 | - | ||
373 | - const [register, { closeDrawer }] = useDrawerInner((data) => { | ||
374 | - if (!data.id) { | ||
375 | - id.value = ''; | ||
376 | - picUrl.value = ''; | ||
377 | - // 新建 | ||
378 | - baseFormPanelRef?.value?.resetFields(); | ||
379 | - profitFormPanelRef?.value?.resetFields(); | ||
380 | - reportFormPanelRef?.value?.resetFields(); | ||
381 | - trackFormPanelRef?.value?.resetFields(); | ||
382 | - inspectionFormPanelRef?.value?.resetFields(); | ||
383 | - | ||
384 | - return; | ||
385 | - } | ||
386 | - id.value = data.id; | ||
387 | - | ||
388 | - // 方式1 | ||
389 | - picUrl.value = data.picUrl; | ||
390 | - data.orderHodTime = data.orderHodTime ? dateUtil(data.orderHodTime) : null; | ||
391 | - data.productionDepartmentConsignTime = data.productionDepartmentConsignTime | ||
392 | - ? dateUtil(data.productionDepartmentConsignTime) | ||
393 | - : null; | ||
394 | - | ||
395 | - fields.baseFields = { | ||
396 | - ...fields.baseFields, | ||
397 | - ...data.lockFields.baseFields, | ||
398 | - }; | ||
399 | - | ||
400 | - if (id.value) { | ||
401 | - setTimeout(() => { | ||
402 | - // 基本信息 | ||
403 | - baseFormPanelRef.value.fields = { ...data.lockFields?.baseFields } || {}; | ||
404 | - baseFormPanelRef.value.setFieldsValue({ | ||
405 | - ...toRaw(data), | ||
406 | - }); | ||
407 | - baseFormPanelRef.value.picUrl = data.picUrl; | ||
408 | - baseFormPanelRef.value.smallPicUrl = data.smallPicUrl; | ||
409 | - | ||
410 | - // 利润分析 | ||
411 | - profitFormPanelRef.value.fields = { ...data.lockFields?.profitAnalysisFields } || {}; | ||
412 | - profitFormPanelRef?.value?.setFieldsValue({ | ||
413 | - ...toRaw(data.profitAnalysisInfo), | ||
414 | - }); | ||
415 | - | ||
416 | - // 项目报告书 | ||
417 | - reportFormPanelRef.value.fields = { ...data.lockFields?.reportFields } || {}; | ||
418 | - reportFormPanelRef?.value?.setFieldsValue({ | ||
419 | - ...toRaw(data.reportInfo), | ||
420 | - }); | ||
421 | - | ||
422 | - // 跟单信息 | ||
423 | - trackFormPanelRef.value.fields = { ...data.lockFields?.trackStageFields } || {}; | ||
424 | - trackFormPanelRef?.value?.setFieldsValue({ | ||
425 | - ...toRaw(data.trackStageInfo), | ||
426 | - }); | ||
427 | - | ||
428 | - // 质检信息 | ||
429 | - inspectionFormPanelRef.value.fields = | ||
430 | - { ...data.lockFields?.inspectionStageFields } || {}; | ||
431 | - inspectionFormPanelRef?.value?.setFieldsValue({ | ||
432 | - ...toRaw(data.inspectionStageInfo), | ||
433 | - }); | ||
434 | - }, 100); | ||
435 | - } else { | ||
436 | - setFieldsValue({}); | ||
437 | - } | ||
438 | - }); | ||
439 | - | ||
440 | - const handleSubmit = async () => { | ||
441 | - if (id.value) { | ||
442 | - const forms = { orderId: id.value } as any; | ||
443 | - if (activeKey.value === '1') { | ||
444 | - forms.baseInfo = baseFormPanelRef?.value?.getFieldsValue() || {}; | ||
445 | - forms.baseInfo = { | ||
446 | - ...forms.baseInfo, | ||
447 | - picUrl: baseFormPanelRef?.value?.picUrl || '', | ||
448 | - smallPicUrl: baseFormPanelRef?.value?.smallPicUrl || '', | ||
449 | - }; | ||
450 | - } else if (activeKey.value === '2') { | ||
451 | - forms.profitAnalysisInfo = profitFormPanelRef?.value?.getFieldsValue() || {}; | ||
452 | - } else if (activeKey.value === '3') { | ||
453 | - forms.reportInfo = reportFormPanelRef?.value?.getFieldsValue() || {}; | ||
454 | - } else if (activeKey.value === '4') { | ||
455 | - forms.trackStageInfo = trackFormPanelRef?.value?.getFieldsValue() || {}; | ||
456 | - } else if (activeKey.value === '5') { | ||
457 | - forms.inspectionStageInfo = inspectionFormPanelRef?.value?.getFieldsValue() || {}; | ||
458 | - } | ||
459 | - | ||
460 | - await orderUpdate(forms); | ||
461 | - } else { | ||
462 | - // const v2 = profitFormPanelRef?.value?.getFieldsValue() || {}; | ||
463 | - // const v3 = reportFormPanelRef?.value?.getFieldsValue() || {}; | ||
464 | - // const v4 = trackFormPanelRef?.value?.getFieldsValue() || {}; | ||
465 | - // const v5 = inspectionFormPanelRef?.value?.getFieldsValue() || {}; | ||
466 | - | ||
467 | - // values.profitAnalysisInfo = { ...v2 }; | ||
468 | - // values.reportInfo = { ...v3 }; | ||
469 | - // values.trackStageInfo = { ...v4 }; | ||
470 | - // values.inspectionStageInfo = { ...v5 }; | ||
471 | - const values = baseFormPanelRef?.value?.getFieldsValue() || {}; | ||
472 | - | ||
473 | - const forms = { | ||
474 | - baseInfo: { | ||
475 | - ...values, | ||
476 | - picUrl: baseFormPanelRef?.value?.picUrl || '', | ||
477 | - smallPicUrl: baseFormPanelRef?.value?.smallPicUrl || '', | ||
478 | - }, | ||
479 | - }; | ||
480 | - await orderCreate(forms); | ||
481 | - } | ||
482 | - closeDrawer(); | ||
483 | - emit('success', {}); | ||
484 | - }; | ||
485 | - return { | ||
486 | - id, | ||
487 | - profitFormPanelRef, | ||
488 | - reportFormPanelRef, | ||
489 | - trackFormPanelRef, | ||
490 | - baseFormPanelRef, | ||
491 | - inspectionFormPanelRef, | ||
492 | - activeKey, | ||
493 | - formRef, | ||
494 | - schemas, | ||
495 | - register, | ||
496 | - registerForm, | ||
497 | - handleSubmit, | ||
498 | - }; | ||
499 | - }, | ||
500 | - }); | ||
501 | -</script> | ||
502 | - | ||
503 | -<style scoped> | ||
504 | - .ant-drawer { | ||
505 | - position: fixed; | ||
506 | - z-index: 9999; | ||
507 | - } | ||
508 | -</style> |
src/views/project/order/component/BaseFormPanel.vue renamed to src/views/project/order/FormDetail/BaseFormPanel.vue
@@ -44,7 +44,7 @@ | @@ -44,7 +44,7 @@ | ||
44 | packetType, | 44 | packetType, |
45 | } = useOrderInfo(orderStore); | 45 | } = useOrderInfo(orderStore); |
46 | 46 | ||
47 | - const schemas = computed(() => { | 47 | + var schemas = computed(() => { |
48 | const options = { | 48 | const options = { |
49 | customerCode, | 49 | customerCode, |
50 | projectNo, | 50 | projectNo, |
@@ -58,6 +58,11 @@ | @@ -58,6 +58,11 @@ | ||
58 | }; | 58 | }; |
59 | 59 | ||
60 | const res = FIELDS_BASE_INFO.map((item) => { | 60 | const res = FIELDS_BASE_INFO.map((item) => { |
61 | + console.log( | ||
62 | + '%c [ ]-62', | ||
63 | + 'font-size:13px; background:pink; color:#bf2c9f;', | ||
64 | + getDisable(fields.value?.baseFields?.picUrl, props.id), | ||
65 | + ); | ||
61 | if (item.field === 'picUrl') { | 66 | if (item.field === 'picUrl') { |
62 | return { | 67 | return { |
63 | field: 'picUrl', | 68 | field: 'picUrl', |
@@ -68,12 +73,15 @@ | @@ -68,12 +73,15 @@ | ||
68 | span: 24, | 73 | span: 24, |
69 | }, | 74 | }, |
70 | componentProps: { | 75 | componentProps: { |
71 | - imgUrl: picUrl, | ||
72 | - disabled: getDisable(fields.value?.baseFields?.picUrl), | 76 | + imgUrl: picUrl.value, |
77 | + disabled: getDisable(get(fields.value, 'picUrl'), props.id), | ||
73 | onChange: (res) => { | 78 | onChange: (res) => { |
74 | if (res.file?.response?.data) { | 79 | if (res.file?.response?.data) { |
75 | picUrl.value = res.file?.response?.data?.picUrl; | 80 | picUrl.value = res.file?.response?.data?.picUrl; |
76 | smallPicUrl.value = res.file?.response?.data?.smallPicUrl; | 81 | smallPicUrl.value = res.file?.response?.data?.smallPicUrl; |
82 | + | ||
83 | + setFieldsValue({ picUrl: picUrl.value }); | ||
84 | + clearValidate('picUrl'); | ||
77 | } | 85 | } |
78 | }, | 86 | }, |
79 | }, | 87 | }, |
@@ -94,22 +102,23 @@ | @@ -94,22 +102,23 @@ | ||
94 | return res; | 102 | return res; |
95 | }); | 103 | }); |
96 | 104 | ||
97 | - const [registerForm, { setFieldsValue, getFieldsValue, resetFields }] = useForm({ | ||
98 | - labelWidth: 120, | ||
99 | - schemas, | ||
100 | - showActionButtonGroup: false, | ||
101 | - actionColOptions: { | ||
102 | - span: 24, | ||
103 | - }, | ||
104 | - }); | 105 | + var [registerForm, { setFieldsValue, getFieldsValue, resetFields, validate, clearValidate }] = |
106 | + useForm({ | ||
107 | + labelWidth: 120, | ||
108 | + schemas, | ||
109 | + showActionButtonGroup: false, | ||
110 | + actionColOptions: { | ||
111 | + span: 24, | ||
112 | + }, | ||
113 | + }); | ||
105 | 114 | ||
106 | return { | 115 | return { |
107 | fields, | 116 | fields, |
108 | - schemas, | ||
109 | registerForm, | 117 | registerForm, |
110 | getFieldsValue, | 118 | getFieldsValue, |
111 | setFieldsValue, | 119 | setFieldsValue, |
112 | resetFields, | 120 | resetFields, |
121 | + validate, | ||
113 | picUrl, | 122 | picUrl, |
114 | smallPicUrl, | 123 | smallPicUrl, |
115 | }; | 124 | }; |
src/views/project/order/component/InspectionFormPanel.vue renamed to src/views/project/order/FormDetail/InspectionFormPanel.vue
src/views/project/order/component/ProfitFormPanel.vue renamed to src/views/project/order/FormDetail/ProfitFormPanel.vue
@@ -43,7 +43,7 @@ | @@ -43,7 +43,7 @@ | ||
43 | }); | 43 | }); |
44 | }); | 44 | }); |
45 | 45 | ||
46 | - const [registerForm, { setFieldsValue, getFieldsValue }] = useForm({ | 46 | + const [registerForm, { setFieldsValue, getFieldsValue, resetFields }] = useForm({ |
47 | labelWidth: 120, | 47 | labelWidth: 120, |
48 | schemas, | 48 | schemas, |
49 | showActionButtonGroup: false, | 49 | showActionButtonGroup: false, |
@@ -51,7 +51,8 @@ | @@ -51,7 +51,8 @@ | ||
51 | span: 24, | 51 | span: 24, |
52 | }, | 52 | }, |
53 | }); | 53 | }); |
54 | - return { fields, schemas, registerForm, getFieldsValue, setFieldsValue }; | 54 | + return { fields, schemas, registerForm, getFieldsValue, setFieldsValue, resetFields }; |
55 | }, | 55 | }, |
56 | }); | 56 | }); |
57 | </script> | 57 | </script> |
58 | +../constant |
src/views/project/order/component/ReportFormPanel.vue renamed to src/views/project/order/FormDetail/ReportFormPanel.vue
src/views/project/order/component/TrackFormPanel.vue renamed to src/views/project/order/FormDetail/TrackFormPanel.vue
src/views/project/order/FormDetail/index.vue
0 → 100644
1 | +<template> | ||
2 | + <BasicDrawer | ||
3 | + v-bind="$attrs" | ||
4 | + showFooter | ||
5 | + @register="register" | ||
6 | + @ok="handleSubmit" | ||
7 | + title="" | ||
8 | + :destroyOnClose="true" | ||
9 | + width="28%" | ||
10 | + ref="formRef" | ||
11 | + :isDetail="true" | ||
12 | + :showDetailBack="false" | ||
13 | + okText="保存" | ||
14 | + :mask="false" | ||
15 | + class="z-20" | ||
16 | + > | ||
17 | + <div className="mt-[-16px]"> | ||
18 | + <Tabs v-model:activeKey="activeKey"> | ||
19 | + <TabPanel key="1" tab="基本信息" :forceRender="true" v-if="role !== ROLE.INSPECT"> | ||
20 | + <BaseFormPanel ref="baseFormPanelRef" :id="id" /> | ||
21 | + </TabPanel> | ||
22 | + <TabPanel | ||
23 | + key="2" | ||
24 | + tab="利润分析" | ||
25 | + :forceRender="true" | ||
26 | + v-if="!!id && (role === ROLE.ADMIN || role === ROLE.BUSINESS)" | ||
27 | + > | ||
28 | + <ProfitFormPanel ref="profitFormPanelRef" :id="id" /> | ||
29 | + </TabPanel> | ||
30 | + <TabPanel | ||
31 | + key="3" | ||
32 | + tab="项目报告书" | ||
33 | + :forceRender="true" | ||
34 | + v-if="!!id && (role === ROLE.ADMIN || role === ROLE.BUSINESS)" | ||
35 | + > | ||
36 | + <ReportFormPanel ref="reportFormPanelRef" :id="id" /> | ||
37 | + </TabPanel> | ||
38 | + <TabPanel | ||
39 | + key="4" | ||
40 | + tab="跟单信息" | ||
41 | + :forceRender="true" | ||
42 | + v-if="!!id && (role === ROLE.ADMIN || role === ROLE.TRACKER)" | ||
43 | + > | ||
44 | + <TrackFormPanel ref="trackFormPanelRef" :id="id" /> | ||
45 | + </TabPanel> | ||
46 | + <TabPanel | ||
47 | + key="5" | ||
48 | + tab="质检信息" | ||
49 | + :forceRender="true" | ||
50 | + v-if="!!id && (role === ROLE.ADMIN || role === ROLE.INSPECT)" | ||
51 | + > | ||
52 | + <InspectionFormPanel ref="inspectionFormPanelRef" :id="id" /> | ||
53 | + </TabPanel> | ||
54 | + </Tabs> | ||
55 | + </div> | ||
56 | + <!-- <template #titleToolbar> <a-button type="primary"> 申请编辑权限 </a-button></template> --> | ||
57 | + | ||
58 | + <!-- <template #appendFooter> | ||
59 | + <a-button type="primary" @click="onGoCheckDetail"> 申请权限</a-button> | ||
60 | + </template> --> | ||
61 | + </BasicDrawer> | ||
62 | +</template> | ||
63 | +<script lang="ts"> | ||
64 | + import { computed, defineComponent, reactive, ref, toRaw, watch, toRefs } from 'vue'; | ||
65 | + import { FormActionType, FormSchema, useForm } from '/@/components/Form/index'; | ||
66 | + import { orderCreate, orderUpdate, uploadImg } from '/@/api/project/order'; | ||
67 | + import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; | ||
68 | + import { dateUtil } from '/@/utils/dateUtil'; | ||
69 | + import ProfitFormPanel from './ProfitFormPanel.vue'; | ||
70 | + import ReportFormPanel from './ReportFormPanel.vue'; | ||
71 | + import TrackFormPanel from './TrackFormPanel.vue'; | ||
72 | + import InspectionFormPanel from './InspectionFormPanel.vue'; | ||
73 | + import BaseFormPanel from './BaseFormPanel.vue'; | ||
74 | + import { useUserStoreWithOut } from '/@/store/modules/user'; | ||
75 | + import { ROLE } from '../type.d'; | ||
76 | + | ||
77 | + import { Tabs } from 'ant-design-vue'; | ||
78 | + | ||
79 | + const userStore = useUserStoreWithOut(); | ||
80 | + | ||
81 | + const TabPanel = Tabs.TabPane; | ||
82 | + | ||
83 | + export default defineComponent({ | ||
84 | + components: { | ||
85 | + BasicDrawer, | ||
86 | + BaseFormPanel, | ||
87 | + Tabs, | ||
88 | + TabPanel, | ||
89 | + ProfitFormPanel, | ||
90 | + ReportFormPanel, | ||
91 | + TrackFormPanel, | ||
92 | + InspectionFormPanel, | ||
93 | + }, | ||
94 | + | ||
95 | + props: { | ||
96 | + detailData: { | ||
97 | + type: Object, | ||
98 | + }, | ||
99 | + onGoCheckDetail: { | ||
100 | + type: Function, | ||
101 | + }, | ||
102 | + }, | ||
103 | + emits: ['success'], | ||
104 | + setup(_, { emit }) { | ||
105 | + const activeKey = ref('1'); | ||
106 | + const baseFormPanelRef = ref(); | ||
107 | + const profitFormPanelRef = ref(); | ||
108 | + const reportFormPanelRef = ref(); | ||
109 | + const trackFormPanelRef = ref(); | ||
110 | + const inspectionFormPanelRef = ref(); | ||
111 | + | ||
112 | + const formRef = ref<FormActionType | null>(null); | ||
113 | + const id = ref(''); | ||
114 | + | ||
115 | + const role = computed(() => { | ||
116 | + return userStore.getUserInfo?.roleSmallVO?.code; | ||
117 | + }); | ||
118 | + | ||
119 | + const picUrl = ref(''); | ||
120 | + let fields = reactive({ baseFields: {} }); | ||
121 | + | ||
122 | + const [register, { closeDrawer }] = useDrawerInner((data) => { | ||
123 | + if (!data.id) { | ||
124 | + id.value = ''; | ||
125 | + picUrl.value = ''; | ||
126 | + // 新建 | ||
127 | + baseFormPanelRef?.value?.resetFields(); | ||
128 | + profitFormPanelRef?.value?.resetFields(); | ||
129 | + reportFormPanelRef?.value?.resetFields(); | ||
130 | + trackFormPanelRef?.value?.resetFields(); | ||
131 | + inspectionFormPanelRef?.value?.resetFields(); | ||
132 | + | ||
133 | + return; | ||
134 | + } | ||
135 | + id.value = data.id; | ||
136 | + | ||
137 | + // 方式1 | ||
138 | + picUrl.value = data.picUrl; | ||
139 | + data.orderHodTime = data.orderHodTime ? dateUtil(data.orderHodTime) : null; | ||
140 | + data.productionDepartmentConsignTime = data.productionDepartmentConsignTime | ||
141 | + ? dateUtil(data.productionDepartmentConsignTime) | ||
142 | + : null; | ||
143 | + | ||
144 | + fields.baseFields = { | ||
145 | + ...fields.baseFields, | ||
146 | + ...data.lockFields.baseFields, | ||
147 | + }; | ||
148 | + | ||
149 | + if (id.value) { | ||
150 | + setTimeout(() => { | ||
151 | + // 基本信息 | ||
152 | + if (baseFormPanelRef.value) { | ||
153 | + baseFormPanelRef.value.fields = { ...data.lockFields?.baseFields } || {}; | ||
154 | + baseFormPanelRef.value.setFieldsValue({ | ||
155 | + ...toRaw(data), | ||
156 | + }); | ||
157 | + baseFormPanelRef.value.picUrl = data.picUrl; | ||
158 | + baseFormPanelRef.value.smallPicUrl = data.smallPicUrl; | ||
159 | + } | ||
160 | + | ||
161 | + if (profitFormPanelRef.value) { | ||
162 | + // 利润分析 | ||
163 | + profitFormPanelRef.value.fields = { ...data.lockFields?.profitAnalysisFields } || {}; | ||
164 | + profitFormPanelRef?.value?.setFieldsValue({ | ||
165 | + ...toRaw(data.profitAnalysisInfo), | ||
166 | + }); | ||
167 | + } | ||
168 | + | ||
169 | + if (reportFormPanelRef.value) { | ||
170 | + // 项目报告书 | ||
171 | + reportFormPanelRef.value.fields = { ...data.lockFields?.reportFields } || {}; | ||
172 | + reportFormPanelRef?.value?.setFieldsValue({ | ||
173 | + ...toRaw(data.reportInfo), | ||
174 | + }); | ||
175 | + } | ||
176 | + if (trackFormPanelRef.value) { | ||
177 | + // 跟单信息 | ||
178 | + trackFormPanelRef.value.fields = { ...data.lockFields?.trackStageFields } || {}; | ||
179 | + trackFormPanelRef?.value?.setFieldsValue({ | ||
180 | + ...toRaw(data.trackStageInfo), | ||
181 | + }); | ||
182 | + } | ||
183 | + | ||
184 | + if (inspectionFormPanelRef.value) { | ||
185 | + // 质检信息 | ||
186 | + inspectionFormPanelRef.value.fields = | ||
187 | + { ...data.lockFields?.inspectionStageFields } || {}; | ||
188 | + inspectionFormPanelRef?.value?.setFieldsValue({ | ||
189 | + ...toRaw(data.trackStageInfo), | ||
190 | + }); | ||
191 | + } | ||
192 | + }, 100); | ||
193 | + } else { | ||
194 | + baseFormPanelRef.value.resetFields(); | ||
195 | + } | ||
196 | + }); | ||
197 | + | ||
198 | + const handleSubmit = async () => { | ||
199 | + if (id.value) { | ||
200 | + const forms = { orderId: id.value } as any; | ||
201 | + if (activeKey.value === '1') { | ||
202 | + try { | ||
203 | + await baseFormPanelRef?.value?.validate(); | ||
204 | + | ||
205 | + forms.baseInfo = baseFormPanelRef?.value?.getFieldsValue() || {}; | ||
206 | + forms.baseInfo = { | ||
207 | + ...forms.baseInfo, | ||
208 | + picUrl: baseFormPanelRef?.value?.picUrl || '', | ||
209 | + smallPicUrl: baseFormPanelRef?.value?.smallPicUrl || '', | ||
210 | + }; | ||
211 | + await orderUpdate(forms); | ||
212 | + closeDrawer(); | ||
213 | + emit('success', {}); | ||
214 | + } catch (error) { | ||
215 | + console.log(error); | ||
216 | + } | ||
217 | + } else { | ||
218 | + if (activeKey.value === '2') { | ||
219 | + forms.profitAnalysisInfo = profitFormPanelRef?.value?.getFieldsValue() || {}; | ||
220 | + } else if (activeKey.value === '3') { | ||
221 | + forms.reportInfo = reportFormPanelRef?.value?.getFieldsValue() || {}; | ||
222 | + } else if (activeKey.value === '4') { | ||
223 | + forms.trackStageInfo = trackFormPanelRef?.value?.getFieldsValue() || {}; | ||
224 | + } else if (activeKey.value === '5') { | ||
225 | + forms.inspectionStageInfo = inspectionFormPanelRef?.value?.getFieldsValue() || {}; | ||
226 | + } | ||
227 | + await orderUpdate(forms); | ||
228 | + closeDrawer(); | ||
229 | + emit('success', {}); | ||
230 | + } | ||
231 | + } else { | ||
232 | + try { | ||
233 | + await baseFormPanelRef?.value?.validate(); | ||
234 | + | ||
235 | + // 新建只有基本信息 | ||
236 | + const values = baseFormPanelRef?.value?.getFieldsValue() || {}; | ||
237 | + | ||
238 | + const forms = { | ||
239 | + baseInfo: { | ||
240 | + ...values, | ||
241 | + picUrl: baseFormPanelRef?.value?.picUrl || '', | ||
242 | + smallPicUrl: baseFormPanelRef?.value?.smallPicUrl || '', | ||
243 | + }, | ||
244 | + }; | ||
245 | + await orderCreate(forms); | ||
246 | + closeDrawer(); | ||
247 | + emit('success', {}); | ||
248 | + } catch (error) { | ||
249 | + console.log(error); | ||
250 | + } | ||
251 | + } | ||
252 | + }; | ||
253 | + return { | ||
254 | + id, | ||
255 | + profitFormPanelRef, | ||
256 | + reportFormPanelRef, | ||
257 | + trackFormPanelRef, | ||
258 | + baseFormPanelRef, | ||
259 | + inspectionFormPanelRef, | ||
260 | + activeKey, | ||
261 | + formRef, | ||
262 | + ROLE, | ||
263 | + role, | ||
264 | + register, | ||
265 | + handleSubmit, | ||
266 | + }; | ||
267 | + }, | ||
268 | + }); | ||
269 | +</script> | ||
270 | + | ||
271 | +<style scoped> | ||
272 | + .ant-drawer { | ||
273 | + position: fixed; | ||
274 | + z-index: 9999; | ||
275 | + } | ||
276 | +</style> |
src/views/project/order/HistoryDetail.vue
1 | <template> | 1 | <template> |
2 | <BasicDrawer | 2 | <BasicDrawer |
3 | + @register="register" | ||
3 | v-bind="$attrs" | 4 | v-bind="$attrs" |
4 | title="操作记录" | 5 | title="操作记录" |
5 | width="60%" | 6 | width="60%" |
6 | :isDetail="true" | 7 | :isDetail="true" |
7 | :showDetailBack="false" | 8 | :showDetailBack="false" |
8 | okText="保存" | 9 | okText="保存" |
10 | + :destroyOnClose="true" | ||
9 | > | 11 | > |
10 | - <Tabs animated> | ||
11 | - <template v-for="i in achieveList" :key="i.key"> | ||
12 | - <TabPane :tab="i.name" /> | ||
13 | - </template> | 12 | + <Tabs v-model:activeKey="activeKey" className="my-0"> |
13 | + <TabPanel :key="1" tab="操作记录" className="w-full"> | ||
14 | + <a-list :pagination="pagination1" className="w-full"> | ||
15 | + <template v-for="item in list1" :key="item.id"> | ||
16 | + <a-list-item class="list"> | ||
17 | + <a-list-item-meta> | ||
18 | + <template #avatar> </template> | ||
19 | + <template #title> | ||
20 | + <span>{{ item.userName }}</span> | ||
21 | + </template> | ||
22 | + <template #description> | ||
23 | + <div class="description"> | ||
24 | + {{ item.optType }} | ||
25 | + </div> | ||
26 | + <div class="info"> | ||
27 | + <div><span>操作时间:</span>{{ formatToDateTime(item.createTime) }}</div> | ||
28 | + </div> | ||
29 | + </template> | ||
30 | + </a-list-item-meta> | ||
31 | + </a-list-item> | ||
32 | + </template> | ||
33 | + </a-list> | ||
34 | + </TabPanel> | ||
35 | + <TabPanel :key="2" tab="审批记录" className="w-full"> | ||
36 | + <a-list :pagination="pagination2" className="w-full"> | ||
37 | + <template v-for="item in list2" :key="item.id"> | ||
38 | + <a-list-item class="list"> | ||
39 | + <a-list-item-meta> | ||
40 | + <template #avatar> </template> | ||
41 | + <template #title> | ||
42 | + <span>{{ item.applyUserName }}</span> | ||
43 | + </template> | ||
44 | + <template #description> | ||
45 | + <div class="description"> | ||
46 | + {{ item.applyRemark }} | ||
47 | + </div> | ||
48 | + <div class="info"> | ||
49 | + <div><span>操作时间:</span>{{ formatToDateTime(item.createTime) }}</div> | ||
50 | + </div> | ||
51 | + </template> | ||
52 | + </a-list-item-meta> | ||
53 | + </a-list-item> | ||
54 | + </template> | ||
55 | + </a-list> | ||
56 | + </TabPanel> | ||
14 | </Tabs> | 57 | </Tabs> |
15 | - <PageWrapper class="prefixCls"> | ||
16 | - <a-list :pagination="pagination" style="width: 100%"> | ||
17 | - <template v-for="item in list" :key="item.id"> | ||
18 | - <a-list-item class="list"> | ||
19 | - <a-list-item-meta> | ||
20 | - <template #avatar> | ||
21 | - <!-- <Icon class="icon" v-if="item.icon" :icon="item.icon" :color="item.color" /> --> | ||
22 | - </template> | ||
23 | - <template #title> | ||
24 | - <!-- <span>{{ item.title }}</span> --> | ||
25 | - <span>操作人</span> | ||
26 | - <!-- <div class="extra" v-if="item.extra"> | ||
27 | - {{ item.extra }} | ||
28 | - </div> --> | ||
29 | - </template> | ||
30 | - <template #description> | ||
31 | - <div class="description"> | ||
32 | - <!-- {{ item.description }} --> | ||
33 | - 干了什么 | ||
34 | - </div> | ||
35 | - <div class="info"> | ||
36 | - <div><span>操作时间</span>{{ item.datetime }}</div> | ||
37 | - </div> | ||
38 | - </template> | ||
39 | - </a-list-item-meta> | ||
40 | - </a-list-item> | ||
41 | - </template> | ||
42 | - </a-list> | ||
43 | - </PageWrapper> | ||
44 | - <!-- <template #titleToolbar> <a-button type="primary"> 申请编辑权限 </a-button></template> --> | ||
45 | 58 | ||
59 | + <!-- <template #titleToolbar> <a-button type="primary"> 申请编辑权限 </a-button></template> --> | ||
46 | <template #appendFooter> | 60 | <template #appendFooter> |
47 | <!-- <a-button type="primary" @click="onGoCheckDetail"> 申请权限</a-button> --> | 61 | <!-- <a-button type="primary" @click="onGoCheckDetail"> 申请权限</a-button> --> |
48 | </template> | 62 | </template> |
49 | </BasicDrawer> | 63 | </BasicDrawer> |
50 | </template> | 64 | </template> |
51 | <script lang="ts"> | 65 | <script lang="ts"> |
52 | - import { defineComponent } from 'vue'; | 66 | + import { defineComponent, ref, computed } from 'vue'; |
53 | import { Tabs, Progress, Row, Col, List } from 'ant-design-vue'; | 67 | import { Tabs, Progress, Row, Col, List } from 'ant-design-vue'; |
54 | - import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; | ||
55 | - import { cardList } from './data'; | ||
56 | - import { PageWrapper } from '/@/components/Page'; | 68 | + import { FormSchema, useForm } from '/@/components/Form/index'; |
57 | 69 | ||
58 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; | 70 | import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; |
71 | + import { getOrderAuditLog, getOrderOptLog } from '/@/api/project/order'; | ||
72 | + import { formatToDateTime } from '/@/utils/dateUtil'; | ||
73 | + | ||
74 | + const TabPanel = Tabs.TabPane; | ||
59 | 75 | ||
60 | const schemas: FormSchema[] = [ | 76 | const schemas: FormSchema[] = [ |
61 | { | 77 | { |
@@ -83,7 +99,7 @@ | @@ -83,7 +99,7 @@ | ||
83 | const achieveList = [ | 99 | const achieveList = [ |
84 | { | 100 | { |
85 | key: '1', | 101 | key: '1', |
86 | - name: '编辑记录', | 102 | + name: '操作记录', |
87 | }, | 103 | }, |
88 | { | 104 | { |
89 | key: '2', | 105 | key: '2', |
@@ -94,10 +110,10 @@ | @@ -94,10 +110,10 @@ | ||
94 | components: { | 110 | components: { |
95 | BasicDrawer, | 111 | BasicDrawer, |
96 | Tabs, | 112 | Tabs, |
113 | + TabPanel, | ||
97 | [List.name]: List, | 114 | [List.name]: List, |
98 | [List.Item.name]: List.Item, | 115 | [List.Item.name]: List.Item, |
99 | AListItemMeta: List.Item.Meta, | 116 | AListItemMeta: List.Item.Meta, |
100 | - PageWrapper, | ||
101 | }, | 117 | }, |
102 | props: { | 118 | props: { |
103 | onGoCheckDetail: { | 119 | onGoCheckDetail: { |
@@ -105,45 +121,71 @@ | @@ -105,45 +121,71 @@ | ||
105 | }, | 121 | }, |
106 | }, | 122 | }, |
107 | setup() { | 123 | setup() { |
108 | - const [registerForm, { setFieldsValue }] = useForm({ | ||
109 | - labelWidth: 120, | ||
110 | - schemas, | ||
111 | - showActionButtonGroup: false, | ||
112 | - actionColOptions: { | ||
113 | - span: 24, | ||
114 | - }, | ||
115 | - }); | 124 | + const list1 = ref([]); |
125 | + const total1 = ref(0); | ||
126 | + const page1 = ref(1); | ||
127 | + | ||
128 | + const list2 = ref([]); | ||
129 | + const total2 = ref(0); | ||
130 | + const page2 = ref(1); | ||
131 | + const orderId = ref(''); | ||
132 | + const activeKey = ref(1); | ||
133 | + | ||
134 | + const getOrderOptLogFunc = async (data, index, page) => { | ||
135 | + if (index === 1) { | ||
136 | + const res = await getOrderOptLog({ orderId: data.id, page: page, pageSize: 20 }); | ||
137 | + list1.value = res.records; | ||
138 | + total1.value = res.total; | ||
139 | + page1.value = page; | ||
140 | + } else { | ||
141 | + const res = await getOrderAuditLog({ orderId: data.id, page: page, pageSize: 20 }); | ||
142 | + list2.value = res.records; | ||
143 | + total2.value = res.total; | ||
144 | + page2.value = page; | ||
145 | + } | ||
146 | + }; | ||
116 | const [register] = useDrawerInner((data) => { | 147 | const [register] = useDrawerInner((data) => { |
117 | - // 方式1 | ||
118 | - setFieldsValue({ | ||
119 | - field2: data.data, | ||
120 | - field1: data.info, | ||
121 | - }); | 148 | + orderId.value = data.id; |
149 | + getOrderOptLogFunc(orderId.value, 1, 1); | ||
150 | + getOrderOptLogFunc(orderId.value, 2, 1); | ||
151 | + }); | ||
152 | + | ||
153 | + const pagination1 = computed(() => { | ||
154 | + return { | ||
155 | + show: true, | ||
156 | + pageSize: 20, | ||
157 | + page: page1.value, | ||
158 | + total: total1.value, | ||
159 | + onChange(cur) { | ||
160 | + getOrderOptLogFunc(orderId.value, 1, cur); | ||
161 | + }, | ||
162 | + }; | ||
163 | + }); | ||
164 | + | ||
165 | + const pagination2 = computed(() => { | ||
166 | + return { | ||
167 | + show: true, | ||
168 | + pageSize: 20, | ||
169 | + page: page1.value, | ||
170 | + total: total1.value, | ||
171 | + onChange(cur) { | ||
172 | + getOrderOptLogFunc(orderId.value, 2, cur); | ||
173 | + }, | ||
174 | + }; | ||
122 | }); | 175 | }); |
176 | + | ||
123 | return { | 177 | return { |
124 | register, | 178 | register, |
125 | schemas, | 179 | schemas, |
126 | - registerForm, | ||
127 | achieveList, | 180 | achieveList, |
128 | - list: cardList, | 181 | + list1, |
182 | + list2, | ||
129 | prefixCls: 'account-center', | 183 | prefixCls: 'account-center', |
130 | - | ||
131 | - pagination: { | ||
132 | - show: true, | ||
133 | - pageSize: 3, | ||
134 | - }, | 184 | + pagination1, |
185 | + pagination2, | ||
186 | + activeKey, | ||
187 | + formatToDateTime, | ||
135 | }; | 188 | }; |
136 | }, | 189 | }, |
137 | }); | 190 | }); |
138 | </script> | 191 | </script> |
139 | - | ||
140 | -<style lang="less" scoped> | ||
141 | - .account-center { | ||
142 | - &-bottom { | ||
143 | - margin: 0 16px 16px; | ||
144 | - padding: 10px; | ||
145 | - border-radius: 3px; | ||
146 | - background-color: @component-background; | ||
147 | - } | ||
148 | - } | ||
149 | -</style> |
src/views/project/order/ProfitAnalysis.vue
@@ -4,10 +4,10 @@ | @@ -4,10 +4,10 @@ | ||
4 | destroyOnClose | 4 | destroyOnClose |
5 | @register="register" | 5 | @register="register" |
6 | title="利润分析表" | 6 | title="利润分析表" |
7 | - :helpMessage="['提示1', '提示2']" | ||
8 | @visible-change="handleShow" | 7 | @visible-change="handleShow" |
9 | :footer="null" | 8 | :footer="null" |
10 | > | 9 | > |
10 | + <!-- :helpMessage="['提示1', '提示2']" --> | ||
11 | <!-- <template #insertFooter> | 11 | <!-- <template #insertFooter> |
12 | <a-button type="primary" danger @click="setLines" :disabled="loading">点我更新内容</a-button> | 12 | <a-button type="primary" danger @click="setLines" :disabled="loading">点我更新内容</a-button> |
13 | </template> --> | 13 | </template> --> |
@@ -19,7 +19,7 @@ | @@ -19,7 +19,7 @@ | ||
19 | layout="vertical" | 19 | layout="vertical" |
20 | :collapseOptions="{ canExpand: true, helpMessage: 'help me' }" | 20 | :collapseOptions="{ canExpand: true, helpMessage: 'help me' }" |
21 | :column="2" | 21 | :column="2" |
22 | - :data="mockData" | 22 | + :data="info" |
23 | :schema="schema" | 23 | :schema="schema" |
24 | /> | 24 | /> |
25 | </BasicModal> | 25 | </BasicModal> |
@@ -35,33 +35,31 @@ | @@ -35,33 +35,31 @@ | ||
35 | setup() { | 35 | setup() { |
36 | const loading = ref(true); | 36 | const loading = ref(true); |
37 | const lines = ref(10); | 37 | const lines = ref(10); |
38 | + const info = ref({}); | ||
38 | const [register, { setModalProps, redoModalHeight }] = useModalInner(async (data) => { | 39 | const [register, { setModalProps, redoModalHeight }] = useModalInner(async (data) => { |
39 | const orderIds = toRaw(data.data); | 40 | const orderIds = toRaw(data.data); |
40 | const res = await orderAnalysis({ orderIds }); | 41 | const res = await orderAnalysis({ orderIds }); |
42 | + | ||
43 | + info.value = { | ||
44 | + ...(res || {}), | ||
45 | + }; | ||
41 | }); | 46 | }); |
42 | - const mockData = { | ||
43 | - username: '100', | ||
44 | - nickName: '100', | ||
45 | - age: '123', | ||
46 | - phone: '1222', | ||
47 | - addr: '2332', | ||
48 | - }; | ||
49 | 47 | ||
50 | const schema: DescItem[] = [ | 48 | const schema: DescItem[] = [ |
51 | { | 49 | { |
52 | - field: 'username', | 50 | + field: 'customerTotalPrice', |
53 | label: '客户总金额', | 51 | label: '客户总金额', |
54 | }, | 52 | }, |
55 | { | 53 | { |
56 | - field: 'nickName', | 54 | + field: 'packetTotalPrice', |
57 | label: '供应商总价', | 55 | label: '供应商总价', |
58 | }, | 56 | }, |
59 | { | 57 | { |
60 | - field: 'phone', | 58 | + field: 'productionDepartmentTotalPrice', |
61 | label: '包装费用', | 59 | label: '包装费用', |
62 | }, | 60 | }, |
63 | { | 61 | { |
64 | - field: 'addr', | 62 | + field: 'profitRate', |
65 | label: '总利润率', | 63 | label: '总利润率', |
66 | }, | 64 | }, |
67 | ]; | 65 | ]; |
@@ -88,7 +86,7 @@ | @@ -88,7 +86,7 @@ | ||
88 | function setLines() { | 86 | function setLines() { |
89 | lines.value = Math.round(Math.random() * 20 + 10); | 87 | lines.value = Math.round(Math.random() * 20 + 10); |
90 | } | 88 | } |
91 | - return { register, loading, handleShow, lines, setLines, mockData, schema }; | 89 | + return { register, loading, handleShow, lines, setLines, info, schema }; |
92 | }, | 90 | }, |
93 | }); | 91 | }); |
94 | </script> | 92 | </script> |
src/views/project/order/data.tsx deleted
100644 → 0
1 | -export const cardList = (() => { | ||
2 | - const result: any[] = []; | ||
3 | - for (let i = 0; i < 6; i++) { | ||
4 | - result.push({ | ||
5 | - id: i, | ||
6 | - title: 'Vben Admin', | ||
7 | - description: '基于Vue Next, TypeScript, Ant Design Vue实现的一套完整的企业级后台管理系统', | ||
8 | - datetime: '2020-11-26 17:39', | ||
9 | - extra: '编辑', | ||
10 | - icon: 'logos:vue', | ||
11 | - color: '#1890ff', | ||
12 | - author: 'Vben', | ||
13 | - percent: 20 * (i + 1), | ||
14 | - }); | ||
15 | - } | ||
16 | - return result; | ||
17 | -})(); |
src/views/project/order/index.vue
@@ -44,13 +44,6 @@ | @@ -44,13 +44,6 @@ | ||
44 | }, | 44 | }, |
45 | ]" | 45 | ]" |
46 | :dropDownActions="[ | 46 | :dropDownActions="[ |
47 | - // { | ||
48 | - // label: '启用', | ||
49 | - // popConfirm: { | ||
50 | - // title: '是否启用?', | ||
51 | - // confirm: handleOpen.bind(null, record), | ||
52 | - // }, | ||
53 | - // }, | ||
54 | { | 47 | { |
55 | label: '历史记录', | 48 | label: '历史记录', |
56 | onClick: handleHistory.bind(null, record), | 49 | onClick: handleHistory.bind(null, record), |
@@ -94,22 +87,24 @@ | @@ -94,22 +87,24 @@ | ||
94 | import { FormOutlined } from '@ant-design/icons-vue'; | 87 | import { FormOutlined } from '@ant-design/icons-vue'; |
95 | import HeaderCell from '/@/components/Table/src/components/HeaderCell.vue'; | 88 | import HeaderCell from '/@/components/Table/src/components/HeaderCell.vue'; |
96 | import { Alert } from 'ant-design-vue'; | 89 | import { Alert } from 'ant-design-vue'; |
97 | - import { SELECT_FIELD_COLUMNS } from './selectData'; | ||
98 | 90 | ||
99 | import { useDrawer } from '/@/components/Drawer'; | 91 | import { useDrawer } from '/@/components/Drawer'; |
100 | import ProfitAnalysis from './ProfitAnalysis.vue'; | 92 | import ProfitAnalysis from './ProfitAnalysis.vue'; |
101 | import { useModal } from '/@/components/Modal'; | 93 | import { useModal } from '/@/components/Modal'; |
102 | 94 | ||
103 | - import { getFormConfig, getOrderColumns } from './tableData'; | ||
104 | - import FormDetail from './FormDetail.vue'; | 95 | + import { getFormConfig, getOrderColumns, SELECT_FIELD_COLUMNS } from './tableData'; |
96 | + import FormDetail from './FormDetail/index.vue'; | ||
105 | import CheckDetail from './CheckDetail.vue'; | 97 | import CheckDetail from './CheckDetail.vue'; |
106 | import HistoryDetail from './HistoryDetail.vue'; | 98 | import HistoryDetail from './HistoryDetail.vue'; |
107 | import FieldDetail from './FieldDetail.vue'; | 99 | import FieldDetail from './FieldDetail.vue'; |
108 | import { createImgPreview } from '/@/components/Preview/index'; | 100 | import { createImgPreview } from '/@/components/Preview/index'; |
109 | import { getOrderList, orderExport } from '/@/api/project/order'; | 101 | import { getOrderList, orderExport } from '/@/api/project/order'; |
110 | import { useOrderStoreWithOut } from '/@/store/modules/order'; | 102 | import { useOrderStoreWithOut } from '/@/store/modules/order'; |
103 | + import { keyBy, reduce } from 'lodash-es'; | ||
104 | + import { useUserStoreWithOut } from '/@/store/modules/user'; | ||
111 | 105 | ||
112 | const orderStore = useOrderStoreWithOut(); | 106 | const orderStore = useOrderStoreWithOut(); |
107 | + const userStore = useUserStoreWithOut(); | ||
113 | 108 | ||
114 | export default defineComponent({ | 109 | export default defineComponent({ |
115 | components: { | 110 | components: { |
@@ -132,26 +127,20 @@ | @@ -132,26 +127,20 @@ | ||
132 | const [historyDetailRegister, { openDrawer: openHistoryDetailDrawer }] = useDrawer(); | 127 | const [historyDetailRegister, { openDrawer: openHistoryDetailDrawer }] = useDrawer(); |
133 | const [fieldDetailRegister, { openDrawer: openFieldDetailDrawer }] = useDrawer(); | 128 | const [fieldDetailRegister, { openDrawer: openFieldDetailDrawer }] = useDrawer(); |
134 | 129 | ||
130 | + const user = userStore.getUserInfo; | ||
131 | + | ||
135 | const [checkModalRegister, { openDrawer: openCheckDetailDrawer }] = useDrawer(); | 132 | const [checkModalRegister, { openDrawer: openCheckDetailDrawer }] = useDrawer(); |
136 | onMounted(async () => { | 133 | onMounted(async () => { |
137 | await orderStore.getDict(); | 134 | await orderStore.getDict(); |
138 | }); | 135 | }); |
139 | 136 | ||
140 | - const [registerTable, { getForm, reload }] = useTable({ | 137 | + const [registerTable, { getForm, reload, getColumns }] = useTable({ |
141 | api: getOrderList, | 138 | api: getOrderList, |
142 | title: '订单列表', | 139 | title: '订单列表', |
143 | - // api: () => { | ||
144 | - // const res = demoListApi(); | ||
145 | - // total.value = res.data.total; | ||
146 | - // return res; | ||
147 | - // // }, | ||
148 | - // pagination: { | ||
149 | - // total: 30, | ||
150 | - // }, | ||
151 | pagination: { | 140 | pagination: { |
152 | total: 60, | 141 | total: 60, |
153 | }, | 142 | }, |
154 | - columns: getOrderColumns(), | 143 | + columns: getOrderColumns(user?.roleSmallVO?.code), |
155 | useSearchForm: true, | 144 | useSearchForm: true, |
156 | formConfig: getFormConfig(), | 145 | formConfig: getFormConfig(), |
157 | showTableSetting: true, | 146 | showTableSetting: true, |
@@ -161,8 +150,8 @@ | @@ -161,8 +150,8 @@ | ||
161 | rowSelection: { | 150 | rowSelection: { |
162 | type: 'checkbox', | 151 | type: 'checkbox', |
163 | selectedRowKeys: checkedKeys, | 152 | selectedRowKeys: checkedKeys, |
164 | - onSelect: onSelect, | ||
165 | - onSelectAll: onSelectAll, | 153 | + onSelect, |
154 | + onSelectAll, | ||
166 | }, | 155 | }, |
167 | actionColumn: { | 156 | actionColumn: { |
168 | width: 160, | 157 | width: 160, |
@@ -216,8 +205,6 @@ | @@ -216,8 +205,6 @@ | ||
216 | return false; | 205 | return false; |
217 | } | 206 | } |
218 | 207 | ||
219 | - function handleOpen(record: Recordable) {} | ||
220 | - | ||
221 | function handleProfitModal() { | 208 | function handleProfitModal() { |
222 | openProfitModal(true, { | 209 | openProfitModal(true, { |
223 | data: checkedKeys.value, | 210 | data: checkedKeys.value, |
@@ -246,7 +233,66 @@ | @@ -246,7 +233,66 @@ | ||
246 | } | 233 | } |
247 | 234 | ||
248 | async function handleExport() { | 235 | async function handleExport() { |
249 | - await orderExport(); | 236 | + const columns = getColumns(); |
237 | + const colObj = keyBy(columns, 'dataIndex'); | ||
238 | + const { | ||
239 | + trackStageInfo, | ||
240 | + reportInfo, | ||
241 | + profitAnalysisInfo, | ||
242 | + inspectionStageInfo, | ||
243 | + ...baseFields | ||
244 | + } = colObj; | ||
245 | + | ||
246 | + for (const key in baseFields) { | ||
247 | + baseFields[key] = 'selected'; | ||
248 | + } | ||
249 | + delete baseFields.action; | ||
250 | + | ||
251 | + const fieldVO = { | ||
252 | + baseFields, | ||
253 | + profitAnalysisFields: profitAnalysisInfo?.children?.length | ||
254 | + ? reduce( | ||
255 | + profitAnalysisInfo.children, | ||
256 | + (result, item) => { | ||
257 | + result[item.dataIndex] = 'selected'; | ||
258 | + return result; | ||
259 | + }, | ||
260 | + {}, | ||
261 | + ) | ||
262 | + : {}, | ||
263 | + reportFields: reportInfo?.children?.length | ||
264 | + ? reduce( | ||
265 | + reportInfo.children, | ||
266 | + (result, item) => { | ||
267 | + result[item.dataIndex] = 'selected'; | ||
268 | + return result; | ||
269 | + }, | ||
270 | + {}, | ||
271 | + ) | ||
272 | + : {}, | ||
273 | + trackStageFields: trackStageInfo?.children?.length | ||
274 | + ? reduce( | ||
275 | + trackStageInfo.children, | ||
276 | + (result, item) => { | ||
277 | + result[item.dataIndex] = 'selected'; | ||
278 | + return result; | ||
279 | + }, | ||
280 | + {}, | ||
281 | + ) | ||
282 | + : {}, | ||
283 | + inspectionStageFields: inspectionStageInfo?.children?.length | ||
284 | + ? reduce( | ||
285 | + inspectionStageInfo.children, | ||
286 | + (result, item) => { | ||
287 | + result[item.dataIndex] = 'selected'; | ||
288 | + return result; | ||
289 | + }, | ||
290 | + {}, | ||
291 | + ) | ||
292 | + : {}, | ||
293 | + }; | ||
294 | + | ||
295 | + await orderExport({ fieldVO }); | ||
250 | } | 296 | } |
251 | 297 | ||
252 | const handleFormSuccess = () => { | 298 | const handleFormSuccess = () => { |
@@ -255,7 +301,6 @@ | @@ -255,7 +301,6 @@ | ||
255 | 301 | ||
256 | return { | 302 | return { |
257 | SELECT_FIELD_COLUMNS, | 303 | SELECT_FIELD_COLUMNS, |
258 | - | ||
259 | fieldDetailRegister, | 304 | fieldDetailRegister, |
260 | profitModalRegister, | 305 | profitModalRegister, |
261 | historyDetailRegister, | 306 | historyDetailRegister, |
@@ -267,7 +312,6 @@ | @@ -267,7 +312,6 @@ | ||
267 | onSelect, | 312 | onSelect, |
268 | handleEdit, | 313 | handleEdit, |
269 | handleCheck, | 314 | handleCheck, |
270 | - handleOpen, | ||
271 | onSelectAll, | 315 | onSelectAll, |
272 | tooltipVisible, | 316 | tooltipVisible, |
273 | handleFieldVisible, | 317 | handleFieldVisible, |
@@ -297,3 +341,4 @@ | @@ -297,3 +341,4 @@ | ||
297 | height: 100px; | 341 | height: 100px; |
298 | } | 342 | } |
299 | </style> | 343 | </style> |
344 | +./constant |
src/views/project/order/selectData.tsx deleted
100644 → 0
src/views/project/order/tableData.tsx
1 | +import { ROLE } from './type.d'; | ||
1 | import { useOrderInfo } from '/@/hooks/component/order'; | 2 | import { useOrderInfo } from '/@/hooks/component/order'; |
2 | import { useOrderStoreWithOut } from '/@/store/modules/order'; | 3 | import { useOrderStoreWithOut } from '/@/store/modules/order'; |
3 | 4 | ||
4 | -export function getOrderColumns() { | ||
5 | - return [ | ||
6 | - { | ||
7 | - title: '客户编码', | ||
8 | - width: 150, | ||
9 | - dataIndex: 'customerCode', | ||
10 | - }, | ||
11 | - { | ||
12 | - title: '项目号', | ||
13 | - width: 150, | ||
14 | - dataIndex: 'projectNo', | ||
15 | - }, | ||
16 | - { | ||
17 | - title: '生产科', | ||
18 | - width: 150, | ||
19 | - dataIndex: 'productionDepartment', | ||
20 | - }, | ||
21 | - { | ||
22 | - title: '内部编号', | ||
23 | - width: 150, | ||
24 | - dataIndex: 'innerNo', | ||
25 | - }, | ||
26 | - { | ||
27 | - title: '客户po号', | ||
28 | - width: 150, | ||
29 | - dataIndex: 'customerPo', | ||
30 | - }, | 5 | +// 角色 |
6 | +// 业务员- 查看all,编辑-利润分析,报告书 | ||
7 | +// 跟单员- 查看利润分析(单价和总金额),跟单,质检,编辑 | ||
8 | +// 质检员- 查看跟单,质检,编辑质检 | ||
31 | 9 | ||
32 | - { | ||
33 | - title: '客户STYLE', | ||
34 | - width: 150, | ||
35 | - dataIndex: 'customerStyle', | ||
36 | - }, | 10 | +// 可选择的列 |
11 | +export const SELECT_FIELD_COLUMNS = [ | ||
12 | + 'projectNo', | ||
13 | + 'customerCode', | ||
14 | + 'innerNo', | ||
15 | + 'poColor', | ||
16 | + 'cnColor', | ||
17 | + 'productStyle', | ||
18 | + 'outboundType', | ||
19 | + 'packetType', | ||
20 | + 'midCheckResult', | ||
21 | + 'endCheckResult', | ||
22 | +]; | ||
37 | 23 | ||
38 | - { | ||
39 | - title: 'Modelo(REFERENCE)', | ||
40 | - width: 150, | ||
41 | - dataIndex: 'modeleLo', | ||
42 | - }, | 24 | +/** |
25 | + * | ||
26 | + * @returns 订单列表数据 | ||
27 | + */ | ||
28 | +const ORDER_LIST_BASE_FIELDS = [ | ||
29 | + { | ||
30 | + title: '客户编码', | ||
31 | + width: 150, | ||
32 | + dataIndex: 'customerCode', | ||
33 | + }, | ||
34 | + { | ||
35 | + title: '项目号', | ||
36 | + width: 150, | ||
37 | + dataIndex: 'projectNo', | ||
38 | + }, | ||
39 | + { | ||
40 | + title: '生产科', | ||
41 | + width: 150, | ||
42 | + dataIndex: 'productionDepartment', | ||
43 | + }, | ||
44 | + { | ||
45 | + title: '内部编号', | ||
46 | + width: 150, | ||
47 | + dataIndex: 'innerNo', | ||
48 | + }, | ||
49 | + { | ||
50 | + title: '客户po号', | ||
51 | + width: 150, | ||
52 | + dataIndex: 'customerPo', | ||
53 | + }, | ||
43 | 54 | ||
44 | - { | ||
45 | - title: 'COLLECTION (style description)', | ||
46 | - width: 150, | ||
47 | - dataIndex: 'collection', | ||
48 | - }, | 55 | + { |
56 | + title: '客户STYLE', | ||
57 | + width: 150, | ||
58 | + dataIndex: 'customerStyle', | ||
59 | + }, | ||
49 | 60 | ||
50 | - { | ||
51 | - title: 'PO COLOR', | ||
52 | - width: 150, | ||
53 | - dataIndex: 'poColor', | ||
54 | - }, | ||
55 | - { | ||
56 | - title: '颜色中文', | ||
57 | - width: 150, | ||
58 | - dataIndex: 'cnColor', | ||
59 | - }, | 61 | + { |
62 | + title: 'Modelo(REFERENCE)', | ||
63 | + width: 150, | ||
64 | + dataIndex: 'modeleLo', | ||
65 | + }, | ||
60 | 66 | ||
61 | - { | ||
62 | - title: '图片', | ||
63 | - width: 150, | ||
64 | - dataIndex: 'picUrl', | ||
65 | - }, | ||
66 | - { | ||
67 | - title: '生产要求', | ||
68 | - width: 150, | ||
69 | - dataIndex: 'productionComment', | ||
70 | - }, | ||
71 | - { | ||
72 | - title: '数量', | ||
73 | - width: 150, | ||
74 | - dataIndex: 'orderCount', | ||
75 | - }, | ||
76 | - { | ||
77 | - title: '订单成分', | ||
78 | - width: 150, | ||
79 | - dataIndex: 'orderComposition', | ||
80 | - }, | ||
81 | - { | ||
82 | - title: '款式类型', | ||
83 | - width: 150, | ||
84 | - dataIndex: 'productStyle', | ||
85 | - }, | ||
86 | - { | ||
87 | - title: '生成科拖货时间', | ||
88 | - width: 150, | ||
89 | - dataIndex: 'productionDepartmentConsignTime', | ||
90 | - }, | ||
91 | - { | ||
92 | - title: '订单上HOD时间', | ||
93 | - width: 150, | ||
94 | - dataIndex: 'orderHodTime', | ||
95 | - }, | 67 | + { |
68 | + title: 'COLLECTION (style description)', | ||
69 | + width: 150, | ||
70 | + dataIndex: 'collection', | ||
71 | + }, | ||
96 | 72 | ||
97 | - { | ||
98 | - title: '出库类型', | ||
99 | - width: 150, | ||
100 | - dataIndex: 'outboundType', | ||
101 | - }, | ||
102 | - { | ||
103 | - title: '包装类型', | ||
104 | - width: 150, | ||
105 | - dataIndex: 'packetType', | ||
106 | - }, | ||
107 | - // { | ||
108 | - // title: 'id', | ||
109 | - // width: 150, | ||
110 | - // dataIndex: 'id', | ||
111 | - // }, | ||
112 | - { | ||
113 | - title: '项目完成报告信息', | ||
114 | - width: 150, | ||
115 | - dataIndex: 'reportInfo', | ||
116 | - children: [ | ||
117 | - { | ||
118 | - title: '想法来源', | ||
119 | - width: 150, | ||
120 | - dataIndex: 'reportInfo.ideaSource', | ||
121 | - customRender: (column) => { | ||
122 | - const { record } = column || {}; | ||
123 | - return record?.reportInfo?.ideaSource; | ||
124 | - }, | 73 | + { |
74 | + title: 'PO COLOR', | ||
75 | + width: 150, | ||
76 | + dataIndex: 'poColor', | ||
77 | + }, | ||
78 | + { | ||
79 | + title: '颜色中文', | ||
80 | + width: 150, | ||
81 | + dataIndex: 'cnColor', | ||
82 | + }, | ||
83 | + | ||
84 | + { | ||
85 | + title: '图片', | ||
86 | + width: 150, | ||
87 | + dataIndex: 'picUrl', | ||
88 | + }, | ||
89 | + { | ||
90 | + title: '生产要求', | ||
91 | + width: 150, | ||
92 | + dataIndex: 'productionComment', | ||
93 | + }, | ||
94 | + { | ||
95 | + title: '数量', | ||
96 | + width: 150, | ||
97 | + dataIndex: 'orderCount', | ||
98 | + }, | ||
99 | + { | ||
100 | + title: '订单成分', | ||
101 | + width: 150, | ||
102 | + dataIndex: 'orderComposition', | ||
103 | + }, | ||
104 | + { | ||
105 | + title: '款式类型', | ||
106 | + width: 150, | ||
107 | + dataIndex: 'productStyle', | ||
108 | + }, | ||
109 | + { | ||
110 | + title: '生成科拖货时间', | ||
111 | + width: 150, | ||
112 | + dataIndex: 'productionDepartmentConsignTime', | ||
113 | + }, | ||
114 | + { | ||
115 | + title: '订单上HOD时间', | ||
116 | + width: 150, | ||
117 | + dataIndex: 'orderHodTime', | ||
118 | + }, | ||
119 | + { | ||
120 | + title: '出库类型', | ||
121 | + width: 150, | ||
122 | + dataIndex: 'outboundType', | ||
123 | + }, | ||
124 | + { | ||
125 | + title: '包装类型', | ||
126 | + width: 150, | ||
127 | + dataIndex: 'packetType', | ||
128 | + }, | ||
129 | +]; | ||
130 | + | ||
131 | +const ORDER_LIST_REPORT_FIELDS = [ | ||
132 | + { | ||
133 | + title: '项目完成报告信息', | ||
134 | + width: 150, | ||
135 | + dataIndex: 'reportInfo', | ||
136 | + children: [ | ||
137 | + { | ||
138 | + title: '想法来源', | ||
139 | + width: 150, | ||
140 | + dataIndex: 'reportInfo.ideaSource', | ||
141 | + customRender: (column) => { | ||
142 | + const { record } = column || {}; | ||
143 | + return record?.reportInfo?.ideaSource; | ||
125 | }, | 144 | }, |
126 | - { | ||
127 | - title: '手工初型', | ||
128 | - width: 150, | ||
129 | - dataIndex: 'reportInfo.manualPreform', | ||
130 | - customRender: (column) => { | ||
131 | - const { record } = column || {}; | ||
132 | - return record?.reportInfo?.manualPreform; | ||
133 | - }, | 145 | + }, |
146 | + { | ||
147 | + title: '手工初型', | ||
148 | + width: 150, | ||
149 | + dataIndex: 'reportInfo.manualPreform', | ||
150 | + customRender: (column) => { | ||
151 | + const { record } = column || {}; | ||
152 | + return record?.reportInfo?.manualPreform; | ||
134 | }, | 153 | }, |
135 | - { | ||
136 | - title: '想法和手工比例分配', | ||
137 | - width: 150, | ||
138 | - dataIndex: 'reportInfo.ideaManualRate', | ||
139 | - customRender: (column) => { | ||
140 | - const { record } = column || {}; | ||
141 | - return record?.reportInfo?.ideaManualRate; | ||
142 | - }, | 154 | + }, |
155 | + { | ||
156 | + title: '想法和手工比例分配', | ||
157 | + width: 150, | ||
158 | + dataIndex: 'reportInfo.ideaManualRate', | ||
159 | + customRender: (column) => { | ||
160 | + const { record } = column || {}; | ||
161 | + return record?.reportInfo?.ideaManualRate; | ||
143 | }, | 162 | }, |
144 | - ], | ||
145 | - }, | ||
146 | - { | ||
147 | - title: '利润分析信息', | ||
148 | - width: 150, | ||
149 | - dataIndex: 'profitAnalysisInfo', | ||
150 | - children: [ | ||
151 | - { | ||
152 | - title: '客户单价', | ||
153 | - width: 150, | ||
154 | - dataIndex: 'customerPrice', | ||
155 | - customRender: (column) => { | ||
156 | - const { record } = column || {}; | ||
157 | - return record?.profitAnalysisInfo?.customerPrice; | ||
158 | - }, | 163 | + }, |
164 | + ], | ||
165 | + }, | ||
166 | +]; | ||
167 | + | ||
168 | +const ORDER_LIST_PROFIT_FIELDS = [ | ||
169 | + { | ||
170 | + title: '利润分析信息', | ||
171 | + width: 150, | ||
172 | + dataIndex: 'profitAnalysisInfo', | ||
173 | + children: [ | ||
174 | + { | ||
175 | + title: '客户单价', | ||
176 | + width: 150, | ||
177 | + dataIndex: 'customerPrice', | ||
178 | + customRender: (column) => { | ||
179 | + const { record } = column || {}; | ||
180 | + return record?.profitAnalysisInfo?.customerPrice; | ||
159 | }, | 181 | }, |
160 | - { | ||
161 | - title: '客户总价', | ||
162 | - width: 150, | ||
163 | - dataIndex: 'customerTotalPrice', | ||
164 | - customRender: (column) => { | ||
165 | - const { record } = column || {}; | ||
166 | - return record?.profitAnalysisInfo?.customerTotalPrice; | ||
167 | - }, | 182 | + }, |
183 | + { | ||
184 | + title: '客户总价', | ||
185 | + width: 150, | ||
186 | + dataIndex: 'customerTotalPrice', | ||
187 | + customRender: (column) => { | ||
188 | + const { record } = column || {}; | ||
189 | + return record?.profitAnalysisInfo?.customerTotalPrice; | ||
168 | }, | 190 | }, |
169 | - { | ||
170 | - title: '生成科单价', | ||
171 | - width: 150, | ||
172 | - dataIndex: 'productionDepartmentPrice', | ||
173 | - customRender: (column) => { | ||
174 | - const { record } = column || {}; | ||
175 | - return record?.profitAnalysisInfo?.productionDepartmentPrice; | ||
176 | - }, | 191 | + }, |
192 | + { | ||
193 | + title: '生成科单价', | ||
194 | + width: 150, | ||
195 | + dataIndex: 'productionDepartmentPrice', | ||
196 | + customRender: (column) => { | ||
197 | + const { record } = column || {}; | ||
198 | + return record?.profitAnalysisInfo?.productionDepartmentPrice; | ||
177 | }, | 199 | }, |
178 | - { | ||
179 | - title: '包装费用', | ||
180 | - width: 150, | ||
181 | - dataIndex: 'packetPrice', | ||
182 | - customRender: (column) => { | ||
183 | - const { record } = column || {}; | ||
184 | - return record?.profitAnalysisInfo?.packetPrice; | ||
185 | - }, | 200 | + }, |
201 | + { | ||
202 | + title: '包装费用', | ||
203 | + width: 150, | ||
204 | + dataIndex: 'packetPrice', | ||
205 | + customRender: (column) => { | ||
206 | + const { record } = column || {}; | ||
207 | + return record?.profitAnalysisInfo?.packetPrice; | ||
186 | }, | 208 | }, |
187 | - { | ||
188 | - title: '包装费用合计', | ||
189 | - width: 150, | ||
190 | - dataIndex: 'packetTotalPrice', | ||
191 | - customRender: (column) => { | ||
192 | - const { record } = column || {}; | ||
193 | - return record?.profitAnalysisInfo?.packetTotalPrice; | ||
194 | - }, | 209 | + }, |
210 | + { | ||
211 | + title: '包装费用合计', | ||
212 | + width: 150, | ||
213 | + dataIndex: 'packetTotalPrice', | ||
214 | + customRender: (column) => { | ||
215 | + const { record } = column || {}; | ||
216 | + return record?.profitAnalysisInfo?.packetTotalPrice; | ||
195 | }, | 217 | }, |
196 | - { | ||
197 | - title: '汇率', | ||
198 | - width: 150, | ||
199 | - dataIndex: 'exchangeRate', | ||
200 | - customRender: (column) => { | ||
201 | - const { record } = column || {}; | ||
202 | - return record?.profitAnalysisInfo?.exchangeRate; | ||
203 | - }, | 218 | + }, |
219 | + { | ||
220 | + title: '汇率', | ||
221 | + width: 150, | ||
222 | + dataIndex: 'exchangeRate', | ||
223 | + customRender: (column) => { | ||
224 | + const { record } = column || {}; | ||
225 | + return record?.profitAnalysisInfo?.exchangeRate; | ||
204 | }, | 226 | }, |
205 | - { | ||
206 | - title: '利润率', | ||
207 | - width: 150, | ||
208 | - dataIndex: 'profitRate', | ||
209 | - customRender: (column) => { | ||
210 | - const { record } = column || {}; | ||
211 | - return record?.profitAnalysisInfo?.profitRate; | ||
212 | - }, | 227 | + }, |
228 | + { | ||
229 | + title: '利润率', | ||
230 | + width: 150, | ||
231 | + dataIndex: 'profitRate', | ||
232 | + customRender: (column) => { | ||
233 | + const { record } = column || {}; | ||
234 | + return record?.profitAnalysisInfo?.profitRate; | ||
213 | }, | 235 | }, |
214 | - ], | ||
215 | - }, | ||
216 | - { | ||
217 | - title: '跟单信息', | ||
218 | - width: 150, | ||
219 | - dataIndex: 'trackStageInfo', | ||
220 | - children: [ | ||
221 | - { | ||
222 | - title: 'pp date', | ||
223 | - width: 150, | ||
224 | - dataIndex: 'ppTime', | ||
225 | - customRender: (column) => { | ||
226 | - const { record } = column || {}; | ||
227 | - return record?.trackStageInfo?.ppTime; | ||
228 | - }, | 236 | + }, |
237 | + ], | ||
238 | + }, | ||
239 | +]; | ||
240 | + | ||
241 | +const ORDER_LIST_TRACK_FIELDS = [ | ||
242 | + { | ||
243 | + title: '跟单信息', | ||
244 | + width: 150, | ||
245 | + dataIndex: 'trackStageInfo', | ||
246 | + children: [ | ||
247 | + { | ||
248 | + title: 'pp date', | ||
249 | + width: 150, | ||
250 | + dataIndex: 'ppTime', | ||
251 | + customRender: (column) => { | ||
252 | + const { record } = column || {}; | ||
253 | + return record?.trackStageInfo?.ppTime; | ||
229 | }, | 254 | }, |
230 | - { | ||
231 | - title: 'pp样品确认意见', | ||
232 | - width: 150, | ||
233 | - dataIndex: 'ppConfirmResult', | ||
234 | - customRender: (column) => { | ||
235 | - const { record } = column || {}; | ||
236 | - return record?.trackStageInfo?.ppConfirmResult; | ||
237 | - }, | 255 | + }, |
256 | + { | ||
257 | + title: 'pp样品确认意见', | ||
258 | + width: 150, | ||
259 | + dataIndex: 'ppConfirmResult', | ||
260 | + customRender: (column) => { | ||
261 | + const { record } = column || {}; | ||
262 | + return record?.trackStageInfo?.ppConfirmResult; | ||
238 | }, | 263 | }, |
239 | - { | ||
240 | - title: 'EXTRA,SHOWROOM,ONLINE sample发送时间', | ||
241 | - width: 250, | ||
242 | - dataIndex: 'esoSampleSendTime', | ||
243 | - customRender: (column) => { | ||
244 | - const { record } = column || {}; | ||
245 | - return record?.trackStageInfo?.esoSampleSendTime; | ||
246 | - }, | 264 | + }, |
265 | + { | ||
266 | + title: 'EXTRA,SHOWROOM,ONLINE sample发送时间', | ||
267 | + width: 250, | ||
268 | + dataIndex: 'esoSampleSendTime', | ||
269 | + customRender: (column) => { | ||
270 | + const { record } = column || {}; | ||
271 | + return record?.trackStageInfo?.esoSampleSendTime; | ||
247 | }, | 272 | }, |
248 | - { | ||
249 | - title: 'shippment sample 发送时间', | ||
250 | - width: 150, | ||
251 | - dataIndex: 'shippmentSampleSendTime', | ||
252 | - customRender: (column) => { | ||
253 | - const { record } = column || {}; | ||
254 | - return record?.trackStageInfo?.shippmentSampleSendTime; | ||
255 | - }, | 273 | + }, |
274 | + { | ||
275 | + title: 'shippment sample 发送时间', | ||
276 | + width: 150, | ||
277 | + dataIndex: 'shippmentSampleSendTime', | ||
278 | + customRender: (column) => { | ||
279 | + const { record } = column || {}; | ||
280 | + return record?.trackStageInfo?.shippmentSampleSendTime; | ||
256 | }, | 281 | }, |
257 | - { | ||
258 | - title: 'shipment sample确认意见', | ||
259 | - width: 150, | ||
260 | - dataIndex: 'shippmentSampleConfirmResult', | ||
261 | - customRender: (column) => { | ||
262 | - const { record } = column || {}; | ||
263 | - return record?.trackStageInfo?.shippmentSampleConfirmResult; | ||
264 | - }, | 282 | + }, |
283 | + { | ||
284 | + title: 'shipment sample确认意见', | ||
285 | + width: 150, | ||
286 | + dataIndex: 'shippmentSampleConfirmResult', | ||
287 | + customRender: (column) => { | ||
288 | + const { record } = column || {}; | ||
289 | + return record?.trackStageInfo?.shippmentSampleConfirmResult; | ||
265 | }, | 290 | }, |
266 | - { | ||
267 | - title: '自测通过时间', | ||
268 | - width: 150, | ||
269 | - dataIndex: 'selfTestPassTime', | ||
270 | - customRender: (column) => { | ||
271 | - const { record } = column || {}; | ||
272 | - return record?.trackStageInfo?.selfTestPassTime; | ||
273 | - }, | 291 | + }, |
292 | + { | ||
293 | + title: '自测通过时间', | ||
294 | + width: 150, | ||
295 | + dataIndex: 'selfTestPassTime', | ||
296 | + customRender: (column) => { | ||
297 | + const { record } = column || {}; | ||
298 | + return record?.trackStageInfo?.selfTestPassTime; | ||
274 | }, | 299 | }, |
275 | - { | ||
276 | - title: 'Aitex测试发送时间', | ||
277 | - width: 150, | ||
278 | - dataIndex: 'aitexTestSendTime', | ||
279 | - customRender: (column) => { | ||
280 | - const { record } = column || {}; | ||
281 | - return record?.trackStageInfo?.aitexTestSendTime; | ||
282 | - }, | 300 | + }, |
301 | + { | ||
302 | + title: 'Aitex测试发送时间', | ||
303 | + width: 150, | ||
304 | + dataIndex: 'aitexTestSendTime', | ||
305 | + customRender: (column) => { | ||
306 | + const { record } = column || {}; | ||
307 | + return record?.trackStageInfo?.aitexTestSendTime; | ||
283 | }, | 308 | }, |
284 | - { | ||
285 | - title: 'Aitex测试结果', | ||
286 | - width: 150, | ||
287 | - dataIndex: 'aitexTestFinishResult', | ||
288 | - customRender: (column) => { | ||
289 | - const { record } = column || {}; | ||
290 | - return record?.trackStageInfo?.aitexTestFinishResult; | ||
291 | - }, | 309 | + }, |
310 | + { | ||
311 | + title: 'Aitex测试结果', | ||
312 | + width: 150, | ||
313 | + dataIndex: 'aitexTestFinishResult', | ||
314 | + customRender: (column) => { | ||
315 | + const { record } = column || {}; | ||
316 | + return record?.trackStageInfo?.aitexTestFinishResult; | ||
292 | }, | 317 | }, |
293 | - { | ||
294 | - title: 'SGS测试发送时间', | ||
295 | - width: 150, | ||
296 | - dataIndex: 'sgsTestSendTime', | ||
297 | - customRender: (column) => { | ||
298 | - const { record } = column || {}; | ||
299 | - return record?.trackStageInfo?.sgsTestSendTime; | ||
300 | - }, | 318 | + }, |
319 | + { | ||
320 | + title: 'SGS测试发送时间', | ||
321 | + width: 150, | ||
322 | + dataIndex: 'sgsTestSendTime', | ||
323 | + customRender: (column) => { | ||
324 | + const { record } = column || {}; | ||
325 | + return record?.trackStageInfo?.sgsTestSendTime; | ||
301 | }, | 326 | }, |
302 | - { | ||
303 | - title: 'SGS测试结果', | ||
304 | - width: 150, | ||
305 | - dataIndex: 'sgsTestFinishResult', | ||
306 | - customRender: (column) => { | ||
307 | - const { record } = column || {}; | ||
308 | - return record?.trackStageInfo?.sgsTestFinishResult; | ||
309 | - }, | 327 | + }, |
328 | + { | ||
329 | + title: 'SGS测试结果', | ||
330 | + width: 150, | ||
331 | + dataIndex: 'sgsTestFinishResult', | ||
332 | + customRender: (column) => { | ||
333 | + const { record } = column || {}; | ||
334 | + return record?.trackStageInfo?.sgsTestFinishResult; | ||
310 | }, | 335 | }, |
311 | - { | ||
312 | - title: 'Barcode sticker arrival time', | ||
313 | - width: 150, | ||
314 | - dataIndex: 'barcodeStickerArrivalTime', | ||
315 | - customRender: (column) => { | ||
316 | - const { record } = column || {}; | ||
317 | - return record?.trackStageInfo?.barcodeStickerArrivalTime; | ||
318 | - }, | 336 | + }, |
337 | + { | ||
338 | + title: 'Barcode sticker arrival time', | ||
339 | + width: 150, | ||
340 | + dataIndex: 'barcodeStickerArrivalTime', | ||
341 | + customRender: (column) => { | ||
342 | + const { record } = column || {}; | ||
343 | + return record?.trackStageInfo?.barcodeStickerArrivalTime; | ||
319 | }, | 344 | }, |
320 | - { | ||
321 | - title: '最晚包材到货时间', | ||
322 | - width: 150, | ||
323 | - dataIndex: 'latestArrivalTime', | ||
324 | - customRender: (column) => { | ||
325 | - const { record } = column || {}; | ||
326 | - return record?.trackStageInfo?.latestArrivalTime; | ||
327 | - }, | 345 | + }, |
346 | + { | ||
347 | + title: '最晚包材到货时间', | ||
348 | + width: 150, | ||
349 | + dataIndex: 'latestArrivalTime', | ||
350 | + customRender: (column) => { | ||
351 | + const { record } = column || {}; | ||
352 | + return record?.trackStageInfo?.latestArrivalTime; | ||
328 | }, | 353 | }, |
329 | - { | ||
330 | - title: '最晚订舱+报关资料时间', | ||
331 | - width: 150, | ||
332 | - dataIndex: 'latestBkTime', | ||
333 | - customRender: (column) => { | ||
334 | - const { record } = column || {}; | ||
335 | - return record?.trackStageInfo?.latestBkTime; | ||
336 | - }, | 354 | + }, |
355 | + { | ||
356 | + title: '最晚订舱+报关资料时间', | ||
357 | + width: 150, | ||
358 | + dataIndex: 'latestBkTime', | ||
359 | + customRender: (column) => { | ||
360 | + const { record } = column || {}; | ||
361 | + return record?.trackStageInfo?.latestBkTime; | ||
337 | }, | 362 | }, |
338 | - ], | ||
339 | - }, | ||
340 | - { | ||
341 | - title: '质检信息', | ||
342 | - width: 150, | ||
343 | - dataIndex: 'inspectionStageInfo', | ||
344 | - children: [ | ||
345 | - { | ||
346 | - title: 'midCheckApplyTime', | ||
347 | - width: 150, | ||
348 | - label: '中期验货申请时间', | ||
349 | - dataIndex: 'midCheckApplyTime', | ||
350 | - customRender: (column) => { | ||
351 | - const { record } = column || {}; | ||
352 | - return record?.inspectionStageInfo?.midCheckApplyTime; | ||
353 | - }, | 363 | + }, |
364 | + ], | ||
365 | + }, | ||
366 | +]; | ||
367 | + | ||
368 | +const ORDER_LIST_INSPECT_FIELDS = [ | ||
369 | + { | ||
370 | + title: '质检信息', | ||
371 | + width: 150, | ||
372 | + dataIndex: 'inspectionStageInfo', | ||
373 | + children: [ | ||
374 | + { | ||
375 | + title: 'midCheckApplyTime', | ||
376 | + width: 150, | ||
377 | + label: '中期验货申请时间', | ||
378 | + dataIndex: 'midCheckApplyTime', | ||
379 | + customRender: (column) => { | ||
380 | + const { record } = column || {}; | ||
381 | + return record?.inspectionStageInfo?.midCheckApplyTime; | ||
354 | }, | 382 | }, |
355 | - { | ||
356 | - title: '中期验货(功能性-拉力/跌落等、外观性-颜色/规格等、耐久性-烤厅等)', | ||
357 | - width: 300, | ||
358 | - dataIndex: 'midCheckComment', | ||
359 | - customRender: (column) => { | ||
360 | - const { record } = column || {}; | ||
361 | - return record?.inspectionStageInfo?.midCheckComment; | ||
362 | - }, | 383 | + }, |
384 | + { | ||
385 | + title: '中期验货(功能性-拉力/跌落等、外观性-颜色/规格等、耐久性-烤厅等)', | ||
386 | + width: 300, | ||
387 | + dataIndex: 'midCheckComment', | ||
388 | + customRender: (column) => { | ||
389 | + const { record } = column || {}; | ||
390 | + return record?.inspectionStageInfo?.midCheckComment; | ||
363 | }, | 391 | }, |
364 | - { | ||
365 | - title: '中期验货结果PASS / FAIL', | ||
366 | - width: 150, | ||
367 | - dataIndex: 'midCheckResult', | ||
368 | - customRender: (column) => { | ||
369 | - const { record } = column || {}; | ||
370 | - return record?.inspectionStageInfo?.midCheckResult; | ||
371 | - }, | 392 | + }, |
393 | + { | ||
394 | + title: '中期验货结果PASS / FAIL', | ||
395 | + width: 150, | ||
396 | + dataIndex: 'midCheckResult', | ||
397 | + customRender: (column) => { | ||
398 | + const { record } = column || {}; | ||
399 | + return record?.inspectionStageInfo?.midCheckResult; | ||
372 | }, | 400 | }, |
373 | - { | ||
374 | - title: '尾期验货申请时间', | ||
375 | - width: 150, | ||
376 | - dataIndex: 'endCheckApplyTime', | ||
377 | - customRender: (column) => { | ||
378 | - const { record } = column || {}; | ||
379 | - return record?.inspectionStageInfo?.endCheckApplyTime; | ||
380 | - }, | 401 | + }, |
402 | + { | ||
403 | + title: '尾期验货申请时间', | ||
404 | + width: 150, | ||
405 | + dataIndex: 'endCheckApplyTime', | ||
406 | + customRender: (column) => { | ||
407 | + const { record } = column || {}; | ||
408 | + return record?.inspectionStageInfo?.endCheckApplyTime; | ||
381 | }, | 409 | }, |
382 | - { | ||
383 | - title: '长度/规格', | ||
384 | - width: 150, | ||
385 | - dataIndex: 'specification', | ||
386 | - customRender: (column) => { | ||
387 | - const { record } = column || {}; | ||
388 | - return record?.inspectionStageInfo?.specification; | ||
389 | - }, | 410 | + }, |
411 | + { | ||
412 | + title: '长度/规格', | ||
413 | + width: 150, | ||
414 | + dataIndex: 'specification', | ||
415 | + customRender: (column) => { | ||
416 | + const { record } = column || {}; | ||
417 | + return record?.inspectionStageInfo?.specification; | ||
390 | }, | 418 | }, |
391 | - { | ||
392 | - title: '功能性不良', | ||
393 | - width: 150, | ||
394 | - dataIndex: 'functionality', | ||
395 | - customRender: (column) => { | ||
396 | - const { record } = column || {}; | ||
397 | - return record?.inspectionStageInfo?.functionality; | ||
398 | - }, | 419 | + }, |
420 | + { | ||
421 | + title: '功能性不良', | ||
422 | + width: 150, | ||
423 | + dataIndex: 'functionality', | ||
424 | + customRender: (column) => { | ||
425 | + const { record } = column || {}; | ||
426 | + return record?.inspectionStageInfo?.functionality; | ||
399 | }, | 427 | }, |
400 | - { | ||
401 | - title: '电镀不良', | ||
402 | - width: 150, | ||
403 | - dataIndex: 'electroplate', | ||
404 | - customRender: (column) => { | ||
405 | - const { record } = column || {}; | ||
406 | - return record?.inspectionStageInfo?.electroplate; | ||
407 | - }, | 428 | + }, |
429 | + { | ||
430 | + title: '电镀不良', | ||
431 | + width: 150, | ||
432 | + dataIndex: 'electroplate', | ||
433 | + customRender: (column) => { | ||
434 | + const { record } = column || {}; | ||
435 | + return record?.inspectionStageInfo?.electroplate; | ||
408 | }, | 436 | }, |
409 | - { | ||
410 | - title: '不良1', | ||
411 | - width: 150, | ||
412 | - dataIndex: 'value1', | ||
413 | - customRender: (column) => { | ||
414 | - const { record } = column || {}; | ||
415 | - return record?.inspectionStageInfo?.value1; | ||
416 | - }, | 437 | + }, |
438 | + { | ||
439 | + title: '不良1', | ||
440 | + width: 150, | ||
441 | + dataIndex: 'value1', | ||
442 | + customRender: (column) => { | ||
443 | + const { record } = column || {}; | ||
444 | + return record?.inspectionStageInfo?.value1; | ||
417 | }, | 445 | }, |
446 | + }, | ||
418 | 447 | ||
419 | - { | ||
420 | - title: '不良2', | ||
421 | - width: 150, | ||
422 | - dataIndex: 'value2', | ||
423 | - customRender: (column) => { | ||
424 | - const { record } = column || {}; | ||
425 | - return record?.inspectionStageInfo?.value2; | ||
426 | - }, | 448 | + { |
449 | + title: '不良2', | ||
450 | + width: 150, | ||
451 | + dataIndex: 'value2', | ||
452 | + customRender: (column) => { | ||
453 | + const { record } = column || {}; | ||
454 | + return record?.inspectionStageInfo?.value2; | ||
427 | }, | 455 | }, |
428 | - { | ||
429 | - title: '其他不良3', | ||
430 | - width: 150, | ||
431 | - dataIndex: 'value3', | ||
432 | - customRender: (column) => { | ||
433 | - const { record } = column || {}; | ||
434 | - return record?.inspectionStageInfo?.value3; | ||
435 | - }, | 456 | + }, |
457 | + { | ||
458 | + title: '其他不良3', | ||
459 | + width: 150, | ||
460 | + dataIndex: 'value3', | ||
461 | + customRender: (column) => { | ||
462 | + const { record } = column || {}; | ||
463 | + return record?.inspectionStageInfo?.value3; | ||
436 | }, | 464 | }, |
437 | - { | ||
438 | - title: '包装:卡片、条码、箱贴,箱单 ', | ||
439 | - width: 150, | ||
440 | - dataIndex: 'boxPacket', | ||
441 | - customRender: (column) => { | ||
442 | - const { record } = column || {}; | ||
443 | - return record?.inspectionStageInfo?.boxPacket; | ||
444 | - }, | 465 | + }, |
466 | + { | ||
467 | + title: '包装:卡片、条码、箱贴,箱单 ', | ||
468 | + width: 150, | ||
469 | + dataIndex: 'boxPacket', | ||
470 | + customRender: (column) => { | ||
471 | + const { record } = column || {}; | ||
472 | + return record?.inspectionStageInfo?.boxPacket; | ||
445 | }, | 473 | }, |
446 | - { | ||
447 | - title: '尾期验货结果PASS / FAIL', | ||
448 | - width: 150, | ||
449 | - dataIndex: 'endCheckResult', | ||
450 | - customRender: (column) => { | ||
451 | - const { record } = column || {}; | ||
452 | - return record?.inspectionStageInfo?.endCheckResult; | ||
453 | - }, | 474 | + }, |
475 | + { | ||
476 | + title: '尾期验货结果PASS / FAIL', | ||
477 | + width: 150, | ||
478 | + dataIndex: 'endCheckResult', | ||
479 | + customRender: (column) => { | ||
480 | + const { record } = column || {}; | ||
481 | + return record?.inspectionStageInfo?.endCheckResult; | ||
454 | }, | 482 | }, |
455 | - ], | ||
456 | - }, | ||
457 | - ]; | 483 | + }, |
484 | + ], | ||
485 | + }, | ||
486 | +]; | ||
487 | +export function getOrderColumns(role: ROLE) { | ||
488 | + if (role === ROLE.ADMIN || role === ROLE.BUSINESS) { | ||
489 | + return [ | ||
490 | + ...ORDER_LIST_BASE_FIELDS, | ||
491 | + ...ORDER_LIST_PROFIT_FIELDS, | ||
492 | + ...ORDER_LIST_REPORT_FIELDS, | ||
493 | + ...ORDER_LIST_TRACK_FIELDS, | ||
494 | + ...ORDER_LIST_INSPECT_FIELDS, | ||
495 | + ]; | ||
496 | + } | ||
497 | + | ||
498 | + if (role === ROLE.TRACKER) { | ||
499 | + return [ | ||
500 | + ...ORDER_LIST_BASE_FIELDS, | ||
501 | + ...ORDER_LIST_PROFIT_FIELDS.map((item) => { | ||
502 | + const children = item.children.filter( | ||
503 | + (k) => k.dataIndex !== 'exchangeRate' && k.dataIndex !== 'profitRate', | ||
504 | + ); | ||
505 | + item.children = children; | ||
506 | + return item; | ||
507 | + }), | ||
508 | + ...ORDER_LIST_TRACK_FIELDS, | ||
509 | + ...ORDER_LIST_INSPECT_FIELDS, | ||
510 | + ]; | ||
511 | + } | ||
512 | + | ||
513 | + if (role === ROLE.INSPECT) { | ||
514 | + return [...ORDER_LIST_BASE_FIELDS, ...ORDER_LIST_TRACK_FIELDS, ...ORDER_LIST_INSPECT_FIELDS]; | ||
515 | + } | ||
516 | + | ||
517 | + return []; | ||
458 | } | 518 | } |
519 | + | ||
459 | // 基本信息 | 520 | // 基本信息 |
460 | export const FIELDS_BASE_INFO = [ | 521 | export const FIELDS_BASE_INFO = [ |
461 | { | 522 | { |
@@ -583,20 +644,20 @@ export const FIELDS_REPORT_INFO = [ | @@ -583,20 +644,20 @@ export const FIELDS_REPORT_INFO = [ | ||
583 | component: 'Select', | 644 | component: 'Select', |
584 | optionField: 'ideaSource', | 645 | optionField: 'ideaSource', |
585 | label: '想法来源', | 646 | label: '想法来源', |
586 | - rules: [{ required: true }], | 647 | + // rules: [{ required: true }], |
587 | }, | 648 | }, |
588 | { | 649 | { |
589 | field: 'manualPreform', | 650 | field: 'manualPreform', |
590 | component: 'Select', | 651 | component: 'Select', |
591 | optionField: 'manualPreform', | 652 | optionField: 'manualPreform', |
592 | label: '手工初型', | 653 | label: '手工初型', |
593 | - rules: [{ required: true }], | 654 | + // rules: [{ required: true }], |
594 | }, | 655 | }, |
595 | { | 656 | { |
596 | field: 'ideaManualRate', | 657 | field: 'ideaManualRate', |
597 | component: 'Input', | 658 | component: 'Input', |
598 | label: '想法和手工比例分配', | 659 | label: '想法和手工比例分配', |
599 | - rules: [{ required: true }], | 660 | + // rules: [{ required: true }], |
600 | }, | 661 | }, |
601 | ]; | 662 | ]; |
602 | 663 | ||
@@ -731,13 +792,19 @@ export const FIELDS_PROFIT_INFO = [ | @@ -731,13 +792,19 @@ export const FIELDS_PROFIT_INFO = [ | ||
731 | field: 'customerPrice', | 792 | field: 'customerPrice', |
732 | component: 'InputNumber', | 793 | component: 'InputNumber', |
733 | label: '客户单价', | 794 | label: '客户单价', |
734 | - rules: [{ required: true }], | 795 | + // rules: [{ required: true }], |
735 | }, | 796 | }, |
797 | + // { | ||
798 | + // field: 'customerTotalPrice', | ||
799 | + // component: 'InputNumber', | ||
800 | + // label: '客户总价', | ||
801 | + // rules: [{ required: true }], | ||
802 | + // }, | ||
736 | { | 803 | { |
737 | field: 'customerCurrency', | 804 | field: 'customerCurrency', |
738 | component: 'Select', | 805 | component: 'Select', |
739 | - label: '客户单价单位', | ||
740 | - rules: [{ required: true }], | 806 | + label: '客户单价货币单位', |
807 | + // rules: [{ required: true }], | ||
741 | componentProps: { | 808 | componentProps: { |
742 | options: [ | 809 | options: [ |
743 | { label: '$', value: '$' }, | 810 | { label: '$', value: '$' }, |
@@ -746,15 +813,15 @@ export const FIELDS_PROFIT_INFO = [ | @@ -746,15 +813,15 @@ export const FIELDS_PROFIT_INFO = [ | ||
746 | }, | 813 | }, |
747 | }, | 814 | }, |
748 | { | 815 | { |
749 | - field: 'customerTotalPrice', | 816 | + field: 'productionDepartmentPrice', |
750 | component: 'InputNumber', | 817 | component: 'InputNumber', |
751 | - label: '客户总价', | ||
752 | - rules: [{ required: true }], | 818 | + label: '生成科单价', |
819 | + // rules: [{ required: true }], | ||
753 | }, | 820 | }, |
754 | { | 821 | { |
755 | - field: 'customerTotalCurrency', | 822 | + field: 'productionDepartmentCurrency', |
756 | component: 'Select', | 823 | component: 'Select', |
757 | - label: '客户总价单位', | 824 | + label: '生成科货币单位', |
758 | rules: [{ required: true }], | 825 | rules: [{ required: true }], |
759 | componentProps: { | 826 | componentProps: { |
760 | options: [ | 827 | options: [ |
@@ -763,35 +830,29 @@ export const FIELDS_PROFIT_INFO = [ | @@ -763,35 +830,29 @@ export const FIELDS_PROFIT_INFO = [ | ||
763 | ], | 830 | ], |
764 | }, | 831 | }, |
765 | }, | 832 | }, |
766 | - { | ||
767 | - field: 'productionDepartmentPrice', | ||
768 | - component: 'InputNumber', | ||
769 | - label: '生成科单价', | ||
770 | - rules: [{ required: true }], | ||
771 | - }, | ||
772 | // { | 833 | // { |
773 | // field: 'productionDepartmentPrice', | 834 | // field: 'productionDepartmentPrice', |
774 | // component: 'InputNumber', | 835 | // component: 'InputNumber', |
775 | // label: '生成科总价¥', | 836 | // label: '生成科总价¥', |
776 | // rules: [{ required: true }], | 837 | // rules: [{ required: true }], |
777 | // }, | 838 | // }, |
839 | + { | ||
840 | + label: '包装费用', | ||
841 | + component: 'InputNumber', | ||
842 | + field: 'packetPrice', | ||
843 | + // rules: [{ required: true }], | ||
844 | + }, | ||
778 | // { | 845 | // { |
779 | - // label: '包装费用$', | 846 | + // label: '包装费用合计', |
780 | // component: 'InputNumber', | 847 | // component: 'InputNumber', |
781 | - // field: 'packetPrice', | 848 | + // field: 'packetTotalPrice', |
782 | // rules: [{ required: true }], | 849 | // rules: [{ required: true }], |
783 | // }, | 850 | // }, |
784 | { | 851 | { |
785 | - label: '包装费用合计', | ||
786 | - component: 'InputNumber', | ||
787 | - field: 'packetTotalPrice', | ||
788 | - rules: [{ required: true }], | ||
789 | - }, | ||
790 | - { | ||
791 | - label: '包装费用合计单位', | 852 | + label: '包装费用货币单位', |
792 | component: 'Select', | 853 | component: 'Select', |
793 | field: 'packetCurrency', | 854 | field: 'packetCurrency', |
794 | - rules: [{ required: true }], | 855 | + // rules: [{ required: true }], |
795 | componentProps: { | 856 | componentProps: { |
796 | options: [ | 857 | options: [ |
797 | { label: '$', value: '$' }, | 858 | { label: '$', value: '$' }, |
@@ -803,7 +864,7 @@ export const FIELDS_PROFIT_INFO = [ | @@ -803,7 +864,7 @@ export const FIELDS_PROFIT_INFO = [ | ||
803 | label: '汇率', | 864 | label: '汇率', |
804 | component: 'InputNumber', | 865 | component: 'InputNumber', |
805 | field: 'exchangeRate', | 866 | field: 'exchangeRate', |
806 | - rules: [{ required: true }], | 867 | + // rules: [{ required: true }], |
807 | }, | 868 | }, |
808 | // { | 869 | // { |
809 | // label: '利润率', | 870 | // label: '利润率', |
@@ -819,75 +880,75 @@ export const FIELDS_INSPECTION_INFO = [ | @@ -819,75 +880,75 @@ export const FIELDS_INSPECTION_INFO = [ | ||
819 | field: 'midCheckApplyTime', | 880 | field: 'midCheckApplyTime', |
820 | component: 'DatePicker', | 881 | component: 'DatePicker', |
821 | label: '中期验货申请时间', | 882 | label: '中期验货申请时间', |
822 | - rules: [{ required: true }], | 883 | + // rules: [{ required: true }], |
823 | }, | 884 | }, |
824 | { | 885 | { |
825 | field: 'midCheckComment', | 886 | field: 'midCheckComment', |
826 | component: 'Input', | 887 | component: 'Input', |
827 | label: '中期验货(功能性-拉力/跌落等、外观性-颜色/规格等、耐久性-烤厅等)', | 888 | label: '中期验货(功能性-拉力/跌落等、外观性-颜色/规格等、耐久性-烤厅等)', |
828 | - rules: [{ required: true }], | 889 | + // rules: [{ required: true }], |
829 | }, | 890 | }, |
830 | { | 891 | { |
831 | field: 'midCheckResult', | 892 | field: 'midCheckResult', |
832 | component: 'Select', | 893 | component: 'Select', |
833 | optionField: 'midCheckResult', | 894 | optionField: 'midCheckResult', |
834 | label: '中期验货结果PASS / FAIL', | 895 | label: '中期验货结果PASS / FAIL', |
835 | - rules: [{ required: true }], | 896 | + // rules: [{ required: true }], |
836 | }, | 897 | }, |
837 | { | 898 | { |
838 | field: 'endCheckApplyTime', | 899 | field: 'endCheckApplyTime', |
839 | component: 'DatePicker', | 900 | component: 'DatePicker', |
840 | label: '尾期验货申请时间', | 901 | label: '尾期验货申请时间', |
841 | - rules: [{ required: true }], | 902 | + // rules: [{ required: true }], |
842 | }, | 903 | }, |
843 | { | 904 | { |
844 | field: 'specification', | 905 | field: 'specification', |
845 | component: 'Input', | 906 | component: 'Input', |
846 | label: '长度/规格', | 907 | label: '长度/规格', |
847 | - rules: [{ required: true }], | 908 | + // rules: [{ required: true }], |
848 | }, | 909 | }, |
849 | { | 910 | { |
850 | field: 'functionality', | 911 | field: 'functionality', |
851 | component: 'Input', | 912 | component: 'Input', |
852 | label: '功能性不良', | 913 | label: '功能性不良', |
853 | - rules: [{ required: true }], | 914 | + // rules: [{ required: true }], |
854 | }, | 915 | }, |
855 | { | 916 | { |
856 | field: 'electroplate', | 917 | field: 'electroplate', |
857 | component: 'Input', | 918 | component: 'Input', |
858 | label: '电镀不良', | 919 | label: '电镀不良', |
859 | - rules: [{ required: true }], | 920 | + // rules: [{ required: true }], |
860 | }, | 921 | }, |
861 | { | 922 | { |
862 | field: 'value1', | 923 | field: 'value1', |
863 | component: 'Input', | 924 | component: 'Input', |
864 | label: '不良1', | 925 | label: '不良1', |
865 | - rules: [{ required: true }], | 926 | + // rules: [{ required: true }], |
866 | }, | 927 | }, |
867 | { | 928 | { |
868 | field: 'value2', | 929 | field: 'value2', |
869 | component: 'Input', | 930 | component: 'Input', |
870 | label: '不良2', | 931 | label: '不良2', |
871 | - rules: [{ required: true }], | 932 | + // rules: [{ required: true }], |
872 | }, | 933 | }, |
873 | { | 934 | { |
874 | field: 'value3', | 935 | field: 'value3', |
875 | component: 'Input', | 936 | component: 'Input', |
876 | label: '其他不良3', | 937 | label: '其他不良3', |
877 | - rules: [{ required: true }], | 938 | + // rules: [{ required: true }], |
878 | }, | 939 | }, |
879 | { | 940 | { |
880 | field: 'boxPacket', | 941 | field: 'boxPacket', |
881 | component: 'Input', | 942 | component: 'Input', |
882 | label: '包装:卡片、条码、箱贴,箱单', | 943 | label: '包装:卡片、条码、箱贴,箱单', |
883 | - rules: [{ required: true }], | 944 | + // rules: [{ required: true }], |
884 | }, | 945 | }, |
885 | { | 946 | { |
886 | field: 'endCheckResult', | 947 | field: 'endCheckResult', |
887 | component: 'Select', | 948 | component: 'Select', |
888 | label: '尾期验货结果PASS / FAIL', | 949 | label: '尾期验货结果PASS / FAIL', |
889 | optionField: 'endCheckResult', | 950 | optionField: 'endCheckResult', |
890 | - rules: [{ required: true }], | 951 | + // rules: [{ required: true }], |
891 | }, | 952 | }, |
892 | ]; | 953 | ]; |
893 | 954 |
src/views/project/order/type.d.ts
0 → 100644
src/views/project/order/utils.ts
0 → 100644
1 | +export const isAuthShow = (role: string) => {}; |
src/views/sys/login/LoginForm.vue
@@ -171,16 +171,16 @@ | @@ -171,16 +171,16 @@ | ||
171 | if (userInfo) { | 171 | if (userInfo) { |
172 | notification.success({ | 172 | notification.success({ |
173 | message: t('sys.login.loginSuccessTitle'), | 173 | message: t('sys.login.loginSuccessTitle'), |
174 | - description: `${t('sys.login.loginSuccessDesc')}: ${userInfo.realName}`, | 174 | + description: `${t('sys.login.loginSuccessDesc')}: ${userInfo.nickName}`, |
175 | duration: 3, | 175 | duration: 3, |
176 | }); | 176 | }); |
177 | } | 177 | } |
178 | } catch (error) { | 178 | } catch (error) { |
179 | - createErrorModal({ | ||
180 | - title: t('sys.api.errorTip'), | ||
181 | - content: (error as unknown as Error).message || t('sys.api.networkExceptionMsg'), | ||
182 | - getContainer: () => document.body.querySelector(`.${prefixCls}`) || document.body, | ||
183 | - }); | 179 | + // createErrorModal({ |
180 | + // title: t('sys.api.errorTip'), | ||
181 | + // content: (error as unknown as Error).message || t('sys.api.networkExceptionMsg'), | ||
182 | + // getContainer: () => document.body.querySelector(`.${prefixCls}`) || document.body, | ||
183 | + // }); | ||
184 | } finally { | 184 | } finally { |
185 | loading.value = false; | 185 | loading.value = false; |
186 | } | 186 | } |