|
@@ -2,7 +2,7 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<div style="margin-bottom: 15px">
|
|
|
- <add v-if="tool.checkAuth($route.name,'productSetManage') && data.disabled" class="inline-16" @addSuccess="onSuccess" :discountrate="data.discountrate"></add>
|
|
|
+ <add v-if="tool.checkAuth($route.name,'productSetManage') && data.disabled" class="inline-16" @addSuccess="onSuccess" :discountrate="discountrate"></add>
|
|
|
<el-button v-if="tool.checkAuth($route.name,'productSetManage') && data.disabled" class="inline-16" size="small" :type="delProductData.length === 0?'':'primary'" @click="onDelProduct" :disabled="delProductData.length === 0">删 除</el-button>
|
|
|
<el-input
|
|
|
size="small"
|
|
@@ -15,7 +15,7 @@
|
|
|
clearable></el-input>
|
|
|
<div style="float: right">
|
|
|
<label class="search__label">预计折扣(%):</label>
|
|
|
- <el-input style="width: 100px;" v-model="data.discountrate" size="small" label="默认折扣" :disabled="!tool.checkAuth($route.name,'productSetManage') || !data.disabled" @change="discountrateChange(data.discountrate)"></el-input>
|
|
|
+ <el-input style="width: 100px;" v-model="discountrate" size="small" label="默认折扣" :disabled="!tool.checkAuth($route.name,'productSetManage') || !data.disabled" @change="discountrateChange(discountrate)"></el-input>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="produtMag-panel">
|
|
@@ -202,6 +202,7 @@ export default {
|
|
|
options:[],
|
|
|
productList:'',
|
|
|
delProductData:[],
|
|
|
+ discountrate:'',
|
|
|
params:{
|
|
|
"id": 20221021145702,
|
|
|
"content": {
|
|
@@ -228,7 +229,7 @@ export default {
|
|
|
async listData(){
|
|
|
console.log(this.data,"data的数据")
|
|
|
console.log(this.data.discountrate)
|
|
|
- /*this.data.discountrate = Math.round(this.data.discountrate * 100) / 100*/
|
|
|
+ this.discountrate = Math.round((this.data.discountrate * 100) * 100) / 100
|
|
|
this.totalPrice = 0
|
|
|
this.params.content.sa_projectid = this.data.sa_projectid
|
|
|
const res = await this.$api.requested(this.params)
|
|
@@ -237,6 +238,7 @@ export default {
|
|
|
this.totalPrice = this.totalPrice + e.amount
|
|
|
})
|
|
|
console.log(this.data.discountrate)
|
|
|
+ console.log(this.discountrate)
|
|
|
this.total = res.total
|
|
|
},
|
|
|
handleSizeChange(val) {
|
|
@@ -360,30 +362,32 @@ export default {
|
|
|
/*修改预计折扣*/
|
|
|
async discountrateChange(val){
|
|
|
if (val > 100){
|
|
|
- this.data.discountrate = 100
|
|
|
+ this.discountrate = 100
|
|
|
}else if(val < 1){
|
|
|
- this.data.discountrate = 1
|
|
|
+ this.discountrate = 1
|
|
|
}else {
|
|
|
- this.data.discountrate = Math.round(val * 100)/100
|
|
|
+ this.discountrate = Math.round(val * 100)/100
|
|
|
}
|
|
|
console.log(this.data,"修改预计折扣")
|
|
|
- this.data.discountrate = (this.data.discountrate / 100).toFixed(3)
|
|
|
+ this.discountrate = (this.discountrate / 100).toFixed(3)
|
|
|
const res = await this.$api.requested({
|
|
|
"id": 20230207090702,
|
|
|
"content": {
|
|
|
"sa_projectid": this.$route.query.id,
|
|
|
- "discountrate": this.data.discountrate
|
|
|
+ "discountrate": this.discountrate
|
|
|
},
|
|
|
})
|
|
|
this.tool.showMessage(res,()=>{
|
|
|
- this.listData()
|
|
|
- if (this.mainData.discountrate > 1){
|
|
|
- this.data.discountrate = Math.round((this.data.discountrate) * 100) / 100
|
|
|
+ this.data.discountrate = this.discountrate
|
|
|
+
|
|
|
+ /* if (this.discountrate > 1){
|
|
|
+ this.discountrate = Math.round((this.data.discountrate) * 100) / 100
|
|
|
}else {
|
|
|
- this.data.discountrate = Math.round((this.data.discountrate * 100) * 100) / 100
|
|
|
- }
|
|
|
+ this.discountrate = Math.round((this.data.discountrate * 100) * 100) / 100
|
|
|
+ }*/
|
|
|
|
|
|
this.$emit("productSetSuccess")
|
|
|
+ this.listData()
|
|
|
})
|
|
|
}
|
|
|
},
|