Commit 684e79679f9510bdd6d83d0e0b74fe540a1333a7
1 parent
95fbe9af
完成邮件配置页面编辑与添加功能
Showing
5 changed files
with
333 additions
and
249 deletions
src/api/sys/config.ts
@@ -92,6 +92,7 @@ export const getEmailList = async (params: any) => { | @@ -92,6 +92,7 @@ export const getEmailList = async (params: any) => { | ||
92 | params, | 92 | params, |
93 | }); | 93 | }); |
94 | const resAll = dealRecords(res.records); | 94 | const resAll = dealRecords(res.records); |
95 | + console.log(resAll); | ||
95 | return resAll; | 96 | return resAll; |
96 | }; | 97 | }; |
97 | 98 |
src/views/project/config/DrawerCreate.vue
@@ -27,14 +27,71 @@ | @@ -27,14 +27,71 @@ | ||
27 | import { defineComponent, ref, computed, unref, toRaw } from 'vue'; | 27 | import { defineComponent, ref, computed, unref, toRaw } from 'vue'; |
28 | import { useOrderInfo } from '/@/hooks/component/order'; | 28 | import { useOrderInfo } from '/@/hooks/component/order'; |
29 | import { useOrderStoreWithOut } from '/@/store/modules/order'; | 29 | import { useOrderStoreWithOut } from '/@/store/modules/order'; |
30 | + // import { configInfos } from './event'; | ||
30 | 31 | ||
31 | const orderStore = useOrderStoreWithOut(); | 32 | const orderStore = useOrderStoreWithOut(); |
32 | const { customerCode: customerCodeOptions } = useOrderInfo(orderStore); | 33 | const { customerCode: customerCodeOptions } = useOrderInfo(orderStore); |
33 | const emit = defineEmits(['success2']); | 34 | const emit = defineEmits(['success2']); |
34 | // const isUpdate = ref(true); | 35 | // const isUpdate = ref(true); |
36 | + const configInfos: ConfigInfo[] = [ | ||
37 | + { | ||
38 | + fieldName: '确认样品确认状态', | ||
39 | + fieldValue: 'configSample', | ||
40 | + event: 'CONFIRM_SAMPLE_EVENT', | ||
41 | + emails: [], | ||
42 | + }, | ||
43 | + { | ||
44 | + fieldName: '其他要求样品发送日期', | ||
45 | + fieldValue: 'otherSample', | ||
46 | + event: 'OTHER_SAMPLE_EVENT', | ||
47 | + emails: [], | ||
48 | + }, | ||
49 | + { | ||
50 | + fieldName: '大货样确认态', | ||
51 | + fieldValue: 'bigSample', | ||
52 | + event: 'BIG_SAMPLE_EVENT', | ||
53 | + emails: [], | ||
54 | + }, | ||
55 | + { | ||
56 | + fieldName: 'AIDE/SGS测试状态', | ||
57 | + fieldValue: 'aitexSgsTest', | ||
58 | + event: 'AITEX_SGS_TEST_EVENT', | ||
59 | + emails: [], | ||
60 | + }, | ||
61 | + { | ||
62 | + fieldName: '要求包材到货日期', | ||
63 | + fieldValue: 'barcodeArrival', | ||
64 | + event: 'BARCODE_ARRIVAL_EVENT', | ||
65 | + emails: [], | ||
66 | + }, | ||
67 | + { | ||
68 | + fieldName: '最晚订舱日期', | ||
69 | + fieldValue: 'latestDc', | ||
70 | + event: 'LATEST_DC_EVENT', | ||
71 | + emails: [], | ||
72 | + }, | ||
73 | + { | ||
74 | + fieldName: '尾期验货日期', | ||
75 | + fieldValue: 'endCheckDate', | ||
76 | + event: 'END_CHECK_DATE_EVENT', | ||
77 | + emails: [], | ||
78 | + }, | ||
79 | + { | ||
80 | + fieldName: '中期验货报告', | ||
81 | + fieldValue: 'midCheckReport', | ||
82 | + event: 'MID_CHECK_REPORT_EVENT', | ||
83 | + emails: [], | ||
84 | + }, | ||
85 | + { | ||
86 | + fieldName: '尾期验货报告', | ||
87 | + fieldValue: 'endCheckReport', | ||
88 | + event: 'END_CHECK_REPORT_EVENT', | ||
89 | + emails: [], | ||
90 | + }, | ||
91 | + ]; | ||
35 | const schemas: FormSchema[] = [ | 92 | const schemas: FormSchema[] = [ |
36 | { | 93 | { |
37 | - field: 'settingValue', | 94 | + field: 'typeValue', |
38 | component: 'Select', | 95 | component: 'Select', |
39 | label: '客户编码', | 96 | label: '客户编码', |
40 | componentProps: { | 97 | componentProps: { |
@@ -44,116 +101,98 @@ | @@ -44,116 +101,98 @@ | ||
44 | span: 23, | 101 | span: 23, |
45 | }, | 102 | }, |
46 | defaultValue: '', | 103 | defaultValue: '', |
104 | + rules: [{ required: true }], | ||
47 | }, | 105 | }, |
48 | { | 106 | { |
49 | - field: 'createTime', | 107 | + field: 'configSample', |
50 | component: 'InputTextArea', | 108 | component: 'InputTextArea', |
51 | labelWidth: 250, | 109 | labelWidth: 250, |
52 | colProps: { | 110 | colProps: { |
53 | span: 23, | 111 | span: 23, |
54 | }, | 112 | }, |
55 | label: '确认样品确认状态(填写邮箱)', | 113 | label: '确认样品确认状态(填写邮箱)', |
114 | + rules: [{ required: true }], | ||
115 | + }, | ||
116 | + { | ||
117 | + field: 'otherSample', | ||
118 | + component: 'InputTextArea', | ||
119 | + labelWidth: 250, | ||
120 | + colProps: { | ||
121 | + span: 23, | ||
122 | + }, | ||
123 | + label: '其他需求样品发送时间(填写邮箱)', | ||
124 | + rules: [{ required: true }], | ||
125 | + }, | ||
126 | + { | ||
127 | + field: 'bigSample', | ||
128 | + component: 'InputTextArea', | ||
129 | + labelWidth: 250, | ||
130 | + colProps: { | ||
131 | + span: 23, | ||
132 | + }, | ||
133 | + label: '大货样确认意见(填写邮箱)', | ||
134 | + rules: [{ required: true }], | ||
135 | + }, | ||
136 | + { | ||
137 | + field: 'aitexSgsTest', | ||
138 | + component: 'InputTextArea', | ||
139 | + labelWidth: 250, | ||
140 | + colProps: { | ||
141 | + span: 23, | ||
142 | + }, | ||
143 | + label: 'AITEX/SGS测试状态(填写邮箱)', | ||
144 | + rules: [{ required: true }], | ||
145 | + }, | ||
146 | + { | ||
147 | + field: 'barcodeArrival', | ||
148 | + component: 'InputTextArea', | ||
149 | + labelWidth: 250, | ||
150 | + colProps: { | ||
151 | + span: 23, | ||
152 | + }, | ||
153 | + label: '要求包装到货日期(填写邮箱)', | ||
154 | + rules: [{ required: true }], | ||
155 | + }, | ||
156 | + { | ||
157 | + field: 'latestDc', | ||
158 | + component: 'InputTextArea', | ||
159 | + labelWidth: 250, | ||
160 | + colProps: { | ||
161 | + span: 23, | ||
162 | + }, | ||
163 | + label: '最晚订舱时间(填写邮箱)', | ||
164 | + rules: [{ required: true }], | ||
165 | + }, | ||
166 | + { | ||
167 | + field: 'endCheckDate', | ||
168 | + component: 'InputTextArea', | ||
169 | + labelWidth: 250, | ||
170 | + colProps: { | ||
171 | + span: 23, | ||
172 | + }, | ||
173 | + label: '尾期验货日期(填写邮箱)', | ||
174 | + rules: [{ required: true }], | ||
175 | + }, | ||
176 | + { | ||
177 | + field: 'midCheckReport', | ||
178 | + component: 'InputTextArea', | ||
179 | + labelWidth: 250, | ||
180 | + colProps: { | ||
181 | + span: 23, | ||
182 | + }, | ||
183 | + label: '中期验货报告(填写邮箱)', | ||
184 | + rules: [{ required: true }], | ||
185 | + }, | ||
186 | + { | ||
187 | + field: 'endCheckReport', | ||
188 | + component: 'InputTextArea', | ||
189 | + labelWidth: 250, | ||
190 | + colProps: { | ||
191 | + span: 23, | ||
192 | + }, | ||
193 | + label: '尾期验货报告(填写邮箱)', | ||
194 | + rules: [{ required: true }], | ||
56 | }, | 195 | }, |
57 | - // { | ||
58 | - // field: 'id', | ||
59 | - // component: 'Select', | ||
60 | - // label: '客户编码', | ||
61 | - // colProps: { | ||
62 | - // span: 23, | ||
63 | - // }, | ||
64 | - // defaultValue: '', | ||
65 | - // rules: [{ required: true }], | ||
66 | - // }, | ||
67 | - // { | ||
68 | - // field: 'event', | ||
69 | - // component: 'InputTextArea', | ||
70 | - // labelWidth: 250, | ||
71 | - // colProps: { | ||
72 | - // span: 23, | ||
73 | - // }, | ||
74 | - // label: '确认样品确认状态(填写邮箱)', | ||
75 | - // rules: [{ required: true }], | ||
76 | - // }, | ||
77 | - // { | ||
78 | - // field: 'event2', | ||
79 | - // component: 'InputTextArea', | ||
80 | - // labelWidth: 250, | ||
81 | - // colProps: { | ||
82 | - // span: 23, | ||
83 | - // }, | ||
84 | - // label: '其他需求样品发送时间(填写邮箱)', | ||
85 | - // rules: [{ required: true }], | ||
86 | - // }, | ||
87 | - // { | ||
88 | - // field: 'event3', | ||
89 | - // component: 'InputTextArea', | ||
90 | - // labelWidth: 250, | ||
91 | - // colProps: { | ||
92 | - // span: 23, | ||
93 | - // }, | ||
94 | - // label: '大货样确认意见(填写邮箱)', | ||
95 | - // rules: [{ required: true }], | ||
96 | - // }, | ||
97 | - // { | ||
98 | - // field: 'event4', | ||
99 | - // component: 'InputTextArea', | ||
100 | - // labelWidth: 250, | ||
101 | - // colProps: { | ||
102 | - // span: 23, | ||
103 | - // }, | ||
104 | - // label: 'AITEX/SGS测试状态(填写邮箱)', | ||
105 | - // rules: [{ required: true }], | ||
106 | - // }, | ||
107 | - // { | ||
108 | - // field: 'event5', | ||
109 | - // component: 'InputTextArea', | ||
110 | - // labelWidth: 250, | ||
111 | - // colProps: { | ||
112 | - // span: 23, | ||
113 | - // }, | ||
114 | - // label: '要求包装到货日期(填写邮箱)', | ||
115 | - // rules: [{ required: true }], | ||
116 | - // }, | ||
117 | - // { | ||
118 | - // field: 'event6', | ||
119 | - // component: 'InputTextArea', | ||
120 | - // labelWidth: 250, | ||
121 | - // colProps: { | ||
122 | - // span: 23, | ||
123 | - // }, | ||
124 | - // label: '最晚订舱时间(填写邮箱)', | ||
125 | - // rules: [{ required: true }], | ||
126 | - // }, | ||
127 | - // { | ||
128 | - // field: 'event7', | ||
129 | - // component: 'InputTextArea', | ||
130 | - // labelWidth: 250, | ||
131 | - // colProps: { | ||
132 | - // span: 23, | ||
133 | - // }, | ||
134 | - // label: '尾期验货日期(填写邮箱)', | ||
135 | - // rules: [{ required: true }], | ||
136 | - // }, | ||
137 | - // { | ||
138 | - // field: 'event8', | ||
139 | - // component: 'InputTextArea', | ||
140 | - // labelWidth: 250, | ||
141 | - // colProps: { | ||
142 | - // span: 23, | ||
143 | - // }, | ||
144 | - // label: '中期验货报告(填写邮箱)', | ||
145 | - // rules: [{ required: true }], | ||
146 | - // }, | ||
147 | - // { | ||
148 | - // field: 'event9', | ||
149 | - // component: 'InputTextArea', | ||
150 | - // labelWidth: 250, | ||
151 | - // colProps: { | ||
152 | - // span: 23, | ||
153 | - // }, | ||
154 | - // label: '尾期验货报告(填写邮箱)', | ||
155 | - // rules: [{ required: true }], | ||
156 | - // }, | ||
157 | ]; | 196 | ]; |
158 | const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({ | 197 | const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({ |
159 | labelWidth: 120, | 198 | labelWidth: 120, |
@@ -174,19 +213,43 @@ | @@ -174,19 +213,43 @@ | ||
174 | // settingValue: 'customerCode', | 213 | // settingValue: 'customerCode', |
175 | // }); | 214 | // }); |
176 | }); | 215 | }); |
177 | - function replaceChineseCommas(text: string): string { | ||
178 | - // 使用正则表达式替换中文逗号 | ||
179 | - const replacedText = text.replace(/,/g, ','); | ||
180 | - return replacedText; | 216 | + |
217 | + interface ConfigInfo { | ||
218 | + fieldName: string; // 字段名称,必须 | ||
219 | + fieldValue: string; // 字段值,必须 | ||
220 | + event?: string; // 订单事件,非必须,可选字段 | ||
221 | + emails: string[]; // 邮箱列表,必须 | ||
222 | + } | ||
223 | + | ||
224 | + // 定义包含configInfos的更大对象 | ||
225 | + interface ProductionDepartment { | ||
226 | + type: string; // 类型,必须 | ||
227 | + typeValue: string; // 某个type中具体的值,必须 | ||
228 | + configInfos: ConfigInfo[]; // 配置信息数组,必须 | ||
181 | } | 229 | } |
182 | async function handleSubmit() { | 230 | async function handleSubmit() { |
183 | try { | 231 | try { |
184 | const values = await validate(); | 232 | const values = await validate(); |
185 | - console.log(values, 555, 666); | ||
186 | - values.createTime = replaceChineseCommas(values.createTime); | ||
187 | - console.log(values, 777, 888); | 233 | + //引入所有事件合集,给各个事件命名,方便匹配 |
234 | + const configObject = configInfos.reduce((obj, item) => { | ||
235 | + obj[item.fieldValue] = item; | ||
236 | + return obj; | ||
237 | + }, {} as { [key: string]: ConfigInfo }); | ||
238 | + const newValues = ref<ProductionDepartment>({ | ||
239 | + type: '客户编码', | ||
240 | + typeValue: '', | ||
241 | + configInfos: [], | ||
242 | + }); | ||
243 | + newValues.value.typeValue = values.typeValue; | ||
244 | + for (const value1 in values) { | ||
245 | + if (value1 != 'typeValue') { | ||
246 | + const arr: string[] = values[value1].split(/[,|,]/); | ||
247 | + configObject[value1].emails = arr; | ||
248 | + newValues.value.configInfos.push(configObject[value1]); | ||
249 | + } | ||
250 | + } | ||
188 | emit('success2', { | 251 | emit('success2', { |
189 | - values: { ...values }, | 252 | + values: { ...newValues.value }, |
190 | }); | 253 | }); |
191 | setDrawerProps({ confirmLoading: true }); | 254 | setDrawerProps({ confirmLoading: true }); |
192 | closeDrawer(); | 255 | closeDrawer(); |
src/views/project/config/DrawerEdit.vue
@@ -52,36 +52,26 @@ | @@ -52,36 +52,26 @@ | ||
52 | label: '确认样品确认状态(填写邮箱)', | 52 | label: '确认样品确认状态(填写邮箱)', |
53 | rules: [{ required: true }], | 53 | rules: [{ required: true }], |
54 | }, | 54 | }, |
55 | - // { | ||
56 | - // field: 'event', | ||
57 | - // component: 'InputTextArea', | ||
58 | - // labelWidth: 250, | ||
59 | - // colProps: { | ||
60 | - // span: 23, | ||
61 | - // }, | ||
62 | - // label: '确认样品确认状态(填写邮箱)', | ||
63 | - // rules: [{ required: true }], | ||
64 | - // }, | ||
65 | - // { | ||
66 | - // field: 'event2', | ||
67 | - // component: 'InputTextArea', | ||
68 | - // labelWidth: 250, | ||
69 | - // colProps: { | ||
70 | - // span: 23, | ||
71 | - // }, | ||
72 | - // label: '其他需求样品发送时间(填写邮箱)', | ||
73 | - // rules: [{ required: true }], | ||
74 | - // }, | ||
75 | - // { | ||
76 | - // field: 'event3', | ||
77 | - // component: 'InputTextArea', | ||
78 | - // labelWidth: 250, | ||
79 | - // colProps: { | ||
80 | - // span: 23, | ||
81 | - // }, | ||
82 | - // label: '大货样确认意见(填写邮箱)', | ||
83 | - // rules: [{ required: true }], | ||
84 | - // }, | 55 | + { |
56 | + field: 'otherSample', | ||
57 | + component: 'InputTextArea', | ||
58 | + labelWidth: 250, | ||
59 | + colProps: { | ||
60 | + span: 23, | ||
61 | + }, | ||
62 | + label: '其他需求样品发送时间(填写邮箱)', | ||
63 | + rules: [{ required: true }], | ||
64 | + }, | ||
65 | + { | ||
66 | + field: 'bigSample', | ||
67 | + component: 'InputTextArea', | ||
68 | + labelWidth: 250, | ||
69 | + colProps: { | ||
70 | + span: 23, | ||
71 | + }, | ||
72 | + label: '大货样确认意见(填写邮箱)', | ||
73 | + rules: [{ required: true }], | ||
74 | + }, | ||
85 | { | 75 | { |
86 | field: 'aitexSgsTest', | 76 | field: 'aitexSgsTest', |
87 | component: 'InputTextArea', | 77 | component: 'InputTextArea', |
@@ -92,56 +82,56 @@ | @@ -92,56 +82,56 @@ | ||
92 | label: 'AITEX/SGS测试状态(填写邮箱)', | 82 | label: 'AITEX/SGS测试状态(填写邮箱)', |
93 | rules: [{ required: true }], | 83 | rules: [{ required: true }], |
94 | }, | 84 | }, |
95 | - // { | ||
96 | - // field: 'event5', | ||
97 | - // component: 'InputTextArea', | ||
98 | - // labelWidth: 250, | ||
99 | - // colProps: { | ||
100 | - // span: 23, | ||
101 | - // }, | ||
102 | - // label: '要求包装到货日期(填写邮箱)', | ||
103 | - // rules: [{ required: true }], | ||
104 | - // }, | ||
105 | - // { | ||
106 | - // field: 'event6', | ||
107 | - // component: 'InputTextArea', | ||
108 | - // labelWidth: 250, | ||
109 | - // colProps: { | ||
110 | - // span: 23, | ||
111 | - // }, | ||
112 | - // label: '最晚订舱时间(填写邮箱)', | ||
113 | - // rules: [{ required: true }], | ||
114 | - // }, | ||
115 | - // { | ||
116 | - // field: 'event7', | ||
117 | - // component: 'InputTextArea', | ||
118 | - // labelWidth: 250, | ||
119 | - // colProps: { | ||
120 | - // span: 23, | ||
121 | - // }, | ||
122 | - // label: '尾期验货日期(填写邮箱)', | ||
123 | - // rules: [{ required: true }], | ||
124 | - // }, | ||
125 | - // { | ||
126 | - // field: 'event8', | ||
127 | - // component: 'InputTextArea', | ||
128 | - // labelWidth: 250, | ||
129 | - // colProps: { | ||
130 | - // span: 23, | ||
131 | - // }, | ||
132 | - // label: '中期验货报告(填写邮箱)', | ||
133 | - // rules: [{ required: true }], | ||
134 | - // }, | ||
135 | - // { | ||
136 | - // field: 'event9', | ||
137 | - // component: 'InputTextArea', | ||
138 | - // labelWidth: 250, | ||
139 | - // colProps: { | ||
140 | - // span: 23, | ||
141 | - // }, | ||
142 | - // label: '尾期验货报告(填写邮箱)', | ||
143 | - // rules: [{ required: true }], | ||
144 | - // }, | 85 | + { |
86 | + field: 'barcodeArrival', | ||
87 | + component: 'InputTextArea', | ||
88 | + labelWidth: 250, | ||
89 | + colProps: { | ||
90 | + span: 23, | ||
91 | + }, | ||
92 | + label: '要求包装到货日期(填写邮箱)', | ||
93 | + rules: [{ required: true }], | ||
94 | + }, | ||
95 | + { | ||
96 | + field: 'latestDc', | ||
97 | + component: 'InputTextArea', | ||
98 | + labelWidth: 250, | ||
99 | + colProps: { | ||
100 | + span: 23, | ||
101 | + }, | ||
102 | + label: '最晚订舱时间(填写邮箱)', | ||
103 | + rules: [{ required: true }], | ||
104 | + }, | ||
105 | + { | ||
106 | + field: 'endCheckDate', | ||
107 | + component: 'InputTextArea', | ||
108 | + labelWidth: 250, | ||
109 | + colProps: { | ||
110 | + span: 23, | ||
111 | + }, | ||
112 | + label: '尾期验货日期(填写邮箱)', | ||
113 | + rules: [{ required: true }], | ||
114 | + }, | ||
115 | + { | ||
116 | + field: 'midCheckReport', | ||
117 | + component: 'InputTextArea', | ||
118 | + labelWidth: 250, | ||
119 | + colProps: { | ||
120 | + span: 23, | ||
121 | + }, | ||
122 | + label: '中期验货报告(填写邮箱)', | ||
123 | + rules: [{ required: true }], | ||
124 | + }, | ||
125 | + { | ||
126 | + field: 'endCheckReport', | ||
127 | + component: 'InputTextArea', | ||
128 | + labelWidth: 250, | ||
129 | + colProps: { | ||
130 | + span: 23, | ||
131 | + }, | ||
132 | + label: '尾期验货报告(填写邮箱)', | ||
133 | + rules: [{ required: true }], | ||
134 | + }, | ||
145 | { | 135 | { |
146 | field: 'id', | 136 | field: 'id', |
147 | }, | 137 | }, |
@@ -172,37 +162,63 @@ | @@ -172,37 +162,63 @@ | ||
172 | ...toRaw(data.data), | 162 | ...toRaw(data.data), |
173 | }); | 163 | }); |
174 | }); | 164 | }); |
175 | - function replaceChineseCommas(text: string): string { | ||
176 | - // 使用正则表达式替换中文逗号 | ||
177 | - const replacedText = text.replace(/,/g, ','); | ||
178 | - return replacedText; | ||
179 | - } | 165 | + // function replaceChineseCommas(text: string): string { |
166 | + // // 使用正则表达式替换中文逗号 | ||
167 | + // const replacedText = text.replace(/,/g, ','); | ||
168 | + // return replacedText; | ||
169 | + // } | ||
180 | async function getData() { | 170 | async function getData() { |
181 | const emailAll = await getEmailList({}); | 171 | const emailAll = await getEmailList({}); |
182 | - console.log(emailAll, 56561); | ||
183 | return emailAll; | 172 | return emailAll; |
184 | } | 173 | } |
174 | + interface NewValues { | ||
175 | + id: string; | ||
176 | + type: string; | ||
177 | + typeValue: string; | ||
178 | + configInfos: any[]; | ||
179 | + } | ||
185 | async function handleSubmit() { | 180 | async function handleSubmit() { |
186 | try { | 181 | try { |
187 | const values = await validate(); | 182 | const values = await validate(); |
183 | + console.log(values, '5656values1'); | ||
184 | + const newValues = ref<NewValues>({ | ||
185 | + id: '', | ||
186 | + type: '', | ||
187 | + typeValue: '', | ||
188 | + configInfos: [], | ||
189 | + }); | ||
190 | + newValues.value.id = values.id; | ||
191 | + newValues.value.type = values.type; | ||
192 | + newValues.value.typeValue = values.typeValue; | ||
193 | + console.log(newValues.value.id, '5656idwd'); | ||
188 | getData().then((res) => { | 194 | getData().then((res) => { |
189 | - const test = ref(); | 195 | + console.log(res, 5656111); |
190 | for (const value1 of res) { | 196 | for (const value1 of res) { |
191 | - test.value = value1; | ||
192 | - for (const value2 of value1.configInfos) { | ||
193 | - console.log(value1, 56568); | 197 | + //循环整个列表,找出编辑行 |
198 | + if (value1.id == values.id) { | ||
199 | + // test.value = value1; | ||
200 | + newValues.value.configInfos = value1.configInfos; | ||
201 | + console.log(newValues.value, '5656fornewvalue'); | ||
202 | + for (const value2 of newValues.value.configInfos) { | ||
203 | + //遍历所有邮件事件 | ||
204 | + // console.log(value2, '5656value2'); | ||
205 | + for (const value3 in values) { | ||
206 | + //遍历编辑框传递数据 | ||
207 | + // console.log(value3, '5656value3'); | ||
208 | + if (value2.fieldValue == value3) { | ||
209 | + const arr: string[] = values[value3].split(/[,|,]/); | ||
210 | + value2.emails = arr; | ||
211 | + console.log(value2.emails, '5656value2.emails'); | ||
212 | + } | ||
213 | + } | ||
214 | + } | ||
194 | } | 215 | } |
195 | } | 216 | } |
196 | - test.value.configSample = replaceChineseCommas(values.configSample); | 217 | + console.log(newValues.value, 56566); |
197 | emit('success', { | 218 | emit('success', { |
198 | - values: { ...test }, | 219 | + values: { ...newValues.value }, |
199 | }); | 220 | }); |
200 | }); | 221 | }); |
201 | - // values.aitexSgsTest = replaceChineseCommas(values.aitexSgsTest); | ||
202 | - // console.log(values, 333333); | ||
203 | - // emit('success', { | ||
204 | - // values: { ...values }, | ||
205 | - // }); | ||
206 | setDrawerProps({ confirmLoading: true }); | 222 | setDrawerProps({ confirmLoading: true }); |
207 | closeDrawer(); | 223 | closeDrawer(); |
208 | } finally { | 224 | } finally { |
src/views/project/config/EmailPanel.vue
@@ -101,8 +101,9 @@ | @@ -101,8 +101,9 @@ | ||
101 | }, | 101 | }, |
102 | // showSelectionBar: true, // 显示多选状态栏 | 102 | // showSelectionBar: true, // 显示多选状态栏 |
103 | }); | 103 | }); |
104 | - function handleCreate() { | 104 | + function handleCreate(record) { |
105 | openDrawerCreate(true, { | 105 | openDrawerCreate(true, { |
106 | + data: record, | ||
106 | isUpdate: false, | 107 | isUpdate: false, |
107 | }); | 108 | }); |
108 | } | 109 | } |
@@ -126,16 +127,19 @@ | @@ -126,16 +127,19 @@ | ||
126 | // reload(); | 127 | // reload(); |
127 | // } | 128 | // } |
128 | async function handleSuccess({ values }) { | 129 | async function handleSuccess({ values }) { |
129 | - console.log(values, 899); | ||
130 | - // const valueJson = JSON.stringify(values); | ||
131 | - // await emailEdit({ values.id }); | 130 | + console.log(values, '5656receive'); |
131 | + await emailEdit({ ...values }); | ||
132 | + // await emailEdit({ | ||
133 | + // type: values.type, | ||
134 | + // typeValue: values.typeValue, | ||
135 | + // configInfos: values.configInfos, | ||
136 | + // }); | ||
132 | reload(); | 137 | reload(); |
133 | } | 138 | } |
134 | 139 | ||
135 | async function handleSuccessCreate({ values }) { | 140 | async function handleSuccessCreate({ values }) { |
136 | - // await emailCreate({ ...values }); | ||
137 | - const valueJson = JSON.stringify(values); | ||
138 | - console.log(valueJson, 777); | 141 | + await emailCreate({ ...values }); |
142 | + console.log(values, 777); | ||
139 | reload(); | 143 | reload(); |
140 | } | 144 | } |
141 | async function handleDelete(record: any) { | 145 | async function handleDelete(record: any) { |
src/views/project/config/data.tsx
@@ -67,46 +67,46 @@ export const columns: BasicColumn[] = [ | @@ -67,46 +67,46 @@ export const columns: BasicColumn[] = [ | ||
67 | dataIndex: 'configSample', | 67 | dataIndex: 'configSample', |
68 | width: 300, | 68 | width: 300, |
69 | }, | 69 | }, |
70 | - // { | ||
71 | - // title: '其他需求样品发送时间', | ||
72 | - // dataIndex: 'event2', | ||
73 | - // width: 300, | ||
74 | - // }, | ||
75 | - // { | ||
76 | - // title: '大货样确认意见', | ||
77 | - // dataIndex: 'event3', | ||
78 | - // width: 300, | ||
79 | - // }, | 70 | + { |
71 | + title: '其他需求样品发送时间', | ||
72 | + dataIndex: 'otherSample', | ||
73 | + width: 300, | ||
74 | + }, | ||
75 | + { | ||
76 | + title: '大货样确认意见', | ||
77 | + dataIndex: 'bigSample', | ||
78 | + width: 300, | ||
79 | + }, | ||
80 | { | 80 | { |
81 | title: 'AITEX/SGS测试状态', | 81 | title: 'AITEX/SGS测试状态', |
82 | dataIndex: 'aitexSgsTest', | 82 | dataIndex: 'aitexSgsTest', |
83 | width: 300, | 83 | width: 300, |
84 | }, | 84 | }, |
85 | - // { | ||
86 | - // title: '要求包装到货日期', | ||
87 | - // dataIndex: 'event5', | ||
88 | - // width: 300, | ||
89 | - // }, | ||
90 | - // { | ||
91 | - // title: '最晚订舱时间', | ||
92 | - // dataIndex: 'event6', | ||
93 | - // width: 300, | ||
94 | - // }, | ||
95 | - // { | ||
96 | - // title: '尾期验货日期', | ||
97 | - // dataIndex: 'event7', | ||
98 | - // width: 300, | ||
99 | - // }, | ||
100 | - // { | ||
101 | - // title: '中期验货报告', | ||
102 | - // dataIndex: 'event8', | ||
103 | - // width: 300, | ||
104 | - // }, | ||
105 | - // { | ||
106 | - // title: '尾期验货报告', | ||
107 | - // dataIndex: 'event9', | ||
108 | - // width: 300, | ||
109 | - // }, | 85 | + { |
86 | + title: '要求包装到货日期', | ||
87 | + dataIndex: 'barcodeArrival', | ||
88 | + width: 300, | ||
89 | + }, | ||
90 | + { | ||
91 | + title: '最晚订舱时间', | ||
92 | + dataIndex: 'latestDc', | ||
93 | + width: 300, | ||
94 | + }, | ||
95 | + { | ||
96 | + title: '尾期验货日期', | ||
97 | + dataIndex: 'endCheckDate', | ||
98 | + width: 300, | ||
99 | + }, | ||
100 | + { | ||
101 | + title: '中期验货报告', | ||
102 | + dataIndex: 'midCheckReport', | ||
103 | + width: 300, | ||
104 | + }, | ||
105 | + { | ||
106 | + title: '尾期验货报告', | ||
107 | + dataIndex: 'endCheckReport', | ||
108 | + width: 300, | ||
109 | + }, | ||
110 | ]; | 110 | ]; |
111 | 111 | ||
112 | export const columnsProduct: BasicColumn[] = [ | 112 | export const columnsProduct: BasicColumn[] = [ |