e08e6a76 by lxs Committed by lihua

数据定价更新

1 parent a3124461
...@@ -303,3 +303,10 @@ export const getCurrentUserInfo = (params) => { ...@@ -303,3 +303,10 @@ export const getCurrentUserInfo = (params) => {
303 params 303 params
304 }); 304 });
305 }; 305 };
306
307 /** 下载文件模板 */
308 export const exportTemplate = (params) => request({
309 url: `${import.meta.env.VITE_APP_ADD_FILE}/import-config/export-template?bizGuid=${params.bizGuid}&importType=${params.importType}`,
310 method: 'post',
311 responseType: 'blob'
312 });
......
...@@ -248,6 +248,7 @@ onMounted(() => { ...@@ -248,6 +248,7 @@ onMounted(() => {
248 :show-header="props.tableInfo.showHeader ?? true" stripe :border="props.tableInfo.border 248 :show-header="props.tableInfo.showHeader ?? true" stripe :border="props.tableInfo.border
249 ?? true" :height="props.tableInfo.height === null ? null : (props.tableInfo.height ?? '100%')" 249 ?? true" :height="props.tableInfo.height === null ? null : (props.tableInfo.height ?? '100%')"
250 :max-height="maxHeight" :row-key="rowKey" :current-row-key="currentRowKey" :row-class-name="rowClassName" 250 :max-height="maxHeight" :row-key="rowKey" :current-row-key="currentRowKey" :row-class-name="rowClassName"
251 :tree-props="props.tableInfo.treeProps" :default-expand-all="props.tableInfo.expandAll ?? false"
251 :expand-row-keys="props.tableInfo.expandedKey" v-loading="tableDataLoading" @row-click="rowClick" 252 :expand-row-keys="props.tableInfo.expandedKey" v-loading="tableDataLoading" @row-click="rowClick"
252 @row-dblclick="rowDblClick" @selection-change="selectionChange" @select="tableCheckboxSelectChange" 253 @row-dblclick="rowDblClick" @selection-change="selectionChange" @select="tableCheckboxSelectChange"
253 @select-all="tableCheckboxAllSelectChange" style="width: 100%; display: inline-block" 254 @select-all="tableCheckboxAllSelectChange" style="width: 100%; display: inline-block"
...@@ -386,7 +387,7 @@ onMounted(() => { ...@@ -386,7 +387,7 @@ onMounted(() => {
386 <template #default="scope" v-else-if="item.type == 'approveTag'"> 387 <template #default="scope" v-else-if="item.type == 'approveTag'">
387 <el-tag v-if="scope.row[item.field]" :type="tagType(scope.row.approveVO, 'approveState')">{{ 388 <el-tag v-if="scope.row[item.field]" :type="tagType(scope.row.approveVO, 'approveState')">{{
388 tagMethod(scope.row.approveVO, 'approveState') 389 tagMethod(scope.row.approveVO, 'approveState')
389 }}</el-tag> 390 }}</el-tag>
390 <span v-else>{{ '--' }}</span> 391 <span v-else>{{ '--' }}</span>
391 </template> 392 </template>
392 <template #default="scope" v-else-if="item.type == 'tooltip'"> 393 <template #default="scope" v-else-if="item.type == 'tooltip'">
...@@ -491,7 +492,7 @@ onMounted(() => { ...@@ -491,7 +492,7 @@ onMounted(() => {
491 </template> 492 </template>
492 <template #default="scope" v-else-if="item.type == 'stepsBar'"> 493 <template #default="scope" v-else-if="item.type == 'stepsBar'">
493 <div :class="item.className" v-if="item.stepsInfo(scope)"> 494 <div :class="item.className" v-if="item.stepsInfo(scope)">
494 <StepBar :steps-info="item.stepsInfo(scope)" /> 495 <StepBar :steps-info="item.stepsInfo(scope)" />
495 </div> 496 </div>
496 <span v-else>--</span> 497 <span v-else>--</span>
497 </template> 498 </template>
......
...@@ -111,13 +111,16 @@ defineExpose({ ...@@ -111,13 +111,16 @@ defineExpose({
111 <p class="item_title">{{ item.title }}</p> 111 <p class="item_title">{{ item.title }}</p>
112 <div class="form_item" v-if="item.type == 'select'"> 112 <div class="form_item" v-if="item.type == 'select'">
113 <span class="item_label" :class="{ required_mark: item.selectInfo.required }">{{ item.selectInfo.label 113 <span class="item_label" :class="{ required_mark: item.selectInfo.required }">{{ item.selectInfo.label
114 }}:</span> 114 }}:</span>
115 <el-select v-model="extraParams[item.selectInfo.field]" :placeholder="item.selectInfo.placeholder" 115 <el-select v-model="extraParams[item.selectInfo.field]" :placeholder="item.selectInfo.placeholder"
116 :disabled="item.selectInfo.disabled" @change="selectChange"> 116 :disabled="item.selectInfo.disabled" @change="selectChange" :filterable="item.selectInfo.filterable" :style="item.selectInfo.style">
117 <el-option v-for="opts in item.selectInfo.options" :label="opts.label" :value="opts.value" /> 117 <el-option v-for="opts in item.selectInfo.options"
118 :label="item.selectInfo.props?.label ? opts[item.selectInfo.props.label] : opts.label"
119 :value="item.selectInfo.props?.value ? opts[item.selectInfo.props.value] : opts.value"
120 :disabled="opts.disabled" />
118 </el-select> 121 </el-select>
119 </div> 122 </div>
120 <div class="form_item" v-if="item.type == 'tree-select'"> 123 <div class="form_item" v-else-if="item.type == 'tree-select'">
121 <span class="item_label" :class="{ required_mark: item.selectInfo.required }">{{ item.selectInfo.label 124 <span class="item_label" :class="{ required_mark: item.selectInfo.required }">{{ item.selectInfo.label
122 }}:</span> 125 }}:</span>
123 <el-tree-select 126 <el-tree-select
...@@ -176,7 +179,7 @@ defineExpose({ ...@@ -176,7 +179,7 @@ defineExpose({
176 </el-button> 179 </el-button>
177 </div> 180 </div>
178 <el-upload v-else ref="fileUploadRef" class="upload_panel" :class="[props.uploadInfo.col]" 181 <el-upload v-else ref="fileUploadRef" class="upload_panel" :class="[props.uploadInfo.col]"
179 v-model:file-list="fileList" :action="item.uploadInfo.action" :auto-upload="item.uploadInfo.auto ?? ''" 182 v-model:file-list="fileList" :action="item.uploadInfo.action ?? ''" :auto-upload="item.uploadInfo.auto ?? ''"
180 :drag="item.uploadInfo.drag ?? false" :accept="item.uploadInfo.accept" :limit="item.uploadInfo.limit ?? 1" 183 :drag="item.uploadInfo.drag ?? false" :accept="item.uploadInfo.accept" :limit="item.uploadInfo.limit ?? 1"
181 :on-change="onUpload" :on-exceed="val => exceedFile(val, item.uploadInfo.cover ?? false)" 184 :on-change="onUpload" :on-exceed="val => exceedFile(val, item.uploadInfo.cover ?? false)"
182 :on-error="handleError" :on-success="handleSuccess" :before-upload="beforeUPload" 185 :on-error="handleError" :on-success="handleSuccess" :before-upload="beforeUPload"
......
...@@ -18,7 +18,7 @@ import { ...@@ -18,7 +18,7 @@ import {
18 getImportData, 18 getImportData,
19 exportDictionary, 19 exportDictionary,
20 exportCollectTask, 20 exportCollectTask,
21 // getImageContent 21 exportTemplate
22 } from '@/api/modules/queryService'; 22 } from '@/api/modules/queryService';
23 import { 23 import {
24 parseAndDecodeUrl, 24 parseAndDecodeUrl,
...@@ -29,6 +29,7 @@ import { ...@@ -29,6 +29,7 @@ import {
29 getDictionaryTree 29 getDictionaryTree
30 } from '@/api/modules/dataInventory'; 30 } from '@/api/modules/dataInventory';
31 import { commonPageConfig } from '@/utils/enum'; 31 import { commonPageConfig } from '@/utils/enum';
32 import { getDemandTreeList, getDiseaseAll } from '@/api/modules/dataPricing';
32 33
33 const { proxy } = getCurrentInstance() as any; 34 const { proxy } = getCurrentInstance() as any;
34 35
...@@ -156,6 +157,29 @@ const getDictList = () => { ...@@ -156,6 +157,29 @@ const getDictList = () => {
156 }) 157 })
157 } 158 }
158 159
160 // 获取需求表树形数据
161 const getTreeData = () => {
162 if (isfileImport == '7') {
163 getDemandTreeList({ pageIndex: 1, pageSize: 100000, isCatalog: 'N' }).then((res: any) => {
164 if (res.code == proxy.$passCode) {
165 const data = res.data?.records || [];
166 dictionaryList.value = data;
167 } else {
168 proxy.$ElMessage.error(res.msg);
169 }
170 })
171 } else {
172 getDiseaseAll().then((res: any) => {
173 if (res.code == proxy.$passCode) {
174 const data = res.data || [];
175 dictionaryList.value = data;
176 } else {
177 proxy.$ElMessage.error(res.msg);
178 }
179 })
180 }
181 }
182
159 const tabsChange = (name) => { 183 const tabsChange = (name) => {
160 tabsActiveName.value = name 184 tabsActiveName.value = name
161 let info: any = { 185 let info: any = {
...@@ -283,11 +307,16 @@ const batching = (type) => { ...@@ -283,11 +307,16 @@ const batching = (type) => {
283 } 307 }
284 open("此操作将永久删除, 是否继续?", "warning", true); 308 open("此操作将永久删除, 是否继续?", "warning", true);
285 } else if (type === 'importFile') { 309 } else if (type === 'importFile') {
286 if (isfileImport == '2' || isfileImport == '4') { 310 if (isfileImport == '2' || isfileImport == '4' || isfileImport == '7' || isfileImport == '8') {
287 dialogInfo.value.header.title = '导入数据' 311 dialogInfo.value.header.title = '导入数据'
288 dialogInfo.value.type = 'upload' 312 dialogInfo.value.type = 'upload'
289 dialogInfo.value.size = isfileImport == '4' ? 600 : 500; 313 dialogInfo.value.size = isfileImport == '4' ? 600 : 500;
290 uploadFiles.value = [] 314 uploadFiles.value = []
315 if (isfileImport == '7') {
316 uploadSteps.value[0].selectInfo.options = dictionaryList.value;
317 } else if (isfileImport == '8') {
318 uploadSteps.value[0].cascaderInfo.options = dictionaryList.value;
319 }
291 uploadInfo.value.uploadInfo.steps = uploadSteps.value 320 uploadInfo.value.uploadInfo.steps = uploadSteps.value
292 const content: any = [uploadInfo.value] 321 const content: any = [uploadInfo.value]
293 dialogInfo.value.contents = content 322 dialogInfo.value.contents = content
...@@ -377,6 +406,20 @@ const exportData = (ids: any = null) => { ...@@ -377,6 +406,20 @@ const exportData = (ids: any = null) => {
377 res?.msg && ElMessage.error(res?.msg); 406 res?.msg && ElMessage.error(res?.msg);
378 } 407 }
379 }); 408 });
409 } else if (tabsActiveName.value == 'importFile' && isfileImport == '7') {
410 exportTemplate({
411 bizGuid: '',
412 importType: "0046"
413 }).then((res: any) => {
414 download(res, '需求表管理导入模板.xlsx', 'excel')
415 });
416 } else if (tabsActiveName.value == 'importFile' && isfileImport == '8') {
417 exportTemplate({
418 bizGuid: '',
419 importType: "0047"
420 }).then((res: any) => {
421 download(res, '疾病管理导入模板.xlsx', 'excel')
422 });
380 } 423 }
381 } 424 }
382 425
...@@ -390,11 +433,11 @@ const importData = (info) => { ...@@ -390,11 +433,11 @@ const importData = (info) => {
390 // dialogInfo.value.footer.btns.map((item: any) => delete item.disabled) 433 // dialogInfo.value.footer.btns.map((item: any) => delete item.disabled)
391 return 434 return
392 } 435 }
436 uploadFiles.value.forEach((item: any, index: number) => {
437 params.append("file", item.raw);
438 });
393 let paramUrl = ''; 439 let paramUrl = '';
394 if (isfileImport == '2') { 440 if (isfileImport == '2') {
395 uploadFiles.value.forEach((item: any, index: number) => {
396 params.append("file", item.raw);
397 });
398 paramUrl = `ms-daop-zcgl-asset-dam-service/dam-catalog-table/excel-by-subject-guid?staffGuid=${userData.staffGuid}&subjectGuid=${route.query.bizGuid}` 441 paramUrl = `ms-daop-zcgl-asset-dam-service/dam-catalog-table/excel-by-subject-guid?staffGuid=${userData.staffGuid}&subjectGuid=${route.query.bizGuid}`
399 } else if (isfileImport == '4') { 442 } else if (isfileImport == '4') {
400 if (!info.databaseNameZh) { 443 if (!info.databaseNameZh) {
...@@ -411,14 +454,17 @@ const importData = (info) => { ...@@ -411,14 +454,17 @@ const importData = (info) => {
411 }) 454 })
412 return; 455 return;
413 } 456 }
414 uploadFiles.value.forEach((item: any, index: number) => { 457
415 params.append("uploadFile", item.raw);
416 });
417 paramUrl = `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/meta-collect-import?staffGuid=${userData.staffGuid}&databaseNameZh=${info.databaseNameZh}&databaseNameEn=${info.databaseNameEn}&isCover=${info.isCover}` 458 paramUrl = `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/meta-collect-import?staffGuid=${userData.staffGuid}&databaseNameZh=${info.databaseNameZh}&databaseNameEn=${info.databaseNameEn}&isCover=${info.isCover}`
459 } else if (isfileImport == '7') {
460 info.bizGuid = '0046';
461 paramUrl = `${import.meta.env.VITE_APP_ADD_FILE}/import-data/import-common?importType=${importType.value}&staffGuid=${userData.staffGuid}&tenantGuid=${userData.tenantGuid}`
462 paramUrl += `&extendFields=${encodeURIComponent(JSON.stringify(info))}`
463 } else if (isfileImport == '8') {
464 info.bizGuid = '0047';
465 paramUrl = `${import.meta.env.VITE_APP_ADD_FILE}/import-data/import-common?importType=${importType.value}&staffGuid=${userData.staffGuid}&tenantGuid=${userData.tenantGuid}`
466 paramUrl += `&extendFields=${encodeURIComponent(JSON.stringify(info))}`
418 } else { 467 } else {
419 uploadFiles.value.forEach((item: any, index: number) => {
420 params.append("file", item.raw);
421 });
422 paramUrl = `${import.meta.env.VITE_APP_ADD_FILE}/import-data/import-common?importType=${importType.value}&staffGuid=${userData.staffGuid}&tenantGuid=${userData.tenantGuid}&dataType=2` 468 paramUrl = `${import.meta.env.VITE_APP_ADD_FILE}/import-data/import-common?importType=${importType.value}&staffGuid=${userData.staffGuid}&tenantGuid=${userData.tenantGuid}&dataType=2`
423 if (info && Object.keys(info).length) { 469 if (info && Object.keys(info).length) {
424 paramUrl += `&extendFields=${encodeURIComponent(JSON.stringify(info))}` 470 paramUrl += `&extendFields=${encodeURIComponent(JSON.stringify(info))}`
...@@ -452,6 +498,10 @@ const dialogBtnClick = (btn, info) => { ...@@ -452,6 +498,10 @@ const dialogBtnClick = (btn, info) => {
452 if (dialogInfo.value.type == 'upload') { 498 if (dialogInfo.value.type == 'upload') {
453 if (tabsActiveName.value == 'dictionary') { 499 if (tabsActiveName.value == 'dictionary') {
454 importData({ bizGuid: dictionaryGuid.value }) 500 importData({ bizGuid: dictionaryGuid.value })
501 } else if (tabsActiveName.value == 'importFile' && isfileImport == '7') {
502 importData(info)
503 } else if (tabsActiveName.value == 'importFile' && isfileImport == '8') {
504 importData(info)
455 } else { 505 } else {
456 importData(info) 506 importData(info)
457 } 507 }
...@@ -478,6 +528,10 @@ const setUploadInfo = () => { ...@@ -478,6 +528,10 @@ const setUploadInfo = () => {
478 importType.value = '0034'; 528 importType.value = '0034';
479 } else if (isfileImport == '4') { 529 } else if (isfileImport == '4') {
480 importType.value = '0042'; 530 importType.value = '0042';
531 } else if (isfileImport == '7') {
532 importType.value = '0046';
533 } else if (isfileImport == '8') {
534 importType.value = '0047';
481 } else { 535 } else {
482 importType.value = '0033'; 536 importType.value = '0033';
483 } 537 }
...@@ -641,6 +695,94 @@ const setUploadInfo = () => { ...@@ -641,6 +695,94 @@ const setUploadInfo = () => {
641 } 695 }
642 ] 696 ]
643 uploadInfo.value.uploadInfo.extraParams = { isCover: 'Y' } 697 uploadInfo.value.uploadInfo.extraParams = { isCover: 'Y' }
698 } else if (tabsActiveName.value == 'importFile' && isfileImport == '7') {
699 uploadSteps.value = [
700 {
701 title: '1、导入前请先录入以下内容',
702 type: 'select',
703 selectInfo: {
704 label: '需求表名称',
705 placeholder: '请选择',
706 field: 'menuGuid',
707 default: '',
708 options: [],
709 props: {
710 label: "menuName",
711 value: "guid",
712 },
713 filterable: true,
714 clearable: true,
715 required: true,
716 style: {
717 width: '191px',
718 }
719 }
720 },
721 {
722 title: '2、请下载最新的模板,并按照模板格式准备需要导入的数据',
723 type: 'btn_down'
724 },
725 {
726 title: '3、选择准备好的文件导入',
727 type: 'btn_upload',
728 uploadInfo: {
729 action: '',
730 auto: false,
731 cover: true,
732 fileList: [],
733 accept: '.xlsx, .xls',
734 tips: '当前支持xls、xlsx文件,默认使用第一个sheet'
735 }
736 }
737 ]
738 dictionaryGuid.value = uploadSetting.value?.dictionaryGuid || ''
739 uploadInfo.value.uploadInfo.extraParams = {
740 menuGuid: dictionaryGuid.value
741 }
742 } else if (tabsActiveName.value == 'importFile' && isfileImport == '8') {
743 uploadSteps.value = [
744 {
745 title: '1、导入前请先录入以下内容',
746 type: 'cascader',
747 cascaderInfo: {
748 label: '疾病名称',
749 placeholder: '',
750 field: 'parentGuid',
751 options: [],
752 default: '',
753 showAllLevels: false,
754 props: {
755 checkStrictly: true,
756 label: "diseaseName",
757 value: "guid",
758 children: 'childList',
759 emitPath: false
760 },
761 filterable: true,
762 clearable: true,
763 }
764 },
765 {
766 title: '2、请下载最新的模板,并按照模板格式准备需要导入的数据',
767 type: 'btn_down'
768 },
769 {
770 title: '3、选择准备好的文件导入',
771 type: 'btn_upload',
772 uploadInfo: {
773 action: '',
774 auto: false,
775 cover: true,
776 fileList: [],
777 accept: '.xlsx, .xls',
778 tips: '当前支持xls、xlsx文件,默认使用第一个sheet'
779 }
780 }
781 ]
782 dictionaryGuid.value = uploadSetting.value?.dictionaryGuid || ''
783 uploadInfo.value.uploadInfo.extraParams = {
784 parentGuid: dictionaryGuid.value
785 }
644 } else { 786 } else {
645 uploadSteps.value = [ 787 uploadSteps.value = [
646 { 788 {
...@@ -674,7 +816,8 @@ onActivated(() => { ...@@ -674,7 +816,8 @@ onActivated(() => {
674 if (tabsActiveName.value == 'dictionary') { 816 if (tabsActiveName.value == 'dictionary') {
675 getDictList(); 817 getDictList();
676 } 818 }
677 setUploadInfo() 819 setUploadInfo();
820 (isfileImport == '7' || isfileImport == '8') && getTreeData();
678 }) 821 })
679 822
680 </script> 823 </script>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!