From 33032d320cb75854def7391026b0401f1bfb8360 Mon Sep 17 00:00:00 2001 From: 黎星凯 <13949086503@163.com> Date: 星期六, 11 五月 2024 17:26:02 +0800 Subject: [PATCH] 20240511修改: 分发单优化, 分类,物品,分发单明细,采购单明细数据导入 --- admin-web/src/views/foundation/classification/index.vue | 75 ++++++++++++++++++++----------------- 1 files changed, 40 insertions(+), 35 deletions(-) diff --git a/admin-web/src/views/foundation/classification/index.vue b/admin-web/src/views/foundation/classification/index.vue index 6913db5..774aa37 100644 --- a/admin-web/src/views/foundation/classification/index.vue +++ b/admin-web/src/views/foundation/classification/index.vue @@ -17,7 +17,12 @@ </el-col> </el-row> <!--娣诲姞/缂栬緫寮圭獥--> - <edit v-if="editSetting.show" :setting="editSetting" @close="editSetting.show = false" @search="refreshData" /> + <edit + v-if="editSetting.show" + :setting="editSetting" + @close="editSetting.show = false" + @search="refreshData" + /> </el-card> </el-container> </el-container> @@ -37,11 +42,10 @@ import items from './items'; import edit from './edit'; import * as finsystenant from '@/api/baseSetting/finsystenant'; -import { getTree } from '@/api/foudation/classification'; +import {getTree} from '@/api/foudation/classification'; import myImport from '@/views/components/myImport'; -import { getBaseUrl } from '@/utils/base'; -import {getType} from '@/api/system/dict/type' -import {getDicts} from '@/api/system/dict/data' +import {getBaseUrl} from '@/utils/base'; +import {getDicts} from '@/api/system/dict/data'; export default { name: 'index', @@ -65,15 +69,15 @@ dialogShow: false, fileSettings: { data: {}, - uploadUrl: getBaseUrl() + '/pc/fin/sys/tenant/import', // 涓婁紶鍦板潃 + uploadUrl: getBaseUrl() + '/pc/base/category/import', // 涓婁紶鍦板潃 accept: '.xls', // 鏍煎紡 type: 'text', // 鍥炴樉褰㈠紡 - loading: false, // 瀵煎叆鏁堟灉 + loading: true, // 瀵煎叆鏁堟灉 }, /* 妯℃澘涓嬭浇 */ templateSettings: { templateName: '瀵煎叆妯℃澘.xls', // 鍚嶇О - templateUrl: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/getImportTemplate', // 涓嬭浇鍦板潃 + templateUrl: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/getImportTemplate?type=classification', // 涓嬭浇鍦板潃 }, onSuccess: null, }, @@ -106,13 +110,19 @@ this.showAdd(null); }, }, + { + name: '瀵煎叆', + click: () => { + this.openImport(null); + }, + }, ], }, // 鍒椾俊鎭� columns: [ - { title: '鍒嗙被鍚嶇О', field: 'categoryName', align: 'center' }, - { title: '绫诲埆', field: 'classification', align: 'left' }, - { title: '鏄剧ず椤哄簭', field: 'orderNumber', align: 'center', width: '80px' }, + { title: '鍒嗙被鍚嶇О', field: 'categoryName', align: 'left', minWidth: 140 }, + { title: '绫诲埆', field: 'classification', align: 'center', width: 100 }, + { title: '鏄剧ず椤哄簭', field: 'orderNumber', align: 'center', width: 100 }, { field: 'states', title: '鐘舵��', @@ -145,7 +155,7 @@ // 鎿嶄綔淇℃伅 operation: { show: true, // 鏄剧ず鎿嶄綔鍒� - width: '150', // 鍒楀 + width: '160', // 鍒楀 attr: [ { title: '缂栬緫', @@ -178,13 +188,13 @@ // 鑾峰彇鏈烘瀯鏍� this.initTreeData(); // 绫诲埆瀛楀吀 - getDicts('GOODS_PRICE').then(res=>{ - this.items[1].options = res.map(v=>{ - v.label=v.dict_label - v.value=v.dict_value - return v - }) - }) + getDicts('GOODS_PRICE').then((res) => { + this.items[1].options = res.map((v) => { + v.label = v.dict_label; + v.value = v.dict_value; + return v; + }); + }); }, methods: { //瀵煎叆 @@ -203,14 +213,8 @@ // 宸︿晶鏍戝垵濮嬪寲 initTreeData() { getTree().then((res) => { - console.log(res, 'restree'); - console.log(this.importSetting, 'this.importSetting'); const content = res || []; - // this.treeDataList.splice(0, this.treeDataList.length) this.treeDataList = content; - // if (content.length > 0) { - // this.importSetting.fileSettings.data = {pid: content[0].id} - // } }); }, updState(row) { @@ -236,20 +240,18 @@ }) .then((res) => { this.$message.success('鍒犻櫎鎴愬姛锛�'); - this.search(); + this.refreshData(); }) .catch(() => {}); }, showAdd() { - if (!this.editSetting.orgId) { - this.$message.warning('璇峰厛閫夋嫨宸︿晶鏈烘瀯') - } else { - this.editSetting.pid = this.p.id; + if (this.p && this.p) { + this.editSetting.pid = this.p.id; + } this.editSetting.id = null; this.editSetting.info = null; this.editSetting.title = '鏂板'; this.editSetting.show = true; - } }, showAudit(row) { this.editSetting.id = row.id; @@ -258,7 +260,6 @@ this.editSetting.show = true; }, nodeClick(param) { - console.log(param, 'param'); param = param || {}; this.p = Object.assign( {}, @@ -280,19 +281,23 @@ // 鏌ヨtable鍒楄〃 search(pageNum) { if (pageNum != undefined) { - this.$refs.myTable.search({pageNum}); + this.$refs.myTable.search({ pageNum }); } else { this.$refs.myTable.search(); } }, refreshData() { - this.initTreeData() - this.search() + this.initTreeData(); + this.search(); }, fifterForm(params) { this.filterFrom = Object.assign(this.filterFrom, params); this.search(1); }, + + openImport(){ + this.importOrg(); + }, }, }; </script> -- Gitblit v1.9.1