|
@@ -34,6 +34,8 @@
|
|
|
</ws-button>
|
|
|
</el-col>
|
|
|
<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="
|
|
|
`warehouseManagement.warehousingOrder.yufu`" type="primary" @click="distribution()" >预付款分配</ws-button>
|
|
|
<ws-button v-hasPermission="
|
|
@@ -44,16 +46,14 @@
|
|
|
</el-button> -->
|
|
|
</el-col>
|
|
|
</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>{{item.issuingTime}}</div>
|
|
|
<div>{{item.warehouseName}}入库单<span v-if='item.warehouseType==2'>(临)</span></div>
|
|
|
<div>
|
|
|
<!-- <ws-button type="primary" @click="distribution(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 v-if='!item.payshow' type="primary" @click="cancel(item)" v-hasPermission="
|
|
|
`warehouseManagement.warehousingOrder.appl`
|
|
@@ -73,7 +73,7 @@
|
|
|
</ws-button>
|
|
|
</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
|
|
|
:selectable='selectInit'
|
|
|
type="selection"
|
|
@@ -266,7 +266,7 @@
|
|
|
<el-button type="primary" @click="distributionsubmit">提交</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
- <el-dialog
|
|
|
+ <el-dialog
|
|
|
title="保证金分配"
|
|
|
:visible.sync="marginshow"
|
|
|
width="50%"
|
|
@@ -318,6 +318,56 @@
|
|
|
<el-button type="primary" @click="marginsubmit">提交</el-button>
|
|
|
</span>
|
|
|
</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="140px">
|
|
|
+ <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-select @focus="warehousefocus" @change="warehousechange" v-model="fieldrationsList.beforeBinNo" filterable placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in options"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.binNumber"
|
|
|
+ :value="item.binNumber">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </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-item label="折干后仓位">
|
|
|
+ <el-select @focus="warehousefocus1" @change="warehousechange1" v-model="fieldrationsList.afterBinNo" filterable placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="item in options1"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.binNumber"
|
|
|
+ :value="item.binNumber">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </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
|
|
|
title="提示"
|
|
|
:visible.sync="dialogVisible"
|
|
@@ -381,7 +431,8 @@
|
|
|
editwarehousingorder,
|
|
|
getExpense,
|
|
|
workflowhandle,
|
|
|
- setExpense
|
|
|
+ getposition,
|
|
|
+ dryout
|
|
|
} from '@/model/warehouse/index'
|
|
|
import {getpayeeinfo,getbuypayeeinfo} from '@/model/profitable/index'
|
|
|
import {
|
|
@@ -418,6 +469,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
dialogApproveFormVisible: false,
|
|
|
dataList:[],
|
|
|
payeeinfo:{},
|
|
|
+ options:[],
|
|
|
// 船舶类型
|
|
|
monetaryKey: null,
|
|
|
form:{
|
|
@@ -431,7 +483,12 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
},
|
|
|
// 表格显示数据
|
|
|
tableDate: [],
|
|
|
-
|
|
|
+ fieldrationsList:{
|
|
|
+ beforeWeight:'',
|
|
|
+ beforeCost:'',
|
|
|
+ afterWeight:'',
|
|
|
+ afterCost:'',
|
|
|
+ },
|
|
|
// 是否显示
|
|
|
showType: true,
|
|
|
dialogVisible:false,
|
|
@@ -495,11 +552,13 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
searchKeyWord: '',
|
|
|
inOutType:'',
|
|
|
contractType: 2,
|
|
|
+ fieldrationsshow:false,
|
|
|
// 提交类型
|
|
|
submitType: true,
|
|
|
multipleSelection:[],
|
|
|
size: 10,
|
|
|
spanArr: [],
|
|
|
+ options1:[],
|
|
|
id:'',
|
|
|
customerInfo:{},
|
|
|
appendixIdss:[],
|
|
@@ -539,6 +598,36 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
this.showType = this.isShow
|
|
|
},
|
|
|
methods: {
|
|
|
+ warehousefocus(){
|
|
|
+ getposition({baseId:this.fieldrationsList.baseId,flag:1}).toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ // row.weightedit=false
|
|
|
+ this.options=response
|
|
|
+ })
|
|
|
+ },
|
|
|
+ warehousechange(e){
|
|
|
+ for (let i = 0; i < this.options.length; i++) {
|
|
|
+ if(this.options[i].binNumber==e){
|
|
|
+ this.fieldrationsList.beforePositionId=this.options[i].id
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ warehousefocus1(){
|
|
|
+ getposition({baseId:this.fieldrationsList.baseId}).toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ // row.weightedit=false
|
|
|
+ this.options1=response
|
|
|
+ })
|
|
|
+ },
|
|
|
+ warehousechange1(e){
|
|
|
+ for (let i = 0; i < this.options1.length; i++) {
|
|
|
+ if(this.options1[i].binNumber==e){
|
|
|
+ this.fieldrationsList.afterPositionId=this.options1[i].id
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
fujian(row) {
|
|
|
this.id = row.id
|
|
|
this.accessoryTFs = true
|
|
@@ -573,13 +662,34 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
selectinOutType(){
|
|
|
this.getList()
|
|
|
},
|
|
|
- handleSelectionChange(val,item) {
|
|
|
+ handleSelectionChange(val,item,index) {
|
|
|
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++) {
|
|
|
if(!item.payshow){
|
|
|
+ if(val[i].amountNotPayable<=0){
|
|
|
+ this.$message({
|
|
|
+ message: '请选择未付大于零的条目!',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ var that =this
|
|
|
+ setTimeout(()=>{
|
|
|
+ that.$refs[`multipleTable${index}`][0].toggleRowSelection(val[i],false);
|
|
|
+ },1000)
|
|
|
+ }else{
|
|
|
val[i].select=true
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ console.log(val)
|
|
|
this.multipleSelection1[item.id]=val
|
|
|
// this.multipleSelection=this.noRepeat(this.multipleSelection.concat(val))
|
|
|
// console.log(this.multipleSelection)
|
|
@@ -619,6 +729,32 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
console.log(item)
|
|
|
if(localStorage.getItem('ws-pf_roleName')=='销售内勤'||localStorage.getItem('ws-pf_roleName')=='采购内勤'){
|
|
|
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
|
|
|
for (let i = 0; i < this.multipleSelection1[item.id].length; i++) {
|
|
|
if(item.warehouseName==this.multipleSelection1[item.id][i].warehouseName){
|
|
@@ -706,6 +842,55 @@ 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('潮粮')==-1){
|
|
|
+ this.$message({
|
|
|
+ message: '只有潮粮可以折干!',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // _this.dialogTitle=arr1[i].contractNo
|
|
|
+ }
|
|
|
+ // this.currectdata=item
|
|
|
+ this.currectdata=arr1
|
|
|
+ this.fieldrationsList.id=this.currectdata[0].id
|
|
|
+ this.fieldrationsList.baseId=this.currectdata[0].baseId
|
|
|
+ this.fieldrationsList.beforeWeight=this.currectdata[0].surplusWeight
|
|
|
+ this.fieldrationsList.beforeCost=this.currectdata[0].avgCost
|
|
|
+ this.fieldrationsshow=true
|
|
|
+ },
|
|
|
distribution(){
|
|
|
let _this= this
|
|
|
console.log(this.multipleSelection1)
|
|
@@ -745,7 +930,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
- if(!arr1[i].contractNo){
|
|
|
+ if(arr1[i].inType!='采购入库'){
|
|
|
this.$message({
|
|
|
message: '请选择货源是采购合同的条目',
|
|
|
type: 'warning'
|
|
@@ -790,7 +975,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
},
|
|
|
cancel(item){
|
|
|
item.payshow=true
|
|
|
- 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
|
|
@@ -807,19 +992,7 @@ import { findLastIndexOfIterate } from 'xe-utils/methods'
|
|
|
},
|
|
|
selectInit(row,index){
|
|
|
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')=='杜大光'){
|
|
|
return true
|
|
@@ -936,6 +1109,80 @@ 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.beforeBinNo){
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ if(!this.fieldrationsList.afterBinNo){
|
|
|
+ this.$message({
|
|
|
+ message: '折干后仓位不能为空',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$confirm('确定提交折干?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ dryout(this.fieldrationsList).toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ this.$message({
|
|
|
+ message: '折干成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ this.form.distributionIng=''
|
|
|
+ this.fieldrationsshow=false
|
|
|
+ this.getList()
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ message: '折干失败',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ // this.$message({
|
|
|
+ // type: 'info',
|
|
|
+ // message: '已取消删除'
|
|
|
+ // });
|
|
|
+ });
|
|
|
+ },
|
|
|
marginsubmit(item){
|
|
|
var arr2=this.currectdata
|
|
|
if(this.form.distributionIng>this.form.distributionCan){
|
|
@@ -1363,6 +1610,9 @@ multiFilter(array, filters) {
|
|
|
this.form.distributionIng=''
|
|
|
this.marginshow = false
|
|
|
},
|
|
|
+ handleClose4() {
|
|
|
+ this.fieldrationsshow = false
|
|
|
+ },
|
|
|
handleSizeChange(val) {
|
|
|
console.log(`每页 ${val} 条`)
|
|
|
this.pageSize = val
|
|
@@ -1449,7 +1699,7 @@ multiFilter(array, filters) {
|
|
|
width: 92%;
|
|
|
}
|
|
|
.el-select {
|
|
|
- width: 30%;
|
|
|
+ width: 100%;
|
|
|
margin-right: 10px;
|
|
|
}
|
|
|
.col1 {
|