|
@@ -11,7 +11,7 @@
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="时间" label-width="40px">
|
|
|
+ <el-form-item label="上传时间" label-width="80px">
|
|
|
<el-date-picker
|
|
|
style="margin-top:5px;"
|
|
|
v-model="dateRange"
|
|
@@ -25,46 +25,58 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- plain
|
|
|
- icon="el-icon-plus"
|
|
|
- size="mini"
|
|
|
- @click="handleAdd"
|
|
|
- v-hasPermi="['system:admin:add']"
|
|
|
- >下载充值模板</el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
<el-upload
|
|
|
- class="upload-demo"
|
|
|
- action="#"
|
|
|
- :limit = 1
|
|
|
- :on-change="handleChange"
|
|
|
- :file-list="fileList"
|
|
|
- :auto-upload="false"
|
|
|
- accept=".xlsx,.xls"
|
|
|
- style="display:inline-block;margin-left:10px;vertical-align: top;"
|
|
|
- >
|
|
|
- <el-button size="mini" type="primary">上传充值文件</el-button>
|
|
|
- </el-upload>
|
|
|
+ ref="upload"
|
|
|
+ class="upload-demo"
|
|
|
+ action="#"
|
|
|
+ :limit = 1
|
|
|
+ :on-change="handleChange"
|
|
|
+ :auto-upload="false"
|
|
|
+ accept=".xlsx,.xls"
|
|
|
+ style="display:inline-block;margin-left:10px;vertical-align: top;"
|
|
|
+ >
|
|
|
+ <el-button size="mini" type="primary">上传文件</el-button>
|
|
|
+ </el-upload>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
<el-table v-loading="loading" :data="adminList" >
|
|
|
<el-table-column label="id" align="center" prop="id" show-overflow-tooltip />
|
|
|
- <el-table-column label="类别" align="center" prop="businessType" show-overflow-tooltip />
|
|
|
+ <el-table-column label="文件类别" align="center" prop="businessType" show-overflow-tooltip />
|
|
|
<el-table-column label="文件名称" align="center" prop="oriName" show-overflow-tooltip />
|
|
|
+ <el-table-column label="文件大小" align="center" prop="fileSize" show-overflow-tooltip >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.fileSize / 1024}}Kb
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="上传时间" align="center" prop="createTime" show-overflow-tooltip />
|
|
|
+ <el-table-column label="文件失效时间" align="center" prop="expriceAt" show-overflow-tooltip />
|
|
|
+ <el-table-column label="文件是否生效" align="center" prop="activeFlag" show-overflow-tooltip >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span :class="scope.row.activeFlag == '1' ? 'success' : 'danger'">{{scope.row.activeFlag == '1' ? '未生效' : '生效'}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="文件状态" align="center" prop="delFlag" show-overflow-tooltip >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span :class="scope.row.delFlag == '1' ? 'success' : 'danger'">{{scope.row.delFlag == '1' ? '未删除' : '删除'}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" show-overflow-tooltip >
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button v-if ="scope.row.url"
|
|
|
+ <el-button v-if ="scope.row.url && scope.row.delFlag == '1'"
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-bottom"
|
|
|
+ @click="handleExport(scope.row)"
|
|
|
+ >下载</el-button>
|
|
|
+ <el-button v-if ="scope.row.url && scope.row.delFlag == '0'"
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-bottom"
|
|
|
+ disabled
|
|
|
@click="handleExport(scope.row)"
|
|
|
>下载</el-button>
|
|
|
- <!-- <span v-if="scope.row.url">
|
|
|
- <span v-if="scope.row.url == '' || scope.row.url == null">文件整理中...请稍后查看</span>
|
|
|
- <span else>{{scope.row.url}}</span>
|
|
|
- </span> -->
|
|
|
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -81,7 +93,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { addChannel, updataChannel, delChannel, listChannel, fileId, uploadFileApi, fileTakeEffect, getFile, listRecharge } from "@/api/system/product";
|
|
|
+import { addChannel, updataChannel, delChannel, fileId, uploadFileApi, fileTakeEffect, getFile, listRecharge } from "@/api/system/product";
|
|
|
export default {
|
|
|
name: "admin",
|
|
|
data() {
|
|
@@ -118,19 +130,9 @@ export default {
|
|
|
current: 1,
|
|
|
size: 10,
|
|
|
name: undefined,
|
|
|
- aliasName: undefined,
|
|
|
- },
|
|
|
- // 表单参数
|
|
|
- form: {
|
|
|
- id:'',
|
|
|
- name:'',
|
|
|
- introduce:'',
|
|
|
- logo:"",
|
|
|
- batchNo:undefined,
|
|
|
- businessType:"产品logo",
|
|
|
- uploadType:"file",
|
|
|
},
|
|
|
|
|
|
+
|
|
|
// 上传图片
|
|
|
dialogImageUrl: '',
|
|
|
dialogVisible: false,
|
|
@@ -162,9 +164,13 @@ export default {
|
|
|
/** 查询参数列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
- let data = this.addDateRange(this.queryParams,this.dateRange)
|
|
|
- data.params = undefined
|
|
|
- listRecharge(data).then(response => {
|
|
|
+ console.log(this.dateRange)
|
|
|
+ if(this.dateRange.length>0){
|
|
|
+ this.queryParams.startTime = this.dateRange[0]
|
|
|
+ this.queryParams.endTime = this.dateRange[1]
|
|
|
+ }
|
|
|
+ console.log(this.queryParams)
|
|
|
+ listRecharge(this.queryParams).then(response => {
|
|
|
if(response.data.records.length>0){
|
|
|
let arrBig = response.data.records
|
|
|
let arrr = []
|
|
@@ -173,27 +179,11 @@ export default {
|
|
|
arrr.push(arrBig[i])
|
|
|
}
|
|
|
}
|
|
|
- // let arr = []
|
|
|
- // arr = response.data.records.map(item =>{
|
|
|
- // return {
|
|
|
- // batchNos:[item.logo]
|
|
|
- // }
|
|
|
- // })
|
|
|
- // for(let i=1;i<response.data.records.length; i++){
|
|
|
- // arr[0].batchNos.push(response.data.records[i].logo)
|
|
|
- // }
|
|
|
- // getFile(arr[0]).then(response =>{
|
|
|
- // const reverse = response.data.reverse()
|
|
|
- // for(let i=0;i<response.data.length;i++){
|
|
|
- // arrBig[i].logo = reverse[i].url
|
|
|
- // }
|
|
|
- // })
|
|
|
- setTimeout(()=>{
|
|
|
+ // setTimeout(()=>{
|
|
|
this.loading = false;
|
|
|
this.adminList = arrr;
|
|
|
this.total = response.data.total;
|
|
|
- console.log(this.adminList)
|
|
|
- },1000)
|
|
|
+ // },1000)
|
|
|
|
|
|
}else{
|
|
|
this.adminList = []
|
|
@@ -227,31 +217,12 @@ export default {
|
|
|
resetQuery() {
|
|
|
this.dateRange = [];
|
|
|
this.resetForm("queryForm");
|
|
|
+ this.queryParams.startTime = undefined
|
|
|
+ this.queryParams.endTime = undefined
|
|
|
+ this.queryParams.name = undefined
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
- /** 新增按钮操作 */
|
|
|
- handleAdd() {
|
|
|
- this.form.id =undefined
|
|
|
- this.form.name =undefined
|
|
|
- this.form.introduce =undefined
|
|
|
- this.form.logo =undefined
|
|
|
- this.reset();
|
|
|
- this.open = true;
|
|
|
- this.title = "添加参数";
|
|
|
- },
|
|
|
- // 多选框选中数据
|
|
|
- handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.id)
|
|
|
- this.single = selection.length!=1
|
|
|
- this.multiple = !selection.length
|
|
|
- },
|
|
|
- /** 修改按钮操作 */
|
|
|
- handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
- Object.assign(this.form, row.id ? this.adminList.find(val=>val.id === row.id) : this.adminList.find(val=>val.id === this.ids[0]))
|
|
|
- this.open = true;
|
|
|
- this.title = "修改参数";
|
|
|
- },
|
|
|
+
|
|
|
|
|
|
handleChange(param){
|
|
|
this.limit = 1
|
|
@@ -264,39 +235,20 @@ export default {
|
|
|
this.form.batchNo = res.data
|
|
|
this.formData = new FormData()// FormData 对象
|
|
|
this.formData.append('files', param.raw)
|
|
|
-
|
|
|
this.form.businessType = "充值表格"
|
|
|
uploadFileApi(this.form.batchNo,this.form.businessType,this.formData).then(response => {
|
|
|
- // getFile({batchNo:this.form.batchNo}).then(response => {
|
|
|
-
|
|
|
- // })
|
|
|
if(response.data.length>0){
|
|
|
let ids = new FormData()
|
|
|
ids.append('ids[]', response.data[0].id)
|
|
|
- // 上传图片生效
|
|
|
+ // 上传生效
|
|
|
fileTakeEffect(response.data[0].batchNo,ids).then(response => {
|
|
|
- this.msgSuccess("上传成功");
|
|
|
- // if (this.form.id != undefined) {
|
|
|
- // updataChannel(this.form).then(response => {
|
|
|
- // this.loading = false,
|
|
|
- // this.msgSuccess("修改成功");
|
|
|
- // this.open = false;
|
|
|
- // this.getList();
|
|
|
- // }).catch(()=>{
|
|
|
- // this.loading = false,
|
|
|
- // this.open = false
|
|
|
- // })
|
|
|
- // } else {
|
|
|
- // addChannel(this.form).then(response => {
|
|
|
- // this.loading = false,
|
|
|
- // this.msgSuccess("新增成功");
|
|
|
- // this.open = false;
|
|
|
- // this.getList();
|
|
|
- // }).catch(()=>{
|
|
|
- // this.loading = false,
|
|
|
- // this.open = false
|
|
|
- // })
|
|
|
- // }
|
|
|
+ if(res.status == "SUCCESS"){
|
|
|
+ this.msgSuccess("上传成功");
|
|
|
+ this.$refs.upload.submit();
|
|
|
+ this.getList()
|
|
|
+ }else{
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
}).catch(err =>{
|
|
|
})
|
|
|
}
|