|
|
@@ -13,6 +13,8 @@
|
|
|
<router-link :to="'/oilsupplier/goodsaptitude/add/operation'">
|
|
|
<el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;">添加</el-button>
|
|
|
</router-link>
|
|
|
+ <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="exportExcel">导出
|
|
|
+ </el-button>
|
|
|
</span>
|
|
|
<el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
|
|
|
|
|
|
@@ -33,7 +35,8 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
- <el-table :data="entityList" size="mini" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
|
|
|
+ <el-table :data="entityList" id="rebateSetTable" size="mini" border height="calc(100vh - 243px)" style="width: 100%"
|
|
|
+ @sort-change="orderby">
|
|
|
<el-table-column label="操作" min-width="200" align="center" fixed="right">
|
|
|
<template slot-scope="scope">
|
|
|
<router-link :to="'/oilsupplier/goodsaptitude/' + scope.row.Id + '/operation'">
|
|
|
@@ -49,34 +52,34 @@
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
<!--<el-button size="small" type="text" style="margin-left:3px" title="审批部门" @click="deptSet(scope.row)">-->
|
|
|
- <!--<i class="icon icon-users"></i>-->
|
|
|
+ <!--<i class="icon icon-users"></i>-->
|
|
|
<!--</el-button>-->
|
|
|
<!--<el-popover placement="top" title="提示" v-model="scope.row.deleteConfirmFlag">-->
|
|
|
- <!--<el-alert-->
|
|
|
- <!--title=""-->
|
|
|
- <!--description="确认要删除吗?"-->
|
|
|
- <!--type="warning"-->
|
|
|
- <!--:closable="false">-->
|
|
|
- <!--</el-alert>-->
|
|
|
- <!--<br/>-->
|
|
|
- <!--<div style="text-align: right; margin: 0">-->
|
|
|
- <!--<el-button type="primary" size="mini" @click="deleteEntity(scope.row)">删除</el-button>-->
|
|
|
- <!--</div>-->
|
|
|
- <!--<el-button slot="reference" type="primary" plain title="删除" style="margin-left:3px" size="mini">删除</el-button>-->
|
|
|
+ <!--<el-alert-->
|
|
|
+ <!--title=""-->
|
|
|
+ <!--description="确认要删除吗?"-->
|
|
|
+ <!--type="warning"-->
|
|
|
+ <!--:closable="false">-->
|
|
|
+ <!--</el-alert>-->
|
|
|
+ <!--<br/>-->
|
|
|
+ <!--<div style="text-align: right; margin: 0">-->
|
|
|
+ <!--<el-button type="primary" size="mini" @click="deleteEntity(scope.row)">删除</el-button>-->
|
|
|
+ <!--</div>-->
|
|
|
+ <!--<el-button slot="reference" type="primary" plain title="删除" style="margin-left:3px" size="mini">删除</el-button>-->
|
|
|
<!--</el-popover>-->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column v-for="column in tableColumns" :prop="column.prop" sortable
|
|
|
- :width="column.width" :key="column.Id" :label="column.label" align="center" show-overflow-tooltip>
|
|
|
+ <el-table-column v-for="column in tableColumns" :prop="column.prop" sortable :width="column.width"
|
|
|
+ :key="column.Id" :label="column.label" align="center" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
{{ transferStr(scope.row[column.prop]) }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
<!--动态显示的表头-->
|
|
|
- <el-table-column v-for="column in dynamicTableColumns" :prop="column.prop" sortable
|
|
|
- :width="300" :key="column.Id" :label="column.label" align="center" show-overflow-tooltip>
|
|
|
+ <el-table-column v-for="column in dynamicTableColumns" :prop="column.prop" sortable :width="320"
|
|
|
+ :key="column.Id" :label="column.label" align="center" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
{{ transferStr(scope.row[column.prop]) }}
|
|
|
</template>
|
|
|
@@ -89,7 +92,7 @@
|
|
|
</el-table-column>-->
|
|
|
</el-table>
|
|
|
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
|
|
|
- :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :page-sizes="[10, 50, 100, 200, 400]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
|
|
|
:total="currentItemCount">
|
|
|
</el-pagination>
|
|
|
</el-card>
|
|
|
@@ -123,6 +126,12 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="大类编码">
|
|
|
+ <el-input size="mini" v-model="searchForm.BigClassCode" style="width:100%" placeholder="请输入"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="中类名称">
|
|
|
<el-input size="mini" v-model="searchForm.MiddleClassName" style="width:100%" placeholder="请输入">
|
|
|
@@ -175,19 +184,16 @@
|
|
|
<el-dialog title="设置审批部门" :visible.sync="deptsetVisible">
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- 审批步骤:
|
|
|
- <el-select v-model="setForm.AuditStepCode" ref="selectAuditStep" placeholder="请选择" size="small">
|
|
|
- <el-option
|
|
|
- v-for="item in AuditStepOptions"
|
|
|
- :key="item.Id"
|
|
|
- :label="item.Key"
|
|
|
- :value="item.Value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ 审批步骤:
|
|
|
+ <el-select v-model="setForm.AuditStepCode" ref="selectAuditStep" placeholder="请选择" size="small">
|
|
|
+ <el-option v-for="item in AuditStepOptions" :key="item.Id" :label="item.Key" :value="item.Value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
审批部门:
|
|
|
- <el-tree style="border: 0" show-checkbox node-key="id" :data="operationOrganizeData" :props="organizeProps" ref="operationOriganizeTree">
|
|
|
+ <el-tree style="border: 0" show-checkbox node-key="id" :data="operationOrganizeData" :props="organizeProps"
|
|
|
+ ref="operationOriganizeTree">
|
|
|
</el-tree>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -199,9 +205,13 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
- import { mapGetters } from 'vuex'
|
|
|
+ import {
|
|
|
+ mapGetters
|
|
|
+ } from 'vuex'
|
|
|
import api from '@/api/oilsupplier/goodsaptitude'
|
|
|
import setapi from '@/api/oilsupplier/oilclassorgset'
|
|
|
+ import FileSaver from "file-saver";
|
|
|
+ import XLSX from "xlsx";
|
|
|
|
|
|
export default {
|
|
|
computed: {
|
|
|
@@ -211,7 +221,7 @@
|
|
|
},
|
|
|
name: 'oilgoodsaptitude',
|
|
|
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
classid: '',
|
|
|
deptsetVisible: false,
|
|
|
@@ -236,6 +246,7 @@
|
|
|
Code: '',
|
|
|
Name: '',
|
|
|
BigClassName: '',
|
|
|
+ BigClassCode: '',
|
|
|
MiddleClassName: '',
|
|
|
SmallClassName: '',
|
|
|
GoodsName: '',
|
|
|
@@ -405,7 +416,7 @@
|
|
|
}
|
|
|
|
|
|
],
|
|
|
- dynamicTableColumns:[],
|
|
|
+ dynamicTableColumns: [],
|
|
|
organizeProps: {
|
|
|
value: 'id',
|
|
|
label: 'name',
|
|
|
@@ -415,10 +426,10 @@
|
|
|
AuditStepOptions: []
|
|
|
}
|
|
|
},
|
|
|
- created () {
|
|
|
+ created() {
|
|
|
// 查询条件初始值备份
|
|
|
Object.assign(this.searchFormReset, this.searchForm)
|
|
|
- //初始化部分表头
|
|
|
+ //初始化部分表头
|
|
|
this.initTableHeader()
|
|
|
|
|
|
// 查询列表
|
|
|
@@ -427,14 +438,35 @@
|
|
|
this.getDictOptions()
|
|
|
},
|
|
|
methods: {
|
|
|
- initTableHeader(){
|
|
|
+ exportExcel() {
|
|
|
+ /* generate workbook object from table */
|
|
|
+ let wb = XLSX.utils.table_to_book(
|
|
|
+ document.querySelector("#rebateSetTable")
|
|
|
+ );
|
|
|
+ /* get binary string as output */
|
|
|
+ let wbout = XLSX.write(wb, {
|
|
|
+ bookType: "xlsx",
|
|
|
+ bookSST: true,
|
|
|
+ type: "array"
|
|
|
+ });
|
|
|
+ try {
|
|
|
+ FileSaver.saveAs(
|
|
|
+ new Blob([wbout], { type: "application/octet-stream" }),
|
|
|
+ "Goods.xlsx"
|
|
|
+ );
|
|
|
+ } catch (e) {
|
|
|
+ if (typeof console !== "undefined") console.log(e, wbout);
|
|
|
+ }
|
|
|
+ return wbout;
|
|
|
+ },
|
|
|
+ initTableHeader() {
|
|
|
|
|
|
setapi.initGoodTableHeader(this.$axios).then(res => {
|
|
|
console.log(res)
|
|
|
- this.dynamicTableColumns=res.data.items
|
|
|
+ this.dynamicTableColumns = res.data.items
|
|
|
})
|
|
|
},
|
|
|
- saveApprovalDept () {
|
|
|
+ saveApprovalDept() {
|
|
|
let organizeids = []
|
|
|
let organize = this.$refs.operationOriganizeTree.getCheckedNodes()
|
|
|
organize.forEach(row => {
|
|
|
@@ -460,7 +492,7 @@
|
|
|
console.log(err)
|
|
|
})
|
|
|
},
|
|
|
- deptSet (val) {
|
|
|
+ deptSet(val) {
|
|
|
let stcode = this.setForm.SupplierTypeCode
|
|
|
this.deptsetVisible = true
|
|
|
this.selecteclassid = val.Id
|
|
|
@@ -480,7 +512,7 @@
|
|
|
console.log(err)
|
|
|
})
|
|
|
},
|
|
|
- initDatas () {
|
|
|
+ initDatas() {
|
|
|
// 分页及列表条件
|
|
|
let params = {
|
|
|
_currentPage: this.currentPage,
|
|
|
@@ -491,18 +523,16 @@
|
|
|
let myCreateOn = []
|
|
|
// 解析时间
|
|
|
|
|
|
- if (this.CreateOn!=null&&this.CreateOn.length === 2) {
|
|
|
+ if (this.CreateOn != null && this.CreateOn.length === 2) {
|
|
|
this.CreateOn[1].setHours(23)
|
|
|
this.CreateOn[1].setMinutes(59)
|
|
|
this.CreateOn[1].setSeconds(59)
|
|
|
myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
|
|
|
myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
|
|
|
}
|
|
|
- console.log(myCreateOn)
|
|
|
// 查询条件
|
|
|
Object.assign(params, this.searchForm)
|
|
|
// 访问接口
|
|
|
- console.log("dasdasdasd")
|
|
|
api.getList(myCreateOn.join(','), params, this.$axios).then(res => {
|
|
|
this.entityList = res.data.items
|
|
|
this.currentItemCount = res.data.currentItemCount
|
|
|
@@ -511,7 +541,7 @@
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- getDictOptions () {
|
|
|
+ getDictOptions() {
|
|
|
api.getDictList(this.$axios).then(res => {
|
|
|
this.AuditStepOptions = res.data.items['AuditStep']
|
|
|
// this.dictOptions.customerList = res.data.items['customerList']
|
|
|
@@ -521,21 +551,21 @@
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- MoreCmdClick (cmd) {
|
|
|
+ MoreCmdClick(cmd) {
|
|
|
if (cmd.Command === 'Set') {
|
|
|
this.deptSet(cmd.row)
|
|
|
} else if (cmd.Command === 'Delete') {
|
|
|
this.deleteEntity(cmd.row)
|
|
|
}
|
|
|
},
|
|
|
- GetCommand (cmdType, row) {
|
|
|
+ GetCommand(cmdType, row) {
|
|
|
let cmd = {}
|
|
|
cmd.Command = cmdType
|
|
|
cmd.row = row
|
|
|
return cmd
|
|
|
},
|
|
|
|
|
|
- searchCommand (command) {
|
|
|
+ searchCommand(command) {
|
|
|
if (command === 'search') {
|
|
|
this.dialogVisible = true
|
|
|
} else if (command === 'clear') {
|
|
|
@@ -543,7 +573,7 @@
|
|
|
}
|
|
|
},
|
|
|
// 列表排序功能
|
|
|
- orderby (column) {
|
|
|
+ orderby(column) {
|
|
|
if (column.order === 'ascending') {
|
|
|
this.Column.Order = 'asc'
|
|
|
} else if (column.order === 'descending') {
|
|
|
@@ -552,27 +582,27 @@
|
|
|
this.Column.Prop = column.prop
|
|
|
this.initDatas()
|
|
|
},
|
|
|
- clearSearch () {
|
|
|
+ clearSearch() {
|
|
|
Object.assign(this.searchForm, this.searchFormReset)
|
|
|
// this.searchForm = this.searchFormReset;
|
|
|
this.CreateOn = ''
|
|
|
this.initDatas()
|
|
|
},
|
|
|
- handleSearch () {
|
|
|
+ handleSearch() {
|
|
|
this.currentPage = 1
|
|
|
this.dialogVisible = false
|
|
|
this.initDatas()
|
|
|
},
|
|
|
- handleCurrentChange (value) {
|
|
|
+ handleCurrentChange(value) {
|
|
|
this.currentPage = value
|
|
|
this.initDatas()
|
|
|
},
|
|
|
- handleSizeChange (value) {
|
|
|
+ handleSizeChange(value) {
|
|
|
this.size = value
|
|
|
this.currentPage = 1
|
|
|
this.initDatas()
|
|
|
},
|
|
|
- deleteEntity (row) {
|
|
|
+ deleteEntity(row) {
|
|
|
// row.deleteConfirmFlag = false
|
|
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
@@ -600,17 +630,18 @@
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- transferStr (val) {
|
|
|
+ transferStr(val) {
|
|
|
if (val === '1') {
|
|
|
return '是'
|
|
|
- } if (val === '0') {
|
|
|
+ }
|
|
|
+ if (val === '0') {
|
|
|
return ''
|
|
|
} else {
|
|
|
return val
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- jstimehandle (val) {
|
|
|
+ jstimehandle(val) {
|
|
|
if (val === '') {
|
|
|
return '----'
|
|
|
} else if (val === '0001-01-01T08:00:00+08:00') {
|
|
|
@@ -623,7 +654,7 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- formatDateTime (date) {
|
|
|
+ formatDateTime(date) {
|
|
|
var y = date.getFullYear()
|
|
|
var m = date.getMonth() + 1
|
|
|
m = m < 10 ? ('0' + m) : m
|
|
|
@@ -636,10 +667,12 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<style>
|
|
|
.el-col {
|
|
|
margin-bottom: 5px;
|
|
|
}
|
|
|
+
|
|
|
</style>
|