提交 c8d0ab6e 编写于 作者: changdi.hao's avatar changdi.hao

Merge branch 'release' into testing/3.23

......@@ -46,4 +46,15 @@ export const uploadPersonExcel = (data, projectId) => {
description: '上传excel文件',
})
// })
}
export const uploadShieldExcel = (data, projectId) => {
return fetch({
headers: {
token: localStorage.getItem('storageToken'),
},
url: getBaseUrl('aggregate/black/setPeopleBlackStatus/batch/' + projectId),
method: 'post',
data: data,
description: '上传excel文件',
})
}
\ No newline at end of file
......@@ -49,6 +49,7 @@
</el-col>
<el-col :span="6" style="padding:0;text-align:right;padding-right:10px;">
<el-button type="primary" size="small" @click="searchList()">搜索</el-button>
<el-button type="primary" size="small" @click="importOrder()" v-if="shieldType == 1">批量导入</el-button>
</el-col>
</el-form>
</el-row>
......@@ -103,12 +104,60 @@
</span>
</el-dialog>
</div>
<!-- 导入屏蔽人员名单 -->
<el-dialog
class="exportlogistics-dialog"
title="批量导入"
:visible="isShowImport"
@close="isShowImport = false"
width="600px"
>
<el-form label-width="120px">
<el-form-item label="导入文档:">
<el-upload
class="upload-excel"
action="#"
accept=".xlsx"
multiple
:limit="1"
:show-file-list="true"
:before-upload="uploadfile"
>
<div class="upload-container">
<el-input
class="file-name"
v-model="fileData.fileName"
size="mini"
readonly
></el-input
>
<el-button type="primary" size="mini">选择文件</el-button>
</div>
</el-upload>
</el-form-item>
<el-form-item label="模板:">
<a class="import-url" :href="logisticsUrl" style="color: #449284">
批量导入模板.xlxs</a>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="small" @click="cancelImport">取消</el-button>
<el-button
size="small"
:loading="isLoading"
type="primary"
@click="confirmImport"
>确认</el-button
>
</div>
</el-dialog>
</div>
</template>
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import { mapGetters } from "vuex";
import { openLoading, closeLoading } from "../../utils/utils";
import { uploadShieldExcel } from "@/utils/education/educationApi";
import * as commonUtil from "../../utils/utils";
import * as operationData from "../../utils/operation";
let vm = null;
......@@ -118,6 +167,14 @@ export default {
},
data() {
return {
isShowImport: false,
isLoading: false,
logisticsUrl: 'https://files.yunqueyi.com/template/portal_template.xlsx',
fileData: {
ext: '',
file: "",
fileName: "",
},
curmbFirst: "教培项目",
curmbSecond: "屏蔽",
projectId: "",
......@@ -232,6 +289,69 @@ export default {
// }
// },
methods: {
// 批量导入
importOrder() {
this.isShowImport = true;
},
uploadfile(file) {
console.log(file, '导入file');
let _this = this;
let arr = file.name.split(".");
let ext = "." + arr[1];
let name = file.name;
let reader = new FileReader();
reader.onload = function (e) {
_this.fileData.fileName = name;
_this.fileData.file = e.target.result.substr(
e.target.result.indexOf("base64,") + 7
);
_this.fileData.ext = ext;
console.log("fileJson", _this.fileData);
};
reader.readAsDataURL(file);
},
// 确认导入
confirmImport() {
this.isLoading = true;
let parmas = {
base64: this.fileData,
type: ''
}
uploadShieldExcel(parmas, this.projectId).then(res => {
if (res.code == '000000') {
if (res.data == '') {
this.isLoading = false;
this.isShowImport = false;
this.$message({
message: '导入成功',
type: 'success'
});
} else {
let a = document.createElement('a');
let href = res.data;
a.setAttribute('href',href);
a.click();
this.isLoading = false;
this.$message.error('导入失败');
}
} else {
this.isLoading = false;
this.$message.error(res.message);
}
}).catch(error => {
this.isLoading = false;
this.$message.error(error.message);
})
},
// 取消导入
cancelImport() {
this.fileData = {
file: "",
fileName: "",
};
this.isShowImport = false;
},
handleChange(value) {
let areaId = "000";
for (let i = 0; i < value.length; i++) {
......
此差异已折叠。
......@@ -162,16 +162,40 @@
</template>
</el-table-column>
<el-table-column label="操作" min-width="230" align="center" fixed="right">
<!-- <template slot-scope="scope">-->
<!-- <div>-->
<!-- <el-button v-if="scope.row.tradeStore.storeType == 1 && scope.row.tradeStore.certifyStatus == 3" @click="setPrice(scope.row, false)" type="text" size="small">设置分佣</el-button>-->
<!-- <el-button @click="editShop(scope.row, 'true')" type="text" size="small">查看</el-button>-->
<!-- <el-button v-if="scope.row.tradeStore.storeType == 1 && scope.row.tradeStore.certifyStatus > 2" @click="editShop(scope.row, 'false')" type="text" size="small">编辑</el-button>-->
<!-- <el-button v-if="checkIsEdit(scope.row)" @click="shopManage(scope.row)" type="text" size="small">商品管理</el-button>-->
<!-- <el-button v-if="checkIsEdit(scope.row)" @click="orderManage(scope.row)" type="text" size="small">订单管理</el-button>-->
<!-- <el-button v-if="scope.row.tradeStore.storeType == 1 && scope.row.tradeStore.certifyStatus == 3"@click="setFreight(scope.row)" type="text" size="small">运费配置</el-button>-->
<!-- <el-button v-if="scope.row.tradeStore.storeType == 3" @click="closeShopAction(scope.row)" type="text" size="small">关闭店铺</el-button>-->
<!-- </div>-->
<!-- </template>-->
<template slot-scope="scope">
<div>
<el-button v-if="scope.row.tradeStore.commissionFlag == 2" @click="setPrice(scope.row, false)" type="text" size="small">设置分佣</el-button>
<el-button v-if="scope.row.tradeStore.storeStatus <= 2" @click="editShop(scope.row, 'true')" type="text" size="small">{{scope.row.tradeStore.storeStatus <= 2 ? '查看' : ''}}</el-button>
<el-button v-if="checkIsEdit(scope.row)" @click="editShop(scope.row, 'false')" type="text" size="small">编辑</el-button>
<el-button @click="shopManage(scope.row)" type="text" size="small">商品管理</el-button>
<el-button @click="orderManage(scope.row)" type="text" size="small">订单管理</el-button>
<el-button v-if="scope.row.tradeStore.commissionFlag == 2" @click="setFreight(scope.row)" type="text" size="small">运费配置</el-button>
<el-button v-if="storageIdType == 1 && (scope.row.tradeStore.storeType == 3 && scope.row.tradeStore.storeStatus == 1)" @click="closeShopAction(scope.row)" type="text" size="small">关闭店铺</el-button>
<el-button @click="editShop(scope.row, 'true')" type="text" size="small">查看</el-button>
<el-button v-if="checkIsEdit(scope.row)" checkIsEdit @click="editShop(scope.row, 'false')" type="text" size="small">编辑</el-button>
<el-button v-if="checkGoods(scope.row)" @click="shopManage(scope.row)" type="text" size="small">商品管理</el-button>
<el-button v-if="checkBills(scope.row)" @click="orderManage(scope.row)" type="text" size="small">订单管理</el-button>
<el-button v-if="checkSpe(scope.row)" @click="setPrice(scope.row, false)" type="text" size="small">设置分佣</el-button>
<el-button v-if="checkSpe(scope.row)" @click="setFreight(scope.row)" type="text" size="small">运费配置</el-button>
<el-button v-if="scope.row.tradeStore.storeType == 3 && isOutsideGetted == 'no'" @click="closeShopAction(scope.row)" type="text" size="small">关闭店铺</el-button>
</div>
</template>
</el-table-column>
......@@ -249,12 +273,14 @@
import { openLoading, closeLoading } from "../../utils/utils";
import BreadCrumb from "@/components/breadcrumb.vue";
import { queryStore, queryShopAuth, closeShop } from '@/utils/shop';
import { getUserTypeReq } from "@/utils/cme/cmeApi";
export default {
components: {
BreadCrumb
},
data(){
return{
isOutsideGetted: 'no',
curmbFirst: '云鹊店铺',
showAllFlag: false,
showNewFlag: false,
......@@ -302,13 +328,17 @@
}],
storeTypeList: [
{
value: 1,
label: "待完善"
},
{
value: 2,
label: "认证提交中"
label: "待审核"
},
{
value: 3,
label: "认证通过"
label: "审核通过"
},
{
value: 4,
......@@ -348,6 +378,7 @@
// this.idType = localStorage.getItem("storageIdType");
this.storageIdType = localStorage.getItem("storageIdType") - 0;
console.log(this.storageIdType);
this.getUserTypeReq();
this.getAddAuth();
this.searchList();
},
......@@ -360,6 +391,15 @@
}
})
},
getUserTypeReq () {
getUserTypeReq().then(res => {
console.log('--res', res);
if(res.code == '000000'){
this.isOutsideGetted = res.data.code;
}
});
},
searchList() {
openLoading(this);
let params = this.searchForm;
......@@ -669,14 +709,48 @@
},
checkIsEdit (row){
const {storeType, certifyStatus} = row.tradeStore;
if(storeType == 3 && certifyStatus == 1){
if(storeType == 1 && Number(certifyStatus) > 2){
return true;
}else if(storeType == 2){
return true;
}else{
return false;
}
},
checkGoods(row) {
const {storeType, certifyStatus} = row.tradeStore;
if(storeType == 1 && Number(certifyStatus) === 3){
return true
}else if(storeType != 3 && certifyStatus>2){
}else if(storeType == 2){
return true
}else {
}else if(storeType == 3){
if(Number(certifyStatus) == 1 || Number(certifyStatus) == 3){
return true;
}else{
return false;
}
}else{
return false;
}
},
checkBills(row) {
const {storeType, certifyStatus} = row.tradeStore;
if(storeType == 1 && Number(certifyStatus) !== 3){
return false;
}else{
return true;
}
}
},
checkSpe(row) {
const {storeType, certifyStatus} = row.tradeStore;
if(storeType == 1 && Number(certifyStatus) == 3){
return true;
}else if(storeType == 2){
return true;
}else{
return false;
}
},
},
filters: {
storeTypeFormat: function(value){
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册