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

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

# Conflicts:
#	src/views/system/asset/withdraw/index.vue
...@@ -5,6 +5,7 @@ ENV = 'development' ...@@ -5,6 +5,7 @@ ENV = 'development'
VUE_APP_BASE_API = 'http://sjapi.jxhh.com' VUE_APP_BASE_API = 'http://sjapi.jxhh.com'
# 开发环境 # 开发环境
#VUE_APP_BASE_API = 'http://192.168.111.36:8200' #VUE_APP_BASE_API = 'http://192.168.111.36:8200'
#VUE_APP_BASE_API = 'http://192.168.111.34:8200'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true
...@@ -49,6 +49,6 @@ export function delBankcard(ids) { ...@@ -49,6 +49,6 @@ export function delBankcard(ids) {
return request({ return request({
url: '/system/bankcard/delete', url: '/system/bankcard/delete',
method: 'delete', method: 'delete',
data:{ids:ids} data:{id:ids}
}) })
} }
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
...@@ -73,6 +73,10 @@ div:focus { ...@@ -73,6 +73,10 @@ div:focus {
padding-left: 5px; padding-left: 5px;
} }
.ml20 {
margin-left: 20px;
}
.block { .block {
display: block; display: block;
} }
......
...@@ -142,6 +142,10 @@ ...@@ -142,6 +142,10 @@
margin-bottom: 10px; margin-bottom: 10px;
} }
.el-input.is-disabled .el-input__inner {
color: #666;
}
/* text color */ /* text color */
.text-navy { .text-navy {
color: #1ab394; color: #1ab394;
...@@ -198,3 +202,31 @@ ...@@ -198,3 +202,31 @@
color: #fff!important; color: #fff!important;
background: #42b983!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"; ...@@ -20,7 +20,8 @@ import { getDicts } from "@/api/system/dict/data";
import { getConfigKey } from "@/api/system/config"; import { getConfigKey } from "@/api/system/config";
import { parseTime, resetForm, addDateRange, selectDictLabel, download, handleTree } from "@/utils/ruoyi"; import { parseTime, resetForm, addDateRange, selectDictLabel, download, handleTree } from "@/utils/ruoyi";
import Pagination from "@/components/Pagination"; import Pagination from "@/components/Pagination";
/*hxz0706*/
import { deepClone } from "@/utils/index";
// 全局方法挂载 // 全局方法挂载
Vue.prototype.getDicts = getDicts Vue.prototype.getDicts = getDicts
...@@ -32,6 +33,7 @@ Vue.prototype.selectDictLabel = selectDictLabel ...@@ -32,6 +33,7 @@ Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.download = download Vue.prototype.download = download
Vue.prototype.handleTree = handleTree Vue.prototype.handleTree = handleTree
Vue.prototype.apiUrl = process.env.VUE_APP_BASE_API Vue.prototype.apiUrl = process.env.VUE_APP_BASE_API
Vue.prototype.deepClone = deepClone
Vue.prototype.msgSuccess = function (msg) { Vue.prototype.msgSuccess = function (msg) {
this.$message({ showClose: true, message: msg, type: "success" }); this.$message({ showClose: true, message: msg, type: "success" });
......
...@@ -19,7 +19,7 @@ service.interceptors.request.use(config => { ...@@ -19,7 +19,7 @@ service.interceptors.request.use(config => {
if (getToken() && !isToken) { if (getToken() && !isToken) {
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
} }
//config.headers['Authorization'] = 'Bearer ' + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dpbk5hbWUiOiIxNTcxMTEzOTg5NSIsInVpZCI6NTI4MjgsImNoYW5uZWxJZCI6MCwiZXhwIjoxNjE5ODMzMzk3LCJpc3MiOiJnaW4tYmxvZyJ9.rh-WXSaFqgqY611Tm5dhba532OYEZvm06vUmgZknoy4' //config.heaoYW5uZWxJZCI6MCwiZXhwIjoxNjE5ODMzMzk3LCJpc3MiOiJnaW4tYmxvZyJ9.rh-WXSaFqgqY611Tm5dhba532OYEZvm06vUmgZknoy4'
return config return config
}, error => { }, error => {
console.log("25reject"); console.log("25reject");
...@@ -28,33 +28,28 @@ service.interceptors.request.use(config => { ...@@ -28,33 +28,28 @@ service.interceptors.request.use(config => {
// 响应拦截器 // 响应拦截器
service.interceptors.response.use(res => { service.interceptors.response.use(res => {
// 未设置状态码则默认成功状态 //debugger
const code = res.data.code || 200; let code = res.data.code
//if(res.data.code !== 0) {
code = res.data.code || 200;
// } else {
// code = 0;
// }
// 返回所有数据的统一处理 // 返回所有数据的统一处理
const data = res.data; const data = res.data;
// 获取错误信息 // 获取错误信息
const message = errorCode[code] || res.data.msg || errorCode['default']; const message = errorCode[code] || res.data.message || res.data.msg || errorCode['default'];
// 200,1意味着成功返回数据
if(code === 200 || code === 1) { if(code === 1 || code === 200) {
if( res.data ) { return res.data
return res.data } else if( code === 500 || code === 0) {
} else {
if( message ) {
Message({message: message, type: 'error'});
}else {
Message({message: '后台数据出错啦!', type: 'error'});
}
return Promise.reject('error');
}
}
else if( code === 500) {
Message({ Message({
message: message, message: message,
type: 'error' type: 'error'
}) })
return Promise.reject(new Error(message)); return Promise.reject(new Error(message));
} } else if(code === 401 || code == 99999) {
else if(code === 401 || code == 99999) {
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
confirmButtonText: '重新登录', confirmButtonText: '重新登录',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -64,30 +59,21 @@ service.interceptors.response.use(res => { ...@@ -64,30 +59,21 @@ service.interceptors.response.use(res => {
location.reload() // 为了重新实例化vue-router对象 避免bug location.reload() // 为了重新实例化vue-router对象 避免bug
}) })
}) })
} else if (code === 500) { } else {
Message({
message: message,
type: 'error'
})
return Promise.reject(new Error(message))
} else if (code !== 200 && code !== 1) {
Notification.error({ Notification.error({
title: message title: message
}) })
return Promise.reject('error') return Promise.reject('error')
store.dispatch('LogOut').then(() => { store.dispatch('LogOut').then(() => {
var ssa = window.location.host; var ssa = window.location.host;
// setTimeout(function (){
if (ssa == 'localhost:1024') { if (ssa == 'localhost:1024') {
window.location.href = 'http://sso.jxhh.com/logout?redirect=http://' + ssa window.location.href = 'http://sso.jxhh.com/logout?redirect=http://' + ssa
} else { } else {
window.location.href = 'http://sso.jxhh.com/logout?redirect=http://' + ssa window.location.href = 'http://sso.jxhh.com/logout?redirect=http://' + ssa
} }
// }, 1000)
// location.reload() // 为了重新实例化vue-router对象 避免bug // location.reload() // 为了重新实例化vue-router对象 避免bug
}) })
} else if (code === 200 || code === 1 ) {
return res.data
} }
}, error => { }, error => {
// --- start ---- 开发时候用这段,把错误彻底抛出来 --- start --- // --- start ---- 开发时候用这段,把错误彻底抛出来 --- start ---
...@@ -103,11 +89,8 @@ service.interceptors.response.use(res => { ...@@ -103,11 +89,8 @@ service.interceptors.response.use(res => {
message: message, message: message,
type: "error" type: "error"
}); });
// console.log(message);
// --- end ---- 开发时候用这段,把错误彻底抛出来 --- end ---
// --- start --- 正式上线,隐藏报错信息 ----- start ---- // --- start --- 正式上线,隐藏报错信息 ----- start ----
// let ssa = window.location.host; // let ssa = window.location.host;
// setTimeout(function () { // setTimeout(function () {
// if (ssa == 'localhost:1024') { // if (ssa == 'localhost:1024') {
...@@ -116,9 +99,7 @@ service.interceptors.response.use(res => { ...@@ -116,9 +99,7 @@ service.interceptors.response.use(res => {
// window.location.href = 'http://sso.jxhh.com/logout?redirect=http://' + ssa // window.location.href = 'http://sso.jxhh.com/logout?redirect=http://' + ssa
// } // }
// }, 1000); // }, 1000);
// --- end --- 正式上线,隐藏报错信息 ----- end ---- // --- end --- 正式上线,隐藏报错信息 ----- end ----
return Promise.reject(error) return Promise.reject(error)
} }
) )
......
...@@ -326,7 +326,7 @@ ...@@ -326,7 +326,7 @@
upLoadImg(data).then((res) => { upLoadImg(data).then((res) => {
if(res && res.data.code == 1){ if(res && res.data.code == 1){
this.licenseImgFileList.push({'url':res.data.data.imageUrl}); this.licenseImgFileList.push({'url':res.data.data.imageUrl});
this.$message('上传成功'); this.$message({type: 'success',message:'上传成功'});
this.$refs.mainForm.clearValidate('license'); this.$refs.mainForm.clearValidate('license');
} }
}); });
......
差异被折叠。
...@@ -13,10 +13,11 @@ ...@@ -13,10 +13,11 @@
gotosso() { gotosso() {
var ticket = this.$route.query.ticket; var ticket = this.$route.query.ticket;
this.$store.dispatch('Login', {"ticket": ticket}).then((res) => { this.$store.dispatch('Login', {"ticket": ticket}).then((res) => {
if (res.token != "") { if (res.token != "") {
// 获取客户是否有审核信息 // 获取客户是否有审核信息
getShopInf().then(res => { getShopInf().then(res => {
if(res.code === 1) { //if(res.code === 1) {
switch(res.data.state) { switch(res.data.state) {
case 0: case 0:
switch(res.data.status){ switch(res.data.status){
...@@ -45,21 +46,25 @@ ...@@ -45,21 +46,25 @@
}); });
break; 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 { } else {
this.$store.dispatch('Statistic') this.$store.dispatch('Statistic')
this.$store.dispatch('FedLogOut') this.$store.dispatch('FedLogOut')
...@@ -73,8 +78,7 @@ ...@@ -73,8 +78,7 @@
}, 1000) }, 1000)
} }
this.loading = false this.loading = false
}) }).catch(() => {
.catch(() => {
this.$store.dispatch('FedLogOut') this.$store.dispatch('FedLogOut')
var ssa = window.location.host var ssa = window.location.host
setTimeout(function () { setTimeout(function () {
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
return { return {
fullHeight: 0, fullHeight: 0,
tableHeight: 0, tableHeight: 0,
loading: true, // 遮罩层 loading: false, // 遮罩层
ids: [], // 选中数组 ids: [], // 选中数组
total: 0, // 总条数 total: 0, // 总条数
assetList: [], // 商户余额变动日志表格数据 assetList: [], // 商户余额变动日志表格数据
...@@ -93,12 +93,9 @@ ...@@ -93,12 +93,9 @@
}, },
/** 查询商户余额变动日志列表 */ /** 查询商户余额变动日志列表 */
getList() { getList() {
this.loading = true; listAsset(this.queryParams).then(res => {
//console.log("重点注意shopid", this.queryParams) this.assetList = res.data.list;
listAsset(this.queryParams).then(response => { this.total = res.data.total;
this.assetList = response.data.list;
this.total = response.data.total;
this.loading = false;
}); });
}, },
// 取消按钮 // 取消按钮
......
<template> <template>
<div class="app-container"> <div class="app-container" v-loading="loading">
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<el-row :span="24" type="flex" align="middle" justify="space-between"> <el-row :span="24" type="flex" align="middle" justify="space-between">
...@@ -20,18 +20,17 @@ ...@@ -20,18 +20,17 @@
</el-row> </el-row>
</div> </div>
<el-table v-loading="loading" :height="tableHeight" :data="bankcardList" <el-table :height="tableHeight" :data="bankcardList"
@selection-change="handleSelectionChange"> @selection-change="handleSelectionChange">
<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="BankAccountName"/> <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="ProvinceCity"/>-->
<el-table-column label="银行名称" align="center" prop="BankName"/> <el-table-column label="银行名称" align="center" prop="bank_name"/>
<el-table-column label="开户行" align="center" prop="Kaihuhang"/> <el-table-column label="开户行" align="center" prop="bank_branch_name"/>
<el-table-column label="户名" align="center" prop="BankAccountName"/> <el-table-column label="账号" align="center" prop="bank_account_sn"/>
<el-table-column label="账号" align="center" prop="BankAccountNo"/>
<!-- <el-table-column label="支付宝账户名称" align="center" prop="ZfbAccountName" />--> <!-- <el-table-column label="支付宝账户名称" align="center" prop="ZfbAccountName" />-->
<!-- <el-table-column label="支付宝账户" align="center" prop="ZfbAccount" />--> <!-- <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"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
...@@ -67,19 +66,19 @@ ...@@ -67,19 +66,19 @@
<!-- </el-dialog>--> <!-- </el-dialog>-->
<el-dialog :visible.sync="bank" :title="banktitle"> <el-dialog :visible.sync="bank" :title="banktitle">
<el-form ref="form" :model="form" :rules="rules" label-width="90px"> <el-form ref="form" :model="form" :rules="rules" label-width="90px" size="small">
<el-row> <!-- <el-row>-->
<el-col :span="16" :offset="3"> <!-- <el-col :span="16" :offset="3">-->
<el-form-item label="开户城市" prop="ProvinceCity"> <!-- <el-form-item label="开户城市" prop="ProvinceCity">-->
<el-input v-model="form.ProvinceCity" placeholder="请输入城市名和商户提交时一致"/> <!-- <el-input v-model="form.ProvinceCity" placeholder="请输入城市名和商户提交时一致"/>-->
</el-form-item> <!-- </el-form-item>-->
</el-col> <!-- </el-col>-->
</el-row> <!-- </el-row>-->
<el-row> <el-row>
<el-col :span="16" :offset="3"> <el-col :span="16" :offset="3">
<el-form-item label="银行名称"> <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" <el-option v-for="item in bankList" :key="item.value" :label="item.value"
:value="item.value"></el-option> :value="item.value"></el-option>
</el-select> </el-select>
...@@ -89,32 +88,32 @@ ...@@ -89,32 +88,32 @@
<el-row> <el-row>
<el-col :span="16" :offset="3"> <el-col :span="16" :offset="3">
<el-form-item label="开户行" prop="kaihuhang"> <el-form-item label="开户行" prop="bank_branch_name">
<el-input v-model="form.kaihuhang" placeholder="请输入开户行"/> <el-input v-model="form.bank_branch_name" placeholder="请输入开户行"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="16" :offset="3"> <el-col :span="16" :offset="3">
<el-form-item label="户名" prop="BankAccountName"> <el-form-item label="户名" prop="bankAccountName">
<el-input v-model="form.BankAccountName" placeholder="请输入户名"/> <el-input v-model="form.bankAccountName" placeholder="请输入户名"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="16" :offset="3"> <el-col :span="16" :offset="3">
<el-form-item label="账号" prop="BankAccountNo"> <el-form-item label="账号" prop="BankAccountSn">
<el-input v-model="form.BankAccountNo" placeholder="请输入账号"/> <el-input v-model="form.BankAccountSn" placeholder="请输入账号"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button> <el-button @click="cancel" size="small">取 消</el-button>
<el-button @click="cancel">取 消</el-button> <el-button type="primary" @click="submitForm" size="small">确 定</el-button>
</div> </div>
</el-dialog> </el-dialog>
...@@ -152,7 +151,7 @@ ...@@ -152,7 +151,7 @@
//银行 //银行
bankList: [], bankList: [],
// 遮罩层 // 遮罩层
loading: true, loading: false,
// 选中数组 // 选中数组
ids: [], ids: [],
// 非单个禁用 // 非单个禁用
...@@ -216,8 +215,10 @@ ...@@ -216,8 +215,10 @@
methods: { methods: {
//获取银行名称列表 //获取银行名称列表
getBankNameList() { getBankNameList() {
listBankname().then(response => { listBankname().then(res => {
this.bankList = response.data if(res.data) {
this.bankList = res.data
}
}); });
}, },
//类型改变 //类型改变
...@@ -245,17 +246,15 @@ ...@@ -245,17 +246,15 @@
}, },
/** 查询商户银行卡列表 */ /** 查询商户银行卡列表 */
getList() { getList() {
this.loading = true;
listBankcard(this.queryParams).then(response => { listBankcard(this.queryParams).then(response => {
this.bankcardList = response.data.list; this.bankcardList = response.data.data;
//console.log(this.bankcardList) // debugger
this.total = response.data.total; this.total = response.data.count;
if (this.total >= 3) { if (this.total >= 3) {
this.isAddbank = true; this.isAddbank = true;
}else { }else {
this.isAddbank = false; this.isAddbank = false;
} }
this.loading = false;
}); });
}, },
// 取消按钮 // 取消按钮
...@@ -307,15 +306,21 @@ ...@@ -307,15 +306,21 @@
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
this.form.sellerId = this.queryParams.sellerId; this.form.sellerId = this.queryParams.sellerId;
this.form.TxType = 1; // this.form.TxType = 1;
this.loading = true;
addBankcard(this.form).then(response => { addBankcard(this.form).then(response => {
if (response.code === 0) { if (response.code === 1) {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");
this.loading = false;
this.open = false; this.open = false;
this.bank = false; this.bank = false;
this.zfb = false; this.zfb = false;
this.getList(); this.getList();
}else {
this.message({type:'error',message: response.message});
} }
this.loading = true;
}); });
} }
...@@ -323,18 +328,20 @@ ...@@ -323,18 +328,20 @@
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.Id const ids = row.id
this.$confirm('是否确认删除商户银行卡编号为"' + ids + '"的数据项?', "警告", { this.$confirm('是否确认删除商户银行卡编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(function () { }).then(async() => {
return delBankcard(ids); this.loading = true;
}).then(() => { let result = await delBankcard(ids);
this.getList(); if(result.code === 1) {
this.msgSuccess("删除成功"); this.$message({type:'success',message:'删除成功'});
}).catch(function () { this.getList()
}); }
this.loading = false;
}).catch(()=> {});
}, },
} //methods结束 } //methods结束
}; };
......
...@@ -65,8 +65,8 @@ ...@@ -65,8 +65,8 @@
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.page"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.limit"
@pagination="getList" @pagination="getList"
/> />
<!-- 添加或修改商户账单对话框 --> <!-- 添加或修改商户账单对话框 -->
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
isBlance: true, isBlance: true,
billId: 0, billId: 0,
// 遮罩层 // 遮罩层
loading: true, loading: false,
// 选中数组 // 选中数组
ids: [], ids: [],
// 非单个禁用 // 非单个禁用
...@@ -142,8 +142,8 @@ ...@@ -142,8 +142,8 @@
sellerId: 0, sellerId: 0,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, page: 1,
pageSize: 10, limit: 10,
shopId: 0, shopId: 0,
money: null, money: null,
org_money: null, org_money: null,
...@@ -209,11 +209,9 @@ ...@@ -209,11 +209,9 @@
}, },
/** 查询商户账单列表 */ /** 查询商户账单列表 */
getList() { getList() {
this.loading = true;
listVerifyrecord(this.queryParams).then(response => { listVerifyrecord(this.queryParams).then(response => {
this.verifyrecordList = response.data.list; this.verifyrecordList = response.data.data;
this.total = response.data.total; this.total = response.data.count;
this.loading = false;
}); });
}, },
// 取消按钮 // 取消按钮
...@@ -244,7 +242,7 @@ ...@@ -244,7 +242,7 @@
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.page = 1;
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
......
...@@ -21,20 +21,20 @@ ...@@ -21,20 +21,20 @@
<el-form-item label="手续费"> <el-form-item label="手续费">
当前手续费为{{newFee}} 当前手续费为{{newFee}}
</el-form-item> </el-form-item>
<el-form-item label="银行卡" prop="bankId"> <el-form-item label="银行卡" prop="bank_id">
<el-select v-model="form.bankId" placeholder="选择到账银行卡" style="width:260px;"> <el-select v-model="form.bank_id" placeholder="选择到账银行卡" style="width:260px;">
<el-option v-for="item in banklist" :key="item.Id" <el-option v-for="item in banklist" :key="item.Id"
:label="item.BankAccountName?item.BankAccountName:item.ZfbAccountName" :label="item.bank_name ? item.bank_name : bank_account_name"
:value="item.Id?item.Id:item.Id"></el-option> :value="item.id ? item.id : item.Id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="提现金额" prop="money"> <el-form-item label="提现金额" prop="amount">
<el-input v-model="form.money" <el-input v-model="form.amount"
@blur="onInputBlur($event)" @blur="onInputBlur($event)"
placeholder="提现金额大于等于100" placeholder="提现金额大于等于100"
style="width:260px;"/> style="width:260px;"/>
</el-form-item> </el-form-item>
<el-form-item label="短信验证码" prop="verifycode"> <el-form-item label="短信验证码" prop="verifycode" class="spe-code-con-item">
<el-input v-model="form.verifycode" placeholder="验证码" style="width:260px;"> <el-input v-model="form.verifycode" placeholder="验证码" style="width:260px;">
<template slot="append"> <template slot="append">
<span v-show="show" @click="getCheckCodeFn">获取验证码</span> <span v-show="show" @click="getCheckCodeFn">获取验证码</span>
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
count: '', count: '',
timer: null, timer: null,
//提现金额 //提现金额
money: 0, amount: 0,
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 选中数组 // 选中数组
...@@ -85,13 +85,13 @@ ...@@ -85,13 +85,13 @@
open: true, open: true,
// 表单参数 // 表单参数
form: { form: {
bankId: '', bank_id: '',
money: '' amount: ''
}, },
// 表单校验 // 表单校验
rules: { rules: {
bankId: [{required: true, message: "请选择要提现的银行卡", trigger: "change"}], bank_id: [{required: true, message: "请选择要提现的银行卡", trigger: "change"}],
money: [{required: true, message: "提现金额不能为空", trigger: "blur"}], amount: [{required: true, message: "提现金额不能为空", trigger: "blur"}],
verifycode: [{required: true, message: "短信验证码不能为空", trigger: "blur"}], verifycode: [{required: true, message: "短信验证码不能为空", trigger: "blur"}],
pwd: [{required: true, message: "支付密码必须填写", trigger: "blur"}] pwd: [{required: true, message: "支付密码必须填写", trigger: "blur"}]
} }
...@@ -144,19 +144,19 @@ ...@@ -144,19 +144,19 @@
}, },
getCheckCodeFn() { getCheckCodeFn() {
let numRegExp = /^[0-9]+(.[0-9]{2})?$/; let numRegExp = /^[0-9]+(.[0-9]{2})?$/;
let numberMoney = Number(this.form.money); let numberMoney = Number(this.form.amount);
let numberCash = Number(this.drawableCash); let numberCash = Number(this.drawableCash);
if(this.form.bankId === '') { if(this.form.bank_id === '') {
this.$refs.form.validateField("bankId"); this.$refs.form.validateField("bank_id");
return; return;
} }
if(this.form.money === '') { if(this.form.amount === '') {
this.$refs.form.validateField("money"); this.$refs.form.validateField("amount");
return; return;
} }
if(!numRegExp.test(this.form.money)) { if(!numRegExp.test(this.form.amount)) {
this.$message({ type: 'warning',message: '提现金额只能输入大于 0 的数字'}); this.$message({ type: 'warning',message: '提现金额只能输入大于 0 的数字'});
return; return;
} }
...@@ -186,32 +186,33 @@ ...@@ -186,32 +186,33 @@
onInputBlur(event) { onInputBlur(event) {
let fee = 0.006; let fee = 0.006;
this.form.money = event.target.value; this.form.amount = event.target.value;
let numRegExp = /^[0-9]+(.[0-9]{2})?$/; let numRegExp = /^[0-9]+(.[0-9]{2})?$/;
let numberMoney = Number(this.form.money); let numberMoney = Number(this.form.amount);
//debugger
let numberCash = Number(this.drawableCash); let numberCash = Number(this.drawableCash);
if(this.form.money !== '') { if(this.form.amount !== '') {
if(!numRegExp.test(this.form.money)) { if(!numRegExp.test(this.form.amount)) {
this.$message({ type: 'warning',message: '提现金额只能输入大于 0 的数字'}); this.$message({ type: 'warning',message: '提现金额只能输入大于 0 的数字'});
return; return;
} }
if (Number(this.form.money) > Number(this.drawableCash)) { if (Number(this.form.amount) > Number(this.drawableCash)) {
this.$message({type: 'warning',message:'提现金额不足!'}); this.$message({type: 'warning',message:'提现金额不足!'});
return; return;
} }
if (Number(this.form.money) < 100) { if (Number(this.form.amount) < 100) {
this.$message({type: 'warning',message:'提现金额需大于或者等于 100'}); this.$message({type: 'warning',message:'提现金额需大于或者等于 100'});
return; return;
} }
this.newFee = (this.form.money * fee + 1).toFixed(2); this.newFee = (this.form.amount * fee + 1).toFixed(2);
} }
}, },
//获取商户的信息 //获取商户的信息
getSellerInfoFn() { getSellerInfoFn() {
const sellerid = this.sellerId; const sellerId = this.sellerId;
getSellerInfo({sellerId: sellerid}).then(response => { getSellerInfo({sellerId: sellerId}).then(response => {
this.sellerinfo = response.data; this.sellerinfo = response.data;
this.sellerinfo.Balance = response.data.Balance / 100; this.sellerinfo.Balance = response.data.Balance / 100;
this.sellerinfo.FrozenMoney = response.data.FrozenMoney / 100; this.sellerinfo.FrozenMoney = response.data.FrozenMoney / 100;
...@@ -221,7 +222,7 @@ ...@@ -221,7 +222,7 @@
//获取商户的银行卡列表 //获取商户的银行卡列表
getBankcardList() { getBankcardList() {
getBankcardList({sellerId: this.sellerId}).then(response => { getBankcardList({sellerId: this.sellerId}).then(response => {
this.banklist = response.data.list; this.banklist = response.data.data;
}); });
}, },
...@@ -245,9 +246,8 @@ ...@@ -245,9 +246,8 @@
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
let numberMoney = Number(this.form.money); let numberMoney = Number(this.form.amount);
let numberCash = Number(this.drawableCash); let numberCash = Number(this.drawableCash);
this.form.sellerId = this.sellerId; this.form.sellerId = this.sellerId;
// 再次校验 提现信息 // 再次校验 提现信息
if(!this.form.sellerId) { if(!this.form.sellerId) {
...@@ -263,14 +263,14 @@ ...@@ -263,14 +263,14 @@
return; return;
} }
this.form.verifycode = Number(this.form.verifycode); this.form.amount = Number(this.form.amount);
this.form.money = Number(this.form.money); addWithdrawlog(this.form).then(response => {
if (response.code === 1) {
addWithdrawlog(this.form).then(res => { this.msgSuccess(response.message);
if (res.code === 0) {
this.msgSuccess(res.msg);
this.getList(); this.getList();
this.reset(); }
else {
this.$message({type: 'error',message: response.message});
} }
// else { // else {
// this.$message({type: 'error',message: res.msg}); // this.$message({type: 'error',message: res.msg});
...@@ -287,4 +287,8 @@ ...@@ -287,4 +287,8 @@
width: 500px; width: 500px;
margin: 20px 0 0 120px; margin: 20px 0 0 120px;
} }
/deep/.spe-code-con-item .el-input-group__append {
cursor: pointer;
}
</style> </style>
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.page"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.limit"
@pagination="getList" @pagination="getList"
/> />
</el-card> </el-card>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
fullHeight: 0, fullHeight: 0,
tableHeight: 0, tableHeight: 0,
// 遮罩层 // 遮罩层
loading: true, loading: false,
// 选中数组 // 选中数组
ids: [], ids: [],
// 非单个禁用 // 非单个禁用
...@@ -67,8 +67,8 @@ ...@@ -67,8 +67,8 @@
open: false, open: false,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, page: 1,
pageSize: 10, limit: 10,
sellerId: 0, sellerId: 0,
}, },
// 表单参数 // 表单参数
...@@ -128,18 +128,14 @@ ...@@ -128,18 +128,14 @@
}, },
/** 查询商户提现列表 */ /** 查询商户提现列表 */
getList() { getList() {
this.loading = true;
this.queryParams.sellerId = this.sellerId; this.queryParams.sellerId = this.sellerId;
//console.log(127, this.queryParams);
listWithdrawlog(this.queryParams).then(response => { listWithdrawlog(this.queryParams).then(response => {
if (response) { if (response) {
this.withdrawlogList = response.data.list; this.withdrawlogList = response.data.data;
this.total = response.data.total; this.total = response.data.count;
} else { } else {
this.$message({message: '数据出错啦!', type: 'error'}); this.$message({message: '数据出错啦!', type: 'error'});
} }
this.loading = false;
}); });
}, },
// 取消按钮 // 取消按钮
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
fullHeight: 0, fullHeight: 0,
tableHeight: 0, tableHeight: 0,
// 遮罩层 // 遮罩层
loading: true, loading: false,
// 选中数组 // 选中数组
ids: [], ids: [],
// 非单个禁用 // 非单个禁用
...@@ -192,11 +192,11 @@ ...@@ -192,11 +192,11 @@
}, },
/** 查询freight列表 */ /** 查询freight列表 */
getList() { getList() {
this.loading = true; listFreight(this.queryParams).then(res => {
listFreight(this.queryParams).then(response => { if(res.data) {
this.freightList = response.data.data.list; this.freightList = res.data.list;
this.total = response.data.data.count; this.total = res.data.count;
this.loading = false; }
}); });
}, },
// 取消按钮 // 取消按钮
...@@ -317,13 +317,14 @@ ...@@ -317,13 +317,14 @@
}).then(async()=> { }).then(async()=> {
this.loading = true; this.loading = true;
let delResult = await delFreight(ids); let delResult = await delFreight(ids);
this.loading = false;
if(delResult.code === 1) { if(delResult.code === 1) {
this.$message({type: 'success',message: delResult.msg}); this.$message({type: 'success',message: delResult.msg});
this.getList();
} }
if(delResult.code === 0) { if(delResult.code === 0) {
this.$message({type: 'error',message: delResult.msg}); this.$message({type: 'error',message: delResult.msg});
} }
this.loading = false;
}).catch(()=> {}); }).catch(()=> {});
}, },
} //methods结束 } //methods结束
......
...@@ -271,9 +271,10 @@ export default { ...@@ -271,9 +271,10 @@ export default {
item.fp= Number(item.fp*100).toFixed(); item.fp= Number(item.fp*100).toFixed();
item.np = Number(item.np*100).toFixed(); item.np = Number(item.np*100).toFixed();
}) })
//console.log(275,this.goodsDate); this.loading = true
addFreight(this.goodsDate).then(response => { addFreight(this.goodsDate).then(res => {
if(response.data.code === 1) { //console.log(275,res);
if(res.code === 1) {
this.$emit("closeIndexbtn",false); this.$emit("closeIndexbtn",false);
if(this.goodsDate.Id === 0) { if(this.goodsDate.Id === 0) {
this.$message({ message: '新增成功', type: 'success'}); 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>
...@@ -79,8 +79,8 @@ ...@@ -79,8 +79,8 @@
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<!-- <el-button type="warning" plain icon="el-icon-download" @click="handleExport">导出订单</el-button>--> <el-button type="warning" plain icon="el-icon-download" @click="handleExport">导出订单</el-button>
<!-- <el-button type="primary" plain icon="el-icon-position" @click="handleDelivery">批量发货</el-button>--> <el-button type="primary" plain icon="el-icon-position" @click="handleDelivery">批量发货</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -793,7 +793,9 @@ ...@@ -793,7 +793,9 @@
// 订单导出 // 订单导出
handleExport(row) { handleExport(row) {
const rowIds = this.ids; const rowIds = this.ids;
let query = {page: 1, limit: 100} //console.log(777,rowIds);
let query = {page: 1, limit: 100};
// return
exportOrder(query).then(res => { exportOrder(query).then(res => {
if(res.code === 1) { if(res.code === 1) {
const link = document.createElement('a'); const link = document.createElement('a');
......
...@@ -175,12 +175,10 @@ ...@@ -175,12 +175,10 @@
methods: { methods: {
// 获取列表 // 获取列表
getList() { getList() {
this.loading = true;
getAddressList(this.queryParams).then(res => { getAddressList(this.queryParams).then(res => {
if(res.code === 1 && res.data.data) { if(res.data.data) {
this.addressList = res.data.data; this.addressList = res.data.data;
this.total = res.data.count; this.total = res.data.count;
this.loading = false;
} }
}); });
}, },
...@@ -261,26 +259,26 @@ ...@@ -261,26 +259,26 @@
// 修改 // 修改
handleUpdate(row) { handleUpdate(row) {
this.isOpen = true;
this.areaList = []; this.areaList = [];
const roleIds = row.id || this.ids; const roleIds = row.id || this.ids;
//this.loading = true; this.loading = true;
getAddressDetails(roleIds).then(res => { getAddressDetails(roleIds).then(res => {
if(res && res.data) { if(res.data) {
this.isOpen = true;
// 处理 三级联动回显 // 处理 三级联动回显
let areaListAry = res.data.address_ids.split(","); let areaListAry = res.data.address_ids ? res.data.address_ids.split(",") : [];
for(let i = 0; i < areaListAry.length; i++) { for(let i = 0; i < areaListAry.length; i++) {
this.areaList.push(Number(areaListAry[i])); this.areaList.push(Number(areaListAry[i]));
} }
this.addressForm = res.data; this.addressForm = res.data;
} }
this.loading = false;
}); });
}, },
cancel() { cancel() {
this.areaList = []; this.areaList = [];
this.resetForm('addressForm'); this.resetForm('addressForm');
this.isOpen = false; this.isOpen = false;
}, },
save(form) { save(form) {
if(typeof this.addressForm.address_ids === "string") { if(typeof this.addressForm.address_ids === "string") {
......
...@@ -86,8 +86,8 @@ ...@@ -86,8 +86,8 @@
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.page"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.limit"
@pagination="getList" @pagination="getList"
/> />
<!-- 售后申请信息对话框 --> <!-- 售后申请信息对话框 -->
...@@ -337,9 +337,10 @@ ...@@ -337,9 +337,10 @@
export default { export default {
name: "retreat", name: "retreat",
data() { data() {
return { return {
// 遮罩层
loading: false,
fullHeight: 0, fullHeight: 0,
tableHeight: 0, tableHeight: 0,
//退货地址 //退货地址
...@@ -404,8 +405,6 @@ ...@@ -404,8 +405,6 @@
reject: false, reject: false,
//退货地址 //退货地址
reback: false, reback: false,
// 遮罩层
loading: true,
// 选中数组 // 选中数组
ids: [], ids: [],
// 非单个禁用 // 非单个禁用
...@@ -424,11 +423,11 @@ ...@@ -424,11 +423,11 @@
open: false, open: false,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, page: 1,
pageSize: 10, limit: 10,
applyTime: [], applyTime: [],
beginTime: 0, beginTime: '',
endTime: 0, endTime: '',
goodsId: null, goodsId: null,
goodsName: null, goodsName: null,
userNeed: null, userNeed: null,
...@@ -487,8 +486,8 @@ ...@@ -487,8 +486,8 @@
// select组件,clear的时候,将addTimeInterval的值,初始化为null,判断当其值为null时,赋值为数组 // select组件,clear的时候,将addTimeInterval的值,初始化为null,判断当其值为null时,赋值为数组
if(!this.queryParams.applyTime && typeof(this.queryParams.applyTime) !== "undefined") { if(!this.queryParams.applyTime && typeof(this.queryParams.applyTime) !== "undefined") {
this.queryParams.applyTime = []; this.queryParams.applyTime = [];
this.queryParams.beginTime = 0; this.queryParams.beginTime = '';
this.queryParams.endTime = 0; this.queryParams.endTime = '';
} }
} }
}, },
...@@ -612,13 +611,11 @@ ...@@ -612,13 +611,11 @@
/** 查询售后申请信息列表 */ /** 查询售后申请信息列表 */
getList() { getList() {
this.loading = true; listRetreat(this.queryParams).then(res => {
listRetreat(this.queryParams).then(response => { if(res.data) {
//console.log(response.data) this.retreatList = res.data.data;
this.retreatList = response.data.list; this.total = res.data.count;
this.total = response.data.total; }
this.loading = false;
}); });
}, },
// 取消按钮 // 取消按钮
...@@ -641,14 +638,14 @@ ...@@ -641,14 +638,14 @@
this.queryParams.beginTime = new Date(this.queryParams.applyTime[0]).getTime() / 1000; this.queryParams.beginTime = new Date(this.queryParams.applyTime[0]).getTime() / 1000;
this.queryParams.endTime = new Date(this.queryParams.applyTime[1]).getTime() / 1000; this.queryParams.endTime = new Date(this.queryParams.applyTime[1]).getTime() / 1000;
} }
this.queryParams.pageNum = 1; this.queryParams.page = 1;
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.queryParams.beginTime = 0; this.queryParams.beginTime = '';
this.queryParams.endTime = 0; this.queryParams.endTime = '';
this.handleQuery(); this.handleQuery();
}, },
//同意申请并发货 //同意申请并发货
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论