From 42703ea001fe9e73f30ed17c05760a57b1cb596c Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 05 三月 2024 11:05:45 +0800
Subject: [PATCH] 完成设备总览静态页面
---
src/components/view/finance-submit.vue | 137 +++++++++++++++++++++++++++++++++++++++------
1 files changed, 117 insertions(+), 20 deletions(-)
diff --git a/src/components/view/finance-submit.vue b/src/components/view/finance-submit.vue
index 14db3e7..ff389b0 100644
--- a/src/components/view/finance-submit.vue
+++ b/src/components/view/finance-submit.vue
@@ -34,6 +34,9 @@
height: calc(100% - 60px - 80px - 10px - 40px);
padding: 20px;
}
+ .el-radio-group{
+ width: 100%;
+ }
</style>
<template>
@@ -42,15 +45,31 @@
<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="chooseDia = true" 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="false" :editable="false" @change="refreshTable()"></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>
+ <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;">
@@ -59,8 +78,23 @@
</div>
</div>
<div class="table">
- <ValueTable ref="ValueTable" :url="$api.dataReporting.selectFinanceSubmitList" :upUrl="$api.dataReporting.updateFinanceSubmit" :delUrl="$api.dataReporting.delFinanceSubmit" :componentData="componentData" :key="upIndex"/>
+ <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>
+ <el-dialog title="璇烽�夋嫨璐㈠姟涓婃姤鐨勫璞�" :visible.sync="chooseDia" width="500px">
+ <div class="body" v-if="chooseDia" style="max-height: 550px;overflow-y: auto;padding: 5px 0;">
+ <el-radio-group v-model="userId">
+ <el-col :span="8" v-for="(a, ai) in users" :key="ai" style="margin-bottom: 2px;">
+ <el-radio border size="small" :label="a.id">{{a.name}}</el-radio>
+ </el-col>
+ </el-radio-group>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="chooseDia = false">鍙栨秷</el-button>
+ <el-button type="primary" @click="goDown">涓嬩竴姝�</el-button>
+ </span>
+ </el-dialog>
</div>
</template>
@@ -75,6 +109,7 @@
componentData: {
entity: {
name: null,
+ createTime: null,
orderBy: {
field: 'id',
order: 'asc'
@@ -88,8 +123,8 @@
font: '缂栬緫',
type: 'text',
method: 'doDiy',
- field:['createUserName']
- },{
+ field: ['createUserName','瀵硅薄=param']
+ }, {
id: 'delete',
font: '鍒犻櫎',
type: 'text',
@@ -100,21 +135,49 @@
product: {
select: []
},
- custom: {select: []}
+ custom: {
+ select: []
+ },
+ param:{
+ select:[]
+ }
},
+ requiredAdd: ['company', 'name', 'employeeRebate','param'],
+ requiredUp: ['employeeRebate'],
+ disabledUp: ['company', 'name','param'],
+ uploadStr: ""
},
entityCopy: {},
upIndex: 0,
product: [],
custom: [],
- addPower: true
+ addPower: true,
+ inPower: true,
+ outPower: true,
+ chooseDia: false,
+ users: [],
+ userId: null
}
+ },
+ 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()
+ this.getUserList()
},
methods: {
refreshTable() {
@@ -124,14 +187,14 @@
this.componentData.entity = this.HaveJson(this.entityCopy)
this.upIndex++
},
- openAdd(){
+ openAdd() {
this.$refs.ValueTable.openAddDia(this.$api.dataReporting.addFinanceSubmit);
},
- selectProductEnumList(){
- this.$axios.get(this.$api.enums.selectProductEnumList).then(res=>{
+ selectProductEnumList() {
+ this.$axios.get(this.$api.enums.selectProductEnumList).then(res => {
this.product = res.data
var str = []
- res.data.forEach(a=>{
+ res.data.forEach(a => {
str.push({
label: a.product,
value: a.product
@@ -140,11 +203,11 @@
this.componentData.selectField.product.select = str
})
},
- selectCustomEnumList(){
- this.$axios.get(this.$api.enums.selectCustomEnumList).then(res=>{
+ selectCustomEnumList() {
+ this.$axios.get(this.$api.enums.selectCustomEnumList).then(res => {
this.custom = res.data
var str = []
- res.data.forEach(a=>{
+ res.data.forEach(a => {
str.push({
label: a.name,
value: a.name
@@ -154,30 +217,64 @@
})
},
// 鏉冮檺鍒嗛厤
- getPower(){
+ 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'){
+ if (power[i].menuMethod == 'updateFinanceSubmit') {
up = true
}
- if(power[i].menuMethod=='delFinanceSubmit'){
+ if (power[i].menuMethod == 'delFinanceSubmit') {
del = true
}
- if(power[i].menuMethod=='addFinanceSubmit'){
+ if (power[i].menuMethod == 'addFinanceSubmit') {
add = true
}
+ if (power[i].menuMethod == 'inputFinanceSubmitCsv') {
+ inPower = true
+ }
+ if (power[i].menuMethod == 'downFinanceSubmitFile') {
+ outPower = true
+ }
}
- if(!del){
+ if (!del) {
this.componentData.do.splice(1, 1)
}
- if(!up){
+ if (!up) {
this.componentData.do.splice(0, 1)
}
this.addPower = add
+ this.inPower = inPower
+ this.outPower = outPower
+ },
+ getUserList(){
+ this.$axios.get(this.$api.user.getUserMenu).then(res => {
+ if (res.code === 201) {
+ return
+ }
+ this.users = res.data
+ var str = []
+ res.data.forEach(a => {
+ str.push({
+ label: a.name,
+ value: a.id
+ })
+ })
+ this.componentData.selectField.param.select = str
+ })
+ },
+ goDown(){
+ if(this.userId == null || this.userId == undefined) {
+ this.$message.error('璇烽�夋嫨璐㈠姟涓婃姤鐨勫璞�')
+ return
+ }
+ this.componentData.uploadStr = this.userId
+ this.$refs.ValueTable.openUpload()
}
}
}
-</script>
\ No newline at end of file
+</script>
--
Gitblit v1.9.3