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

Merge branch 'dev_hxz' into test

# Conflicts:
#	src/utils/request.js
#	src/views/system/asset/withdraw/index.vue
#	src/views/system/order/index.vue
......@@ -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;
}
......@@ -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');
}
});
......
......@@ -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();
},
/** 重置按钮操作 */
......
......@@ -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>
......@@ -175,12 +175,10 @@
methods: {
// 获取列表
getList() {
this.loading = true;
getAddressList(this.queryParams).then(res => {
if(res.code === 1 && res.data.data) {
if(res.data.data) {
this.addressList = res.data.data;
this.total = res.data.count;
this.loading = false;
}
});
},
......@@ -261,26 +259,26 @@
// 修改
handleUpdate(row) {
this.isOpen = true;
this.areaList = [];
const roleIds = row.id || this.ids;
//this.loading = true;
this.loading = true;
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++) {
this.areaList.push(Number(areaListAry[i]));
}
this.addressForm = res.data;
}
this.loading = false;
});
},
cancel() {
this.areaList = [];
this.resetForm('addressForm');
this.isOpen = false;
},
save(form) {
if(typeof this.addressForm.address_ids === "string") {
......
......@@ -86,8 +86,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"
/>
<!-- 售后申请信息对话框 -->
......@@ -337,9 +337,10 @@
export default {
name: "retreat",
data() {
return {
// 遮罩层
loading: false,
fullHeight: 0,
tableHeight: 0,
//退货地址
......@@ -404,8 +405,6 @@
reject: false,
//退货地址
reback: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
......@@ -424,11 +423,11 @@
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
page: 1,
limit: 10,
applyTime: [],
beginTime: 0,
endTime: 0,
beginTime: '',
endTime: '',
goodsId: null,
goodsName: null,
userNeed: null,
......@@ -487,8 +486,8 @@
// select组件,clear的时候,将addTimeInterval的值,初始化为null,判断当其值为null时,赋值为数组
if(!this.queryParams.applyTime && typeof(this.queryParams.applyTime) !== "undefined") {
this.queryParams.applyTime = [];
this.queryParams.beginTime = 0;
this.queryParams.endTime = 0;
this.queryParams.beginTime = '';
this.queryParams.endTime = '';
}
}
},
......@@ -612,13 +611,11 @@
/** 查询售后申请信息列表 */
getList() {
this.loading = true;
listRetreat(this.queryParams).then(response => {
//console.log(response.data)
this.retreatList = response.data.list;
this.total = response.data.total;
this.loading = false;
listRetreat(this.queryParams).then(res => {
if(res.data) {
this.retreatList = res.data.data;
this.total = res.data.count;
}
});
},
// 取消按钮
......@@ -641,14 +638,14 @@
this.queryParams.beginTime = new Date(this.queryParams.applyTime[0]).getTime() / 1000;
this.queryParams.endTime = new Date(this.queryParams.applyTime[1]).getTime() / 1000;
}
this.queryParams.pageNum = 1;
this.queryParams.page = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.beginTime = 0;
this.queryParams.endTime = 0;
this.queryParams.beginTime = '';
this.queryParams.endTime = '';
this.handleQuery();
},
//同意申请并发货
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论