From 6bbceeae0a692ef60f429dbca889752fcb09ec9a Mon Sep 17 00:00:00 2001 From: houshuai <17802598606@163.com> Date: 星期四, 03 七月 2025 19:42:01 +0800 Subject: [PATCH] 线边库和订单 基本页面搭建 --- src/views/base/SupplierList.vue | 83 ++++++++++++++++++----------------------- 1 files changed, 37 insertions(+), 46 deletions(-) diff --git a/src/views/base/SupplierList.vue b/src/views/base/SupplierList.vue index 701e9a6..270a0c6 100644 --- a/src/views/base/SupplierList.vue +++ b/src/views/base/SupplierList.vue @@ -1,7 +1,6 @@ <template> <a-card :bordered="false" - title="渚涘簲鍟�" > <!-- 鏌ヨ鍖哄煙 --> <div class="table-page-search-wrapper"> @@ -11,10 +10,7 @@ > <a-row :gutter="30"> - <a-col - :md="6" - :sm="24" - > + <a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-form-item label="渚涘簲鍟嗙紪鍙�"> <j-input placeholder="璇疯緭鍏ヤ緵搴斿晢缂栧彿妫�绱�" @@ -23,16 +19,20 @@ </a-form-item> </a-col> - <a-col - :md="6" - :sm="24" - > + <a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-form-item label="渚涘簲鍟嗗悕绉�"> <j-input placeholder="璇疯緭鍏ヤ緵搴斿晢鍚嶇О妫�绱�" v-model="queryParam.supplierName" ></j-input> </a-form-item> + </a-col> + + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </span> </a-col> </a-row> </a-form> @@ -41,20 +41,14 @@ <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> <div class="table-operator"> <a-button - type="primary" - @click="searchQuery" - icon="search" - >鏌ヨ</a-button> - <a-button - type="primary" - @click="searchReset" - icon="reload" - >閲嶇疆</a-button> - <a-button @click="handleAdd" type="primary" icon="plus" >鏂板</a-button> + <!-- <a-button type="primary" @click="exportToExcel('渚涘簲鍟嗕俊鎭鍏ユā鏉�')" icon="export" style="margin-left: 8px" >涓嬭浇瀵煎叆妯℃澘</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> + <a-button type="primary" icon="import" :disabled="!nodeSelected.key || nodeSelected.entity.leafFlag === '2'">瀵煎叆</a-button> + </a-upload> --> </div> <!-- table鍖哄煙-begin --> @@ -70,17 +64,7 @@ :dataSource="dataSource" :pagination="ipagination" :loading="loading" - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:type}" - @change="handleTableChange" - :customRow="clickThenCheck" > - <span - slot="partCount" - slot-scope="text,record" - class="fontweight" - > - {{record.partCount}} - </span> <!--鐘舵�佹爮涓�у睍绀�--> <span slot="status" @@ -181,9 +165,7 @@ }, data() { return { - selectedRowRecord: {}, dataSource: [], - partCount: "", /* 鍒嗛〉鍙傛暟 */ ipagination: { current: 1, @@ -265,7 +247,6 @@ scopedSlots: { customRender: 'action' }, } ], - type: "radio", url: { list: '/base/supplier/list', delete: '/base/supplier/delete', @@ -274,9 +255,7 @@ } }, mounted() { - this.$bus.$on('refreshParentPage', (data) => { - this.loadData(); - }) + }, methods: { loadData(arg) { @@ -319,18 +298,30 @@ } }); }, - clickThenCheck(record) { - return { - on: { - click: (e) => { - this.selectedRowRecord = record; - this.onSelectChange(record.id.split(","), [record]); - } + exportToExcel(fileName) { + this.loading = true // 鏄剧ず鍔犺浇閬僵 + this.queryParam.paraTypeFlag = this.paraTypeFlag + var params = this.getQueryParams() + downFile(this.url.loadTemplate,params).then((data)=>{ + if (!data) { + this.$message.warning("鏂囦欢涓嬭浇澶辫触") + return } - }; - }, - onSelectChange(selectedRowKeys) { - this.selectedRowKeys = selectedRowKeys; + if (typeof window.navigator.msSaveBlob !== 'undefined') { + window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'}), fileName+'.xlsx') + }else{ + let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'})) + let link = document.createElement('a') + link.style.display = 'none' + link.href = url + link.setAttribute('download', fileName+'.xlsx') + document.body.appendChild(link) + link.click() + document.body.removeChild(link); //涓嬭浇瀹屾垚绉婚櫎鍏冪礌 + window.URL.revokeObjectURL(url); //閲婃斁鎺塨lob瀵硅薄 + } + this.loading = false // 闅愯棌閬僵 + }) }, }, -- Gitblit v1.9.3