This commit is contained in:
faiz 2024-04-11 20:03:00 +08:00
parent f39b6a36f3
commit 6f9b4285bb
5 changed files with 842 additions and 30 deletions

View File

@ -159,12 +159,22 @@ export function seckillProductLstApi(data) {
export function categoryListApi(data) {
return request.get(`store/category/list`, data)
}
/**
* @description 导出订单
*/
export function exportProductApi(data) {
return request.get(`store/product/export`, data)
}
/**
* @description 商户分类 -- 列表
*/
export function merCategoryListApi() {
return request.get(`system/merchant/category_lst`)
}
/** 商品列表 -- 价格编辑 */
export function freeTrialApi(id, data) {
return request.post(`store/product/free_trial/${id}`, data)
}
/**
* @description 商品审核 -- 详情
*/

View File

@ -183,22 +183,125 @@
<div class="section">
<div class="title">费用信息</div>
<el-row :gutter="24" class="mt20">
<el-col v-if="!isAdd" :span="24">
<el-col :span="24">
<el-form-item label="店铺保证金:" label-width="146px">
<el-radio-group v-model="merData.is_margin">
<el-radio :label="0" class="radio"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
<span v-if="merData.is_margin == 1">
<el-input
v-model="merData.margin"
placeholder="请填写保证金"
style="width:120px;margin-left: 8px;"
/> ,
</span>
<span v-if="merData.is_margin == 1">
额度
<el-input
v-model="merData.ot_margin"
placeholder="请填写额度"
style="width:120px;margin-left: 8px;"
/>
</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="产品服务费保证金:" label-width="146px">
<el-radio-group v-model="merData.is_service">
<el-radio :label="0" class="radio"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
<span v-if="merData.is_service == 1">
<el-input
v-model="merData.service_cost"
placeholder="请填写保证金"
style="width:120px;margin-left: 8px;"
/> ,
</span>
<span v-if="merData.is_service == 1">
额度
<el-input
v-model="merData.ot_service_cost"
placeholder="请填写额度"
style="width:120px;margin-left: 8px;"
/>
</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="上架费保证金:" label-width="146px">
<el-radio-group v-model="merData.is_goods">
<el-radio :label="0" class="radio"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
<span v-if="merData.is_goods == 1">
<el-input
v-model="merData.goods_cost"
placeholder="请填写保证金"
style="width:120px;margin-left: 8px;"
/> ,
</span>
<span v-if="merData.is_goods == 1">
额度
<el-input
v-model="merData.ot_goods_cost"
placeholder="请填写额度"
style="width:120px;margin-left: 8px;"
/>
</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="提现限额:" label-width="146px">
<el-input
v-model="merData.exchange_limit"
placeholder="请填写额度"
style="width:120px;margin-left: 8px;"
/>
</el-form-item>
</el-col>
<!-- <el-col v-if="!isAdd" :span="24">
<el-form-item label="店铺保证金:" prop="ot_margin">
<span>{{merData.is_margin == 0 ? '无' : merData.ot_margin+'元'}}</span>
</el-form-item>
</el-col>
<el-col v-if="!isAdd && merData.is_margin != 0" :span="24">
</el-col> -->
</el-row>
<el-row :gutter="24" class="mt20">
<el-col v-if="!isAdd":span="8">
<el-form-item label="保证金支付状态:">
<span>{{merData.is_margin == 1 ? '待缴' : merData.is_margin == 0 ? '无' : '已缴' }}</span>
</el-form-item>
</el-col>
<el-col v-if="!isAdd && merData.is_margin != 0" :span="24">
<el-col v-if="!isAdd" :span="8">
<el-form-item label="产品服务费支付状态:" label-width="142px">
<span>{{merData.is_service == 1 ? '待缴' : merData.is_service == 0 ? '无' : '已缴' }}</span>
</el-form-item>
</el-col>
<el-col v-if="!isAdd" :span="8">
<el-form-item label="上架费支付状态:">
<span>{{merData.is_goods == 1 ? '待缴' : merData.is_goods == 0 ? '无' : '已缴' }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24" class="mt20">
<el-col v-if="!isAdd" :span="8">
<el-form-item label="保证金余额:">
<span>{{merData.margin}}</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-col v-if="!isAdd" :span="8">
<el-form-item label="产品服务费余额:">
<span>{{merData.service_cost}}</span>
</el-form-item>
</el-col>
<el-col v-if="!isAdd" :span="8">
<el-form-item label="上架费余额:">
<span>{{merData.goods_cost}}</span>
</el-form-item>
</el-col>
</el-row>
<!-- <el-col :span="24">
<el-form-item label="手续费设置:" prop="commission_rate">
<el-switch
v-model="merData.commission_switch"
@ -219,8 +322,7 @@
</span>
<div class="info info-red">(此处如未设置手续费系统会自动读取商户分类下对应手续费此处已设置则优先以此处设置为准)</div>
</el-form-item>
</el-col>
</el-row>
</el-col> -->
</div>
<div class="section">
<div class="title">审核信息</div>
@ -263,7 +365,7 @@
</el-col>
</el-row>
</div>
<div class="section">
<!-- <div class="section">
<div class="title">其他信息</div>
<div class="mt20">
<el-row :gutter="24">
@ -287,7 +389,7 @@
</el-col>
</el-row>
</div>
</div>
</div> -->
</el-tab-pane>
<el-tab-pane label="账号信息" name="account">
<div class="section">

View File

@ -6,7 +6,7 @@
<div class="title">基础信息</div>
<ul class="list">
<li class="item">
<div>商户名称</div>
<div>店铺名称</div>
<div class="value">
{{merData.mer_name}}
</div>
@ -23,13 +23,13 @@
<div>是否为军人:</div>
<div class="value">{{merData.is_soldier == 1 ? "是" : "否"}}</div>
</li>
<li class="item">
<!-- <li class="item">
<div>商户分类</div>
<div v-if="merData.merchantCategory" class="value">
{{merData.merchantCategory.category_name}}
<span class="info info-red">(该分类下的商户手续费是{{merData.merchantCategory.commission_rate*100}}%)</span>
</div>
</li>
</li> -->
<li class="item">
<div>推荐商户</div>
<div class="value">{{merData.is_best == 1 ? "是" : "否"}}</div>
@ -42,10 +42,10 @@
<div>商户状态</div>
<div class="value">{{merData.status == 1 ? "开启" : "关闭"}}</div>
</li>
<li class="item">
<!-- <li class="item">
<div>排序</div>
<div class="value">{{merData.sort}}</div>
</li>
</li> -->
<li class="item">
<div>更新时间</div>
<div class="value">{{merData.update_time}}</div>
@ -58,29 +58,35 @@
<div>备注</div>
<div class="value">{{merData.mark}}</div>
</li>
<li class="item" style="align-content: center;">
<!-- <li class="item" style="align-content: center;">
<div>营业执照</div>
<el-image v-for="(item,index) in companyImage" :key="index" style="width: 60px;height: 60px;" :src="item" :preview-src-list="companyImage" />
</li>
</li> -->
</ul>
<div class="title" style="margin-top: 10px;">银行卡信息</div>
<ul class="list">
<ul class="list" v-if="merData.ext">
<li class="item">
<div>名称</div>
<div class="value">
{{merData.financial_bank&&merData.financial_bank.name}}
{{merData.ext.bank&&merData.ext.bank.bankName}}
</div>
</li>
<li class="item">
<div>开户银行</div>
<div class="value">
{{merData.financial_bank&&merData.financial_bank.bank}}
{{merData.ext.bank&&merData.ext.bank.bankCard}}
</div>
</li>
<li class="item">
<div>开户卡号</div>
<div class="value">
{{merData.financial_bank&&merData.financial_bank.bank_code}}
{{merData.ext.bank&&merData.ext.bank.bankBranchName}}
</div>
</li>
<li class="item">
<div>联行号</div>
<div class="value">
{{merData.ext.bank&&merData.ext.bank.CNAPS}}
</div>
</li>
</ul>

View File

@ -0,0 +1,659 @@
<template>
<div class="Box">
<el-dialog
v-if="modals"
:visible.sync="modals"
width="80%"
title="价格编辑"
custom-class="dialog-scustom"
>
<el-form
ref="formValidate"
class="formValidate mt20"
:model="formValidate"
:rules="ruleInline"
label-width="120px"
label-position="right"
@submit.native.prevent
>
<div>
<div>
<!-- <el-form-item label="商户商品分类:" >
<el-cascader
v-model="formValidate.mer_cate_id"
class="selWidth"
:options="merCateList"
:props="{multiple:true,checkStrictly:true,emitPath:false }"
clearable
/>
</el-form-item> -->
<el-form-item v-if="formValidate.spec_type === 1 && ManyAttrValue.length > 1" label="批量设置:" class="labeltop">
<el-table :data="oneFormBatch" size="mini">
<el-table-column label="图片" min-width="150" align="center">
<template slot-scope="scope">
<div
class="acea-row row-middle row-center-wrapper"
>
<div v-if="oneFormBatch[0].image" class="pictrue pictrueTab">
<img v-lazy="oneFormBatch[0].image">
</div>
<div v-else class="upLoad pictrueTab acea-row row-center-wrapper">
<i class="el-icon-camera cameraIconfont" />
</div>
</div>
</template>
</el-table-column>
<el-table-column label="售价" min-width="100" align="center">
<template slot-scope="scope">
<el-input @input="handleOnform" v-model="oneFormBatch[0].price" class="priceBox" controls-position="right"/>
</template>
</el-table-column>
<el-table-column label="成本价" min-width="100" align="center">
<template slot-scope="scope">
<el-input-number :disabled="true" v-model="oneFormBatch[0].cost" :min="0" class="priceBox" controls-position="right"/>
</template>
</el-table-column>
<el-table-column label="市场价" min-width="100" align="center">
<template slot-scope="scope">
<el-input @input="handleOnform('ot_price')" v-model="oneFormBatch[0].ot_price" class="priceBox" controls-position="right"/>
</template>
</el-table-column>
<el-table-column label="占比" min-width="100" align="center">
<template slot-scope="scope">
<el-input-number :disabled="true" v-model="oneFormBatch[0].proportion" :min="0" class="priceBox" controls-position="right"/>
</template>
</el-table-column>
<el-table-column label="库存" min-width="100" align="center">
<template slot-scope="scope">
<el-input-number v-model="oneFormBatch[0].stock" :min="0" class="priceBox" controls-position="right"/>
</template>
</el-table-column>
<el-table-column label="成长值" min-width="100" align="center">
<template slot-scope="scope">
<el-input-number :disabled="true" v-model="oneFormBatch[0].growth" :min="0" class="priceBox" controls-position="right"/>
</template>
</el-table-column>
<el-table-column label="商品编号" min-width="100" align="center">
<template slot-scope="scope">
<el-input v-model="oneFormBatch[0].bar_code" />
</template>
</el-table-column>
<el-table-column label="重量(KG)" min-width="100" align="center">
<template slot-scope="scope">
<el-input-number v-model="oneFormBatch[0].weight" :min="0" class="priceBox" controls-position="right"/>
</template>
</el-table-column>
<el-table-column label="体积(m²)" min-width="100" align="center">
<template slot-scope="scope">
<el-input-number v-model="oneFormBatch[0].volume" :min="0" class="priceBox" controls-position="right"/>
</template>
</el-table-column>
<el-table-column label="操作" min-width="150">
<template slot-scope="scope">
<a href="javascript: void(0);" class="ela-btn" @click="batchAdd">添加</a>
<a href="javascript: void(0);" class="ela-btn" @click="batchDel">清空</a>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item v-if="formValidate.spec_type === 0" class="labeltop" label="规格列表:">
<el-table :data="OneattrValue" border class="tabNumWidth" size="mini">
<el-table-column align="center" label="图片" min-width="80">
<template slot-scope="scope">
<div class="upLoadPicBox">
<div v-if="scope.row.image" class="pictrue tabPic"><img :src="scope.row.image"></div>
<div v-else class="upLoad tabPic">
<i class="el-icon-camera cameraIconfont" />
</div>
</div>
</template>
</el-table-column>
<el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="120">
<template slot-scope="scope">
<el-input v-if="formThead[iii].title==='商品编号'" v-model="scope.row[iii]" type="text" class="priceBox" />
<el-input v-else @input="handleCost(scope.row,iii,$event)" :disabled="formThead[iii].title === '成本价'||formThead[iii].title === '占比'||formThead[iii].title === '成长值'" v-model="scope.row[iii]" class="priceBox" controls-position="right"/>
</template>
</el-table-column>
<template v-if="formValidate.extension_type === 1">
<el-table-column align="center" label="一级返佣(元)" min-width="100">
<template slot-scope="scope">
<el-input-number v-model="scope.row.extension_one" :min="0" class="priceBox" controls-position="right"/>
</template>
</el-table-column>
<el-table-column align="center" label="二级返佣(元)" min-width="100">
<template slot-scope="scope">
<el-input-number v-model="scope.row.extension_two" :min="0" class="priceBox" controls-position="right"/>
</template>
</el-table-column>
</template>
</el-table>
</el-form-item>
<el-form-item v-if="formValidate.spec_type === 1" class="labeltop" label="规格列表:">
<el-table :data="ManyAttrValue" border class="tabNumWidth" size="mini">
<template v-if="manyTabDate">
<el-table-column v-for="(item,iii) in manyTabDate" :key="iii" align="center" :label="manyTabTit[iii].title" min-width="80">
<template slot-scope="scope">
<span class="priceBox" v-text="scope.row[iii]" />
</template>
</el-table-column>
</template>
<el-table-column align="center" label="图片" min-width="80">
<template slot-scope="scope">
<div class="upLoadPicBox" title="750*750px">
<div v-if="scope.row.image" class="pictrue tabPic"><img :src="scope.row.image"></div>
<div v-else class="upLoad tabPic">
<i class="el-icon-camera cameraIconfont" />
</div>
</div>
</template>
</el-table-column>
<el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="120">
<template slot-scope="scope">
<el-input v-if="formThead[iii].title==='商品编号'" v-model="scope.row[iii]" type="text" class="priceBox" />
<el-input v-else @input="handleCost(scope.row,iii,$event)" :disabled="formThead[iii].title === '成本价'||formThead[iii].title === '占比'||formThead[iii].title === '成长值'" v-model="scope.row[iii]" class="priceBox" controls-position="right"/>
</template>
</el-table-column>
<template v-if="formValidate.extension_type === 1">
<el-table-column align="center" label="一级返佣(元)" min-width="100">
<template slot-scope="scope">
<el-input-number v-model="scope.row.extension_one" :min="0" class="priceBox" controls-position="right"/>
</template>
</el-table-column>
<el-table-column align="center" label="二级返佣(元)" min-width="100">
<template slot-scope="scope">
<el-input-number v-model="scope.row.extension_two" :min="0" class="priceBox" controls-position="right"/>
</template>
</el-table-column>
</template>
</el-table>
</el-form-item>
<el-form-item>
<el-button :loading="loading1" type="primary" class="submission" @click="handleSubmit('formValidate')">提交</el-button>
</el-form-item>
</div>
</div>
</el-form>
</el-dialog>
</div>
</template>
<script>
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEBCRMEB
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import {
// categorySelectApi,
productDetailApi,
freeTrialApi
} from '@/api/product'
import { roterPre } from "@/settings";
const defaultObj = {
store_name: '',
cate_id: '',
temp_id: '',
type: 0,
guarantee_template_id: '',
keyword: '',
unit_name: '',
store_info: '',
image: '',
slider_image: [],
content: '',
ficti: 0,
once_count: 0,
give_integral: 0,
is_show: 0,
price: 0,
cost: 0,
ot_price: 0,
stock: 0,
attrs: [],
items: [],
delivery_way: [],
mer_labels: [],
delivery_free: 0,
spec_type: 0,
is_copoy: 1,
attrValue: [{
image: '',
price: 0,
cost: 0,
ot_price: 0,
proportion:0.6,
stock: 0,
growth:0,
bar_code: '',
weight: 0,
volume: 0
}]
}
const objTitle = {
price: {
title: '售价'
},
cost: {
title: '成本价'
},
ot_price: {
title: '市场价'
},
proportion: {
title: '占比'
},
stock: {
title: '库存'
},
growth: {
title: '成长值'
},
bar_code: {
title: '商品编号'
},
weight: {
title: '重量KG'
},
volume: {
title: '体积(m³)'
}
}
export default {
name: 'editAttr',
components: {},
data() {
return {
product_id: '',
roterPre: roterPre,
modals: false,
loading: false,
loading1: false,
OneattrValue: [Object.assign({}, defaultObj.attrValue[0])], //
ManyAttrValue: [Object.assign({}, defaultObj.attrValue[0])], //
manyTabDate: {},
count: 0,
modal_loading: false,
images: '',
modalPic: false,
isChoice: '',
columns: [],
merCateList: [], //
ruleInline: {
mer_cate_id: [
{
required: true,
message: '请选择商户分类',
trigger: 'change',
type: 'array',
min: '1'
}
]
},
formThead: Object.assign({}, objTitle),
formValidate: Object.assign({}, defaultObj),
items: [
{
image: '',
price: 0,
cost: 0,
proportion:0.6,
growth:0,
ot_price: 0,
stock: 0,
bar_code: '',
weight: 0,
volume: 0
}
],
tableIndex: 0,
attrInfo: {},
oneFormBatch: [
{
image: '',
price: 0,
proportion:0.6,
growth:0,
cost: 0,
ot_price: 0,
stock: 0,
bar_code: '',
weight: 0,
volume: 0
}
]
}
},
computed: {
attrValue() {
const obj = Object.assign({}, defaultObj.attrValue[0])
delete obj.image
return obj
},
},
watch: {
'formValidate.attr': {
handler: function(val) {
if (this.formValidate.spec_type === 1) this.watCh(val)
},
immediate: false,
deep: true
}
},
created() {
// this.getCategorySelect()
},
mounted() {
},
methods: {
handleOnform(type){
if(type=='ot_price'){
this.oneFormBatch[0].ot_price = this.oneFormBatch[0].ot_price.replace(/^([0-9-]\d*\.?\d{0,2})?.*$/,'$1')
}else{
this.oneFormBatch[0].price = this.oneFormBatch[0].price.replace(/^([0-9-]\d*\.?\d{0,2})?.*$/,'$1')
this.oneFormBatch[0].cost = (this.oneFormBatch[0].price * 0.6).toFixed(2)
this.oneFormBatch[0].growth = parseInt(this.oneFormBatch[0].price * 0.3)
}
},
handleCost(val,i,e){
if(i=='price'){
val.price=val.price.replace(/^([0-9-]\d*\.?\d{0,2})?.*$/,'$1')
val.cost = (e * 0.6).toFixed(2)
val.growth = parseInt(e*0.3)
}
if(i=='ot_price'){
val.ot_price=val.ot_price.replace(/^([0-9-]\d*\.?\d{0,2})?.*$/,'$1')
if(!val.price){
this.$message.error('成本价低于0')
}
}
},
batchDel() {
this.oneFormBatch = [
{
image: '',
price: 0,
proportion:0.6,
growth:0,
cost: 0,
ot_price: 0,
stock: 0,
bar_code: '',
weight: 0,
volume: 0
}
]
},
batchAdd() {
for (const val of this.ManyAttrValue) {
this.$set(val, 'image', this.oneFormBatch[0].image)
this.$set(val, 'price', this.oneFormBatch[0].price)
this.$set(val, 'cost', this.oneFormBatch[0].cost)
this.$set(val, 'ot_price', this.oneFormBatch[0].ot_price)
this.$set(val, 'stock', this.oneFormBatch[0].stock)
this.$set(val, 'bar_code', this.oneFormBatch[0].bar_code)
this.$set(val, 'weight', this.oneFormBatch[0].weight)
this.$set(val, 'volume', this.oneFormBatch[0].volume)
this.$set(val, 'growth', this.oneFormBatch[0].growth)
this.$set(val, 'proportion', this.oneFormBatch[0].proportion)
this.$set(val, 'extension_one', this.oneFormBatch[0].extension_one)
this.$set(val, 'extension_two', this.oneFormBatch[0].extension_two)
}
},
//
// getCategorySelect() {
// categorySelectApi()
// .then((res) => {
// this.merCateList = res.data
// })
// .catch((res) => {
// this.$message.error(res.message)
// })
// },
watCh(val) {
const tmp = {}
const tmpTab = {}
this.formValidate.attr.forEach((o, i) => {
tmp['value' + i] = { title: o.value }
tmpTab['value' + i] = ''
})
this.ManyAttrValue = this.attrFormat(val)
console.log(this.ManyAttrValue)
this.ManyAttrValue.forEach((val, index) => {
const key = Object.values(val.detail).sort().join('/')
if (this.attrInfo[key]) this.ManyAttrValue[index] = this.attrInfo[key]
val.image = this.formValidate.image
})
this.attrInfo = {}
this.ManyAttrValue.forEach((val) => {
if (val.detail !== 'undefined' && val.detail !== null) {
this.attrInfo[Object.values(val.detail).sort().join('/')] = val
}
})
this.manyTabTit = tmp
this.manyTabDate = tmpTab
this.formThead = Object.assign({}, this.formThead, tmp)
},
attrFormat(arr) {
let data = []
const res = []
return format(arr)
function format(arr) {
if (arr.length > 1) {
arr.forEach((v, i) => {
if (i === 0) data = arr[i]['detail']
const tmp = []
data.forEach(function(vv) {
arr[i + 1] && arr[i + 1]['detail'] && arr[i + 1]['detail'].forEach(g => {
const rep2 = (i !== 0 ? '' : arr[i]['value'] + '_$_') + vv + '-$-' + arr[i + 1]['value'] + '_$_' + g
tmp.push(rep2)
if (i === (arr.length - 2)) {
const rep4 = {
image: '',
price: 0,
cost: 0,
ot_price: 0,
proportion:0.6,
stock: 0,
growth:0,
bar_code: '',
weight: 0,
volume: 0,
brokerage: 0,
brokerage_two: 0
}
rep2.split('-$-').forEach((h, k) => {
const rep3 = h.split('_$_')
if (!rep4['detail']) rep4['detail'] = {}
rep4['detail'][rep3[0]] = rep3.length > 1 ? rep3[1] : ''
})
Object.values(rep4.detail).forEach((v, i) => {
rep4['value' + i] = v
})
res.push(rep4)
}
})
})
data = tmp.length ? tmp : []
})
} else {
const dataArr = []
arr.forEach((v, k) => {
v['detail'].forEach((vv, kk) => {
dataArr[kk] = v['value'] + '_' + vv
res[kk] = {
image: '',
price: 0,
cost: 0,
ot_price: 0,
proportion:0.6,
stock: 0,
growth:0,
bar_code: '',
weight: 0,
volume: 0,
brokerage: 0,
brokerage_two: 0,
detail: { [v['value']]: vv }
}
Object.values(res[kk].detail).forEach((v, i) => {
res[kk]['value' + i] = v
})
})
})
data.push(dataArr.join('$&'))
}
return res
}
},
//
getAttrDetail(id) {
this.product_id = id
this.loading = true
this.modals = true
productDetailApi(id)
.then((res) => {
const info = res.data
this.formValidate = {
attr: info.attr || [],
attrValue: info.attrValue,
mer_cate_id: info.mer_cate_id,
spec_type: info.spec_type,
slider_image: info.slider_image,
content: info.content,
store_info: info.store_info
}
if (this.formValidate.spec_type === 0) {
this.OneattrValue = info.attrValue.map((item) => {
item.growth = (item.price * 0.3).toFixed(2)
item.proportion = '0.6'
return item
})
} else {
this.ManyAttrValue = info.attrValue.map((item) => {
item.growth = (item.price * 0.3).toFixed(2)
item.proportion = '0.6'
return item
})
console.log(this.ManyAttrValue);
this.ManyAttrValue.forEach(val => {
if (val.detail !== 'undefined' && val.detail !== null) {
this.attrInfo[
Object.values(val.detail)
.sort()
.join('/')
] = val
}
})
this.$watch('formValidate.attr', this.watCh)
}
this.loading = false
})
.catch((res) => {
this.$message.error(res.message)
this.loading = false
})
},
//
handleSubmit(name) {
let that = this;
that.$refs[name].validate((valid) => {
if (valid) {
if (this.formValidate.spec_type === 1) {
let mode = this.ManyAttrValue.every(item=>{
return !(+item.ot_price<item.price)
})
if(!mode) return this.$message.error("市场价格限定等于或大于售价");
// let url = this.ManyAttrValue.every(item=>{
// return item.gist_url
// })
// if(!url) return this.$message.error("-");
this.formValidate.attrValue = this.ManyAttrValue;
} else {
let attr = this.OneattrValue[0]
if(+attr.ot_price<attr.price) return this.$message.error("市场价格限定等于或大于售价");
// if(!attr.gist_url) return this.$message.error("-");
this.formValidate.attrValue = this.OneattrValue;
this.formValidate.attr = [];
}
that.loading1 = true
freeTrialApi(that.product_id,that.formValidate)
.then((res) => {
that.loading1 = false
that.$message.success(res.message)
setTimeout(() => {
that.modals = false
}, 500)
})
.catch((res) => {
that.$message.error(res.message)
that.loading1 = false
})
} else {
if (!that.formValidate.mer_cate_id) {
that.$message.warning('请选择商户商品分类!')
}
}
})
},
}
}
</script>
<style scoped lang="scss">
::v-deep .el-cascader {
display: block;
}
.ela-btn {
color: var(--prev-color-primary);
}
.priceBox {
width: 80px;
}
.btndel {
position: absolute;
z-index: 1;
width: 20px !important;
height: 20px !important;
left: 46px;
top: -4px;
}
.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%;
}
}
::v-deep .el-input-number__decrease,::v-deep .el-input-number__increase{
display: none;
}
::v-deep .el-input-number.is-controls-right .el-input__inner{
padding: 0 5px;
}
::v-deep .el-input__inner{
padding: 0 5px;
}
.pictrueTab {
width: 40px !important;
height: 40px !important;
}
.upLoad {
width: 40px;
height: 40px;
border: 1px dotted rgba(0, 0, 0, 0.1);
border-radius: 4px;
background: rgba(0, 0, 0, 0.02);
cursor: pointer;
}
</style>

View File

@ -97,6 +97,7 @@
<el-button size="small" :disabled="multipleSelection.length==0 " @click="batchShow(1)">批量显示</el-button>
<el-button :disabled="multipleSelection.length==0" size="small" @click="batchLabel">批量设置标签</el-button>
<el-button :disabled="multipleSelection.length==0" size="small" @click="batchRecommend">批量设置推荐</el-button>
<el-button type="primary" size="small" @click="exports">导出列表</el-button>
</div>
<el-table v-loading="listLoading" :data="tableData.data" size="small" @selection-change="handleSelectionChange">
<el-table-column v-if="Number(tableFrom.type)<7" key="2" type="selection" width="55" />
@ -199,6 +200,7 @@
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-if="Number(tableFrom.type) < 7" @click.native="onEdit(scope.row.product_id)">编辑商品</el-dropdown-item>
<el-dropdown-item v-if="Number(tableFrom.type) < 7" @click.native="onAuditFree(scope.row)">价格编辑</el-dropdown-item>
<el-dropdown-item v-if="tableFrom.type != 5">
<router-link :to="{path: roterPre + '/product/comment/?product_id=' + scope.row.product_id}" style="font-size: 14px;">
查看评价
@ -354,6 +356,7 @@
@changeDrawer="changeDrawer"
:drawer="drawer"
></pro-detail>
<edit-attr ref="editAttr" />
</div>
</template>
@ -381,14 +384,17 @@ import {
updatetProductLabel,
batchesLabelsApi,
batchesRecommendApi,
batchesOnOffApi
batchesOnOffApi,
exportProductApi
} from '@/api/product'
import { roterPre } from '@/settings'
import infoFrom from './info'
import editAttr from './editAttr'
import ueditorFrom from '@/components/ueditorFrom'
import previewBox from '@/components/previewBox/index'
import proDetail from './proDetails.vue';
import timeOptions from '@/utils/timeOptions';
import createWorkBook from '@/utils/newToExcel.js';
const proOptions = [{
name: '热门榜单',
value: 'is_hot'
@ -408,7 +414,8 @@ export default {
infoFrom,
ueditorFrom,
previewBox,
proDetail
proDetail,
editAttr
},
data() {
return {
@ -534,6 +541,34 @@ export default {
this.getLabelLst()
},
methods: {
//
onAuditFree(row) {
this.$refs.editAttr.getAttrDetail(row.product_id)
},
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)
if (lebData.export.length) {
data = data.concat(lebData.export)
excelData.page++
}
}
createWorkBook(lebData.header, lebData.title, data, lebData.foot,lebData.filename);
return
},
/**订单列表 */
downData(excelData) {
return new Promise((resolve, reject) => {
exportProductApi(excelData).then((res) => {
return resolve(res.data)
})
})
},
//
onchangeTime(e) {
this.timeVal = e