|
@@ -37,13 +37,25 @@
|
|
<el-radio label="1" >是</el-radio>
|
|
<el-radio label="1" >是</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item v-if="form.redeemFlag==1" label="待赎回合同">
|
|
|
|
- <el-select filterable clearable v-model="form.redeemContractNo" placeholder="选择待赎回的合同">
|
|
|
|
- <el-option v-for="item in tableData" :key="item.id" :label="item.contractNo" :value="item.contractNo"></el-option>
|
|
|
|
|
|
+ </el-form>
|
|
|
|
+ <div v-if="form.redeemFlag==1">
|
|
|
|
+ <el-form :inline="true" v-for="(item,index) in form.redeemContractNoList" :key="'hetong'+index" class="demo-form-inline">
|
|
|
|
+ <el-form-item class="inline-big" :label="'待赎回合同-'+(index+1)" label-width="160px">
|
|
|
|
+ <el-select @change="( (val)=>{contractNochange1(val,index)} )" filterable clearable v-model="item.redeemContractNo" placeholder="选择待赎回的合同">
|
|
|
|
+ <el-option v-for="item1 in tableData" :key="item1.id" :label="item1.contractNo+(item1.expectedRedemption?'('+item1.expectedRedemption+'吨)':'')" :value="item1.contractNo"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
- </el-form-item>
|
|
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label-width="120px" label="转入重量">
|
|
|
|
+ <el-input @input="weightinput1($event,index)" v-model="item.transferOutWeight" placeholder="输入转入重量"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <img width="22" height="22" class="add" @click="addcontract" src="../../../public/img/add.png" alt="" />
|
|
|
|
+ <img width="22" height="22" class="del" @click="delcontract(index)" src="../../../public/img/del.png" alt="" />
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <el-form ref="form" :model="form" label-width="160px">
|
|
<el-form-item label="平均成本(元/吨)">
|
|
<el-form-item label="平均成本(元/吨)">
|
|
- <el-input v-model="form.avgCost" placeholder="输入平均成本"></el-input>
|
|
|
|
|
|
+ <el-input @input="avgcostinput" v-model="form.avgCost" placeholder="输入平均成本"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="应付粮款(元)">
|
|
<el-form-item label="应付粮款(元)">
|
|
<el-input @input="amountinginput" v-model="form.amountIngPayable" placeholder="输入粮款金额"></el-input>
|
|
<el-input @input="amountinginput" v-model="form.amountIngPayable" placeholder="输入粮款金额"></el-input>
|
|
@@ -61,13 +73,13 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<el-form :inline="true" v-for="(item,index) in form.cargoPositionDetailsList" :key="'cangwe'+index" class="demo-form-inline">
|
|
<el-form :inline="true" v-for="(item,index) in form.cargoPositionDetailsList" :key="'cangwe'+index" class="demo-form-inline">
|
|
- <el-form-item label-width="160px" :label="'仓位-'+(index+1)">
|
|
|
|
|
|
+ <el-form-item class="inline-big" label-width="160px" :label="'仓位-'+(index+1)">
|
|
<el-select @focus="binNumberfocus" clearable filterable @change="($event)=>binNumberchange($event,item,index)" v-model="item.binNumber" placeholder="选择仓位">
|
|
<el-select @focus="binNumberfocus" clearable filterable @change="($event)=>binNumberchange($event,item,index)" v-model="item.binNumber" placeholder="选择仓位">
|
|
<el-option v-for="item1 in binNumberList" :label="item1.binNumber" :value="item1.binNumber"></el-option>
|
|
<el-option v-for="item1 in binNumberList" :label="item1.binNumber" :value="item1.binNumber"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label-width="170px" label="入库重量(吨)">
|
|
|
|
- <el-input @input="weightinput" v-model="item.weight" placeholder="输入该仓位出库重量"></el-input>
|
|
|
|
|
|
+ <el-form-item label-width="120px" label="入库重量(吨)">
|
|
|
|
+ <el-input @input="weightinput" v-model="item.weight" placeholder="输入该仓位出库重量"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<img width="22" height="22" class="add" @click="add" src="../../../public/img/add.png" alt="" />
|
|
<img width="22" height="22" class="add" @click="add" src="../../../public/img/add.png" alt="" />
|
|
<img width="22" height="22" class="del" @click="del(index)" src="../../../public/img/del.png" alt="" />
|
|
<img width="22" height="22" class="del" @click="del(index)" src="../../../public/img/del.png" alt="" />
|
|
@@ -141,6 +153,7 @@ import {xialaNo} from '@/model/tasksport/index'
|
|
relationReceiveNo:'不关联',
|
|
relationReceiveNo:'不关联',
|
|
redeemFlag:'0',
|
|
redeemFlag:'0',
|
|
cargoPositionDetailsList:[{binNumber:'',positionId:'',weight:'',goodsweight:''}],
|
|
cargoPositionDetailsList:[{binNumber:'',positionId:'',weight:'',goodsweight:''}],
|
|
|
|
+ redeemContractNoList:[{redeemContractNo:'',transferOutWeight:'',weight:''}],
|
|
compId: localStorage.getItem('ws-pf_compId')
|
|
compId: localStorage.getItem('ws-pf_compId')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -149,6 +162,32 @@ import {xialaNo} from '@/model/tasksport/index'
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ avgcostinput(e){
|
|
|
|
+ if(this.form.relationReceiveNo!='不关联'){
|
|
|
|
+ this.form.amountIngPayable=(this.form.transferOutWeight1*e).toFixed(3)
|
|
|
|
+ this.form.amountNotPayable=(this.form.amountIngPayable-this.form.amountEdPayable).toFixed(3)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ weightinput1(e,index){
|
|
|
|
+ console.log(this.form.redeemContractNoList[index])
|
|
|
|
+ if(!this.form.redeemContractNoList[index].redeemContractNo){
|
|
|
|
+ this.$message.error('请选择待赎回合同后再输入转入重量!')
|
|
|
|
+ }
|
|
|
|
+ if(e>this.form.redeemContractNoList[index].weight){
|
|
|
|
+ this.$message.error('转入重量不能大于待赎回合同的重量!')
|
|
|
|
+ }
|
|
|
|
+ if(e<0){
|
|
|
|
+ this.$message.error('转入重量不能是负数!')
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ contractNochange1(e,index){
|
|
|
|
+ for (let i = 0; i < this.tableData.length; i++) {
|
|
|
|
+ if(this.tableData[i].contractNo==e){
|
|
|
|
+ this.form.redeemContractNoList[index].weight=this.tableData[i].expectedRedemption
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
onChange() {
|
|
onChange() {
|
|
this.$refs.upload
|
|
this.$refs.upload
|
|
.handleSaveBill()
|
|
.handleSaveBill()
|
|
@@ -162,14 +201,15 @@ import {xialaNo} from '@/model/tasksport/index'
|
|
},
|
|
},
|
|
amountinginput(e){
|
|
amountinginput(e){
|
|
if(this.form.amountEdPayable){
|
|
if(this.form.amountEdPayable){
|
|
- this.form.amountNotPayable=e-this.form.amountEdPayable
|
|
|
|
|
|
+ this.form.amountNotPayable=(e-this.form.amountEdPayable).toFixed(3)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
amountedinput(e){
|
|
amountedinput(e){
|
|
if(this.form.amountIngPayable){
|
|
if(this.form.amountIngPayable){
|
|
- this.form.amountNotPayable=this.form.amountIngPayable-e
|
|
|
|
|
|
+ this.form.amountNotPayable=(this.form.amountIngPayable-e).toFixed(3)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+
|
|
del(index){
|
|
del(index){
|
|
if(this.form.cargoPositionDetailsList.length>1){
|
|
if(this.form.cargoPositionDetailsList.length>1){
|
|
this.form.cargoPositionDetailsList.splice(index,1)
|
|
this.form.cargoPositionDetailsList.splice(index,1)
|
|
@@ -188,6 +228,17 @@ import {xialaNo} from '@/model/tasksport/index'
|
|
this.form.cargoPositionDetailsList.push({binNumber:'',positionId:'',weight:'',goodsweight:''})
|
|
this.form.cargoPositionDetailsList.push({binNumber:'',positionId:'',weight:'',goodsweight:''})
|
|
this.$forceUpdate()
|
|
this.$forceUpdate()
|
|
},
|
|
},
|
|
|
|
+ addcontract(){
|
|
|
|
+ this.form.redeemContractNoList.push({redeemContractNo:'',transferOutWeight:''})
|
|
|
|
+ this.$forceUpdate()
|
|
|
|
+ },
|
|
|
|
+ delcontract(index){
|
|
|
|
+ if(this.form.redeemContractNoList.length>1){
|
|
|
|
+ this.form.redeemContractNoList.splice(index,1)
|
|
|
|
+ }else{
|
|
|
|
+ this.$message.error('至少保留一条数据不可删除!')
|
|
|
|
+ }
|
|
|
|
+ },
|
|
onSubmit(){
|
|
onSubmit(){
|
|
if(!this.form.outContractNo){
|
|
if(!this.form.outContractNo){
|
|
this.$message.error('合同编号不能为空!')
|
|
this.$message.error('合同编号不能为空!')
|
|
@@ -197,9 +248,30 @@ import {xialaNo} from '@/model/tasksport/index'
|
|
this.$message.error('货名不能为空!')
|
|
this.$message.error('货名不能为空!')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(this.form.redeemFlag==1&&!this.form.redeemContractNo){
|
|
|
|
- this.$message.error('待赎回合同不能为空!')
|
|
|
|
|
|
+
|
|
|
|
+ if(this.form.relationReceiveNo!='不关联'){
|
|
|
|
+
|
|
|
|
+ var weight=0
|
|
|
|
+ var contarctNo=''
|
|
|
|
+ for (let i = 0; i < this.form.redeemContractNoList.length; i++) {
|
|
|
|
+ if(this.form.redeemFlag==1&&!this.form.redeemContractNoList[i].redeemContractNo){
|
|
|
|
+ this.$message.error('待赎回合同不能为空!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ var arr=this.form.redeemContractNoList.filter(item=>{return item.redeemContractNo==this.form.redeemContractNoList[i].redeemContractNo})
|
|
|
|
+ if(arr.length>1){
|
|
|
|
+ this.$message.error('待赎回合同重复!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ contarctNo+=this.form.redeemContractNoList[i].redeemContractNo+','
|
|
|
|
+ weight+=Number(this.form.redeemContractNoList[i].transferOutWeight)
|
|
|
|
+ }
|
|
|
|
+ this.form.redeemContractNo=contarctNo
|
|
|
|
+ // console.log(Number(weight),Number(this.form.transferOutWeight1))
|
|
|
|
+ if(Number(weight)!=Number(this.form.transferOutWeight1)){
|
|
|
|
+ this.$message.error('赎回重量与出库重量不相等!')
|
|
return
|
|
return
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if(!this.form.avgCost){
|
|
if(!this.form.avgCost){
|
|
this.$message.error('平均成本不能为空!')
|
|
this.$message.error('平均成本不能为空!')
|
|
@@ -292,6 +364,7 @@ import {xialaNo} from '@/model/tasksport/index'
|
|
if(this.form.warehouseName==this.warehouseList[i].warehouseName){
|
|
if(this.form.warehouseName==this.warehouseList[i].warehouseName){
|
|
this.form.baseId=this.warehouseList[i].id
|
|
this.form.baseId=this.warehouseList[i].id
|
|
this.binNumberList = this.warehouseList[i].positionInfos
|
|
this.binNumberList = this.warehouseList[i].positionInfos
|
|
|
|
+ this.form.cargoPositionDetailsList=[{binNumber:'',positionId:'',weight:'',goodsweight:''}]
|
|
this.$forceUpdate()
|
|
this.$forceUpdate()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -305,8 +378,16 @@ import {xialaNo} from '@/model/tasksport/index'
|
|
}
|
|
}
|
|
this.form.transferOutWeight=this.form.transferOutWeight.toFixed(3)
|
|
this.form.transferOutWeight=this.form.transferOutWeight.toFixed(3)
|
|
},
|
|
},
|
|
|
|
+
|
|
contractNochange(e){
|
|
contractNochange(e){
|
|
for (let i = 0; i < this.contractNoList.length; i++) {
|
|
for (let i = 0; i < this.contractNoList.length; i++) {
|
|
|
|
+ if(this.contractNoList[i].contractNo==e){
|
|
|
|
+ this.contractNoListGoodName=this.contractNoList[i].goodsName
|
|
|
|
+ this.$set(this.form,'contractSeller',this.contractNoList[i].seller)
|
|
|
|
+ this.$set(this.form,'goodsName',this.contractNoList[i].goodsName)
|
|
|
|
+ this.$set(this.form,'goodsNameKey',this.contractNoList[i].goodsNameKey)
|
|
|
|
+ this.$set(this.form,'avgCost',this.contractNoList[i].unitContractPrice)
|
|
|
|
+ }
|
|
if(this.contractNoList[i].contractNo==e&&this.form.relationReceiveNo=='不关联'){
|
|
if(this.contractNoList[i].contractNo==e&&this.form.relationReceiveNo=='不关联'){
|
|
this.$set(this.form,'customer',this.contractNoList[i].seller)
|
|
this.$set(this.form,'customer',this.contractNoList[i].seller)
|
|
for (let q = 0; q < this.customerList.length; q++) {
|
|
for (let q = 0; q < this.customerList.length; q++) {
|
|
@@ -318,17 +399,12 @@ import {xialaNo} from '@/model/tasksport/index'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}else if(this.contractNoList[i].contractNo==e&&this.form.relationReceiveNo!='不关联'){
|
|
}else if(this.contractNoList[i].contractNo==e&&this.form.relationReceiveNo!='不关联'){
|
|
|
|
+ console.log(this.form.goodsName,this.contractNoList[i].goodsName)
|
|
if(this.form.goodsName!=this.contractNoList[i].goodsName){
|
|
if(this.form.goodsName!=this.contractNoList[i].goodsName){
|
|
this.$message.error('采购合同货名与关联转出业务货名不一致!')
|
|
this.$message.error('采购合同货名与关联转出业务货名不一致!')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(this.contractNoList[i].contractNo==e){
|
|
|
|
- this.contractNoListGoodName=this.contractNoList[i].goodsName
|
|
|
|
- this.$set(this.form,'contractSeller',this.contractNoList[i].seller)
|
|
|
|
- this.$set(this.form,'goodsName',this.contractNoList[i].goodsName)
|
|
|
|
- this.$set(this.form,'goodsNameKey',this.contractNoList[i].goodsNameKey)
|
|
|
|
- this.$set(this.form,'avgCost',this.contractNoList[i].unitContractPrice)
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
},
|
|
},
|
|
receiveNochange(e){
|
|
receiveNochange(e){
|
|
@@ -518,6 +594,20 @@ import {xialaNo} from '@/model/tasksport/index'
|
|
margin:0;
|
|
margin:0;
|
|
width:48%;
|
|
width:48%;
|
|
}
|
|
}
|
|
|
|
+/deep/.el-form.el-form--inline .el-form-item{
|
|
|
|
+ margin:0;
|
|
|
|
+ width:31%;
|
|
|
|
+}
|
|
|
|
+/deep/.el-form.el-form--inline .el-form-item.inline-big{
|
|
|
|
+ width:62%;
|
|
|
|
+}
|
|
|
|
+/deep/.el-form.el-form--inline .el-form-item .el-form-item__content{
|
|
|
|
+ width:calc(100% - 120px);
|
|
|
|
+}
|
|
|
|
+/deep/.el-form.el-form--inline .el-form-item.inline-big .el-form-item__content{
|
|
|
|
+ width:calc(100% - 160px);
|
|
|
|
+}
|
|
|
|
+// inline-big
|
|
.add,.del{
|
|
.add,.del{
|
|
position:absolute;
|
|
position:absolute;
|
|
top:50%;
|
|
top:50%;
|