|
@@ -112,7 +112,7 @@
|
|
|
label="数量"
|
|
label="数量"
|
|
|
width="180">
|
|
width="180">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-input-number v-model="scope.row.qty" size="mini" :min="1" label="描述文字" disabled></el-input-number>
|
|
|
|
|
|
|
+ <p><span>{{scope.row.qty}}</span></p>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
@@ -128,7 +128,21 @@
|
|
|
label="折扣(%)"
|
|
label="折扣(%)"
|
|
|
width="100">
|
|
width="100">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-input v-model="scope.row.discountrate" size="mini" placeholder="请输入折扣" disabled></el-input>
|
|
|
|
|
|
|
+ <div v-if="scope.row.discountDifferenceAmount > 0">
|
|
|
|
|
+ <p><span :style="[setTopColor]">{{scope.row.discountrate}}</span></p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div v-else-if="scope.row.discountDifferenceAmount < 0" >
|
|
|
|
|
+ <p><span :style="[setDownColor]">{{scope.row.discountrate}}</span></p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="mindiscountrate"
|
|
|
|
|
+ label="最低授权折扣(%)"
|
|
|
|
|
+ width="130">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <p><span>{{scope.row.mindiscountrate}}</span></p>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
@@ -136,7 +150,15 @@
|
|
|
label="单价"
|
|
label="单价"
|
|
|
width="100">
|
|
width="100">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-input v-model="scope.row.price" size="mini" placeholder="请输入单价" disabled></el-input>
|
|
|
|
|
|
|
+ <p><span :style="[setColor]">{{scope.row.price}}</span></p>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="discountDifferenceAmount"
|
|
|
|
|
+ label="授权折扣差额"
|
|
|
|
|
+ width="130">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <p><span>{{scope.row.discountDifferenceAmount}}</span></p>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
@@ -204,6 +226,12 @@ export default {
|
|
|
currentPage:0,
|
|
currentPage:0,
|
|
|
changeList:[],
|
|
changeList:[],
|
|
|
totalPrice:0,
|
|
totalPrice:0,
|
|
|
|
|
+ setTopColor:{
|
|
|
|
|
+ color:'#79da56'
|
|
|
|
|
+ },
|
|
|
|
|
+ setDownColor:{
|
|
|
|
|
+ color:'#ef230c'
|
|
|
|
|
+ },
|
|
|
param:{
|
|
param:{
|
|
|
"id": 20221021095503,
|
|
"id": 20221021095503,
|
|
|
"version":1,
|
|
"version":1,
|
|
@@ -220,21 +248,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods:{
|
|
methods:{
|
|
|
- /*产品配置信息新增初始化*/
|
|
|
|
|
- async productInitialization(id){
|
|
|
|
|
- this.param.content.sa_quotedpriceid = id
|
|
|
|
|
- const res = await this.$api.requested(this.param)
|
|
|
|
|
- this.list = res.data
|
|
|
|
|
- this.total = res.total
|
|
|
|
|
- this.totalPrice = 0
|
|
|
|
|
- for (var i=0 ;i<this.list.length;i++){
|
|
|
|
|
-
|
|
|
|
|
- this.list[i].discountrate = this.list[i].discountrate * 100
|
|
|
|
|
- this.totalPrice = this.totalPrice + this.list[i].qty * this.list[i].price
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- console.log(this.list,'产品配置信息')
|
|
|
|
|
- },
|
|
|
|
|
/*产品配置信息*/
|
|
/*产品配置信息*/
|
|
|
async productData(){
|
|
async productData(){
|
|
|
console.log(this.data,"输出产品数据")
|
|
console.log(this.data,"输出产品数据")
|
|
@@ -245,20 +258,16 @@ export default {
|
|
|
this.totalPrice = 0
|
|
this.totalPrice = 0
|
|
|
for (var i=0 ;i<this.list.length;i++){
|
|
for (var i=0 ;i<this.list.length;i++){
|
|
|
this.list[i].discountrate = this.list[i].discountrate * 100
|
|
this.list[i].discountrate = this.list[i].discountrate * 100
|
|
|
|
|
+ this.list[i].mindiscountrate = this.list[i].mindiscountrate * 100
|
|
|
this.totalPrice = this.totalPrice + this.list[i].qty * this.list[i].price
|
|
this.totalPrice = this.totalPrice + this.list[i].qty * this.list[i].price
|
|
|
- }
|
|
|
|
|
- console.log(this.list,'产品配置信息')
|
|
|
|
|
- },
|
|
|
|
|
- /*修改折扣或单价的时候刷新*/
|
|
|
|
|
- async productDiscountrateData(id){
|
|
|
|
|
- this.param.content.sa_quotedpriceid = id
|
|
|
|
|
- const res = await this.$api.requested(this.param)
|
|
|
|
|
- this.list = res.data
|
|
|
|
|
- this.total = res.total
|
|
|
|
|
- this.totalPrice = 0
|
|
|
|
|
- for (var i=0 ;i<this.list.length;i++){
|
|
|
|
|
- this.list[i].discountrate = this.list[i].discountrate * 100
|
|
|
|
|
- this.totalPrice = this.totalPrice + this.list[i].qty * this.list[i].price
|
|
|
|
|
|
|
+ console.log(this.list[i].discountDifferenceAmount,"差额")
|
|
|
|
|
+ /*if (this.list[i].discountDifferenceAmount > 0){
|
|
|
|
|
+ console.log("执行")
|
|
|
|
|
+ this.setColor.color = '#79da56'
|
|
|
|
|
+ }else if(this.list[i].discountDifferenceAmount < 0) {
|
|
|
|
|
+ console.log("执行233")
|
|
|
|
|
+ this.setColor.color = '#ef230c'
|
|
|
|
|
+ }*/
|
|
|
}
|
|
}
|
|
|
console.log(this.list,'产品配置信息')
|
|
console.log(this.list,'产品配置信息')
|
|
|
},
|
|
},
|
|
@@ -293,100 +302,6 @@ export default {
|
|
|
console.log(type,"项目报价")
|
|
console.log(type,"项目报价")
|
|
|
this.$refs.quoterPrice.queryProduct(id,type)
|
|
this.$refs.quoterPrice.queryProduct(id,type)
|
|
|
},
|
|
},
|
|
|
- onChangeNum (val,data,index) {
|
|
|
|
|
- console.log(val,data,index)
|
|
|
|
|
- /* data.amount = data.qty * data.price*/
|
|
|
|
|
- if (val < data.orderminqty){
|
|
|
|
|
- val = data.orderminqty
|
|
|
|
|
- }else {
|
|
|
|
|
- let m = val % data.orderaddqty
|
|
|
|
|
- console.log(m)
|
|
|
|
|
- if (m !== 0){
|
|
|
|
|
- val = val + data.orderaddqty - m
|
|
|
|
|
- console.log(val,"新的数量值")
|
|
|
|
|
- data.qty = val
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- this.$set(this.list,index,data)
|
|
|
|
|
- this.$nextTick(()=>{
|
|
|
|
|
- let obj = this.list.map(e=>{
|
|
|
|
|
- return {
|
|
|
|
|
- sa_quotedprice_itemsid:e.sa_quotedprice_itemsid,
|
|
|
|
|
- itemid:e.itemid,
|
|
|
|
|
- oldprice:e.marketprice,
|
|
|
|
|
- price:e.price,
|
|
|
|
|
- discountrate:(e.discountrate/100).toFixed(4),
|
|
|
|
|
- qty:e.qty
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- this.changeData(obj)
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- onChangeDiscountrate(val,data,index) {
|
|
|
|
|
- /* data.price = data.marketprice * (data.discountrate / 100)
|
|
|
|
|
- data.amount = (data.qty * data.price).toFixed(2)*/
|
|
|
|
|
- this.$set(this.list,index,data)
|
|
|
|
|
- this.$nextTick(()=>{
|
|
|
|
|
- let obj = this.list.map(e=>{
|
|
|
|
|
- return {
|
|
|
|
|
- sa_quotedprice_itemsid:e.sa_quotedprice_itemsid,
|
|
|
|
|
- itemid:e.itemid,
|
|
|
|
|
- oldprice:e.marketprice,
|
|
|
|
|
- price:0,
|
|
|
|
|
- discountrate:(e.discountrate/100).toFixed(4),
|
|
|
|
|
- qty:e.qty
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- this.changeDiscountrateData(obj)
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- onChangePrice(val,data,index){
|
|
|
|
|
- /*data.discountrate = ((data.price / data.marketprice) * 100).toFixed(2)
|
|
|
|
|
- data.amount = data.qty * data.price*/
|
|
|
|
|
- this.$set(this.list,index,data)
|
|
|
|
|
- this.$nextTick(()=>{
|
|
|
|
|
- this.objSet(this.list)
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- objSet(data){
|
|
|
|
|
- let obj = data.map(e=>{
|
|
|
|
|
- return {
|
|
|
|
|
- sa_quotedprice_itemsid:e.sa_quotedprice_itemsid,
|
|
|
|
|
- itemid:e.itemid,
|
|
|
|
|
- oldprice:e.marketprice,
|
|
|
|
|
- price:e.price,
|
|
|
|
|
- discountrate:0,
|
|
|
|
|
- qty:e.qty
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- this.changeDiscountrateData(obj)
|
|
|
|
|
- },
|
|
|
|
|
- async changeData(obj){
|
|
|
|
|
- console.log(this.list,"数据")
|
|
|
|
|
- const res = await this.$api.requested({
|
|
|
|
|
- "id": 20221021095403,
|
|
|
|
|
- "version":1,
|
|
|
|
|
- "content": {
|
|
|
|
|
- "sa_quotedpriceid":this.list[0].sa_quotedpriceid, //sat_notice_classid<=0时 为新增
|
|
|
|
|
- "items":obj
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- console.log(res)
|
|
|
|
|
- this.productData()
|
|
|
|
|
- },
|
|
|
|
|
- async changeDiscountrateData(obj){
|
|
|
|
|
- console.log(this.list,"数据")
|
|
|
|
|
- const res = await this.$api.requested({
|
|
|
|
|
- "id": 20221021095403,
|
|
|
|
|
- "version":1,
|
|
|
|
|
- "content": {
|
|
|
|
|
- "sa_quotedpriceid":this.list[0].sa_quotedpriceid, //sat_notice_classid<=0时 为新增
|
|
|
|
|
- "items":obj
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- console.log(res)
|
|
|
|
|
- this.productDiscountrateData(res.data[0].sa_quotedpriceid)
|
|
|
|
|
- },
|
|
|
|
|
async deleteProduct(val){
|
|
async deleteProduct(val){
|
|
|
console.log(val)
|
|
console.log(val)
|
|
|
const res = await this.$api.requested({
|
|
const res = await this.$api.requested({
|