|
@@ -0,0 +1,457 @@
|
|
|
+//货权转入
|
|
|
+<template>
|
|
|
+ <div class="container">
|
|
|
+ <el-row class="row_top">
|
|
|
+ <el-col :span="12">
|
|
|
+ <h2 class="bg-left title">货权转入</h2>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" class="bg-right"><el-button class="bg-bottom" type="primary" size="small" @click="returnsales()"><img width="6" height="10"
|
|
|
+ style="vertion-align: bottom; margin-right: 3px" src="../../../public/img/lujing.png" alt="" />返回
|
|
|
+ </el-button></el-col>
|
|
|
+ </el-row>
|
|
|
+ <div class="center">
|
|
|
+ <el-form ref="form" :model="form" label-width="200px">
|
|
|
+ <el-form-item label="关联货权转出记录">
|
|
|
+ <el-select @change="receiveNochange" v-model="form.relationReceiveNo" placeholder="选择关联货权">
|
|
|
+ <el-option label="不关联" value="不关联"></el-option>
|
|
|
+ <el-option v-for="item in cusationinfo" :key="item.id" :label="item.relationReceiveNo+('('+item.transferOutWeight+'吨)')" :value="item.relationReceiveNo"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="合同编号">
|
|
|
+ <el-select @change="contractNochange" v-model="form.outContractNo" placeholder="请选择合同编号">
|
|
|
+ <el-option v-for="item in contractNoList" :key="item.id" :label="item.contractNo" :value="item.contractNo"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="客户">
|
|
|
+ <el-input disabled placeholder="自动获取,不可编辑" v-model="form.customer"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="货名">
|
|
|
+ <el-select @change="goosnamechange" v-model="form.goodsName" placeholder="选择货名">
|
|
|
+ <el-option v-for="item in goodnameList" :key="item.constKey" :label="item.constValue" :value="item.constValue"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="是否为货权赎回">
|
|
|
+ <el-radio-group v-model="form.redeemFlag">
|
|
|
+ <el-radio label="0" >否</el-radio>
|
|
|
+ <el-radio label="1" >是</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="form.redeemFlag==1" label="待赎回合同">
|
|
|
+ <el-select v-model="form.redeemContractNo" placeholder="选择待赎回的合同">
|
|
|
+ <el-option v-for="item in tableData" :key="item.id" :label="item.contractNo" :value="item.contractNo"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="平均成本(元/吨)">
|
|
|
+ <el-input v-model="form.avgCost" placeholder="输入平均成本"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="应付粮款(元)">
|
|
|
+ <el-input @input="amountinginput" v-model="form.amountIngPayable" placeholder="输入粮款金额"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="已付粮款(元)">
|
|
|
+ <el-input @input="amountedinput" v-model="form.amountEdPayable" placeholder="输入粮款金额"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="未付粮款(元)">
|
|
|
+ <el-input disabled v-model="form.amountNotPayable" placeholder="自动计算,不可编辑"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="库点">
|
|
|
+ <el-select @change="warehouseNamechange" v-model="form.warehouseName" placeholder="选择库点">
|
|
|
+ <el-option v-for="item in warehouseList" :key="item.id" :label="item.warehouseName" :value="item.warehouseName"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-form :inline="true" label-width="200px" v-for="(item,index) in form.cargoPositionDetailsList" :key="'cangwe'+index" class="demo-form-inline">
|
|
|
+ <el-form-item :label="'仓位-'+(index+1)">
|
|
|
+ <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-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="入库重量(吨)">
|
|
|
+ <el-input @input="weightinput" v-model="item.weight" placeholder="输入该仓位出库重量"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <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="" />
|
|
|
+ </el-form>
|
|
|
+ <el-form label-width="200px">
|
|
|
+ <el-form-item label="合计重量">
|
|
|
+ <el-input disabled v-model="form.transferOutWeight" placeholder="自动计算,不可编辑"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="onSubmit">提交</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+
|
|
|
+import {
|
|
|
+ getredeemedinfo,
|
|
|
+ getcusationinfo,
|
|
|
+ setrollin
|
|
|
+} from '@/model/warehouse/index'
|
|
|
+import {
|
|
|
+ packList,
|
|
|
+ } from '@/model/contarct/index'
|
|
|
+ import {
|
|
|
+ getwarehouse
|
|
|
+ } from '@/model/houseSelfCollect/index'
|
|
|
+import {xialaNo} from '@/model/tasksport/index'
|
|
|
+ export default {
|
|
|
+ components: {},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ cusationinfo:[],
|
|
|
+ tableData:[],
|
|
|
+ contractNoList:[],
|
|
|
+ goodnameList:[],
|
|
|
+ warehouseList:[],
|
|
|
+ binNumberList:[],
|
|
|
+ rollweight:0,
|
|
|
+ compId: localStorage.getItem('ws-pf_compId'),
|
|
|
+ form:{
|
|
|
+ relationReceiveNo:'不关联',
|
|
|
+ redeemFlag:'0',
|
|
|
+ cargoPositionDetailsList:[{binNumber:'',positionId:'',weight:'',goodsweight:''}],
|
|
|
+ compId: localStorage.getItem('ws-pf_compId')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ activated() {
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ amountinginput(e){
|
|
|
+ if(this.form.amountEdPayable){
|
|
|
+ this.form.amountNotPayable=e-this.form.amountEdPayable
|
|
|
+ }
|
|
|
+ },
|
|
|
+ amountedinput(e){
|
|
|
+ if(this.form.amountIngPayable){
|
|
|
+ this.form.amountNotPayable=this.form.amountIngPayable-e
|
|
|
+ }
|
|
|
+ },
|
|
|
+ del(index){
|
|
|
+ if(this.form.cargoPositionDetailsList.length>1){
|
|
|
+ this.form.cargoPositionDetailsList.splice(index,1)
|
|
|
+ }else{
|
|
|
+ this.$message.error('至少保留一条仓位!')
|
|
|
+ }
|
|
|
+ this.form.transferOutWeight=0
|
|
|
+ for (let i = 0; i < this.form.cargoPositionDetailsList.length; i++) {
|
|
|
+ if(this.form.cargoPositionDetailsList[i].weight){
|
|
|
+ this.form.transferOutWeight+=Number(this.form.cargoPositionDetailsList[i].weight)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.form.transferOutWeight=this.form.transferOutWeight.toFixed(3)
|
|
|
+ },
|
|
|
+ add(){
|
|
|
+ this.form.cargoPositionDetailsList.push({binNumber:'',positionId:'',weight:'',goodsweight:''})
|
|
|
+ this.$forceUpdate()
|
|
|
+ },
|
|
|
+ onSubmit(){
|
|
|
+ if(!this.form.outContractNo){
|
|
|
+ this.$message.error('合同编号不能为空!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.form.goodsName){
|
|
|
+ this.$message.error('货名不能为空!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(this.form.redeemFlag==1&&!this.form.redeemContractNo){
|
|
|
+ this.$message.error('待赎回合同不能为空!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.form.avgCost){
|
|
|
+ this.$message.error('平均成本不能为空!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.form.amountIngPayable&&this.form.amountIngPayable!=0){
|
|
|
+ this.$message.error('应付粮款不能为空!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.form.amountEdPayable&&this.form.amountEdPayable!=0){
|
|
|
+ this.$message.error('已付粮款不能为空!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.form.amountNotPayable&&this.form.amountNotPayable!=0){
|
|
|
+ this.$message.error('未付粮款不能为空!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.form.warehouseName){
|
|
|
+ this.$message.error('库点不能为空!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for (let i = 0; i < this.form.cargoPositionDetailsList.length; i++) {
|
|
|
+ if(!this.form.cargoPositionDetailsList[i].binNumber){
|
|
|
+ this.$message.error('仓位号不能为空!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.form.cargoPositionDetailsList[i].weight){
|
|
|
+ this.$message.error('入库重量不能为空!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(this.form.cargoPositionDetailsList[i].weight<0||
|
|
|
+ String(this.form.cargoPositionDetailsList[i].weight).indexOf(".") != -1 && String(this.form.cargoPositionDetailsList[i].weight).split('.')[1].length > 3){
|
|
|
+ this.$message.error('入库重量输入错误!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var binNumberdata=this.form.cargoPositionDetailsList.filter((item)=>{return item.binNumber==this.form.cargoPositionDetailsList[i].binNumber})
|
|
|
+ if(binNumberdata.length>1){
|
|
|
+ this.$message.error('仓位号不能重复!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.form.transferOutWeight!=this.form.transferOutWeight1&&this.form.relationReceiveNo!='不关联'){
|
|
|
+ this.$message.error('入库重量与出库重量不相等!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$confirm('确定提交货权转移信息?', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ setrollin(this.form).toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ this.$message.success('提交成功!')
|
|
|
+ this.$router.go(-1)
|
|
|
+ // row.weightedit=false
|
|
|
+ this.getList()
|
|
|
+ }).catch((req)=>{
|
|
|
+ this.$message.error(req.message)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ returnsales(){
|
|
|
+ this.$router.go(-1)
|
|
|
+ },
|
|
|
+ binNumberchange(e,item,index){
|
|
|
+ for (let i = 0; i < this.binNumberList.length; i++) {
|
|
|
+ if(this.binNumberList[i].binNumber==e){
|
|
|
+ item.positionId=this.binNumberList[i].id
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ binNumberfocus(){
|
|
|
+ if(!this.form.warehouseName){
|
|
|
+ this.$message.error('请选择库点!')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async warehouseNamechange(e){
|
|
|
+ for (let i = 0; i < this.warehouseList.length; i++) {
|
|
|
+ this.form.baseId=this.warehouseList[i].id
|
|
|
+ if(this.form.warehouseName==this.warehouseList[i].warehouseName){
|
|
|
+ console.log(this.warehouseList[i].positionInfos,111111)
|
|
|
+ this.binNumberList = this.warehouseList[i].positionInfos
|
|
|
+ this.$forceUpdate()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ weightinput(e){
|
|
|
+ this.form.transferOutWeight=0
|
|
|
+ for (let i = 0; i < this.form.cargoPositionDetailsList.length; i++) {
|
|
|
+ if(this.form.cargoPositionDetailsList[i].weight){
|
|
|
+ this.form.transferOutWeight+=Number(this.form.cargoPositionDetailsList[i].weight)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.form.transferOutWeight=this.form.transferOutWeight.toFixed(3)
|
|
|
+ },
|
|
|
+ contractNochange(e){
|
|
|
+ for (let i = 0; i < this.contractNoList.length; i++) {
|
|
|
+ if(this.contractNoList[i].contractNo==e&&this.form.relationReceiveNo=='不关联'){
|
|
|
+ this.$set(this.form,'customer',this.contractNoList[i].seller)
|
|
|
+ }
|
|
|
+ if(this.contractNoList[i].contractNo==e){
|
|
|
+ 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){
|
|
|
+ for (let i = 0; i < this.cusationinfo.length; i++) {
|
|
|
+ if(this.cusationinfo[i].relationReceiveNo==e){
|
|
|
+ this.$set(this.form,'customer',this.cusationinfo[i].customer)
|
|
|
+ this.$set(this.form,'transferOutWeight1',this.cusationinfo[i].transferOutWeight)
|
|
|
+ this.$set(this.form,'amountIngPayable',this.cusationinfo[i].amountIngPayable)
|
|
|
+ this.$set(this.form,'amountEdPayable',this.cusationinfo[i].amountEdPayable)
|
|
|
+ this.$set(this.form,'amountNotPayable',this.cusationinfo[i].amountNotPayable)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ goosnamechange(e){
|
|
|
+ for (var i = 0; i < this.goodnameList.length; i++) {
|
|
|
+ if (this.goodnameList[i].constValue == e) {
|
|
|
+ this.form.goodsNameKey = this.goodnameList[i].constKey
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async getList() {
|
|
|
+ var response=await getcusationinfo({
|
|
|
+ searchType:1,
|
|
|
+ currentPage: 1,
|
|
|
+ pageSize:9999,
|
|
|
+ compId:localStorage.getItem('ws-pf_compId'),
|
|
|
+ })
|
|
|
+ .toPromise()
|
|
|
+ this.cusationinfo=response.records
|
|
|
+ this.contractNoList=await xialaNo({compId: localStorage.getItem('ws-pf_compId'),flag: 0}).toPromise()
|
|
|
+ this.warehouseList=await getwarehouse({compId: this.compId}).toPromise()
|
|
|
+ // 货名
|
|
|
+ this.goodnameList =await packList({
|
|
|
+ constId: 'CON2',
|
|
|
+ })
|
|
|
+ .toPromise()
|
|
|
+ var response1=await getredeemedinfo({
|
|
|
+ dropFlag:1,
|
|
|
+ pageSize:9999 ,
|
|
|
+ currentPage: 1,
|
|
|
+ compId:localStorage.getItem('ws-pf_compId'),
|
|
|
+ })
|
|
|
+ .toPromise()
|
|
|
+ this.tableData = response1.records
|
|
|
+ this.deptBudgetTotal = response.total
|
|
|
+ },
|
|
|
+ },
|
|
|
+ }
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+ table,
|
|
|
+ table tr th,
|
|
|
+ table tr td {
|
|
|
+ border: 2px solid #333333;
|
|
|
+ padding: 5px 0;
|
|
|
+ height: 55px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .content {
|
|
|
+ width: 1000px;
|
|
|
+ padding: 70px 20px 20px 20px;
|
|
|
+ font-size: 22px;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ table {
|
|
|
+ width: 100%;
|
|
|
+ text-align: center;
|
|
|
+ border-collapse: collapse;
|
|
|
+ border: 3px solid #333333;
|
|
|
+ }
|
|
|
+
|
|
|
+ .col-bgc {
|
|
|
+ background: #f6f7fb;
|
|
|
+ }
|
|
|
+
|
|
|
+ .container {
|
|
|
+ background: #E8ECF6;
|
|
|
+ }
|
|
|
+
|
|
|
+ .center {
|
|
|
+ margin: 0 auto;
|
|
|
+ background: #ffffff;
|
|
|
+ height: calc(100vh - 13vh);
|
|
|
+ border-radius: 4px;
|
|
|
+ padding: 20px 0;
|
|
|
+
|
|
|
+ /deep/.el-table td,
|
|
|
+ /deep/.el-table th {
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .row_top {
|
|
|
+ background: #F6F7FC;
|
|
|
+ border-radius: 4px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+
|
|
|
+ .bg-left {
|
|
|
+ padding-left: 30px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .bg-right {
|
|
|
+ padding-right: 10px;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+
|
|
|
+ .title {
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+
|
|
|
+ .title::before {
|
|
|
+ content: '';
|
|
|
+ display: inline-block;
|
|
|
+ width: 5px;
|
|
|
+ height: 30px;
|
|
|
+ background: #5473e8;
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .datascreen {
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .data_css {
|
|
|
+ width: 40%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .input_css {
|
|
|
+ width: 50%;
|
|
|
+ margin: 0 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .find {
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .fromdata {
|
|
|
+ margin: 20px 0;
|
|
|
+ overflow-y: scroll;
|
|
|
+ height: 546px;
|
|
|
+ }
|
|
|
+ .top_info{
|
|
|
+ margin: 10px 0 0 10px;
|
|
|
+ min-width: 712px;
|
|
|
+ .info_css{
|
|
|
+ margin-right: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .bg-right{
|
|
|
+ padding-top:15px;
|
|
|
+ }
|
|
|
+ .el-icon-connection{
|
|
|
+ color:#409eff;
|
|
|
+ }
|
|
|
+ .flex{
|
|
|
+ display:flex;justify-content: space-between;
|
|
|
+ }
|
|
|
+ .el-form{
|
|
|
+ width:50%;
|
|
|
+ margin:0 auto;
|
|
|
+ position:relative;
|
|
|
+ }
|
|
|
+ /deep/.el-form .el-select{
|
|
|
+ width:100%;
|
|
|
+ }
|
|
|
+ /deep/.el-form.el-form--inline{
|
|
|
+ margin-bottom:18px;
|
|
|
+ }
|
|
|
+ /deep/.el-form.el-form--inline .el-form-item{
|
|
|
+ margin:0;
|
|
|
+}
|
|
|
+.add,.del{
|
|
|
+ position:absolute;
|
|
|
+ top:50%;
|
|
|
+ transform:translateY(-50%);
|
|
|
+ right:25px;
|
|
|
+ }
|
|
|
+ .del{
|
|
|
+ right:-2px;
|
|
|
+ }
|
|
|
+</style>
|