|
@@ -96,7 +96,7 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"&&deptBudgetList.flag!="是"' class='expensetitle'>费用分配</div>
|
|
|
- <div v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"&&deptBudgetList.flag!="是"' style='margin:0 auto 10px;width:90%;'>
|
|
|
+ <div v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"&&deptBudgetList.flag!="是"' style='margin:0 auto 10px;width:90%;display: flex;'>
|
|
|
<ws-select v-model="mode" placeholder="费用分配方式" @change="modeselect">
|
|
|
<ws-option v-for="item in modeList" :key="item.value" :label="item.value" :value="item.value"
|
|
|
style="color: #8890b1" />
|
|
@@ -120,7 +120,20 @@
|
|
|
<ws-option v-for="item in moneysList" :key="item.value" :label="item.value" :value="item.value"
|
|
|
style="color: #8890b1" />
|
|
|
</ws-select>
|
|
|
- <span v-if='mode!="暂不分配"'>合计分配:{{amount}}元</span>
|
|
|
+ <div style='width:30%;' v-if='deptBudgetList.purpose == "库点费用" && deptBudgetList.flag == "否" &&mode != "暂不分配"'>
|
|
|
+ <el-date-picker v-model="value2" type="daterange" align="right" unlink-panels range-separator="至"
|
|
|
+ start-placeholder="开始日期" value-format='yyyy-MM-dd' end-placeholder="结束日期" :picker-options="pickerOptions"
|
|
|
+ @change="dateChange">
|
|
|
+ </el-date-picker>
|
|
|
+ </div>
|
|
|
+ <ws-select v-if='deptBudgetList.purpose == "库点费用" && deptBudgetList.flag == "否" &&mode != "暂不分配"' :disabled='disabled' v-model="orderId" placeholder="全部客户"
|
|
|
+ @change='sourceChange'>
|
|
|
+ <ws-option key="全部客户" label="全部客户" value="" style="color: #8890b1" />
|
|
|
+ <ws-option v-for="item in customerList" :key="item.id" :label="item.goodsSource" :value="item.id"
|
|
|
+ style="color: #8890b1" />
|
|
|
+ </ws-select>
|
|
|
+ <el-button @click="queren" v-if='deptBudgetList.purpose == "库点费用" && deptBudgetList.flag == "否" &&mode != "暂不分配"'>确认</el-button>
|
|
|
+ <span style="margin-top:5px" v-if='mode!="暂不分配"'>合计分配:{{amount}}元</span>
|
|
|
</div>
|
|
|
<el-table ref="tableref" v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"&&mode!="暂不分配"||deptBudgetList.purpose=="库点费用"&&mode!="暂不分配"&&deptBudgetList.flag!="是"' :data="feeDetailsDistributions" style="width: 90%;margin:0 auto;">
|
|
|
<el-table-column v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="仓库名称" min-width="110">
|
|
@@ -154,7 +167,11 @@
|
|
|
<el-table-column v-if='deptBudgetList.purpose=="库点费用"||deptBudgetList.purpose=="合同费用"' 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)})">
|
|
|
+ <el-select v-if="scope.row.orderId &&confirmFlag==0" 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" />
|
|
|
+ </el-select>
|
|
|
+ <el-select v-else v-model="scope.row.goodsSource" 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" />
|
|
|
</el-select>
|
|
@@ -192,16 +209,31 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import WsUpload from '@/components/WsUpload'
|
|
|
- import {setexpense,getcontract,getwarehouse,addexenseinfo,getwarehousingorder,getexpensecount,getpayeeinfo} from '@/model/profitable/index'
|
|
|
+ import {setexpense,getcontract,getwarehouse,addexenseinfo,getwarehousingorder,getexpensecount,getpayeeinfo,getwarehousingorderList} from '@/model/profitable/index'
|
|
|
export default {
|
|
|
components: {
|
|
|
WsUpload,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ customerList: [],
|
|
|
+ goodsSource: '',
|
|
|
+ value2: '',
|
|
|
+ endDate: '',
|
|
|
+ startDate: '',
|
|
|
+ baseId: '',
|
|
|
+ currentPage: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ searchType: '',
|
|
|
+ searchKeyWord: '',
|
|
|
+ goodsName: '',
|
|
|
+ //是否按时间筛选标识,1是
|
|
|
+ confirmFlag: 0,
|
|
|
+ datas: [],
|
|
|
+ orderId: '',
|
|
|
value: [],
|
|
|
profitList: [{
|
|
|
- name: "玉米",
|
|
|
+ name: '玉米',
|
|
|
count: 2000,
|
|
|
}],
|
|
|
mode:'全部分配',
|
|
@@ -213,7 +245,7 @@
|
|
|
warecontractList:[],
|
|
|
dateRange: this.disabledDate(),
|
|
|
feeDetailsDistributions:[{receiptDocDate:'',inWarehouseWeight:0,distributionMoney:0,warehouseName:'',goodsName:'',goodsSource:'',index:0}],
|
|
|
- deptBudgetList:{purpose:"合同费用",type:'粮款',flag:'否',payee:'',accountNumber:'',bank:'',bankBranch:'',wareExpenseType:'杂费',},
|
|
|
+ deptBudgetList:{purpose:'合同费用',type:'粮款',flag:'否',payee:'',accountNumber:'',bank:'',bankBranch:'',wareExpenseType:'杂费',},
|
|
|
makeWordData: {},
|
|
|
warehouseList:[],
|
|
|
contractList:[],
|
|
@@ -243,7 +275,7 @@
|
|
|
|
|
|
},
|
|
|
activated() {
|
|
|
-
|
|
|
+ this.value2 = this.getNowTime()
|
|
|
getexpensecount({compId:localStorage.getItem('ws-pf_compId')}).toPromise()
|
|
|
.then(response => {
|
|
|
// this.Num=response
|
|
@@ -270,33 +302,59 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ sourceChange(e) {
|
|
|
+ if (e == '') {
|
|
|
+ this.goodsSource = '全部客户'
|
|
|
+ this.selectOrderList()
|
|
|
+ } else {
|
|
|
+ for (let i = 0; i < this.customerList.length; i++) {
|
|
|
+ if (this.customerList[i].id == e) {
|
|
|
+ this.goodsSource = this.customerList[i].goodsSource
|
|
|
+ this.orderId = this.customerList[i].id
|
|
|
+ this.selectOrderList()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getNowTime() {
|
|
|
+ const start = new Date(new Date().getTime() - 3600 * 1000 * 24)
|
|
|
+ .toISOString()
|
|
|
+ .replace('T', ' ')
|
|
|
+ .split('.')[0] //默认开始时间1天前
|
|
|
+ const end = new Date(new Date().getTime())
|
|
|
+ .toISOString()
|
|
|
+ .replace('T', ' ')
|
|
|
+ .split('.')[0]//默认结束时间今天
|
|
|
+ // console.log([start.split(' '), end])
|
|
|
+ return [start.split(' ')[0], end.split(' ')[0]]
|
|
|
+ },
|
|
|
Previewf(file) {
|
|
|
console.log(file);
|
|
|
// window.open(file.response)
|
|
|
if (file) {
|
|
|
- const addTypeArray = file.name.split(".");
|
|
|
+ const addTypeArray = file.name.split('.');
|
|
|
const addType = addTypeArray[addTypeArray.length - 1];
|
|
|
console.log(addType);
|
|
|
- if (addType === "pdf") {
|
|
|
+ if (addType === 'pdf') {
|
|
|
let routeData = this.$router.resolve({
|
|
|
- path: "/insurancePdf",
|
|
|
+ path: '/insurancePdf',
|
|
|
query: { url: file.response, showBack: false },
|
|
|
});
|
|
|
- window.open(routeData.href, "_blank");
|
|
|
+ window.open(routeData.href, '_blank');
|
|
|
}
|
|
|
//".rar, .zip, .doc, .docx, .xls, .txt, .pdf, .jpg, .png, .jpeg,"
|
|
|
- else if (addType === "doc" || addType === "docx" || addType === "xls") {
|
|
|
+ else if (addType === 'doc' || addType === 'docx' || addType === 'xls') {
|
|
|
window.open(
|
|
|
- "http://view.officeapps.live.com/op/view.aspx?src=" + file.response
|
|
|
+ 'http://view.officeapps.live.com/op/view.aspx?src=' + file.response
|
|
|
);
|
|
|
- } else if (addType === "txt") {
|
|
|
+ } else if (addType === 'txt') {
|
|
|
window.open(file.response);
|
|
|
- } else if (["png", "jpg", "jpeg"].includes(addType)) {
|
|
|
+ } else if (['png', 'jpg', 'jpeg'].includes(addType)) {
|
|
|
window.open(file.response);
|
|
|
- } else if (addType === "rar" || addType === "zip") {
|
|
|
+ } else if (addType === 'rar' || addType === 'zip') {
|
|
|
this.$message({
|
|
|
- message: "该文件类型暂不支持预览",
|
|
|
- type: "warning",
|
|
|
+ message: '该文件类型暂不支持预览',
|
|
|
+ type: 'warning',
|
|
|
});
|
|
|
return false;
|
|
|
}
|
|
@@ -328,9 +386,9 @@
|
|
|
timeFun(unixtimestamp) {
|
|
|
var unixtimestamp = new Date(unixtimestamp);
|
|
|
var year = 1900 + unixtimestamp.getYear();
|
|
|
- var month = "0" + (unixtimestamp.getMonth() + 1);
|
|
|
- var date = "0" + unixtimestamp.getDate();
|
|
|
- return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2,date.length)
|
|
|
+ var month = '0' + (unixtimestamp.getMonth() + 1);
|
|
|
+ var date = '0' + unixtimestamp.getDate();
|
|
|
+ return year + '-' + month.substring(month.length - 2, month.length) + '-' + date.substring(date.length - 2,date.length)
|
|
|
},
|
|
|
selectware(e,index){
|
|
|
var arr=[]
|
|
@@ -345,40 +403,49 @@
|
|
|
this.$set(this.goodsourcelist,index,JSON.parse(JSON.stringify(arr)))
|
|
|
})
|
|
|
},
|
|
|
- selectgoodsSource(e,item,index){
|
|
|
- var weight=0
|
|
|
- console.log(e)
|
|
|
- var money=0
|
|
|
- if(!this.deptBudgetList.amountMoney&&this.moneys=='按重量自动分配'){
|
|
|
- for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
- if(this.feeDetailsDistributions[i].orderId==e){
|
|
|
- this.feeDetailsDistributions[i].orderId=''
|
|
|
- }
|
|
|
+ selectgoodsSource(e, item, index) {
|
|
|
+ var weight = 0
|
|
|
+ var money = 0
|
|
|
+ var moneyDiff = 0
|
|
|
+ if (!this.deptBudgetList.amountMoney && this.moneys == '按重量自动分配') {
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
+ if (this.feeDetailsDistributions[i].orderId && this.feeDetailsDistributions[i].orderId == e) {
|
|
|
+ this.feeDetailsDistributions[i].orderId = ''
|
|
|
}
|
|
|
- this.$message({
|
|
|
- message: '请输入金额之后进行操作',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- return
|
|
|
}
|
|
|
- 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
|
|
|
- }
|
|
|
+ this.$message({
|
|
|
+ message: '请输入金额之后进行操作',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 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
|
|
|
+ this.feeDetailsDistributions[index].orderId = this.goodsourcelist[index][i].id
|
|
|
}
|
|
|
- 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++) {
|
|
|
- this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
|
|
|
- money+=this.feeDetailsDistributions[i].distributionMoney
|
|
|
- }
|
|
|
+ }
|
|
|
+ if (this.moneys == '按重量自动分配') {
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
+ weight += Number(this.feeDetailsDistributions[i].inWarehouseWeight)
|
|
|
}
|
|
|
- },
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
+ if (i != this.feeDetailsDistributions.length - 1) {
|
|
|
+ this.feeDetailsDistributions[i].distributionMoney = Math.round((this.feeDetailsDistributions[i].inWarehouseWeight / weight) * this.deptBudgetList.amountMoney)
|
|
|
+ if (this.feeDetailsDistributions[i].distributionMoney) {
|
|
|
+ moneyDiff += Number(this.feeDetailsDistributions[i].distributionMoney)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (i == this.feeDetailsDistributions.length - 1) {
|
|
|
+ this.feeDetailsDistributions[i].distributionMoney = this.deptBudgetList.amountMoney - moneyDiff
|
|
|
+ }
|
|
|
+ money = this.feeDetailsDistributions[i].distributionMoney + moneyDiff
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
selecttime(e,item,index){
|
|
|
var weight=0
|
|
|
var money=0
|
|
@@ -426,6 +493,96 @@
|
|
|
this.$set(this.goodsourcelist,index,JSON.parse(JSON.stringify(arr)))
|
|
|
})
|
|
|
},
|
|
|
+ queren() {
|
|
|
+ if (!this.deptBudgetList.amountMoney && this.moneys == '按重量自动分配') {
|
|
|
+ this.$message({
|
|
|
+ message: '请输入金额之后进行操作',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.confirmFlag = 1
|
|
|
+ this.selectOrderList()
|
|
|
+ },
|
|
|
+ dateChange(e) {
|
|
|
+ this.value2 = e
|
|
|
+ },
|
|
|
+ selectOrderList() {
|
|
|
+ var arr = []
|
|
|
+ var weight = 0
|
|
|
+ var money = 0
|
|
|
+ var moneyDiff = 0
|
|
|
+ this.startDate = this.value2[0]
|
|
|
+ this.endDate = this.value2[1]
|
|
|
+ if(!this.deptBudgetList.warehouseId){
|
|
|
+ this.$message({
|
|
|
+ message: '请选择仓库之后进行操作',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ getwarehousingorderList({
|
|
|
+ compId: localStorage.getItem('ws-pf_compId'),
|
|
|
+ startDate: this.startDate,
|
|
|
+ endDate: this.endDate,
|
|
|
+ baseId: this.deptBudgetList.warehouseId,
|
|
|
+ currentPage: this.currentPage,
|
|
|
+ pageSize: this.pageSize,
|
|
|
+ searchType: this.searchType,
|
|
|
+ searchKeyWord: this.searchKeyWord,
|
|
|
+ goodsName: this.goodsName,
|
|
|
+ goodsSource: this.goodsSource == '全部客户' ? '' : this.goodsSource
|
|
|
+ })
|
|
|
+ .toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ this.datas = []
|
|
|
+ if (this.goodsSource && this.goodsSource != '全部客户') {
|
|
|
+ for (let i = 0; i < response.records.length; i++) {
|
|
|
+ this.datas.push(response.records[i])
|
|
|
+ }
|
|
|
+ for (let z = 0; z < this.datas.length; z++) {
|
|
|
+ arr.push({ receiptDocDate: this.datas[z].issuingTime, goodsSource: this.datas[z].goodsSource, id: this.datas[z].id, weight: this.datas[z].inWarehouseWeight, goodsName: this.datas[z].goodsName, goodsNameKey: this.datas[z].goodsNameKey })
|
|
|
+ }
|
|
|
+ this.feeDetailsDistributions = arr
|
|
|
+ } else {
|
|
|
+ for (let i = 0; i < response.records.length; i++) {
|
|
|
+ for (let j = 0; j < response.records[i].warehousingOrderList.length; j++) {
|
|
|
+ this.datas.push(response.records[i].warehousingOrderList[j])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (let z = 0; z < this.datas.length; z++) {
|
|
|
+ arr.push({ receiptDocDate: this.datas[z].issuingTime, goodsSource: this.datas[z].goodsSource,orderId:this.datas[z].id, id: this.datas[z].id, weight: this.datas[z].inWarehouseWeight, goodsName: this.datas[z].goodsName, goodsNameKey: this.datas[z].goodsNameKey })
|
|
|
+ }
|
|
|
+ this.feeDetailsDistributions = arr
|
|
|
+
|
|
|
+ //获取客户
|
|
|
+ this.customerList = this.unique(arr)
|
|
|
+ }
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
+ this.feeDetailsDistributions[i].inWarehouseWeight = this.feeDetailsDistributions[i].weight
|
|
|
+ weight += Number(this.feeDetailsDistributions[i].inWarehouseWeight)
|
|
|
+ }
|
|
|
+ if (this.moneys == '按重量自动分配') {
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
+ if (i != this.feeDetailsDistributions.length - 1) {
|
|
|
+ this.feeDetailsDistributions[i].distributionMoney = Math.round((this.feeDetailsDistributions[i].inWarehouseWeight / weight) * this.deptBudgetList.amountMoney)
|
|
|
+ if (this.feeDetailsDistributions[i].distributionMoney) {
|
|
|
+ moneyDiff += Number(this.feeDetailsDistributions[i].distributionMoney)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (i == this.feeDetailsDistributions.length - 1) {
|
|
|
+ this.feeDetailsDistributions[i].distributionMoney = this.deptBudgetList.amountMoney - moneyDiff
|
|
|
+ }
|
|
|
+ // this.feeDetailsDistributions[i].distributionMoney = Math.round((this.feeDetailsDistributions[i].inWarehouseWeight / weight) * this.deptBudgetList.amountMoney)
|
|
|
+ money = this.feeDetailsDistributions[i].distributionMoney + moneyDiff
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ unique(arr) {
|
|
|
+ const res = new Map();
|
|
|
+ return arr.filter((arr) => !res.has(arr.goodsSource) && res.set(arr.goodsSource, 1));
|
|
|
+ },
|
|
|
selectcontent(e){
|
|
|
|
|
|
},
|
|
@@ -436,7 +593,7 @@
|
|
|
this.signingDate=this.contractList[i].signingDate
|
|
|
getpayeeinfo({compId:localStorage.getItem('ws-pf_compId'),contractNo:e}).toPromise()
|
|
|
.then((response1) => {
|
|
|
- this.deptBudgetList.payee=response1.customerType=="企业客户"?response1.compName:response1.customerName
|
|
|
+ this.deptBudgetList.payee=response1.customerType=='企业客户'?response1.compName:response1.customerName
|
|
|
this.deptBudgetList.accountNumber=response1.bankCard
|
|
|
this.deptBudgetList.bank=response1.bankDeposit
|
|
|
this.deptBudgetList.bankBranch=response1.bankDepositBranch
|
|
@@ -519,7 +676,7 @@
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- if(this.deptBudgetList.purpose=='合同费用'&&this.deptBudgetList.type=='非粮款'||this.deptBudgetList.purpose=='库点费用'&&this.deptBudgetList.flag!="是"){
|
|
|
+ if(this.deptBudgetList.purpose=='合同费用'&&this.deptBudgetList.type=='非粮款'||this.deptBudgetList.purpose=='库点费用'&&this.deptBudgetList.flag!='是'){
|
|
|
for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
// if(!this.feeDetailsDistributions[i].goodsSource){
|
|
|
// this.$message({
|
|
@@ -528,7 +685,7 @@
|
|
|
// })
|
|
|
// return
|
|
|
// }
|
|
|
- if(!this.feeDetailsDistributions[i].distributionMoney&&this.mode!="暂不分配"){
|
|
|
+ if(!this.feeDetailsDistributions[i].distributionMoney&&this.mode!='暂不分配'){
|
|
|
this.$message({
|
|
|
message: '分配金额不能为空!',
|
|
|
type: 'warning',
|
|
@@ -568,7 +725,7 @@
|
|
|
this.deptBudgetList.expenseAllocationInfoList=[]
|
|
|
}else{
|
|
|
this.deptBudgetList.storageFeeFlag=0
|
|
|
- if(this.mode=="暂不分配"){
|
|
|
+ if(this.mode=='暂不分配'){
|
|
|
this.deptBudgetList.expenseAllocationInfoList=[]
|
|
|
}else{
|
|
|
this.deptBudgetList.expenseAllocationInfoList=this.feeDetailsDistributions
|
|
@@ -586,7 +743,7 @@
|
|
|
this.deptBudgetList.expenseAllocationInfoList=[]
|
|
|
}else if(this.deptBudgetList.type=='非粮款'){
|
|
|
this.deptBudgetList.costType=3
|
|
|
- if(this.mode!="暂不分配"){
|
|
|
+ if(this.mode!='暂不分配'){
|
|
|
this.deptBudgetList.expenseAllocationInfoList=this.feeDetailsDistributions
|
|
|
}
|
|
|
}else if(this.deptBudgetList.type=='保证金'){
|
|
@@ -632,6 +789,7 @@
|
|
|
}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
|
|
|
})
|
|
|
if(repetition.length==0){
|
|
|
data.push(this.feeDetailsDistributions[i])
|
|
@@ -737,7 +895,7 @@
|
|
|
})
|
|
|
}
|
|
|
this.mode='全部分配'
|
|
|
- this.deptBudgetList={purpose:"合同费用",type:'粮款',flag:'否',payee:'',accountNumber:'',bank:'',bankBranch:'',wareExpenseType:'杂费',}
|
|
|
+ this.deptBudgetList={purpose:'合同费用',type:'粮款',flag:'否',payee:'',accountNumber:'',bank:'',bankBranch:'',wareExpenseType:'杂费',}
|
|
|
this.feeDetailsDistributions=[{receiptDocDate:'',inWarehouseWeight:0,distributionMoney:0,warehouseName:'',goodsName:'',goodsSource:'',index:0}]
|
|
|
this.paymentScreenshot=[]
|
|
|
this.$refs.upload.clearFiles()
|
|
@@ -760,16 +918,43 @@
|
|
|
addlist(){
|
|
|
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){
|
|
|
- if(this.feeDetailsDistributions.length>1){
|
|
|
- this.feeDetailsDistributions.splice(row.index,1)
|
|
|
- }else{
|
|
|
- this.$message({
|
|
|
- message: '至少保留一条!',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
+ dellist(row) {
|
|
|
+ var weight = 0
|
|
|
+ var money = 0
|
|
|
+ var moneyDiff = 0
|
|
|
+ if (this.feeDetailsDistributions.length > 1) {
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
+ if (this.feeDetailsDistributions[i]) {
|
|
|
+ if (this.feeDetailsDistributions[i] == row) {
|
|
|
+ this.feeDetailsDistributions.splice(i, 1)
|
|
|
+ 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++) {
|
|
|
+ if (i != this.feeDetailsDistributions.length - 1) {
|
|
|
+ this.feeDetailsDistributions[i].distributionMoney = Math.round((this.feeDetailsDistributions[i].inWarehouseWeight / weight) * this.deptBudgetList.amountMoney)
|
|
|
+ if (this.feeDetailsDistributions[i].distributionMoney) {
|
|
|
+ moneyDiff += Number(this.feeDetailsDistributions[i].distributionMoney)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (i == this.feeDetailsDistributions.length - 1) {
|
|
|
+ this.feeDetailsDistributions[i].distributionMoney = this.deptBudgetList.amountMoney - moneyDiff
|
|
|
+ }
|
|
|
+ money = this.feeDetailsDistributions[i].distributionMoney + moneyDiff
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- },
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: '至少保留一条!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
getList() {
|
|
|
getcontract({
|
|
|
compId:localStorage.getItem('ws-pf_compId'),
|