|
@@ -24,13 +24,14 @@
|
|
|
</BaseHeaderLayout>
|
|
|
<el-row style='margin:10px;'>
|
|
|
<el-col :span="12">
|
|
|
- <ws-button :type="searchType===''?'primary':''" @click="handleAdd()" v-hasPermission="
|
|
|
- `warehouseManagement.warehousingOrder.View`
|
|
|
- ">全部
|
|
|
+ <ws-button :type="searchType===''?'primary':''" @click="handle('')" v-hasPermission="
|
|
|
+ `warehouseManagement.warehousingOrder.View`">全部
|
|
|
</ws-button>
|
|
|
- <ws-button :type="searchType==='1'?'primary':''" @click="handleAdd()" v-hasPermission="
|
|
|
- `warehouseManagement.warehousingOrder.View`
|
|
|
- ">未付款
|
|
|
+ <ws-button :type="searchType==='1'?'primary':''" @click="handle('1')" v-hasPermission="
|
|
|
+ `warehouseManagement.warehousingOrder.View`">未付款
|
|
|
+ </ws-button>
|
|
|
+ <ws-button :type="searchType==='2'?'primary':''" @click="handle('2')" v-hasPermission="
|
|
|
+ `warehouseManagement.warehousingOrder.View`">待审核
|
|
|
</ws-button>
|
|
|
</el-col>
|
|
|
<el-col style='text-align:right;' :span="12">
|
|
@@ -67,7 +68,7 @@
|
|
|
</ws-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-table class="wenzi" :data="item.warehousingOrderList" style="width: 100%" @selection-change="handleSelectionChange" >
|
|
|
+ <el-table class="wenzi" :data="item.warehousingOrderList" style="width: 100%" @selection-change="handleSelectionChange($event,item)" >
|
|
|
<el-table-column
|
|
|
:selectable='selectInit'
|
|
|
type="selection"
|
|
@@ -83,13 +84,13 @@
|
|
|
<el-table-column prop="deliveryWarehouse" label="发货库" width="80"></el-table-column>
|
|
|
<el-table-column prop="goodsName" label="货名" width="80">
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="inWarehouseWeight" width="200" class="table_td" label="入库重量(吨)">
|
|
|
+ <el-table-column prop="inWarehouseWeight1" width="200" class="table_td" label="入库重量(吨)">
|
|
|
<template scope="scope">
|
|
|
- <span v-if='!scope.row.weightedit&&scope.row.warehouseType==2||scope.row.warehouseType==1'>{{scope.row.inWarehouseWeight}}</span>
|
|
|
- <el-input style='width:80%;' v-if='scope.row.weightedit&&scope.row.warehouseType==2' v-model='scope.row.inWarehouseWeight'></el-input>
|
|
|
+ <span v-if='scope.row.weightedit==false&&scope.row.warehouseType==2||scope.row.warehouseType==1'>{{scope.row.inWarehouseWeight1}}</span>
|
|
|
+ <el-input style='width:80%;' v-if='scope.row.weightedit&&scope.row.warehouseType==2' v-model='scope.row.inWarehouseWeight1'></el-input>
|
|
|
<i @click="changeWeight(scope.row)" v-if="
|
|
|
- scope.row.weightedit&&scope.row.weightshow" class="iconfont icon-dui"></i>
|
|
|
- <img v-if="!scope.row.weightedit&&scope.row.weightshow" width="17" height="18" style="vertical-align: text-top; position: relative; top: -1px"
|
|
|
+ scope.row.weightedit&&scope.row.warehouseType==2" class="iconfont icon-dui"></i>
|
|
|
+ <img v-if="!scope.row.weightedit&&scope.row.warehouseType==2" width="17" height="18" style="vertical-align: text-top; position: relative; top: -1px"
|
|
|
src="../../../public/img/edit.png" @click="editWeight(scope.row)" alt="" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -111,7 +112,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="avgCost" width="130" class="table_td" label="平均成本(元/吨)"></el-table-column>
|
|
|
- <el-table-column prop="requestFunds" width="130" class="table_td" label="请款">
|
|
|
+ <el-table-column prop="requestFunds" width="180" class="table_td" label="请款">
|
|
|
<template scope="scope">
|
|
|
<span v-if="!scope.row.select">{{ scope.row.requestFunds }}</span>
|
|
|
<el-input v-else v-model='scope.row.requestFunds'></el-input>
|
|
@@ -202,13 +203,14 @@
|
|
|
getoreditoutput,
|
|
|
outdelete,
|
|
|
movestates,
|
|
|
- woekflowhandle
|
|
|
+ // woekflowhandle
|
|
|
} from '@/model/tasksport/index'
|
|
|
import {
|
|
|
getwarehousingorder,
|
|
|
paymoney,
|
|
|
editwarehousingorder,
|
|
|
- getexenseinfo
|
|
|
+ getexenseinfo,
|
|
|
+ workflowhandle
|
|
|
} from '@/model/warehouse/index'
|
|
|
import {
|
|
|
downloadFile
|
|
@@ -326,6 +328,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
compId: localStorage.getItem('ws-pf_compId'),
|
|
|
historyList: [],
|
|
|
money:0,
|
|
|
+ multipleSelection1:{},
|
|
|
aduitshow:false,
|
|
|
costlist:[],
|
|
|
pickerBeginDateBefore: {
|
|
@@ -349,14 +352,35 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
fujian(row) {
|
|
|
this.id = row.id
|
|
|
this.accessoryTFs = true
|
|
|
- this.appendixIdss = row.addressUrl.split(',')
|
|
|
+ if(row.addressUrl.split(',')){
|
|
|
+ var arr=row.addressUrl.split(',')
|
|
|
+ this.dataList=[]
|
|
|
+ for(var i=0;i<arr.length;i++){
|
|
|
+ this.dataList.push({url:arr[i]})
|
|
|
+ }
|
|
|
+ this.appendixIdss=arr
|
|
|
+ this.paymentScreenshot=arr
|
|
|
+ }
|
|
|
+
|
|
|
console.log(this.appendixIdss)
|
|
|
},
|
|
|
+ handle(status){
|
|
|
+ this.searchType=status
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
selectinOutType(){
|
|
|
this.getList()
|
|
|
},
|
|
|
- handleSelectionChange(val) {
|
|
|
- this.multipleSelection=this.noRepeat(this.multipleSelection.concat(val))
|
|
|
+ handleSelectionChange(val,item) {
|
|
|
+ console.log(val,item)
|
|
|
+ for (let i = 0; i < val.length; i++) {
|
|
|
+ if(!item.payshow){
|
|
|
+ val[i].select=true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.multipleSelection1[item.id]=val
|
|
|
+ // this.multipleSelection=this.noRepeat(this.multipleSelection.concat(val))
|
|
|
+ // console.log(this.multipleSelection)
|
|
|
},
|
|
|
noRepeat(arr){
|
|
|
|
|
@@ -369,7 +393,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
row.weightedit=true
|
|
|
},
|
|
|
changeWeight(row){
|
|
|
- if(row.inWarehouseWeight<row.outWarehouseWOOeight){
|
|
|
+ if(row.inWarehouseWeight1<row.outWarehouseWeight){
|
|
|
this.$message({
|
|
|
message: '入库量不能小于出库量',
|
|
|
type: 'warning'
|
|
@@ -382,7 +406,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
type: 'warning',
|
|
|
})
|
|
|
.then(() => {
|
|
|
- editwarehousingorder({id:row.id,inWarehouseWeight:row.inWarehouseWeight}).toPromise()
|
|
|
+ editwarehousingorder({id:row.id,inWarehouseWeight:row.inWarehouseWeight1*1000}).toPromise()
|
|
|
.then((response) => {
|
|
|
// row.weightedit=false
|
|
|
this.getList()
|
|
@@ -390,21 +414,29 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
})
|
|
|
},
|
|
|
payout(item){
|
|
|
- console.log(item)
|
|
|
- if(this.multipleSelection.length>0){
|
|
|
- item.payshow=false
|
|
|
- for (let i = 0; i < this.multipleSelection.length; i++) {
|
|
|
- if(item.warehouseName==this.multipleSelection[i].warehouseName){
|
|
|
- this.multipleSelection[i].select=true
|
|
|
+ // console.log(item)
|
|
|
+ if(localStorage.getItem('ws-pf_roleName')=='销售内勤'||localStorage.getItem('ws-pf_roleName')=='采购内勤'){
|
|
|
+ if(this.multipleSelection1[item.id].length>0){
|
|
|
+ item.payshow=false
|
|
|
+ for (let i = 0; i < this.multipleSelection1[item.id].length; i++) {
|
|
|
+ if(item.warehouseName==this.multipleSelection1[item.id][i].warehouseName){
|
|
|
+ this.multipleSelection1[item.id][i].select=true
|
|
|
+ }
|
|
|
}
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: '至少选择一条待请款条目!',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
}
|
|
|
}else{
|
|
|
this.$message({
|
|
|
- message: '至少选择一条待请款条目',
|
|
|
- type: 'warning'
|
|
|
- });
|
|
|
+ message: '暂无此权限!',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
+
|
|
|
},
|
|
|
getNowTime() {
|
|
|
const start = new Date(new Date().getTime() - 3600 * 1000 * 24 )
|
|
@@ -420,9 +452,10 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
},
|
|
|
cancel(item){
|
|
|
item.payshow=true
|
|
|
- for (let i = 0; i < this.multipleSelection.length; i++) {
|
|
|
- if(item.warehouseName==this.multipleSelection[i].warehouseName){
|
|
|
- this.multipleSelection[i].select=false
|
|
|
+ console.log(this.multipleSelection1[item.id])
|
|
|
+ for (let i = 0; i < this.multipleSelection1[item.id].length; i++) {
|
|
|
+ if(item.warehouseName==this.multipleSelection1[item.id][i].warehouseName){
|
|
|
+ this.multipleSelection1[item.id][i].select=false
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -468,16 +501,14 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
handleRemove(file) {
|
|
|
// console.log(file)
|
|
|
for (let i = 0; i < this.paymentScreenshot.length; i++) {
|
|
|
- if(this.paymentScreenshot[i]==response.url){
|
|
|
+ if(this.paymentScreenshot[i]==file.url){
|
|
|
this.paymentScreenshot.splice(i, 1)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
},
|
|
|
submit(item){
|
|
|
- var arr1=this.multipleSelection.filter(function(items,index){
|
|
|
- return item.warehouseName==items.warehouseName
|
|
|
- })
|
|
|
+ var arr1=this.multipleSelection1[item.id]
|
|
|
for (let i = 0; i < arr1.length; i++) {
|
|
|
if(!arr1[i].requestFunds){
|
|
|
this.$message({
|
|
@@ -501,6 +532,11 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
+ // for (let i = 0; i < arr1.length; i++) {
|
|
|
+ // if(arr[i].inType=='收购入库'){
|
|
|
+ // arr[i].inWarehouseWeight=arr[i].inWarehouseWeight*1000
|
|
|
+ // }
|
|
|
+ // }
|
|
|
this.$confirm('确认提交请款信息', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
@@ -524,11 +560,11 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
return false
|
|
|
})
|
|
|
},
|
|
|
- paymentsubmit(){
|
|
|
+ paymentsubmit(item){
|
|
|
+ // console.log(item.id)
|
|
|
var that=this
|
|
|
- var arr2=this.multipleSelection.filter(function(items,index){
|
|
|
- return that.currectdata.warehouseName==items.warehouseName
|
|
|
- })
|
|
|
+ console.log(this.multipleSelection1,this.multipleSelection1[this.currectdata.id])
|
|
|
+ var arr2=this.multipleSelection1[this.currectdata.id]
|
|
|
if(this.paymentScreenshot.length==0){
|
|
|
this.$message({
|
|
|
message: '请上传付款截图',
|
|
@@ -536,11 +572,13 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
+ console.log(arr2)
|
|
|
for (let i = 0; i < arr2.length; i++) {
|
|
|
- arr2[i].addressUrl=arr2[i].addressUrl+this.paymentScreenshot.toString()
|
|
|
+ arr2[i].addressUrlArray=arr2[i].addressUrlArray.concat(this.paymentScreenshot)
|
|
|
+ arr2[i].addressUrl=arr2[i].addressUrlArray.toString()
|
|
|
|
|
|
}
|
|
|
- paymoney({flag:0,warehousingOrderList:arr2}).toPromise()
|
|
|
+ paymoney({flag:0,warehousingOrderList:arr2}).toPromise()
|
|
|
.then((response) => {
|
|
|
this.$message({
|
|
|
message: '付款成功',
|
|
@@ -548,7 +586,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
});
|
|
|
this.aduitshow=false
|
|
|
this.paymentScreenshot=[]
|
|
|
- this.$refs.upload.clearFiles()
|
|
|
+ this.$refs.uploadfiles.clearFiles()
|
|
|
this.getList()
|
|
|
}).catch(() => {
|
|
|
this.$message({
|
|
@@ -556,46 +594,45 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
type: 'warning'
|
|
|
});
|
|
|
})
|
|
|
-
|
|
|
},
|
|
|
payment(item){
|
|
|
- this.money=0
|
|
|
- var moneyarr=this.multipleSelection.filter(function(items,index){
|
|
|
- return item.warehouseName==items.warehouseName
|
|
|
- })
|
|
|
- console.log(moneyarr)
|
|
|
- for (let i = 0; i < this.multipleSelection.length; i++) {
|
|
|
- if(this.multipleSelection[i].warehouseName==item.warehouseName){
|
|
|
- this.money=Number(this.money)+Number(this.multipleSelection[i].requestFunds)
|
|
|
- if(this.multipleSelection[i].approveStatus!==null){
|
|
|
- this.$message({
|
|
|
- message: '请勾选一条待付款的条目',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- this.form.name=this.money
|
|
|
- this.currectdata=item
|
|
|
- if(moneyarr&&moneyarr.length>0){
|
|
|
- this.aduitshow=true
|
|
|
- }else{
|
|
|
- this.$message({
|
|
|
- message: '至少勾选一条待付款的条目',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ if(localStorage.getItem('ws-pf_roleName')=='出纳'){
|
|
|
+ this.money=0
|
|
|
+ var moneyarr=this.multipleSelection1[item.id]
|
|
|
+ console.log(moneyarr)
|
|
|
+ for (let i = 0; i < this.multipleSelection1[item.id].length; i++) {
|
|
|
+ if(this.multipleSelection1[item.id][i].warehouseName==item.warehouseName){
|
|
|
+ if(this.multipleSelection1[item.id][i].addressUrl){
|
|
|
+ this.multipleSelection1[item.id][i].addressUrlArray=this.multipleSelection1[item.id][i].addressUrl.split(',')
|
|
|
+ }
|
|
|
+ this.money=Number(this.money)+Number(this.multipleSelection1[item.id][i].requestFunds)
|
|
|
+ if(this.multipleSelection1[item.id][i].approveStatus!==null||this.multipleSelection1[item.id][i].requestFunds==0){
|
|
|
+ this.$message({
|
|
|
+ message: '请勾选一条待付款的条目',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.form.name=this.money
|
|
|
+ this.currectdata=item
|
|
|
+ if(moneyarr&&moneyarr.length>0){
|
|
|
+ this.aduitshow=true
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: '至少勾选一条待付款的条目',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
},
|
|
|
aduit(row){
|
|
|
- var arr2=this.multipleSelection.filter(function(items,index){
|
|
|
- return row.warehouseName==items.warehouseName
|
|
|
- })
|
|
|
+ var arr2=this.multipleSelection1[row.id]
|
|
|
// console.log(arr2)
|
|
|
if(arr2.length==0){
|
|
|
- if(localStorage.getItem('ws-pf_roleName')=='采购副总'){
|
|
|
+ if(localStorage.getItem('ws-pf_staffName')=='杜大光'){
|
|
|
this.$message({
|
|
|
message: '至少选择一条待决策人审核的条目',
|
|
|
type: 'eroor'
|
|
@@ -617,24 +654,35 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+ if(!arr2[i].taskId){
|
|
|
+ this.$message({
|
|
|
+ message: '至少选择一条待审核的条目',
|
|
|
+ type: 'eroor'
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
var arr3=this.filtertask(arr2)
|
|
|
this.$confirm('审核请款信息', {
|
|
|
confirmButtonText: '通过',
|
|
|
cancelButtonText: '驳回',
|
|
|
+ distinguishCancelAndClose:true,
|
|
|
type: 'warning',
|
|
|
})
|
|
|
.then(() => {
|
|
|
|
|
|
this.aduithandle(arr3,0,true)
|
|
|
- }).catch(() => {
|
|
|
+ }).catch((action) => {
|
|
|
+ console.log(action)
|
|
|
+ if(action=='cancel'){
|
|
|
this.aduithandle(arr3,0,false)
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
aduithandle(item,index,status){
|
|
|
if(index<item.length){
|
|
|
- woekflowhandle({
|
|
|
+ workflowhandle({
|
|
|
taskId: item[index].taskId,
|
|
|
approved:status,
|
|
|
auditMind: '34',
|
|
@@ -704,10 +752,14 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
var data=response.records[i].warehousingOrderList
|
|
|
for (let q = 0; q < data.length; q++) {
|
|
|
if(data[q].inType=='收购入库'){
|
|
|
- data[q].inWarehouseWeight=Number((data[q].inWarehouseWeight/1000).toFixed(3))
|
|
|
+ data[q].inWarehouseWeight1=Number((data[q].inWarehouseWeight/1000).toFixed(3))
|
|
|
+ data[q].surplusWeight=(data[q].inWarehouseWeight/1000)-data[q].outWarehouseWeight+data[q].profitAndLoss
|
|
|
+ }else{
|
|
|
+ data[q].inWarehouseWeight1=data[q].inWarehouseWeight.toFixed(3)
|
|
|
+ data[q].surplusWeight=data[q].inWarehouseWeight-data[q].outWarehouseWeight+data[q].profitAndLoss
|
|
|
}
|
|
|
+ console.log(response.records[i].warehouseType)
|
|
|
data[q].select=false
|
|
|
- data[q].surplusWeight=data[q].inWarehouseWeight-data[q].outWarehouseWeight+data[q].profitAndLoss
|
|
|
data[q].weightedit=false
|
|
|
data[q].warehouseType=response.records[i].warehouseType
|
|
|
}
|