From 1e4f78885d71bcfc5644d20ad9ac95d6b6beb00e Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期一, 19 六月 2023 16:06:56 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue | 9 Source/UBCS-WEB/src/components/FormTemplate/ResembleQuery.vue | 10 Source/UBCS-WEB/src/components/FormTemplate/ResembleQueryDialog.vue | 45 +++-- Source/UBCS-WEB/src/api/batchImport/index.js | 2 Source/UBCS-WEB/src/components/BatchImport/ShowImportData.vue | 238 +++++++++++++++++++++++++++++ Source/UBCS-WEB/src/views/MasterData/FormTempalteTest.vue | 23 +- Source/UBCS-WEB/src/components/BatchImport/index.vue | 125 ++++++++------ 7 files changed, 355 insertions(+), 97 deletions(-) diff --git a/Source/UBCS-WEB/src/api/batchImport/index.js b/Source/UBCS-WEB/src/api/batchImport/index.js index 7790c47..f48426a 100644 --- a/Source/UBCS-WEB/src/api/batchImport/index.js +++ b/Source/UBCS-WEB/src/api/batchImport/index.js @@ -4,7 +4,7 @@ // 鍘嗗彶瀵煎叆妯℃澘涓嬭浇 export const downloadHistoryImportTemplate = (params) => { return request({ - url: '/api/ubcs-code/mdmEngineController/downloadTopImportExcel', + url: '/api/ubcs-code/mdmEngineController/downloadImportExcelHistory', method: 'get', params }) diff --git a/Source/UBCS-WEB/src/components/BatchImport/ShowImportData.vue b/Source/UBCS-WEB/src/components/BatchImport/ShowImportData.vue new file mode 100644 index 0000000..32fde8d --- /dev/null +++ b/Source/UBCS-WEB/src/components/BatchImport/ShowImportData.vue @@ -0,0 +1,238 @@ +<template> + <el-dialog + :title="title" + :visible="dialogVisible" + width="1200px" + append-to-body + > + <div class="flex_box"> + <div class="left" :style="{ width: leftWidth }"> + <div class="isExpand_box"> + <el-link type="primary" @click="hideTree"> + <i + :class="isExpand ? 'el-icon-arrow-left' : 'el-icon-arrow-right'" + ></i> + {{ isExpand ? "鏀剁缉" : "灞曞紑" }} + </el-link> + </div> + <el-input + placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" + v-model="filterText" + size="small" + v-show="isExpand" + > + </el-input> + <el-tree + v-show="isExpand" + class="filter_tree" + :data="data" + default-expand-all + :filter-node-method="filterNode" + ref="tree" + > + </el-tree> + </div> + <div class="right"> + <div class="tab_box"> + <el-tabs v-model="activeName" type="card" @tab-click="handleClick"> + <el-tab-pane label="姝g‘鏁版嵁" name="success"> + <el-table border :data="successData"></el-table> + </el-tab-pane> + <el-tab-pane label="鏈夌浉浼奸」鎴栬�呴敊璇暟鎹�" name="error"> + <el-table border :data="errorData"></el-table> + </el-tab-pane> + </el-tabs> + </div> + </div> + </div> + <template #footer> + <div> + <el-button size="small" type="primary">纭畾瀵煎叆</el-button> + <el-button size="small">鍙栨秷</el-button> + </div> + </template> + </el-dialog> +</template> + +<script> +export default { + name: "ShowImportData", + props: { + title: { + type: String, + default: "鍘嗗彶鏁版嵁瀵煎叆", + }, + visible: false, + }, + computed: { + dialogVisible: { + get() { + return this.visible; + }, + set(val) { + this.$emit("update:visible", val); + }, + }, + }, + data() { + return { + isExpand: true, + filterText: "", + leftWidth: "200px", + data: [ + { + id: 1, + label: "涓�绾� 1", + children: [ + { + id: 4, + label: "浜岀骇 1-1", + children: [ + { + id: 9, + label: "涓夌骇 1-1-1", + }, + { + id: 10, + label: "涓夌骇 1-1-2", + }, + ], + }, + ], + }, + { + id: 2, + label: "涓�绾� 2", + children: [ + { + id: 5, + label: "浜岀骇 2-1", + }, + { + id: 6, + label: "浜岀骇 2-2", + }, + ], + }, + { + id: 3, + label: "涓�绾� 3", + children: [ + { + id: 7, + label: "浜岀骇 3-1", + }, + { + id: 8, + label: "浜岀骇 3-2", + }, + { + id: 8, + label: "浜岀骇 3-2", + }, + { + id: 8, + label: "浜岀骇 3-2", + }, + { + id: 8, + label: "浜岀骇 3-2", + }, + { + id: 8, + label: "浜岀骇 3-2", + }, + { + id: 8, + label: "浜岀骇 3-2", + }, + { + id: 8, + label: "浜岀骇 3-2", + }, + { + id: 8, + label: "浜岀骇 3-2", + }, + { + id: 8, + label: "浜岀骇 3-2", + }, + { + id: 8, + label: "浜岀骇 3-2", + }, + { + id: 8, + label: "浜岀骇 3-2", + }, + { + id: 8, + label: "浜岀骇 3-2", + }, + { + id: 8, + label: "浜岀骇 3-2", + }, + { + id: 8, + label: "浜岀骇 3-2", + }, + { + id: 8, + label: "浜岀骇 3-2", + }, + { + id: 8, + label: "浜岀骇 3-2", + }, + { + id: 8, + label: "浜岀骇 3-2", + }, + ], + }, + ], + successData: [], + errorData: [], + }; + }, + + methods: { + filterNode(value, data) { + if (!value) return true; + return data.label.indexOf(value) !== -1; + }, + hideTree() { + if (this.isExpand) { + this.leftWidth = "50px"; + } else { + this.leftWidth = "200px"; + } + this.isExpand = !this.isExpand; + }, + }, + watch: { + filterText(val) { + this.$refs.tree.filter(val); + }, + }, +}; +</script> + +<style lang="scss" scoped> +.flex_box { + display: flex; + .left { + transition: all 0.3s; + .isExpand_box { + margin-bottom: 10px; + text-align: right; + } + .filter_tree { + max-height: 400px; + overflow-y: scroll; + } + } +} +</style> diff --git a/Source/UBCS-WEB/src/components/BatchImport/index.vue b/Source/UBCS-WEB/src/components/BatchImport/index.vue index f9baddc..a5bacf6 100644 --- a/Source/UBCS-WEB/src/components/BatchImport/index.vue +++ b/Source/UBCS-WEB/src/components/BatchImport/index.vue @@ -1,51 +1,63 @@ <template> - <el-dialog :title="title" :visible="visible" append-to-body> - <Divider text="瀵煎叆鎻愮ず" left="30px"></Divider> - <ul> - <li v-for="(item, index) in tipList" :key="index"> - {{ item }} - </li> - </ul> - <div class="radio_box"> - <span>鍒嗙被鐨勮矾寰勪娇鐢ㄧ殑灞炴��:</span> - <el-radio-group v-model="classifyAttr"> - <el-radio label="id">鍒嗙被缂栧彿</el-radio> - <el-radio label="name">鍒嗙被鍚嶇О</el-radio> - </el-radio-group> - </div> - <Divider text="excel鏂囦欢锛岄�夋嫨鏂囦欢鍚庝細鑷姩涓婁紶" left="30px"></Divider> - <el-upload - class="upload" - :accept="accept" - :action="action" - :before-upload="beforeUpload" - :on-exceed="handleExceed" - :headers="uploadHeaders" - :on-success="onSuccess" - :show-file-list="false" - :data="{ - codeClassifyOid: this.codeClassifyOid, - classifyAttr: this.classifyAttr, - }" - > - <el-button size="small" type="primary" - ><i class="el-icon-upload"></i> 鐐瑰嚮涓婁紶</el-button + <div> + <el-dialog :title="title" :visible="visible" append-to-body> + <Divider text="瀵煎叆鎻愮ず" left="30px"></Divider> + <ul> + <li v-for="(item, index) in tipList" :key="index"> + {{ item }} + </li> + </ul> + <div class="radio_box"> + <span>鍒嗙被鐨勮矾寰勪娇鐢ㄧ殑灞炴��:</span> + <el-radio-group v-model="classifyAttr"> + <el-radio label="id">鍒嗙被缂栧彿</el-radio> + <el-radio label="name">鍒嗙被鍚嶇О</el-radio> + </el-radio-group> + </div> + <Divider text="excel鏂囦欢锛岄�夋嫨鏂囦欢鍚庝細鑷姩涓婁紶" left="30px"></Divider> + <el-upload + class="upload" + :accept="accept" + :action="action" + :before-upload="beforeUpload" + :on-exceed="handleExceed" + :headers="uploadHeaders" + :on-success="onSuccess" + :show-file-list="false" + :data="{ + codeClassifyOid: this.codeClassifyOid, + classifyAttr: this.classifyAttr, + }" > - </el-upload> - <template #footer> - <el-button type="primary" size="small" @click="downloadTemplateFun" :loading="downloadLoading" - >涓嬭浇瀵煎叆妯℃澘</el-button - > - <el-button size="small">鍏抽棴</el-button> - </template> - </el-dialog> + <el-button size="small" type="primary" + ><i class="el-icon-upload"></i> 鐐瑰嚮涓婁紶</el-button + > + </el-upload> + <template #footer> + <el-button + type="primary" + size="small" + @click="downloadTemplateFun" + :loading="downloadLoading" + >涓嬭浇瀵煎叆妯℃澘</el-button + > + <el-button size="small" @click="visible = false">鍏抽棴</el-button> + </template> + </el-dialog> + <ShowImportData :visible="showVisible" v-if="showVisible"></ShowImportData> + </div> </template> <script> -import { downloadHistoryImportTemplate, downloadErrorFile } from "../../api/batchImport/index"; +import ShowImportData from "./ShowImportData.vue"; +import { + downloadHistoryImportTemplate, + downloadErrorFile, +} from "../../api/batchImport/index"; import { getToken } from "@/util/auth"; export default { - name: "", + name: "BatchImport", + components: { ShowImportData }, props: { visible: { type: Boolean, @@ -68,7 +80,8 @@ return { classifyAttr: "id", uploadParams: {}, - downloadLoading: false + downloadLoading: false, + showVisible: false, }; }, computed: { @@ -109,30 +122,32 @@ }, // 涓嬭浇瀵煎叆妯℃澘 downloadTemplateFun() { - this.downloadLoading = true + this.downloadLoading = true; downloadHistoryImportTemplate({ codeClassifyOid: "535FC9B6-FE27-241F-5FCA-ED4DC17CF95B", - }).then(res => { - this.downloadLoading = false - console.log(res); - }).catch(() => { - this.downloadLoading = false - }); + }) + .then((res) => { + this.downloadLoading = false; + console.log(res); + }) + .catch(() => { + this.downloadLoading = false; + }); }, onSuccess(res) { if (res.code === 400) { - this.$message.error(`${res.msg}锛岃涓嬭浇閿欒淇℃伅杩涜鏌ョ湅锛乣) + this.$message.error(`${res.msg}锛岃涓嬭浇閿欒淇℃伅杩涜鏌ョ湅锛乣); } - downloadErrorFile({uuid: res.data.fileOid}) - } + downloadErrorFile({ uuid: res.data.fileOid }); + }, }, watch: { visible: { - immediate:true, + immediate: true, handler() { this.getDataByType(); - } - } + }, + }, }, }; </script> diff --git a/Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue b/Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue index acb2ed6..42912d0 100644 --- a/Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue +++ b/Source/UBCS-WEB/src/components/FormTemplate/FormTempalte.vue @@ -517,6 +517,7 @@ collapse: true, column: [], }); + return } if ( formItem.type === "combox" && @@ -596,7 +597,7 @@ this.$set(this.option, "column", column); this.$set(this.option, "group", group); this.formIndex++; - if (this.type === 'add') { + if (this.type === 'add' || this.type === 'preview') { this.loading = false; } this.geDictData(dictKeys); @@ -652,11 +653,11 @@ if (type === "truefalse") { return [ { - key: false, + key: 'false', value: "鍚�", }, { - key: true, + key: 'true', value: "鏄�", }, ]; @@ -700,7 +701,7 @@ }, // 鑾峰彇琛ㄥ崟璇︽儏鏁版嵁 getFormDetail() { - if (this.type === 'add') return + if (this.type === 'add' || this.type === 'preview') return getFormDetail({ templateOid: this.templateOid, oid: this.rowOid }).then( (res) => { this.form = Object.assign(this.form, res.data.data[0]) diff --git a/Source/UBCS-WEB/src/components/FormTemplate/ResembleQuery.vue b/Source/UBCS-WEB/src/components/FormTemplate/ResembleQuery.vue index da90c5c..fb1e119 100644 --- a/Source/UBCS-WEB/src/components/FormTemplate/ResembleQuery.vue +++ b/Source/UBCS-WEB/src/components/FormTemplate/ResembleQuery.vue @@ -70,11 +70,7 @@ type: { type: String, default: "add", - }, - form: { - type: Object, - default: () => ({}), - }, + } }, data() { return { @@ -82,8 +78,8 @@ activeName: "findlike", tableData: [], loading: false, - resembleTemplateOid: "78B8C7C5-A042-0B96-FE6D-65421451782A", - resembleCodeClassifyOid: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96", + resembleTemplateOid: "", + resembleCodeClassifyOid: "", rowOid: '', defaultValue: {}, secVOList: [], diff --git a/Source/UBCS-WEB/src/components/FormTemplate/ResembleQueryDialog.vue b/Source/UBCS-WEB/src/components/FormTemplate/ResembleQueryDialog.vue index 9741d14..b97f223 100644 --- a/Source/UBCS-WEB/src/components/FormTemplate/ResembleQueryDialog.vue +++ b/Source/UBCS-WEB/src/components/FormTemplate/ResembleQueryDialog.vue @@ -22,7 +22,7 @@ </template> <script> -import { getFormTemplate } from "@/api/formTemplate"; +import { getFormTemplate, getFormDetail } from "@/api/formTemplate"; import ResembleQuery from "./ResembleQuery"; export default { name: "ResembleQueryDialog", @@ -40,6 +40,7 @@ type: String, default: "", }, + rowOid: "", codeRuleOid: { type: String, default: "", @@ -56,7 +57,8 @@ data() { return { column: [], - loading: false + loading: false, + detailData: {}, }; }, computed: { @@ -71,23 +73,28 @@ }, methods: { openDialog() { - this.loading = true - getFormTemplate({ - templateOid: this.templateOid, - codeClassifyOid: this.codeClassifyOid, - }).then((res) => { - this.loading = false - if ( - res.data && - res.data.resembleTableVO.cols && - res.data.resembleTableVO.cols.length > 0 - ) { - this.column = res.data.resembleTableVO.cols; - this.$refs.ResembleQuery.resembleQuery(); - } else { - this.column = []; - } - }); + this.loading = true; + getFormDetail({ templateOid: this.templateOid, oid: this.rowOid }) + .then((res) => { + this.detailData = res.data.data[0] || {}; + return getFormTemplate({ + templateOid: this.templateOid, + codeClassifyOid: this.codeClassifyOid, + }); + }) + .then((res) => { + this.loading = false; + if ( + res.data && + res.data.resembleTableVO.cols && + res.data.resembleTableVO.cols.length > 0 + ) { + this.column = res.data.resembleTableVO.cols; + this.$refs.ResembleQuery.resembleQuery(this.detailData); + } else { + this.column = []; + } + }); }, }, }; diff --git a/Source/UBCS-WEB/src/views/MasterData/FormTempalteTest.vue b/Source/UBCS-WEB/src/views/MasterData/FormTempalteTest.vue index 8704a87..efffed5 100644 --- a/Source/UBCS-WEB/src/views/MasterData/FormTempalteTest.vue +++ b/Source/UBCS-WEB/src/views/MasterData/FormTempalteTest.vue @@ -6,20 +6,21 @@ <el-button @click="visible2 = true">闄勪欢绠$悊dialog</el-button> <FormTemplateDialog :visible.sync="visible" - :type="this.type" - :templateOid="this.templateOid" - :codeClassifyOid="this.codeClassifyOid" - :codeRuleOid="this.codeRuleOid" + :type="type" + :templateOid="templateOid" + :codeClassifyOid="codeClassifyOid" + :codeRuleOid="codeRuleOid" :disabledProp="disabledProp" :rowOid="rowOid" @submit="submit" ></FormTemplateDialog> <ResembleQueryDialog :visible.sync="visible1" - :type="this.type" - :templateOid="this.templateOid" - :codeClassifyOid="this.codeClassifyOid" - :codeRuleOid="this.codeRuleOid" + :type="type" + :templateOid="templateOid" + :codeClassifyOid="codeClassifyOid" + :rowOid="rowOid" + :codeRuleOid="codeRuleOid" ></ResembleQueryDialog> <BatchImport :visible="visible3" @@ -52,11 +53,11 @@ // 榛樿绂佺敤鐨勮〃鍏冪礌 disabledProp: ["id", "lcstatus"], // 琛ㄥ崟绫诲瀷 - type: "add", - templateOid: "78B8C7C5-A042-0B96-FE6D-65421451782A", + type: "edit", + templateOid: "f441b131-5ea0-4672-ab74-735b11161928", codeClassifyOid: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96", codeRuleOid: "B95872A6-9CEA-D490-8F1B-9D26548CAF96", - rowOid: "6EF696C3-CD87-0E7C-1EA1-8DE3913A95C9", + rowOid: "551FBA49-9A94-2F83-9126-9DD4F9BB14B5", }; }, methods: { -- Gitblit v1.9.3