This commit is contained in:
faiz 2024-04-29 09:15:14 +08:00
parent adcf52bbac
commit 8656fb7811
3 changed files with 31 additions and 4 deletions

View File

@ -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 预售 -- 列表
*/

View File

@ -358,12 +358,22 @@ export default {
}
},
calculatePercentage(number) {
// 0.650%
//
var percentage = 100 - (number - 0.1) * 100;
// 0100
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,'')

View File

@ -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)