|
@@ -34,6 +34,8 @@
|
|
</ws-button>
|
|
</ws-button>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col style='text-align:right;' :span="12">
|
|
<el-col style='text-align:right;' :span="12">
|
|
|
|
+ <ws-button v-hasPermission="
|
|
|
|
+ `warehouseManagement.warehousingOrder.yufu`" type="primary" @click="fieldrations()" >折干</ws-button>
|
|
<ws-button v-hasPermission="
|
|
<ws-button v-hasPermission="
|
|
`warehouseManagement.warehousingOrder.yufu`" type="primary" @click="distribution()" >预付款分配</ws-button>
|
|
`warehouseManagement.warehousingOrder.yufu`" type="primary" @click="distribution()" >预付款分配</ws-button>
|
|
<ws-button v-hasPermission="
|
|
<ws-button v-hasPermission="
|
|
@@ -44,16 +46,14 @@
|
|
</el-button> -->
|
|
</el-button> -->
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
- <div v-for="item in gainList" style='margin:10px;border:1px solid #ccc;padding:10px;'>
|
|
|
|
|
|
+ <div v-for="(item,index) in gainList" style='margin:10px;border:1px solid #ccc;padding:10px;'>
|
|
<div style='width:100%;justify-content:space-between;align-items:center;margin-bottom:10px;' class="flex">
|
|
<div style='width:100%;justify-content:space-between;align-items:center;margin-bottom:10px;' class="flex">
|
|
<div>{{item.issuingTime}}</div>
|
|
<div>{{item.issuingTime}}</div>
|
|
<div>{{item.warehouseName}}入库单<span v-if='item.warehouseType==2'>(临)</span></div>
|
|
<div>{{item.warehouseName}}入库单<span v-if='item.warehouseType==2'>(临)</span></div>
|
|
<div>
|
|
<div>
|
|
<!-- <ws-button type="primary" @click="distribution(item)" >预付款分配</ws-button>
|
|
<!-- <ws-button type="primary" @click="distribution(item)" >预付款分配</ws-button>
|
|
<ws-button type="primary" @click="marginAllocation(item)">保证金分配</ws-button> -->
|
|
<ws-button type="primary" @click="marginAllocation(item)">保证金分配</ws-button> -->
|
|
- <ws-button v-if='item.payshow' type="primary" @click="payout(item)" v-hasPermission="
|
|
|
|
- `warehouseManagement.warehousingOrder.appl`
|
|
|
|
- ">请款
|
|
|
|
|
|
+ <ws-button v-if='item.payshow' type="primary" @click="payout(item)" v-hasPermission="`warehouseManagement.warehousingOrder.appl`">请款
|
|
</ws-button>
|
|
</ws-button>
|
|
<ws-button v-if='!item.payshow' type="primary" @click="cancel(item)" v-hasPermission="
|
|
<ws-button v-if='!item.payshow' type="primary" @click="cancel(item)" v-hasPermission="
|
|
`warehouseManagement.warehousingOrder.appl`
|
|
`warehouseManagement.warehousingOrder.appl`
|
|
@@ -73,7 +73,7 @@
|
|
</ws-button>
|
|
</ws-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <el-table class="wenzi" :data="item.warehousingOrderList" style="width: 100%" @selection-change="handleSelectionChange($event,item)" >
|
|
|
|
|
|
+ <el-table class="wenzi" :ref="'multipleTable'+index" :data="item.warehousingOrderList" style="width: 100%" @selection-change="handleSelectionChange($event,item,index)" >
|
|
<el-table-column
|
|
<el-table-column
|
|
:selectable='selectInit'
|
|
:selectable='selectInit'
|
|
type="selection"
|
|
type="selection"
|
|
@@ -266,7 +266,7 @@
|
|
<el-button type="primary" @click="distributionsubmit">提交</el-button>
|
|
<el-button type="primary" @click="distributionsubmit">提交</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
- <el-dialog
|
|
|
|
|
|
+ <el-dialog
|
|
title="保证金分配"
|
|
title="保证金分配"
|
|
:visible.sync="marginshow"
|
|
:visible.sync="marginshow"
|
|
width="50%"
|
|
width="50%"
|
|
@@ -318,6 +318,39 @@
|
|
<el-button type="primary" @click="marginsubmit">提交</el-button>
|
|
<el-button type="primary" @click="marginsubmit">提交</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="折干"
|
|
|
|
+ :visible.sync="fieldrationsshow"
|
|
|
|
+ width="50%"
|
|
|
|
+ :before-close="handleClose4">
|
|
|
|
+ <div>
|
|
|
|
+ <!--插槽会替换title显示的内容 -->
|
|
|
|
+ <div slot="title" class="header-title">
|
|
|
|
+ <span v-show="dialogTitle" class="title-name">{{ dialogTitle }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <el-form ref="form" :model="form" label-width="120px">
|
|
|
|
+ <el-form-item label="合同编号">
|
|
|
|
+ <el-input disabled v-model="form.accumulatedPrepayment"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="折干前重量(吨)">
|
|
|
|
+ <el-input v-model="fieldrationsList.beforeWeight"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="折干前成本(元/吨)">
|
|
|
|
+ <el-input disabled placeholder="自动计算,不可编辑" v-model="fieldrationsList.beforeCost"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="折干后重量(吨)">
|
|
|
|
+ <el-input @input="afterWeightchange" v-model="fieldrationsList.afterWeight"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="折干后成本(元/吨)">
|
|
|
|
+ <el-input disabled placeholder="自动计算,不可编辑" v-model="fieldrationsList.afterCost"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="handleClose4">取消</el-button>
|
|
|
|
+ <el-button type="primary" @click="fieldrationssubmit">提交</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ </el-dialog>
|
|
<!-- <el-dialog
|
|
<!-- <el-dialog
|
|
title="提示"
|
|
title="提示"
|
|
:visible.sync="dialogVisible"
|
|
:visible.sync="dialogVisible"
|
|
@@ -431,7 +464,12 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
},
|
|
},
|
|
// 表格显示数据
|
|
// 表格显示数据
|
|
tableDate: [],
|
|
tableDate: [],
|
|
-
|
|
|
|
|
|
+ fieldrationsList:{
|
|
|
|
+ beforeWeight:'',
|
|
|
|
+ beforeCost:'',
|
|
|
|
+ afterWeight:'',
|
|
|
|
+ afterCost:'',
|
|
|
|
+ },
|
|
// 是否显示
|
|
// 是否显示
|
|
showType: true,
|
|
showType: true,
|
|
dialogVisible:false,
|
|
dialogVisible:false,
|
|
@@ -495,6 +533,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
searchKeyWord: '',
|
|
searchKeyWord: '',
|
|
inOutType:'',
|
|
inOutType:'',
|
|
contractType: 2,
|
|
contractType: 2,
|
|
|
|
+ fieldrationsshow:false,
|
|
// 提交类型
|
|
// 提交类型
|
|
submitType: true,
|
|
submitType: true,
|
|
multipleSelection:[],
|
|
multipleSelection:[],
|
|
@@ -573,13 +612,35 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
selectinOutType(){
|
|
selectinOutType(){
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
- handleSelectionChange(val,item) {
|
|
|
|
|
|
+ handleSelectionChange(val,item,index) {
|
|
console.log(val,item)
|
|
console.log(val,item)
|
|
|
|
+ for(let i = 0;i < this.gainList.length; i++){
|
|
|
|
+ if(this.gainList[i].warehouseName==item.warehouseName){
|
|
|
|
+ for (let q = 0; q < this.gainList[i].warehousingOrderList.length; q++) {
|
|
|
|
+ if(!item.payshow){
|
|
|
|
+ this.gainList[i].warehousingOrderList[q].select=false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
for (let i = 0; i < val.length; i++) {
|
|
for (let i = 0; i < val.length; i++) {
|
|
if(!item.payshow){
|
|
if(!item.payshow){
|
|
|
|
+ if(val[i].amountNotPayable<=0){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '请选择未付大于零的条目!',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ });
|
|
|
|
+ var that =this
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ console.log(that.$refs[`multipleTable${index}`][0])
|
|
|
|
+ that.$refs[`multipleTable${index}`][0].toggleRowSelection(val[i],false);
|
|
|
|
+ },1000)
|
|
|
|
+ }else{
|
|
val[i].select=true
|
|
val[i].select=true
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ console.log(val)
|
|
this.multipleSelection1[item.id]=val
|
|
this.multipleSelection1[item.id]=val
|
|
// this.multipleSelection=this.noRepeat(this.multipleSelection.concat(val))
|
|
// this.multipleSelection=this.noRepeat(this.multipleSelection.concat(val))
|
|
// console.log(this.multipleSelection)
|
|
// console.log(this.multipleSelection)
|
|
@@ -619,6 +680,32 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
console.log(item)
|
|
console.log(item)
|
|
if(localStorage.getItem('ws-pf_roleName')=='销售内勤'||localStorage.getItem('ws-pf_roleName')=='采购内勤'){
|
|
if(localStorage.getItem('ws-pf_roleName')=='销售内勤'||localStorage.getItem('ws-pf_roleName')=='采购内勤'){
|
|
if(Object.keys(this.multipleSelection1).length!=0&&this.multipleSelection1[item.id].length>0){
|
|
if(Object.keys(this.multipleSelection1).length!=0&&this.multipleSelection1[item.id].length>0){
|
|
|
|
+ for (let i = 0; i < this.multipleSelection1[item.id].length; i++) {
|
|
|
|
+ if(item.warehouseName==this.multipleSelection1[item.id][i].warehouseName){
|
|
|
|
+
|
|
|
|
+ if(this.multipleSelection1[item.id][i].inType=='移库入库'||this.multipleSelection1[item.id][i].inType=='退库入库'){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '请选择收购入库或采购入库的条目!',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(this.multipleSelection1[item.id][i].amountNotPayable<=0){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '请选择未付大于零的条目!',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(this.multipleSelection1[item.id][i].amountNotPayable>0&&this.multipleSelection1[item.id][i].approveStatus){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '请选择未请款的条目!',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
item.payshow=false
|
|
item.payshow=false
|
|
for (let i = 0; i < this.multipleSelection1[item.id].length; i++) {
|
|
for (let i = 0; i < this.multipleSelection1[item.id].length; i++) {
|
|
if(item.warehouseName==this.multipleSelection1[item.id][i].warehouseName){
|
|
if(item.warehouseName==this.multipleSelection1[item.id][i].warehouseName){
|
|
@@ -706,6 +793,53 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
|
|
+ fieldrations(){
|
|
|
|
+ let _this= this
|
|
|
|
+ console.log(this.multipleSelection1)
|
|
|
|
+ var arr=[]
|
|
|
|
+ var currectData=[]
|
|
|
|
+ for (const key in this.multipleSelection1) {
|
|
|
|
+ var array=this.multipleSelection1[key]
|
|
|
|
+ for (let i = 0; i < array.length; i++) {
|
|
|
|
+ arr.push(array[i])
|
|
|
|
+ }
|
|
|
|
+ if(array.length>0){
|
|
|
|
+ currectData=array
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(arr.length>1){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '一次只可折干一条数据',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(currectData.length==0){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '请选择一条数据!',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // console.log(currectData)
|
|
|
|
+ var arr1=currectData
|
|
|
|
+ for (let i = 0; i < arr1.length; i++) {
|
|
|
|
+ if(arr1[i].goodsName.indexOf('潮粮')){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '只有潮粮可以折干!',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // _this.dialogTitle=arr1[i].contractNo
|
|
|
|
+ }
|
|
|
|
+ // this.currectdata=item
|
|
|
|
+ this.currectdata=arr1
|
|
|
|
+ this.fieldrationsList.beforeWeight=this.currectdata[0].surplusWeight
|
|
|
|
+ this.fieldrationsList.beforeCost=this.currectdata[0].avgCost
|
|
|
|
+ this.fieldrationsshow=true
|
|
|
|
+ },
|
|
distribution(){
|
|
distribution(){
|
|
let _this= this
|
|
let _this= this
|
|
console.log(this.multipleSelection1)
|
|
console.log(this.multipleSelection1)
|
|
@@ -745,7 +879,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
});
|
|
});
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(!arr1[i].contractNo){
|
|
|
|
|
|
+ if(arr1[i].inType!='采购入库'){
|
|
this.$message({
|
|
this.$message({
|
|
message: '请选择货源是采购合同的条目',
|
|
message: '请选择货源是采购合同的条目',
|
|
type: 'warning'
|
|
type: 'warning'
|
|
@@ -790,7 +924,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
},
|
|
},
|
|
cancel(item){
|
|
cancel(item){
|
|
item.payshow=true
|
|
item.payshow=true
|
|
- console.log(this.multipleSelection1[item.id])
|
|
|
|
|
|
+
|
|
for (let i = 0; i < this.multipleSelection1[item.id].length; i++) {
|
|
for (let i = 0; i < this.multipleSelection1[item.id].length; i++) {
|
|
if(item.warehouseName==this.multipleSelection1[item.id][i].warehouseName){
|
|
if(item.warehouseName==this.multipleSelection1[item.id][i].warehouseName){
|
|
this.multipleSelection1[item.id][i].select=false
|
|
this.multipleSelection1[item.id][i].select=false
|
|
@@ -807,19 +941,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
},
|
|
},
|
|
selectInit(row,index){
|
|
selectInit(row,index){
|
|
if(localStorage.getItem('ws-pf_roleName')=='销售内勤'||localStorage.getItem('ws-pf_roleName')=='采购内勤'){
|
|
if(localStorage.getItem('ws-pf_roleName')=='销售内勤'||localStorage.getItem('ws-pf_roleName')=='采购内勤'){
|
|
- if(row.inType=='移库入库'||row.inType=='退库入库'){
|
|
|
|
- return false
|
|
|
|
- }else{
|
|
|
|
- if(row.amountNotPayable>0){
|
|
|
|
- if(!row.approveStatus){
|
|
|
|
- return true
|
|
|
|
- }else{
|
|
|
|
- return false
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- return false
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ return true
|
|
|
|
|
|
}else if(localStorage.getItem('ws-pf_staffName')=='杜大光'){
|
|
}else if(localStorage.getItem('ws-pf_staffName')=='杜大光'){
|
|
return true
|
|
return true
|
|
@@ -936,6 +1058,66 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
});
|
|
});
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ afterWeightchange(e){
|
|
|
|
+ this.fieldrationsList.afterCost=(Number(this.fieldrationsList.beforeWeight)*Number(this.fieldrationsList.beforeCost))/Number(e)
|
|
|
|
+ },
|
|
|
|
+ fieldrationssubmit(){
|
|
|
|
+ var arr2=this.currectdata
|
|
|
|
+ if(!this.fieldrationsList.beforeWeight){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '折干前重量不能为空',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(this.fieldrationsList.beforeWeight<=0){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '折干前重量输入错误',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(!this.fieldrationsList.afterWeight){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '折干前重量不能为空',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(this.fieldrationsList.afterWeight<=0){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '折干后重量输入错误',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.$confirm('确定提交分配金额?', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ }).then(() => {
|
|
|
|
+ paymoney({flag:3,money:this.form.distributionIng,warehousingOrderList:arr2,contractId:this.form.contractId}).toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '分配成功',
|
|
|
|
+ type: 'success'
|
|
|
|
+ });
|
|
|
|
+ this.form.distributionIng=''
|
|
|
|
+ this.marginshow=false
|
|
|
|
+ this.getList()
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '分配失败',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ // this.$message({
|
|
|
|
+ // type: 'info',
|
|
|
|
+ // message: '已取消删除'
|
|
|
|
+ // });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
marginsubmit(item){
|
|
marginsubmit(item){
|
|
var arr2=this.currectdata
|
|
var arr2=this.currectdata
|
|
if(this.form.distributionIng>this.form.distributionCan){
|
|
if(this.form.distributionIng>this.form.distributionCan){
|
|
@@ -1363,6 +1545,9 @@ multiFilter(array, filters) {
|
|
this.form.distributionIng=''
|
|
this.form.distributionIng=''
|
|
this.marginshow = false
|
|
this.marginshow = false
|
|
},
|
|
},
|
|
|
|
+ handleClose4() {
|
|
|
|
+ this.fieldrationsshow = false
|
|
|
|
+ },
|
|
handleSizeChange(val) {
|
|
handleSizeChange(val) {
|
|
console.log(`每页 ${val} 条`)
|
|
console.log(`每页 ${val} 条`)
|
|
this.pageSize = val
|
|
this.pageSize = val
|