|
|
@@ -74,7 +74,7 @@
|
|
|
width="180"
|
|
|
fixed="right">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input-number :controls="true" :step-strictly="true" size="mini" v-model="scope.row.outqty" @change="qtyChange" label="输入数量"></el-input-number>
|
|
|
+ <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
|
|
|
@@ -93,7 +93,7 @@
|
|
|
width="90"
|
|
|
fixed="right">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button type="text" size="small" @click="deleteProduct(scope.row)">删 除</el-button>
|
|
|
+ <el-button :disabled="!checkDateOut" type="text" size="small" @click="deleteProduct(scope.row)">删 除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -134,7 +134,9 @@ export default {
|
|
|
},
|
|
|
list:[],
|
|
|
currentPage:0,
|
|
|
- total:0
|
|
|
+ total:0,
|
|
|
+ checkDateOut:false,
|
|
|
+ time:null
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
@@ -155,36 +157,43 @@ export default {
|
|
|
this.param.content.pageNumber = val
|
|
|
this.listData()
|
|
|
},
|
|
|
- async qtyChange () {
|
|
|
+ qtyChange () {
|
|
|
this.list = this.list.filter(e=>{
|
|
|
e.outamount = e.outqty * e.marketprice
|
|
|
return e
|
|
|
})
|
|
|
- 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
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- this.tool.showMessage(res,()=>{
|
|
|
-
|
|
|
- })
|
|
|
+ if(this.time !== null){
|
|
|
+ clearTimeout(this.time);
|
|
|
+ }
|
|
|
+ this.time = setTimeout(async () => {
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.tool.showMessage(res,()=>{
|
|
|
+ this.$emit('onSuccess')
|
|
|
+ })
|
|
|
+ },1000)
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
async deleteProduct (row) {
|
|
|
const res = await this.$api.requested({
|
|
|
@@ -197,10 +206,21 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
this.tool.showMessage(res,()=>{
|
|
|
- this.listData()
|
|
|
+ this.listData(this.param.content.where.sa_projectid)
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ watch:{
|
|
|
+ mainData (val) {
|
|
|
+ let date = new Date(this.mainData.periodend)
|
|
|
+ let now = Date.now()
|
|
|
+ if (date.getTime() < now) {
|
|
|
+ this.checkDateOut = false
|
|
|
+ } else {
|
|
|
+ this.checkDateOut = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
mounted () {
|
|
|
|
|
|
}
|