|
@@ -0,0 +1,169 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div class="list-view">
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ :data="tableData"
|
|
|
|
|
+ row-key="id"
|
|
|
|
|
+ ref="table"
|
|
|
|
|
+ header-row-class-name="table-header-row"
|
|
|
|
|
+ header-cell-class-name="table-header-cell"
|
|
|
|
|
+ row-class-name="table-row"
|
|
|
|
|
+ cell-class-name="table-cell"
|
|
|
|
|
+ :height="tableHeight"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-table-column v-if="multipleMode" align="center" type="selection" width="50"> </el-table-column>
|
|
|
|
|
+ <!-- <el-table-column prop="id" label="ID" width="100"> </el-table-column> -->
|
|
|
|
|
+ <!-- <el-table-column prop="patentId" label="专利id"> </el-table-column> -->
|
|
|
|
|
+ <el-table-column prop="feeMaintenanceId" label="官费类型名称id"> </el-table-column>
|
|
|
|
|
+ <el-table-column prop="status" label="支付状态" :formatter="statusFormatter"> </el-table-column>
|
|
|
|
|
+ <el-table-column prop="patentPartnerId" label="专利权人"> </el-table-column>
|
|
|
|
|
+ <el-table-column prop="payPartnerId" label="支付对象"> </el-table-column>
|
|
|
|
|
+ <el-table-column prop="amount" label="金额"> </el-table-column>
|
|
|
|
|
+ <el-table-column prop="currencyMaintenanceId" label="币种"> </el-table-column>
|
|
|
|
|
+ <el-table-column prop="paymentDeadline" label="支付期限"> </el-table-column>
|
|
|
|
|
+ <el-table-column prop="paymentDate" label="支付日期"> </el-table-column>
|
|
|
|
|
+ <el-table-column prop="remark" label="备注"> </el-table-column>
|
|
|
|
|
+ <el-table-column prop="invoiceReturn" label="是否发票回传">
|
|
|
|
|
+ <template slot-scope="{ row }">
|
|
|
|
|
+ <el-tag :type="row.invoiceReturn ? '' : 'info'">{{ row.invoiceReturn }}</el-tag>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="userId" label="userId"> </el-table-column>
|
|
|
|
|
+ <el-table-column label="操作" align="center" fixed="right" min-width="150">
|
|
|
|
|
+ <template slot-scope="{ row }">
|
|
|
|
|
+ <el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>
|
|
|
|
|
+ <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+<script>
|
|
|
|
|
+import { mapState } from 'vuex';
|
|
|
|
|
+import pageableTable from '@/mixins/pageableTable';
|
|
|
|
|
+
|
|
|
|
|
+export default {
|
|
|
|
|
+ name: 'FeeList',
|
|
|
|
|
+ mixins: [pageableTable],
|
|
|
|
|
+ props: {
|
|
|
|
|
+ logoPatentInfo: {
|
|
|
|
|
+ type: Object,
|
|
|
|
|
+ default: () => {
|
|
|
|
|
+ return {};
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ multipleMode: false,
|
|
|
|
|
+ search: '',
|
|
|
|
|
+ url: '/fee/all',
|
|
|
|
|
+ downloading: false,
|
|
|
|
|
+ statusOptions: [
|
|
|
|
|
+ { label: '已支付', value: 'PAID' },
|
|
|
|
|
+ { label: '未支付', value: 'UNPAID' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ pageSize: 100
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ selection() {
|
|
|
|
|
+ return this.$refs.table.selection.map(i => i.id);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ init() {
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.tableHeight = document.querySelector('.el-table').getBoundingClientRect().height + 20;
|
|
|
|
|
+ }, 100);
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ statusFormatter(row, column, cellValue, index) {
|
|
|
|
|
+ let selectedOption = this.statusOptions.find(i => i.value === cellValue);
|
|
|
|
|
+ if (selectedOption) {
|
|
|
|
|
+ return selectedOption.label;
|
|
|
|
|
+ }
|
|
|
|
|
+ return '';
|
|
|
|
|
+ },
|
|
|
|
|
+ beforeGetData() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ query: {
|
|
|
|
|
+ patentId: this.logoPatentInfo.id
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ toggleMultipleMode(multipleMode) {
|
|
|
|
|
+ this.multipleMode = multipleMode;
|
|
|
|
|
+ if (!multipleMode) {
|
|
|
|
|
+ this.$refs.table.clearSelection();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ addRow() {
|
|
|
|
|
+ this.$refs.feeAdd.show = true;
|
|
|
|
|
+ },
|
|
|
|
|
+ editRow(row) {
|
|
|
|
|
+ this.$router.push({
|
|
|
|
|
+ path: '/feeEdit',
|
|
|
|
|
+ query: {
|
|
|
|
|
+ id: row.id
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ download() {
|
|
|
|
|
+ this.downloading = true;
|
|
|
|
|
+ this.$axios
|
|
|
|
|
+ .get('/fee/excel', {
|
|
|
|
|
+ responseType: 'blob',
|
|
|
|
|
+ params: { size: 10000 }
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ this.downloading = false;
|
|
|
|
|
+ const downloadUrl = window.URL.createObjectURL(new Blob([res.data]));
|
|
|
|
|
+ const link = document.createElement('a');
|
|
|
|
|
+ link.href = downloadUrl;
|
|
|
|
|
+ link.setAttribute('download', res.headers['content-disposition'].split('filename=')[1]);
|
|
|
|
|
+ document.body.appendChild(link);
|
|
|
|
|
+ link.click();
|
|
|
|
|
+ link.remove();
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(e => {
|
|
|
|
|
+ console.log(e);
|
|
|
|
|
+ this.downloading = false;
|
|
|
|
|
+ this.$message.error(e.error);
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ operation1() {
|
|
|
|
|
+ this.$notify({
|
|
|
|
|
+ title: '提示',
|
|
|
|
|
+ message: this.selection
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ operation2() {
|
|
|
|
|
+ this.$message('操作2');
|
|
|
|
|
+ },
|
|
|
|
|
+ deleteRow(row) {
|
|
|
|
|
+ this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ return this.$http.post(`/fee/del/${row.id}`);
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ this.$message.success('删除成功');
|
|
|
|
|
+ this.getData();
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(e => {
|
|
|
|
|
+ if (e !== 'cancel') {
|
|
|
|
|
+ this.$message.error(e.error);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+</script>
|
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
|
+.list-view {
|
|
|
|
|
+ flex-grow: 1;
|
|
|
|
|
+ padding: 20px 0;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|