|
@@ -191,7 +191,7 @@
|
|
|
<span style="margin-top:5px;margin-left: 10px" v-if='mode!="暂不分配"'>合计分配:{{amount}}元</span>
|
|
|
</div>
|
|
|
<el-table ref="tableref" v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"&&mode!="暂不分配"||deptBudgetList.purpose=="库点费用"&&mode!="暂不分配"||deptBudgetList.expensesPurpose==2&&mode!="暂不分配"' :data="feeDetailsDistributions" style="width: 90%;margin:0 auto;">
|
|
|
- <el-table-column width="150" v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="仓库名称" min-width="110">
|
|
|
+ <el-table-column key="1" width="150" v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="仓库名称" min-width="110">
|
|
|
<template slot-scope="scope">
|
|
|
<el-select v-model="scope.row.warehouseName" placeholder="选择仓库" @change="((value)=>{selectware(value, scope.$index)})">
|
|
|
<el-option v-for="item in warehouseList" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName"
|
|
@@ -199,7 +199,7 @@
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column width="150" v-if='deptBudgetList.expensesPurpose==2' prop="date" label="仓库名称" min-width="110">
|
|
|
+ <el-table-column key="2" width="150" v-if='deptBudgetList.expensesPurpose==2' prop="date" label="仓库名称" min-width="110">
|
|
|
<template slot-scope="scope">
|
|
|
<el-select @change="((value)=>{receiptDocDatechange1(value, scope.$index)})" v-model="scope.row.warehouseName" placeholder="选择仓库">
|
|
|
<el-option v-for="item in warehouseList" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName"
|
|
@@ -215,19 +215,19 @@
|
|
|
</ws-select>
|
|
|
</template>
|
|
|
</el-table-column> -->
|
|
|
- <el-table-column width="200" v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="日期">
|
|
|
+ <el-table-column key="3" width="200" v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="日期">
|
|
|
<template slot-scope="scope">
|
|
|
<el-date-picker @change="((value)=>{receiptDocDatechange(value, scope.$index)})" v-model="scope.row.receiptDocDate" type="date" placeholder="请选择日期"
|
|
|
value-format="yyyy-MM-dd" ></el-date-picker>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column width="200" v-if='deptBudgetList.expensesPurpose==1||deptBudgetList.expensesPurpose==2' prop="date" label="日期">
|
|
|
+ <el-table-column key="4" width="200" v-if='deptBudgetList.expensesPurpose==1||deptBudgetList.expensesPurpose==2' prop="date" label="日期">
|
|
|
<template slot-scope="scope">
|
|
|
<el-date-picker @change="((value)=>{receiptDocDatechange1(value, scope.$index)})" v-model="scope.row.receiptDocDate" type="date" placeholder="请选择日期"
|
|
|
value-format="yyyy-MM-dd" ></el-date-picker>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column v-if='deptBudgetList.purpose=="库点费用"||deptBudgetList.expensesPurpose==2||deptBudgetList.expensesPurpose==1' prop="date" label="货源">
|
|
|
+ <el-table-column key="5" v-if='deptBudgetList.purpose=="库点费用"||deptBudgetList.expensesPurpose==2||deptBudgetList.expensesPurpose==1' prop="date" label="货源">
|
|
|
<template slot-scope="scope">
|
|
|
<!-- {{scope.row.goodsourcelist}} -->
|
|
|
<!-- <el-select v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
|
|
@@ -244,22 +244,22 @@
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column width="150" v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="货名">
|
|
|
+ <el-table-column key="6" width="150" v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="货名">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{scope.row.goodsName?scope.row.goodsName:'自动获取'}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column width="150" prop="inWarehouseWeight" label="入库量(吨)">
|
|
|
+ <el-table-column key="7" width="150" prop="inWarehouseWeight" label="入库量(吨)">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{scope.row.inWarehouseWeight?scope.row.inWarehouseWeight:'自动获取'}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column width="200" prop="date" label="分配金额(元)">
|
|
|
+ <el-table-column key="8" width="200" prop="date" label="分配金额(元)">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input placeholder="输入费用名称,1-15个字" class="input_css" v-model="scope.row.distributionMoney"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="address" label="操作" width="200">
|
|
|
+ <el-table-column key="9" prop="address" label="操作" width="200">
|
|
|
<template slot-scope="scope">
|
|
|
<img class='add' @click='addlist()' src="../../../public/img/add.png" alt="">
|
|
|
<img class='del' @click='dellist(scope.row)' src="../../../public/img/del.png" alt="">
|
|
@@ -363,7 +363,7 @@ weight: 4000}]],
|
|
|
for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
num += Number(this.feeDetailsDistributions[i].distributionMoney)
|
|
|
}
|
|
|
- return num
|
|
|
+ return num.toFixed(2)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -420,7 +420,8 @@ weight: 4000}]],
|
|
|
searchType: this.searchType,
|
|
|
searchKeyWord: this.searchKeyWord,
|
|
|
goodsName: this.goodsName,
|
|
|
- goodsSource: this.goodsSource == '全部客户' ? '' : this.goodsSource
|
|
|
+ goodsSource: this.goodsSource == '全部客户' ? '' : this.goodsSource,
|
|
|
+ confirmFlag : this.confirmFlag
|
|
|
})
|
|
|
.toPromise()
|
|
|
.then((response) => {
|
|
@@ -461,9 +462,9 @@ weight: 4000}]],
|
|
|
}
|
|
|
}
|
|
|
if (i == this.feeDetailsDistributions.length - 1) {
|
|
|
- this.feeDetailsDistributions[i].distributionMoney = this.deptBudgetList.unallocatedAmount - moneyDiff
|
|
|
+ this.feeDetailsDistributions[i].distributionMoney = Number(this.deptBudgetList.unallocatedAmount - moneyDiff).toFixed(2)
|
|
|
}
|
|
|
- money = this.feeDetailsDistributions[i].distributionMoney + moneyDiff
|
|
|
+ money = Number(this.feeDetailsDistributions[i].distributionMoney + moneyDiff).toFixed(2)
|
|
|
}
|
|
|
}
|
|
|
})
|
|
@@ -492,6 +493,7 @@ weight: 4000}]],
|
|
|
})
|
|
|
},
|
|
|
selectgoodsSource(e,item,index){
|
|
|
+ debugger
|
|
|
var weight=0
|
|
|
var money=0
|
|
|
var moneyDiff = 0
|
|
@@ -509,11 +511,13 @@ weight: 4000}]],
|
|
|
}
|
|
|
for (let i = 0; i < this.goodsourcelist[index].length; i++) {
|
|
|
if(this.goodsourcelist[index][i].id==e){
|
|
|
- this.feeDetailsDistributions[index].goodsSource=this.goodsourcelist[index][i].goodsSource
|
|
|
+ // this.feeDetailsDistributions[index].goodsSource=this.goodsourcelist[index][i].goodsSource
|
|
|
+ this.$set(this.feeDetailsDistributions[index],'goodsSource',this.goodsourcelist[index][i].goodsSource)
|
|
|
this.feeDetailsDistributions[index].inWarehouseWeight=this.goodsourcelist[index][i].weight
|
|
|
this.feeDetailsDistributions[index].goodsName=this.goodsourcelist[index][i].goodsName
|
|
|
this.feeDetailsDistributions[index].goodsNameKey=this.goodsourcelist[index][i].goodsNameKey
|
|
|
this.feeDetailsDistributions[index].orderId = this.goodsourcelist[index][i].id
|
|
|
+ this.$forceUpdate()
|
|
|
}
|
|
|
}
|
|
|
// if(this.moneys=='按重量自动分配'){
|
|
@@ -537,9 +541,9 @@ weight: 4000}]],
|
|
|
}
|
|
|
}
|
|
|
if (i == this.feeDetailsDistributions.length - 1) {
|
|
|
- this.feeDetailsDistributions[i].distributionMoney = this.deptBudgetList.unallocatedAmount - moneyDiff
|
|
|
+ this.feeDetailsDistributions[i].distributionMoney = Number(this.deptBudgetList.unallocatedAmount - moneyDiff).toFixed(2)
|
|
|
}
|
|
|
- money = this.feeDetailsDistributions[i].distributionMoney + moneyDiff
|
|
|
+ money = Number(this.feeDetailsDistributions[i].distributionMoney + moneyDiff).toFixed(2)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -598,8 +602,10 @@ weight: 4000}]],
|
|
|
for (let i = 0; i < response.length; i++) {
|
|
|
arr.push({goodsSource:response[i].goodsSource,id:response[i].id,weight:response[i].inWarehouseWeight,goodsName:response[i].goodsName,goodsNameKey:response[i].goodsNameKey})
|
|
|
}
|
|
|
- this.feeDetailsDistributions[index].goodsSource=''
|
|
|
- this.feeDetailsDistributions[index].weight=''
|
|
|
+ // this.feeDetailsDistributions[index].goodsSource=''
|
|
|
+ // this.feeDetailsDistributions[index].weight=''
|
|
|
+ this.$set(this.feeDetailsDistributions[index],'goodsSource','')
|
|
|
+ this.$set(this.feeDetailsDistributions[index],'weight','')
|
|
|
this.$set(this.goodsourcelist,index,JSON.parse(JSON.stringify(arr)))
|
|
|
})
|
|
|
}
|
|
@@ -625,20 +631,20 @@ weight: 4000}]],
|
|
|
this.deptBudgetList.totalDistribution=this.amount
|
|
|
if(this.deptBudgetList.purpose=='合同费用'&&this.deptBudgetList.type=='非粮款'||this.deptBudgetList.purpose=='库点费用'){
|
|
|
for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
- if(!this.feeDetailsDistributions[i].distributionMoney){
|
|
|
+ if(!this.feeDetailsDistributions[i].distributionMoney&&this.feeDetailsDistributions[i].distributionMoney!=0){
|
|
|
this.$message({
|
|
|
message: '分配金额不能为空!',
|
|
|
type: 'warning',
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- if(this.feeDetailsDistributions[i].distributionMoney<0){
|
|
|
- this.$message({
|
|
|
- message: '分配金额应大于0!',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
+ // if(this.feeDetailsDistributions[i].distributionMoney<0){
|
|
|
+ // this.$message({
|
|
|
+ // message: '分配金额应大于0!',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
if(!this.feeDetailsDistributions[i].orderId){
|
|
|
this.$message({
|
|
|
message: '货源不能为空!',
|
|
@@ -681,7 +687,7 @@ weight: 4000}]],
|
|
|
this.deptBudgetList.expenseAllocationInfoList=this.feeDetailsDistributions
|
|
|
}
|
|
|
if(this.deptBudgetList.expensesPurpose==1||this.deptBudgetList.expensesPurpose==2){
|
|
|
- var data=[]
|
|
|
+ var data=[]
|
|
|
for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
if(data.length==0){
|
|
|
data.push(this.feeDetailsDistributions[i])
|
|
@@ -704,14 +710,14 @@ weight: 4000}]],
|
|
|
}
|
|
|
}
|
|
|
if(this.deptBudgetList.expensesPurpose==3){
|
|
|
- var data=[]
|
|
|
+ var data=[]
|
|
|
for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
if(data.length==0){
|
|
|
data.push(this.feeDetailsDistributions[i])
|
|
|
}else{
|
|
|
var repetition=data.filter((item,index)=>{
|
|
|
return this.feeDetailsDistributions[i].warehouseName==item.warehouseName&&this.feeDetailsDistributions[i].receiptDocDate==item.receiptDocDate
|
|
|
- && this.feeDetailsDistributions[i].goodsSource == item.goodsSource
|
|
|
+ && this.feeDetailsDistributions[i].goodsSource == item.goodsSource && this.feeDetailsDistributions[i].orderId==item.orderId
|
|
|
})
|
|
|
if(repetition.length==0){
|
|
|
data.push(this.feeDetailsDistributions[i])
|
|
@@ -723,7 +729,6 @@ weight: 4000}]],
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
this.deptBudgetList.expensesType=2
|
|
@@ -743,6 +748,7 @@ weight: 4000}]],
|
|
|
}
|
|
|
|
|
|
if(this.deptBudgetList.expensesPurpose==1&&this.deptBudgetList.costType==3&&this.mode=='全部分配'||this.deptBudgetList.expensesPurpose==3&&this.mode=='全部分配'){
|
|
|
+ this.deptBudgetList.unallocatedAmount = Number(this.deptBudgetList.unallocatedAmount).toFixed(2)
|
|
|
if(this.amount!=this.deptBudgetList.unallocatedAmount){
|
|
|
this.$message({
|
|
|
message: '请款金额与分配金额不相等!',
|
|
@@ -767,12 +773,13 @@ weight: 4000}]],
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- if(this.deptBudgetList.expenseName.length<1||this.deptBudgetList.expenseName.length>15){
|
|
|
- this.$message({
|
|
|
- message: '费用名称输入错误!',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- }
|
|
|
+ // if(this.deptBudgetList.expenseName.length<1||this.deptBudgetList.expenseName.length>15){
|
|
|
+ // this.$message({
|
|
|
+ // message: '费用名称输入错误!',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
if(!this.deptBudgetList.amountMoney){
|
|
|
this.$message({
|
|
|
message: '金额不能为空!',
|
|
@@ -806,6 +813,7 @@ weight: 4000}]],
|
|
|
console.log(e)
|
|
|
},
|
|
|
addlist(){
|
|
|
+ this.confirmFlag = 0
|
|
|
this.feeDetailsDistributions.push({receiptDocDate:'',inWarehouseWeight:0,distributionMoney:0,warehouseName:'',time:0,id:0,weight:0,goodsName:'',goodsSource:'',index:0, goodsNameKey: null,index:this.feeDetailsDistributions.length})
|
|
|
},
|
|
|
dellist(row){
|
|
@@ -860,9 +868,9 @@ weight: 4000}]],
|
|
|
}
|
|
|
}
|
|
|
if (i == this.feeDetailsDistributions.length - 1) {
|
|
|
- this.feeDetailsDistributions[i].distributionMoney = this.deptBudgetList.unallocatedAmount - moneyDiff
|
|
|
+ this.feeDetailsDistributions[i].distributionMoney = (this.deptBudgetList.unallocatedAmount - moneyDiff).toFixed(2)
|
|
|
}
|
|
|
- money = this.feeDetailsDistributions[i].distributionMoney + moneyDiff
|
|
|
+ money = (this.feeDetailsDistributions[i].distributionMoney + moneyDiff).toFixed(2)
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -934,7 +942,7 @@ weight: 4000}]],
|
|
|
response.type='保证金'
|
|
|
}
|
|
|
this.deptBudgetList=response
|
|
|
- this.feeDetailsDistributions = this.defineComponent.expenseAllocationInfoList
|
|
|
+ // this.feeDetailsDistributions = this.deptBudgetList.expenseAllocationInfoList
|
|
|
this.dataList=[]
|
|
|
if(response.addressUrl){
|
|
|
var arr=[]
|
|
@@ -992,7 +1000,12 @@ weight: 4000}]],
|
|
|
}
|
|
|
},
|
|
|
returnsales(){
|
|
|
- this.$router.go(-1)
|
|
|
+ // this.$router.go(-1)
|
|
|
+ this.feeDetailsDistributions = [{receiptDocDate:'',inWarehouseWeight:0,distributionMoney:0,warehouseName:'',goodsName:'',goodsSource:'',index:0,}],
|
|
|
+ this.goodsourcelist = []
|
|
|
+ this.$router.push({
|
|
|
+ path:'expensemanagementdetails'
|
|
|
+ })
|
|
|
},
|
|
|
handlefujian(file) {
|
|
|
// console.log(file)
|