'新增批发价,取消会员价'

This commit is contained in:
weipengfei 2023-12-04 14:24:04 +08:00
parent 95beee9000
commit ec8e023c79
3 changed files with 1328 additions and 463 deletions

View File

@ -4,7 +4,11 @@
<div slot="header" class="clearfix">
<div class="container">
<el-form size="small" inline label-width="100px">
<el-form-item label="时间选择:" class="width100" style="display: block;">
<el-form-item
label="时间选择:"
class="width100"
style="display: block"
>
<el-radio-group
v-model="tableFrom.date"
type="button"
@ -13,10 +17,11 @@
@change="selectChange(tableFrom.date)"
>
<el-radio-button
v-for="(item,i) in fromList.fromTxt"
v-for="(item, i) in fromList.fromTxt"
:key="i"
:label="item.val"
>{{ item.text }}</el-radio-button>
>{{ item.text }}</el-radio-button
>
</el-radio-group>
<el-date-picker
v-model="timeVal"
@ -26,12 +31,16 @@
type="daterange"
placement="bottom-end"
placeholder="自定义时间"
style="width: 250px;"
style="width: 250px"
@change="onchangeTime"
/>
</el-form-item>
<el-form-item label="审核状态:">
<el-radio-group v-model="tableFrom.status" type="button" @change="getList(1)">
<el-radio-group
v-model="tableFrom.status"
type="button"
@change="getList(1)"
>
<el-radio-button label="">全部 </el-radio-button>
<el-radio-button label="0">待审核</el-radio-button>
<el-radio-button label="1">已审核</el-radio-button>
@ -39,21 +48,21 @@
</el-radio-group>
</el-form-item>
<el-form-item label="商户名称:">
<el-select
v-model="tableFrom.mer_id"
clearable
filterable
placeholder="请选择"
class="selWidth"
@change="getList(1)"
>
<el-option
v-for="item in merSelect"
:key="item.mer_id"
:label="item.mer_name"
:value="item.mer_id"
/>
</el-select>
<el-select
v-model="tableFrom.mer_id"
clearable
filterable
placeholder="请选择"
class="selWidth"
@change="getList(1)"
>
<el-option
v-for="item in merSelect"
:key="item.mer_id"
:label="item.mer_name"
:value="item.mer_id"
/>
</el-select>
</el-form-item>
<el-form-item label="商户类别:">
<el-select
@ -69,7 +78,11 @@
</el-form-item>
<el-form-item label="收款方式:">
<el-radio-group v-model="tableFrom.financial_type" type="button" @change="getList(1)">
<el-radio-group
v-model="tableFrom.financial_type"
type="button"
@change="getList(1)"
>
<el-radio-button label="">全部 </el-radio-button>
<el-radio-button label="1">银行卡</el-radio-button>
<el-radio-button label="3">支付宝</el-radio-button>
@ -77,22 +90,22 @@
</el-radio-group>
</el-form-item>
<el-form-item label="转账状态:">
<el-select
v-model="tableFrom.financial_status"
placeholder="请选择"
class="filter-item selWidth mr20"
clearable
@change="getList"
>
<el-option
v-for="item in arrivalStatusList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-select
v-model="tableFrom.financial_status"
placeholder="请选择"
class="filter-item selWidth mr20"
clearable
@change="getList"
>
<el-option
v-for="item in arrivalStatusList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="关键字:" class="width100" >
<el-form-item label="关键字:" class="width100">
<el-input
v-model="tableFrom.keyword"
@keyup.enter.native="getList(1)"
@ -100,10 +113,21 @@
class="selWidth"
size="small"
>
<el-button slot="append" icon="el-icon-search" size="small" class="el-button-solt" @click="getList(1)" />
<el-button
slot="append"
icon="el-icon-search"
size="small"
class="el-button-solt"
@click="getList(1)"
/>
</el-input>
<el-button size="small" type="primary" icon="el-icon-top" @click="exports">列表导出</el-button>
<el-button
size="small"
type="primary"
icon="el-icon-top"
@click="exports"
>列表导出</el-button
>
<!-- <el-button size="small" type="primary" @click="getExportFileList">导出记录</el-button> -->
</el-form-item>
</el-form>
@ -118,33 +142,59 @@
class="table"
>
<el-table-column label="序号" min-width="60">
<template scope="scope">
<span>{{ scope.$index+(tableFrom.page - 1) * tableFrom.limit + 1 }}</span>
</template>
<template scope="scope">
<span>{{
scope.$index + (tableFrom.page - 1) * tableFrom.limit + 1
}}</span>
</template>
</el-table-column>
<el-table-column prop="mer_name" label="商户类别" min-width="80">
<template slot-scope="scope">
<span v-if="scope.row.merchant" class="spBlock">{{ scope.row.merchant .is_trader ? '自营' : '非自营' }}</span>
<span v-if="scope.row.merchant" class="spBlock">{{
scope.row.merchant.is_trader ? "自营" : "非自营"
}}</span>
</template>
</el-table-column>
<el-table-column label="商户名称" min-width="150">
<el-table-column label="商户名称" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.merchant ? scope.row.merchant.mer_name : '' }}</span>
<span>{{
scope.row.merchant ? scope.row.merchant.mer_name : ""
}}</span>
</template>
</el-table-column>
<el-table-column prop="create_time" label="申请时间" min-width="150"/>
<el-table-column prop="extract_money" label="转账金额(元)" min-width="120" />
<el-table-column prop="admin_id" label="平台管理员姓名" min-width="120" />
<el-table-column prop="create_time" label="申请时间" min-width="150" />
<el-table-column
prop="extract_money"
label="转账金额(元)"
min-width="120"
/>
<el-table-column
prop="admin_id"
label="平台管理员姓名"
min-width="120"
/>
<el-table-column label="收款方式" min-width="100">
<template slot-scope="scope">
<span v-if="scope.row.financial_type">{{scope.row.financial_type == 1 ? '银行' : scope.row.financial_type == 2 ? '微信' : '支付宝' }}</span>
<span v-if="scope.row.financial_type">{{
scope.row.financial_type == 1
? "银行"
: scope.row.financial_type == 2
? "微信"
: "支付宝"
}}</span>
<span v-else>--</span>
</template>
</el-table-column>
<el-table-column label="审核状态" min-width="120">
<template slot-scope="scope">
<span>{{ scope.row.status == 0 ? '待审核' : scope.row.status == 1 ? '审核通过' : '审核未通过' }}</span>
<span v-if="scope.row.status === -1" style="font-size: 12px;">
<span>{{
scope.row.status == 0
? "待审核"
: scope.row.status == 1
? "审核通过"
: "审核未通过"
}}</span>
<span v-if="scope.row.status === -1" style="font-size: 12px">
<br />
原因{{ scope.row.refusal }}
</span>
@ -152,16 +202,50 @@
</el-table-column>
<el-table-column label="到账状态" min-width="120">
<template slot-scope="scope">
<span>{{ scope.row.financial_status == 1 ? '已转账' : '未转账' }}</span>
<span>{{
scope.row.financial_status == 1 ? "已转账" : "未转账"
}}</span>
</template>
</el-table-column>
<el-table-column prop="mer_money" label="商户余额(元)" min-width="120"/>
<el-table-column label="操作" min-width="180" fixed="right" align="center">
<el-table-column
prop="mer_money"
label="商户余额(元)"
min-width="120"
/>
<el-table-column
label="操作"
min-width="180"
fixed="right"
align="center"
>
<template slot-scope="scope">
<el-button v-if="scope.row.status == 0" type="text" size="small" @click="transferDetail(scope.row.financial_id)">审核</el-button>
<el-button v-if="scope.row.status == 1 && scope.row.financial_status != 1" type="text" size="small" @click="transferDetail(scope.row.financial_id,1)">转账</el-button>
<el-button v-if="scope.row.status == 1 && scope.row.financial_status == 1" type="text" size="small" @click="transferDetail(scope.row.financial_id,0)">转账信息</el-button>
<el-button type="text" size="small" @click="transferMark(scope.row.financial_id)">备注</el-button>
<el-button
v-if="scope.row.status == 0"
type="text"
size="small"
@click="transferDetail(scope.row.financial_id)"
>审核</el-button
>
<el-button
v-if="scope.row.status == 1 && scope.row.financial_status != 1"
type="text"
size="small"
@click="transferDetail(scope.row.financial_id, 1)"
>转账</el-button
>
<el-button
v-if="scope.row.status == 1 && scope.row.financial_status == 1"
type="text"
size="small"
@click="transferDetail(scope.row.financial_id, 0)"
>转账信息</el-button
>
<el-button
type="text"
size="small"
@click="transferMark(scope.row.financial_id)"
>备注</el-button
>
</template>
</el-table-column>
</el-table>
@ -178,59 +262,169 @@
</div>
</el-card>
<!--转账信息-->
<el-dialog :title="transferData.status == 0 ? '审核' : '转账信息'" :visible.sync="dialogVisible" width="700px" v-if="dialogVisible">
<div class="box-container">
<div class="acea-row">
<div class="list sp100"><label class="name">商户名称</label>{{ transferData.merchant && transferData.merchant.mer_name }}</div>
<div class="list sp100"><label class="name">商户ID</label>{{ transferData.merchant && transferData.merchant.mer_id }}</div>
<div class="list sp100"><label class="name">商户余额</label>{{ transferData.mer_money }}</div>
<div class="list sp100"><label class="name">商户收款方式</label>{{ transferData.financial_type == 1 ? '银行卡' : transferData.financial_type == 2 ? '微信' : '支付宝' }}</div>
<div class="list sp100" v-if="transferData.financial_type == 1"><label class="name">开户银行</label>{{ transferData.financial_account.bank }}</div>
<div class="list sp100" v-if="transferData.financial_type == 1"><label class="name">银行账号</label>{{ transferData.financial_account.bank_code }}</div>
<div class="list sp100" v-if="transferData.financial_type == 1"><label class="name">开户户名</label>{{ transferData.financial_account.name }}</div>
<div class="list sp100" v-if="transferData.financial_type != 1"><label class="name">真实姓名</label>{{ transferData.financial_account.name }}</div>
<div class="list sp100" v-if="transferData.financial_type == 2"><label class="name">微信号</label>{{ transferData.financial_account.wechat }}</div>
<div class="list sp100 image" v-if="transferData.financial_type == 2"><label class="name">微信收款二维码:</label><img style="max-width: 150px; height: 80px;" @click="getPicture(transferData.financial_account.wechat_code);return false;" :src="transferData.financial_account.wechat_code"/></div>
<div class="list sp100" v-if="transferData.financial_type == 3"><label class="name">支付宝账号</label>{{ transferData.financial_account.alipay }}</div>
<div class="list sp100 image" v-if="transferData.financial_type == 3"><label class="name">支付宝收款二维码:</label><img style="max-width: 150px; height: 80px;" @click="getPicture(transferData.financial_account.alipay_code);return false;" :src="transferData.financial_account.alipay_code"/></div>
<div class="list sp100"><label class="name">本次申请转账金额</label><span class="font-red">{{ transferData.extract_money }}</span></div>
<div class="list sp100" v-if="transferData.status != 0"><label class="name">审核状态</label>{{ transferData.status == 0 ? '待审核' : transferData.status == 1 ? '已审核' : '审核失败' }}</div>
<div class="list sp100" v-if="transferData.status == 1"><label class="name">审核时间</label>{{ transferData.status_time }}</div>
<div class="list sp100" v-if="transferData.status == -1"><label class="name">审核未通过原因</label>{{ transferData.refusal }}</div>
<el-form ref="ruleForm" class="demo-ruleForm" label-width="90px">
<el-form-item label="审核状态:" required v-if="transferData.status == 0">
<el-radio-group v-model="formValidate.status">
<el-radio :label="1" class="radio">通过</el-radio>
<el-radio :label="-1">拒绝</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="原因:" required v-if="formValidate.status == -1">
<el-input type="textarea" v-model="formValidate.refusal"></el-input>
</el-form-item>
<el-form-item label="转账凭证:" v-if="transferData.status == 1">
<div class="acea-row">
<div v-if="voucher_image.length > 0" v-for="(item,index) in voucher_image" :key="index" class="pictrue">
<img :src="item" @click="getPicture(item)"/>
<i class="el-icon-error btndel" @click="handleRemove(index)" />
</div>
<div class="upLoadPicBox" @click="modalPicTap('2')">
<div class="upLoad">
<i class="el-icon-upload2" />
</div>
</div>
</div>
</el-form-item>
<el-form-item>
<el-button v-if="transferData.status == 0" type="primary" @click="transferReview(transferData.financial_id)">提交</el-button>
<el-button v-if="transferData.status == 1" type="primary" @click="onSubmit(transferData.financial_id)">提交</el-button>
</el-form-item>
</el-form>
</div>
<el-dialog
:title="transferData.status == 0 ? '审核' : '转账信息'"
:visible.sync="dialogVisible"
width="700px"
v-if="dialogVisible"
>
<div class="box-container">
<div class="acea-row">
<div class="list sp100">
<label class="name">商户名称</label
>{{ transferData.merchant && transferData.merchant.mer_name }}
</div>
<div class="list sp100">
<label class="name">商户ID</label
>{{ transferData.merchant && transferData.merchant.mer_id }}
</div>
<div class="list sp100">
<label class="name">商户余额</label>{{ transferData.mer_money }}
</div>
<div class="list sp100">
<label class="name">商户收款方式</label
>{{
transferData.financial_type == 1
? "银行卡"
: transferData.financial_type == 2
? "微信"
: "支付宝"
}}
</div>
<div class="list sp100" v-if="transferData.financial_type == 1">
<label class="name">银行</label
>{{ transferData.financial_account.bank }}
</div>
<div class="list sp100" v-if="transferData.financial_type == 1">
<label class="name">卡号</label
>{{ transferData.financial_account.bank_code }}
</div>
<div class="list sp100" v-if="transferData.financial_type == 1">
<label class="name">持卡人</label
>{{ transferData.financial_account.name }}
</div>
<div class="list sp100" v-if="transferData.financial_type != 1">
<label class="name">真实姓名</label
>{{ transferData.financial_account.name }}
</div>
<div class="list sp100" v-if="transferData.financial_type == 2">
<label class="name">微信号</label
>{{ transferData.financial_account.wechat }}
</div>
<div class="list sp100 image" v-if="transferData.financial_type == 2">
<label class="name">微信收款二维码</label
><img
style="max-width: 150px; height: 80px"
@click="
getPicture(transferData.financial_account.wechat_code);
return false;
"
:src="transferData.financial_account.wechat_code"
/>
</div>
<div class="list sp100" v-if="transferData.financial_type == 3">
<label class="name">支付宝账号</label
>{{ transferData.financial_account.alipay }}
</div>
<div class="list sp100 image" v-if="transferData.financial_type == 3">
<label class="name">支付宝收款二维码</label
><img
style="max-width: 150px; height: 80px"
@click="
getPicture(transferData.financial_account.alipay_code);
return false;
"
:src="transferData.financial_account.alipay_code"
/>
</div>
<div class="list sp100">
<label class="name">本次申请转账金额</label
><span class="font-red">{{ transferData.extract_money }}</span>
</div>
<div class="list sp100" v-if="transferData.status != 0">
<label class="name">审核状态</label
>{{
transferData.status == 0
? "待审核"
: transferData.status == 1
? "已审核"
: "审核失败"
}}
</div>
<div class="list sp100" v-if="transferData.status == 1">
<label class="name">审核时间</label>{{ transferData.status_time }}
</div>
<div class="list sp100" v-if="transferData.status == -1">
<label class="name">审核未通过原因</label
>{{ transferData.refusal }}
</div>
<el-form ref="ruleForm" class="demo-ruleForm" label-width="90px">
<el-form-item
label="审核状态:"
required
v-if="transferData.status == 0"
>
<el-radio-group v-model="formValidate.status">
<el-radio :label="1" class="radio">通过</el-radio>
<el-radio :label="-1">拒绝</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label="原因:"
required
v-if="formValidate.status == -1"
>
<el-input
type="textarea"
v-model="formValidate.refusal"
></el-input>
</el-form-item>
<el-form-item label="转账凭证:" v-if="transferData.status == 1">
<div class="acea-row">
<div
v-if="voucher_image.length > 0"
v-for="(item, index) in voucher_image"
:key="index"
class="pictrue"
>
<img :src="item" @click="getPicture(item)" />
<i
class="el-icon-error btndel"
@click="handleRemove(index)"
/>
</div>
<div class="upLoadPicBox" @click="modalPicTap('2')">
<div class="upLoad">
<i class="el-icon-upload2" />
</div>
</div>
</div>
</el-form-item>
<el-form-item>
<el-button
v-if="transferData.status == 0"
type="primary"
@click="transferReview(transferData.financial_id)"
>提交</el-button
>
<el-button
v-if="transferData.status == 1"
type="primary"
@click="onSubmit(transferData.financial_id)"
>提交</el-button
>
</el-form-item>
</el-form>
</div>
</div>
</el-dialog>
<!--查看二维码-->
<el-dialog :visible.sync="pictureVisible" width="700px" v-if="pictureVisible">
<img :src="pictureUrl" class="pictures"/>
<el-dialog
:visible.sync="pictureVisible"
width="700px"
v-if="pictureVisible"
>
<img :src="pictureUrl" class="pictures" />
</el-dialog>
<!--导出订单列表-->
<file-list ref="exportList" />
@ -254,7 +448,7 @@ import fileList from '@/components/exportFile/fileList'
export default {
components: { cardsData, fileList },
name: 'transferRecord',
data() {
data () {
return {
type: '',
tableData: {
@ -316,7 +510,7 @@ export default {
},
}
},
mounted() {
mounted () {
this.getList(1);
this.getMerSelect();
this.getHeaderData();
@ -324,7 +518,7 @@ export default {
methods: {
//
getMerSelect() {
getMerSelect () {
merSelectApi()
.then((res) => {
this.merSelect = res.data;
@ -334,124 +528,124 @@ export default {
});
},
//
getHeaderData(){
transferHeaderDataApi().then((res) => {
this.cardLists = res.data
})
getHeaderData () {
transferHeaderDataApi().then((res) => {
this.cardLists = res.data
})
.catch((res) => {
this.$message.error(res.message);
});
},
//
transferDetail(id,num){
if(num) this.voucher_image = []
transferDetailApi(id).then(res => {
this.listLoading = false;
this.dialogVisible = true;
this.transferData = res.data
this.formValidate.status = res.data.status
if(num){
this.voucher_image = []
}else{
this.voucher_image = res.data.image
}
})
transferDetail (id, num) {
if (num) this.voucher_image = []
transferDetailApi(id).then(res => {
this.listLoading = false;
this.dialogVisible = true;
this.transferData = res.data
this.formValidate.status = res.data.status
if (num) {
this.voucher_image = []
} else {
this.voucher_image = res.data.image
}
})
.catch(res => {
this.listLoading = false;
this.$message.error(res.message)
})
},
//
getPicture(url){
this.pictureVisible = true;
this.pictureUrl = url;
getPicture (url) {
this.pictureVisible = true;
this.pictureUrl = url;
},
//
transferReview(id){
let parmas = {
status: this.formValidate.status,
refusal: this.formValidate.refusal
}
transferReviewApi(id,parmas).then(res => {
this.listLoading = false;
this.$message.success(res.message);
this.dialogVisible = false;
this.getList(1);
}).catch(res => {
this.listLoading = false;
this.$message.error(res.message)
})
transferReview (id) {
let parmas = {
status: this.formValidate.status,
refusal: this.formValidate.refusal
}
transferReviewApi(id, parmas).then(res => {
this.listLoading = false;
this.$message.success(res.message);
this.dialogVisible = false;
this.getList(1);
}).catch(res => {
this.listLoading = false;
this.$message.error(res.message)
})
},
//
transferMark(id){
this.$modalForm(transferMarkApi(id)).then(() => this.getList('1'))
transferMark (id) {
this.$modalForm(transferMarkApi(id)).then(() => this.getList('1'))
},
//
onSubmit(id){
if(this.voucher_image == 0){
return this.$message.error('请上传转账凭证!')
}else{
transferEditApi(id,{image: this.voucher_image}).then(res => {
this.$message.success(res.message)
this.dialogVisible = false;
this.getList(1);
}).catch(res => {
this.$message.error(res.message)
})
}
onSubmit (id) {
if (this.voucher_image == 0) {
return this.$message.error('请上传转账凭证!')
} else {
transferEditApi(id, { image: this.voucher_image }).then(res => {
this.$message.success(res.message)
this.dialogVisible = false;
this.getList(1);
}).catch(res => {
this.$message.error(res.message)
})
}
},
//
modalPicTap(tit, num, i) {
const _this = this;
const attr = [];
this.$modalUpload(function (img) {
if (tit === "2" && !num) {
img.map((item) => {
attr.push(item.attachment_src);
_this.voucher_image.push(item);
if(_this.voucher_image.length > 6){
_this.voucher_image.length = 6
}
});
//
modalPicTap (tit, num, i) {
const _this = this;
const attr = [];
this.$modalUpload(function (img) {
if (tit === "2" && !num) {
img.map((item) => {
attr.push(item.attachment_src);
_this.voucher_image.push(item);
if (_this.voucher_image.length > 6) {
_this.voucher_image.length = 6
}
}, tit);
});
}
}, tit);
},
handleRemove(i) {
this.voucher_image.splice(i, 1);
handleRemove (i) {
this.voucher_image.splice(i, 1);
},
//
selectChange(tab) {
selectChange (tab) {
this.tableFrom.date = tab
this.timeVal = []
this.getList(1)
},
//
onchangeTime(e) {
onchangeTime (e) {
this.timeVal = e
this.tableFrom.date = e ? this.timeVal.join('-') : ''
this.getList(1)
},
async exports() {
async exports () {
let excelData = JSON.parse(JSON.stringify(this.tableFrom)), data = []
excelData.page = 1
let pageCount = 1
let lebData = {};
for (let i = 0; i < pageCount; i++) {
lebData = await this.downData(excelData)
pageCount = Math.ceil(lebData.count/excelData.limit)
pageCount = Math.ceil(lebData.count / excelData.limit)
if (lebData.export.length) {
data = data.concat(lebData.export)
excelData.page++
}
}
}
createWorkBook(lebData.header, lebData.title, data, lebData.foot,lebData.filename);
createWorkBook(lebData.header, lebData.title, data, lebData.foot, lebData.filename);
return
},
/**订单列表 */
downData(excelData) {
downData (excelData) {
return new Promise((resolve, reject) => {
transferRecordsExportApi(excelData).then((res) => {
return resolve(res.data)
@ -459,7 +653,7 @@ export default {
})
},
//
exportRecord() {
exportRecord () {
transferRecordsExportApi(this.tableFrom)
.then((res) => {
/*this.$message.success(res.message)
@ -482,11 +676,11 @@ export default {
})
},
//
getExportFileList() {
getExportFileList () {
this.$refs.exportList.exportFileList()
},
//
getList(num) {
getList (num) {
this.listLoading = true
this.tableFrom.page = num ? num : this.tableFrom.page;
transferRecordApi(this.tableFrom)
@ -500,16 +694,16 @@ export default {
this.listLoading = false
})
},
pageChange(page) {
pageChange (page) {
this.tableFrom.page = page
this.getList()
},
handleSizeChange(val) {
handleSizeChange (val) {
this.tableFrom.limit = val
this.getList()
},
handleClose() {
handleClose () {
this.dialogLogistics = false
},
}
@ -517,7 +711,7 @@ export default {
</script>
<style lang="scss" scoped>
/deep/ .el-dialog__title{
/deep/ .el-dialog__title {
font-weight: bold;
}
.selWidth {
@ -541,30 +735,30 @@ export default {
box-sizing: border-box;
}
.pictrue {
width: 60px;
height: 60px;
border: 1px dotted rgba(0, 0, 0, 0.1);
margin-right: 10px;
position: relative;
cursor: pointer;
img {
width: 100%;
height: 100%;
}
width: 60px;
height: 60px;
border: 1px dotted rgba(0, 0, 0, 0.1);
margin-right: 10px;
position: relative;
cursor: pointer;
img {
width: 100%;
height: 100%;
}
}
.btndel {
position: absolute;
z-index: 1;
width: 20px !important;
height: 20px !important;
left: 46px;
top: -4px;
position: absolute;
z-index: 1;
width: 20px !important;
height: 20px !important;
left: 46px;
top: -4px;
}
.box-container {
overflow: hidden;
padding: 0 10px;
}
.box-container .title{
.box-container .title {
margin: 15px 0 10px;
color: #333;
font-weight: bold;
@ -575,10 +769,10 @@ export default {
float: left;
line-height: 40px;
}
.box-container .list .info{
.box-container .list .info {
display: block;
.el-textarea{
margin-top: 10px;
.el-textarea {
margin-top: 10px;
}
}
.box-container .list.image {
@ -601,15 +795,15 @@ export default {
.box-container .list .name {
align-items: center;
display: inline-block;
// width: 130px;
// width: 130px;
color: #606266;
text-align: right;
}
.acea-row{
.acea-row {
margin-bottom: 25px;
}
.pictures{
width: 100%;
max-width: 100%;
.pictures {
width: 100%;
max-width: 100%;
}
</style>

View File

@ -5,30 +5,91 @@
<div class="container">
<el-form size="small" label-width="100px" :inline="true">
<el-form-item label="选择时间:" style="display: inline-block">
<el-radio-group v-model="tableFrom.date" size="small" @change="selectChange(tableFrom.date)">
<el-radio-button v-for="(itemn, indexn) in fromList.fromTxt" :key="indexn" :label="itemn.val">{{ itemn.text }}</el-radio-button>
<el-radio-group
v-model="tableFrom.date"
size="small"
@change="selectChange(tableFrom.date)"
>
<el-radio-button
v-for="(itemn, indexn) in fromList.fromTxt"
:key="indexn"
:label="itemn.val"
>{{ itemn.text }}</el-radio-button
>
</el-radio-group>
<el-date-picker v-model="timeVal" type="daterange" placeholder="选择日期" format="yyyy/MM/dd" value-format="yyyy/MM/dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="onchangeTime" />
<el-date-picker
v-model="timeVal"
type="daterange"
placeholder="选择日期"
format="yyyy/MM/dd"
value-format="yyyy/MM/dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="onchangeTime"
/>
</el-form-item>
<el-form-item label="关键字:" label-width="80px" style="display: inline-block">
<el-input v-model="tableFrom.keyword" @keyup.enter.native="getList(1)" placeholder="请输入店铺关键字/店铺名/联系电话" class="selWidth">
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="getList(1)" />
<el-form-item
label="关键字:"
label-width="80px"
style="display: inline-block"
>
<el-input
v-model="tableFrom.keyword"
@keyup.enter.native="getList(1)"
placeholder="请输入店铺关键字/店铺名/联系电话"
class="selWidth"
>
<el-button
slot="append"
icon="el-icon-search"
class="el-button-solt"
@click="getList(1)"
/>
</el-input>
</el-form-item>
<el-form-item label="商户类别:">
<el-select v-model="tableFrom.is_trader" clearable placeholder="请选择" class="selWidth" @change="getList(1)">
<el-select
v-model="tableFrom.is_trader"
clearable
placeholder="请选择"
class="selWidth"
@change="getList(1)"
>
<el-option label="自营" value="1" />
<el-option label="非自营" value="0" />
</el-select>
</el-form-item>
<el-form-item label="商户分类:">
<el-select v-model="tableFrom.category_id" clearable placeholder="请选择" class="selWidth" @change="getList(1)">
<el-option v-for="item in merCateList" :key="item.value" :label="item.label" :value="item.value" />
<el-select
v-model="tableFrom.category_id"
clearable
placeholder="请选择"
class="selWidth"
@change="getList(1)"
>
<el-option
v-for="item in merCateList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="店铺类型:">
<el-select v-model="tableFrom.type_id" clearable placeholder="请选择" class="selWidth" @change="getList(1)">
<el-option v-for="item in storeType" :key="item.value" :label="item.label" :value="item.value" />
<el-select
v-model="tableFrom.type_id"
clearable
placeholder="请选择"
class="selWidth"
@change="getList(1)"
>
<el-option
v-for="item in storeType"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="店铺商圈:">
@ -46,17 +107,43 @@
:value="item.code"
/>
</el-select> -->
<el-cascader v-model="tableFrom.area_id" :options="form.options" @change="handleChange1"></el-cascader>
<el-cascader v-model="tableFrom.street_id" :options="form.options1" @change="getList(1)"></el-cascader>
<el-cascader
v-model="tableFrom.area_id"
:options="form.options"
@change="handleChange1"
></el-cascader>
<el-cascader
v-model="tableFrom.street_id"
:options="form.options1"
@change="getList(1)"
></el-cascader>
</el-form-item>
<el-tabs v-if="headeNum.length > 0" v-model="tableFrom.status" @tab-click="getList(1), getHeadNum()">
<el-tab-pane v-for="(item, index) in headeNum" :key="index" :name="item.type.toString()" :label="item.title + '(' + item.count + ')'" />
<el-tabs
v-if="headeNum.length > 0"
v-model="tableFrom.status"
@tab-click="getList(1), getHeadNum()"
>
<el-tab-pane
v-for="(item, index) in headeNum"
:key="index"
:name="item.type.toString()"
:label="item.title + '(' + item.count + ')'"
/>
</el-tabs>
</el-form>
</div>
<el-button size="small" type="primary" @click="onAdd">添加商户</el-button>
<el-button size="small" type="primary" @click="onAdd"
>添加商户</el-button
>
</div>
<el-table v-loading="listLoading" :data="tableData.data" style="width: 100%" size="small" highlight-current-row class="switchTable">
<el-table
v-loading="listLoading"
:data="tableData.data"
style="width: 100%"
size="small"
highlight-current-row
class="switchTable"
>
<el-table-column prop="mer_id" label="ID" min-width="60" />
<el-table-column prop="mer_name" label="商户名称" min-width="150" />
<!--<el-table-column prop="mer_name" label="商户类别" min-width="90">
@ -80,7 +167,15 @@
<el-table-column prop="mark" label="备注" min-width="200" />
<el-table-column prop="status" label="推荐" min-width="100">
<template slot-scope="scope">
<el-switch v-model="scope.row.is_best" :active-value="1" :inactive-value="0" active-text="是" inactive-text="否" disabled @click.native="onchangeIsShow(scope.row)" />
<el-switch
v-model="scope.row.is_best"
:active-value="1"
:inactive-value="0"
active-text="是"
inactive-text="否"
disabled
@click.native="onchangeIsShow(scope.row)"
/>
</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间" min-width="150" />
@ -99,10 +194,23 @@
<el-table-column prop="status" label="开启/关闭" min-width="100">
<template slot-scope="scope">
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" active-text="开启" inactive-text="关闭" disabled @click.native="onchangeIsClose(scope.row)" />
<el-switch
v-model="scope.row.status"
:active-value="1"
:inactive-value="0"
active-text="开启"
inactive-text="关闭"
disabled
@click.native="onchangeIsClose(scope.row)"
/>
</template>
</el-table-column>
<el-table-column label="操作" min-width="280" fixed="right" align="center">
<el-table-column
label="操作"
min-width="280"
fixed="right"
align="center"
>
<template slot-scope="scope">
<!-- <router-link
v-if="tableFrom.status === '1'"
@ -110,11 +218,40 @@
>
<el-button type="text" size="small" class="mr10">对账</el-button>
</router-link>-->
<el-button v-if="tableFrom.status === '1'" type="text" size="small" @click="onLogo(scope.row.mer_id)">登录</el-button>
<el-button type="text" size="small" @click="onEdit(scope.row.mer_id)">编辑</el-button>
<el-button v-if="tableFrom.status === '1'" type="text" size="small" @click="onPassword(scope.row.mer_id)">修改管理员密码</el-button>
<el-button v-if="tableFrom.status === '0'" type="text" size="small" @click="handleDelete(scope.row.mer_id, scope.$index)">删除</el-button>
<el-button v-if="tableFrom.status === '1'" type="text" size="small" @click="handleTimes(scope.row.mer_id)">设置第三方平台商品复制次数</el-button>
<el-button
v-if="tableFrom.status === '1'"
type="text"
size="small"
@click="onLogo(scope.row.mer_id)"
>登录</el-button
>
<el-button
type="text"
size="small"
@click="onEdit(scope.row.mer_id)"
>编辑</el-button
>
<el-button
v-if="tableFrom.status === '1'"
type="text"
size="small"
@click="onPassword(scope.row.mer_id)"
>修改管理员密码</el-button
>
<el-button
v-if="tableFrom.status === '0'"
type="text"
size="small"
@click="handleDelete(scope.row.mer_id, scope.$index)"
>删除</el-button
>
<el-button
v-if="tableFrom.status === '1'"
type="text"
size="small"
@click="handleTimes(scope.row.mer_id)"
>设置第三方平台商品复制次数</el-button
>
<!-- <el-button
v-if="tableFrom.status === '1'"
type="text"
@ -125,93 +262,312 @@
</el-table-column>
</el-table>
<div class="block">
<el-pagination :page-sizes="[20, 40, 60, 80]" :page-size="tableFrom.limit" :current-page="tableFrom.page" layout="total, sizes, prev, pager, next, jumper" :total="tableData.total" @size-change="handleSizeChange" @current-change="pageChange" />
<el-pagination
:page-sizes="[20, 40, 60, 80]"
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</el-card>
<!-- 添加商户弹出层 -->
<el-dialog :title="edit == 0 ? '新增商户信息' : '编辑商户信息'" :visible.sync="popFormVisible" @close="close('form')">
<el-dialog
:title="edit == 0 ? '新增商户信息' : '编辑商户信息'"
:visible.sync="popFormVisible"
@close="close('form')"
>
<el-form :model="form" :rules="rules" ref="form">
<el-form-item label="商户名称" :label-width="formLabelWidth" prop="mer_name">
<el-input v-model="form.mer_name" autocomplete="off" placeholder="请输入商户名称"></el-input>
<el-form-item
label="商户名称"
:label-width="formLabelWidth"
prop="mer_name"
>
<el-input
v-model="form.mer_name"
autocomplete="off"
placeholder="请输入商户名称"
></el-input>
</el-form-item>
<el-form-item label="商户分类" :label-width="formLabelWidth" >
<el-form-item label="商户分类" :label-width="formLabelWidth">
<el-select v-model="form.category_id" placeholder="请选择商户分类">
<el-option :label="item.label" :value="item.value" v-for="item in merCateList" :key="item.value"></el-option>
<el-option
:label="item.label"
:value="item.value"
v-for="item in merCateList"
:key="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="店铺类型" :label-width="formLabelWidth" prop="type_id">
<el-form-item
label="店铺类型"
:label-width="formLabelWidth"
prop="type_id"
>
<el-select v-model="form.type_id" placeholder="请选择店铺类型">
<el-option :label="item.label" :value="item.value" v-for="item in storeType" :key="item.value"></el-option>
<el-option
:label="item.label"
:value="item.value"
v-for="item in storeType"
:key="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="商圈" :label-width="formLabelWidth">
<el-cascader v-model="form.info" :options="form.options" @change="handleChange1"></el-cascader>
<el-cascader v-model="form.info1" :options="form.options1" @change="handleChange2"></el-cascader>
<el-cascader v-model="form.info2" :options="form.options2" @change="handleChange3($event, form.options2)"></el-cascader>
<el-cascader
v-model="form.info"
:options="form.options"
@change="handleChange1"
></el-cascader>
<el-cascader
v-model="form.info1"
:options="form.options1"
@change="handleChange2"
></el-cascader>
<el-cascader
v-model="form.info2"
:options="form.options2"
@change="handleChange3($event, form.options2)"
></el-cascader>
</el-form-item>
<el-form-item label="商户账号" :label-width="formLabelWidth" prop="mer_account">
<el-input v-model="form.mer_account" autocomplete="off" placeholder="请输入商户账号" :disabled="!add"></el-input>
<el-form-item
label="商户账号"
:label-width="formLabelWidth"
prop="mer_account"
>
<el-input
v-model="form.mer_account"
autocomplete="off"
placeholder="请输入商户账号"
:disabled="!add"
></el-input>
</el-form-item>
<el-form-item label="登陆密码" :label-width="formLabelWidth" prop="mer_password">
<el-input v-model="form.mer_password" autocomplete="off" placeholder="请输入登陆密码" :disabled="!add"></el-input>
<el-form-item
label="登陆密码"
:label-width="formLabelWidth"
prop="mer_password"
>
<el-input
v-model="form.mer_password"
autocomplete="off"
placeholder="请输入登陆密码"
:disabled="!add"
></el-input>
</el-form-item>
<div class="dis">
<el-form-item label="保证金额度" :label-width="formLabelWidth" class="mer_phone">
<el-input v-model="form.ot_margin" style="width: 200px" autocomplete="off" disabled placeholder="保证金额度"></el-input>
<el-form-item
label="保证金额度"
:label-width="formLabelWidth"
class="mer_phone"
>
<el-input
v-model="form.ot_margin"
style="width: 200px"
autocomplete="off"
disabled
placeholder="保证金额度"
></el-input>
</el-form-item>
<el-form-item label="已缴纳的保证金" :label-width="formLabelWidth" class="mer_phone">
<el-input v-model="form.paid_margin" style="width: 200px" autocomplete="off" disabled placeholder="已缴纳的保证金"></el-input>
<el-form-item
label="已缴纳的保证金"
:label-width="formLabelWidth"
class="mer_phone"
>
<el-input
v-model="form.paid_margin"
style="width: 200px"
autocomplete="off"
disabled
placeholder="已缴纳的保证金"
></el-input>
</el-form-item>
</div>
<div class="dis">
<el-form-item label="需缴纳的保证金" :label-width="formLabelWidth" class="mer_phone">
<el-input v-model="form.margin" style="width: 200px" autocomplete="off" placeholder="请输入需缴纳的保证金"></el-input>
<el-form-item
label="需缴纳的保证金"
:label-width="formLabelWidth"
class="mer_phone"
>
<el-input
v-model="form.margin"
style="width: 200px"
autocomplete="off"
placeholder="请输入需缴纳的保证金"
></el-input>
</el-form-item>
<el-form-item label="自动扣除保证金比例" :label-width="formLabelWidth" prop="commission_rate">
<el-input v-model="form.auto_margin_rate" style="width: 200px" autocomplete="off"></el-input>
<el-form-item
label="自动扣除保证金比例"
:label-width="formLabelWidth"
prop="commission_rate"
>
<el-input
v-model="form.auto_margin_rate"
style="width: 200px"
autocomplete="off"
></el-input>
</el-form-item>
</div>
<el-form-item label="商户姓名" :label-width="formLabelWidth" prop="real_name">
<el-input v-model="form.real_name" autocomplete="off" placeholder="请输入商户姓名"></el-input>
<el-form-item
label="商户姓名"
:label-width="formLabelWidth"
prop="real_name"
>
<el-input
v-model="form.real_name"
autocomplete="off"
placeholder="请输入商户姓名"
></el-input>
</el-form-item>
<div class="dis">
<el-form-item label="商户手机号" :label-width="formLabelWidth" prop="mer_phone" class="mer_phone">
<el-input v-model="form.mer_phone" autocomplete="off" placeholder="请输入商户手机号"></el-input>
<el-form-item
label="商户手机号"
:label-width="formLabelWidth"
prop="mer_phone"
class="mer_phone"
>
<el-input
v-model="form.mer_phone"
autocomplete="off"
placeholder="请输入商户手机号"
></el-input>
</el-form-item>
<el-form-item label="手续费(%)" :label-width="formLabelWidth" prop="commission_rate">
<el-input-number v-model="form.commission_rate" @change="handleChange" :min="0" :max="10" label="描述文字" aria-placeholder="请输入手续费"></el-input-number>
<el-form-item
label="手续费(%)"
:label-width="formLabelWidth"
prop="commission_rate"
>
<el-input-number
v-model="form.commission_rate"
@change="handleChange"
:min="0"
:max="10"
label="描述文字"
aria-placeholder="请输入手续费"
></el-input-number>
</el-form-item>
</div>
<el-form-item label="商户关键字" :label-width="formLabelWidth" prop="mer_keyword">
<el-input v-model="form.mer_keyword" autocomplete="off" placeholder="请输入商户关键字"></el-input>
<el-form-item
label="商户关键字"
:label-width="formLabelWidth"
prop="mer_keyword"
>
<el-input
v-model="form.mer_keyword"
autocomplete="off"
placeholder="请输入商户关键字"
></el-input>
</el-form-item>
<el-form-item label="商户地址" :label-width="formLabelWidth" prop="mer_address">
<el-input v-model="form.mer_address" autocomplete="off" placeholder="请输入商户地址"></el-input>
<el-form-item
label="商户地址"
:label-width="formLabelWidth"
prop="mer_address"
>
<el-input
v-model="form.mer_address"
autocomplete="off"
placeholder="请输入商户地址"
></el-input>
</el-form-item>
<el-form-item label="微信分账商户号" :label-width="formLabelWidth" prop="sub_mchid">
<el-input v-model="form.sub_mchid" autocomplete="off" placeholder="请输入微信分账商户号"></el-input>
<el-form-item
label="微信分账商户号"
:label-width="formLabelWidth"
prop="sub_mchid"
>
<el-input
v-model="form.sub_mchid"
autocomplete="off"
placeholder="请输入微信分账商户号"
></el-input>
</el-form-item>
<el-form-item label="备注" :label-width="formLabelWidth" prop="mark">
<el-input type="textarea" placeholder="请输入备注" maxlength="130" v-model="form.mark" autocomplete="off"></el-input>
<el-input
type="textarea"
placeholder="请输入备注"
maxlength="130"
v-model="form.mark"
autocomplete="off"
></el-input>
</el-form-item>
<el-form-item label="排序" :label-width="formLabelWidth" prop="sort">
<el-input-number v-model="form.sort" @change="handleChange" :min="0" :max="10"></el-input-number>
<el-input-number
v-model="form.sort"
@change="handleChange"
:min="0"
:max="10"
></el-input-number>
</el-form-item>
<div class="switch_btn">
<el-form-item class="mini_btn" label="直播间审核" prop="value1" :label-width="formLabelWidth">
<el-switch v-model="form.value1" active-color="#3390ff" active-text="开" inactive-text="关" inactive-color="#DCDFE6"></el-switch>
<el-form-item
class="mini_btn"
label="直播间审核"
prop="value1"
:label-width="formLabelWidth"
>
<el-switch
v-model="form.value1"
active-color="#3390ff"
active-text="开"
inactive-text="关"
inactive-color="#DCDFE6"
></el-switch>
</el-form-item>
<el-form-item class="mini_btn" label="产品审核" prop="value2" :label-width="formLabelWidth">
<el-switch v-model="form.value2" active-color="#3390ff" active-text="开" inactive-text="关" inactive-color="#DCDFE6"></el-switch>
<el-form-item
class="mini_btn"
label="产品审核"
prop="value2"
:label-width="formLabelWidth"
>
<el-switch
v-model="form.value2"
active-color="#3390ff"
active-text="开"
inactive-text="关"
inactive-color="#DCDFE6"
></el-switch>
</el-form-item>
<el-form-item class="mini_btn" label="直播间商品审核" prop="value3" :label-width="formLabelWidth">
<el-switch v-model="form.value3" active-color="#3390ff" active-text="开" inactive-text="关" inactive-color="#DCDFE6"></el-switch>
<el-form-item
class="mini_btn"
label="直播间商品审核"
prop="value3"
:label-width="formLabelWidth"
>
<el-switch
v-model="form.value3"
active-color="#3390ff"
active-text="开"
inactive-text="关"
inactive-color="#DCDFE6"
></el-switch>
</el-form-item>
<el-form-item class="mini_btn" label="是否推荐" prop="value4" :label-width="formLabelWidth">
<el-switch v-model="form.value4" active-color="#3390ff" active-text="开" inactive-text="关" inactive-color="#DCDFE6"></el-switch>
<el-form-item
class="mini_btn"
label="是否推荐"
prop="value4"
:label-width="formLabelWidth"
>
<el-switch
v-model="form.value4"
active-color="#3390ff"
active-text="开"
inactive-text="关"
inactive-color="#DCDFE6"
></el-switch>
</el-form-item>
<el-form-item class="mini_btn" label="是否自营" prop="value5" :label-width="formLabelWidth">
<el-switch v-model="form.value5" active-color="#3390ff" active-text="开" inactive-text="关" inactive-color="#DCDFE6"></el-switch>
<el-form-item
class="mini_btn"
label="是否自营"
prop="value5"
:label-width="formLabelWidth"
>
<el-switch
v-model="form.value5"
active-color="#3390ff"
active-text="开"
inactive-text="关"
inactive-color="#DCDFE6"
></el-switch>
</el-form-item>
</div>
</el-form>
@ -260,12 +616,13 @@ import SettingMer from "@/libs/settingMer";
import Cookies from "js-cookie";
export default {
name: "MerchantList",
data() {
data () {
return {
add: true,
//
popFormVisible: false,
merid: "",
edit: 0,
form: {
mer_name: "", //
category_id: "", //
@ -363,24 +720,24 @@ export default {
};
},
created() {
created () {
this.getshopList();
},
beforeMount() { },
mounted() {
beforeMount () { },
mounted () {
this.getHeadNum();
this.getMerCategory();
this.getStoreType();
this.getList("");
},
methods: {
close(formName) {
close (formName) {
this.resetForm(formName);
},
handleChange(value) {
handleChange (value) {
// console.log(value);
},
async handleChange1(value) {
async handleChange1 (value) {
console.log(value);
const data = { area_code: value[0] };
const promise = await getShopAddressApi_two(data);
@ -392,7 +749,7 @@ export default {
}
console.log(this.form.info1);
},
async handleChange2(value, ID) {
async handleChange2 (value, ID) {
console.log(value, ID);
if (value !== value) {
this.form.info2 = 0;
@ -405,7 +762,7 @@ export default {
}
this.form.options2 = promise.data;
},
handleChange3(e, val) {
handleChange3 (e, val) {
// let id=''
// for(let item of val){
// if(item.code==e){
@ -431,17 +788,17 @@ export default {
// this.form.street_id = this.form.info1[0]
// this.form.village_id = id
},
open4(err) {
open4 (err) {
this.$message.error(err);
},
open2(sus) {
open2 (sus) {
this.$message({
message: sus,
type: "success"
});
},
//
submitForm(formName) {
submitForm (formName) {
console.log("1------------------1");
this.$refs[formName].validate(async valid => {
if (valid) {
@ -515,20 +872,20 @@ export default {
});
},
//
resetForm(formName) {
resetForm (formName) {
this.$nextTick(() => {
this.$refs[formName].resetFields();
});
// this.$refs[formName].resetFields();
},
//
handleChange(value) {
handleChange (value) {
console.log(value);
},
//
getShopClassify() { },
getShopClassify () { },
//
async getshopList() {
async getshopList () {
const data = { city_code: "510500" };
const promise = await getShopAddressApi(data).then(
res => {
@ -543,7 +900,7 @@ export default {
}
);
},
onLogo(id) {
onLogo (id) {
merchantLoginApi(id)
.then(res => {
Cookies.set("merchantToken", res.data.token);
@ -554,21 +911,21 @@ export default {
});
},
//
selectChange(tab) {
selectChange (tab) {
this.tableFrom.date = tab;
this.timeVal = [];
this.tableFrom.page = 1;
this.getList("");
},
//
onchangeTime(e) {
onchangeTime (e) {
this.timeVal = e;
this.tableFrom.date = this.timeVal ? this.timeVal.join("-") : "";
this.tableFrom.page = 1;
this.getList("");
},
//
getHeadNum() {
getHeadNum () {
merchantCountApi()
.then(res => {
this.headeNum[0]["count"] = res.data.valid;
@ -577,7 +934,7 @@ export default {
.catch(res => { });
},
//
getMerCategory() {
getMerCategory () {
getMerCateApi()
.then(res => {
this.merCateList = res.data;
@ -586,7 +943,7 @@ export default {
this.$message.error(res.message);
});
},
getStoreType() {
getStoreType () {
getstoreTypeApi()
.then(res => {
this.storeType = res.data;
@ -596,7 +953,7 @@ export default {
});
},
//
getList(num) {
getList (num) {
console.log(this.tableFrom);
this.listLoading = true;
this.tableFrom.page = num ? num : this.tableFrom.page;
@ -613,16 +970,16 @@ export default {
this.$message.error(res.message);
});
},
pageChange(page) {
pageChange (page) {
this.tableFrom.page = page;
this.getList("");
},
handleSizeChange(val) {
handleSizeChange (val) {
this.tableFrom.limit = val;
this.getList(1);
},
//
onchangeIsShow(row) {
onchangeIsShow (row) {
const title = row.is_best === 0 ? "是否开启推荐商户" : "是否关闭推荐商户";
this.$modalSure(title).then(() => {
merchantStatuseApi(row.mer_id, row.is_best === 1 ? 0 : 1)
@ -636,7 +993,7 @@ export default {
});
},
//
onchangeIsClose(row) {
onchangeIsClose (row) {
merchantIsCloseApi(row.mer_id, row.status === 1 ? 0 : 1)
.then(({ message }) => {
this.$message.success(message);
@ -647,7 +1004,7 @@ export default {
});
},
//
onAdd() {
onAdd () {
this.add = true;
this.edit = 0;
this.popFormVisible = true;
@ -664,7 +1021,7 @@ export default {
// this.$modalForm(merchantCreateApi()).then(() => this.getList(""));
},
//
async onEdit(id) {
async onEdit (id) {
//
this.popFormVisible = true; //
this.add = false;
@ -734,7 +1091,7 @@ export default {
// this.$modalForm(merchantUpdateApi(id)).then(() => this.getList(""));
},
//
handleDelete(id) {
handleDelete (id) {
this.$modalSure(
"该商户下有相关数据信息,删除后不可恢复,您是否确定删除"
).then(() => {
@ -750,16 +1107,16 @@ export default {
});
},
//
onDeduct(id) {
onDeduct (id) {
this.$modalForm(marginDeductionForm(id)).then(() => this.getList(""));
},
//
handleTimes(id) {
handleTimes (id) {
this.$modalForm(changeCopyApi(id)).then(() => this.getList(""));
},
//
onPassword(id) {
onPassword (id) {
this.$modalForm(merchantPasswordApi(id));
}
}

View File

@ -2,88 +2,238 @@
<div class="divBox">
<el-card class="box-card">
<div slot="header" class="clearfix">
<el-tabs v-model="tableFrom.type" @tab-click="getList(1),getLstFilterApi()">
<el-tab-pane v-for="(item,index) in headeNum" :key="index" :name="item.type.toString()" :label="item.name +'('+item.count +')' " />
<el-tabs
v-model="tableFrom.type"
@tab-click="getList(1), getLstFilterApi()"
>
<el-tab-pane
v-for="(item, index) in headeNum"
:key="index"
:name="item.type.toString()"
:label="item.name + '(' + item.count + ')'"
/>
</el-tabs>
<div class="container">
<div class="demo-input-suffix acea-row">
<el-form inline size="small" label-width="120px">
<el-form-item label="商品分类:">
<el-cascader v-model="tableFrom.pid" class="selWidth" :options="merCateList" :props="{ checkStrictly: true, emitPath:false }" clearable @change="getList(1)" />
<el-cascader
v-model="tableFrom.pid"
class="selWidth"
:options="merCateList"
:props="{ checkStrictly: true, emitPath: false }"
clearable
@change="getList(1)"
/>
</el-form-item>
<el-form-item label="商户名称:">
<el-select v-model="tableFrom.mer_id" clearable filterable placeholder="请选择" class="selWidth" @change="getList(1)">
<el-option v-for="item in merSelect" :key="item.mer_id" :label="item.mer_name" :value="item.mer_id" />
<el-select
v-model="tableFrom.mer_id"
clearable
filterable
placeholder="请选择"
class="selWidth"
@change="getList(1)"
>
<el-option
v-for="item in merSelect"
:key="item.mer_id"
:label="item.mer_name"
:value="item.mer_id"
/>
</el-select>
</el-form-item>
<el-form-item label="商户类别:">
<el-select v-model="tableFrom.is_trader" clearable placeholder="请选择" class="selWidth" @change="getList(1)">
<el-select
v-model="tableFrom.is_trader"
clearable
placeholder="请选择"
class="selWidth"
@change="getList(1)"
>
<el-option label="自营" value="1" />
<el-option label="非自营" value="0" />
</el-select>
</el-form-item>
<el-form-item label="商品状态:">
<el-select v-model="tableFrom.us_status" placeholder="请选择" class="filter-item selWidth" clearable @change="getList(1)">
<el-option v-for="item in productStatusList" :key="item.value" :label="item.label" :value="item.value" />
<el-select
v-model="tableFrom.us_status"
placeholder="请选择"
class="filter-item selWidth"
clearable
@change="getList(1)"
>
<el-option
v-for="item in productStatusList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="推荐级别:">
<el-select v-model="tableFrom.star" placeholder="请选择" class="filter-item selWidth" clearable @change="getList(1)">
<el-option v-for="item in recommendedLevelStatus" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-select
v-model="tableFrom.star"
placeholder="请选择"
class="filter-item selWidth"
clearable
@change="getList(1)"
>
<el-option
v-for="item in recommendedLevelStatus"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="标签:">
<el-select v-model="tableFrom.sys_labels" placeholder="请选择" class="filter-item selWidth" clearable filterable @change="getList(1)">
<el-option v-for="item in labelList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
<el-select
v-model="tableFrom.sys_labels"
placeholder="请选择"
class="filter-item selWidth"
clearable
filterable
@change="getList(1)"
>
<el-option
v-for="item in labelList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="会员价设置:">
<el-select v-model="tableFrom.svip_price_type" placeholder="请选择" class="selWidth" clearable @change="getList(1)">
<el-option label="未设置" value="0" />
<el-option label="默认设置" value="1" />
<el-option label="自定义设置" value="2" />
</el-select>
</el-form-item>
<!-- <el-form-item label="会员价设置:">
<el-select
v-model="tableFrom.svip_price_type"
placeholder="请选择"
class="selWidth"
clearable
@change="getList(1)"
>
<el-option label="未设置" value="0" />
<el-option label="默认设置" value="1" />
<el-option label="自定义设置" value="2" />
</el-select>
</el-form-item> -->
<el-form-item label="商品推荐:">
<el-select v-model="tableFrom.hot_type" placeholder="请选择" class="filter-item selWidth" clearable filterable @change="getList(1)">
<el-option v-for="item in recommendList" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
<el-select
v-model="tableFrom.hot_type"
placeholder="请选择"
class="filter-item selWidth"
clearable
filterable
@change="getList(1)"
>
<el-option
v-for="item in recommendList"
:key="item.value"
:label="item.name"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="商品搜索:">
<el-input v-model="tableFrom.keyword" @keyup.enter.native="getList(1)" placeholder="请输入商品名称,关键字,产品编号" class="selWidth">
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="getList(1)" />
<el-input
v-model="tableFrom.keyword"
@keyup.enter.native="getList(1)"
placeholder="请输入商品名称,关键字,产品编号"
class="selWidth"
>
<el-button
slot="append"
icon="el-icon-search"
class="el-button-solt"
@click="getList(1)"
/>
</el-input>
</el-form-item>
</el-form>
</div>
</div>
<el-button v-show="tableFrom.type === '6'" size="mini" :disabled="multipleSelection.length==0" @click="batch">批量审核</el-button>
<el-button size="mini" :disabled="multipleSelection.length==0 " @click="batchOff">批量强制下架</el-button>
<el-button size="mini" :disabled="multipleSelection.length==0 " @click="batchShow(0)">批量不显示</el-button>
<el-button size="mini" :disabled="multipleSelection.length==0 " @click="batchShow(1)">批量显示</el-button>
<el-button :disabled="multipleSelection.length==0" size="mini" @click="batchLabel">批量设置标签</el-button>
<el-button :disabled="multipleSelection.length==0" size="mini" @click="batchRecommend">批量设置推荐</el-button>
<el-button
v-show="tableFrom.type === '6'"
size="mini"
:disabled="multipleSelection.length == 0"
@click="batch"
>批量审核</el-button
>
<el-button
size="mini"
:disabled="multipleSelection.length == 0"
@click="batchOff"
>批量强制下架</el-button
>
<el-button
size="mini"
:disabled="multipleSelection.length == 0"
@click="batchShow(0)"
>批量不显示</el-button
>
<el-button
size="mini"
:disabled="multipleSelection.length == 0"
@click="batchShow(1)"
>批量显示</el-button
>
<el-button
:disabled="multipleSelection.length == 0"
size="mini"
@click="batchLabel"
>批量设置标签</el-button
>
<el-button
:disabled="multipleSelection.length == 0"
size="mini"
@click="batchRecommend"
>批量设置推荐</el-button
>
</div>
<el-table v-loading="listLoading" :data="tableData.data" style="width: 100%" size="mini" @selection-change="handleSelectionChange">
<el-table-column v-if="Number(tableFrom.type)<7" key="2" type="selection" width="55" />
<el-table
v-loading="listLoading"
:data="tableData.data"
style="width: 100%"
size="mini"
@selection-change="handleSelectionChange"
>
<el-table-column
v-if="Number(tableFrom.type) < 7"
key="2"
type="selection"
width="55"
/>
<el-table-column type="expand">
<template slot-scope="props">
<el-form label-position="left" inline class="demo-table-expand">
<el-form-item label="平台分类:">
<span>{{ props.row.storeCategory?props.row.storeCategory.cate_name:'-' }}</span>
<span>{{
props.row.storeCategory
? props.row.storeCategory.cate_name
: "-"
}}</span>
</el-form-item>
<el-form-item label="商户类别:">
<!-- <span>{{ props.row.storeCategory?props.row.storeCategory.cate_name:'-' }}</span> -->
<span v-if="props.row.merchant" class="spBlock">{{ props.row.merchant .is_trader ? '自营' : '非自营' }}</span>
<span v-if="props.row.merchant" class="spBlock">{{
props.row.merchant.is_trader ? "自营" : "非自营"
}}</span>
</el-form-item>
<el-form-item label="商品分类:">
<template v-if="props.row.merCateId.length">
<span v-for="(item, index) in props.row.merCateId" :key="index" class="mr10">{{ item.category ? item.category.cate_name : '-' }}</span>
<span
v-for="(item, index) in props.row.merCateId"
:key="index"
class="mr10"
>{{ item.category ? item.category.cate_name : "-" }}</span
>
</template>
<span v-else>-</span>
</el-form-item>
<el-form-item label="品牌:">
<span>{{ props.row.brand ? props.row.brand.brand_name: '-' }}</span>
<span>{{
props.row.brand ? props.row.brand.brand_name : "-"
}}</span>
</el-form-item>
<el-form-item label="市场价格:">
<span>{{ props.row.ot_price | filterEmpty }}</span>
@ -110,27 +260,40 @@
<el-table-column label="商品图" min-width="80">
<template slot-scope="scope">
<div class="demo-image__preview">
<el-image style="width: 36px; height: 36px" :src="scope.row.image" :preview-src-list="[scope.row.image]" />
<el-image
style="width: 36px; height: 36px"
:src="scope.row.image"
:preview-src-list="[scope.row.image]"
/>
</div>
</template>
</el-table-column>
<el-table-column prop="store_name" label="商品名称" min-width="200" />
<el-table-column label="商户名称" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.merchant ? scope.row.merchant.mer_name : '' }}</span>
<span>{{
scope.row.merchant ? scope.row.merchant.mer_name : ""
}}</span>
</template>
</el-table-column>
<el-table-column prop="mer_name" label="商户类别" min-width="90">
<template slot-scope="scope">
<span v-if="scope.row.merchant" class="spBlock">{{ scope.row.merchant .is_trader ? '自营' : '非自营' }}</span>
<span v-if="scope.row.merchant" class="spBlock">{{
scope.row.merchant.is_trader ? "自营" : "非自营"
}}</span>
</template>
</el-table-column>
<el-table-column prop="price" label="商品售价" min-width="90" />
<el-table-column prop="svip_price" label="会员价" min-width="90">
<template slot-scope="scope">
<span>{{ scope.row.svip_price || '-' }}</span>
<el-table-column prop="svip_price" label="批发价" min-width="90">
<template slot-scope="scope">
<span>{{ scope.row.procure_price || "-" }}</span>
</template>
</el-table-column>
<!-- <el-table-column prop="svip_price" label="会员价" min-width="90">
<template slot-scope="scope">
<span>{{ scope.row.svip_price || "-" }}</span>
</template>
</el-table-column> -->
<el-table-column prop="sales" label="销量" min-width="90" />
<!-- <el-table-column prop="integral_total" label="抵扣积分" min-width="90" />
<el-table-column prop="integral_price_total" label="积分抵扣金额" min-width="90" /> -->
@ -146,7 +309,14 @@
<el-table-column prop="rank" label="排序" min-width="70" />
<el-table-column prop="status" label="是否显示" min-width="100">
<template slot-scope="scope">
<el-switch v-model="scope.row.is_used" :active-value="1" :inactive-value="0" active-text="显示" inactive-text="隐藏" @change="onchangeIsShow(scope.row)" />
<el-switch
v-model="scope.row.is_used"
:active-value="1"
:inactive-value="0"
active-text="显示"
inactive-text="隐藏"
@change="onchangeIsShow(scope.row)"
/>
</template>
</el-table-column>
<el-table-column prop="stock" label="商品状态" min-width="90">
@ -154,63 +324,190 @@
<span>{{ scope.row.us_status | productStatusFilter }}</span>
</template>
</el-table-column>
<el-table-column prop="stock" label="标签" max-height="120" min-width="90" show-overflow-tooltip>
<el-table-column
prop="stock"
label="标签"
max-height="120"
min-width="90"
show-overflow-tooltip
>
<template slot-scope="scope">
<span v-for="(item,index) in scope.row.sys_labels" :key="index" class="label-list">{{ item.name }}</span>
<span
v-for="(item, index) in scope.row.sys_labels"
:key="index"
class="label-list"
>{{ item.name }}</span
>
</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间" min-width="150" />
<el-table-column v-if="Number(tableFrom.type) < 7" key="8" label="操作" min-width="160" fixed="right" align="center">
<el-table-column
v-if="Number(tableFrom.type) < 7"
key="8"
label="操作"
min-width="160"
fixed="right"
align="center"
>
<template slot-scope="scope">
<el-button v-if="Number(tableFrom.type) < 7" type="text" size="small" @click="onEdit(scope.row.product_id)">编辑</el-button>
<el-button type="text" size="small" @click="handlePreview(scope.row.product_id)">预览</el-button>
<router-link v-if="tableFrom.type != 5" :to="{path: roterPre + '/product/comment/?product_id=' + scope.row.product_id}">
<el-button type="text" size="small" class="mr10">查看评价</el-button>
<el-button
v-if="Number(tableFrom.type) < 7"
type="text"
size="small"
@click="onEdit(scope.row.product_id)"
>编辑</el-button
>
<el-button
type="text"
size="small"
@click="handlePreview(scope.row.product_id)"
>预览</el-button
>
<router-link
v-if="tableFrom.type != 5"
:to="{
path:
roterPre +
'/product/comment/?product_id=' +
scope.row.product_id,
}"
>
<el-button type="text" size="small" class="mr10"
>查看评价</el-button
>
</router-link>
<el-button v-if="tableFrom.type !== '5'" type="text" size="small" @click="onEditLabel(scope.row)">编辑标签</el-button>
<el-button v-if="tableFrom.type === '6' || tableFrom.type === '1'" type="text" size="small" @click="toVirtualSales(scope.row.product_id)">已售数量</el-button>
<el-button v-if="tableFrom.type === '6'" type="text" size="small" @click="toExamine(scope.row.product_id)">审核</el-button>
<el-button v-if="Number(tableFrom.type) < 3" type="text" size="small" @click="toOff([scope.row.product_id])">强制下架</el-button>
<el-button
v-if="tableFrom.type !== '5'"
type="text"
size="small"
@click="onEditLabel(scope.row)"
>编辑标签</el-button
>
<el-button
v-if="tableFrom.type === '6' || tableFrom.type === '1'"
type="text"
size="small"
@click="toVirtualSales(scope.row.product_id)"
>已售数量</el-button
>
<el-button
v-if="tableFrom.type === '6'"
type="text"
size="small"
@click="toExamine(scope.row.product_id)"
>审核</el-button
>
<el-button
v-if="Number(tableFrom.type) < 3"
type="text"
size="small"
@click="toOff([scope.row.product_id])"
>强制下架</el-button
>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination :page-sizes="[20, 40, 60, 80]" :page-size="tableFrom.limit" :current-page="tableFrom.page" layout="total, sizes, prev, pager, next, jumper" :total="tableData.total" @size-change="handleSizeChange" @current-change="pageChange" />
<el-pagination
:page-sizes="[20, 40, 60, 80]"
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</el-card>
<info-from ref="infoFrom" :is-show="isShow" :ids="OffId" @subSuccess="subSuccess" />
<el-dialog title="商品编辑" :visible.sync="dialogVisible" width="1000px" :before-close="handleClose" :append-to-body='append'>
<el-form ref="formValidate" v-loading="fullscreenLoading" class="formValidate mt20" :rules="ruleValidate" :model="formValidate" label-width="100px" @submit.native.prevent>
<info-from
ref="infoFrom"
:is-show="isShow"
:ids="OffId"
@subSuccess="subSuccess"
/>
<el-dialog
title="商品编辑"
:visible.sync="dialogVisible"
width="1000px"
:before-close="handleClose"
:append-to-body="append"
>
<el-form
ref="formValidate"
v-loading="fullscreenLoading"
class="formValidate mt20"
:rules="ruleValidate"
:model="formValidate"
label-width="100px"
@submit.native.prevent
>
<el-form-item label="商品名称:" prop="store_name">
<el-input v-model="formValidate.store_name" placeholder="请输入商品名称" />
<el-input
v-model="formValidate.store_name"
placeholder="请输入商品名称"
/>
</el-form-item>
<el-form-item label="星级推荐:">
<el-rate class="rate_star" v-model="formValidate.star" :colors="colors" style="margin-top: 4px;"></el-rate>
<span style="margin-top: 4px; font-size: 12px;">备注5星为最高推荐级别1星为最低推荐级别设置后会在商城商品列表搜索商品列表中体现</span>
<el-rate
class="rate_star"
v-model="formValidate.star"
:colors="colors"
style="margin-top: 4px"
></el-rate>
<span style="margin-top: 4px; font-size: 12px"
>备注5星为最高推荐级别1星为最低推荐级别设置后会在商城商品列表搜索商品列表中体现</span
>
</el-form-item>
<el-form-item label="商品推荐:">
<el-checkbox-group v-model="checkboxGroup" size="small" @change="onChangeGroup">
<el-checkbox v-for="(item, index) in recommend" :key="index" :label="item.value">{{ item.name }}</el-checkbox>
<el-checkbox-group
v-model="checkboxGroup"
size="small"
@change="onChangeGroup"
>
<el-checkbox
v-for="(item, index) in recommend"
:key="index"
:label="item.value"
>{{ item.name }}</el-checkbox
>
</el-checkbox-group>
</el-form-item>
<el-form-item label="排序:">
<el-input-number v-model="formValidate.rank" placeholder="请输入排序序号" style="width: 200px;" />
<el-input-number
v-model="formValidate.rank"
placeholder="请输入排序序号"
style="width: 200px"
/>
</el-form-item>
<el-col :span="24">
<el-form-item label="商品详情:">
<ueditor-from v-model="formValidate.content" :content="formValidate.content" />
<ueditor-from
v-model="formValidate.content"
:content="formValidate.content"
/>
</el-form-item>
</el-col>
<el-form-item style="margin-top:30px;">
<el-button type="primary" class="submission" size="small" @click="handleSubmit('formValidate')">提交</el-button>
<el-form-item style="margin-top: 30px">
<el-button
type="primary"
class="submission"
size="small"
@click="handleSubmit('formValidate')"
>提交</el-button
>
</el-form-item>
</el-form>
</el-dialog>
<!--预览商品-->
<!--预览商品-->
<div v-if="previewVisible">
<div class="bg" @click.stop="previewVisible = false" />
<preview-box v-if="previewVisible" ref="previewBox" :goods-id="goodsId" :product-type="0" :preview-key="previewKey" />
<div class="bg" @click.stop="previewVisible = false" />
<preview-box
v-if="previewVisible"
ref="previewBox"
:goods-id="goodsId"
:product-type="0"
:preview-key="previewKey"
/>
</div>
<!--编辑标签-->
<el-dialog
@ -222,18 +519,27 @@
>
<el-form ref="labelForm" :model="labelForm" @submit.native.prevent>
<el-form-item>
<el-select v-model="labelForm.sys_labels" clearable filterable multiple placeholder="请选择" class="selWidth">
<el-select
v-model="labelForm.sys_labels"
clearable
filterable
multiple
placeholder="请选择"
class="selWidth"
>
<el-option
v-for="item in labelList"
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in labelList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm('labelForm')">提交</el-button>
<el-button type="primary" @click="submitForm('labelForm')"
>提交</el-button
>
</span>
</el-dialog>
<!--编辑推荐-->
@ -246,8 +552,17 @@
>
<el-form @submit.native.prevent>
<el-form-item label="商品推荐:">
<el-checkbox-group v-model="recommendGroup" @change="onChangeRecommend" size="small">
<el-checkbox v-for="(item, index) in recommend" :key="index" :label="item.value">{{ item.name }}</el-checkbox>
<el-checkbox-group
v-model="recommendGroup"
@change="onChangeRecommend"
size="small"
>
<el-checkbox
v-for="(item, index) in recommend"
:key="index"
:label="item.value"
>{{ item.name }}</el-checkbox
>
</el-checkbox-group>
</el-form-item>
</el-form>
@ -308,7 +623,7 @@ export default {
ueditorFrom,
previewBox
},
data() {
data () {
return {
props: {
emitPath: false
@ -408,7 +723,7 @@ export default {
recommendForm: {}
}
},
mounted() {
mounted () {
this.getMerSelect()
this.getList('')
this.getCategorySelect()
@ -416,11 +731,11 @@ export default {
this.getLabelLst()
},
methods: {
subSuccess() {
subSuccess () {
this.getList('')
this.getLstFilterApi()
},
onchangeIsShow(row) {
onchangeIsShow (row) {
changeApi(row.product_id, row.is_used).then(({
message
}) => {
@ -434,13 +749,13 @@ export default {
})
},
//
handlePreview(id) {
handlePreview (id) {
this.previewVisible = true
this.goodsId = id
this.previewKey = ''
},
//
getLabelLst() {
getLabelLst () {
getProductLabelApi().then(res => {
this.labelList = res.data
})
@ -449,7 +764,7 @@ export default {
})
},
//
onEditLabel(row) {
onEditLabel (row) {
this.dialogLabel = true
this.product_id = row.product_id
if (row.sys_labels && row.sys_labels.length) {
@ -465,7 +780,7 @@ export default {
}
}
},
submitForm(name) {
submitForm (name) {
this.$refs[name].validate(valid => {
if (valid) {
this.isBatch ? batchesLabelsApi(this.labelForm).then(({ message }) => {
@ -476,23 +791,23 @@ export default {
}).catch(res => {
this.$message.error(res.message)
}) :
updatetProductLabel(this.product_id, this.labelForm).then(({ message }) => {
this.$message.success(message)
this.getList('')
this.dialogLabel = false
}).catch(res => {
this.$message.error(res.message)
})
updatetProductLabel(this.product_id, this.labelForm).then(({ message }) => {
this.$message.success(message)
this.getList('')
this.dialogLabel = false
}).catch(res => {
this.$message.error(res.message)
})
} else {
return
}
})
},
batchRecommend() {
batchRecommend () {
this.dialogRecommend = true
this.recommendGroup = []
},
submitRecommendForm() {
submitRecommendForm () {
this.recommendForm.ids = this.OffId
batchesRecommendApi(this.recommendForm).then(({ message }) => {
this.$message.success(message)
@ -502,7 +817,7 @@ export default {
this.$message.error(res.message)
})
},
getInfo(id) {
getInfo (id) {
this.fullscreenLoading = true
this.checkboxGroup = [];
productDetailApi(id).then(res => {
@ -518,10 +833,10 @@ export default {
rank: info.rank,
star: info.star
}
if(info.is_benefit === 1) this.checkboxGroup.push('is_benefit')
if(info.is_hot === 1) this.checkboxGroup.push('is_hot')
if(info.is_best === 1) this.checkboxGroup.push('is_best')
if(info.is_new === 1) this.checkboxGroup.push('is_new')
if (info.is_benefit === 1) this.checkboxGroup.push('is_benefit')
if (info.is_hot === 1) this.checkboxGroup.push('is_hot')
if (info.is_best === 1) this.checkboxGroup.push('is_best')
if (info.is_new === 1) this.checkboxGroup.push('is_new')
this.fullscreenLoading = false
console.log(this.formValidate)
}).catch(res => {
@ -529,20 +844,20 @@ export default {
this.fullscreenLoading = false
})
},
onEdit(id) {
onEdit (id) {
this.productId = id
this.getInfo(id)
this.dialogVisible = true
},
//
toVirtualSales(id) {
toVirtualSales (id) {
this.$modalForm(toVirtualSalesApi(id)).then(() => this.getList(''))
},
//
handleSubmit(name) {
handleSubmit (name) {
console.log(this.formValidate)
this.$refs[name].validate((valid) => {
if(valid) {
if (valid) {
productUpdateApi(this.productId, this.formValidate).then(async res => {
this.fullscreenLoading = false
this.$message.success(res.message)
@ -557,30 +872,30 @@ export default {
}
})
},
onChangeGroup() {
onChangeGroup () {
this.checkboxGroup.includes('is_benefit') ? this.formValidate.is_benefit = 1 : this.formValidate.is_benefit = 0 && this.checkboxGroup.remove('is_benefit')
this.checkboxGroup.includes('is_best') ? this.formValidate.is_best = 1 : this.formValidate.is_best = 0 && this.checkboxGroup.remove('is_best')
this.checkboxGroup.includes('is_new') ? this.formValidate.is_new = 1 : this.formValidate.is_new = 0 && this.checkboxGroup.remove('is_new')
this.checkboxGroup.includes('is_hot') ? this.formValidate.is_hot = 1 : this.formValidate.is_hot = 0 && this.checkboxGroup.remove('is_hot')
},
onChangeRecommend() {
onChangeRecommend () {
this.recommendForm.is_benefit = Number(this.recommendGroup.includes('is_benefit'));
this.recommendForm.is_best = Number(this.recommendGroup.includes('is_best'));
this.recommendForm.is_new = Number(this.recommendGroup.includes('is_new'));
this.recommendForm.is_hot = Number(this.recommendGroup.includes('is_hot'));
},
handleClose() {
handleClose () {
this.dialogVisible = false
this.dialogLabel = false
this.dialogRecommend = false
},
//
batchOff() {
if(this.multipleSelection.length === 0) return this.$message.warning('请先选择商品')
batchOff () {
if (this.multipleSelection.length === 0) return this.$message.warning('请先选择商品')
this.toOff(this.OffId)
},
//
batchLabel() {
batchLabel () {
this.labelForm = {
sys_labels: [],
ids: this.OffId
@ -589,20 +904,20 @@ export default {
this.dialogLabel = true
},
//
batchShow(status) {
if(this.multipleSelection.length === 0) return this.$message.warning('请先选择商品')
let data = {status: status,ids: this.OffId}
batchesOnOffApi(data).then(res => {
batchShow (status) {
if (this.multipleSelection.length === 0) return this.$message.warning('请先选择商品')
let data = { status: status, ids: this.OffId }
batchesOnOffApi(data).then(res => {
this.$message.success(res.message)
this.getList('')
})
.catch(res => {
this.$message.error(res.message)
})
.catch(res => {
this.$message.error(res.message)
})
},
//
toOff(id) {
toOff (id) {
this.$prompt('强制下架', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@ -610,7 +925,7 @@ export default {
inputType: 'textarea',
inputPlaceholder: '请输入强制下架原因',
inputValidator: (value) => {
if(!value) {
if (!value) {
return '请输入强制下架原因'
}
}
@ -639,7 +954,7 @@ export default {
})
},
//
getLstFilterApi() {
getLstFilterApi () {
lstFilterApi().then(res => {
this.headeNum = res.data
}).catch(res => {
@ -647,19 +962,19 @@ export default {
})
},
//
getMerSelect() {
getMerSelect () {
merSelectApi().then(res => {
this.merSelect = res.data
}).catch(res => {
this.$message.error(res.message)
})
},
batch() {
if(this.multipleSelection.length === 0) return this.$message.warning('请先选择商品')
batch () {
if (this.multipleSelection.length === 0) return this.$message.warning('请先选择商品')
this.$refs.infoFrom.dialogVisible = true
this.isShow = false
},
handleSelectionChange(val) {
handleSelectionChange (val) {
this.multipleSelection = val
const data = []
this.multipleSelection.map((item) => {
@ -667,13 +982,13 @@ export default {
})
this.OffId = data
},
toExamine(id) {
toExamine (id) {
this.$refs.infoFrom.dialogVisible = true
this.isShow = true
this.$refs.infoFrom.getInfo(id)
},
//
getCategorySelect() {
getCategorySelect () {
categoryListApi().then(res => {
this.merCateList = res.data
}).catch(res => {
@ -681,7 +996,7 @@ export default {
})
},
//
getList(num) {
getList (num) {
this.listLoading = true
this.tableFrom.page = num ? num : this.tableFrom.page;
productLstApi(this.tableFrom).then(res => {
@ -693,11 +1008,11 @@ export default {
this.$message.error(res.message)
})
},
pageChange(page) {
pageChange (page) {
this.tableFrom.page = page
this.getList('')
},
handleSizeChange(val) {
handleSizeChange (val) {
this.tableFrom.limit = val
this.getList('')
}
@ -706,23 +1021,23 @@ export default {
</script>
<style lang="scss" scoped>
/deep/.el-select-dropdown__item{
max-width: 350px!important;
/deep/.el-select-dropdown__item {
max-width: 350px !important;
}
.template{
.template {
overflow: hidden;
}
.label-list{
.label-list {
height: 100%;
}
.bg {
z-index: 100;
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
z-index: 100;
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
}
.rate_star {
position: relative;
@ -753,5 +1068,4 @@ table .el-image {
.seachTiele {
line-height: 35px;
}
</style>