提交 d9b05ecf authored 作者: 王天霸's avatar 王天霸

Merge branch 'dev_hxz' of http://120.27.146.32:8888/wangfulong/shop-new into dev_hxz

......@@ -49,6 +49,6 @@ export function delBankcard(ids) {
return request({
url: '/system/bankcard/delete',
method: 'delete',
data:{ids:ids}
data:{id:ids}
})
}
......@@ -73,6 +73,10 @@ div:focus {
padding-left: 5px;
}
.ml20 {
margin-left: 20px;
}
.block {
display: block;
}
......
......@@ -142,6 +142,10 @@
margin-bottom: 10px;
}
.el-input.is-disabled .el-input__inner {
color: #666;
}
/* text color */
.text-navy {
color: #1ab394;
......@@ -198,3 +202,31 @@
color: #fff!important;
background: #42b983!important;
}
/* 上传图片 */
.upload-img {
display: inline-block;
}
.el-upload--picture-card{
width: 98px;
height: 98px;
}
.el-upload{
width: 98px;
height: 98px;
line-height: 98px;
}
.el-upload-list--picture-card .el-upload-list__item{
width: 98px;
height: 98px;
line-height: 98px;
}
.el-upload-list--picture-card .el-upload-list__item-thumbnail{
width: 98px;
height: 98px;
line-height: 98px;
}
.avatar{
width: 98px;
height: 98px;
}
......@@ -20,7 +20,8 @@ import { getDicts } from "@/api/system/dict/data";
import { getConfigKey } from "@/api/system/config";
import { parseTime, resetForm, addDateRange, selectDictLabel, download, handleTree } from "@/utils/ruoyi";
import Pagination from "@/components/Pagination";
/*hxz0706*/
import { deepClone } from "@/utils/index";
// 全局方法挂载
Vue.prototype.getDicts = getDicts
......@@ -32,6 +33,7 @@ Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.download = download
Vue.prototype.handleTree = handleTree
Vue.prototype.apiUrl = process.env.VUE_APP_BASE_API
Vue.prototype.deepClone = deepClone
Vue.prototype.msgSuccess = function (msg) {
this.$message({ showClose: true, message: msg, type: "success" });
......
......@@ -19,7 +19,7 @@ service.interceptors.request.use(config => {
if (getToken() && !isToken) {
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
}
//config.headers['Authorization'] = 'Bearer ' + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dpbk5hbWUiOiIxNTcxMTEzOTg5NSIsInVpZCI6NTI4MjgsImNoYW5uZWxJZCI6MCwiZXhwIjoxNjE5ODMzMzk3LCJpc3MiOiJnaW4tYmxvZyJ9.rh-WXSaFqgqY611Tm5dhba532OYEZvm06vUmgZknoy4'
//config.heaoYW5uZWxJZCI6MCwiZXhwIjoxNjE5ODMzMzk3LCJpc3MiOiJnaW4tYmxvZyJ9.rh-WXSaFqgqY611Tm5dhba532OYEZvm06vUmgZknoy4'
return config
}, error => {
console.log("25reject");
......@@ -28,33 +28,28 @@ service.interceptors.request.use(config => {
// 响应拦截器
service.interceptors.response.use(res => {
// 未设置状态码则默认成功状态
const code = res.data.code || 200;
// debugger
let code = res.data.code
if(res.data.code !== 0) {
code = res.data.code || 200;
} else {
code = 0;
}
// 返回所有数据的统一处理
const data = res.data;
// 获取错误信息
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'});
}
return Promise.reject('error');
}
}
else if( code === 500) {
const message = errorCode[code] || res.data.message || errorCode['default'];
if(code === 1 || code === 200) {
return res.data
} else if( code === 500 || code === 0) {
Message({
message: message,
type: 'error'
})
return Promise.reject(new Error(message));
}
else if(code === 401 || code == 99999) {
} else if(code === 401 || code == 99999) {
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
confirmButtonText: '重新登录',
cancelButtonText: '取消',
......@@ -64,30 +59,21 @@ service.interceptors.response.use(res => {
location.reload() // 为了重新实例化vue-router对象 避免bug
})
})
} else if (code === 500) {
Message({
message: message,
type: 'error'
})
return Promise.reject(new Error(message))
} else if (code !== 200 && code !== 1) {
} else {
Notification.error({
title: message
})
return Promise.reject('error')
store.dispatch('LogOut').then(() => {
var ssa = window.location.host;
// setTimeout(function (){
if (ssa == 'localhost:1024') {
window.location.href = 'http://sso.jxhh.com/logout?redirect=http://' + ssa
} else {
window.location.href = 'http://sso.jxhh.com/logout?redirect=http://' + ssa
}
// }, 1000)
// location.reload() // 为了重新实例化vue-router对象 避免bug
})
} else if (code === 200 || code === 1 ) {
return res.data
}
}, error => {
// --- start ---- 开发时候用这段,把错误彻底抛出来 --- start ---
......@@ -103,11 +89,8 @@ service.interceptors.response.use(res => {
message: message,
type: "error"
});
// console.log(message);
// --- end ---- 开发时候用这段,把错误彻底抛出来 --- end ---
// --- start --- 正式上线,隐藏报错信息 ----- start ----
// let ssa = window.location.host;
// setTimeout(function () {
// if (ssa == 'localhost:1024') {
......@@ -116,9 +99,7 @@ service.interceptors.response.use(res => {
// window.location.href = 'http://sso.jxhh.com/logout?redirect=http://' + ssa
// }
// }, 1000);
// --- end --- 正式上线,隐藏报错信息 ----- end ----
return Promise.reject(error)
}
)
......
......@@ -326,7 +326,7 @@
upLoadImg(data).then((res) => {
if(res && res.data.code == 1){
this.licenseImgFileList.push({'url':res.data.data.imageUrl});
this.$message('上传成功');
this.$message({type: 'success',message:'上传成功'});
this.$refs.mainForm.clearValidate('license');
}
});
......
......@@ -149,11 +149,14 @@ export default {
let money = []
let count = []
let actual = []
response.data.line.forEach(function(item, index) {
money.unshift(item.price)
actual.unshift(item.date)
count.unshift(item.count)
})
if(response.data.line && response.data.line.length > 0) {
response.data.line.forEach(function(item, index) {
money.unshift(item.price)
actual.unshift(item.date)
count.unshift(item.count)
})
}
//最大订单数
var maxOrderNum=this.lineChartData.maxChannelData;
for(var n=1;n<count.length;n++){
......@@ -185,7 +188,7 @@ export default {
});
},
handleSetLineChartData(type) {
console.log("type",type)
//console.log("type",type)
this.lineChartData = lineChartData[type]
}
}
......
......@@ -13,10 +13,11 @@
gotosso() {
var ticket = this.$route.query.ticket;
this.$store.dispatch('Login', {"ticket": ticket}).then((res) => {
if (res.token != "") {
// 获取客户是否有审核信息
getShopInf().then(res => {
if(res.code === 1) {
//if(res.code === 1) {
switch(res.data.state) {
case 0:
switch(res.data.status){
......@@ -45,21 +46,25 @@
});
break;
}
}else {
if(res && res.msg) {
Notification.error({
title: '提示:',
message: res.msg
})
}else {
Notification.error({
title: '提示:',
message: '刷新浏览器后,再次登录,若仍不行,请联系我们!'
})
}
}
});
//}
// else {
// if(res && res.msg) {
// Notification.error({
// title: '提示:',
// message: res.msg
// })
// }else {
// Notification.error({
// title: '提示:',
// message: '刷新浏览器后,再次登录,若仍不行,请联系我们!'
// })
// }
// }
});
} else {
this.$store.dispatch('Statistic')
this.$store.dispatch('FedLogOut')
......@@ -73,8 +78,7 @@
}, 1000)
}
this.loading = false
})
.catch(() => {
}).catch(() => {
this.$store.dispatch('FedLogOut')
var ssa = window.location.host
setTimeout(function () {
......
......@@ -34,7 +34,7 @@
return {
fullHeight: 0,
tableHeight: 0,
loading: true, // 遮罩层
loading: false, // 遮罩层
ids: [], // 选中数组
total: 0, // 总条数
assetList: [], // 商户余额变动日志表格数据
......@@ -93,12 +93,9 @@
},
/** 查询商户余额变动日志列表 */
getList() {
this.loading = true;
//console.log("重点注意shopid", this.queryParams)
listAsset(this.queryParams).then(response => {
this.assetList = response.data.list;
this.total = response.data.total;
this.loading = false;
listAsset(this.queryParams).then(res => {
this.assetList = res.data.list;
this.total = res.data.total;
});
},
// 取消按钮
......
<template>
<div class="app-container">
<div class="app-container" v-loading="loading">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-row :span="24" type="flex" align="middle" justify="space-between">
......@@ -20,18 +20,17 @@
</el-row>
</div>
<el-table v-loading="loading" :height="tableHeight" :data="bankcardList"
<el-table :height="tableHeight" :data="bankcardList"
@selection-change="handleSelectionChange">
<el-table-column label="商户ID" align="center" prop="Id"/>
<el-table-column label="开户名" align="center" prop="BankAccountName"/>
<el-table-column label="城市名" align="center" prop="ProvinceCity"/>
<el-table-column label="银行名称" align="center" prop="BankName"/>
<el-table-column label="开户行" align="center" prop="Kaihuhang"/>
<el-table-column label="户名" align="center" prop="BankAccountName"/>
<el-table-column label="账号" align="center" prop="BankAccountNo"/>
<el-table-column label="商户ID" align="center" prop="id"/>
<el-table-column label="开户名" align="center" prop="bank_account_name"/>
<!-- <el-table-column label="城市名" align="center" prop="ProvinceCity"/>-->
<el-table-column label="银行名称" align="center" prop="bank_name"/>
<el-table-column label="开户行" align="center" prop="bank_branch_name"/>
<el-table-column label="账号" align="center" prop="bank_account_sn"/>
<!-- <el-table-column label="支付宝账户名称" align="center" prop="ZfbAccountName" />-->
<!-- <el-table-column label="支付宝账户" align="center" prop="ZfbAccount" />-->
<el-table-column label="类型" :formatter="btypa" align="center" prop="State"/>
<!-- <el-table-column label="类型" :formatter="btypa" align="center" prop="State"/>-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
......@@ -67,19 +66,19 @@
<!-- </el-dialog>-->
<el-dialog :visible.sync="bank" :title="banktitle">
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
<el-row>
<el-col :span="16" :offset="3">
<el-form-item label="开户城市" prop="ProvinceCity">
<el-input v-model="form.ProvinceCity" placeholder="请输入城市名和商户提交时一致"/>
</el-form-item>
</el-col>
</el-row>
<el-form ref="form" :model="form" :rules="rules" label-width="90px" size="small">
<!-- <el-row>-->
<!-- <el-col :span="16" :offset="3">-->
<!-- <el-form-item label="开户城市" prop="ProvinceCity">-->
<!-- <el-input v-model="form.ProvinceCity" placeholder="请输入城市名和商户提交时一致"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row>
<el-col :span="16" :offset="3">
<el-form-item label="银行名称">
<el-select v-model="form.BankName" placeholder="状态" style="width: 100%">
<el-select v-model="form.bankName" placeholder="状态" style="width: 100%">
<el-option v-for="item in bankList" :key="item.value" :label="item.value"
:value="item.value"></el-option>
</el-select>
......@@ -89,32 +88,32 @@
<el-row>
<el-col :span="16" :offset="3">
<el-form-item label="开户行" prop="kaihuhang">
<el-input v-model="form.kaihuhang" placeholder="请输入开户行"/>
<el-form-item label="开户行" prop="bank_branch_name">
<el-input v-model="form.bank_branch_name" placeholder="请输入开户行"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="16" :offset="3">
<el-form-item label="户名" prop="BankAccountName">
<el-input v-model="form.BankAccountName" placeholder="请输入户名"/>
<el-form-item label="户名" prop="bankAccountName">
<el-input v-model="form.bankAccountName" placeholder="请输入户名"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="16" :offset="3">
<el-form-item label="账号" prop="BankAccountNo">
<el-input v-model="form.BankAccountNo" placeholder="请输入账号"/>
<el-form-item label="账号" prop="BankAccountSn">
<el-input v-model="form.BankAccountSn" placeholder="请输入账号"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
<el-button @click="cancel" size="small">取 消</el-button>
<el-button type="primary" @click="submitForm" size="small">确 定</el-button>
</div>
</el-dialog>
......@@ -152,7 +151,7 @@
//银行
bankList: [],
// 遮罩层
loading: true,
loading: false,
// 选中数组
ids: [],
// 非单个禁用
......@@ -216,8 +215,10 @@
methods: {
//获取银行名称列表
getBankNameList() {
listBankname().then(response => {
this.bankList = response.data
listBankname().then(res => {
if(res.data) {
this.bankList = res.data
}
});
},
//类型改变
......@@ -245,17 +246,15 @@
},
/** 查询商户银行卡列表 */
getList() {
this.loading = true;
listBankcard(this.queryParams).then(response => {
this.bankcardList = response.data.list;
//console.log(this.bankcardList)
this.total = response.data.total;
this.bankcardList = response.data.data;
// debugger
this.total = response.data.count;
if (this.total >= 3) {
this.isAddbank = true;
}else {
this.isAddbank = false;
}
this.loading = false;
});
},
// 取消按钮
......@@ -307,10 +306,12 @@
this.$refs["form"].validate(valid => {
if (valid) {
this.form.sellerId = this.queryParams.sellerId;
this.form.TxType = 1;
// this.form.TxType = 1;
this.loading = true;
addBankcard(this.form).then(response => {
if (response.code === 0) {
if (response.code === 1) {
this.msgSuccess("新增成功");
this.loading = false;
this.open = false;
this.bank = false;
this.zfb = false;
......@@ -323,18 +324,20 @@
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.Id
const ids = row.id
this.$confirm('是否确认删除商户银行卡编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return delBankcard(ids);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(function () {
});
}).then(async() => {
this.loading = true;
let result = await delBankcard(ids);
if(result.code === 1) {
this.$message({type:'success',message:'删除成功'});
this.getList()
}
this.loading = false;
}).catch(()=> {});
},
} //methods结束
};
......
......@@ -65,8 +65,8 @@
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.page"
:limit.sync="queryParams.limit"
@pagination="getList"
/>
<!-- 添加或修改商户账单对话框 -->
......@@ -122,7 +122,7 @@
isBlance: true,
billId: 0,
// 遮罩层
loading: true,
loading: false,
// 选中数组
ids: [],
// 非单个禁用
......@@ -142,8 +142,8 @@
sellerId: 0,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
page: 1,
limit: 10,
shopId: 0,
money: null,
org_money: null,
......@@ -209,11 +209,9 @@
},
/** 查询商户账单列表 */
getList() {
this.loading = true;
listVerifyrecord(this.queryParams).then(response => {
this.verifyrecordList = response.data.list;
this.total = response.data.total;
this.loading = false;
this.verifyrecordList = response.data.data;
this.total = response.data.count;
});
},
// 取消按钮
......@@ -244,7 +242,7 @@
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.queryParams.page = 1;
this.getList();
},
/** 重置按钮操作 */
......
......@@ -189,6 +189,7 @@
this.form.money = event.target.value;
let numRegExp = /^[0-9]+(.[0-9]{2})?$/;
let numberMoney = Number(this.form.money);
//debugger
let numberCash = Number(this.drawableCash);
if(this.form.money !== '') {
if(!numRegExp.test(this.form.money)) {
......@@ -210,8 +211,8 @@
},
//获取商户的信息
getSellerInfoFn() {
const sellerid = this.sellerId;
getSellerInfo({sellerId: sellerid}).then(response => {
const sellerId = this.sellerId;
getSellerInfo({sellerId: sellerId}).then(response => {
this.sellerinfo = response.data;
this.sellerinfo.Balance = response.data.Balance / 100;
this.sellerinfo.FrozenMoney = response.data.FrozenMoney / 100;
......@@ -221,7 +222,7 @@
//获取商户的银行卡列表
getBankcardList() {
getBankcardList({sellerId: this.sellerId}).then(response => {
this.banklist = response.data.list;
this.banklist = response.data.data;
});
},
......@@ -247,7 +248,6 @@
if (valid) {
let numberMoney = Number(this.form.money);
let numberCash = Number(this.drawableCash);
this.form.sellerId = this.sellerId;
// 再次校验 提现信息
if(!this.form.sellerId) {
......@@ -258,10 +258,12 @@
this.$message({type: 'error',message: '提现金额不能小于100'});
return;
}
if(this.form.money > this.drawableCash ) {
if(numberMoney > numberCash ) {
this.$message({type: 'error',message: '提现金额不足!'});
return;
}
// this.form.verifycode = Number(this.form.verifycode);
addWithdrawlog(this.form).then(response => {
if (response.code == 0) {
this.msgSuccess(response.msg);
......
......@@ -23,8 +23,8 @@
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
:page.sync="queryParams.page"
:limit.sync="queryParams.limit"
@pagination="getList"
/>
</el-card>
......@@ -48,7 +48,7 @@
fullHeight: 0,
tableHeight: 0,
// 遮罩层
loading: true,
loading: false,
// 选中数组
ids: [],
// 非单个禁用
......@@ -67,8 +67,8 @@
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
page: 1,
limit: 10,
sellerId: 0,
},
// 表单参数
......@@ -128,18 +128,14 @@
},
/** 查询商户提现列表 */
getList() {
this.loading = true;
this.queryParams.sellerId = this.sellerId;
//console.log(127, this.queryParams);
listWithdrawlog(this.queryParams).then(response => {
if (response) {
this.withdrawlogList = response.data.list;
this.total = response.data.total;
this.withdrawlogList = response.data.data;
this.total = response.data.count;
} else {
this.$message({message: '数据出错啦!', type: 'error'});
}
this.loading = false;
});
},
// 取消按钮
......
......@@ -85,7 +85,7 @@
fullHeight: 0,
tableHeight: 0,
// 遮罩层
loading: true,
loading: false,
// 选中数组
ids: [],
// 非单个禁用
......@@ -192,11 +192,11 @@
},
/** 查询freight列表 */
getList() {
this.loading = true;
listFreight(this.queryParams).then(response => {
this.freightList = response.data.data.list;
this.total = response.data.data.count;
this.loading = false;
listFreight(this.queryParams).then(res => {
if(res.data) {
this.freightList = res.data.list;
this.total = res.data.count;
}
});
},
// 取消按钮
......@@ -317,13 +317,14 @@
}).then(async()=> {
this.loading = true;
let delResult = await delFreight(ids);
this.loading = false;
if(delResult.code === 1) {
this.$message({type: 'success',message: delResult.msg});
this.getList();
}
if(delResult.code === 0) {
this.$message({type: 'error',message: delResult.msg});
}
this.loading = false;
}).catch(()=> {});
},
} //methods结束
......
......@@ -271,9 +271,10 @@ export default {
item.fp= Number(item.fp*100).toFixed();
item.np = Number(item.np*100).toFixed();
})
//console.log(275,this.goodsDate);
addFreight(this.goodsDate).then(response => {
if(response.data.code === 1) {
this.loading = true
addFreight(this.goodsDate).then(res => {
//console.log(275,res);
if(res.code === 1) {
this.$emit("closeIndexbtn",false);
if(this.goodsDate.Id === 0) {
this.$message({ message: '新增成功', type: 'success'});
......
<template>
<div class="app-container">
<el-row :gutter="20">
<el-col :span="4" >
<div class="grid-content bg-purple">
<p>参数</p>
<p style="font-size:12px;">根据商品特性设置相符的商品参数</p>
</div>
</el-col>
<el-col :span="20" style="border-left:2px solid #fff;">
<div class='tablessst'>
<p class="col_p">参数名称</p>
<p class='col_pr'>参数值 拖动行可进行排序</p>
</div>
<div v-for="(item,index) in goodsPram" :key="index" v-dragging="{ list: goodsPram, item: item, group: 'knowTab' }" class='tablesss'>
<p class="col_p"><el-input v-model="item.title" placeholder="如尺码,颜色等" style="width:calc(100% - 20px)"></el-input></p>
<p class='col_pr'>
<el-input v-model="item.value" placeholder="根据参数进行设置, 如 S/M/L/XL/XXl, 或红/黄/蓝" style="width:calc(100% - 200px)"></el-input>
<el-button icon="el-icon-close" style="margin-left:10px;" @click="deletearrinput(index)"></el-button>
<el-button style="margin-left:10px;">拖动排序</el-button>
</p>
</div>
<el-button @click="addguild()" icon="el-icon-plus" style="margin-top:20px;"> 添加参数</el-button>
</el-col>
</el-row>
<!-- <el-button type="primary" @click="handleinfomationclick('ruleForm')">下一步</el-button>-->
<el-button >重置</el-button>
</div>
</template>
<script>
export default {
name: 'goodsmeter',
props: {
parameterdata: {
type: Object,
required: true
}
},
data() {
return {
goodsPram:[{
id:0,
title:'',
value:''
}]
}
},
components:{
'hello':{
render:function(createElement){
return createElement(
'h'+this.level,
this.$se
)
}
}
},
mounted() {
// this.driver = new Driver()
this.$dragging.$on('dragged', (value) => {
//因为我这在排序的时候不需要做处理,所以空着就行
// debugger
})
},
watch:{
goodsPram:{
handler(val, oldVal){
this.$emit('parameterclicks',val)
},
deep:true
},
parameterdata(curVal,oldVal){
if(curVal){
this.goodsPram= curVal
}
}
},
methods: {
handleinfomationclick(formName) {
this.$emit('parameterclicks',this.goodsPram)
},
addguild(){
let arrchild={
id:0,
title:'',
value:''
}
this.$set(this.goodsPram, this.goodsPram.length,arrchild)
},
deletearrinput(index){
this.goodsPram.splice(index,1)
},
}
}
</script>
<style scoped>
.app-container{
width:100%;
height:100%;
background: #f8f8f8;
}
ul,li{
list-style: none;
margin: 0;
padding:0;
}
.ullist{
border: 1px solid #e7eaec;
padding: 10px;
margin-bottom: 10px;
}
.el-input-group{
width:calc(100% - 60px);
}
.col_p{
width:30%;
float:left;
}
.col_pr{
width:70%;
float:left;
}
.tablesss{
height:70px;
border-bottom: 1px solid #e6ebf5;
}
.tablessst{
height:50px;
border-bottom: 1px solid #e6ebf5;
}
</style>
差异被折叠。
<template>
<div class="app-container">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-form :inline="true" class="queryFormInline">
<el-row :span="24" type="flex" align="middle" justify="space-between">
<el-col :span="18">
<p style="font-size: 18px; float:left;">下架商品列表</p>
</el-col>
<el-col :span="6">
<el-form-item style="float: right">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增
</el-button>
<el-button
type="success"
icon="el-icon-edit"
size="mini"
@click="handleOnsale"
>申请上架
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<!-- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="商品ID" prop="goods_id">
<el-input
v-model="queryParams.goods_id"
placeholder="请输入商品ID"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form> -->
<el-table v-loading="loading" :data="goodsList" :height="tableHeight" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="商品主图" align="center" width="100" prop="defaultImage">
<template slot-scope="scope">
<el-image
style="width: 60px; height: 50px"
:src="scope.row.defaultImage"
></el-image>
</template>
</el-table-column>
<el-table-column label="商品ID" align="center" prop="goodsId"/>
<el-table-column label="商品名称" align="center" prop="goodsName"/>
<el-table-column label="协议价" align="center" :formatter="formatePrice" prop="jsPrice"/>
<el-table-column label="物流运费" align="center" :formatter="formatePrice" prop="wlPrice"/>
<el-table-column label="市场售价" align="center" :formatter="formatePrice" prop="scPrice"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleUpdate(scope.row)"
>编辑
</el-button>
<el-divider direction="vertical"></el-divider>
<el-button
size="mini"
type="text"
@click="handleDelete(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改goods对话框 -->
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
<IndexBtn :option="form" @closeDialog="closeDialog"/>
</el-dialog>
</el-card>
</div>
</template>
<script>
import IndexBtn from '../add'
import {listGoods, getGoods, delGoods, addGoods, updateGoods, OffSaleList, Onsale} from '@/api/module/goods'
export default {
name: "goods",
data() {
return {
fullHeight: 0,
tableHeight: 0,
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// goods表格数据
goodsList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
isOnsale: 0
},
// 表单参数
form: {},
// 表单校验
rules: {
goods_name: [
{required: true, message: "商品名称不能为空", trigger: "blur"}
],
}
};
},
components: {
IndexBtn
},
created() {
this.getList();
this.$nextTick(() => {
this.fullHeight = document.getElementsByClassName('box-card')[0].clientHeight
})
},
watch: {
fullHeight(val) {
let formHeight = document.getElementsByClassName('clearfix')[0].clientHeight
this.tableHeight = val - formHeight - 100;
}
},
methods: {
//格式化价格
formatePrice(row, s, value, i) {
var nm = 0
var money = value
if (money > 0) {
nm = money / 100
}
return nm
},
/** 查询goods列表 */
getList() {
this.loading = true;
listGoods(this.queryParams).then(res => {
if(res.code === 1 && res.data) {
this.goodsList = res.data.list;
this.total = res.data.count;
}else if(res.code === 0) {
if(res.msg) {
this.$message({type: 'error',message: res.msg});
}else {
this.$message({type: 'error',message: '数据出错啦!'});
}
}
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.goodsId)
this.single = true
this.multiple = !selection.length
},
/** 上架操作 */
handleOnsale(row) {
const rowIds = row.goodsId || this.ids;
let params = {"ids": rowIds, "status": 1};
if(!rowIds || rowIds.length === 0) {
this.$message({message: '请先选择要上架的商品数据', type: 'warning'});
return;
}
Onsale(params).then(res => {
this.msgSuccess("成功申请" + res.length + "个商品");
});
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push({
path: '/system/goods/add'
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const goods_id = row.goodsId
this.$router.push({
path: '/system/goods/add', query: {goodsId: goods_id}
});
// getGoods(goods_id).then(response => {
// this.form = response.data;
// this.open = true;
// this.title = "修改goods";
// });
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.goods_id != null) {
updateGoods(this.form).then(response => {
if (response.code === 0) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addGoods(this.form).then(response => {
if (response.code === 0) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const goods_ids = row.goodsId || this.ids;
this.$confirm('是否确认删除商品ID为"' + goods_ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return delGoods(goods_ids);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(function () {
});
},
// 子组件关闭父组件对话框
closeDialog(params) {
this.open = params;
}
} //methods结束
};
</script>
<style scoped>
.app-container {
height: 100%;
}
.box-card {
height: 100%;
}
.box-card /deep/ .el-card__body {
height: 100%;
overflow: hidden;
}
.el-table {
height: calc(100% - 120px);
}
/deep/ .el-dialog {
height: 90%;
overflow: hidden;
}
/deep/ .el-dialog__body {
height: 100%;
//height: calc(100% - 20px);
overflow-x: hidden;
overflow-y: scroll;
}
</style>
<template>
<div class="app-container">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-form :model="queryParams" ref="queryForm" :inline="true" class="queryFormInline">
<el-row :span="24" type="flex" align="middle" justify="space-between">
<el-col :span="20">
<el-form-item label="商品Id" prop="goodsId">
<el-input
size="small"
placeholder="请输入商品Id"
v-model="queryParams.goodsId"
></el-input>
</el-form-item>
<el-form-item label="商品名称" prop="goodsName">
<el-input
size="small"
placeholder="请输入商品名称"
v-model="queryParams.goodsName"
></el-input>
</el-form-item>
<el-form-item>
<el-button
size="mini"
type="primary"
icon="el-icon-search"
@click="handleQuery"
>搜索</el-button>
<el-button
size="mini"
icon="el-icon-refresh"
@click="resetQuery('queryForm')"
>重置</el-button>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item style="float: right">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增
</el-button>
<el-button
type="success"
icon=""
size="mini"
@click="handleOffGoods"
>商品下架
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table v-loading="loading" :data="goodsList" :height="tableHeight" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="商品主图" align="center" width="100" prop="defaultImage">
<template slot-scope="scope">
<el-image
style="width: 60px; height: 50px"
:src="scope.row.defaultImage"
></el-image>
</template>
</el-table-column>
<el-table-column label="商品ID" align="center" prop="goodsId"/>
<el-table-column label="商品名称" align="center" prop="goodsName"/>
<el-table-column label="协议价" align="center" :formatter="formatePrice" prop="jsPrice"/>
<el-table-column label="物流运费" align="center" :formatter="formatePrice" prop="wlPrice"/>
<el-table-column label="市场售价" align="center" :formatter="formatePrice" prop="scPrice"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="handleOffGoods(scope.row)"
>下架
</el-button>
<el-divider direction="vertical"></el-divider>
<el-button
size="mini"
type="text"
@click="handleUpdate(scope.row)"
>编辑
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改goods对话框 -->
<el-dialog :title="title" :visible.sync="open" :modal-append-to-body="false" width="90%"
style="height:90%;overflow:hidden;" append-to-body>
<IndexBtn :option="form"/>
</el-dialog>
</el-card>
</div>
</template>
<script>
import IndexBtn from '../add'
import {listGoods, getGoods, delGoods, addGoods, updateGoods, Onsale} from '@/api/module/goods'
export default {
name: "goods",
data() {
return {
fullHeight: 0,
tableHeight: 0,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// goods表格数据
goodsList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
isOnsale: 1,
goodsId: '',
goodsName: ''
},
// 表单参数
form: {},
// 表单校验
rules: {
goods_name: [
{required: true, message: "商品名称不能为空", trigger: "blur"}
],
}
};
},
components: {
IndexBtn
},
created() {
this.getList();
this.$nextTick(() => {
this.fullHeight = document.getElementsByClassName('box-card')[0].clientHeight
})
},
watch: {
fullHeight(val) {
let formHeight = document.getElementsByClassName('clearfix')[0].clientHeight
this.tableHeight = val - formHeight - 100;
}
},
methods: {
/*商品下架*/
handleOffGoods(row) {
const rowIds = row.goodsId || 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("下架成功");
}).catch(() => {
});
},
//格式化价格
formatePrice(row, s, value, i) {
var nm = 0
var money = value
if (money > 0) {
nm = money / 100
}
return nm
},
/** 查询goods列表 */
getList() {
this.loading = true;
listGoods(this.queryParams).then(res => {
if(res.code === 1 && res.data) {
this.goodsList = res.data.list;
this.total = res.data.count;
}else if(res.code === 0) {
if(res.msg) {
this.$message({type: 'error',message: res.msg});
}else {
this.$message({type: 'error',message: '数据出错啦!'});
}
}
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.goodsId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 下架操作 */
handleOnsale() {
Onsale({"ids": this.ids, "status": 0}).then(response => {
this.msgSuccess("成功申请" + response.data.length + "个商品");
});
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push({
path: '/system/goods/add'
});
},
/** 详情按钮操作 */
handleUpdate(row) {
const goods_id = row.goodsId
this.$router.push({
path: '/system/goods/add', query: {goodsId: goods_id}
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.goodsId != null) {
updateGoods(this.form).then(response => {
if (response.code === 0) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addGoods(this.form).then(response => {
if (response.code === 0) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
// 重置
resetQuery(form) {
this.resetForm("queryForm");
this.handleQuery();
},
} //methods结束
};
</script>
<style scoped>
.app-container {
height: 100%;
}
/deep/ .el-dialog {
height: 100%;
}
/deep/ .el-dialog__body {
height: 80%;
overflow-y: scroll;
}
.box-card {
height: 100%;
}
.box-card /deep/ .el-card__body {
height: 100%;
overflow: hidden;
}
.el-table {
height: calc(100% - 120px);
}
</style>
<template>
<div class="goods-after-sale">
<el-form ref="goodsAfterSaleForm" :model="goodsAfterSaleForm" :rules="goodsAfterSaleRules" label-width="150px" size="small">
<el-form-item label="服务标签:" prop="fwbq">
<el-checkbox-group v-model="goodsAfterSaleForm.fwbq">
<el-checkbox v-for="item in tagOptions" :label="item.id" true-label :key="item.id">{{item.tag}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="邮费模板:" prop="freightId">
<el-select v-model="goodsAfterSaleForm.freightId" placeholder="请选择邮费模板" style="width:400px;">
<el-option v-for="item in freightOptions" :key="item.Id" :label="item.Name" :value="item.Id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="发货时效:" prop="Delayompensate">
<el-select v-model="goodsAfterSaleForm.Delayompensate" style="width:400px;" placeholder="请选择发货时效">
<el-option label="24小时" :value="24"></el-option>
<el-option label="48小时" :value="48"></el-option>
<el-option label="72小时" :value="72"></el-option>
</el-select>
</el-form-item>
<el-form-item label="售后时长:" prop="aftersaleTime">
<el-select v-model="goodsAfterSaleForm.aftersaleTime" style="width:400px;" placeholder="请选择售后时长">
<el-option label="7天" :value="7"></el-option>
<el-option label="15天" :value="15"></el-option>
<el-option label="30天" :value="30"></el-option>
</el-select>
</el-form-item>
<!-- <div style="width: 100%;height: 1000px;">我很高</div>-->
</el-form>
</div>
</template>
<script>
import { GetFreight } from '@/api/module/goods'
export default {
name: "goodsaftersale",
props: {
goodsaftersale: {
type: Object,
required: true
}
},
data() {
let checkFwbq = (rule, value, callback) => {
if (this.goodsAfterSaleForm.fwbq.length === 0) {
callback(new Error("请选择服务类型"));
} else {
callback();
}
};
return {
goodsAfterSaleForm: {
fwbq: [],
freightId: 310,
Delayompensate: 24,
aftersaleTime: 7
},
goodsAfterSaleRules: {
fwbq: [{required: true, validator: checkFwbq}],
freightId: [{required: true, message: '请选择邮费模板', trigger: 'change'}],
Delayompensate: [{required: true, message: '请选择发货时效', trigger: 'change'}],
aftersaleTime: [{required: true, message: '请选择售后时长', trigger: 'change'}]
},
tagOptions: [
{id: 2, tag: "假一赔十"},
{id: 4, tag: "不可退还"},
{id: 5, tag: "厂家直供"}
],
freightOptions: []
} // return end
},
mounted() {
this.getFreightData();
},
methods: {
// 运费模板
getFreightData() {
GetFreight().then(res => {
if(res.data) {
this.freightOptions = res.data
}else {
this.freightOptions = ''
}
});
},
// 商品信息 子组件 form表单校验, 在父组件中被调用
validateGoodsAfterSaleForm () {
let flag = null
this.$refs['goodsAfterSaleForm'].validate(valid => {
if (valid) {
flag = true
} else {
flag = false
}
})
return flag
},
} // methods end
}
</script>
<style lang="scss" type="text/stylus" scoped>
.goods-after-sale {
padding: 15px 0px;
margin-top: 18px;
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论