|
@@ -1,6 +1,10 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<el-input class="mt-10" style="width:200px" prefix-icon="el-icon-search" size="small" placeholder="搜索产品名称" v-model="param.content.where.condition" @keyup.native.enter="search()" @clear="search()" clearable></el-input>
|
|
|
+ <div style="float: right">
|
|
|
+ <label class="search__label">折扣(%):</label>
|
|
|
+ <el-input style="width: 100px;" v-model="discountrate" size="small" label="默认折扣" @change="discountrateChange"></el-input>
|
|
|
+ </div>
|
|
|
<el-table
|
|
|
ref="multipleTable"
|
|
|
:data="list"
|
|
@@ -69,12 +73,12 @@
|
|
|
<el-tag size="mini" type="info" effect="plain">{{scope.row.unitname}}/{{scope.row.axunitname}}</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="marketprice"
|
|
|
- label="牌价"
|
|
|
- width="100"
|
|
|
- fixed="right">
|
|
|
- </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="marketprice"
|
|
|
+ label="牌价"
|
|
|
+ width="100"
|
|
|
+ fixed="right">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
label="数量"
|
|
|
width="180"
|
|
@@ -83,6 +87,15 @@
|
|
|
<el-input-number :disabled="!checkDateOut" :controls="true" :step-strictly="true" size="mini" v-model="scope.row.outqty" @change="qtyChange" label="输入数量"></el-input-number>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="price"
|
|
|
+ label="单价"
|
|
|
+ width="100"
|
|
|
+ fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input :disabled="!checkDateOut" size="mini" v-model="scope.row.price" @change="priceChange" label="输入单价"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="outamount"
|
|
|
label="金额"
|
|
@@ -141,51 +154,101 @@ export default {
|
|
|
currentPage:0,
|
|
|
total:0,
|
|
|
checkDateOut:false,
|
|
|
- time:null
|
|
|
+ time:null,
|
|
|
+ discountrate:0
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
- async listData (sa_projectid) {
|
|
|
+ async listData (sa_projectid,discountrate) {
|
|
|
+ this.discountrate = discountrate
|
|
|
this.param.content.where.sa_projectid = sa_projectid
|
|
|
const res = await this.$api.requested(this.param)
|
|
|
this.list = res.data
|
|
|
- console.log(this.list,"产品列表信息")
|
|
|
this.total = res.total
|
|
|
this.currentPage = res.pageNumber
|
|
|
},
|
|
|
async search () {
|
|
|
this.param.content.pageNumber = 1
|
|
|
- this.listData(this.param.content.where.sa_projectid)
|
|
|
+ this.listData(this.param.content.where.sa_projectid,this.discountrate)
|
|
|
},
|
|
|
handleSizeChange(val) {
|
|
|
// console.log(`每页 ${val} 条`);
|
|
|
this.param.content.pageSize = val
|
|
|
- this.listData(this.param.content.where.sa_projectid)
|
|
|
+ this.listData(this.param.content.where.sa_projectid,this.discountrate)
|
|
|
},
|
|
|
handleCurrentChange(val) {
|
|
|
// console.log(`当前页: ${val}`);
|
|
|
this.param.content.pageNumber = val
|
|
|
- this.listData(this.param.content.where.sa_projectid)
|
|
|
+ this.listData(this.param.content.where.sa_projectid,this.discountrate)
|
|
|
},
|
|
|
qtyChange () {
|
|
|
+ console.log(this.list)
|
|
|
this.list = this.list.filter(e=>{
|
|
|
- e.outamount = e.outqty * e.marketprice
|
|
|
+ e.outamount = e.outqty * e.price
|
|
|
return e
|
|
|
})
|
|
|
if(this.time !== null){
|
|
|
clearTimeout(this.time);
|
|
|
}
|
|
|
this.time = setTimeout(async () => {
|
|
|
+ console.log(this.list)
|
|
|
const res = await this.$api.requested({
|
|
|
"id": 20220906155003,
|
|
|
- "version":1,
|
|
|
"content": {
|
|
|
"sa_salesforecastmodelid":this.mainData.sa_salesforecastmodelid,
|
|
|
"sa_salesforecastbillid":this.$route.query.id,
|
|
|
"sa_projectid": this.param.content.where.sa_projectid,
|
|
|
"itemclassinfos": this.list.map(e=>{
|
|
|
return {
|
|
|
+ /*"sa_salesforecastid":e.sa_salesforecastid,
|
|
|
+ "itemclassnum": e.itemclassnum,
|
|
|
+ "orderqty": e.orderqty,
|
|
|
+ "orderamount": e.orderamount,
|
|
|
+ "invoiceqty": e.invoiceqty,
|
|
|
+ "invoiceamount": e.invoiceamount,
|
|
|
+ "outqty": e.outqty,
|
|
|
+ "outamount": e.outamount,
|
|
|
+ "itemid":e.itemid*/
|
|
|
"sa_salesforecastid":e.sa_salesforecastid,
|
|
|
+ "itemid": e.itemid,
|
|
|
+ "orderqty": e.orderqty,
|
|
|
+ "orderamount": e.orderamount,
|
|
|
+ "invoiceqty": e.invoiceqty,
|
|
|
+ "invoiceamount": e.invoiceamount,
|
|
|
+ "outqty": e.outqty,
|
|
|
+ "price":e.price
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log(this.param.content.where.sa_projectid)
|
|
|
+ this.listData(this.param.content.where.sa_projectid,this.discountrate)
|
|
|
+ this.$emit('onSuccess',this.param.content.where.sa_projectid)
|
|
|
+ /*this.tool.showMessage(res,()=>{
|
|
|
+ this.listData()
|
|
|
+ this.$emit('onSuccess')
|
|
|
+ })*/
|
|
|
+ },300)
|
|
|
+ },
|
|
|
+ priceChange(){
|
|
|
+ this.list = this.list.filter(e=>{
|
|
|
+ e.outamount = e.outqty * e.price
|
|
|
+ return e
|
|
|
+ })
|
|
|
+ if(this.time !== null){
|
|
|
+ clearTimeout(this.time);
|
|
|
+ }
|
|
|
+ this.time = setTimeout(async () => {
|
|
|
+ console.log(this.list)
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": 20220906155003,
|
|
|
+ "content": {
|
|
|
+ "sa_salesforecastmodelid":this.mainData.sa_salesforecastmodelid,
|
|
|
+ "sa_salesforecastbillid":this.$route.query.id,
|
|
|
+ "sa_projectid": this.param.content.where.sa_projectid,
|
|
|
+ "itemclassinfos": this.list.map(e=>{
|
|
|
+ return {
|
|
|
+ /*"sa_salesforecastid":e.sa_salesforecastid,
|
|
|
"itemclassnum": e.itemclassnum,
|
|
|
"orderqty": e.orderqty,
|
|
|
"orderamount": e.orderamount,
|
|
@@ -193,21 +256,37 @@ export default {
|
|
|
"invoiceamount": e.invoiceamount,
|
|
|
"outqty": e.outqty,
|
|
|
"outamount": e.outamount,
|
|
|
- "itemid":e.itemid
|
|
|
+ "itemid":e.itemid*/
|
|
|
+ "sa_salesforecastid":e.sa_salesforecastid,
|
|
|
+ "itemid": e.itemid,
|
|
|
+ "orderqty": e.orderqty,
|
|
|
+ "orderamount": e.orderamount,
|
|
|
+ "invoiceqty": e.invoiceqty,
|
|
|
+ "invoiceamount": e.invoiceamount,
|
|
|
+ "outqty": e.outqty,
|
|
|
+ "price":e.price
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
console.log(this.param.content.where.sa_projectid)
|
|
|
- this.listData(this.param.content.where.sa_projectid)
|
|
|
+ this.listData(this.param.content.where.sa_projectid,this.discountrate)
|
|
|
this.$emit('onSuccess',this.param.content.where.sa_projectid)
|
|
|
/*this.tool.showMessage(res,()=>{
|
|
|
this.listData()
|
|
|
this.$emit('onSuccess')
|
|
|
})*/
|
|
|
- },1000)
|
|
|
-
|
|
|
-
|
|
|
+ },300)
|
|
|
+ },
|
|
|
+ discountrateChange(){
|
|
|
+ if (this.discountrate > 100){
|
|
|
+ this.discountrate = 100
|
|
|
+ }else if(this.discountrate < 0){
|
|
|
+ this.discountrate = 0
|
|
|
+ }else {
|
|
|
+ this.discountrate = Math.round(this.discountrate * 100)/100
|
|
|
+ }
|
|
|
+ this.$emit('discountrateSet',this.discountrate)
|
|
|
},
|
|
|
/*amountChange (){
|
|
|
this.list = this.list.filter(e=>{
|
|
@@ -260,7 +339,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
this.tool.showMessage(res,()=>{
|
|
|
- this.listData(this.param.content.where.sa_projectid)
|
|
|
+ this.listData(this.param.content.where.sa_projectid,this.discountrate)
|
|
|
})
|
|
|
}
|
|
|
},
|
|
@@ -276,7 +355,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
|
-
|
|
|
+ console.log(this.mainData,"mainData")
|
|
|
}
|
|
|
}
|
|
|
|