|
@@ -0,0 +1,431 @@
|
|
|
|
+//保证金
|
|
|
|
+<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-row style='margin-bottom:10px;'>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-select v-model="contractNo" filterable clearable placeholder="选择合同" @change="selectcontractNo" >
|
|
|
|
+ <el-option key="0" label="全部合同" value=""
|
|
|
|
+ style="color: #8890b1" />
|
|
|
|
+ <el-option v-for="item in contractNoList" :key="item.contractNo" :label="item.contractNo" :value="item.contractNo"
|
|
|
|
+ style="color: #8890b1" />
|
|
|
|
+ </el-select>
|
|
|
|
+ <el-select v-model="contractType" filterable clearable placeholder="选择类型" @change="selecttype" :value="searchType">
|
|
|
|
+ <el-option key="type0" label="全部类型" value=""
|
|
|
|
+ style="color: #8890b1" />
|
|
|
|
+ <el-option key="1" label="采购合同" value="1"
|
|
|
|
+ style="color: #8890b1" />
|
|
|
|
+ <el-option key="2" label="销售合同" value="2"
|
|
|
|
+ style="color: #8890b1" />
|
|
|
|
+ <el-option key="3" label="收购合同" value="3"
|
|
|
|
+ style="color: #8890b1" />
|
|
|
|
+ <el-option key="4" label="代收合同" value="4"
|
|
|
|
+ style="color: #8890b1" />
|
|
|
|
+ <el-option key="5" label="代储合同" value="5"
|
|
|
|
+ style="color: #8890b1" />
|
|
|
|
+ </el-select>
|
|
|
|
+ <el-input v-model="searchKeyWord" placeholder="可按照客户名称进行查找" clearable maxlength="100" type="input"
|
|
|
|
+ class="findValue" @keyup.enter.native="find()"></el-input>
|
|
|
|
+ <ws-button class="find" type="primary" @click="find()"><img width="16" height="16" style="
|
|
|
|
+ vertical-align: text-top;
|
|
|
|
+ position: relative;
|
|
|
|
+ top: 0px;
|
|
|
|
+ left: -8px;
|
|
|
|
+ " src="../../../public/img/sousuo.png" alt="" /></ws-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row style="margin-bottom: 10px">
|
|
|
|
+ <el-col :span="18">
|
|
|
|
+ <el-button style="margin-left: 10px" @click="typeChange('')" :type="searchType == '' ? 'primary' : ''">全部
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button @click="typeChange(1)" :type="searchType == 1 ? 'primary' : ''">收入</el-button>
|
|
|
|
+ <el-button @click="typeChange(2)" :type="searchType == 2 ? 'primary' : ''">支出</el-button>
|
|
|
|
+ <span>合计:{{money}}</span>
|
|
|
|
+ <el-button v-if="currectcontract.contractType==2" @click="payliangkuan()" type='primary'>抵粮款</el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col style="text-align: right" :span="6">
|
|
|
|
+
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <div class="fromdata">
|
|
|
|
+ <el-table :data="tableData" stripe style="width: 100%">
|
|
|
|
+ <el-table-column type="index" label="序号">
|
|
|
|
+ <template scope="scope">
|
|
|
|
+ <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
|
|
|
|
+ <span v-else>{{ scope.$index + 1 }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="contractNo" label="合同编号"></el-table-column>
|
|
|
|
+ <el-table-column prop="contractType" label="合同类型">
|
|
|
|
+ <template scope="scope">
|
|
|
|
+ <span v-if="scope.row.contractType==1">采购</span>
|
|
|
|
+ <span v-if="scope.row.contractType==2">销售</span>
|
|
|
|
+ <span v-if="scope.row.contractType==3">收购</span>
|
|
|
|
+ <span v-if="scope.row.contractType==4">代收</span>
|
|
|
|
+ <span v-if="scope.row.contractType==5">代储</span>
|
|
|
|
+
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="customer" label="客户"></el-table-column>
|
|
|
|
+ <el-table-column prop="money" label="收支类型">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span v-if="scope.row.expensesType == 1">收入</span>
|
|
|
|
+ <span v-if="scope.row.expensesType == 2">支出</span>
|
|
|
|
+ <span v-if="scope.row.epenseName=='保证金抵粮款'">(抵)</span>
|
|
|
|
+ <span v-if="scope.row.epenseName=='保证金分配'">(分)</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="amountMoney" label="金额(元)"></el-table-column>
|
|
|
|
+ <el-table-column prop="agent" label="经办人"></el-table-column>
|
|
|
|
+ <el-table-column prop="createDate" label="收支时间"></el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </div>
|
|
|
|
+ <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
|
|
|
|
+ style="text-align:center" :page-size="deptCircularPage.pageSize"
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
|
|
|
|
+ </el-pagination>
|
|
|
|
+ </div>
|
|
|
|
+ <el-dialog width='50%' :visible.sync="interestrateshow" title="保证金抵粮款" top="20vh">
|
|
|
|
+ <el-form ref="form" :model="form" label-width="80px">
|
|
|
|
+ <el-form-item label="合同编号">
|
|
|
|
+ <el-input disabled v-model="form.contractNo"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="可用金额(元)">
|
|
|
|
+ <el-input disabled v-model="form.money"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="抵粮款金额(元)">
|
|
|
|
+ <el-input placeholder="输入抵粮款金额" v-model="form.amountMoney"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button type="primary" @click="interestrateshow=false">取消</el-button>
|
|
|
|
+ <el-button type="primary" @click="submit">确定</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+<script>
|
|
|
|
+ import {
|
|
|
|
+ getboodinfo,
|
|
|
|
+ getwarehouse,
|
|
|
|
+ getcontractno,setfoodallowance
|
|
|
|
+ } from '@/model/profitable/index'
|
|
|
|
+ import {
|
|
|
|
+ getenabledinfo,
|
|
|
|
+ setenabledinfo
|
|
|
|
+} from '@/model/warehouse/index'
|
|
|
|
+
|
|
|
|
+ export default {
|
|
|
|
+ components: {},
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ value: "",
|
|
|
|
+ tableData: [],
|
|
|
|
+ deptBudgetTotal: 0,
|
|
|
|
+ currentPage: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ money:0,
|
|
|
|
+ form:{},
|
|
|
|
+ deptCircularPage: {},
|
|
|
|
+ taskTypeList:[],
|
|
|
|
+ warehouse:[],
|
|
|
|
+ interestrateshow:false,
|
|
|
|
+ searchType:"",
|
|
|
|
+ contractType:'',
|
|
|
|
+ searchKeyWord:"",
|
|
|
|
+ startDate:"",
|
|
|
|
+ endDate:"",
|
|
|
|
+ outtotal:0,
|
|
|
|
+ intotal:0,
|
|
|
|
+ foodExpenditure:0,
|
|
|
|
+ grainIncome:0,
|
|
|
|
+ expenseIncome:0,
|
|
|
|
+ expensesPay:0,
|
|
|
|
+ contractNo:'',
|
|
|
|
+ currentProfit:0,
|
|
|
|
+ warehouseName:'全部仓库',
|
|
|
|
+ allotmentofMoney:{},
|
|
|
|
+ contractNoList:[],
|
|
|
|
+ currectcontract:{}
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ activated() {
|
|
|
|
+ getcontractno({
|
|
|
|
+ // agreementType: '',
|
|
|
|
+ // goodsType: 1
|
|
|
|
+ })
|
|
|
|
+ .toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.contractNoList = response
|
|
|
|
+ })
|
|
|
|
+ getboodinfo({
|
|
|
|
+ // warehouseType: 1,
|
|
|
|
+ compId: localStorage.getItem('ws-pf_compId'),
|
|
|
|
+ searchKeyWord:'',
|
|
|
|
+ currentPage: 1,
|
|
|
|
+ contractNo:'',
|
|
|
|
+ pageSize:10000 ,
|
|
|
|
+ contractType:'',
|
|
|
|
+ searchType:''
|
|
|
|
+ })
|
|
|
|
+ .toPromise()
|
|
|
|
+ .then(response => {
|
|
|
|
+ if(response.records.length>0){
|
|
|
|
+ var shouru=0
|
|
|
|
+ var zhichu=0
|
|
|
|
+ for (let i = 0; i < response.records.length; i++) {
|
|
|
|
+ if(response.records[i].expensesType==1){
|
|
|
|
+ shouru+=response.records[i].amountMoney
|
|
|
|
+ }
|
|
|
|
+ if(response.records[i].expensesType==2){
|
|
|
|
+ zhichu+=response.records[i].amountMoney
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ this.money=shouru-zhichu
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ // this.getPassYearFormatDate()
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ payliangkuan(){
|
|
|
|
+ if(this.money<0){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '保证金余额不足!',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.form.contractNo=this.contractNo
|
|
|
|
+ this.form.money=this.money
|
|
|
|
+ this.interestrateshow=true
|
|
|
|
+ },
|
|
|
|
+ typeChange(num){
|
|
|
|
+ this.searchType = num
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
+ returnsales(){
|
|
|
|
+ this.$router.go(-1)
|
|
|
|
+ },
|
|
|
|
+ submit(){
|
|
|
|
+ if(!this.form.amountMoney){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '抵粮款金额不能为空',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(this.form.amountMoney>this.form.money||this.form.amountMoney<0||String(this.form.amountMoney).indeOf('.')!= -1 &&
|
|
|
|
+ String(this.deptBudgetList.weight).length -
|
|
|
|
+ (String(this.deptBudgetList.weight).indexOf('.') + 1) >
|
|
|
|
+ 2){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '抵粮款金额输入错误',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ });
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.$confirm('确定提交保证金变更信息', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ setfoodallowance({amountMoney:this.form.amountMoney,contractNo:this.contractNo,}).toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '提交成功,可在费用详情页面查看审核状态',
|
|
|
|
+ type: 'success'
|
|
|
|
+ });
|
|
|
|
+ this.interestrateshow=false
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ getPassYearFormatDate () {
|
|
|
|
+ var nowDate = new Date()
|
|
|
|
+ var _date = new Date()
|
|
|
|
+ nowDate.setTime(nowDate.getTime()-24*60*60*1000*30)
|
|
|
|
+ var year = nowDate.getFullYear()
|
|
|
|
+ var year1 = _date.getFullYear()
|
|
|
|
+ var month = nowDate.getMonth() + 1
|
|
|
|
+ var month1 = _date.getMonth() + 1
|
|
|
|
+ var strDate = nowDate.getDate()
|
|
|
|
+ var strDate1 = _date.getDate()
|
|
|
|
+ if (month >= 1 && month <= 9) {
|
|
|
|
+ month = '0' + month
|
|
|
|
+ }
|
|
|
|
+ if (month1 >= 1 && month1 <= 9) {
|
|
|
|
+ month1 = '0' + month1
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (strDate >= 0 && strDate <= 9) {
|
|
|
|
+ strDate = '0' + strDate
|
|
|
|
+ }
|
|
|
|
+ if (strDate1 >= 0 && strDate1 <= 9) {
|
|
|
|
+ strDate1 = '0' + strDate1
|
|
|
|
+ }
|
|
|
|
+ this.startDate = year + '-' + month +'-' + strDate
|
|
|
|
+ this.endDate = year1 + '-' + month1 +'-' + strDate1
|
|
|
|
+ this.value=[this.startDate,this.endDate]
|
|
|
|
+ },
|
|
|
|
+ selecttype(e){
|
|
|
|
+ // if(e=='全部仓库'){
|
|
|
|
+ // this.warehouseName=''
|
|
|
|
+ // }else{
|
|
|
|
+ // this.warehouseName=e
|
|
|
|
+ // }
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
+ selectcontractNo(e){
|
|
|
|
+ for (let i = 0; i < this.contractNoList.length; i++) {
|
|
|
|
+ if(this.contractNoList[i].contractNo==e){
|
|
|
|
+ this.currectcontract=this.contractNoList[i]
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ // if(e=='全部仓库'){
|
|
|
|
+ // this.warehouseName=''
|
|
|
|
+ // }else{
|
|
|
|
+ // this.warehouseName=e
|
|
|
|
+ // }
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
+ getList() {
|
|
|
|
+ getboodinfo({
|
|
|
|
+ // warehouseType: 1,
|
|
|
|
+ compId: localStorage.getItem('ws-pf_compId'),
|
|
|
|
+ searchKeyWord:this.searchKeyWord,
|
|
|
|
+ currentPage: this.currentPage,
|
|
|
|
+ contractNo:this.contractNo,
|
|
|
|
+ pageSize:this.pageSize ,
|
|
|
|
+ contractType:this.contractType,
|
|
|
|
+ searchType:this.searchType
|
|
|
|
+ })
|
|
|
|
+ .toPromise()
|
|
|
|
+ .then(response => {
|
|
|
|
+ this.tableData = response.records
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ this.deptBudgetTotal = response.total
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ changeDate(){
|
|
|
|
+ if(this.value){
|
|
|
|
+ this.startDate = this.value[0]
|
|
|
|
+ this.endDate = this.value[1]
|
|
|
|
+ }
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
+ pickerOptions() {},
|
|
|
|
+ find() {
|
|
|
|
+ this.getList()
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ handleSizeChange(val) {
|
|
|
|
+ console.log(`每页 ${val} 条`)
|
|
|
|
+ this.pageSize = val
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
+ handleCurrentChange(val) {
|
|
|
|
+ this.currentPage = val
|
|
|
|
+ console.log(`当前页: ${val}`)
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+ .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;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+.findValue{
|
|
|
|
+ width:200px;
|
|
|
|
+}
|
|
|
|
+ .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;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+</style>
|