| | |
| | | <template> |
| | | <a-card |
| | | :bordered="false" |
| | | title="供应商" |
| | | > |
| | | <!-- 查询区域 --> |
| | | <div class="table-page-search-wrapper"> |
| | |
| | | > |
| | | <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="请输入供应商编号检索" |
| | |
| | | </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> |
| | |
| | | <!-- 操作按钮区域 --> |
| | | <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 --> |
| | |
| | | :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" |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | selectedRowRecord: {}, |
| | | dataSource: [], |
| | | partCount: "", |
| | | /* 分页参数 */ |
| | | ipagination: { |
| | | current: 1, |
| | |
| | | scopedSlots: { customRender: 'action' }, |
| | | } |
| | | ], |
| | | type: "radio", |
| | | url: { |
| | | list: '/base/supplier/list', |
| | | delete: '/base/supplier/delete', |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$bus.$on('refreshParentPage', (data) => { |
| | | this.loadData(); |
| | | }) |
| | | |
| | | }, |
| | | methods: { |
| | | loadData(arg) { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | 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); //释放掉blob对象 |
| | | } |
| | | this.loading = false // 隐藏遮罩 |
| | | }) |
| | | }, |
| | | }, |
| | | |