提交 b2d86fab authored 作者: huaxinzhu's avatar huaxinzhu

1、入驻,获取品牌信息

2、变动金额修复
3、资产-账户管理-限制最多增加3条数据
4、运费-运费模板-新增优化,批量删除修复
5、商品-上架商品-增加商品下架功能
6、拦截器优化,抛出所有错误提示
上级 c510ab4d
# 开发环境配置
ENV = 'development'
# gfast管理系统/开发环境
# 正式环境
VUE_APP_BASE_API = 'http://sjapi.jxhh.com'
# 达叔 开发环境
#VUE_APP_BASE_API = 'http://192.168.111.32:8200'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true
......@@ -15,11 +15,11 @@ const service = axios.create({
// request拦截器
service.interceptors.request.use(config => {
// 是否需要设置 token
const isToken = (config.headers || {}).isToken === false;
const isToken = (config.headers || {}).isToken === false
if (getToken() && !isToken) {
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
}
//config.headers['Authorization'] = 'Bearer ' + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dpbk5hbWUiOiIxNTcxMTEzOTg5NSIsInVpZCI6NTI4MjgsImNoYW5uZWxJZCI6MCwiZXhwIjoxNjE5Njc2MDMzLCJpc3MiOiJnaW4tYmxvZyJ9.ccnrAoIMRLQV1MAAII6J3F7ATnFDjcgUnMw6VoKuRA0'
//config.headers['Authorization'] = 'Bearer ' + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dpbk5hbWUiOiIxNTcxMTEzOTg5NSIsInVpZCI6NTI4MjgsImNoYW5uZWxJZCI6MCwiZXhwIjoxNjE5NzQ4NzcxLCJpc3MiOiJnaW4tYmxvZyJ9.sAefBY0yvwxkQN3f6VjiYZellZasfLs7oRLGFi83BBA'
return config
}, error => {
console.log("25reject");
......@@ -30,19 +30,36 @@ service.interceptors.request.use(config => {
service.interceptors.response.use(res => {
// 未设置状态码则默认成功状态
const code = res.data.code || 200;
// 返回所有数据的统一处理
const data = res.data;
// 获取错误信息
const message = errorCode[code] || res.data.msg || errorCode['default']
if (code === 401 || code == 99999) {
MessageBox.confirm(
'登录状态已过期,您可以继续留在该页面,或者重新登录',
'系统提示',
{
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
const message = errorCode[code] || res.data.msg || errorCode['default'];
// 200,1意味着成功返回数据
if(code === 200 || code === 1) {
if( res.data ) {
return res.data
} else {
if( message ) {
Message({message: message, type: 'error'});
}else {
Message({message: '后台数据出错了!', type: 'error'});
}
).then(() => {
return Promise.reject('error');
}
}
else if( code === 500) {
Message({
message: message,
type: 'error'
})
return Promise.reject(new Error(message));
}
else if(code === 401 || code == 99999) {
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
store.dispatch('LogOut').then(() => {
location.reload() // 为了重新实例化vue-router对象 避免bug
})
......@@ -86,7 +103,7 @@ service.interceptors.response.use(res => {
message: message,
type: "error"
});
// console.log(message);
console.log(message);
// --- end ---- 开发时候用这段,把错误彻底抛出来 --- end ---
// --- start --- 正式上线,隐藏报错信息 ----- start ----
......@@ -101,6 +118,7 @@ service.interceptors.response.use(res => {
// }, 1000);
// --- end --- 正式上线,隐藏报错信息 ----- end ----
return Promise.reject(error)
}
)
......
......@@ -487,8 +487,8 @@
//this.resetForm();
getBrandsInf().then(res => {
console.log("获取品牌:",res);
if(res.code === 1 && res.data) {
this.brandForm = res.data[0];
if(res.code === 1 && res.data.data) {
this.brandForm = res.data.data[0];
// 商标logo图片处理
let brandList = {};
let brandArr = [];
......
......@@ -7,7 +7,7 @@
<el-table v-loading="loading" :height="tableHeight" :data="assetList">
<el-table-column label="ID" align="center" prop="Id"/>
<el-table-column label="流水订单号" align="center" prop="BalanceSn"/>
<el-table-column label="变动金额" align="center" :formatter="formatMoney" prop="ChangeMoney"/>
<el-table-column label="变动金额" align="center" prop="ChangeMoney"/>
<el-table-column label="变动类型" align="center" :formatter="formatType" prop="ChangeType"/>
<el-table-column label="时间" align="center" :formatter="formatTime" prop="AddTime"/>
<el-table-column label="描述" align="center" prop="Des"/>
......
......@@ -5,7 +5,7 @@
<span>账户管理</span>
<el-button
style='float:right'
:disabled="!addbank"
:disabled="isAddbank"
type="primary"
icon="el-icon-plus"
size="mini"
......@@ -165,7 +165,7 @@
banktitle: "对公账户(数量最多为3个)",
// 是否显示弹出层
open: false,
addbank: false,
isAddbank: false,
bank: false,
zfb: false,
// 查询参数
......@@ -245,8 +245,10 @@
this.bankcardList = response.data.list;
//console.log(this.bankcardList)
this.total = response.data.total;
if (this.total < 3) {
this.addbank = true
if (this.total >= 3) {
this.isAddbank = true;
}else {
this.isAddbank = false;
}
this.loading = false;
});
......
......@@ -2,7 +2,7 @@
<div class="app-container">
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>提现记录</span>
<span>运费模板</span>
<el-button
style="float:right;margin-left: 10px;"
......@@ -13,15 +13,15 @@
@click="handleDelete"
>删除
</el-button>
<el-button
style="float:right;"
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改
</el-button>
<!-- <el-button-->
<!-- style="float:right;"-->
<!-- type="success"-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- >修改-->
<!-- </el-button>-->
<el-button
style="float:right;margin-left: 20px;"
type="primary"
......@@ -35,13 +35,11 @@
<el-table v-loading="loading" :data="freightList" :height="tableHeight" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="ID" align="center" prop="Id"/>
<el-table-column label="模板名称" align="center" prop="Name"/>
<el-table-column label="排序" align="center" prop="Sort"/>
<el-table-column label="是否是默认模板" align="center" :formatter="formatDefault" prop="IsDefault"/>
<el-table-column label="类型" align="center" :formatter="formatType" prop="ChargeType"/>
<el-table-column label="是否是默认" align="center" prop="Publish"/>
<el-table-column label="启用状态" align="center" :formatter="formaStatus" prop="Publish"/>
<el-table-column label="创建时间" align="center" :formatter="formatTime" prop="Created"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
......@@ -70,8 +68,8 @@
@pagination="getList"
/>
<!-- 添加或修改freight对话框 -->
<el-dialog :title="title" :visible.sync="open" v-if="open" width="90%" append-to-body>
<IndexBtn :option="form"/>
<el-dialog :title="title" :visible.sync="isOpen" v-if="isOpen" width="70%">
<IndexBtn :option="form" @closeIndexbtn="closeDialog"/>
</el-dialog>
</el-card>
</div>
......@@ -104,7 +102,7 @@
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
isOpen: false,
// 查询参数
queryParams: {
pageNum: 1,
......@@ -142,11 +140,26 @@
},
watch: {
fullHeight(val, oldval) {
console.log(val)
this.tableHeight = val - 130
}
},
methods: {
closeDialog(val) {
this.isOpen = val;
this.getList();
},
// 模板是否启用状态
formaStatus(row) {
let isPublish = row.Publish;
let publish = '';
if(isPublish === 1) {
publish = '启用';
}
if(isPublish === 0) {
publish = '禁用';
}
return publish
},
formatType(row) {
var typese = row.ChargeType
var optDess = ''
......@@ -188,7 +201,7 @@
},
// 取消按钮
cancel() {
this.open = false;
this.isOpen = false;
this.reset();
},
// 表单重置
......@@ -220,14 +233,18 @@
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.ids = selection.map(item => item.Id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
if(this.total >= 20) {
this.$message({ message: '您已经有20个运费模板了,暂时不再支持更多哦!',type: 'warning'});
return;
}
this.reset();
this.open = true;
this.isOpen = true;
this.form = {
Id: 0,
Sort: 0,
......@@ -245,19 +262,18 @@
],
Disdispatching: "",
Publish: 0,
},
this.title = "添加运费模板";
};
this.title = "添加运费模板";
},
/** 修改按钮操作 */
handleUpdate(row) {
console.log(row)
this.reset();
const id = row.Id
getFreight(id).then(response => {
let formdate = response.data
response.data.Dispatching = JSON.parse(formdate.Dispatching)
this.form = response.data
this.open = true;
this.isOpen = true;
this.title = "修改运费模板";
});
},
......@@ -269,7 +285,7 @@
updateFreight(this.form).then(response => {
if (response.code === 0) {
this.msgSuccess("修改成功");
this.open = false;
this.isOpen = false;
this.getList();
}
});
......@@ -277,7 +293,7 @@
addFreight(this.form).then(response => {
if (response.code === 0) {
this.msgSuccess("新增成功");
this.open = false;
this.isOpen = false;
this.getList();
}
});
......@@ -285,10 +301,12 @@
}
});
},
/*
* publish 启用禁用状态 1是启用,0 禁用
* */
/** 删除按钮操作 */
handleDelete(row) {
console.log(row)
const ids = row.Id
const ids = row.Id || this.ids;
this.$confirm('是否确认删除运费模板编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
......@@ -298,8 +316,7 @@
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(function () {
});
}).catch(function () {});
},
} //methods结束
};
......
......@@ -105,7 +105,6 @@
</el-row>
</el-form-item>
<el-form-item label="不配送区域">
<p>
<el-input
v-model="goodsDate.Disdispatching"
placeholder=""
......@@ -118,7 +117,6 @@
>
</template>
</el-input>
</p>
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="goodsDate.Publish">
......@@ -126,13 +124,11 @@
<el-radio :label="0">禁用</el-radio>
</el-radio-group>
</el-form-item>
<el-button class="btns" type="primary" @click="handleinfomationclick()">提交</el-button
<el-button class="btns" type="primary" @click="handleinfomationclick()"> </el-button
>
</el-form>
<el-dialog title="提示" :visible.sync="dialogVisible" width="30%">
<el-dialog title="选择不配送省" :visible.sync="dialogVisible" width="30%" append-to-body>
<div>
<el-checkbox-group v-model="checkList">
<el-checkbox
......@@ -145,9 +141,7 @@
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="btndisabled()"
>确 定</el-button
>
<el-button type="primary" @click="btndisabled()">确 定</el-button>
</span>
</el-dialog>
</div>
......@@ -247,54 +241,43 @@ export default {
},
opendias(type, i, index) {
let _this = this
this.goodsDate.Dispatching.forEach((element) => { //获取初始化数据已选中
this.goodsDate.Dispatching.forEach((element) => {
let arrd = element.a.split(',')
for(let i=0;i<arrd.length;i++){
this.disabledate.push(arrd[i]);
this.disabledate.push(arrd[i]);
}
});
let arr = this.goodsDate.Disdispatching.split(',');
for(let i=0;i<arr.length;i++){
this.disabledate.push(arr[i]);
}
this.btnindex = index;
this.arrlist.forEach(item =>{
item.value = false;
})
this.checkList = type.split(",");
let arr = this.goodsDate.Disdispatching.split(',')
for(let i=0;i<arr.length;i++){ //获取初始化数据不配送
this.disabledate.push(arr[i]);
}
this.btnindex = index
this.arrlist.forEach(item =>{
item.value = false
})
this.checkList = type.split(",");
let disabledates = JSON.parse(JSON.stringify(this.disabledate)); //可以将json对象转换成json对符串
let disabarr = this.unique(disabledates,this.checkList) //去掉当前选择的disabled效果
this.arrlist.forEach(item =>{
if (disabarr.includes(item.lable)) {
item.value = true
}
})
console.log(disabarr)
// 区域选择
if (i == 0) {
//配送区域
let disabledates = JSON.parse(JSON.stringify(this.disabledate)); //可以将json对象转换成json对符串
let disabarr = this.unique(disabledates,this.checkList) //去掉当前选择的disabled效果
this.arrlist.forEach(item =>{
if (disabarr.includes(item.lable)) {
item.value = true
}
})
} else {
//不配送区域
}
this.dialogVisible = true;
},
handleinfomationclick() {//提交
console.log(this.goodsDate)
this.goodsDate.Disdispatching.forEach(item=>{
item.np = Number(item.np*100).toFixed()
})
addFreight(this.goodsDate).then(response => {
console.log(296,response);
if(response.data.code === 1) {
this.$message({ message: '新增成功!', type: 'success'});
this.$emit("closeIndexbtn",false);
}
if(response.data.code == 1){
alert(response.data.msg);
}
this.loading = false;
});
},
......@@ -372,7 +355,7 @@ li {
border-bottom: 1px solid #e6ebf5;
}
.btns{
width:500px;
width:180px;
margin:0 auto;
display: block;
}
......
......@@ -18,10 +18,18 @@
type="success"
icon="el-icon-edit"
size="mini"
@click="handleOnsale"
>修改</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button
type="success"
icon=""
size="mini"
@click="handleOffGoods"
>商品下架
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
......@@ -100,7 +108,7 @@
</template>
<script>
import IndexBtn from '../add'
import { listGoods, getGoods, delGoods, addGoods, updateGoods } from '@/api/module/goods'
import { listGoods, getGoods, delGoods, addGoods, updateGoods, Onsale } from '@/api/module/goods'
export default {
name: "goods",
data() {
......@@ -156,6 +164,25 @@ export default {
}
},
methods: {
/*商品下架*/
handleOffGoods(row) {
const rowIds = row.roleId || this.ids;
let params = {"ids": rowIds, "status": 0};
if(!rowIds || rowIds.length === 0) {
this.$message({ message: '请先选择要下架的商品数据', type: 'warning'});
return;
}
this.$confirm('是否确认下架商品ID为"' + rowIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return Onsale(params);
}).then(() => {
this.getList();
this.msgSuccess("下架成功");
})
},
//格式化价格
formatePrice(row,s,value,i){
var nm =0
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论