|
@@ -0,0 +1,465 @@
|
|
|
|
+// 还款
|
|
|
|
+<template>
|
|
|
|
+ <div>
|
|
|
|
+ <el-row>
|
|
|
|
+ <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="cancel"><img width="6" height="10"
|
|
|
|
+ style="vertical-align: bottom; margin-right: 3px" src="../../../public/img/lujing.png" alt="" />返回
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-date-picker
|
|
|
|
+ style="width:50% !important;"
|
|
|
|
+ v-model="value2"
|
|
|
|
+ type="daterange"
|
|
|
|
+ value-format='yyyy-MM-dd'
|
|
|
|
+ @change='datechange'
|
|
|
|
+ range-separator="至"
|
|
|
|
+ start-placeholder="开始日期"
|
|
|
|
+ end-placeholder="结束日期">
|
|
|
|
+ </el-date-picker>
|
|
|
|
+ <el-select v-model="borrowingCompany" placeholder="选择公司" class="typeselect" @change="getList"
|
|
|
|
+ :value="searchType">
|
|
|
|
+ <ws-option key="全部公司" label="全部公司" value="" style="color: #8890b1" />
|
|
|
|
+ <ws-option v-for="item in companyList1" :key="item.id" :label="item.compName" :value="item.compName"
|
|
|
|
+ style="color: #8890b1" />
|
|
|
|
+ </el-select>
|
|
|
|
+ <el-select v-model="borrowingWarehouse" placeholder="选择仓库" class="typeselect" @change="getList"
|
|
|
|
+ :value="searchType">
|
|
|
|
+ <ws-option key="全部仓库" label="全部仓库" value="" style="color: #8890b1" />
|
|
|
|
+ <ws-option v-for="item in warehouseList1" :key="item.id" :label="item.warehouseName" :value="item.warehouseName"
|
|
|
|
+ style="color: #8890b1" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12" class="bg-right">
|
|
|
|
+ <el-button class="bg-bottom" type="primary" size="small" @click="payment()">放粮</el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-table
|
|
|
|
+ class="wenzi"
|
|
|
|
+ :data="recordList"
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ height="780"
|
|
|
|
+ >
|
|
|
|
+ <el-table-column prop="borrowingCompany" label="公司名称">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="borrowingWarehouse" label="出库名称">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="repaymentEdAmount" label="放粮重量(吨)">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="repaymentIngAmount" label="放粮后在押(吨)">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="appendix" label="备注">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span @click="remarkLook(scope.row)" class="text_css">查看</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="operator" label="操作人">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="createDate" label="操作时间">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ <el-dialog width="40%" :visible.sync="paymentForm" :append-to-body="true" title="放粮" :before-close="paymentFormRemove">
|
|
|
|
+ <div class="tanchuang">
|
|
|
|
+ <ws-form>
|
|
|
|
+ <ws-info-table>
|
|
|
|
+ <ws-form-item label="借款公司" prop="money">
|
|
|
|
+ <el-select v-model="stillMoney.borrowingCompany" placeholder="选择借款公司" filterable clearable class="typeselect" @change="companyChange"
|
|
|
|
+ :value="searchType">
|
|
|
|
+ <ws-option v-for="item in companyList" :key="item.renownId" :label="item.renown" :value="item.renown"
|
|
|
|
+ style="color: #8890b1" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </ws-form-item>
|
|
|
|
+ <ws-form-item label="借款库点" prop="repaymentDate">
|
|
|
|
+ <el-select v-model="stillMoney.borrowingWarehouse" placeholder="选择借款仓库" class="typeselect" filterable clearable @change="warehouseChange"
|
|
|
|
+ :value="searchType">
|
|
|
|
+ <ws-option v-for="item in warehouseList" :key="item.id" :label="item.warehouseName" :value="item.warehouseName"
|
|
|
|
+ style="color: #8890b1" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </ws-form-item>
|
|
|
|
+ <ws-form-item label="货名" prop="repaymentDate">
|
|
|
|
+ <el-select v-model="stillMoney.goodsName" placeholder="选择货名" class="typeselect" filterable clearable @change="goodsChange"
|
|
|
|
+ :value="searchType">
|
|
|
|
+ <ws-option v-for="item in goodsList" :key="item.id" :label="item.goodsName" :value="item.goodsName"
|
|
|
|
+ style="color: #8890b1" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </ws-form-item>
|
|
|
|
+ <ws-form-item label="在押重量" prop="money">
|
|
|
|
+ <ws-input type="number" disabled v-model="stillMoney.amount" placeholder="自动获取,不可编辑"
|
|
|
|
+ maxlength="100" size="small" />
|
|
|
|
+ </ws-form-item>
|
|
|
|
+ <ws-form-item label="放粮重量" prop="money">
|
|
|
|
+ <ws-input type="number" v-model="stillMoney.repaymentEdAmount" placeholder="输入放粮重量"
|
|
|
|
+ maxlength="100" size="small" />
|
|
|
|
+ </ws-form-item>
|
|
|
|
+ <ws-form-item label="备注(选填)" prop="money">
|
|
|
|
+ </ws-form-item>
|
|
|
|
+ <div style="width:50%;margin:0 auto;">
|
|
|
|
+ <el-input
|
|
|
|
+ type="textarea"
|
|
|
|
+ :rows="2"
|
|
|
|
+ placeholder="输入备注信息"
|
|
|
|
+ v-model="stillMoney.remark">
|
|
|
|
+ </el-input>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ </ws-info-table>
|
|
|
|
+ <div style="text-align: center; margin-top: 20px">
|
|
|
|
+ <el-button @click="paymentFormRemove ">取消</el-button>
|
|
|
|
+ <el-button @click="paymentSubmit">提交</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </ws-form>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ <div class="pageNumber">
|
|
|
|
+ <!-- 页数 -->
|
|
|
|
+ <el-pagination
|
|
|
|
+ @size-change="handleSizeChange"
|
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
|
+ :current-page="currentPage"
|
|
|
|
+ :page-size="deptCircularPage.pageSize"
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
+ :total="deptBudgetTotal"
|
|
|
|
+ >
|
|
|
|
+ </el-pagination>
|
|
|
|
+ </div>
|
|
|
|
+ <WinseaContentModal v-model="accessoryTFs" title="备注"
|
|
|
|
+ @on-cancel="handleClose">
|
|
|
|
+ {{ appendixIdss }}
|
|
|
|
+ </WinseaContentModal>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+<script>
|
|
|
|
+ import {
|
|
|
|
+ getcompList,
|
|
|
|
+ } from '@/model/signIn/index'
|
|
|
|
+ import {
|
|
|
|
+ getRepaymentList,
|
|
|
|
+ repaymentSubmit,
|
|
|
|
+ getWarehouseReceiptLook,
|
|
|
|
+ getCompany,
|
|
|
|
+ getdetainedweight
|
|
|
|
+ } from '@/model/tradeServicesManagement/index'
|
|
|
|
+ import {
|
|
|
|
+ xiala
|
|
|
|
+ } from '@/model/warehouse/index'
|
|
|
|
+ import WsUpload from '@/components/WsUpload'
|
|
|
|
+ export default {
|
|
|
|
+ components: {
|
|
|
|
+ WsUpload,
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ recordList:[],
|
|
|
|
+ value2:'',
|
|
|
|
+ isShowadjustment:false,
|
|
|
|
+ pickerOptions:[],
|
|
|
|
+ borrowingWarehouse:'',
|
|
|
|
+ borrowingCompany:'',
|
|
|
|
+ paymentForm:false,
|
|
|
|
+ payments:{},
|
|
|
|
+ companyList:[],
|
|
|
|
+ imageUrl:"",
|
|
|
|
+ repayment:{
|
|
|
|
+ repaymentScreenshot:"",
|
|
|
|
+ repaymentEdAmount:0,
|
|
|
|
+ },
|
|
|
|
+ currentPage:1,
|
|
|
|
+ pageSize:10,
|
|
|
|
+ deptCircularPage:{},
|
|
|
|
+ stillMoney:{
|
|
|
|
+ repaymentDate:'',
|
|
|
|
+ goodsName:'',
|
|
|
|
+ borrowingCompany:'',
|
|
|
|
+ bankId:localStorage.getItem('ws-pf_compId'),
|
|
|
|
+ },
|
|
|
|
+ value2:[],
|
|
|
|
+ deptBudgetTotal:0,
|
|
|
|
+ compId:localStorage.getItem('ws-pf_compId'),
|
|
|
|
+ id:"",
|
|
|
|
+ contractNo:"",
|
|
|
|
+ accessoryTFs:false,
|
|
|
|
+ appendixIdss:"",
|
|
|
|
+ bankId:'',
|
|
|
|
+ warehouseList:[],
|
|
|
|
+ goodsList:[],
|
|
|
|
+ companyList1:[],
|
|
|
|
+ warehouseList1:[],
|
|
|
|
+ borrowingWarehouse:'',
|
|
|
|
+ repaymentIngAmount:0
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ activated() {
|
|
|
|
+ this.getNowTime()
|
|
|
|
+ this.getCompList()
|
|
|
|
+ this.getWarehouse()
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ datechange(){
|
|
|
|
+ this.currentPage = 1
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
+ getCompList(){
|
|
|
|
+ getcompList()
|
|
|
|
+ .toPromise()
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.companyList1 = res
|
|
|
|
+ })
|
|
|
|
+ .catch((err) => {})
|
|
|
|
+ },
|
|
|
|
+ getWarehouse() {
|
|
|
|
+ //获取仓库
|
|
|
|
+ xiala({
|
|
|
|
+ compId: this.compId,
|
|
|
|
+ warehouseType:1
|
|
|
|
+ }).toPromise()
|
|
|
|
+ .then(response => {
|
|
|
|
+ this.warehouseList1 = response
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ goodsChange(e){
|
|
|
|
+ console.log(e)
|
|
|
|
+ getdetainedweight({bankId:this.compId,compId:this.stillMoney.compId,warehouseId:this.stillMoney.warehouseId,goodsName:e,warehouseName:this.stillMoney.borrowingWarehouse}).toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ console.log(response)
|
|
|
|
+ this.$set(this.stillMoney,'goodsName',e)
|
|
|
|
+ this.$set(this.stillMoney,'amount',response)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ companyChange(e){
|
|
|
|
+ console.log(e)
|
|
|
|
+ for (let i = 0; i < this.companyList.length; i++) {
|
|
|
|
+ if(this.companyList[i].renown==this.stillMoney.borrowingCompany){
|
|
|
|
+ this.$set(this.stillMoney,'borrowingWarehouse','')
|
|
|
|
+ this.$set(this.stillMoney,'borrowingCompany',e)
|
|
|
|
+ this.stillMoney.compId = this.companyList[i].renownId
|
|
|
|
+ this.warehouseList = this.companyList[i].warehouseNameList
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ warehouseChange(e){
|
|
|
|
+ for (let i = 0; i < this.warehouseList.length; i++) {
|
|
|
|
+ if(this.warehouseList[i].warehouseName==this.stillMoney.borrowingWarehouse){
|
|
|
|
+ this.stillMoney.warehouseId = this.companyList[i].warehouseId
|
|
|
|
+ this.$set(this.stillMoney,'goodsName','')
|
|
|
|
+ this.goodsList = this.warehouseList[i].goodsNameList
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleClose(){
|
|
|
|
+ this.accessoryTFs = false
|
|
|
|
+ },
|
|
|
|
+ cancel() {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: 'warehouseReceiptRegulation'
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ getNowTime() {
|
|
|
|
+ var now = new Date();
|
|
|
|
+ var year = now.getFullYear(); //得到年份
|
|
|
|
+ var month = now.getMonth(); //得到月份
|
|
|
|
+ var date = now.getDate(); //得到日期
|
|
|
|
+ month = month + 1;
|
|
|
|
+ month = month.toString().padStart(2, "0");
|
|
|
|
+ date = date.toString().padStart(2, "0");
|
|
|
|
+ var defaultDate = `${year}-${month}-${date}`;
|
|
|
|
+ this.$set(this.stillMoney, "repaymentDate", defaultDate);
|
|
|
|
+ },
|
|
|
|
+ getList(){
|
|
|
|
+ var startDate=''
|
|
|
|
+ var endDate=''
|
|
|
|
+ if(this.value2){
|
|
|
|
+ startDate=this.value2[0]?this.value2[0]:''
|
|
|
|
+ endDate=this.value2[1]?this.value2[1]:''
|
|
|
|
+ }
|
|
|
|
+ getCompany({bankId:this.compId}).toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.companyList=response
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ getRepaymentList({interestFlag:2,
|
|
|
|
+ compId:this.repayment.compId,currentPage:this.currentPage,
|
|
|
|
+ pageSize:this.pageSize,
|
|
|
|
+ startDate:startDate,
|
|
|
|
+ endDate:endDate,
|
|
|
|
+ borrowingCompany:this.borrowingCompany,
|
|
|
|
+ borrowingWarehouse:this.borrowingWarehouse
|
|
|
|
+ }).toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.recordList = response.records
|
|
|
|
+ // this.stillMoney.amountToRepaid = this.repayment.amountToRepaid
|
|
|
|
+ this.deptCircularPage.currentPage = response.current
|
|
|
|
+ this.deptCircularPage.pageSize = response.size
|
|
|
|
+ this.deptBudgetTotal = response.total
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ //成功付款截图
|
|
|
|
+ handleAvatarSuccess(e){
|
|
|
|
+ this.$refs.upload.handleSaveBill()
|
|
|
|
+ .then(async response => {
|
|
|
|
+ this.stillMoney.repaymentScreenshot = response
|
|
|
|
+ })
|
|
|
|
+ .catch(res => {
|
|
|
|
+ EventBus.$emit('error', (JSON.parse(res) || {}).message)
|
|
|
|
+ this.$refs.upload.clearFiles()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ //付款提交
|
|
|
|
+ paymentSubmit(){
|
|
|
|
+ if(!this.stillMoney.repaymentEdAmount){
|
|
|
|
+ this.$message.error("请输入放粮重量!")
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(this.stillMoney.repaymentEdAmount <= 0 ){
|
|
|
|
+ this.$message.error("放粮重量输入错误!")
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.stillMoney.repaymentIngAmount = this.stillMoney.amount - this.stillMoney.repaymentEdAmount
|
|
|
|
+ if( this.stillMoney.repaymentEdAmount > this.stillMoney.repaymentIngAmount){
|
|
|
|
+ this.$message.error("放粮重量不可大于在押重量!")
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (
|
|
|
|
+ (String(this.stillMoney.repaymentEdAmount).indexOf('.') != -1 &&
|
|
|
|
+ String(this.stillMoney.repaymentEdAmount).length -
|
|
|
|
+ (String(this.stillMoney.repaymentEdAmount).indexOf('.') + 1) >
|
|
|
|
+ 2)
|
|
|
|
+ ) {
|
|
|
|
+ this.$message.error("放粮重量需保留两位小数,请重新输入!")
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ console.log("图片",this.stillMoney.repaymentScreenshot)
|
|
|
|
+ this.$confirm('付息信息提交后不可修改,确定提交?', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.stillMoney.operator = localStorage.getItem('ws-pf_staffName')
|
|
|
|
+ this.stillMoney.interestFlag = 2
|
|
|
|
+ repaymentSubmit(this.stillMoney).toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.$message.success("放粮成功!")
|
|
|
|
+ this.stillMoney = { repaymentDate:''}
|
|
|
|
+ this.stillMoney.repaymentScreenshot = ""
|
|
|
|
+ this.getNowTime()
|
|
|
|
+ this.paymentForm = false
|
|
|
|
+ this.getList()
|
|
|
|
+ })
|
|
|
|
+ }).catch(() =>{
|
|
|
|
+ return false
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ paymentFormRemove(){
|
|
|
|
+ this.paymentForm = false
|
|
|
|
+ this.stillMoney.repaymentScreenshot = ""
|
|
|
|
+ this.stillMoney.repaymentEdAmount = ""
|
|
|
|
+ this.stillMoney.repaymentDate = ""
|
|
|
|
+ },
|
|
|
|
+ //查看附件
|
|
|
|
+ remarkLook(row){
|
|
|
|
+ this.appendixIdss = row.remark
|
|
|
|
+ this.accessoryTFs = true
|
|
|
|
+ },
|
|
|
|
+ handleSizeChange(val) {
|
|
|
|
+ console.log(`每页 ${val} 条`)
|
|
|
|
+ this.pageSize = val
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
+ handleCurrentChange(val) {
|
|
|
|
+ this.currentPage = val
|
|
|
|
+ console.log(`当前页: ${val}`)
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
+ returnsales() {
|
|
|
|
+ this.$router.go(-1)
|
|
|
|
+ },
|
|
|
|
+ payment() {
|
|
|
|
+ console.log(this.stillMoney.repaymentScreenshot)
|
|
|
|
+ this.paymentForm = true
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+ .bg-left {
|
|
|
|
+ padding-left: 30px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .bg-right {
|
|
|
|
+ padding-right: 10px;
|
|
|
|
+ text-align: right;
|
|
|
|
+ }
|
|
|
|
+ .title {
|
|
|
|
+ position: relative;
|
|
|
|
+ }
|
|
|
|
+.bg-bottom {
|
|
|
|
+ margin: 15px 0px;
|
|
|
|
+ }
|
|
|
|
+ .title::before {
|
|
|
|
+ content: '';
|
|
|
|
+ display: inline-block;
|
|
|
|
+ width: 5px;
|
|
|
|
+ height: 30px;
|
|
|
|
+ background: #5473e8;
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: 0;
|
|
|
|
+ }
|
|
|
|
+ .tanchuang {
|
|
|
|
+ margin: 0 auto;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .tanchuang .ws-info-table {
|
|
|
|
+ display: initial;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .tanchuang .ws-info-table .el-form-item {
|
|
|
|
+ margin: 0 auto;
|
|
|
|
+ text-align: center;
|
|
|
|
+ }
|
|
|
|
+ .ws-info-table {
|
|
|
|
+ border: none;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .ws-info-table .el-form-item {
|
|
|
|
+ width: 50%;
|
|
|
|
+ border: none;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /deep/.ws-info-table .el-form-item .el-form-item__label {
|
|
|
|
+ width: 30%;
|
|
|
|
+ min-width: 125px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ background: #ffffff;
|
|
|
|
+ color: #8890b1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /deep/.ws-info-table .el-form-item .el-form-item__content {
|
|
|
|
+ border: none;
|
|
|
|
+ }
|
|
|
|
+ .span_css span{
|
|
|
|
+ margin-left: 20px;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ }
|
|
|
|
+ .pageNumber{
|
|
|
|
+ text-align: center;
|
|
|
|
+ }
|
|
|
|
+ .text_css {
|
|
|
|
+ color: #5878e8;
|
|
|
|
+ }
|
|
|
|
+ /deep/.el-table .cell{
|
|
|
|
+ text-align: center;
|
|
|
|
+ }
|
|
|
|
+ .upLoad{
|
|
|
|
+ width: 50%;
|
|
|
|
+ margin: 0 auto;
|
|
|
|
+ }
|
|
|
|
+</style>
|