6.28(去掉权限

This commit is contained in:
Hong
2024-06-28 19:01:24 +08:00
parent c33b63fc2c
commit fcd2f81f5a
2 changed files with 138 additions and 142 deletions

View File

@@ -34,13 +34,13 @@
</el-form-item>
<el-form-item v-if="dataForm.way == 0" label="按比例分佣" prop="ratio" class="lang">
<!-- <el-input v-model.trim="dataForm.ratio" placeholder="请输入比例分佣" /> -->
<el-input-number type="text" step-strictly v-model.trim="dataForm.ratio" :min="0" :max="999999999"
:precision="2" :step="0.1"></el-input-number>
<el-input-number type="text" :precision="2" v-model="dataForm.ratio" :min="0" :max="999999999"
></el-input-number>
</el-form-item>
<el-form-item v-if="dataForm.way == 1" label="按量分佣" prop="each" class="lang">
<!-- <el-input v-model.trim="dataForm.each" type="number" placeholder="请输入" /> -->
<el-input-number type="text" step-strictly v-model.trim="dataForm.each" :min="0" :max="999999999"
:precision="2" :step="0.1"></el-input-number>
<el-input-number type="text" :precision="2" v-model="dataForm.each" :min="0" :max="999999999"
></el-input-number>
</el-form-item>
<el-form-item label="省市区" prop="selectedOptions" class="lang">
<el-cascader style="width: 100%" :options="pcTextArr" v-model="dataForm.selectedOptions"
@@ -294,7 +294,6 @@ export default {
this.dataForm.qualificationPicture = JSON.stringify(this.dataForm.sliderImages);
this.dataForm.keywords = this.labelarr.join(',');
this.dataForm.startTime = this.dataForm.time1[0]
console.log(this.dataForm, '提交数据');
if (this.dataForm.id) {
platformUpdate(this.dataForm).then((res) => {
this.$message.success('操作成功');

View File

@@ -19,28 +19,25 @@
</el-select>
</el-form-item>
<el-form-item label="参与时间" prop="time1" class="lang">
<el-date-picker v-model="time1" type="datetimerange" start-placeholder="开始日期"
end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss" @change="timeChange">
<el-date-picker v-model="time1" type="datetimerange" start-placeholder="开始日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss"
@change="timeChange">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" plain icon="el-icon-search" size="mini" @click="queryListFn"
>搜索
<el-button type="primary" plain icon="el-icon-search" size="mini" @click="queryListFn">搜索
</el-button>
</el-form-item>
<el-form-item>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="carExportFn"
v-hasPermi="['system:shop:export']">导出司机编号
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="carExportFn">导出司机编号
</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini"
@click="carExpListOpen = true;expType=1">导入司机编号</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="carExportUnregisteredFn"
v-hasPermi="['system:shop:export']">导出第三方注册
@click="carExpListOpen = true; expType = 1">导入司机编号</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini"
@click="carExportUnregisteredFn">导出第三方注册
</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini"
@click="carExpListOpen = true;expType=2">导入第三方注册</el-button>
@click="carExpListOpen = true; expType = 2">导入第三方注册</el-button>
</el-form-item>
</el-form>
</div>
@@ -73,8 +70,8 @@
</el-table-column>
<el-table-column label="操作" min-width="110" fixed="right" align="center">
<template slot-scope="scope">
<el-button type="text" size="small" @click="onInfo(scope.row.id)" class="mr10">详情</el-button>
</template>
<el-button type="text" size="small" @click="onInfo(scope.row.id)" class="mr10">详情</el-button>
</template>
</el-table-column>
</el-table>
<div class="block">
@@ -86,12 +83,12 @@
<!-- 导入汽车列表 -->
<el-dialog title="导入" :visible.sync="carExpListOpen" width="25%" :before-close="handleClose">
<div>
<el-select v-if="expType==2" v-model="tableFrom.platformId" filterable remote reserve-keyword placeholder="请输入关键词"
:remote-method="remoteMethod" :loading="loading">
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
<div v-if="expType==2" style="height: 20px;"></div>
<el-select v-if="expType == 2" v-model="tableFrom.platformId" filterable remote reserve-keyword
placeholder="请输入关键词" :remote-method="remoteMethod" :loading="loading">
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
<div v-if="expType == 2" style="height: 20px;"></div>
<div v-if="!impDataFlag">
<el-upload width="100%" class="upload-demo" action="https://jsonplaceholder.typicode.com/posts/"
:http-request="handleUploadForm" multiple :limit="1" :file-list="fileList">
@@ -141,9 +138,9 @@
<span v-if="formData.status == 3"> 审核成功</span>
</el-descriptions-item>
<el-descriptions-item label="动力类型">{{
carData.powerType == 0 ? '纯电' : carData.powerType == 1 ? '油电' : '纯油'
}}</el-descriptions-item>
<el-descriptions-item label="参与时间">{{ formData.participationTime }}</el-descriptions-item>
carData.powerType == 0 ? '纯电' : carData.powerType == 1 ? '油电' : '纯油'
}}</el-descriptions-item>
<el-descriptions-item label="参与时间">{{ formData.participationTime }}</el-descriptions-item>
<el-descriptions-item label="绑定时间">{{ formData.bindingTime }}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{ formData.createTime }}</el-descriptions-item>
<el-descriptions-item label="修改时间">{{ formData.updateTime }}</el-descriptions-item>
@@ -153,20 +150,20 @@
</div>
</template>
<script>
import { platformPageListApi, platformUserList, getUserDetail, carExport, carExportUnregistered, carExportError, excelUserSn, carGetImportRate,excelUserCondition,conditionRate ,ExportRefError} from "@/api/divide.js"
import { platformPageListApi, platformUserList, getUserDetail, carExport, carExportUnregistered, carExportError, excelUserSn, carGetImportRate, excelUserCondition, conditionRate, ExportRefError } from "@/api/divide.js"
export default {
name: 'carBrand',
data() {
return {
//详情弹出层
loadingFrom:false,
loadingFrom: false,
//详情
formData:{
car:{}
formData: {
car: {}
},
carData:{},
carData: {},
//导入类型
expType:1,
expType: 1,
//导入弹出层
carExpListOpen: false,
//导入开关
@@ -189,7 +186,7 @@ export default {
tableData: [],
options: [],
//参与时间
time1:[]
time1: []
};
},
computed: {},
@@ -203,13 +200,13 @@ export default {
},
methods: {
//时间
timeChange(e) {
//时间
timeChange(e) {
console.log(e);
if(e){
this.tableFrom.dateLimit=e.join(',')
}else{
this.tableFrom.dateLimit=''
if (e) {
this.tableFrom.dateLimit = e.join(',')
} else {
this.tableFrom.dateLimit = ''
}
this.tableFrom.page = 1;
this.carListFn();
@@ -232,7 +229,7 @@ export default {
this.formData = {};
},
//搜索
queryListFn(){
queryListFn() {
this.tableFrom.page = 1;
this.carListFn();
},
@@ -258,14 +255,14 @@ export default {
this.loadingFrom = true;
getUserDetail(id).then((res) => {
this.formData = res;
if(res.car){
this.carData=res.car
if (res.car) {
this.carData = res.car
}
});
},
// 上传
handleUploadForm(param) {
// 上传
handleUploadForm(param) {
const formData = new FormData();
formData.append('file', param.file);
this.file = formData;
@@ -274,58 +271,58 @@ export default {
toChannelShop() {
if (this.file) {
this.buttFlag = true;
if(this.expType==1){
if (this.expType == 1) {
excelUserSn(this.file)
.then((res) => {
// console.log(res);
this.importData = res;
this.fileList = [];
this.impDataFlag = true;
this.buttFlag = false;
})
.catch((res) => {
this.buttFlag = false;
// console.log(res);
});
this.timer = setInterval(() => {
// 车辆导入进度
carGetImportRate().then((res) => {
this.percentage = this.getPercent(res.data.already_install, res.data.total_install);
if (res.data.already_install == null) {
clearInterval(this.timer);
}
});
}, 2000);
}else{
.then((res) => {
// console.log(res);
this.importData = res;
this.fileList = [];
this.impDataFlag = true;
this.buttFlag = false;
})
.catch((res) => {
this.buttFlag = false;
// console.log(res);
});
this.timer = setInterval(() => {
// 车辆导入进度
carGetImportRate().then((res) => {
this.percentage = this.getPercent(res.data.already_install, res.data.total_install);
if (res.data.already_install == null) {
clearInterval(this.timer);
}
});
}, 2000);
} else {
console.log(this.tableFrom.platformId);
if(!this.tableFrom.platformId){
if (!this.tableFrom.platformId) {
this.$message.success('请选择导入平台');
return
}
//第三方导入
excelUserCondition(this.file,this.tableFrom.platformId)
.then((res) => {
// console.log(res);
this.importData = res;
this.fileList = [];
this.impDataFlag = true;
this.buttFlag = false;
})
.catch((res) => {
this.buttFlag = false;
// console.log(res);
});
this.timer = setInterval(() => {
// 第三方导入进度
conditionRate().then((res) => {
this.percentage = this.getPercent(res.data.already_install, res.data.total_install);
if (res.data.already_install == null) {
clearInterval(this.timer);
}
});
}, 2000);
excelUserCondition(this.file, this.tableFrom.platformId)
.then((res) => {
// console.log(res);
this.importData = res;
this.fileList = [];
this.impDataFlag = true;
this.buttFlag = false;
})
.catch((res) => {
this.buttFlag = false;
// console.log(res);
});
this.timer = setInterval(() => {
// 第三方导入进度
conditionRate().then((res) => {
this.percentage = this.getPercent(res.data.already_install, res.data.total_install);
if (res.data.already_install == null) {
clearInterval(this.timer);
}
});
}, 2000);
}
} else {
this.$message.success('请选择文件');
}
@@ -341,60 +338,60 @@ export default {
},
//导出失败文件
carExportErrorFn() {
if(this.expType==2){
if (this.expType == 2) {
carExportError({
attach: this.importData.attach,
}).then((res) => {
let URL = window.URL || window.webkitURL;
let blob = res.data;
let objectUrl = URL.createObjectURL(blob);
if (res.fileName) {
let a = document.createElement('a');
if (typeof a.download === 'undefined') {
window.location = objectUrl;
} else {
a.href = objectUrl;
const time = new Date();
const year = time.getFullYear(); // 获取年份
const month = time.getMonth() + 1; // 获取月份
const day = time.getDate(); // 获取日期
// 将时间转换为特定格式的字符串
const formattedDate = `${year}-${month.toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`;
a.download = `${formattedDate}expError.xlsx`;
document.body.appendChild(a);
a.click();
a.remove();
attach: this.importData.attach,
}).then((res) => {
let URL = window.URL || window.webkitURL;
let blob = res.data;
let objectUrl = URL.createObjectURL(blob);
if (res.fileName) {
let a = document.createElement('a');
if (typeof a.download === 'undefined') {
window.location = objectUrl;
} else {
a.href = objectUrl;
const time = new Date();
const year = time.getFullYear(); // 获取年份
const month = time.getMonth() + 1; // 获取月份
const day = time.getDate(); // 获取日期
// 将时间转换为特定格式的字符串
const formattedDate = `${year}-${month.toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`;
a.download = `${formattedDate}expError.xlsx`;
document.body.appendChild(a);
a.click();
a.remove();
}
}
}
});
}else{
});
} else {
ExportRefError({
attach: this.importData.attach,
}).then((res) => {
let URL = window.URL || window.webkitURL;
let blob = res.data;
let objectUrl = URL.createObjectURL(blob);
if (res.fileName) {
let a = document.createElement('a');
if (typeof a.download === 'undefined') {
window.location = objectUrl;
} else {
a.href = objectUrl;
const time = new Date();
const year = time.getFullYear(); // 获取年份
const month = time.getMonth() + 1; // 获取月份
const day = time.getDate(); // 获取日期
// 将时间转换为特定格式的字符串
const formattedDate = `${year}-${month.toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`;
a.download = `${formattedDate}expError.xlsx`;
document.body.appendChild(a);
a.click();
a.remove();
attach: this.importData.attach,
}).then((res) => {
let URL = window.URL || window.webkitURL;
let blob = res.data;
let objectUrl = URL.createObjectURL(blob);
if (res.fileName) {
let a = document.createElement('a');
if (typeof a.download === 'undefined') {
window.location = objectUrl;
} else {
a.href = objectUrl;
const time = new Date();
const year = time.getFullYear(); // 获取年份
const month = time.getMonth() + 1; // 获取月份
const day = time.getDate(); // 获取日期
// 将时间转换为特定格式的字符串
const formattedDate = `${year}-${month.toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`;
a.download = `${formattedDate}expError.xlsx`;
document.body.appendChild(a);
a.click();
a.remove();
}
}
}
});
});
}
},
//导出第三方注册信息
carExportUnregisteredFn() {
@@ -467,7 +464,7 @@ export default {
this.buttFlag = false;
this.impDataFlag = false;
this.carExpListOpen = false;
this.fileList=[]
this.fileList = []
//导入数据返回
this.importData = {};
},