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

1、入驻,获取品牌信息

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