423e0317 by lihua

质量评估,价值评估支持不走流程配置

1 parent 013e2f9d
...@@ -444,6 +444,41 @@ export const getRegisterExchangeList = () => request({ ...@@ -444,6 +444,41 @@ export const getRegisterExchangeList = () => request({
444 method: 'get' 444 method: 'get'
445 }) 445 })
446 446
447 /** 获取合同列表 */
448 export const getContractList = (params) => request({
449 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-contract/page-list`,
450 method: 'post',
451 data: params
452 })
453
454 /** 新增合同 */
455 export const saveDamContract = (params) => request({
456 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-contract/save`,
457 method: 'post',
458 data: params
459 })
460
461 /** 更新合同 */
462 export const updateDamContract = (params) => request({
463 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-contract/update`,
464 method: 'put',
465 data: params
466 })
467
468 /** 删除合同 */
469 export const delDamContract = (params) => request({
470 url: `${import.meta.env.VITE_API_NEW_PORTAL}/dam-contract/delete`,
471 method: 'delete',
472 data: params
473 })
474
475 /** 获取会员列表 */
476 export const getTenantList = (params) => request({
477 url: `${import.meta.env.VITE_APP_PERSONAL_URL}/tenant/singlePage`,
478 method: 'post',
479 data: params
480 })
481
447 // API详情 482 // API详情
448 /** 查询域名和文根 */ 483 /** 查询域名和文根 */
449 /** api类型,有表单类型,自定义sql. */ 484 /** api类型,有表单类型,自定义sql. */
......
...@@ -78,3 +78,8 @@ export const crossPlatformApprove = (params) => request({ ...@@ -78,3 +78,8 @@ export const crossPlatformApprove = (params) => request({
78 method: 'post', 78 method: 'post',
79 data: {} 79 data: {}
80 }) 80 })
81 /** 功能流程配置-获取是否需要审批 */
82 export const isNeedApprove = (params) => request({
83 url: `${import.meta.env.VITE_APP_WORK_FLOW_URL}/func-flow-config/is-need-approve?funcCode=${params.funcCode}`,
84 method: 'get',
85 })
......
...@@ -106,7 +106,7 @@ const getDrawerConRef = (refName) => { ...@@ -106,7 +106,7 @@ const getDrawerConRef = (refName) => {
106 } 106 }
107 // const drawerForm = drawerFormRef.value[0] || drawerFormRef.value; 107 // const drawerForm = drawerFormRef.value[0] || drawerFormRef.value;
108 if (refName == 'drawerFormRef') { 108 if (refName == 'drawerFormRef') {
109 const drawerForm = drawerFormRef.value[0] || drawerFormRef.value; 109 const drawerForm = drawerFormRef.value?.[0] || drawerFormRef.value;
110 return drawerForm 110 return drawerForm
111 } 111 }
112 } 112 }
...@@ -153,11 +153,13 @@ const tableBtnClick = (scope, btn) => { ...@@ -153,11 +153,13 @@ const tableBtnClick = (scope, btn) => {
153 const submitForm = async (formEl: FormInstance | undefined, btn) => { 153 const submitForm = async (formEl: FormInstance | undefined, btn) => {
154 if (!formEl) return; 154 if (!formEl) return;
155 await formEl.validate((valid, fields) => { 155 await formEl.validate((valid, fields) => {
156 if (valid) {
157 const drawerForm = drawerFormRef.value[0] || drawerFormRef.value; 156 const drawerForm = drawerFormRef.value[0] || drawerFormRef.value;
157 if (valid) {
158 const formInfo = drawerForm.formInline; 158 const formInfo = drawerForm.formInline;
159 emits("drawerBtnClick", btn, formInfo); 159 emits("drawerBtnClick", btn, formInfo);
160 } else { 160 } else {
161 var obj = fields && Object.keys(fields);
162 obj?.[0] && formEl?.scrollToField(obj?.[0])
161 console.log("error submit!", fields); 163 console.log("error submit!", fields);
162 } 164 }
163 }); 165 });
......
...@@ -1452,7 +1452,8 @@ const panelChange = (scope, row) => { ...@@ -1452,7 +1452,8 @@ const panelChange = (scope, row) => {
1452 :disabled="item.disabled || readonly" @change="(val) => cascaderChange(val, item)" /> 1452 :disabled="item.disabled || readonly" @change="(val) => cascaderChange(val, item)" />
1453 <template v-else-if="item.type && item.type.indexOf('date') > -1"> 1453 <template v-else-if="item.type && item.type.indexOf('date') > -1">
1454 <el-date-picker :class="[item.col, { is_block: item.block }]" v-if="item.type == 'date-picker'" 1454 <el-date-picker :class="[item.col, { is_block: item.block }]" v-if="item.type == 'date-picker'"
1455 v-model="formInline[item.field]" type="daterange" range-separator="至" start-placeholder="开始日期" 1455 v-model="formInline[item.field]" type="daterange" range-separator="至" start-placeholder="开始日期" :format="item.format ?? null"
1456 :value-format="item.valueFormat ?? null"
1456 end-placeholder="结束日期" :unlink-panels="item.unlink ?? false" :shortcuts="item.shortcuts ?? []" 1457 end-placeholder="结束日期" :unlink-panels="item.unlink ?? false" :shortcuts="item.shortcuts ?? []"
1457 :default-value="item.defaultDate" :disabled="item.disabled ?? false" /> 1458 :default-value="item.defaultDate" :disabled="item.disabled ?? false" />
1458 <el-date-picker :class="[item.col, { is_block: item.block }]" v-else-if="item.type == 'date-year'" 1459 <el-date-picker :class="[item.col, { is_block: item.block }]" v-else-if="item.type == 'date-year'"
......
...@@ -182,6 +182,10 @@ onMounted(() => { ...@@ -182,6 +182,10 @@ onMounted(() => {
182 <el-date-picker v-model="formInline[item.field]" type="datetimerange" start-placeholder="开始时间" 182 <el-date-picker v-model="formInline[item.field]" type="datetimerange" start-placeholder="开始时间"
183 end-placeholder="结束时间" /> 183 end-placeholder="结束时间" />
184 </template> 184 </template>
185 <template v-else-if="item.type == 'date-range'">
186 <el-date-picker v-model="formInline[item.field]" type="daterange" :start-placeholder="item.startPlaceholder ?? '开始日期'" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
187 :end-placeholder="item.endPlaceholder ?? '结束日期'" />
188 </template>
185 <template v-else-if="item.type == 'radio-button'"> 189 <template v-else-if="item.type == 'radio-button'">
186 <el-radio-group v-model="formInline[item.field]" @change="radioGroupChange"> 190 <el-radio-group v-model="formInline[item.field]" @change="radioGroupChange">
187 <el-radio-button v-for="opts in item.options" :label="opts.label" /> 191 <el-radio-button v-for="opts in item.options" :label="opts.label" />
......
...@@ -217,6 +217,27 @@ const routes: RouteRecordRaw[] = [ ...@@ -217,6 +217,27 @@ const routes: RouteRecordRaw[] = [
217 }, 217 },
218 }, 218 },
219 ] 219 ]
220 },
221 {
222 path: '/data-asset-register/contract-progress',
223 component: Layout,
224 meta: {
225 title: '合同进度一览',
226 icon: 'ep:grid',
227 },
228 children: [
229 {
230 path: '',
231 name: 'contractProgress',
232 component: () => import('@/views/data_asset/contractProgress.vue'),
233 meta: {
234 title: '合同进度一览',
235 sidebar: false,
236 cache: true,
237 breadcrumb: false,
238 },
239 },
240 ]
220 } 241 }
221 ] 242 ]
222 export default routes 243 export default routes
......
1 <route lang="yaml">
2 name: contractProgress
3 </route>
4
5 <script lang="ts" setup name="contractProgress">
6 import { ref } from 'vue';
7 import { TableColumnWidth, commonPageConfig } from '@/utils/enum';
8 import {
9 saveDamContract,
10 updateDamContract,
11 delDamContract,
12 getContractList,
13 getParamsList,
14 getTenantList
15 } from "@/api/modules/dataAsset";
16 import { Plus } from "@element-plus/icons-vue";
17 import TableTools from "@/components/Tools/table_tools.vue";
18 import { useValidator } from '@/hooks/useValidator';
19 import useUserStore from "@/store/modules/user";
20 import { cloneDeep } from 'lodash-es';
21 import { onUploadFileDownload } from '@/api/modules/common';
22
23 const { proxy } = getCurrentInstance() as any;
24 const userStore = useUserStore();
25 const userData = JSON.parse(userStore.userData)
26 const { required } = useValidator();
27 const contractTypes: any = ref([]);
28
29 /** 交易合同节点 */
30 const tradeContractNodesList: any = ref([]);
31
32 /** 资产合同节点 */
33 const registerContractNodesList: any = ref([]);
34
35 /** 甲方乙方的下拉会员列表 */
36 const partyAList: any = ref([]);
37
38 const searchItemList = ref([
39 {
40 type: "input",
41 label: "",
42 field: "contractName",
43 default: "",
44 maxlength: 50,
45 placeholder: "合同名称",
46 clearable: true,
47 },
48 {
49 label: "",
50 type: "select",
51 placeholder: "合同类型",
52 field: "contractTypeCode",
53 options: contractTypes.value,
54 default: '',
55 filterable: true,
56 clearable: true,
57 },
58 {
59 type: 'select',
60 label: '',
61 field: 'contractNodeCode',
62 default: '',
63 placeholder: '进展阶段',
64 options: [],
65 clearable: true
66 },
67 {
68 type: "date-range",
69 field: "dateRange",
70 default: null,
71 startPlaceholder: '签约开始日期',
72 endPlaceholder: '签约结束日期',
73 clearable: true,
74 required: true
75 }
76 ]);
77
78 const page = ref({
79 ...commonPageConfig,
80 contractName: '',
81 contractTypeCode: '',
82 contractNodeCode: '',
83 dateRange: []
84 });
85
86 const toSearch = (val: any, clear: boolean = false) => {
87 page.value.curr = 1;
88 if (clear) {
89 searchItemList.value.map((item) => (item.default = ""));
90 page.value.contractName = '';
91 page.value.contractTypeCode = "";
92 page.value.contractNodeCode = "";
93 page.value.dateRange = [];
94 searchItemList.value[2].options = [];
95 } else {
96 page.value.contractName = val.contractName;
97 page.value.contractTypeCode = val.contractTypeCode;
98 page.value.contractNodeCode = val.contractNodeCode;
99 page.value.dateRange = val.dateRange;
100 }
101 getTableData();
102 };
103
104 const tableTools = ref();
105
106 const handleSearchChange = (val, row, info) => {
107 if (row.field == 'contractTypeCode') {
108 tableTools.value.toolSearch.formInline.contractNodeCode = '';
109 searchItemList.value[2].options = val == '1' ? registerContractNodesList.value : (!val ? [] : tradeContractNodesList.value);
110 }
111 }
112
113 const getTableData = () => {
114 tableInfo.value.loading = true;
115 getContractList({
116 pageSize: page.value.limit,
117 pageIndex: page.value.curr,
118 contractName: page.value.contractName,
119 contractTypeCode: page.value.contractTypeCode,
120 contractNodeCode: page.value.contractNodeCode,
121 startDate: page.value.dateRange?.[0] || '',
122 endDate: page.value.dateRange?.[1] || '',
123 }).then((res: any) => {
124 tableInfo.value.loading = false
125 if (res.code == proxy.$passCode) {
126 const data = res.data || {}
127 tableInfo.value.data = data.records || [];
128 tableInfo.value.page.curr = data.pageIndex;
129 tableInfo.value.page.rows = data.totalRows || 0;
130 } else {
131 proxy.$ElMessage.error(res.msg);
132 }
133 })
134 }
135
136 const currTableData: any = ref({});
137
138 const tableInfo = ref({
139 id: 'contract-data-table',
140 rowKey: 'guid',
141 loading: false,
142 fields: [
143 { label: "合同名称", field: "contractName", width: 160, align: "left" },
144 { label: "合同类型", field: "contractTypeName", width: 110 },
145 { label: "甲方名称", field: "partyAName", width: 180 },
146 { label: "乙方名称", field: "partyBName", width: 180 },
147 { label: "签约日期", field: "signContractDate", width: 110 },
148 ],
149 childFields: [
150 { label: "进展节点", field: "contractNodeName", width: 140, align: "left" },
151 { label: "开始日期", field: "startDate", width: TableColumnWidth.DATE },
152 { label: "结束日期", field: "endDate", width: TableColumnWidth.DATE },
153 { label: "工作内容描述", field: "contentDescribe", width: 280 },
154 ],
155 data: [],
156 page: {
157 type: "normal",
158 rows: 0,
159 ...page.value,
160 }
161 });
162
163 const getNodeSteps = (scope) => {
164 let contractNodeCodes = scope.row.contractNodeCodes || [];
165 return {
166 list: contractNodeCodes.map((n, index) => {
167 return {
168 // tooltip: {
169 // placement: 'top',
170 // content: n.name,
171 // className: 'step_title_tooltip',
172 // effect: 'light',
173 // },
174 title: n.name,
175 value: index + 1
176 }
177 }),
178 step: !scope.row.contractNodes?.length ? null : (scope.row.contractNodes.length - 1)
179 }
180 }
181
182 const contractEditFormItems = ref([
183 {
184 label: "合同类型",
185 type: "select",
186 placeholder: "请选择",
187 field: "contractTypeCode",
188 options: contractTypes.value,
189 default: '',
190 filterable: true,
191 clearable: true,
192 required: true,
193 },
194 {
195 type: "input",
196 label: "合同名称",
197 field: "contractName",
198 default: "",
199 maxlength: 50,
200 placeholder: "请输入",
201 clearable: true,
202 required: true,
203 },
204 {
205 label: "甲方名称",
206 type: "select",
207 placeholder: "请选择",
208 field: "partyAGuid",
209 options: partyAList.value,
210 props: {
211 value: 'guid',
212 label: 'tenantName'
213 },
214 default: '',
215 filterable: true,
216 clearable: true,
217 required: true,
218 },
219 {
220 label: "乙方名称",
221 type: "select",
222 placeholder: "请选择",
223 field: "partyBGuid",
224 options: partyAList.value,
225 props: {
226 value: 'guid',
227 label: 'tenantName'
228 },
229 default: '',
230 filterable: true,
231 clearable: true,
232 required: true,
233 },
234 {
235 label: "跟进节点",
236 type: "select",
237 placeholder: "请选择",
238 field: "contractNodeCodes",
239 options: [],
240 multiple: true,
241 default: [],
242 filterable: true,
243 collapse: true,
244 tagsTooltip: true,
245 clearable: true,
246 required: true,
247 },
248 {
249 label: '签约日期',
250 type: 'date',
251 placeholder: '请输入',
252 field: 'signContractDate',
253 default: "",
254 unlink: true,
255 disabled: false,
256 clearable: true,
257 required: true
258 },
259 ]);
260
261 const contractEditFormRules = ref({
262 contractTypeCode: [required('请选择合同类型')],
263 contractName: [required('请填写合同名称')],
264 partyAGuid: [required('请选择甲方名称')],
265 partyBGuid: [required('请选择乙方名称')],
266 contractNodeCodes: [required('请选择跟进节点')],
267 signContractDate: [required('请选择签约日期')],
268 });
269
270
271 /** 新增分类的form */
272 const contractEditFormInfo = ref({
273 type: "form",
274 title: "",
275 col: "span",
276 formInfo: {
277 id: "add-class-form",
278 readonly: false,
279 items: contractEditFormItems.value,
280 rules: contractEditFormRules.value,
281 },
282 });
283
284 const drawerRef = ref();
285
286 /** 新增编辑分类。 */
287 const drawerInfo = ref({
288 visible: false,
289 direction: 'rtl',
290 size: 550,
291 header: {
292 title: '新增合同',
293 },
294 type: '',
295 container: {
296 contents: [contractEditFormInfo.value],
297 },
298 footer: {
299 visible: true,
300 btns: [
301 { type: 'default', label: '取消', value: 'cancel' },
302 { type: 'primary', label: '确定', value: 'save', loading: false },
303 ]
304 }
305 })
306
307 const validate = async () => {
308 if (!nodesInfo.value?.length) {
309 return true;
310 }
311 let taskIndex = 0;
312 for (const task of nodesInfo.value) {
313 let res = await depFormRef.value['ref-' + task.contractNodeCode]?.ruleFormRef?.validate((valid, errorItem) => {
314 if (!valid) {
315 var obj = Object.keys(errorItem);
316 depFormRef.value['ref-' + task.contractNodeCode]?.ruleFormRef?.scrollToField(obj[0]);
317 return false;
318 }
319 })
320 if (!res) {
321 return res;
322 }
323 taskIndex++;
324 }
325 return true;
326 }
327
328 const drawerBtnClick = async (btn, info) => {
329 if (btn.value == 'cancel') {
330 drawerInfo.value.visible = false;
331 } else {
332 if (info.partyAGuid == info.partyBGuid) {
333 proxy.$ElMessage.error(`甲方名称跟乙方名称不能选择同一个`);
334 drawerRef.value?.getDrawerConRef('drawerFormRef')?.ruleFormRef?.scrollToField('partyAGuid');
335 return;
336 }
337 let res = await validate();
338 if (!res) {
339 return
340 }
341 info.contractNodes = [];
342 let index = 0;
343 for (const n of nodesInfo.value) {
344 let formInline = depFormRef.value['ref-' + n.contractNodeCode].formInline;
345 if (index != 0) {
346 if (formInline.dateRange[0] < info.contractNodes[index - 1].endDate) {
347 proxy.$ElMessage.error(`【${n.contractNodeName}】的开始日期应大于等于上一个节点的结束日期`);
348 depFormRef.value['ref-' + n.contractNodeCode]?.ruleFormRef?.scrollToField('dateRange');
349 return;
350 }
351 }
352 info.contractNodes.push(Object.assign({}, formInline, {
353 contractNodeCode: n.contractNodeCode,
354 contractGuid: currTableData.value.guid,
355 contractTypeCode: info.contractTypeCode,
356 startDate: formInline.dateRange[0],
357 endDate: formInline.dateRange[1],
358 nodeAchievement: formInline.nodeAchievement?.map(n => {
359 return {
360 name: n.name,
361 url: n.url
362 }
363 }) || []
364 }))
365 index++;
366 }
367 drawerInfo.value.footer.btns[1].loading = true;
368 if (drawerInfo.value.type == 'add') {
369 saveDamContract(info).then((res: any) => {
370 drawerInfo.value.footer.btns[1].loading = false;
371 if (res.code == proxy.$passCode) {
372 page.value.curr = 1;
373 getTableData();
374 proxy.$ElMessage.success('新增合同成功');
375 drawerInfo.value.visible = false;
376 } else {
377 proxy.$ElMessage.error(res.msg);
378 }
379 })
380 } else {
381 const params = { ...info };
382 params.guid = currTableData.value.guid;
383 updateDamContract(params).then((res: any) => {
384 drawerInfo.value.footer.btns[1].loading = false;
385 if (res.code == proxy.$passCode) {
386 getTableData();
387 proxy.$ElMessage.success('修改合同成功');
388 drawerInfo.value.visible = false;
389 } else {
390 proxy.$ElMessage.error(res.msg);
391 }
392 })
393 }
394 }
395 }
396
397 const drawerSelectChange = (val, row, info) => {
398 if (row.field == 'contractTypeCode') {
399 contractEditFormItems.value.forEach(item => {
400 item.default = info[item.field];
401 if (item.field == 'contractNodeCodes') {
402 item.default = '';
403 nodesInfo.value = [];
404 item.options = val == '1' ? registerContractNodesList.value : (!val ? [] : tradeContractNodesList.value);
405 }
406 });
407 } else if (row.field == 'contractNodeCodes') {
408 info.contractNodeCodes = val?.sort((a, b) => parseInt(a) - parseInt(b));
409 let oldNodesInfo = nodesInfo.value;
410 let nodeInfo: any[] = [];
411 info.contractNodeCodes?.forEach(code => {
412 let node = oldNodesInfo.find(on => on.contractNodeCode == code);
413 if (node) {
414 let formInline = depFormRef.value['ref-' + node.contractNodeCode]?.formInline || {};
415 node.nodeFormItems.forEach(item => {
416 item.default = formInline[item.field];
417 })
418 nodeInfo.push(node);
419 } else {
420 if (oldNodesInfo.length > 0 && parseInt(code) < parseInt(oldNodesInfo[oldNodesInfo.length - 1].contractNodeCode)) {
421 nodeInfo.push({
422 contractNodeCode: code,
423 contractNodeName: registerContractNodesList.value.find(r => r.value == code)?.label || tradeContractNodesList.value.find(r => r.value == code)?.label,
424 nodeFormItems: cloneDeep(nodeFormItems.value),
425 nodeFormRules: nodeFormRules.value
426 });
427 }
428 }
429 }) || [];
430 nodesInfo.value = nodeInfo;
431 }
432 }
433
434 const contractNodeCodes = computed(() => {
435 return drawerRef.value?.getDrawerConRef('drawerFormRef')?.formInline?.contractNodeCodes;
436 })
437
438 const handleNodeFileView = (scope) => {
439 let file = scope.row?.nodeAchievement?.[0];
440 onUploadFileDownload(file);
441 }
442
443 const handleTableEdit = (scope) => {
444 drawerInfo.value.visible = true;
445 drawerInfo.value.type = 'edit';
446 drawerInfo.value.header.title = '编辑合同';
447 currTableData.value = scope.row;
448 contractEditFormItems.value.forEach(item => {
449 item.default = scope.row[item.field];
450 if (item.field == 'contractNodeCodes') {
451 item.default = scope.row.contractNodeCodes?.map(c => c.code) || [];
452 item.options = scope.row.contractTypeCode == '1' ? registerContractNodesList.value : (!scope.row.contractTypeCode ? [] : tradeContractNodesList.value);
453 }
454 })
455 nodesInfo.value = scope.row.contractNodes?.map(node => {
456 let items = cloneDeep(nodeFormItems.value);
457 items.forEach(item => {
458 item.default = node[item.field];
459 if (item.field == 'dateRange') {
460 item.default = [node.startDate, node.endDate];
461 }
462 })
463 return Object.assign({}, node, {
464 nodeFormItems: items,
465 nodeFormRules: nodeFormRules.value
466 })
467 }) || [];
468 }
469
470 const handleTableDel = (scope) => {
471 proxy.$openMessageBox("确定要删除该登记合同吗?", () => {
472 delDamContract([scope.row.guid]).then((res: any) => {
473 if (res.code == proxy.$passCode) {
474 page.value.curr = 1;
475 getTableData();
476 proxy.$ElMessage.success('删除登记合同成功');
477 } else {
478 proxy.$ElMessage.error(res.msg);
479 }
480 });
481 }, () => {
482 proxy.$ElMessage.info("已取消删除");
483 })
484 }
485
486 const handleCreate = () => {
487 drawerInfo.value.visible = true;
488 drawerInfo.value.type = 'add';
489 drawerInfo.value.header.title = '新增合同';
490 contractEditFormItems.value.forEach(item => {
491 item.default = '';
492 if (item.field == 'partyBGuid') {
493 item.default = userData.tenantGuid;
494 }
495 })
496 }
497
498 const nodesInfo: any = ref([]);
499
500 const depFormRef = ref({});
501 const setDepItemRef = (el: any, index: string) => {
502 if (el) {
503 depFormRef.value['ref-' + index] = el;
504 }
505 }
506
507 const nodeFormItems = ref([{
508 label: "开始日期~结束日期",
509 type: "date-picker",
510 field: "dateRange",
511 default: [],
512 placeholder: "开始日期~结束日期",
513 clearable: true,
514 format: 'YYYY-MM-DD',
515 valueFormat: 'YYYY-MM-DD',
516 block: true,
517 required: true,
518 },
519 // {
520 // label: '开始日期',
521 // type: 'date',
522 // placeholder: '请选择',
523 // field: 'startDate',
524 // default: "",
525 // unlink: true,
526 // disabled: false,
527 // clearable: true,
528 // required: true
529 // }, {
530 // label: '结束日期',
531 // type: 'date',
532 // placeholder: '请选择',
533 // field: 'endDate',
534 // default: "",
535 // unlink: true,
536 // disabled: false,
537 // clearable: true,
538 // required: true
539 // },
540 {
541 label: '节点成果上传',
542 tip: '支持格式:xls .xlsx .doc .docx .rar .zip',
543 type: 'upload-file',
544 accept: '.xls, .xlsx, .doc, .docx, .rar, .zip',
545 required: true,
546 block: true,
547 visible: true,
548 default: [],
549 field: 'nodeAchievement',
550 limit: 1,
551 }, {
552 label: '工作内容描述',
553 type: 'textarea',
554 placeholder: '请输入',
555 field: 'contentDescribe',
556 default: '',
557 maxlength: 200,
558 block: true,
559 clearable: true,
560 },]);
561
562 const nodeFormRules = ref({
563 dateRange: [{
564 type: 'array', required: true, message: '请填写开始日期~结束日期', trigger: 'change',
565 }],
566 // startDate: [required('请填写开始日期')],
567 // endDate: [required('请填写结束日期')],
568 nodeAchievement: [{
569 validator: (rule: any, value: any, callback: any) => {
570 if (!value?.length) {
571 callback(new Error('请上传节点成果附件'))
572 } else {
573 callback();
574 }
575 }, trigger: 'change'
576 }],
577 });
578
579 const addNode = () => {
580 let len = nodesInfo.value.length;
581 let code = contractNodeCodes.value[len];
582 let nodeList = drawerRef.value?.getDrawerConRef('drawerFormRef')?.formInline?.contractTypeCode == '2' ? tradeContractNodesList.value : registerContractNodesList.value;
583 nodesInfo.value.push({
584 contractNodeCode: code,
585 contractNodeName: nodeList.find(r => r.value == code)?.label,
586 nodeFormItems: cloneDeep(nodeFormItems.value),
587 nodeFormRules: nodeFormRules.value
588 })
589 }
590
591 const handleDelNode = (index) => {
592 proxy.$openMessageBox("确定要删除该进展阶段节点信息录入吗?", () => {
593 nodesInfo.value.splice(index, 1);
594 }, () => {
595 proxy.$ElMessage.info("已取消删除");
596 })
597 }
598
599 onBeforeMount(() => {
600 getParamsList({
601 dictType: "资产合同类型"
602 }).then((res: any) => {
603 contractTypes.value = [];
604 if (res.code == proxy.$passCode) {
605 contractTypes.value = res.data || [];
606 searchItemList.value[1].options = contractTypes.value;
607 contractEditFormItems.value[0].options = contractTypes.value;
608 } else {
609 proxy.$ElMessage.error(res.msg);
610 }
611 })
612 getParamsList({
613 dictType: "交易合同节点"
614 }).then((res: any) => {
615 tradeContractNodesList.value = [];
616 if (res.code == proxy.$passCode) {
617 tradeContractNodesList.value = res.data || [];
618 } else {
619 proxy.$ElMessage.error(res.msg);
620 }
621 })
622 getParamsList({
623 dictType: "登记合同节点"
624 }).then((res: any) => {
625 registerContractNodesList.value = [];
626 if (res.code == proxy.$passCode) {
627 registerContractNodesList.value = res.data || [];
628 } else {
629 proxy.$ElMessage.error(res.msg);
630 }
631 })
632 getTenantList({
633 bizState: 'Y',
634 pageSize: -1
635 }).then((res: any) => {
636 partyAList.value = [];
637 if (res.code == proxy.$passCode) {
638 partyAList.value = res.data?.records || [];
639 contractEditFormItems.value[2].options = partyAList.value;
640 contractEditFormItems.value[3].options = partyAList.value;
641 } else {
642 proxy.$ElMessage.error(res.msg);
643 }
644 })
645 })
646
647 </script>
648
649 <template>
650 <div class="container_wrap">
651 <div class="table_tool_wrap">
652 <TableTools ref="tableTools" :searchItems="searchItemList" :searchId="'contract-data-search'" @search="toSearch"
653 :init="true" @select-change="handleSearchChange" />
654 </div>
655 <div class="tools_btns">
656 <el-button type="primary" @click="handleCreate">新增</el-button>
657 </div>
658 <div class="table_panel_wrap">
659 <el-table v-loading="tableInfo.loading" ref="tableRef" :data="tableInfo.data" :highlight-current-row="true" stripe
660 border height="100%" tooltip-effect="light" row-key="guid" class="expand-table"
661 :style="{ width: '100%', height: 'calc(100% - 8px)', margin: '8px 0px', display: 'inline-block', }">
662 <el-table-column type="expand">
663 <template #default="scope">
664 <el-table ref="fieldsTableRef" :data="scope.row.contractNodes" :highlight-current-row="true" stripe border
665 height="100%" tooltip-effect="light" :style="{
666 width: '100%',
667 'max-height': '100%',
668 display: 'inline-block',
669 }">
670 <el-table-column label="序号" type="index" width="56px" align="center" show-overflow-tooltip>
671 </el-table-column>
672 <el-table-column v-for="field in tableInfo.childFields" :prop="field.field" :label="field.label"
673 :width="field.width" :align="field.align" show-overflow-tooltip>
674 <template #default="scope">
675 <span>{{ scope.row[field.field || ''] || '--' }}</span>
676 </template>
677 </el-table-column>
678 <el-table-column label="附件信息" width="120px" align="left" fixed="right" show-overflow-tooltip>
679 <template #default="scope">
680 <span class="text_btn" @click="handleNodeFileView(scope)">查看</span>
681 </template>
682 </el-table-column>
683 </el-table>
684 </template>
685 </el-table-column>
686 <el-table-column label="序号" type="index" width="56px" align="center" show-overflow-tooltip>
687 </el-table-column>
688 <el-table-column v-for="field in tableInfo.fields" :prop="field.field" :label="field.label" :width="field.width"
689 :align="field.align" show-overflow-tooltip>
690 <template #default="scope">
691 <span>{{ scope.row[field.field || ''] || '--' }}</span>
692 </template>
693 </el-table-column>
694 <el-table-column label="进展阶段" width="450px" align="center">
695 <template #default="scope">
696 <div class="custom-steps" v-if="scope.row.contractNodeCodes?.length">
697 <StepBar :steps-info="getNodeSteps(scope)" />
698 </div>
699 <span v-else>--</span>
700 </template>
701 </el-table-column>
702 <el-table-column label="操作" width="100px" align="left" fixed="right" show-overflow-tooltip>
703 <template #default="scope">
704 <span class="text_btn" @click="handleTableEdit(scope)">编辑</span>
705 <span class="text_btn ml4" @click="handleTableDel(scope)">删除</span>
706 </template>
707 </el-table-column>
708 </el-table>
709 </div>
710 <Drawer :drawerInfo="drawerInfo" @drawerBtnClick="drawerBtnClick" ref="drawerRef"
711 @drawerSelectChange='drawerSelectChange'>
712 <!-- 传递到 Form 组件中的默认插槽 -->
713 <template v-slot:default>
714 <template v-if="contractNodeCodes?.length > 0">
715 <div class="title-label">进展阶段录入</div>
716 <!-- 渲染行 -->
717 <div v-for="(row, index) in nodesInfo" :key="index" class="match-content-wrapper">
718 <div class="title-row"><span class="title">{{ row.contractNodeName }}</span><span class="btns"
719 v-show="index == nodesInfo.length - 1" @click="handleDelNode(index)">删除</span></div>
720 <Form :ref="(el: any) => { setDepItemRef(el, row.contractNodeCode) }" :itemList="row.nodeFormItems"
721 :formId="'node-form' + index" :rules="row.nodeFormRules" col="col2" />
722 </div>
723
724 <!-- 新增按钮 -->
725 <div class="bottm_tools" v-show="nodesInfo.length < contractNodeCodes?.length" @click="addNode">
726 <el-icon>
727 <Plus />
728 </el-icon>
729 <span>新增进展</span>
730 </div>
731 </template>
732 </template>
733 </Drawer>
734 </div>
735 </template>
736
737 <style lang="scss" scoped>
738 .container_wrap {
739 padding: 0 16px;
740 }
741
742 .table_panel_wrap {
743 height: calc(100% - 94px);
744 }
745
746 .ml4 {
747 margin-left: 4px;
748 }
749
750 :deep(.custom-steps) {
751 width: 100%;
752 height: 64px;
753 display: flex;
754
755 .el-steps {
756 width: 100%;
757 }
758 }
759
760 .title-label {
761 margin-bottom: 4px;
762 font-size: 18px;
763 color: #212121;
764 }
765
766 .title-row {
767 height: 48px;
768 display: flex;
769 justify-content: space-between;
770 align-items: center;
771
772 .title {
773 color: #212121;
774 font-size: 16px;
775 font-weight: 600;
776 }
777
778 .btns {
779 cursor: pointer;
780 color: var(--el-color-primary);
781 font-size: 14px;
782 }
783 }
784
785 .bottm_tools {
786 width: 100%;
787 height: 40px;
788 display: flex;
789 justify-content: center;
790 align-items: center;
791 background: #fafafa;
792 color: #999;
793 font-size: 14px;
794 border: 1px dashed var(--el-border-color-regular);
795 margin-bottom: 12px;
796
797 >span {
798 margin-left: 8px;
799 }
800
801 &:hover {
802 background: #EBF6F7;
803 border: 1px dashed var(--el-color-primary);
804 }
805 }
806
807 :deep(.el-table.expand-table) {
808 .el-table__expanded-cell.el-table__cell {
809 background: #fff !important;
810 padding-left: 48px;
811 padding-right: 8px;
812 }
813 }
814
815 :deep(.el-steps) {
816 .el-step__head.is-finish .el-step__icon.is-icon {
817 background-color: transparent;
818 }
819 }
820 </style>
...\ No newline at end of file ...\ No newline at end of file
...@@ -15,13 +15,14 @@ import { ...@@ -15,13 +15,14 @@ import {
15 qualityAllow, 15 qualityAllow,
16 deleteQuality, 16 deleteQuality,
17 updatQuality, 17 updatQuality,
18 getTenantList
18 } from "@/api/modules/dataAsset"; 19 } from "@/api/modules/dataAsset";
19 import useUserStore from "@/store/modules/user"; 20 import useUserStore from "@/store/modules/user";
20 import useDataAssetStore from "@/store/modules/dataAsset"; 21 import useDataAssetStore from "@/store/modules/dataAsset";
21 import { 22 import {
22 getStaffDetailInfo 23 getStaffDetailInfo
23 } from "@/api/modules/queryService"; 24 } from "@/api/modules/queryService";
24 import { rejectFlowData, revokeFlowData, getCamundaDeploymentId, getProcessNodesPromise, isMyFirstNode, passFlowData } from "@/api/modules/workFlowService"; 25 import { isNeedApprove, rejectFlowData, revokeFlowData, getCamundaDeploymentId, getProcessNodesPromise, isMyFirstNode, passFlowData } from "@/api/modules/workFlowService";
25 26
26 const assetStore = useDataAssetStore(); 27 const assetStore = useDataAssetStore();
27 28
...@@ -51,7 +52,7 @@ const tableFields = ref([ ...@@ -51,7 +52,7 @@ const tableFields = ref([
51 { label: "登记时间", field: "registerTime", width: 120 }, 52 { label: "登记时间", field: "registerTime", width: 120 },
52 // { label: "企业名称", field: "tenantName", width: 240, align: "left" }, 53 // { label: "企业名称", field: "tenantName", width: 240, align: "left" },
53 { label: "评估机构", field: "evaluationAgencyName", width: 250, align: "left" }, 54 { label: "评估机构", field: "evaluationAgencyName", width: 250, align: "left" },
54 { label: "审批状态", field: "approveVO", type: "approveTag", width: 96, align: 'center' }, 55 { label: "审批状态", field: "approveVO", type: "approveTag", enableNoApprove: true, width: 96, align: 'center' },
55 { 56 {
56 label: "主平台审批状态", field: "crossPlatformApproveState", type: "approveTagBtn", width: 150, align: 'center', btn: { 57 label: "主平台审批状态", field: "crossPlatformApproveState", type: "approveTagBtn", width: 150, align: 'center', btn: {
57 label: '查看', visible: (scope) => { 58 label: '查看', visible: (scope) => {
...@@ -66,7 +67,21 @@ const tableFields = ref([ ...@@ -66,7 +67,21 @@ const tableFields = ref([
66 67
67 const deploymentId = ref(''); 68 const deploymentId = ref('');
68 69
69 onMounted(() => { 70 const tenantList: any = ref([]);
71
72 onBeforeMount(() => {
73 getTenantList({
74 bizState: 'Y',
75 pageSize: -1
76 }).then((res: any) => {
77 tenantList.value = [];
78 if (res.code == proxy.$passCode) {
79 tenantList.value = res.data?.records || [];
80 formItems.value[1].options = tenantList.value;
81 } else {
82 proxy.$ElMessage.error(res.msg);
83 }
84 })
70 }); 85 });
71 86
72 onActivated(() => { 87 onActivated(() => {
...@@ -144,17 +159,31 @@ const getTableData = () => { ...@@ -144,17 +159,31 @@ const getTableData = () => {
144 }) 159 })
145 } 160 }
146 161
162 let needApprovePromise = ref();
163
164 const needApprove = ref(true);
165
147 const handleCreate = () => { 166 const handleCreate = () => {
148 if (!assetListData.value.length) { 167 if (!assetListData.value.length) {
149 ElMessage.warning('当前没有可发起质量评价的资产!'); 168 ElMessage.warning('当前没有可发起质量评价的资产!');
150 return; 169 return;
151 } 170 }
171 if (needApprovePromise.value) {
172 return;
173 }
174 needApprovePromise.value = isNeedApprove({ funcCode: 'ZCZLPJ' }).then((res1: any) => {
175 needApprovePromise.value = null;
176 if (res1.code == proxy.$passCode) {
177 needApprove.value = res1.data;
152 formItems.value[0].visible = true; 178 formItems.value[0].visible = true;
153 formItems.value[0].default = ''; 179 formItems.value[0].default = '';
154 formItems.value[1].visible = true; 180 formItems.value[1].visible = !needApprove.value;
155 formItems.value[1].default = []; 181 formItems.value[1].default = '';
182 formItems.value[2].visible = true;
183 formItems.value[2].default = [];
156 dialogInfo.value.visible = true; 184 dialogInfo.value.visible = true;
157 dialogInfo.value.type = ''; 185 dialogInfo.value.type = '';
186 if (needApprove.value) {
158 getCamundaDeploymentId('10018', userData.tenantGuid, userData.staffGuid).then((res: any) => { 187 getCamundaDeploymentId('10018', userData.tenantGuid, userData.staffGuid).then((res: any) => {
159 if (res.code == proxy.$passCode) { 188 if (res.code == proxy.$passCode) {
160 deploymentId.value = res.data; 189 deploymentId.value = res.data;
...@@ -163,6 +192,11 @@ const handleCreate = () => { ...@@ -163,6 +192,11 @@ const handleCreate = () => {
163 proxy.$ElMessage.error(res.msg); 192 proxy.$ElMessage.error(res.msg);
164 } 193 }
165 }) 194 })
195 }
196 } else {
197 proxy.$ElMessage.error(res1.msg);
198 }
199 })
166 } 200 }
167 201
168 const page = ref({ 202 const page = ref({
...@@ -203,7 +237,13 @@ const tableInfo = ref({ ...@@ -203,7 +237,13 @@ const tableInfo = ref({
203 237
204 const getTableBtns = (row) => { 238 const getTableBtns = (row) => {
205 let btnsArr: any[] = []; 239 let btnsArr: any[] = [];
206 const approveVO = row.approveVO || {}; 240 const approveVO = row.approveVO;
241 if (!approveVO && row.isApprove == 'N') {
242 btnsArr.push({ label: "编辑", value: "redit" });
243 btnsArr.push({ label: "删除", value: "del" });
244 btnsArr.push({ label: "详情", value: "detail" });
245 return btnsArr;
246 }
207 const approveState = row.approveVO.approveState || null; 247 const approveState = row.approveVO.approveState || null;
208 const approveStaffGuids = approveVO.approveStaffGuids || []; 248 const approveStaffGuids = approveVO.approveStaffGuids || [];
209 const staffGuid = approveVO.staffGuid || ''; 249 const staffGuid = approveVO.staffGuid || '';
...@@ -254,11 +294,21 @@ const tableBtnClick = (scope, btn) => { ...@@ -254,11 +294,21 @@ const tableBtnClick = (scope, btn) => {
254 currTableData.value = row; 294 currTableData.value = row;
255 console.log(row, '-------'); 295 console.log(row, '-------');
256 if (type == "redit") { 296 if (type == "redit") {
297 isNeedApprove({ funcCode: 'ZCZLPJ' }).then((res1: any) => {
298 if (res1.code == proxy.$passCode) {
299 needApprove.value = res1.data;
300 formItems.value[0].visible = false;
301 formItems.value[0].default = row.damGuid;
302 formItems.value[1].visible = !needApprove.value;
303 formItems.value[1].default = row.evaluationAgencyGuid;
304 formItems.value[2].default = row.qualityEvaluationFile || [];
305 dialogInfo.value.contents[0].formInfo.items = formItems.value;
257 dialogInfo.value.visible = true; 306 dialogInfo.value.visible = true;
258 dialogInfo.value.type = 'reSubmit'; 307 dialogInfo.value.type = 'reSubmit';
259 formItems.value[0].visible = false; 308 } else {
260 formItems.value[0].default = row.registerGuid; 309 proxy.$ElMessage.error(res1.msg);
261 formItems.value[1].default = row.qualityEvaluationFile || []; 310 }
311 })
262 } else if (type == "del") { 312 } else if (type == "del") {
263 delTableOpen("此操作将永久删除该资产质量评价,是否继续?", "warning"); 313 delTableOpen("此操作将永久删除该资产质量评价,是否继续?", "warning");
264 } else if (type === 'reject') { 314 } else if (type === 'reject') {
...@@ -390,6 +440,20 @@ const formItems = ref([{ ...@@ -390,6 +440,20 @@ const formItems = ref([{
390 visible: true, 440 visible: true,
391 required: true 441 required: true
392 }, { 442 }, {
443 label: '评估机构',
444 type: 'select',
445 placeholder: '请选择',
446 field: 'evaluationAgencyGuid',
447 default: '',
448 block: true,
449 options: tenantList.value,
450 props: {
451 value: 'guid',
452 label: 'tenantName'
453 },
454 visible: false,
455 required: true
456 }, {
393 label: '附件上传', 457 label: '附件上传',
394 tip: '支持格式:xls .xlsx .doc .docx .rar .zip', 458 tip: '支持格式:xls .xlsx .doc .docx .rar .zip',
395 type: 'upload-file', 459 type: 'upload-file',
...@@ -456,6 +520,62 @@ const dialogInfo = ref({ ...@@ -456,6 +520,62 @@ const dialogInfo = ref({
456 /** 编辑质量评价发起资产申请按钮处理。 */ 520 /** 编辑质量评价发起资产申请按钮处理。 */
457 const dialogBtnClick = (btn, info) => { 521 const dialogBtnClick = (btn, info) => {
458 if (btn.value == 'submit') { 522 if (btn.value == 'submit') {
523 if (!needApprove.value) {
524 // 不需要走流程审批的提交
525 dialogInfo.value.footer.btns[1].loading = true;
526 if (dialogInfo.value.type == 'reSubmit') {
527 updatQuality({
528 guid: currTableData.value.guid,
529 tenantGuid: userData.tenantGuid,
530 damGuid: currTableData.value.damGuid,
531 daName: currTableData.value.daName,
532 immediateApprove: true,
533 evaluationAgencyGuid: info.evaluationAgencyGuid,
534 qualityEvaluationFile: info.qualityEvaluationFile?.map(file => {
535 return {
536 name: file.name,
537 url: file.url
538 }
539 }) || []
540 }).then((res: any) => {
541 dialogInfo.value.footer.btns[1].loading = false;
542 if (res?.code == proxy.$passCode) {
543 ElMessage.success('该资产质量评价重新提交成功');
544 dialogInfo.value.visible = false;
545 page.value.curr = 1;
546 getTableData();
547 } else {
548 ElMessage.error(res.msg);
549 }
550 })
551 } else {
552 let daInfo = assetListData.value.find(a => a.guid == info.damGuid);
553 saveQuality({
554 tenantGuid: userData.tenantGuid,
555 damGuid: info.damGuid,
556 daName: daInfo.damName,
557 immediateApprove: true,
558 evaluationAgencyGuid: info.evaluationAgencyGuid,
559 qualityEvaluationFile: info.qualityEvaluationFile?.map(file => {
560 return {
561 name: file.name,
562 url: file.url
563 }
564 }) || []
565 }).then((res: any) => {
566 dialogInfo.value.footer.btns[1].loading = false;
567 if (res?.code == proxy.$passCode) {
568 ElMessage.success('质量评价发起成功');
569 dialogInfo.value.visible = false;
570 page.value.curr = 1;
571 getTableData();
572 } else {
573 ElMessage.error(res.msg);
574 }
575 })
576 }
577 } else {
578 // 需要走流程的审批功能。
459 dialogInfo.value.footer.btns[1].loading = true; 579 dialogInfo.value.footer.btns[1].loading = true;
460 let submitFunc = () => { 580 let submitFunc = () => {
461 getProcessNodesPromise({ 581 getProcessNodesPromise({
...@@ -540,6 +660,7 @@ const dialogBtnClick = (btn, info) => { ...@@ -540,6 +660,7 @@ const dialogBtnClick = (btn, info) => {
540 } 660 }
541 }) 661 })
542 } 662 }
663 }
543 } else if (btn.value == 'cancel') { 664 } else if (btn.value == 'cancel') {
544 dialogInfo.value.visible = false; 665 dialogInfo.value.visible = false;
545 } 666 }
......
...@@ -114,7 +114,7 @@ const getDetailInfo = () => { ...@@ -114,7 +114,7 @@ const getDetailInfo = () => {
114 if (res.code == proxy.$passCode) { 114 if (res.code == proxy.$passCode) {
115 const data = res.data || {}; 115 const data = res.data || {};
116 evaDetailInfo.value = data; 116 evaDetailInfo.value = data;
117 deploymentId.value = data.approveVO.camundaDeploymentId; 117 deploymentId.value = data.approveVO?.camundaDeploymentId;
118 processInstanceId.value = data.approveVO?.camundaInstanceId; 118 processInstanceId.value = data.approveVO?.camundaInstanceId;
119 } else { 119 } else {
120 proxy.$ElMessage.error(res.msg); 120 proxy.$ElMessage.error(res.msg);
...@@ -127,7 +127,7 @@ const getDetailInfo = () => { ...@@ -127,7 +127,7 @@ const getDetailInfo = () => {
127 const data = res.data || {}; 127 const data = res.data || {};
128 costAssessDetail.value = data; 128 costAssessDetail.value = data;
129 evaDetailInfo.value = data; 129 evaDetailInfo.value = data;
130 deploymentId.value = data.approveVO.camundaDeploymentId; 130 deploymentId.value = data.approveVO?.camundaDeploymentId;
131 processInstanceId.value = data.approveVO?.camundaInstanceId; 131 processInstanceId.value = data.approveVO?.camundaInstanceId;
132 } else { 132 } else {
133 proxy.$ElMessage.error(res.msg); 133 proxy.$ElMessage.error(res.msg);
...@@ -209,6 +209,9 @@ const toolBtns: any = computed(() => { ...@@ -209,6 +209,9 @@ const toolBtns: any = computed(() => {
209 label: "关闭", value: "cancel", plain: true 209 label: "关闭", value: "cancel", plain: true
210 }]; 210 }];
211 let approveVO = evaDetailInfo.value.approveVO || costAssessDetail.value.approveVO; 211 let approveVO = evaDetailInfo.value.approveVO || costAssessDetail.value.approveVO;
212 if (!approveVO) {
213 return btnsArr;
214 }
212 let staffGuid = userData.staffGuid; 215 let staffGuid = userData.staffGuid;
213 if (approveVO && approveVO.approveState == 'A' && approveVO.approveStaffGuids && approveVO.approveStaffGuids.indexOf(staffGuid) > -1) { 216 if (approveVO && approveVO.approveState == 'A' && approveVO.approveStaffGuids && approveVO.approveStaffGuids.indexOf(staffGuid) > -1) {
214 btnsArr.push(...[{ label: "通过", value: "pass", type: 'primary' }, { label: "驳回", value: "reject", type: 'danger', plain: true }]); 217 btnsArr.push(...[{ label: "通过", value: "pass", type: 'primary' }, { label: "驳回", value: "reject", type: 'danger', plain: true }]);
...@@ -1171,7 +1174,7 @@ const handleClick = () => { ...@@ -1171,7 +1174,7 @@ const handleClick = () => {
1171 </div> 1174 </div>
1172 </ContentWrap> 1175 </ContentWrap>
1173 1176
1174 <ContentWrap v-if="route.query.type == 'qualityEvaluate' || route.query.type == 'costAssess'" id="id-approveInfo" 1177 <ContentWrap v-if="(route.query.type == 'qualityEvaluate' && evaDetailInfo.approveVO && evaDetailInfo.isApprove !='N') || (route.query.type == 'costAssess' && costAssessDetail.approveVO && costAssessDetail.isApprove !='N')" id="id-approveInfo"
1175 title="审批信息" description="" style="margin: 16px 16px 16px"> 1178 title="审批信息" description="" style="margin: 16px 16px 16px">
1176 <ApprovalProcess ref="approvalProcessRef" v-if="deploymentId" :deploymentId="deploymentId" :processInstanceId="processInstanceId"> 1179 <ApprovalProcess ref="approvalProcessRef" v-if="deploymentId" :deploymentId="deploymentId" :processInstanceId="processInstanceId">
1177 </ApprovalProcess> 1180 </ApprovalProcess>
......
...@@ -78,7 +78,7 @@ const getDetailInfo = () => { ...@@ -78,7 +78,7 @@ const getDetailInfo = () => {
78 const data = res.data || {}; 78 const data = res.data || {};
79 evaDetailInfo.value = data; 79 evaDetailInfo.value = data;
80 detailInfo.value = data; 80 detailInfo.value = data;
81 deploymentId.value = data.approveVO.camundaDeploymentId; 81 deploymentId.value = data.approveVO?.camundaDeploymentId;
82 processInstanceId.value = data.approveVO?.camundaInstanceId; 82 processInstanceId.value = data.approveVO?.camundaInstanceId;
83 //需要显示质量评价信息 83 //需要显示质量评价信息
84 if (data.qualityScore != null) { 84 if (data.qualityScore != null) {
...@@ -90,6 +90,9 @@ const getDetailInfo = () => { ...@@ -90,6 +90,9 @@ const getDetailInfo = () => {
90 tabsInfo.value.tabs.splice(3, 1); 90 tabsInfo.value.tabs.splice(3, 1);
91 } 91 }
92 } 92 }
93 if (evaDetailInfo.value.isApprove == 'N') {
94 tabsInfo.value.tabs.pop();
95 }
93 if (fullPath === route.fullPath) { 96 if (fullPath === route.fullPath) {
94 document.title = `详情-${data.daName}`; 97 document.title = `详情-${data.daName}`;
95 } 98 }
...@@ -124,7 +127,7 @@ const getDetailInfo = () => { ...@@ -124,7 +127,7 @@ const getDetailInfo = () => {
124 const data = res.data || {}; 127 const data = res.data || {};
125 costAssessDetailInfo.value = data; 128 costAssessDetailInfo.value = data;
126 detailInfo.value = data; 129 detailInfo.value = data;
127 deploymentId.value = data.approveVO.camundaDeploymentId; 130 deploymentId.value = data.approveVO?.camundaDeploymentId;
128 processInstanceId.value = data.approveVO?.camundaInstanceId; 131 processInstanceId.value = data.approveVO?.camundaInstanceId;
129 // 需要显示价值评估信息 132 // 需要显示价值评估信息
130 if (data.assessmentMoney != null) { 133 if (data.assessmentMoney != null) {
...@@ -136,7 +139,9 @@ const getDetailInfo = () => { ...@@ -136,7 +139,9 @@ const getDetailInfo = () => {
136 tabsInfo.value.tabs.splice(3, 1); 139 tabsInfo.value.tabs.splice(3, 1);
137 } 140 }
138 } 141 }
139 142 if (costAssessDetailInfo.value.isApprove == 'N') {
143 tabsInfo.value.tabs.pop();
144 }
140 if (data.qualityScore) { 145 if (data.qualityScore) {
141 // 确保"质量评价"标签存在于tabs中,并插入到"价值评估"前面 146 // 确保"质量评价"标签存在于tabs中,并插入到"价值评估"前面
142 const qualityTabIndex = tabsInfo.value.tabs.findIndex(tab => tab.name === "qualityEvaluate"); 147 const qualityTabIndex = tabsInfo.value.tabs.findIndex(tab => tab.name === "qualityEvaluate");
...@@ -285,8 +290,8 @@ const getDetailInfo = () => { ...@@ -285,8 +290,8 @@ const getDetailInfo = () => {
285 let { approveVO } = data; 290 let { approveVO } = data;
286 detailInfo.value = data; 291 detailInfo.value = data;
287 assetDetailInfo.value = data; 292 assetDetailInfo.value = data;
288 deploymentId.value = approveVO.camundaDeploymentId; 293 deploymentId.value = approveVO?.camundaDeploymentId;
289 processInstanceId.value = approveVO.camundaInstanceId; 294 processInstanceId.value = approveVO?.camundaInstanceId;
290 isTextTruncated(); 295 isTextTruncated();
291 } else { 296 } else {
292 ElMessage.error(res.msg); 297 ElMessage.error(res.msg);
...@@ -446,6 +451,9 @@ const toolBtns: any = computed(() => { ...@@ -446,6 +451,9 @@ const toolBtns: any = computed(() => {
446 return btnsArr; 451 return btnsArr;
447 } 452 }
448 let approveVO = detailInfo.value.approveVO; 453 let approveVO = detailInfo.value.approveVO;
454 if (!approveVO) {
455 return btnsArr;
456 }
449 let staffGuid = userData.staffGuid; 457 let staffGuid = userData.staffGuid;
450 if (approveVO && approveVO.approveState == 'A' && approveVO.approveStaffGuids && approveVO.approveStaffGuids.indexOf(staffGuid) > -1) { 458 if (approveVO && approveVO.approveState == 'A' && approveVO.approveStaffGuids && approveVO.approveStaffGuids.indexOf(staffGuid) > -1) {
451 btnsArr.push(...[{ label: "通过", value: "pass", type: 'primary' }, { label: "驳回", value: "reject", type: 'danger', plain: true }]); 459 btnsArr.push(...[{ label: "通过", value: "pass", type: 'primary' }, { label: "驳回", value: "reject", type: 'danger', plain: true }]);
...@@ -1749,7 +1757,7 @@ const passCommonDialogBtnClick = (btn, info) => { ...@@ -1749,7 +1757,7 @@ const passCommonDialogBtnClick = (btn, info) => {
1749 </div> 1757 </div>
1750 </ContentWrap> 1758 </ContentWrap>
1751 <ContentWrap id="id-approveInfo" title="审批信息" expandSwicth style="margin-top: 15px" 1759 <ContentWrap id="id-approveInfo" title="审批信息" expandSwicth style="margin-top: 15px"
1752 :isExpand="approveInfoExpand" @expand="(v) => approveInfoExpand = v" v-if="route.query.type != 'certificate'"> 1760 :isExpand="approveInfoExpand" @expand="(v) => approveInfoExpand = v" v-if="tabsInfo.tabs.find(t => t.name == 'approveInfo') && route.query.type != 'certificate'">
1753 <!-- <Table :tableInfo="approveTableInfo" /> --> 1761 <!-- <Table :tableInfo="approveTableInfo" /> -->
1754 <ApprovalProcess ref="approvalProcessRef" v-if="deploymentId" :deploymentId="deploymentId" 1762 <ApprovalProcess ref="approvalProcessRef" v-if="deploymentId" :deploymentId="deploymentId"
1755 :processInstanceId="processInstanceId"> 1763 :processInstanceId="processInstanceId">
......
...@@ -12,14 +12,15 @@ import { ...@@ -12,14 +12,15 @@ import {
12 saveCostAssess, 12 saveCostAssess,
13 updateCostAssess, 13 updateCostAssess,
14 deleteCostAssess, 14 deleteCostAssess,
15 costAssessAllow 15 costAssessAllow,
16 getTenantList
16 } from "@/api/modules/dataAsset"; 17 } from "@/api/modules/dataAsset";
17 import { 18 import {
18 getStaffDetailInfo 19 getStaffDetailInfo
19 } from "@/api/modules/queryService"; 20 } from "@/api/modules/queryService";
20 import useUserStore from "@/store/modules/user"; 21 import useUserStore from "@/store/modules/user";
21 import useDataAssetStore from "@/store/modules/dataAsset"; 22 import useDataAssetStore from "@/store/modules/dataAsset";
22 import { getCamundaDeploymentId, getProcessNodesPromise, passFlowData, rejectFlowData, revokeFlowData, isMyFirstNode } from '@/api/modules/workFlowService'; 23 import { isNeedApprove, getCamundaDeploymentId, getProcessNodesPromise, passFlowData, rejectFlowData, revokeFlowData, isMyFirstNode } from '@/api/modules/workFlowService';
23 import { changeNum } from '@/utils/common'; 24 import { changeNum } from '@/utils/common';
24 25
25 const assetStore = useDataAssetStore(); 26 const assetStore = useDataAssetStore();
...@@ -43,11 +44,14 @@ const tableFields = ref([ ...@@ -43,11 +44,14 @@ const tableFields = ref([
43 // { label: "企业名称", field: "tenantName", width: 240, align: "left" }, 44 // { label: "企业名称", field: "tenantName", width: 240, align: "left" },
44 { label: "评估机构", field: "evaluationAgencyName", width: 250, align: "left" }, 45 { label: "评估机构", field: "evaluationAgencyName", width: 250, align: "left" },
45 { 46 {
46 label: "审批状态", field: "approveVO", type: "approveTag", width: 96, align: 'center' 47 label: "审批状态", field: "approveVO", type: "approveTag", enableNoApprove: true, width: 96, align: 'center'
47 }, 48 },
48 ]); 49 ]);
49 50
50 const deploymentId = ref(''); 51 const deploymentId = ref('');
52
53 const tenantList: any = ref([]);
54
51 onBeforeMount(() => { 55 onBeforeMount(() => {
52 if (isCompanyPlatform.value) { 56 if (isCompanyPlatform.value) {
53 tableInfo.value.fields = tableFields.value; 57 tableInfo.value.fields = tableFields.value;
...@@ -55,14 +59,18 @@ onBeforeMount(() => { ...@@ -55,14 +59,18 @@ onBeforeMount(() => {
55 tableFields.value.splice(3, 0, { label: "企业名称", field: "tenantName", width: 250, align: "left" }) 59 tableFields.value.splice(3, 0, { label: "企业名称", field: "tenantName", width: 250, align: "left" })
56 tableInfo.value.fields = tableFields.value; 60 tableInfo.value.fields = tableFields.value;
57 } 61 }
58 // getTenantAttach(userData.tenantGuid).then((res: any) => { 62 getTenantList({
59 // if (res?.code == proxy.$passCode) { 63 bizState: 'Y',
60 // attachDataInfo.value = res.data || {}; 64 pageSize: -1
61 // formItems.value[1].templateUrl = attachDataInfo.value.quality_evaluation_file; 65 }).then((res: any) => {
62 // } else { 66 tenantList.value = [];
63 // ElMessage.error(res.msg); 67 if (res.code == proxy.$passCode) {
64 // } 68 tenantList.value = res.data?.records || [];
65 // }) 69 formItems.value[1].options = tenantList.value;
70 } else {
71 proxy.$ElMessage.error(res.msg);
72 }
73 })
66 }); 74 });
67 75
68 onActivated(() => { 76 onActivated(() => {
...@@ -140,27 +148,40 @@ const getTableData = () => { ...@@ -140,27 +148,40 @@ const getTableData = () => {
140 }) 148 })
141 } 149 }
142 150
151 let needApprovePromise = ref();
152
153 const needApprove = ref(true);
154
143 const handleCreate = () => { 155 const handleCreate = () => {
144 if (!assetListData.value.length) { 156 if (!assetListData.value.length) {
145 ElMessage.warning('当前没有可发起价值评估的资产!'); 157 ElMessage.warning('当前没有可发起价值评估的资产!');
146 return; 158 return;
147 } 159 }
148 formItems.value[4].placeholder = `本次评估数据资产总体质量得分为**分\n准确性:\n一致性:\n可访问性:\n规范性:\n完整性:`; 160 if (needApprovePromise.value) {
161 return;
162 }
163 needApprovePromise.value = isNeedApprove({ funcCode: 'ZCJZPG' }).then((res1: any) => {
164 needApprovePromise.value = null;
165 if (res1.code == proxy.$passCode) {
166 needApprove.value = res1.data;
167 formItems.value[5].placeholder = `本次评估数据资产总体质量得分为**分\n准确性:\n一致性:\n可访问性:\n规范性:\n完整性:`;
149 formItems.value[0].visible = true; 168 formItems.value[0].visible = true;
150 formItems.value[0].default = ''; 169 formItems.value[0].default = '';
151 formItems.value[1].visible = true; 170 formItems.value[1].visible = !needApprove.value;
152 formItems.value[1].default = []; 171 formItems.value[1].default = '';
153 formItems.value[2].visible = false; 172 formItems.value[2].visible = true;
154 formItems.value[2].default = ''; 173 formItems.value[2].default = [];
155 formItems.value[3].visible = false; 174 formItems.value[3].visible = false;
156 formItems.value[3].default = ''; 175 formItems.value[3].default = '';
157 formItems.value[4].visible = false; 176 formItems.value[4].visible = false;
158 formItems.value[4].default = ''; 177 formItems.value[4].default = '';
159 formItems.value[5].visible = false; 178 formItems.value[5].visible = false;
160 formItems.value[5].default = []; 179 formItems.value[5].default = '';
180 formItems.value[6].visible = false;
181 formItems.value[6].default = [];
161 dialogInfo.value.visible = true; 182 dialogInfo.value.visible = true;
162 dialogInfo.value.type = ''; 183 dialogInfo.value.type = '';
163 if (!deploymentId.value) { 184 if (needApprove.value) {
164 getCamundaDeploymentId('10019', userData.tenantGuid, userData.staffGuid).then((res: any) => { 185 getCamundaDeploymentId('10019', userData.tenantGuid, userData.staffGuid).then((res: any) => {
165 if (res.code == proxy.$passCode) { 186 if (res.code == proxy.$passCode) {
166 deploymentId.value = res.data; 187 deploymentId.value = res.data;
...@@ -170,6 +191,10 @@ const handleCreate = () => { ...@@ -170,6 +191,10 @@ const handleCreate = () => {
170 } 191 }
171 }) 192 })
172 } 193 }
194 } else {
195 proxy.$ElMessage.error(res1.msg);
196 }
197 });
173 } 198 }
174 199
175 const page = ref({ 200 const page = ref({
...@@ -210,7 +235,13 @@ const tableInfo = ref({ ...@@ -210,7 +235,13 @@ const tableInfo = ref({
210 235
211 const getTableBtns = (row) => { 236 const getTableBtns = (row) => {
212 let btnsArr: any[] = []; 237 let btnsArr: any[] = [];
213 const approveVO = row.approveVO || {}; 238 const approveVO = row.approveVO;
239 if (!approveVO && row.isApprove == 'N') {
240 btnsArr.push({ label: "编辑", value: "redit" });
241 btnsArr.push({ label: "删除", value: "del" });
242 btnsArr.push({ label: "详情", value: "detail" });
243 return btnsArr;
244 }
214 const approveState = row.approveVO.approveState || null; 245 const approveState = row.approveVO.approveState || null;
215 const approveStaffGuids = approveVO.approveStaffGuids || []; 246 const approveStaffGuids = approveVO.approveStaffGuids || [];
216 const staffGuid = approveVO.staffGuid || ''; 247 const staffGuid = approveVO.staffGuid || '';
...@@ -262,62 +293,47 @@ const tableBtnClick = (scope, btn) => { ...@@ -262,62 +293,47 @@ const tableBtnClick = (scope, btn) => {
262 console.log('row', row); 293 console.log('row', row);
263 currTableData.value = row; 294 currTableData.value = row;
264 if (type == "redit") { 295 if (type == "redit") {
265 // if (!row.registerGuid) { 296 isNeedApprove({ funcCode: 'ZCJZPG' }).then((res1: any) => {
266 // formItems.value[2].visible = true; 297 if (res1.code == proxy.$passCode) {
267 // formItems.value[3].visible = true; 298 needApprove.value = res1.data;
268 // formItems.value[4].visible = true;
269 // formItems.value[5].visible = true;
270 // formItems.value[0].visible = false;
271 // formItems.value[0].default = row.damGuid;
272 // formItems.value[1].default = row.costAssessmentFile || [];
273 // dialogInfo.value.type = 'reSubmit';
274 // dialogInfo.value.visible = true;
275 // } else {
276 // formItems.value[2].visible = false;
277 // formItems.value[3].visible = false;
278 // formItems.value[4].visible = false;
279 // formItems.value[5].visible = false;
280 // formItems.value[0].visible = false;
281 // formItems.value[0].default = row.damGuid;
282 // formItems.value[1].default = row.costAssessmentFile || [];
283 // formItems.value[2].default = row.qualityScore;
284 // formItems.value[3].default = row.evaluationRangeStart && row.evaluationRangeEnd ? [row.evaluationRangeStart, row.evaluationRangeEnd] : '';
285 // formItems.value[4].default = row.evaluationNote;
286 // formItems.value[5].default = row.evaluationFile || [];
287 // dialogInfo.value.type = 'reSubmit';
288 // dialogInfo.value.visible = true;
289 // }
290 if (row.qualityEvaluationGuid) { 299 if (row.qualityEvaluationGuid) {
291 formItems.value[2].visible = false;
292 formItems.value[3].visible = false; 300 formItems.value[3].visible = false;
293 formItems.value[4].visible = false; 301 formItems.value[4].visible = false;
294 formItems.value[5].visible = false; 302 formItems.value[5].visible = false;
303 formItems.value[6].visible = false;
295 formItems.value[0].visible = false; 304 formItems.value[0].visible = false;
296 formItems.value[0].default = row.damGuid; 305 formItems.value[0].default = row.damGuid;
297 formItems.value[1].default = row.costAssessmentFile || []; 306 formItems.value[1].visible = !needApprove.value;
307 formItems.value[1].default = row.evaluationAgencyGuid;
308 formItems.value[2].default = row.costAssessmentFile || [];
298 // formItems.value[2].default = row.qualityScore; 309 // formItems.value[2].default = row.qualityScore;
299 formItems.value[3].default = row.evaluationRangeStart && row.evaluationRangeEnd ? [row.evaluationRangeStart, row.evaluationRangeEnd] : ''; 310 formItems.value[5].default = row.evaluationRangeStart && row.evaluationRangeEnd ? [row.evaluationRangeStart, row.evaluationRangeEnd] : '';
300 // formItems.value[4].default = row.evaluationNote; 311 // formItems.value[4].default = row.evaluationNote;
301 // formItems.value[5].default = row.evaluationFile || []; 312 // formItems.value[5].default = row.evaluationFile || [];
302 dialogInfo.value.type = 'reSubmit'; 313 dialogInfo.value.type = 'reSubmit';
303 dialogInfo.value.visible = true; 314 dialogInfo.value.visible = true;
304 } 315 }
305 if (!row.qualityEvaluationGuid) { 316 if (!row.qualityEvaluationGuid) {
306 formItems.value[2].visible = true;
307 formItems.value[3].visible = true; 317 formItems.value[3].visible = true;
308 formItems.value[4].visible = true; 318 formItems.value[4].visible = true;
309 formItems.value[5].visible = true; 319 formItems.value[5].visible = true;
320 formItems.value[6].visible = true;
310 formItems.value[0].visible = false; 321 formItems.value[0].visible = false;
311 formItems.value[0].default = row.damGuid; 322 formItems.value[0].default = row.damGuid;
312 formItems.value[1].default = row.costAssessmentFile || []; 323 formItems.value[1].visible = !needApprove.value;
313 formItems.value[2].default = changeNum(row.qualityScore || 0, 2); 324 formItems.value[1].default = row.evaluationAgencyGuid;
314 formItems.value[3].default = row.evaluationRangeStart && row.evaluationRangeEnd ? [row.evaluationRangeStart, row.evaluationRangeEnd] : ''; 325 formItems.value[2].default = row.costAssessmentFile || [];
315 formItems.value[4].default = row.evaluationNote; 326 formItems.value[3].default = changeNum(row.qualityScore || 0, 2);
316 formItems.value[5].default = row.evaluationFile || []; 327 formItems.value[4].default = row.evaluationRangeStart && row.evaluationRangeEnd ? [row.evaluationRangeStart, row.evaluationRangeEnd] : '';
328 formItems.value[5].default = row.evaluationNote;
329 formItems.value[6].default = row.evaluationFile || [];
317 dialogInfo.value.type = 'reSubmit'; 330 dialogInfo.value.type = 'reSubmit';
318 dialogInfo.value.visible = true; 331 dialogInfo.value.visible = true;
319 } 332 }
320 333 } else {
334 proxy.$ElMessage.error(res1.msg);
335 }
336 });
321 } else if (type == "delete") { 337 } else if (type == "delete") {
322 delTableOpen("此操作将永久删除该资产价值评估,是否继续?", "warning"); 338 delTableOpen("此操作将永久删除该资产价值评估,是否继续?", "warning");
323 } else if (type === 'backup') { 339 } else if (type === 'backup') {
...@@ -392,71 +408,6 @@ const tableBtnClick = (scope, btn) => { ...@@ -392,71 +408,6 @@ const tableBtnClick = (scope, btn) => {
392 } 408 }
393 }; 409 };
394 410
395 // const tableBtnClick = (scope, btn) => {
396 // const type = btn.value;
397 // const row = scope.row;
398 // currTableData.value = row;
399 // if (type === "edit") { //草稿中\已驳回\已撤销\已通过 状态,才可以编辑。
400 // localStorage.setItem('isRestart', btn.label == '重新提交' ? 'true' : '');
401 // // router.push({
402 // // name: 'registerStart',
403 // // query: { guid: row.guid, exchangeGuid: row.exchangeGuid, name: row.daName, type }
404 // // });
405 // router.push({
406 // name: 'registerValueDetail',
407 // query: { guid: row.registerGuid, costAssessGuid: row.guid, type: 'costAssess', daTenantGuid: row.tenantGuid, exchangeGuid: row.exchangeGuid }
408 // });
409 // } else if (type == "delete") {
410 // delTableOpen("此操作将永久删除该资产登记,是否继续?", "warning");
411 // } else if (type === 'revoke') { // 撤销,状态为审批中时可以撤销。
412 // ElMessageBox.confirm('确定撤销该资产登记审批流程吗?', "提示", {
413 // confirmButtonText: "确定",
414 // cancelButtonText: "取消",
415 // type: 'warning',
416 // }).then(() => {
417 // tableInfo.value.loading = true;
418 // let params = {
419 // guid: row.approveVO.approveGuid,
420 // flowType: row.approveVO.flowType,
421 // approveStaffGuid: userData.staffGuid,
422 // }
423 // revokeFlowData(params).then((res: any) => {
424 // tableInfo.value.loading = false;
425 // if (res?.code == proxy.$passCode) {
426 // if (res.data) {
427 // ElMessage.success('该审批流程撤销成功!');
428 // getTableData();
429 // } else {
430 // ElMessage.error('该审批流程撤销失败!');
431 // }
432 // } else {
433 // ElMessage.error(res.msg);
434 // }
435 // }).catch(() => {
436 // tableInfo.value.loading = false;
437 // });
438 // }).catch(() => {
439 // ElMessage({
440 // type: 'info',
441 // message: '已取消撤销'
442 // });
443 // });
444 // } else if (type === 'detail') { // 详情, 若是草稿中,详情就是编辑,
445 // // router.push({
446 // // name: 'registerInfoDetail',
447 // // query: { guid: row.guid, name: row.daName, type: 'asset' }
448 // // });
449 // router.push({
450 // name: 'registerValueDetail',
451 // query: { guid: row.registerGuid, costAssessGuid: row.guid, type: 'costAssess', daTenantGuid: row.tenantGuid }
452 // });
453 // } else if (type === 'pass') {
454 // passDialogInfo.value.visible = true;
455 // } else if (type == 'reject') {
456 // rejectDialogInfo.value.visible = true;
457 // }
458 // };
459
460 const delTableOpen = (msg, type, isBatch: boolean = false) => { 411 const delTableOpen = (msg, type, isBatch: boolean = false) => {
461 ElMessageBox.confirm(msg, "提示", { 412 ElMessageBox.confirm(msg, "提示", {
462 confirmButtonText: "确定", 413 confirmButtonText: "确定",
...@@ -509,6 +460,20 @@ const formItems = ref<any>([ ...@@ -509,6 +460,20 @@ const formItems = ref<any>([
509 }, 460 },
510 visible: true, 461 visible: true,
511 required: true 462 required: true
463 }, {
464 label: '评估机构',
465 type: 'select',
466 placeholder: '请选择',
467 field: 'evaluationAgencyGuid',
468 default: '',
469 block: true,
470 options: tenantList.value,
471 props: {
472 value: 'guid',
473 label: 'tenantName'
474 },
475 visible: false,
476 required: true
512 }, 477 },
513 { 478 {
514 label: '附件上传', 479 label: '附件上传',
...@@ -658,24 +623,26 @@ const dialogInfo = ref({ ...@@ -658,24 +623,26 @@ const dialogInfo = ref({
658 623
659 624
660 const handleSelectChange = (val, row, info) => { 625 const handleSelectChange = (val, row, info) => {
661 let qualityEvaluationGuid = ''; 626 if (row.field != 'registerGuid') {
662 assetListData.value.forEach((item) => { 627 return;
663 if (item.guid == val) {
664 qualityEvaluationGuid = item.qualityEvaluationGuid;
665 } 628 }
666 }); 629 let qualityEvaluationGuid = assetListData.value.find(item => item.guid == val)?.qualityEvaluationGuid;
667 if (!qualityEvaluationGuid) { 630 if (!qualityEvaluationGuid) {
668 formItems.value[0].default = val; 631 formItems.value[0].default = val;
669 formItems.value[2].visible = true; 632 formItems.value[1].default = info.evaluationAgencyGuid;
633 formItems.value[2].default = info[formItems.value[2].field];
670 formItems.value[3].visible = true; 634 formItems.value[3].visible = true;
671 formItems.value[4].visible = true; 635 formItems.value[4].visible = true;
672 formItems.value[5].visible = true; 636 formItems.value[5].visible = true;
637 formItems.value[6].visible = true;
673 } else { 638 } else {
674 formItems.value[0].default = val; 639 formItems.value[0].default = val;
675 formItems.value[2].visible = false; 640 formItems.value[1].default = info.evaluationAgencyGuid;
641 formItems.value[2].default = info[formItems.value[2].field];
676 formItems.value[3].visible = false; 642 formItems.value[3].visible = false;
677 formItems.value[4].visible = false; 643 formItems.value[4].visible = false;
678 formItems.value[5].visible = false; 644 formItems.value[5].visible = false;
645 formItems.value[6].visible = false;
679 } 646 }
680 647
681 } 648 }
...@@ -709,6 +676,101 @@ const reSubmitPromise: any = ref(null); ...@@ -709,6 +676,101 @@ const reSubmitPromise: any = ref(null);
709 const dialogBtnClick = (btn, info) => { 676 const dialogBtnClick = (btn, info) => {
710 console.log('btn', btn, info); 677 console.log('btn', btn, info);
711 if (btn.value == 'submit') { 678 if (btn.value == 'submit') {
679 if (!needApprove.value) {
680 dialogInfo.value.footer.btns[1].loading = true;
681 if (dialogInfo.value.type == 'reSubmit') {
682 updateCostAssess({
683 guid: currTableData.value.guid,
684 immediateApprove: true,
685 tenantGuid: userData.tenantGuid,
686 daName: currTableData.value.daName,
687 damGuid: currTableData.value.damGuid,
688 costAssessmentFile: info.costAssessmentFile?.map(file => {
689 return {
690 name: file.name,
691 url: file.url
692 }
693 }) || [],
694 evaluationFile: info.evaluationFile?.map(file => {
695 return {
696 name: file.name,
697 url: file.url
698 }
699 }) || [],
700 qualityScore: info.qualityScore || null,
701 evaluationRangeStart: info.evaluationRange ? info.evaluationRange[0] : null,
702 evaluationRangeEnd: info.evaluationRange ? info.evaluationRange[1] : null,
703 evaluationNote: info.evaluationNote || null,
704 evaluationAgencyGuid: info.evaluationAgencyGuid,
705 }).then((res: any) => {
706 dialogInfo.value.footer.btns[1].loading = false;
707 if (res?.code == proxy.$passCode) {
708 ElMessage.success('该资产价值评估重新提交成功');
709 dialogInfo.value.visible = false;
710 page.value.curr = 1;
711 getTableData();
712 formItems.value[4].placeholder = `本次评估数据资产总体质量得分为**分\n准确性:\n一致性:\n可访问性:\n规范性:\n完整性:`;
713 } else {
714 ElMessage.error(res.msg);
715 }
716 })
717 } else {
718 let params: any = {};
719 let daInfo = assetListData.value.find(a => a.guid == info.registerGuid);
720 if (daInfo.qualityEvaluationGuid) {
721 //通过质量评估发起资产申请
722 params = {
723 immediateApprove: true,
724 tenantGuid: userData.tenantGuid,
725 daName: daInfo.damName,
726 damGuid: daInfo.guid,
727 costAssessmentFile: info.costAssessmentFile?.map(file => {
728 return {
729 name: file.name,
730 url: file.url
731 }
732 }) || [],
733 evaluationAgencyGuid: info.evaluationAgencyGuid,
734 }
735 } else {
736 //未通过质量评估发起资产申请
737 params = {
738 immediateApprove: true,
739 tenantGuid: userData.tenantGuid,
740 daName: daInfo.damName,
741 damGuid: daInfo.guid,
742 costAssessmentFile: info.costAssessmentFile?.map(file => {
743 return {
744 name: file.name,
745 url: file.url
746 }
747 }) || [],
748 evaluationFile: info.evaluationFile?.map(file => {
749 return {
750 name: file.name,
751 url: file.url
752 }
753 }) || [],
754 qualityScore: info.qualityScore,
755 evaluationRangeStart: info.evaluationRange ? info.evaluationRange[0] : null,
756 evaluationRangeEnd: info.evaluationRange ? info.evaluationRange[1] : null,
757 evaluationNote: info.evaluationNote,
758 evaluationAgencyGuid: info.evaluationAgencyGuid,
759 }
760 }
761 saveCostAssess(params).then((res: any) => {
762 dialogInfo.value.footer.btns[1].loading = false;
763 if (res?.code == proxy.$passCode) {
764 ElMessage.success('价值评估发起成功');
765 dialogInfo.value.visible = false;
766 page.value.curr = 1;
767 getTableData();
768 } else {
769 ElMessage.error(res.msg);
770 }
771 })
772 }
773 } else {
712 let submitFunc = () => { 774 let submitFunc = () => {
713 getProcessNodesPromise({ 775 getProcessNodesPromise({
714 deploymentId: deploymentId.value, 776 deploymentId: deploymentId.value,
...@@ -833,6 +895,7 @@ const dialogBtnClick = (btn, info) => { ...@@ -833,6 +895,7 @@ const dialogBtnClick = (btn, info) => {
833 } 895 }
834 }) 896 })
835 } 897 }
898 }
836 } else if (btn.value == 'cancel') { 899 } else if (btn.value == 'cancel') {
837 dialogInfo.value.visible = false; 900 dialogInfo.value.visible = false;
838 } 901 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!