|
@@ -14,44 +14,39 @@
|
|
<div class="center">
|
|
<div class="center">
|
|
|
|
|
|
<div>
|
|
<div>
|
|
- <el-form label-position="left"><div style='margin:30px 0 30px;'>基本信息</div>
|
|
|
|
- <el-form-item label-width='100px' label="用途" span="1" prop="purpose" class="readonly">
|
|
|
|
- <ws-select v-model="deptBudgetList.purpose" placeholder="" class="typeselect" >
|
|
|
|
- <ws-option label="合同费用" value="合同费用"
|
|
|
|
|
|
+ <el-form label-position="left">
|
|
|
|
+ <el-form-item label-width='100px' label="用途" span="1" prop="purpose" class="readonly">
|
|
|
|
+ <ws-select disabled v-model="deptBudgetList.expensesPurpose" placeholder="" class="typeselect" >
|
|
|
|
+ <ws-option label="合同费用" value="1"
|
|
style="color: #8890b1" />
|
|
style="color: #8890b1" />
|
|
- <ws-option label="库点费用" value="库点费用"
|
|
|
|
|
|
+ <ws-option label="库点费用" value="3"
|
|
style="color: #8890b1" />
|
|
style="color: #8890b1" />
|
|
- <ws-option label="经营性费用" value="经营性费用"
|
|
|
|
|
|
+ <ws-option label="经营性费用" value="5"
|
|
style="color: #8890b1" />
|
|
style="color: #8890b1" />
|
|
</ws-select>
|
|
</ws-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label-width='100px' v-if='deptBudgetList.purpose=="合同费用"' label="类型" span="1" prop="contractNo" class="readonly">
|
|
|
|
- <ws-select v-model="deptBudgetList.type" placeholder="" class="typeselect" >
|
|
|
|
- <ws-option label="粮款" value="粮款" style="color: #8890b1" />
|
|
|
|
- <ws-option label="非粮款" value="非粮款" style="color: #8890b1" />
|
|
|
|
- <ws-option label="保证金" value="保证金" style="color: #8890b1" />
|
|
|
|
|
|
+ <el-form-item label-width='100px' v-if='deptBudgetList.expensesPurpose==1' label="类型" span="1" prop="contractNo" class="readonly">
|
|
|
|
+ <ws-select disabled v-model="deptBudgetList.costType" placeholder="" class="typeselect" >
|
|
|
|
+ <ws-option label="粮款" value="1" style="color: #8890b1" />
|
|
|
|
+ <ws-option label="非粮款" value="3" style="color: #8890b1" />
|
|
|
|
+ <ws-option label="保证金" value="5" style="color: #8890b1" />
|
|
</ws-select>
|
|
</ws-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label-width='100px' v-if='deptBudgetList.purpose=="合同费用"' label="合同编号" span="1" prop="contractNo" class="readonly">
|
|
|
|
- <el-select v-model="deptBudgetList.contractNo" placeholder="选择合同" class="typeselect" @change="selectcontract">
|
|
|
|
- <el-option v-for="item in contractList" :key="item.contractNo" :label="item.contractNo" :value="item.contractNo"
|
|
|
|
- style="color: #8890b1" />
|
|
|
|
- </el-select>
|
|
|
|
|
|
+ <el-form-item v-if='deptBudgetList.expensesPurpose==3' label-width='100px' label="仓库名称" span="1" prop="warehouse" class="readonly">
|
|
|
|
+ {{deptBudgetList.warehouseName}}
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label-width='100px' v-if='deptBudgetList.purpose=="库点费用"' label="仓库名称" span="1" prop="contractNo" class="readonly">
|
|
|
|
- <el-select v-model="deptBudgetList.warehouseName" placeholder="选择仓库" class="typeselect" @change="selectwarehouse">
|
|
|
|
- <el-option v-for="item in warehouseList" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName"
|
|
|
|
- style="color: #8890b1" />
|
|
|
|
- </el-select>
|
|
|
|
|
|
+ <el-form-item v-if='deptBudgetList.expensesPurpose==1' label-width='100px' label="合同编号" span="1" prop="contractNo" class="readonly">
|
|
|
|
+ {{deptBudgetList.contractNo}}
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label-width='100px' label="费用名称" span="1" prop="settlementMethod">
|
|
<el-form-item label-width='100px' label="费用名称" span="1" prop="settlementMethod">
|
|
- <el-input class='input50 input_css' placeholder="输入费用名称,1-15个字" v-model="deptBudgetList.expenseName"></el-input>
|
|
|
|
|
|
+ {{deptBudgetList.expenseName}}
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label-width='100px' label="金额" span="1" prop="contractNo" class="readonly">
|
|
<el-form-item label-width='100px' label="金额" span="1" prop="contractNo" class="readonly">
|
|
- <el-input class='input50 input_css' placeholder="输入请款金额" v-model="deptBudgetList.amountMoney"></el-input>
|
|
|
|
|
|
+ {{deptBudgetList.amountMoney}}
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label-width='100px' label="备注" span="1" prop="settlementMethod">
|
|
<el-form-item label-width='100px' label="备注" span="1" prop="settlementMethod">
|
|
<el-input
|
|
<el-input
|
|
|
|
+ disabled
|
|
type="textarea"
|
|
type="textarea"
|
|
:rows="5"
|
|
:rows="5"
|
|
placeholder="选填,不超过50个字"
|
|
placeholder="选填,不超过50个字"
|
|
@@ -59,10 +54,13 @@
|
|
</el-input>
|
|
</el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label-width='100px' label="附件">
|
|
<el-form-item label-width='100px' label="附件">
|
|
- <el-upload ref='uploadfiles' :file-list='srcList' action="https://www.zthymaoyi.com/upload/admin" list-type="picture-card"
|
|
|
|
- :on-success="handlefujian" :on-remove="handleRemove" class="photo2">
|
|
|
|
- <i class="el-icon-plus"></i>
|
|
|
|
- </el-upload>
|
|
|
|
|
|
+ <!-- <div>
|
|
|
|
+ <span v-for='item in dataList'><el-image
|
|
|
|
+ style="width: 100px; height: 100px;border:1px solid #000;display:inline-block;margin:10px;"
|
|
|
|
+ :src="item"
|
|
|
|
+ :preview-src-list="dataList"></el-image></span>
|
|
|
|
+
|
|
|
|
+ </div> -->
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"' class='expensetitle'>费用分配</div>
|
|
<div v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"' class='expensetitle'>费用分配</div>
|
|
@@ -92,35 +90,36 @@
|
|
</ws-select>
|
|
</ws-select>
|
|
<span v-if='mode!="暂不分配"'>合计分配:{{amount}}元</span>
|
|
<span v-if='mode!="暂不分配"'>合计分配:{{amount}}元</span>
|
|
</div>
|
|
</div>
|
|
- <el-table v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"&&mode!="暂不分配"||deptBudgetList.purpose=="库点费用"&&mode!="暂不分配"' :data="feeDetailsDistributions" style="width: 90%;margin:0 auto;">
|
|
|
|
|
|
+ <el-table ref="tableref" v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"&&mode!="暂不分配"||deptBudgetList.purpose=="库点费用"&&mode!="暂不分配"' :data="feeDetailsDistributions" style="width: 90%;margin:0 auto;">
|
|
<el-table-column v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="仓库名称" min-width="110">
|
|
<el-table-column v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="仓库名称" min-width="110">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <ws-select v-model="scope.row.warehouseName" placeholder="选择仓库" @change="((value)=>{selectware(value, scope.row)})">
|
|
|
|
- <ws-option v-for="item in warehouseList" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName"
|
|
|
|
|
|
+ <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"
|
|
style="color: #8890b1" />
|
|
style="color: #8890b1" />
|
|
- </ws-select>
|
|
|
|
|
|
+ </el-select>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="日期">
|
|
<el-table-column v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="日期">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <ws-select v-model="scope.row.receiptDocDate" placeholder="选择日期" @change="((value)=>{selecttime(value, scope.row)})">
|
|
|
|
- <ws-option v-for="item in datelist" :key="item.time" :label="item.time" :value="item.time"
|
|
|
|
|
|
+ <ws-select v-model="scope.row.receiptDocDate" placeholder="选择日期" @change="((value)=>{selecttime(value, scope.row,scope.$index)})">
|
|
|
|
+ <ws-option v-for="item in datelist[scope.$index]" :key="item.time" :label="item.time" :value="item.time"
|
|
style="color: #8890b1" />
|
|
style="color: #8890b1" />
|
|
</ws-select>
|
|
</ws-select>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="日期">
|
|
<el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="日期">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-date-picker @change="receiptDocDatechange" v-model="scope.row.receiptDocDate" type="date" placeholder="请选择日期"
|
|
|
|
|
|
+ <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>
|
|
value-format="yyyy-MM-dd" ></el-date-picker>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="货源">
|
|
<el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="货源">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <ws-select v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row)})">
|
|
|
|
- <ws-option v-for="item in goodsourcelist" :key="item.id" :label="item.goodsSource" :value="item.id"
|
|
|
|
|
|
+ <!-- {{scope.row.goodsourcelist}} -->
|
|
|
|
+ <el-select v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
|
|
|
|
+ <el-option v-for="item in goodsourcelist[scope.$index]" :key="item.id" :label="item.goodsSource" :value="item.id"
|
|
style="color: #8890b1" />
|
|
style="color: #8890b1" />
|
|
- </ws-select>
|
|
|
|
|
|
+ </el-select>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="货名">
|
|
<el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="货名">
|
|
@@ -155,7 +154,7 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
- import {lookexenseinfo,getcontract,getwarehouse,addexenseinfo,getwarehousingorder,editexenseinfo} from '@/model/profitable/index'
|
|
|
|
|
|
+ import {lookexenseinfo,getcontract,getwarehouse,getwarehousingorder,editexenseinfo,deloneallocationinfo} from '@/model/profitable/index'
|
|
export default {
|
|
export default {
|
|
components: {},
|
|
components: {},
|
|
data() {
|
|
data() {
|
|
@@ -172,14 +171,18 @@
|
|
disabled:false,
|
|
disabled:false,
|
|
warecontractList:[],
|
|
warecontractList:[],
|
|
// dateRange: this.disabledDate(),
|
|
// dateRange: this.disabledDate(),
|
|
- feeDetailsDistributions:[{receiptDocDate:'',inWarehouseWeight:0,distributionMoney:0,warehouseName:'',goodsName:'',goodsSource:'',index:0}],
|
|
|
|
|
|
+ feeDetailsDistributions:[{receiptDocDate:'',inWarehouseWeight:0,distributionMoney:0,warehouseName:'',goodsName:'',goodsSource:'',index:0,}],
|
|
deptBudgetList:{purpose:"合同费用",type:'粮款'},
|
|
deptBudgetList:{purpose:"合同费用",type:'粮款'},
|
|
makeWordData: {},
|
|
makeWordData: {},
|
|
warehouseList:[],
|
|
warehouseList:[],
|
|
contractList:[],
|
|
contractList:[],
|
|
choosablewareList:[],
|
|
choosablewareList:[],
|
|
paymentScreenshot:[],
|
|
paymentScreenshot:[],
|
|
- goodsourcelist:[],
|
|
|
|
|
|
+ goodsourcelist:[[{goodsName: "玉米",
|
|
|
|
+goodsNameKey: null,
|
|
|
|
+goodsSource: "张跃文",
|
|
|
|
+id: "34e710ed3883484798ab37ec4ee9b9cd",
|
|
|
|
+weight: 4000}]],
|
|
signingDate:'',
|
|
signingDate:'',
|
|
datelist:[],
|
|
datelist:[],
|
|
modeList:[{key:1,value:'全部分配'},{key:2,value:'部分分配'},{key:3,value:'暂不分配'}],
|
|
modeList:[{key:1,value:'全部分配'},{key:2,value:'部分分配'},{key:3,value:'暂不分配'}],
|
|
@@ -224,16 +227,18 @@
|
|
var date = "0" + unixtimestamp.getDate();
|
|
var date = "0" + unixtimestamp.getDate();
|
|
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2,date.length)
|
|
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2,date.length)
|
|
},
|
|
},
|
|
- selectware(e,item){
|
|
|
|
|
|
+ selectware(e,index){
|
|
|
|
+ var arr=[]
|
|
this.datelist=[]
|
|
this.datelist=[]
|
|
getwarehousingorder({contractNo:this.deptBudgetList.contractNo,warehouseName:e}).toPromise()
|
|
getwarehousingorder({contractNo:this.deptBudgetList.contractNo,warehouseName:e}).toPromise()
|
|
.then(response => {
|
|
.then(response => {
|
|
for (let i = 0; i < response.length; i++) {
|
|
for (let i = 0; i < response.length; i++) {
|
|
- this.datelist.push({time:response[i].issuingTime,id:response[i].id,weight:response[i].inWarehouseWeight})
|
|
|
|
|
|
+ arr.push({time:response[i].issuingTime,id:response[i].id,weight:response[i].inWarehouseWeight})
|
|
}
|
|
}
|
|
|
|
+ this.$set(this.datelist,index,JSON.parse(JSON.stringify(arr)))
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- selectgoodsSource(e,item){
|
|
|
|
|
|
+ selectgoodsSource(e,item,index){
|
|
var weight=0
|
|
var weight=0
|
|
console.log(e)
|
|
console.log(e)
|
|
var money=0
|
|
var money=0
|
|
@@ -249,32 +254,25 @@
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- for (let i = 0; i < this.goodsourcelist.length; i++) {
|
|
|
|
- if(this.goodsourcelist[i].id==e){
|
|
|
|
- item.goodsSource=this.goodsourcelist[i].goodsSource
|
|
|
|
- item.inWarehouseWeight=this.goodsourcelist[i].weight
|
|
|
|
- item.goodsName=this.goodsourcelist[i].goodsName
|
|
|
|
- item.goodsNameKey=this.goodsourcelist[i].goodsNameKey
|
|
|
|
|
|
+ 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].inWarehouseWeight=this.goodsourcelist[index][i].weight
|
|
|
|
+ this.feeDetailsDistributions[index].goodsName=this.goodsourcelist[index][i].goodsName
|
|
|
|
+ this.feeDetailsDistributions[index].goodsNameKey=this.goodsourcelist[index][i].goodsNameKey
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if(this.moneys=='按重量自动分配'){
|
|
if(this.moneys=='按重量自动分配'){
|
|
|
|
+ weight = this.feeDetailsDistributions.reduce(function (total, currentValue, currentIndex, arr) {
|
|
|
|
+ return total + currentValue.inWarehouseWeight;
|
|
|
|
+ }, 0)
|
|
for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
- weight+=this.feeDetailsDistributions[i].inWarehouseWeight
|
|
|
|
- }
|
|
|
|
- for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
|
- // console.log(weight,this.feeDetailsDistributions[i].inWarehouseWeight)
|
|
|
|
- if(i=this.feeDetailsDistributions.length-1&&i!=0){
|
|
|
|
- console.log(i)
|
|
|
|
- this.feeDetailsDistributions[i].distributionMoney=this.deptBudgetList.amountMoney-money
|
|
|
|
- }else{
|
|
|
|
this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
|
|
this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
|
|
money+=this.feeDetailsDistributions[i].distributionMoney
|
|
money+=this.feeDetailsDistributions[i].distributionMoney
|
|
- }
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- selecttime(e,item){
|
|
|
|
|
|
+ selecttime(e,item,index){
|
|
var weight=0
|
|
var weight=0
|
|
var money=0
|
|
var money=0
|
|
if(!this.deptBudgetList.amountMoney&&this.moneys=='按重量自动分配'){
|
|
if(!this.deptBudgetList.amountMoney&&this.moneys=='按重量自动分配'){
|
|
@@ -289,10 +287,11 @@
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- for (let i = 0; i < this.datelist.length; i++) {
|
|
|
|
- if(this.datelist[i].time==e){
|
|
|
|
- item.orderId=this.datelist[i].id
|
|
|
|
- item.inWarehouseWeight=this.datelist[i].weight
|
|
|
|
|
|
+ for (let i = 0; i < this.datelist[index].length; i++) {
|
|
|
|
+ // console.log()
|
|
|
|
+ if(this.datelist[index][i].time==e){
|
|
|
|
+ item.orderId=this.datelist[index][i].id
|
|
|
|
+ item.inWarehouseWeight=this.datelist[index][i].weight
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if(this.moneys=='按重量自动分配'){
|
|
if(this.moneys=='按重量自动分配'){
|
|
@@ -301,23 +300,22 @@
|
|
}
|
|
}
|
|
for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
// console.log(weight,this.feeDetailsDistributions[i].inWarehouseWeight)
|
|
// console.log(weight,this.feeDetailsDistributions[i].inWarehouseWeight)
|
|
- if(i=this.feeDetailsDistributions.length-1&&i!=0){
|
|
|
|
- this.feeDetailsDistributions[i].distributionMoney=this.deptBudgetList.amountMoney-money
|
|
|
|
- }else{
|
|
|
|
this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
|
|
this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
|
|
money+=this.feeDetailsDistributions[i].distributionMoney
|
|
money+=this.feeDetailsDistributions[i].distributionMoney
|
|
- }
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// console.log(this.feeDetailsDistributions)
|
|
// console.log(this.feeDetailsDistributions)
|
|
},
|
|
},
|
|
- receiptDocDatechange(e){
|
|
|
|
- this.goodsourcelist=[]
|
|
|
|
|
|
+ receiptDocDatechange(e,index){
|
|
|
|
+ var arr=[]
|
|
|
|
+ this.goodsourcelist[index]=[]
|
|
getwarehousingorder({warehouseName:this.deptBudgetList.warehouseName,receiptDocDate:e}).toPromise()
|
|
getwarehousingorder({warehouseName:this.deptBudgetList.warehouseName,receiptDocDate:e}).toPromise()
|
|
.then(response => {
|
|
.then(response => {
|
|
for (let i = 0; i < response.length; i++) {
|
|
for (let i = 0; i < response.length; i++) {
|
|
- this.goodsourcelist.push({goodsSource:response[i].goodsSource,id:response[i].id,weight:response[i].inWarehouseWeight,goodsName:response[i].goodsName,goodsNameKey:response[i].goodsNameKey})
|
|
|
|
|
|
+ arr.push({goodsSource:response[i].goodsSource,id:response[i].id,weight:response[i].inWarehouseWeight,goodsName:response[i].goodsName,goodsNameKey:response[i].goodsNameKey})
|
|
}
|
|
}
|
|
|
|
+ this.$set(this.goodsourcelist,index,JSON.parse(JSON.stringify(arr)))
|
|
})
|
|
})
|
|
},
|
|
},
|
|
selectcontent(e){
|
|
selectcontent(e){
|
|
@@ -334,9 +332,7 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
handlefujian(file) {
|
|
handlefujian(file) {
|
|
- // console.log(file)
|
|
|
|
this.paymentScreenshot.push(file.url)
|
|
this.paymentScreenshot.push(file.url)
|
|
- // this.dialogVisible = true
|
|
|
|
},
|
|
},
|
|
submit(){
|
|
submit(){
|
|
this.deptBudgetList.totalDistribution=this.amount
|
|
this.deptBudgetList.totalDistribution=this.amount
|
|
@@ -405,14 +401,6 @@
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- // for (let q = 0; q < data.length; q++) {
|
|
|
|
- // if(data[q].warehouseName==this.feeDetailsDistributions[i].warehouseName&&this.feeDetailsDistributions[i].receiptDocDate==data[q].receiptDocDate){
|
|
|
|
- // this.$message({
|
|
|
|
- // message: '请不要选择一样的入库单!',
|
|
|
|
- // type: 'warning',
|
|
|
|
- // })
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -435,14 +423,6 @@
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- // for (let q = 0; q < data.length; q++) {
|
|
|
|
- // if(data[q].warehouseName==this.feeDetailsDistributions[i].warehouseName&&this.feeDetailsDistributions[i].receiptDocDate==data[q].receiptDocDate){
|
|
|
|
- // this.$message({
|
|
|
|
- // message: '请不要选择一样的入库单!',
|
|
|
|
- // type: 'warning',
|
|
|
|
- // })
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -455,7 +435,7 @@
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(!this.deptBudgetList.warehouse&&this.deptBudgetList.expensesPurpose==3){
|
|
|
|
|
|
+ if(!this.deptBudgetList.warehouseName&&this.deptBudgetList.expensesPurpose==3){
|
|
this.$message({
|
|
this.$message({
|
|
message: '仓库名称不能为空!',
|
|
message: '仓库名称不能为空!',
|
|
type: 'warning',
|
|
type: 'warning',
|
|
@@ -509,7 +489,7 @@
|
|
return
|
|
return
|
|
}
|
|
}
|
|
this.deptBudgetList.addressUrl=this.paymentScreenshot.toString()
|
|
this.deptBudgetList.addressUrl=this.paymentScreenshot.toString()
|
|
- this.deptBudgetList.flag=4
|
|
|
|
|
|
+ this.deptBudgetList.flag=3
|
|
editexenseinfo(this.deptBudgetList).toPromise()
|
|
editexenseinfo(this.deptBudgetList).toPromise()
|
|
.then(response => {
|
|
.then(response => {
|
|
this.$message({
|
|
this.$message({
|
|
@@ -521,18 +501,32 @@
|
|
},
|
|
},
|
|
modeselect(e){
|
|
modeselect(e){
|
|
console.log(e)
|
|
console.log(e)
|
|
- },selectware(e){
|
|
|
|
- console.log(e)
|
|
|
|
},
|
|
},
|
|
goodsNameselect(e){
|
|
goodsNameselect(e){
|
|
console.log(e)
|
|
console.log(e)
|
|
},
|
|
},
|
|
addlist(){
|
|
addlist(){
|
|
- this.feeDetailsDistributions.push({proDate:'',weight:'',money:'',warehouse:'',belonging:'',index:this.feeDetailsDistributions.length})
|
|
|
|
|
|
+ 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){
|
|
dellist(row){
|
|
if(this.feeDetailsDistributions.length>1){
|
|
if(this.feeDetailsDistributions.length>1){
|
|
- this.feeDetailsDistributions.splice(row.index,1)
|
|
|
|
|
|
+ if(row.id==0){
|
|
|
|
+ this.feeDetailsDistributions.splice(row.index,1)
|
|
|
|
+ }else{
|
|
|
|
+ deloneallocationinfo({id:row.id}).toPromise().then((response) => {
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ var weight=0
|
|
|
|
+ var money=0
|
|
|
|
+ if(this.moneys=='按重量自动分配'){
|
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
|
+ weight+=this.feeDetailsDistributions[i].inWarehouseWeight
|
|
|
|
+ }
|
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
|
+ this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
|
|
|
|
+ money+=this.feeDetailsDistributions[i].distributionMoney
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
getList() {
|
|
getList() {
|
|
@@ -563,24 +557,51 @@
|
|
}else if(response.costType==5){
|
|
}else if(response.costType==5){
|
|
response.type='保证金'
|
|
response.type='保证金'
|
|
}
|
|
}
|
|
- this.deptBudgetList=response
|
|
|
|
|
|
+ this.deptBudgetList=response
|
|
|
|
+ this.dataList=[]
|
|
if(response.addressUrl){
|
|
if(response.addressUrl){
|
|
var arr=[]
|
|
var arr=[]
|
|
var srcs=response.addressUrl.split(',')
|
|
var srcs=response.addressUrl.split(',')
|
|
- this.paymentScreenshot=srcs
|
|
|
|
for (let i = 0; i < srcs.length; i++) {
|
|
for (let i = 0; i < srcs.length; i++) {
|
|
- arr.push({url:srcs[i]})
|
|
|
|
|
|
+ this.dataList.push({url:srcs[i]})
|
|
|
|
|
|
}
|
|
}
|
|
- this.srcList=arr
|
|
|
|
|
|
+ this.paymentScreenshot=srcs
|
|
}
|
|
}
|
|
- if(response.expenseAllocationInfoList){
|
|
|
|
- this.feeDetailsDistributions=response.expenseAllocationInfoList
|
|
|
|
|
|
+ if(localStorage.getItem('expensebh')){
|
|
|
|
+ if(this.deptBudgetList.expensesPurpose==3||this.deptBudgetList.expensesPurpose==1){
|
|
|
|
+ this.getgoodsourcelist()
|
|
|
|
+ }
|
|
|
|
+ // console.log(this.feeDetailsDistributions)
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ async getgoodsourcelist(){
|
|
|
|
+ if(localStorage.getItem('expensebh')){
|
|
|
|
+ this.feeDetailsDistributions=JSON.parse(localStorage.getItem('expensebh'))
|
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
|
+ var arr=[]
|
|
|
|
+ if(this.deptBudgetList.expensesPurpose==3){
|
|
|
|
+ const data = await getwarehousingorder({warehouseName:this.deptBudgetList.warehouseName,receiptDocDate:this.feeDetailsDistributions[i].receiptDocDate}).toPromise()
|
|
|
|
+ this.goodsourcelist[i]=[]
|
|
|
|
+ for (let q = 0; q < data.length; q++) {
|
|
|
|
+ arr.push({
|
|
|
|
+ goodsSource:data[q].goodsSource,
|
|
|
|
+ id:data[q].id,weight:data[q].inWarehouseWeight,goodsName:data[q].goodsName,goodsNameKey:data[q].goodsNameKey})
|
|
|
|
+ }
|
|
|
|
+ this.$set(this.goodsourcelist,i,JSON.parse(JSON.stringify(arr)))
|
|
|
|
+ }else if(this.deptBudgetList.expensesPurpose==1){
|
|
|
|
+ const data = await getwarehousingorder({contractNo:this.deptBudgetList.contractNo,warehouseName:this.feeDetailsDistributions[i].warehouseName}).toPromise()
|
|
|
|
+ this.datelist[i]=[]
|
|
|
|
+ for (let q = 0; q < data.length; q++) {
|
|
|
|
+ arr.push({time:data[i].issuingTime,id:data[i].id,weight:data[i].inWarehouseWeight})
|
|
|
|
+ }
|
|
|
|
+ this.$set(this.datelist,i,JSON.parse(JSON.stringify(arr)))
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ console.log(this.goodsourcelist,this.datelist)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
returnsales(){
|
|
returnsales(){
|
|
this.$router.go(-1)
|
|
this.$router.go(-1)
|
|
},
|
|
},
|
|
@@ -714,4 +735,7 @@
|
|
/deep/.el-form-item {
|
|
/deep/.el-form-item {
|
|
width: 50%;
|
|
width: 50%;
|
|
}
|
|
}
|
|
|
|
+.add,.del{
|
|
|
|
+ width:25px;height:25px;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|