gjy před 2 roky
rodič
revize
e0ffcd5e43

+ 6 - 0
src/api/V2/warehouse/index.js

@@ -159,3 +159,9 @@ export const API_EXPORT_ORDER ='/warehousingOrder/exportWarehousingOrder'
 export const API_GET_DRYLIST='/dryWarehouse/getInfo'
 // 计算折干后重量
 export const API_GET_DRYWEIGHT='/warehousingOrder/dryWeight'
+// 货权转出
+export const API_SET_ROLLOUT='/cargoTitleDetails/api/addInfo'
+// 修改货权赎回状态
+export const API_EDIT_ROLLOUT='/cargoTitleDetails/api/editStatus'
+// 待赎回
+export const API_REDEEMEDINFO='/contractManagementInfo/toBeRedeemedInfo'

+ 2 - 0
src/lang/zh.js

@@ -675,6 +675,8 @@ export default {
     purchasDetail: '采购详情',
     billDetail: '备件结算详情',
     warehousingOrder: '入库单',
+    awaitrAnsom:'入库单  /  待赎回',
+    gooddetail:'货权明细',
     storageCharge:'仓储费',
     earnestmoney:'保证金',
     oilcost:'油费',

+ 10 - 1
src/model/warehouse/index.js

@@ -77,7 +77,10 @@ import {
     API_SPONSOR_WITHDRAW,
     API_EXPORT_ORDER,
     API_GET_DRYLIST,
-    API_GET_DRYWEIGHT
+    API_GET_DRYWEIGHT,
+    API_SET_ROLLOUT,
+    API_EDIT_ROLLOUT,
+    API_REDEEMEDINFO
     // API_GET_EXPENSEINFO
 } from '@/api/V2/warehouse'
 // import { app } from 'electron'
@@ -238,3 +241,9 @@ export const exportOrder = appRx.post(API_EXPORT_ORDER)
 export const getdrylist = appRx.get(API_GET_DRYLIST, errorCatcher, errorHandle, filter)
 // 计算折干后重量
 export const getdryweight = appRx.post(API_GET_DRYWEIGHT, errorCatcher, errorHandle, filter)
+// 货权转出
+export const setrollout = appRx.post(API_SET_ROLLOUT, errorCatcher, errorHandle, filter)
+// 修改货权赎回状态
+export const editrollout = appRx.post(API_EDIT_ROLLOUT, errorCatcher, errorHandle, filter)
+// 待赎回
+export const getredeemedinfo = appRx.get(API_REDEEMEDINFO, errorCatcher, errorHandle, filter)

+ 31 - 0
src/views/warehousenew/component/router/index.js

@@ -508,6 +508,37 @@ const warehouseManagementRouter = {
       },
       hidden: true
     },
+    {
+      path: 'awaitRansom',
+      component: () =>
+        import(/* webpackChunkName: "applDetail" */ '@/views/warehousenew/awaitRansom'),
+      name: 'awaitRansom',
+      meta: {
+        title: 'awaitrAnsom',
+        shortcutEntrance: 'warehouseManagementList',
+        module: 'warehouseManagement.warehouse.warehouseInfo',
+        permissicon: [],
+        keepAlive: true,
+        _title:'待赎回'
+        // module: 'procurement.sparepart.applDetail'
+      },
+      hidden:true
+    },
+    {
+      path: 'gooddetail',
+      component: () =>
+        import(/* webpackChunkName: "applDetail" */ '@/views/warehousenew/gooddetail'),
+      name: 'gooddetail',
+      meta: {
+        title: 'gooddetail',
+        shortcutEntrance: 'warehouseManagementList',
+        module: 'warehouseManagement.warehouse.warehouseInfo',
+        permissicon: [],
+        keepAlive: true,
+        _title:'货权明细'
+        // module: 'procurement.sparepart.applDetail'
+      },
+    },
   ],
 };
 export default warehouseManagementRouter;

+ 267 - 3
src/views/warehousenew/warehousingOrder.vue

@@ -62,7 +62,10 @@
       <el-col style='text-align:right;' :span="12">
         <!-- <ws-button v-hasPermission="
             `warehouseManagement.warehousingOrder.yufu`" type="primary" @click="interestrate()" >{{interestratevalue.value}}利率</ws-button> -->
-            <ws-button  type="primary" @click="exportList()">导出</ws-button>
+        <ws-button  type="primary" @click="awatingransom()">待赎回</ws-button>
+        <ws-button  type="primary" @click="editRollout()">修改赎回状态</ws-button>
+        <ws-button  type="primary" @click="goodrollOut()">货权转出</ws-button>
+        <ws-button  type="primary" @click="exportList()">导出</ws-button>
         <ws-button v-hasPermission="
         `warehouseManagement.warehousingOrder.yufu`" type="primary" @click="fieldrations()">折干</ws-button>
         <ws-button v-hasPermission="
@@ -163,6 +166,11 @@
           </template>
         </el-table-column>
         <el-table-column prop="outWarehouseWeight" width="80" class="table_td" label="出库重量"></el-table-column>
+        <el-table-column prop="transferOutWeight" width="120" class="table_td" label="转出">
+          <template scope="scope">
+            <span :style="scope.row.transferOutWeight>0?'color:#5F7DE9;':''">{{ scope.row.transferOutWeight }} <span v-if="scope.row.redeemFlag">(赎)</span></span>
+          </template>
+        </el-table-column>
         <el-table-column prop="profitAndLoss" class="table_td" label="盈亏(吨)"></el-table-column>
         <el-table-column prop="surplusWeight" width="80" class="table_td" label="剩余重量"></el-table-column>
         <el-table-column prop="grainFund" width="80" class="table_td" label="粮款(元)"></el-table-column>
@@ -467,6 +475,57 @@
     <el-dialog width='30%' :visible.sync="remarkList" title="备注" top="20vh">
       <span>{{ remark }}</span>
     </el-dialog>
+    <el-dialog width='50%' :visible.sync="rolloutShow" title="货权转出" top="20vh">
+      <div class="form-inline">
+        <div>
+          选中{{ rolloutData.warehousingOrderList.length }}条:{{rolloutData.warehouseName}}&nbsp;转出&nbsp;{{ rolloutData.goodsName }}&nbsp;
+          {{ rolloutData.transferOutWeight }}吨&nbsp;应付{{rolloutData.amountIngPayable}}&nbsp; 已付{{rolloutData.amountEdPayable}}&nbsp; 
+          未付{{rolloutData.amountNotPayable}}&nbsp; 平均成本 {{ rolloutData.avgCost }}
+        </div>
+        <el-form :inline="true" label-width="120px" class="demo-form-inline">
+          <el-form-item label="售价(元/吨)">
+            <el-input v-model="rolloutData.salePrice" placeholder="输入货权转出售价"></el-input>
+          </el-form-item>
+          <el-form-item label="是否赎回">
+            <el-radio v-model="rolloutData.redeemFlag" label="1">暂定赎回</el-radio>
+            <el-radio v-model="rolloutData.redeemFlag" label="0">永不赎回</el-radio>
+          </el-form-item>
+        </el-form>
+        <el-form :inline="true" label-width="120px" class="demo-form-inline">
+          <el-form-item label="合同编号">
+            <el-select v-model="rolloutData.outContractNo" placeholder="选择合同编号">
+              <el-option v-for="item in contractNoList" :key="item.contractNo" :label="item.contractNo" :value="item.contractNo"></el-option>
+            </el-select>
+          </el-form-item>
+        </el-form>
+        <el-form :inline="true" label-width="120px" class="demo-form-inline">
+          <el-form-item label="是否赎回">
+            <el-radio v-model="rolloutData.systemIdentification" label="1">易粮易运用户</el-radio>
+            <el-radio v-model="rolloutData.systemIdentification" label="0">非易粮易运用户</el-radio>
+          </el-form-item>
+          <el-form-item label="售价(元/吨)">
+            <el-input v-model="rolloutData.receiveCompName" placeholder="输入货权接收公司全称"></el-input>
+          </el-form-item>
+        </el-form>
+        <el-form :inline="true" label-width="120px" v-for="(item,index) in rolloutData.cargoPositionDetailsList" class="demo-form-inline">
+          <el-form-item :label="'仓位-'+(index+1)">
+            <el-select @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 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>
+        <div>合计:吨</div>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="rolloutShow = false">取 消</el-button>
+          <el-button type="primary" @click="rolloutclick">确 定</el-button>
+        </span>
+      </div>
+    </el-dialog>
     <el-dialog width='50%' :visible.sync="interestrateshow" title="修改利率" top="20vh">
       <el-input placeholder="" v-model="interestratevalue.value"></el-input>
       <span slot="footer" class="dialog-footer">
@@ -554,7 +613,10 @@ import {
   getbyname,
   sponsorWithdraw,
   exportOrder,
-  getdryweight
+  getdryweight,
+  getbinnumber,
+  setrollout,
+  editrollout
 } from '@/model/warehouse/index'
 import {
   selectWarehouseSelf,
@@ -570,6 +632,9 @@ import {
   fmoney,
   EventBus
 } from 'base-core-lib'
+import {
+		xialaNo,
+	} from '@/model/tasksport/index'
 import { findLastIndexOfIterate } from 'xe-utils/methods'
 export default {
   name: 'viewSpareMoney',
@@ -599,7 +664,22 @@ export default {
       EndDate:'',
       rejectshow:false,
       options: [],
+      rolloutData:{
+        warehouseId:'',
+        warehouseName:'',
+        goodsName:'',
+        transferOutWeight:0,
+        amountEdPayable:0,
+        amountNotPayable:0,
+        amountIngPayable:0,
+        avgCost:0,
+        redeemFlag:'1',
+        systemIdentification:'1',
+        warehousingOrderList:[],
+        cargoPositionDetailsList:[{binNumber:'',positionId:'',weight:'',}]
+      },
       isShowPrintType: false,
+      rolloutShow:false,
       // warehouseAllXiaLa:[],
       textarea: '',
       weightGreater:'',
@@ -744,7 +824,9 @@ export default {
       titletype: '',
       remark: '',
       baseId:'',
-      auditMind:''
+      auditMind:'',
+      contractNoList:[],
+      binNumberList:[],
     }
   },
   // activated() {
@@ -768,6 +850,161 @@ export default {
     this.showType = this.isShow
   },
   methods: {
+    awatingransom(){
+      this.$router.push({path: 'awaitRansom'})
+    },
+    editRollout(){
+      
+      this.$confirm('确定以上货源不再赎回?', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          editrollout(this.rolloutData).toPromise()
+            .then((response) => {
+              this.$message.success('操作成功!')
+              // row.weightedit=false
+              this.getList()
+            }).catch((req)=>{
+              this.$message.error(req.message)
+            })
+        })
+    },
+    rolloutclick(){
+      this.$confirm('提交后不可修改,确定转出货权?', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          setrollout(this.rolloutData).toPromise()
+            .then((response) => {
+              this.rolloutShow=false
+              this.$message.success('提交成功!')
+              // row.weightedit=false
+              this.getList()
+            }).catch((req)=>{
+              this.$message.error(req.message)
+            })
+        })
+      
+    },
+    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
+        }
+      }
+    },
+    del(index){
+      if(this.rolloutData.warehousingOrderList.length>1){
+        this.rolloutData.warehousingOrderList.splice(index,1)
+      }else{
+        this.$message.error('至少保留一条仓位!')
+      }
+    },
+    add(){
+      this.rolloutData.warehousingOrderList.push({binNumber:'',positionId:'',weight:'',})
+    },
+    async goodrollOut(){
+      var concatarr=[]
+      var arr=[]
+      var arr3=[]
+      var arr4=[]
+      for (const key in this.multipleSelection1) {
+        concatarr = concatarr.concat(this.multipleSelection1[key])
+      }
+      if(concatarr.length==0){
+        this.$message.error('至少勾选一条!')
+        return 
+      }
+      for (const key in this.multipleSelection1) {
+        var array = this.multipleSelection1[key]
+        for (let i = 0; i < array.length; i++) {
+          if(array[i].amountEdPayable == 0 && !array[i].approveStatus||array[i].amountEdPayable == array[i].grainFund && !array[i].approveStatus){
+            arr.push(array[i])
+          }else{
+            this.$message.error('请选择已付全款或未请款的条目!')
+            return
+          }
+          if (arr3.length == 0) {
+            arr3.push(array[i])
+          } else {
+            var arr2 = arr3.filter((item) => { return item.warehouseName == array[i].warehouseName })
+            if (arr2.length == 0) {
+              arr3.push(array[i])
+            }
+          }
+          if (arr4.length == 0) {
+            arr4.push(array[i])
+          } else {
+            var arr5 = arr4.filter((item) => { return item.warehouseName == array[i].warehouseName })
+            if (arr5.length == 0) {
+              arr4.push(array[i])
+            }
+          }
+        }
+        
+      }
+      let map = new Map();
+      for (let item of arr) {
+        map.set(item.goodsName, item);
+      }
+
+      var data = [...map.values()];
+      if (data.length > 1) {
+        this.$message({
+          message: '所选条目货名不一致!',
+          type: 'warning'
+        });
+        return
+      }
+      if (arr3.length > 1) {
+        this.$message({
+          message: '所选条目库点不一致!',
+          type: 'warning'
+        });
+        return
+      }
+      if (arr4.length > 1) {
+        this.$message({
+          message: '所选条目合同编号不一致!',
+          type: 'warning'
+        });
+        return
+      }
+      var num=0
+      this.rolloutData.warehousingOrderList=arr
+      this.rolloutData.warehouseId=arr[0].baseId
+      this.rolloutData.warehouseName=arr[0].warehouseName
+      this.rolloutData.goodsName=arr[0].goodsName
+      this.rolloutData.transferOutWeight=0
+      this.rolloutData.amountEdPayable=0
+      this.rolloutData.amountNotPayable=0
+      this.rolloutData.amountIngPayable=0
+      for (let i = 0; i < arr.length; i++) {
+        this.rolloutData.transferOutWeight+=Number(arr[i].surplusWeight)
+        this.rolloutData.amountEdPayable+=Number(arr[i].amountEdPayable)
+        this.outamountNotPayable+=Number(arr[i].amountNotPayable)
+        this.rolloutData.amountIngPayable+=Number(arr[i].grainFund)
+        num+=(Number(arr[i].surplusWeight*arr[i].avgCost))
+      }
+      console.log(this.rolloutData)
+      this.rolloutData.transferOutWeight= this.rolloutData.transferOutWeight.toFixed(3)
+      this.rolloutData.avgCost=(num/this.rolloutData.transferOutWeight).toFixed(3)
+      this.rolloutData.amountEdPayable=this.rolloutData.amountEdPayable.toFixed(3)
+      this.rolloutData.amountNotPayable=this.rolloutData.amountNotPayable.toFixed(3)
+      this.rolloutData.amountIngPayable=this.rolloutData.amountIngPayable.toFixed(3)
+      this.contractNoList=await xialaNo({compId: localStorage.getItem('ws-pf_compId'),flag: 1}).toPromise()
+      var data=await getbinnumber({id: this.rolloutData.warehouseId,}).toPromise()
+      this.binNumberList = data.warehousePositionInfoList
+      // var that = this
+      // setTimeout(function(){
+        this.rolloutShow=true
+      // },1000)
+      
+    },
     exportList() {
           let date = new Date()
           var year = date.getFullYear();
@@ -2406,4 +2643,31 @@ export default {
       text-align: center;
      
     }
+    /deep/.form-inline .el-form.el-form--inline{
+      width:90%;
+      position:relative;
+    }
+    /deep/.form-inline .el-form.el-form--inline .el-form-item{
+      width:49%;
+      
+    }
+    /deep/.form-inline .el-form.el-form--inline .el-form-item .el-form-item__label{
+      width:30%;
+    }
+    /deep/.form-inline .el-form.el-form--inline .el-form-item .el-form-item__content{
+      width:70%;
+    }
+    .add,.del{
+      position:absolute;
+      top:50%;
+      transform:translateY(-50%);
+      right:-10px;
+    }
+    .del{
+      right:-40px;
+    }
+    // {
+    //   position:absolute;
+    //   top:50%;
+    // }
 </style>