|
@@ -34,6 +34,10 @@
|
|
<ws-option label="保证金" value="5" 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">
|
|
|
|
+ <span v-if='(deptBudgetList.storageFeeFlag==1)'>是</span>
|
|
|
|
+ <span v-if='(deptBudgetList.storageFeeFlag==0)'>否</span>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item v-if='deptBudgetList.expensesPurpose==3' label-width='100px' label="仓库名称" span="1" prop="warehouse" class="readonly">
|
|
<el-form-item v-if='deptBudgetList.expensesPurpose==3' label-width='100px' label="仓库名称" span="1" prop="warehouse" class="readonly">
|
|
{{deptBudgetList.warehouseName}}
|
|
{{deptBudgetList.warehouseName}}
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -86,9 +90,9 @@
|
|
<el-input disabled class='input50 input_css' placeholder="输入开户支行" v-model="deptBudgetList.bankBranch"></el-input>
|
|
<el-input disabled class='input50 input_css' placeholder="输入开户支行" v-model="deptBudgetList.bankBranch"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
- <div v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"||deptBudgetList.expensesPurpose==2' class='expensetitle'>费用分配</div>
|
|
|
|
- <div v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"||deptBudgetList.expensesPurpose==2' style='margin:0 auto 10px;width:90%;'>
|
|
|
|
- <ws-select v-model="mode" placeholder="费用分配方式" @change="modeselect">
|
|
|
|
|
|
+ <div v-if='(deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"&&deptBudgetList.storageFeeFlag==0||deptBudgetList.expensesPurpose==2&&deptBudgetList.storageFeeFlag==0)' class='expensetitle'>费用分配</div>
|
|
|
|
+ <div v-if='(deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"&&deptBudgetList.storageFeeFlag==0||deptBudgetList.expensesPurpose==2&&deptBudgetList.storageFeeFlag==0)' 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"
|
|
<ws-option v-for="item in modeList" :key="item.value" :label="item.value" :value="item.value"
|
|
style="color: #8890b1" />
|
|
style="color: #8890b1" />
|
|
</ws-select>
|
|
</ws-select>
|
|
@@ -111,7 +115,21 @@
|
|
<ws-option v-for="item in moneysList" :key="item.value" :label="item.value" :value="item.value"
|
|
<ws-option v-for="item in moneysList" :key="item.value" :label="item.value" :value="item.value"
|
|
style="color: #8890b1" />
|
|
style="color: #8890b1" />
|
|
</ws-select>
|
|
</ws-select>
|
|
- <span v-if='mode!="暂不分配"'>合计分配:{{amount}}元</span>
|
|
|
|
|
|
+ <div style='width:30%;' v-if='(deptBudgetList.purpose == "库点费用" &&mode != "暂不分配" && deptBudgetList.storageFeeFlag==0)'>
|
|
|
|
+ <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>
|
|
|
|
+ <!-- && deptBudgetList.flag == "否" :disabled='disabled'-->
|
|
|
|
+ <el-button type="primary" @click="queren" v-if='(deptBudgetList.purpose == "库点费用" &&mode != "暂不分配" && deptBudgetList.storageFeeFlag==0)'>确认</el-button>
|
|
|
|
+ <ws-select v-if='(deptBudgetList.purpose == "库点费用" &&mode != "暂不分配"&& deptBudgetList.storageFeeFlag==0)' v-model="goodsSource" placeholder="全部客户"
|
|
|
|
+ @change='sourceChange'>
|
|
|
|
+ <ws-option key="全部客户" label="全部客户" value="全部客户" style="color: #8890b1" />
|
|
|
|
+ <ws-option v-for="item in customerList" :key="item.goodsSource" :label="item.goodsSource" :value="item.goodsSource"
|
|
|
|
+ style="color: #8890b1" />
|
|
|
|
+ </ws-select>
|
|
|
|
+ <span style="margin-top:5px" v-if='mode!="暂不分配"'>合计分配:{{amount}}元</span>
|
|
</div>
|
|
</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 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 width="150" v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="仓库名称" min-width="110">
|
|
@@ -153,7 +171,15 @@
|
|
<el-table-column v-if='deptBudgetList.purpose=="库点费用"||deptBudgetList.expensesPurpose==2||deptBudgetList.expensesPurpose==1' prop="date" label="货源">
|
|
<el-table-column v-if='deptBudgetList.purpose=="库点费用"||deptBudgetList.expensesPurpose==2||deptBudgetList.expensesPurpose==1' prop="date" label="货源">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<!-- {{scope.row.goodsourcelist}} -->
|
|
<!-- {{scope.row.goodsourcelist}} -->
|
|
- <el-select class="goodsource" v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
|
|
|
|
|
|
+ <!-- <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" />
|
|
|
|
+ </el-select> -->
|
|
|
|
+ <el-select style="width: 100%;" v-if="(scope.row.orderId &&confirmFlag==0 && !scope.row.goodsSource)" 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 style="width: 100%;" 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"
|
|
<el-option v-for="item in goodsourcelist[scope.$index]" :key="item.id" :label="item.goodsSource" :value="item.id"
|
|
style="color: #8890b1" />
|
|
style="color: #8890b1" />
|
|
</el-select>
|
|
</el-select>
|
|
@@ -192,16 +218,34 @@
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import WsUpload from '@/components/WsUpload'
|
|
import WsUpload from '@/components/WsUpload'
|
|
- import {lookexenseinfo,getcontract,getwarehouse,getwarehousingorder,editexenseinfo,deloneallocationinfo} from '@/model/profitable/index'
|
|
|
|
|
|
+ import {lookexenseinfo,getcontract,getwarehouse,getwarehousingorder,editexenseinfo,deloneallocationinfo,getwarehousingorderList} from '@/model/profitable/index'
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
WsUpload,
|
|
WsUpload,
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ customerList: [],
|
|
|
|
+ goodsSource: '',
|
|
|
|
+ value2: '',
|
|
|
|
+ endDate: '',
|
|
|
|
+ startDate: '',
|
|
|
|
+ baseId: '',
|
|
|
|
+ warehouseName:'',
|
|
|
|
+ currentPage: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ searchType: '',
|
|
|
|
+ searchKeyWord: '',
|
|
|
|
+ goodsName: '',
|
|
|
|
+ storageFeeFlag:'',
|
|
|
|
+ //是否按时间筛选标识,1是
|
|
|
|
+ confirmFlag: 0,
|
|
|
|
+ datas: [],
|
|
|
|
+ datas1:[],
|
|
|
|
+ orderId: '',
|
|
value: [],
|
|
value: [],
|
|
profitList: [{
|
|
profitList: [{
|
|
- name: "玉米",
|
|
|
|
|
|
+ name: '玉米',
|
|
count: 2000,
|
|
count: 2000,
|
|
}],
|
|
}],
|
|
mode:'全部分配',
|
|
mode:'全部分配',
|
|
@@ -214,16 +258,16 @@
|
|
compId:localStorage.getItem('ws-pf_compId'),
|
|
compId:localStorage.getItem('ws-pf_compId'),
|
|
// 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:[[{goodsName: "玉米",
|
|
|
|
|
|
+ goodsourcelist:[[{goodsName: '玉米',
|
|
goodsNameKey: null,
|
|
goodsNameKey: null,
|
|
-goodsSource: "张跃文",
|
|
|
|
-id: "34e710ed3883484798ab37ec4ee9b9cd",
|
|
|
|
|
|
+goodsSource: '张跃文',
|
|
|
|
+id: '34e710ed3883484798ab37ec4ee9b9cd',
|
|
weight: 4000}]],
|
|
weight: 4000}]],
|
|
signingDate:'',
|
|
signingDate:'',
|
|
datelist:[],
|
|
datelist:[],
|
|
@@ -248,6 +292,7 @@ weight: 4000}]],
|
|
// this.makeWordData = this.getData(2)
|
|
// this.makeWordData = this.getData(2)
|
|
// this.initCharts()
|
|
// this.initCharts()
|
|
// this.getPassYearFormatDate()
|
|
// this.getPassYearFormatDate()
|
|
|
|
+ this.value2 = this.getNowTime()
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -255,19 +300,125 @@ weight: 4000}]],
|
|
amount: function () {
|
|
amount: function () {
|
|
// `this` 指向 vm 实例
|
|
// `this` 指向 vm 实例
|
|
var num=0
|
|
var num=0
|
|
- for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
|
- num+=Number(this.feeDetailsDistributions[i].distributionMoney)
|
|
|
|
- }
|
|
|
|
- return num
|
|
|
|
- }
|
|
|
|
|
|
+ if (this.feeDetailsDistributions) {
|
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
|
+ num += Number(this.feeDetailsDistributions[i].distributionMoney)
|
|
|
|
+ }
|
|
|
|
+ return num
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ sourceChange(e) {
|
|
|
|
+ if (e == '') {
|
|
|
|
+ this.goodsSource = '全部客户'
|
|
|
|
+ } else {
|
|
|
|
+ this.goodsSource = e
|
|
|
|
+ }
|
|
|
|
+ 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]]
|
|
|
|
+ },
|
|
|
|
+ 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]
|
|
|
|
+ getwarehousingorderList({
|
|
|
|
+ compId: localStorage.getItem('ws-pf_compId'),
|
|
|
|
+ startDate: this.startDate,
|
|
|
|
+ endDate: this.endDate,
|
|
|
|
+ baseId: this.deptBudgetList.warehouseId,
|
|
|
|
+ warehouseName : this.deptBudgetList.warehouseName,
|
|
|
|
+ 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 = []
|
|
|
|
+ this.datas1 = []
|
|
|
|
+ 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: '', 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: '', 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
|
|
|
|
+ }
|
|
|
|
+ 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));
|
|
|
|
+ },
|
|
timeFun(unixtimestamp) {
|
|
timeFun(unixtimestamp) {
|
|
var unixtimestamp = new Date(unixtimestamp);
|
|
var unixtimestamp = new Date(unixtimestamp);
|
|
var year = 1900 + unixtimestamp.getYear();
|
|
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){
|
|
selectware(e,index){
|
|
var arr=[]
|
|
var arr=[]
|
|
@@ -283,8 +434,8 @@ weight: 4000}]],
|
|
},
|
|
},
|
|
selectgoodsSource(e,item,index){
|
|
selectgoodsSource(e,item,index){
|
|
var weight=0
|
|
var weight=0
|
|
- console.log(e)
|
|
|
|
var money=0
|
|
var money=0
|
|
|
|
+ var moneyDiff = 0
|
|
if(!this.deptBudgetList.amountMoney&&this.moneys=='按重量自动分配'){
|
|
if(!this.deptBudgetList.amountMoney&&this.moneys=='按重量自动分配'){
|
|
for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
if(this.feeDetailsDistributions[i].orderId==e){
|
|
if(this.feeDetailsDistributions[i].orderId==e){
|
|
@@ -303,17 +454,35 @@ weight: 4000}]],
|
|
this.feeDetailsDistributions[index].inWarehouseWeight=this.goodsourcelist[index][i].weight
|
|
this.feeDetailsDistributions[index].inWarehouseWeight=this.goodsourcelist[index][i].weight
|
|
this.feeDetailsDistributions[index].goodsName=this.goodsourcelist[index][i].goodsName
|
|
this.feeDetailsDistributions[index].goodsName=this.goodsourcelist[index][i].goodsName
|
|
this.feeDetailsDistributions[index].goodsNameKey=this.goodsourcelist[index][i].goodsNameKey
|
|
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=='按重量自动分配'){
|
|
|
|
+ // 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){
|
|
selecttime(e,item,index){
|
|
var weight=0
|
|
var weight=0
|
|
@@ -449,7 +618,7 @@ weight: 4000}]],
|
|
this.deptBudgetList.expenseAllocationInfoList=[]
|
|
this.deptBudgetList.expenseAllocationInfoList=[]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(this.deptBudgetList.expensesPurpose==2){
|
|
|
|
|
|
+ if(this.deptBudgetList.expensesPurpose==2 || this.deptBudgetList.expensesPurpose==3&&this.storageFeeFlag==0){
|
|
this.deptBudgetList.expenseAllocationInfoList=this.feeDetailsDistributions
|
|
this.deptBudgetList.expenseAllocationInfoList=this.feeDetailsDistributions
|
|
}
|
|
}
|
|
if(this.deptBudgetList.expensesPurpose==1||this.deptBudgetList.expensesPurpose==2){
|
|
if(this.deptBudgetList.expensesPurpose==1||this.deptBudgetList.expensesPurpose==2){
|
|
@@ -460,6 +629,7 @@ weight: 4000}]],
|
|
}else{
|
|
}else{
|
|
var repetition=data.filter((item,index)=>{
|
|
var repetition=data.filter((item,index)=>{
|
|
return this.feeDetailsDistributions[i].orderId==item.orderId&&this.feeDetailsDistributions[i].receiptDocDate==item.receiptDocDate
|
|
return this.feeDetailsDistributions[i].orderId==item.orderId&&this.feeDetailsDistributions[i].receiptDocDate==item.receiptDocDate
|
|
|
|
+ && this.feeDetailsDistributions[i].goodsSource == item.goodsSource
|
|
})
|
|
})
|
|
if(repetition.length==0){
|
|
if(repetition.length==0){
|
|
data.push(this.feeDetailsDistributions[i])
|
|
data.push(this.feeDetailsDistributions[i])
|
|
@@ -482,6 +652,7 @@ weight: 4000}]],
|
|
}else{
|
|
}else{
|
|
var repetition=data.filter((item,index)=>{
|
|
var repetition=data.filter((item,index)=>{
|
|
return this.feeDetailsDistributions[i].warehouseName==item.warehouseName&&this.feeDetailsDistributions[i].receiptDocDate==item.receiptDocDate
|
|
return this.feeDetailsDistributions[i].warehouseName==item.warehouseName&&this.feeDetailsDistributions[i].receiptDocDate==item.receiptDocDate
|
|
|
|
+ && this.feeDetailsDistributions[i].goodsSource == item.goodsSource
|
|
})
|
|
})
|
|
if(repetition.length==0){
|
|
if(repetition.length==0){
|
|
data.push(this.feeDetailsDistributions[i])
|
|
data.push(this.feeDetailsDistributions[i])
|
|
@@ -579,29 +750,80 @@ weight: 4000}]],
|
|
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})
|
|
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(row.id==0){
|
|
|
|
- this.feeDetailsDistributions.splice(row.index,1)
|
|
|
|
- }else{
|
|
|
|
- this.feeDetailsDistributions.splice(row.index,1)
|
|
|
|
- var data=localStorage.getItem('expensebh')
|
|
|
|
- var data1=[]
|
|
|
|
- for (let i = 0; i < data.length; i++) {
|
|
|
|
- if(data[i].id==row.id){
|
|
|
|
- var data1=data.splice(row.i,1)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if(data1.length>0){
|
|
|
|
- localStorage.setItem('expensebh',data1)
|
|
|
|
- }else{
|
|
|
|
- localStorage.removeItem('expensebh')
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- deloneallocationinfo({id:row.id}).toPromise().then((response) => {
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
|
|
+ // var weight=0
|
|
|
|
+ // var money=0
|
|
|
|
+ // var moneyDiff = 0
|
|
|
|
+ // if(this.feeDetailsDistributions.length>1){
|
|
|
|
+ // debugger
|
|
|
|
+ // if(row.id==0){
|
|
|
|
+ // this.feeDetailsDistributions.splice(row.index,1)
|
|
|
|
+ // }else{
|
|
|
|
+ // this.feeDetailsDistributions.splice(row.index,1)
|
|
|
|
+ // var data=localStorage.getItem('expensebh')
|
|
|
|
+ // var data1=[]
|
|
|
|
+ // for (let i = 0; i < data.length; i++) {
|
|
|
|
+ // if(data[i].id==row.id){
|
|
|
|
+ // var data1=data.splice(row.i,1)
|
|
|
|
+
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // if(data1.length>0){
|
|
|
|
+ // localStorage.setItem('expensebh',data1)
|
|
|
|
+ // }else{
|
|
|
|
+ // localStorage.removeItem('expensebh')
|
|
|
|
+ // }
|
|
|
|
+ // deloneallocationinfo({id:row.id}).toPromise().then((response) => {
|
|
|
|
+
|
|
|
|
+ // })
|
|
|
|
|
|
|
|
|
|
|
|
+ // }
|
|
|
|
+ var weight = 0
|
|
|
|
+ var money = 0
|
|
|
|
+ var moneyDiff = 0
|
|
|
|
+ if (this.feeDetailsDistributions.length > 1) {
|
|
|
|
+ if (row.id == 0) {
|
|
|
|
+ this.feeDetailsDistributions.splice(row.index, 1)
|
|
|
|
+ } else {
|
|
|
|
+ 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
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ var data = localStorage.getItem('expensebh')
|
|
|
|
+ var data1 = []
|
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
|
+ if (data[i].id == row.id) {
|
|
|
|
+ var data1 = data.splice(row.i, 1)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (data1.length > 0) {
|
|
|
|
+ localStorage.setItem('expensebh', data1)
|
|
|
|
+ } else {
|
|
|
|
+ localStorage.removeItem('expensebh')
|
|
|
|
+ }
|
|
|
|
+ deloneallocationinfo({ id: row.id }).toPromise().then((response) => {
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
this.$message({
|
|
this.$message({
|
|
@@ -610,17 +832,18 @@ weight: 4000}]],
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- 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
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // 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() {
|
|
getcontract({
|
|
getcontract({
|
|
@@ -652,6 +875,7 @@ weight: 4000}]],
|
|
response.type='保证金'
|
|
response.type='保证金'
|
|
}
|
|
}
|
|
this.deptBudgetList=response
|
|
this.deptBudgetList=response
|
|
|
|
+ this.feeDetailsDistributions = this.defineComponent.expenseAllocationInfoList
|
|
this.dataList=[]
|
|
this.dataList=[]
|
|
if(response.addressUrl){
|
|
if(response.addressUrl){
|
|
var arr=[]
|
|
var arr=[]
|