<style scoped>
|
.title {
|
height: 60px;
|
line-height: 60px;
|
}
|
|
.search {
|
background-color: #fff;
|
height: 80px;
|
display: flex;
|
align-items: center;
|
}
|
|
.search_thing {
|
width: 350px;
|
display: flex;
|
align-items: center;
|
}
|
|
.search_label {
|
width: 110px;
|
font-size: 14px;
|
text-align: right;
|
}
|
|
.search_input {
|
width: calc(100% - 110px);
|
}
|
|
.table {
|
margin-top: 10px;
|
background-color: #fff;
|
width: calc(100% - 40px);
|
height: calc(100% - 60px - 80px - 10px - 40px);
|
padding: 20px;
|
}
|
</style>
|
|
<template>
|
<div class="role_manage">
|
<div>
|
<el-row class="title">
|
<el-col :span="12" style="padding-left: 20px;">财务上报</el-col>
|
<el-col :span="12" style="text-align: right;">
|
<el-button size="medium" @click="$refs.ValueTable.openUpload()" v-if="inPower">
|
<i class="el-icon-upload2" style="color: #3A7BFA;"></i>
|
<span style="color: #3A7BFA;">导入</span>
|
</el-button>
|
<el-button size="medium" @click="$refs.ValueTable.openDownDia()" v-if="outPower">
|
<i class="el-icon-download" style="color: #3A7BFA;"></i>
|
<span style="color: #3A7BFA;">导出</span>
|
</el-button>
|
<el-button size="medium" type="primary" @click="openAdd" v-if="addPower">新增</el-button>
|
</el-col>
|
</el-row>
|
</div>
|
<div class="search">
|
<div class="search_thing">
|
<div class="search_label">系统日期:</div>
|
<div class="search_input">
|
<el-date-picker size="small" v-model="componentData.entity.createTime" type="date" placeholder="选择日期"
|
value-format="yyyy-MM-dd HH:mm:ss" clearable></el-date-picker>
|
</div>
|
</div>
|
<div class="search_thing">
|
<div class="search_label">账户名:</div>
|
<div class="search_input">
|
<el-input size="small" v-model="componentData.entity.name" clearable placeholder="账户名"
|
@keyup.enter.native="refreshTable()"></el-input>
|
</div>
|
</div>
|
<div class="search_thing" style="padding-left: 30px;">
|
<el-button size="small" @click="refresh()">重 置</el-button>
|
<el-button size="small" type="primary" @click="refreshTable()">查 询</el-button>
|
</div>
|
</div>
|
<div class="table">
|
<ValueTable ref="ValueTable" :url="$api.dataReporting.selectFinanceSubmitList"
|
:upUrl="$api.dataReporting.updateFinanceSubmit" :delUrl="$api.dataReporting.delFinanceSubmit"
|
:componentData="componentData" :key="upIndex" :downUrl="$api.dataReporting.downFinanceSubmitFile" :inputUrl="$api.dataReporting.inputFinanceSubmitCsv"/>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import ValueTable from '../tool/value-table.vue'
|
export default {
|
components: {
|
ValueTable
|
},
|
data() {
|
return {
|
componentData: {
|
entity: {
|
name: null,
|
createTime: null,
|
orderBy: {
|
field: 'id',
|
order: 'asc'
|
}
|
},
|
isIndex: true,
|
showSelect: false,
|
select: true,
|
do: [{
|
id: 'update',
|
font: '编辑',
|
type: 'text',
|
method: 'doDiy',
|
field: ['createUserName']
|
}, {
|
id: 'delete',
|
font: '删除',
|
type: 'text',
|
method: 'doDiy'
|
}],
|
tagField: {},
|
selectField: {
|
product: {
|
select: []
|
},
|
custom: {
|
select: []
|
}
|
},
|
requiredAdd: ['company', 'name', 'employeeRebate'],
|
requiredUp: ['company', 'name', 'employeeRebate']
|
},
|
entityCopy: {},
|
upIndex: 0,
|
product: [],
|
custom: [],
|
addPower: true,
|
inPower: true,
|
outPower: true
|
}
|
},
|
created() {
|
var today = new Date();
|
var yyyy = today.getFullYear();
|
var mm = today.getMonth() + 1;
|
var dd = today.getDate()
|
if (dd < 10) {
|
dd = "0" + dd;
|
}
|
if (mm < 10) {
|
mm = "0" + mm;
|
}
|
this.componentData.entity.createTime = this.HaveJson(`${yyyy}-${mm}-${dd} 00:00:00`)
|
},
|
mounted() {
|
this.entityCopy = this.HaveJson(this.componentData.entity)
|
this.selectProductEnumList()
|
this.selectCustomEnumList()
|
this.getPower()
|
},
|
methods: {
|
refreshTable() {
|
this.$refs['ValueTable'].selectList()
|
},
|
refresh() {
|
this.componentData.entity = this.HaveJson(this.entityCopy)
|
this.upIndex++
|
},
|
openAdd() {
|
this.$refs.ValueTable.openAddDia(this.$api.dataReporting.addFinanceSubmit);
|
},
|
selectProductEnumList() {
|
this.$axios.get(this.$api.enums.selectProductEnumList).then(res => {
|
this.product = res.data
|
var str = []
|
res.data.forEach(a => {
|
str.push({
|
label: a.product,
|
value: a.product
|
})
|
})
|
this.componentData.selectField.product.select = str
|
})
|
},
|
selectCustomEnumList() {
|
this.$axios.get(this.$api.enums.selectCustomEnumList).then(res => {
|
this.custom = res.data
|
var str = []
|
res.data.forEach(a => {
|
str.push({
|
label: a.name,
|
value: a.name
|
})
|
})
|
this.componentData.selectField.custom.select = str
|
})
|
},
|
// 权限分配
|
getPower() {
|
let power = JSON.parse(sessionStorage.getItem('power'))
|
let up = false
|
let del = false
|
let add = false
|
let inPower = false
|
let outPower = false
|
for (var i = 0; i < power.length; i++) {
|
if (power[i].menuMethod == 'updateFinanceSubmit') {
|
up = true
|
}
|
if (power[i].menuMethod == 'delFinanceSubmit') {
|
del = true
|
}
|
if (power[i].menuMethod == 'addFinanceSubmit') {
|
add = true
|
}
|
if (power[i].menuMethod == 'inputFinanceSubmitCsv') {
|
inPower = true
|
}
|
if (power[i].menuMethod == 'downFinanceSubmitFile') {
|
outPower = true
|
}
|
}
|
if (!del) {
|
this.componentData.do.splice(1, 1)
|
}
|
if (!up) {
|
this.componentData.do.splice(0, 1)
|
}
|
this.addPower = add
|
this.inPower = inPower
|
this.outPower = outPower
|
}
|
}
|
}
|
</script>
|