edit
This commit is contained in:
parent
adcf52bbac
commit
8656fb7811
|
@ -299,6 +299,12 @@ export function seckillChangeApi(id, status) {
|
|||
export function toVirtualSalesApi(id) {
|
||||
return request.get(`store/product/ficti/form/${id}`)
|
||||
}
|
||||
/**
|
||||
* @description 商品列表 -- 标记标记
|
||||
*/
|
||||
export function setTagNameApi(id) {
|
||||
return request.get(`store/product/tag_name/form/${id}`)
|
||||
}
|
||||
/**
|
||||
* @description 预售 -- 列表
|
||||
*/
|
||||
|
|
|
@ -358,12 +358,22 @@ export default {
|
|||
|
||||
}
|
||||
},
|
||||
calculatePercentage(number) {
|
||||
// 假设输入的是0.6,50%
|
||||
// 首先计算百分比
|
||||
var percentage = 100 - (number - 0.1) * 100;
|
||||
// 确保百分比在0到100之间
|
||||
percentage = Math.min(Math.max(percentage, 0), 100);
|
||||
// 返回百分比
|
||||
return percentage + "%";
|
||||
},
|
||||
handleCost(val,i){
|
||||
switch(i){
|
||||
case 'cost':
|
||||
val.cost=val.cost.replace(/^([0-9-]\d*\.?\d{0,2})?.*$/,'$1')
|
||||
val.growth = parseInt(val.price*(0.9-(val.cost/val.price)))
|
||||
// val.growth = parseInt(val.price*(0.9-(val.cost/val.price)))
|
||||
val.proportion = (val.cost/val.price).toFixed(2)
|
||||
val.growth = parseInt(val.price*val.proportion)
|
||||
break;
|
||||
case 'ot_price':
|
||||
val.ot_price=val.ot_price.replace(/^([0-9-]\d*\.?\d{0,2})?.*$/,'$1')
|
||||
|
@ -373,8 +383,8 @@ export default {
|
|||
break;
|
||||
case 'price':
|
||||
val.price=val.price.replace(/^([0-9-]\d*\.?\d{0,2})?.*$/,'$1')
|
||||
val.growth = parseInt(val.price*(0.9-(val.cost/val.price)))
|
||||
val.proportion = (val.cost/val.price).toFixed(2)
|
||||
val.growth = parseInt(val.price*val.proportion)
|
||||
break;
|
||||
case 'growth':
|
||||
val.growth=val.growth.replace(/[^\d]/g,'')
|
||||
|
|
|
@ -51,6 +51,9 @@
|
|||
<el-form-item label="商品搜索:" prop="keyword">
|
||||
<el-input v-model="tableFrom.keyword" @keyup.enter.native="getList(1)" placeholder="请输入商品名称,关键字,产品编号" class="selWidth" />
|
||||
</el-form-item>
|
||||
<el-form-item label="标记:" prop="keyword">
|
||||
<el-input v-model="tableFrom.tag_name" @keyup.enter.native="getList(1)" placeholder="请输入标记" class="selWidth" />
|
||||
</el-form-item>
|
||||
<el-form-item label="时间选择:" prop="create_time">
|
||||
<el-date-picker
|
||||
v-model="timeVal"
|
||||
|
@ -133,6 +136,7 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="product_id" label="ID" min-width="80" />
|
||||
<el-table-column prop="tag_name" label="标记" min-width="80" />
|
||||
<el-table-column prop="audit_type" label="商品类型" min-width="80">
|
||||
<template slot-scope="scope">
|
||||
{{ productTypeList[scope.row.audit_type].label }}
|
||||
|
@ -212,7 +216,8 @@
|
|||
查看评价
|
||||
</router-link>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="tableFrom.type !== '5'" @click.native="onEditLabel(scope.row)">编辑标签</el-dropdown-item>
|
||||
<!-- <el-dropdown-item v-if="tableFrom.type !== '5'" @click.native="onEditLabel(scope.row)">编辑标签</el-dropdown-item> -->
|
||||
<el-dropdown-item @click.native="setTagName(scope.row.product_id)">编辑标签</el-dropdown-item>
|
||||
<el-dropdown-item v-if="tableFrom.type === '6' || tableFrom.type === '1'" @click.native="toVirtualSales(scope.row.product_id)">已售数量</el-dropdown-item>
|
||||
<el-dropdown-item v-if="Number(tableFrom.type) < 3" @click.native="toOff(scope.row.product_id)">强制下架</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
|
@ -395,7 +400,8 @@ import {
|
|||
batchesLabelsApi,
|
||||
batchesRecommendApi,
|
||||
batchesOnOffApi,
|
||||
exportProductApi
|
||||
exportProductApi,
|
||||
setTagNameApi
|
||||
} from '@/api/product'
|
||||
import { roterPre } from '@/settings'
|
||||
import infoFrom from './info'
|
||||
|
@ -512,6 +518,7 @@ export default {
|
|||
cate_id: '',
|
||||
sys_labels: '',
|
||||
pid: '',
|
||||
tag_name:'',
|
||||
store_name: '',
|
||||
audit_type:'',
|
||||
type: '6',
|
||||
|
@ -776,6 +783,10 @@ export default {
|
|||
toVirtualSales(id) {
|
||||
this.$modalForm(toVirtualSalesApi(id)).then(() => this.getList(''))
|
||||
},
|
||||
// 编辑标签
|
||||
setTagName(id) {
|
||||
this.$modalForm(setTagNameApi(id)).then(() => this.getList(''))
|
||||
},
|
||||
// 提交
|
||||
handleSubmit(name) {
|
||||
console.log(this.formValidate)
|
||||
|
|
Loading…
Reference in New Issue