|
@@ -1,15 +1,7 @@
|
|
|
//合同利润详情
|
|
|
<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="6">
|
|
@@ -18,11 +10,9 @@
|
|
|
<el-col :span="18">
|
|
|
<div style='margin-left:10px;' class="datascreen">
|
|
|
<div style="display:inline-block;width:50;">
|
|
|
- <el-date-picker value-format='yyyy-MM-dd' v-model="value" type="daterange" align="right" unlink-panels
|
|
|
- range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions"
|
|
|
- class="data_css" @change="changeDate">
|
|
|
- </el-date-picker>
|
|
|
- </div>
|
|
|
+ <el-date-picker value-format='yyyy-MM-dd' v-model="value" type="daterange" align="right" unlink-panels range-separator="至"
|
|
|
+ start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" class="data_css" @change="changeDate" >
|
|
|
+ </el-date-picker></div>
|
|
|
<el-input placeholder="可按合同编号、买方名称、卖方名称查找" class="input_css" v-model="searchKeyWord"></el-input>
|
|
|
<el-button class="find" type="primary" @click="find()"><img width="16" height="16" style="left: -8px;"
|
|
|
src="../../../public/img/sousuo.png" alt="" /></el-button>
|
|
@@ -31,28 +21,26 @@
|
|
|
</el-row>
|
|
|
<el-row style='margin-bottom:10px;'>
|
|
|
<el-col :span="18">
|
|
|
- <el-button style="margin-left:10px" @click="typeChange('')"
|
|
|
- :type="searchContractType == '' ? 'primary' : ''">全部合同</el-button>
|
|
|
- <el-button @click="typeChange(2)" :type="searchContractType == 2 ? 'primary' : ''">采购合同</el-button>
|
|
|
- <el-button @click="typeChange(1)" :type="searchContractType == 1 ? 'primary' : ''">销售合同</el-button>
|
|
|
- <el-button @click="typeChange(3)" :type="searchContractType == 3 ? 'primary' : ''">代收合同</el-button>
|
|
|
- <el-button @click="typeChange(4)" :type="searchContractType == 4 ? 'primary' : ''">代储合同</el-button>
|
|
|
- <el-button @click="typeChange(5)" :type="searchContractType == 5 ? 'primary' : ''">收购合同</el-button>
|
|
|
+ <el-button style="margin-left:10px" @click="typeChange('')" :type="searchContractType == ''?'primary':''">全部合同</el-button>
|
|
|
+ <el-button @click="typeChange(2)" :type="searchContractType == 2?'primary':''">采购合同</el-button>
|
|
|
+ <el-button @click="typeChange(1)" :type="searchContractType == 1?'primary':''">销售合同</el-button>
|
|
|
+ <el-button @click="typeChange(3)" :type="searchContractType == 3?'primary':''">代收合同</el-button>
|
|
|
+ <el-button @click="typeChange(4)" :type="searchContractType == 4?'primary':''">代储合同</el-button>
|
|
|
+ <el-button @click="typeChange(5)" :type="searchContractType == 5?'primary':''">收购合同</el-button>
|
|
|
<!-- <el-button @click="typeChange(1)" :type="searchType == 1?'primary':''">收储合同</el-button> -->
|
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
-
|
|
|
+ <el-col style="text-align:right;" :span="6">
|
|
|
+ <el-button type='primary' @click='detail'>合同利润概览</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row style='margin-bottom:10px;'>
|
|
|
<el-col :span="18">
|
|
|
- <el-button style="margin-left:10px" @click="typeChange1('')"
|
|
|
- :type="searchTypeCon == '' ? 'primary' : ''">全部状态</el-button>
|
|
|
- <el-button @click="typeChange1(4)" :type="searchTypeCon == 4 ? 'primary' : ''">待执行</el-button>
|
|
|
- <el-button @click="typeChange1(1)" :type="searchTypeCon == 1 ? 'primary' : ''">执行中</el-button>
|
|
|
- <el-button @click="typeChange1(3)" :type="searchTypeCon == 3 ? 'primary' : ''">发运结束</el-button>
|
|
|
- <el-button @click="typeChange1(2)" :type="searchTypeCon == 2 ? 'primary' : ''">已完成</el-button>
|
|
|
- <el-button @click="typeChange1(5)" :type="searchTypeCon == 5 ? 'primary' : ''">已结算</el-button>
|
|
|
+ <el-button style="margin-left:10px" @click="typeChange1('')" :type="searchTypeCon == ''?'primary':''">全部状态</el-button>
|
|
|
+ <el-button @click="typeChange1(4)" :type="searchTypeCon == 4?'primary':''">待执行</el-button>
|
|
|
+ <el-button @click="typeChange1(1)" :type="searchTypeCon == 1?'primary':''">执行中</el-button>
|
|
|
+ <el-button @click="typeChange1(3)" :type="searchTypeCon == 3?'primary':''">发运结束</el-button>
|
|
|
+ <el-button @click="typeChange1(2)" :type="searchTypeCon == 2?'primary':''">已完成</el-button>
|
|
|
+ <el-button @click="typeChange1(5)" :type="searchTypeCon == 5?'primary':''">已结算</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
|
|
@@ -60,8 +48,10 @@
|
|
|
</el-row>
|
|
|
<div class="fromdata">
|
|
|
<el-table :data="tableData" stripe style="width: 100%" @selection-change="handleSelectionChange">
|
|
|
- <el-table-column type="selection" width="55">
|
|
|
- </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ type="selection"
|
|
|
+ width="55">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column type="index" label="序号">
|
|
|
<template scope="scope">
|
|
|
<span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
|
|
@@ -70,38 +60,37 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="contractNo" label="合同编号">
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{ scope.row.contractNo }}</span>
|
|
|
+ <span>{{scope.row.contractNo}}</span>
|
|
|
<i @click="correlation(scope.row)" class="el-icon-connection"></i>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="contractType" label="合同类型">
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if='scope.row.agreementType == "销售合同"'>销售</span>
|
|
|
- <span v-if='scope.row.agreementType == "采购合同"'>采购</span>
|
|
|
- <span v-if='scope.row.agreementType == "代收合同"'>代收</span>
|
|
|
- <span v-if='scope.row.agreementType == "代储合同"'>代储</span>
|
|
|
- <span v-if='scope.row.agreementType == "收购合同"'>收购</span>
|
|
|
+ <span v-if='scope.row.agreementType=="销售合同"'>销售</span>
|
|
|
+ <span v-if='scope.row.agreementType=="采购合同"'>采购</span>
|
|
|
+ <span v-if='scope.row.agreementType=="代收合同"'>代收</span>
|
|
|
+ <span v-if='scope.row.agreementType=="代储合同"'>代储</span>
|
|
|
+ <span v-if='scope.row.agreementType=="收购合同"'>收购</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="buyer" label="买方/收购方"></el-table-column>
|
|
|
<el-table-column prop="seller" label="卖方/合营方"></el-table-column>
|
|
|
<el-table-column width="120" prop="surplus" label="剩余(吨)">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if='scope.row.agreementType == "销售合同"'>-</span>
|
|
|
- <span v-else>{{ scope.row.surplus }}</span>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if='scope.row.agreementType=="销售合同"'>-</span>
|
|
|
+ <span v-else>{{scope.row.surplus}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column width="150" prop="settlementPrice" label="结算单价(元/吨)">
|
|
|
+ <el-table-column width="150" prop="settlementPrice" label="结算单价(元/吨)">
|
|
|
</el-table-column>
|
|
|
<el-table-column width="120" prop="profit" label="利润(万元)">
|
|
|
</el-table-column>
|
|
|
<el-table-column width="80" prop="status" label="状态"></el-table-column>
|
|
|
<el-table-column width="100" prop="signingDate" label="签订日期"></el-table-column>
|
|
|
- <el-table-column prop="address" label="操作" width="350">
|
|
|
+ <el-table-column prop="address" label="操作" width="300">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button v-if="scope.row.status == '已结算'" @click="finalstatement(scope.row)"
|
|
|
- type="primary">结算单</el-button>
|
|
|
- <el-button v-if="scope.row.status == '已完成'" @click="closeaccount(scope.row)" type="primary">结算</el-button>
|
|
|
+ <el-button v-if="scope.row.status=='已结算'" @click="finalstatement(scope.row)" type="primary">结算单</el-button>
|
|
|
+ <el-button v-if="scope.row.status=='已完成'" @click="closeaccount(scope.row)" type="primary">结算</el-button>
|
|
|
<el-button @click="inventory(scope.row)" type="primary">库存</el-button>
|
|
|
<el-button @click="cost(scope.row)" type="primary">费用</el-button>
|
|
|
<el-button @click="exportText(scope.row)" type="primary" v-if="scope.row.status == '已结算'">导出</el-button>
|
|
@@ -110,41 +99,46 @@
|
|
|
</el-table>
|
|
|
</div>
|
|
|
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
|
|
|
- style="text-align:center" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper"
|
|
|
- :total="deptBudgetTotal">
|
|
|
+ style="text-align:center" :page-size="pageSize"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
- <el-dialog title="提示" :visible.sync="correlationshow" width="30%" :before-close="handleClose">
|
|
|
- <div v-if="contractList.length > 0">
|
|
|
- <div style="display:flex;justify-content: space-between;" v-for="(item, index) in contractList" :key="index">
|
|
|
- <div>{{ item.contractNo }}</div>
|
|
|
- <div><span v-if="item.status != '已完成' && item.status != '已结算' && item.status != '发运结束'">未完成</span><span
|
|
|
- v-else>已完成</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div v-else>暂无关联合同</div>
|
|
|
- </el-dialog>
|
|
|
- <el-dialog title="合同结算单" :visible.sync="show" width="47%" :before-close="handleClose1">
|
|
|
- <div>
|
|
|
- <table class="table">
|
|
|
+ <el-dialog
|
|
|
+ title="提示"
|
|
|
+ :visible.sync="correlationshow"
|
|
|
+ width="30%"
|
|
|
+ :before-close="handleClose">
|
|
|
+ <div v-if="contractList.length>0">
|
|
|
+ <div style="display:flex;justify-content: space-between;" v-for="item in contractList"><div>{{item.contractNo}}</div>
|
|
|
+ <div><span v-if="item.status!='已完成'&&item.status!='已结算'&&item.status!='发运结束'">未完成</span><span v-else>已完成</span></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else>暂无关联合同</div>
|
|
|
+</el-dialog>
|
|
|
+<el-dialog
|
|
|
+ title="合同结算单"
|
|
|
+ :visible.sync="show"
|
|
|
+ width="47%"
|
|
|
+ :before-close="handleClose1">
|
|
|
+ <div>
|
|
|
+ <table class="table">
|
|
|
<tr class="row">
|
|
|
<td class="col col-bgc">合同编号</td>
|
|
|
- <td class="col">{{ tableData.contractNo }}</td>
|
|
|
+ <td class="col">{{tableData.contractNo}}</td>
|
|
|
<td class="col col-bgc">合同类型</td>
|
|
|
- <td class="col">{{ tableData.agreementType }}</td>
|
|
|
+ <td class="col">{{tableData.agreementType}}</td>
|
|
|
</tr>
|
|
|
<tr class="row">
|
|
|
<td class="col col-bgc">买方</td>
|
|
|
- <td class="col">{{ tableData.buyer }}</td>
|
|
|
+ <td class="col">{{tableData.buyer}}</td>
|
|
|
<td class="col col-bgc">卖方</td>
|
|
|
- <td class="col">{{ tableData.seller }}</td>
|
|
|
+ <td class="col">{{tableData.seller}}</td>
|
|
|
</tr>
|
|
|
<tr class="row">
|
|
|
<td class="col col-bgc">结算单价(元/吨)</td>
|
|
|
- <td class="col">{{ tableData.settlementPrice }}</td>
|
|
|
+ <td class="col">{{tableData.settlementPrice}}</td>
|
|
|
<td class="col col-bgc">合计利润(元)</td>
|
|
|
- <td class="col">{{ tableData.profit }}</td>
|
|
|
+ <td class="col">{{tableData.profit}}</td>
|
|
|
</tr>
|
|
|
<tr class="row">
|
|
|
<td class="col col-bgc">关联合同</td>
|
|
@@ -152,16 +146,16 @@
|
|
|
<td class="col col-bgc">重量(吨)</td>
|
|
|
<td class="col col-bgc">利润(元)</td>
|
|
|
</tr>
|
|
|
- <tr v-for="(item, index) in tableData.contractList" :key="index" class="row">
|
|
|
- <td class="col">{{ item.contractNo }}</td>
|
|
|
- <td class="col">{{ item.settlementPrice }}</td>
|
|
|
- <td class="col">{{ item.weight }}</td>
|
|
|
- <td class="col">{{ item.profit }}</td>
|
|
|
+ <tr v-for="item in tableData.contractList" class="row">
|
|
|
+ <td class="col">{{item.contractNo}}</td>
|
|
|
+ <td class="col">{{item.settlementPrice}}</td>
|
|
|
+ <td class="col">{{item.weight}}</td>
|
|
|
+ <td class="col">{{item.profit}}</td>
|
|
|
</tr>
|
|
|
</table>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
- <el-dialog title="导出" :visible.sync="exportShow" width="500px" :before-close="exportClose" :show-close="true">
|
|
|
+ </div>
|
|
|
+</el-dialog>
|
|
|
+<el-dialog title="导出" :visible.sync="exportShow" width="500px" :before-close="exportClose" :show-close="true">
|
|
|
<div class="check">
|
|
|
<el-checkbox-group v-model="checkList" @change="checkChange">
|
|
|
<el-checkbox label="合同附件" :disabled="contract"></el-checkbox>
|
|
@@ -178,53 +172,55 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import {
|
|
|
- getcontractdetails,
|
|
|
- getrelationcontract,
|
|
|
- editcontract,
|
|
|
- judgesettlement,
|
|
|
- exportText,
|
|
|
+ import {
|
|
|
+ getcontractdetails,
|
|
|
+ getrelationcontract,
|
|
|
+ editcontract,
|
|
|
+ judgesettlement,
|
|
|
+ exportText,
|
|
|
getAnnex
|
|
|
-} from '@/model/profitable/index'
|
|
|
-import {
|
|
|
- downloadFile
|
|
|
-} from '@/utils/batchDown'
|
|
|
-export default {
|
|
|
- components: {},
|
|
|
- data() {
|
|
|
- return {
|
|
|
- value: '',
|
|
|
- tableData: [],
|
|
|
- show: false,
|
|
|
- correlationshow: false,
|
|
|
- deptBudgetTotal: 0,
|
|
|
- currentPage: 1,
|
|
|
- pageSize: 10,
|
|
|
- agreementType: '',
|
|
|
- deptCircularPage: {},
|
|
|
- searchType: '',
|
|
|
- searchKeyWord: '',
|
|
|
- startDate: '',
|
|
|
- searchContractType: '',
|
|
|
- searchTypeCon: '',
|
|
|
- endDate: '',
|
|
|
- outtotal: 0,
|
|
|
- intotal: 0,
|
|
|
- contractList: [],
|
|
|
- tableData: {},
|
|
|
- datalist: {},
|
|
|
- compId: localStorage.getItem('ws-pf_compId'),
|
|
|
- exportShow: false,//导出
|
|
|
+ } from '@/model/profitable/index'
|
|
|
+ export default {
|
|
|
+ components: {},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ value: '',
|
|
|
+ tableData: [],
|
|
|
+ show:false,
|
|
|
+ correlationshow:false,
|
|
|
+ deptBudgetTotal: 0,
|
|
|
+ currentPage: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ agreementType:'',
|
|
|
+ deptCircularPage: {},
|
|
|
+ searchType:'',
|
|
|
+ searchKeyWord:'',
|
|
|
+ startDate:'',
|
|
|
+ searchContractType:'',
|
|
|
+ searchTypeCon:'',
|
|
|
+ endDate:'',
|
|
|
+ outtotal:0,
|
|
|
+ intotal:0,
|
|
|
+ contractList:[],
|
|
|
+ tableData:{},
|
|
|
+ datalist:{},
|
|
|
+ compId:localStorage.getItem('ws-pf_compId'),
|
|
|
+ exportShow: false,//导出
|
|
|
checkList: [],
|
|
|
exportObj: {},
|
|
|
contract: false,
|
|
|
- }
|
|
|
- },
|
|
|
- activated() {
|
|
|
- this.getPassYearFormatDate()
|
|
|
- },
|
|
|
- methods: {
|
|
|
- async exportSubmit() {
|
|
|
+ }
|
|
|
+ },
|
|
|
+ activated() {
|
|
|
+ if(this.$route.query.contractNo){
|
|
|
+ this.searchKeyWord=this.$route.query.contractNo
|
|
|
+ }else{
|
|
|
+ this.searchKeyWord=''
|
|
|
+ }
|
|
|
+ this.getPassYearFormatDate()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async exportSubmit() {
|
|
|
const {
|
|
|
data
|
|
|
} = await exportText(
|
|
@@ -284,329 +280,294 @@ export default {
|
|
|
this.checkList = []
|
|
|
this.exportShow = false
|
|
|
},
|
|
|
- handleClose() {
|
|
|
- this.correlationshow = false
|
|
|
- },
|
|
|
- handleClose1() {
|
|
|
- this.show = false
|
|
|
- },
|
|
|
- correlation(row) {
|
|
|
- getrelationcontract({
|
|
|
- agreementType: row.agreementType, contractNo: row.contractNo, compId: this.compId
|
|
|
- })
|
|
|
- .toPromise()
|
|
|
- .then(response => {
|
|
|
- this.contractList = response
|
|
|
- this.correlationshow = true
|
|
|
- })
|
|
|
- },
|
|
|
- typeChange(num) {
|
|
|
- this.searchContractType = num
|
|
|
- this.getList()
|
|
|
- },
|
|
|
- typeChange1(num) {
|
|
|
- this.searchTypeCon = num
|
|
|
- this.getList()
|
|
|
- },
|
|
|
- async closeaccount(row) {
|
|
|
-
|
|
|
- var data = await getrelationcontract({
|
|
|
- agreementType: row.agreementType, contractNo: row.contractNo, compId: this.compId
|
|
|
- })
|
|
|
- .toPromise()
|
|
|
- var arr = [row].concat(data)
|
|
|
- this.datalist.contractManagementInfoList = arr
|
|
|
- judgesettlement(this.datalist).toPromise().then(response => {
|
|
|
- var weightprice = 0
|
|
|
- for (let i = 0; i < data.length; i++) {
|
|
|
- // weightprice+=(data[i].weight*data[i].settlementPrice)
|
|
|
- if (row.agreementType == '收购合同' || row.agreementType == '采购合同') {
|
|
|
- weightprice += (data[i].weight * (data[i].settlementPrice - row.settlementPrice))
|
|
|
- } else if (row.agreementType == '销售合同') {
|
|
|
- weightprice += (data[i].weight * (row.settlementPrice - data[i].settlementPrice))
|
|
|
- }
|
|
|
- }
|
|
|
- row.profit = weightprice
|
|
|
+ handleClose(){
|
|
|
+ this.correlationshow=false
|
|
|
+ },
|
|
|
+ handleClose1(){
|
|
|
+ this.show=false
|
|
|
+ },
|
|
|
+ correlation(row){
|
|
|
+ getrelationcontract({
|
|
|
+ agreementType:row.agreementType,contractNo:row.contractNo,compId:this.compId})
|
|
|
+ .toPromise()
|
|
|
+ .then(response => {
|
|
|
+ this.contractList=response
|
|
|
+ this.correlationshow=true
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ typeChange(num){
|
|
|
+ this.searchContractType= num
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ typeChange1(num){
|
|
|
+ this.searchTypeCon= num
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ async closeaccount(row){
|
|
|
+
|
|
|
+ var data=await getrelationcontract({
|
|
|
+ agreementType:row.agreementType,contractNo:row.contractNo,compId:this.compId})
|
|
|
+ .toPromise()
|
|
|
+ var arr=[row].concat(data)
|
|
|
+ this.datalist.contractManagementInfoList=arr
|
|
|
+ judgesettlement(this.datalist).toPromise().then(response => {
|
|
|
+ var weightprice=0
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
+ // weightprice+=(data[i].weight*data[i].settlementPrice)
|
|
|
+ if(row.agreementType=='收购合同'||row.agreementType=='采购合同'){
|
|
|
+ weightprice+=(data[i].weight*(data[i].settlementPrice-row.settlementPrice))
|
|
|
+ }else if(row.agreementType=='销售合同'){
|
|
|
+ weightprice+=(data[i].weight*(row.settlementPrice-data[i].settlementPrice))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ row.profit=weightprice
|
|
|
this.$confirm('结算后当前合同和相关合同不可再进行费用相关操作', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
.then(() => {
|
|
|
- editcontract({ flag: 2, id: row.id, profit: row.profit }).toPromise()
|
|
|
- .then(response => {
|
|
|
- this.$message({
|
|
|
- message: '结算成功!',
|
|
|
- type: 'success',
|
|
|
- })
|
|
|
- this.getList()
|
|
|
- }).catch(() => {
|
|
|
- this.$message({
|
|
|
- message: '结算失败!',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- })
|
|
|
+ editcontract({flag:2,id:row.id,profit:row.profit}).toPromise()
|
|
|
+ .then(response => {
|
|
|
+ this.$message({
|
|
|
+ message: '结算成功!',
|
|
|
+ type: 'success',
|
|
|
+ })
|
|
|
+ this.getList()
|
|
|
+ }).catch(()=>{
|
|
|
+ this.$message({
|
|
|
+ message: '结算失败!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
- },
|
|
|
- finalstatement(row) {
|
|
|
- this.tableData.contractNo = row.contractNo
|
|
|
- this.tableData.agreementType = row.agreementType
|
|
|
- this.tableData.buyer = row.buyer
|
|
|
- this.tableData.seller = row.seller
|
|
|
- this.tableData.settlementPrice = row.settlementPrice
|
|
|
- this.tableData.profit = (row.profit * 10000).toFixed(2)
|
|
|
- getrelationcontract({
|
|
|
- agreementType: row.agreementType, contractNo: row.contractNo, compId: this.compId
|
|
|
- })
|
|
|
- .toPromise()
|
|
|
- .then(response => {
|
|
|
- for (let q = 0; q < response.length; q++) {
|
|
|
- if (row.agreementType == '收购合同' || row.agreementType == '采购合同') {
|
|
|
- response[q].profit = (response[q].weight * (response[q].settlementPrice - row.settlementPrice)).toFixed(2)
|
|
|
- } else if (row.agreementType == '销售合同') {
|
|
|
- response[q].profit = (response[q].weight * (row.settlementPrice - response[q].settlementPrice)).toFixed(2)
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- this.tableData.contractList = response
|
|
|
- this.show = true
|
|
|
})
|
|
|
- },
|
|
|
- inventory(row) {
|
|
|
- this.$router.push({ name: 'contractinventory', query: { contractNo: row.contractNo, contractType: row.contractType, buyer: row.buyer, seller: row.seller } })
|
|
|
- },
|
|
|
- returnsales() {
|
|
|
- this.$router.go(-1)
|
|
|
- },
|
|
|
- handleSelectionChange(val) {
|
|
|
- this.multipleSelection = val;
|
|
|
- },
|
|
|
- cost(row) {
|
|
|
- this.$router.push({ name: 'contractcost', query: { contractNo: row.contractNo, contractType: row.contractType, buyer: row.buyer, seller: row.seller } })
|
|
|
- },
|
|
|
- getPassYearFormatDate() {
|
|
|
- var _date = new Date()
|
|
|
- var nowDate = 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]
|
|
|
- this.getList()
|
|
|
- // })
|
|
|
- },
|
|
|
- async getList() {
|
|
|
- var response = await getcontractdetails({
|
|
|
- // warehouseType: 1,
|
|
|
- agreementType: this.agreementType,
|
|
|
- startDate: this.startDate,
|
|
|
- endDate: this.endDate,
|
|
|
- searchKeyWord: this.searchKeyWord,
|
|
|
- currentPage: this.currentPage,
|
|
|
- pageSize: this.pageSize,
|
|
|
- searchType: this.searchType,
|
|
|
- searchContractType: this.searchContractType,
|
|
|
- searchTypeCon: this.searchTypeCon
|
|
|
- })
|
|
|
- .toPromise()
|
|
|
-
|
|
|
- if (response.records.length) {
|
|
|
- for (let i = 0; i < response.records.length; i++) {
|
|
|
- if (response.records[i].status == '已结算') {
|
|
|
- var data = await getrelationcontract({
|
|
|
- agreementType: response.records[i].agreementType, contractNo: response.records[i].contractNo, compId: this.compId
|
|
|
- })
|
|
|
- .toPromise()
|
|
|
- var weightprice = 0
|
|
|
- var weightprice1 = 0
|
|
|
- console.log(data)
|
|
|
- for (let q = 0; q < data.length; q++) {
|
|
|
- if (response.records[i].agreementType == '收购合同' || response.records[i].agreementType == '采购合同') {
|
|
|
- weightprice += (data[q].weight * (data[q].settlementPrice - response.records[i].settlementPrice))
|
|
|
- } else if (response.records[i].agreementType == '销售合同') {
|
|
|
- weightprice += (data[q].weight * (response.records[i].settlementPrice - data[q].settlementPrice))
|
|
|
+ },
|
|
|
+ finalstatement(row){
|
|
|
+ console.log(row)
|
|
|
+ this.tableData.contractNo=row.contractNo
|
|
|
+ this.tableData.agreementType=row.agreementType
|
|
|
+ this.tableData.buyer=row.buyer
|
|
|
+ this.tableData.seller=row.seller
|
|
|
+ this.tableData.settlementPrice=row.settlementPrice
|
|
|
+ this.tableData.profit=(row.profit*10000).toFixed(2)
|
|
|
+ getrelationcontract({
|
|
|
+ agreementType:row.agreementType,contractNo:row.contractNo,compId:this.compId})
|
|
|
+ .toPromise()
|
|
|
+ .then(response => {
|
|
|
+ for (let q = 0; q < response.length; q++) {
|
|
|
+ if(row.agreementType=='收购合同'||row.agreementType=='采购合同'){
|
|
|
+ response[q].profit=(response[q].weight*(response[q].settlementPrice-row.settlementPrice)).toFixed(2)
|
|
|
+ }else if(row.agreementType=='销售合同'){
|
|
|
+ response[q].profit=(response[q].weight*(row.settlementPrice-response[q].settlementPrice)).toFixed(2)
|
|
|
}
|
|
|
- data[q].profit = data[q].weight * data[q].settlementPrice
|
|
|
- console.log(data[q], 222222)
|
|
|
+
|
|
|
}
|
|
|
- response.records[i].profit = weightprice
|
|
|
-
|
|
|
- }
|
|
|
- response.records[i].profit = Number(Number(response.records[i].profit / 10000).toFixed(3))
|
|
|
- response.records[i].surplus = Number(Number(response.records[i].surplus).toFixed(3))
|
|
|
+ this.tableData.contractList=response
|
|
|
+ this.show=true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ inventory(row){
|
|
|
+ this.$router.push({name:'contractinventory',query:{contractNo:row.contractNo,contractType:row.contractType,buyer:row.buyer,seller:row.seller}})
|
|
|
+ },
|
|
|
+
|
|
|
+ handleSelectionChange(val) {
|
|
|
+ this.multipleSelection = val;
|
|
|
+ },
|
|
|
+ cost(row){
|
|
|
+ this.$router.push({name:'contractcost',query:{contractNo:row.contractNo,contractType:row.contractType,buyer:row.buyer,seller:row.seller}})
|
|
|
+ },
|
|
|
+ detail(){
|
|
|
+ this.$router.push({name:'contractprofitsdetails'})
|
|
|
+ },
|
|
|
+ getPassYearFormatDate() {
|
|
|
+ var _date = new Date()
|
|
|
+ var nowDate = 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
|
|
|
}
|
|
|
- }
|
|
|
- this.tableData = response.records
|
|
|
- if (this.tableData.length > 0) {
|
|
|
-
|
|
|
- this.intotal = Number(this.tableData[0].inContractMoney) + Number(this.tableData[0].inWarehouseMoney) + Number(this.tableData[0].inManageMoney)
|
|
|
- this.outtotal = Number(this.tableData[0].outContractMoney) + Number(this.tableData[0].outWarehouseMoney) + Number(this.tableData[0].outManageMoney)
|
|
|
- }
|
|
|
-
|
|
|
- this.deptBudgetTotal = response.total
|
|
|
- },
|
|
|
+ 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]
|
|
|
+ this.getList()
|
|
|
+ // })
|
|
|
+ },
|
|
|
+ async getList() {
|
|
|
+ var response=await getcontractdetails({
|
|
|
+ // warehouseType: 1,
|
|
|
+ agreementType: this.agreementType,
|
|
|
+ startDate:this.startDate,
|
|
|
+ endDate:this.endDate,
|
|
|
+ searchKeyWord:this.searchKeyWord,
|
|
|
+ currentPage: this.currentPage,
|
|
|
+ pageSize:this.pageSize ,
|
|
|
+ searchType:this.searchType,
|
|
|
+ searchContractType:this.searchContractType,
|
|
|
+ searchTypeCon:this.searchTypeCon
|
|
|
+ })
|
|
|
+ .toPromise()
|
|
|
+
|
|
|
+ if(response.records.length){
|
|
|
+ for (let i = 0; i < response.records.length; i++) {
|
|
|
+ if(response.records[i].status=='已结算'){
|
|
|
+ var data=await getrelationcontract({
|
|
|
+ agreementType:response.records[i].agreementType,contractNo:response.records[i].contractNo,compId:this.compId})
|
|
|
+ .toPromise()
|
|
|
+ var weightprice=0
|
|
|
+ var weightprice1=0
|
|
|
+ console.log(data)
|
|
|
+ for (let q = 0; q < data.length; q++) {
|
|
|
+ if(response.records[i].agreementType=='收购合同'||response.records[i].agreementType=='采购合同'){
|
|
|
+ weightprice+=(data[q].weight*(data[q].settlementPrice-response.records[i].settlementPrice))
|
|
|
+ }else if(response.records[i].agreementType=='销售合同'){
|
|
|
+ weightprice+=(data[q].weight*(response.records[i].settlementPrice-data[q].settlementPrice))
|
|
|
+ }
|
|
|
+ data[q].profit=data[q].weight*data[q].settlementPrice
|
|
|
+ console.log(data[q],222222)
|
|
|
+ }
|
|
|
+ response.records[i].profit=weightprice
|
|
|
+
|
|
|
+ }
|
|
|
+ response.records[i].profit=Number(Number(response.records[i].profit/10000).toFixed(3))
|
|
|
+ response.records[i].surplus=Number(Number(response.records[i].surplus).toFixed(3))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.tableData = response.records
|
|
|
+ if(this.tableData.length > 0){
|
|
|
+
|
|
|
+ this.intotal = Number(this.tableData[0].inContractMoney) + Number(this.tableData[0].inWarehouseMoney) + Number(this.tableData[0].inManageMoney)
|
|
|
+ this.outtotal = Number(this.tableData[0].outContractMoney) + Number(this.tableData[0].outWarehouseMoney) + Number(this.tableData[0].outManageMoney)
|
|
|
+ }
|
|
|
+
|
|
|
+ this.deptBudgetTotal = response.total
|
|
|
+ },
|
|
|
|
|
|
- changeDate() {
|
|
|
- if (this.value) {
|
|
|
- this.startDate = this.value[0]
|
|
|
- this.endDate = this.value[1]
|
|
|
- }
|
|
|
- this.getList()
|
|
|
- },
|
|
|
- pickerOptions() { },
|
|
|
- find() {
|
|
|
- this.getList()
|
|
|
+ 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()
|
|
|
+ },
|
|
|
},
|
|
|
- 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>
|
|
|
-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;
|
|
|
-}
|
|
|
+ table,
|
|
|
+ table tr th,
|
|
|
+ table tr td {
|
|
|
+ border: 2px solid #333333;
|
|
|
+ padding: 5px 0;
|
|
|
+ height: 55px;
|
|
|
+ }
|
|
|
|
|
|
-.col-bgc {
|
|
|
- background: #f6f7fb;
|
|
|
-}
|
|
|
+ .content {
|
|
|
+ width: 1000px;
|
|
|
+ padding: 70px 20px 20px 20px;
|
|
|
+ font-size: 22px;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ }
|
|
|
|
|
|
-.container {
|
|
|
- background: #E8ECF6;
|
|
|
-}
|
|
|
+ table {
|
|
|
+ width: 100%;
|
|
|
+ text-align: center;
|
|
|
+ border-collapse: collapse;
|
|
|
+ border: 3px solid #333333;
|
|
|
+ }
|
|
|
|
|
|
-.center {
|
|
|
- margin: 0 auto;
|
|
|
- background: #ffffff;
|
|
|
- height: calc(100vh - 215px);
|
|
|
- border-radius: 4px;
|
|
|
- padding: 20px 0;
|
|
|
+ .col-bgc {
|
|
|
+ background: #f6f7fb;
|
|
|
+ }
|
|
|
|
|
|
- /deep/.el-table td,
|
|
|
- /deep/.el-table th {
|
|
|
- text-align: center;
|
|
|
+ .container {
|
|
|
+ background: #E8ECF6;
|
|
|
}
|
|
|
-}
|
|
|
|
|
|
-.row_top {
|
|
|
- background: #F6F7FC;
|
|
|
- border-radius: 4px;
|
|
|
- margin-bottom: 10px;
|
|
|
+ .center {
|
|
|
+ margin: 0 auto;
|
|
|
+ background: #ffffff;
|
|
|
+ height: calc(100vh - 13vh);
|
|
|
+ border-radius: 4px;
|
|
|
+ padding: 20px 0;
|
|
|
|
|
|
- .bg-left {
|
|
|
- padding-left: 30px;
|
|
|
- }
|
|
|
-
|
|
|
- .bg-right {
|
|
|
- padding-right: 10px;
|
|
|
- text-align: right;
|
|
|
+ /deep/.el-table td,
|
|
|
+ /deep/.el-table th {
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- .title {
|
|
|
- position: relative;
|
|
|
- }
|
|
|
+ .datascreen {
|
|
|
+ display: flex;
|
|
|
|
|
|
- .title::before {
|
|
|
- content: '';
|
|
|
- display: inline-block;
|
|
|
- width: 5px;
|
|
|
- height: 30px;
|
|
|
- background: #5473e8;
|
|
|
- position: absolute;
|
|
|
- left: 0;
|
|
|
- }
|
|
|
-}
|
|
|
+ .data_css {
|
|
|
+ width: 40%;
|
|
|
+ }
|
|
|
|
|
|
-.datascreen {
|
|
|
- display: flex;
|
|
|
+ .input_css {
|
|
|
+ width: 50%;
|
|
|
+ margin: 0 10px;
|
|
|
+ }
|
|
|
|
|
|
- .data_css {
|
|
|
- width: 40%;
|
|
|
+ .find {
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- .input_css {
|
|
|
- width: 50%;
|
|
|
- margin: 0 10px;
|
|
|
+ .fromdata {
|
|
|
+ margin: 20px 0;
|
|
|
+ overflow-y: scroll;
|
|
|
+ height: 546px;
|
|
|
}
|
|
|
-
|
|
|
- .find {
|
|
|
- margin-right: 10px;
|
|
|
+ .top_info{
|
|
|
+ margin: 10px 0 0 10px;
|
|
|
+ min-width: 712px;
|
|
|
+ .info_css{
|
|
|
+ margin-right: 20px;
|
|
|
+ }
|
|
|
}
|
|
|
-}
|
|
|
-
|
|
|
-.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;
|
|
|
}
|
|
|
-}
|
|
|
-
|
|
|
-.bg-right {
|
|
|
- padding-top: 15px;
|
|
|
-}
|
|
|
-
|
|
|
-.el-icon-connection {
|
|
|
- color: #409eff;
|
|
|
-}
|
|
|
-
|
|
|
-.check {
|
|
|
+ .el-icon-connection{
|
|
|
+ color:#409eff;
|
|
|
+ }
|
|
|
+ .check {
|
|
|
text-align: center;
|
|
|
}
|
|
|
</style>
|