You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

411 lines
11 KiB

3 years ago
<template>
<div>
<!-- 合同详情-->
<xy-dialog :is-show.sync="isShowDetail" type="normal" title="详情" class="contract-detail" v-if="detail">
<template v-slot:normalContent>
<div class="base-info">
<div class="base-info-title">项目基本信息</div>
<div class="base-info-item">
<div class="base-info-item-title">项目名称</div>
<div class="base-info-item-content">{{detail.name}}</div>
</div>
<div class="base-info-item">
<div class="base-info-item-title">项目类型</div>
3 years ago
<div class="base-info-item-content">{{typeFormatter(detail.type)}}</div>
3 years ago
</div>
<div style="display: flex;justify-content: space-between;">
<div class="base-info-item" style="flex-basis: 50%">
<div class="base-info-item-title">采购形式</div>
3 years ago
<div class="base-info-item-content">{{detail.purchase_way.value}}</div>
3 years ago
</div>
<div class="base-info-item" style="flex-basis: 50%">
<div class="base-info-item-title">采购方式</div>
3 years ago
<div class="base-info-item-content">{{detail.purchase_type.value}}</div>
3 years ago
</div>
</div>
<div class="base-info-item">
<div class="base-info-item-title">项目预算</div>
<div class="base-info-item-content">{{detail.plan_price}}</div>
3 years ago
<div class="base-info-item-unit">(万元)</div>
3 years ago
</div>
<div class="base-info-item">
<div class="base-info-item-title">资金渠道</div>
3 years ago
<div class="base-info-item-content">{{detail.money_way.value}}</div>
3 years ago
</div>
</div>
<div class="link-budget-plan">
<div class="link-budget-plan-title">关联预算计划</div>
<xy-table :height="260" :table-item="linkBudgetPlanTable" :show-index="false" :list="detail.plans">
<template v-slot:btns>
<div></div>
</template>
</xy-table>
</div>
<div class="sign-info">
<div class="sign-info-title">签订信息</div>
<div class="sign-info-item">
<div class="sign-info-item-title">合同金额</div>
<div class="sign-info-item-content">{{detail.money}}</div>
3 years ago
<div class="sign-info-item-unit"></div>
3 years ago
</div>
<div style="display: flex;justify-content: space-between">
<div class="sign-info-item" style="flex-basis: 50%">
<div class="sign-info-item-title">承包商\供应商</div>
<div class="sign-info-item-content">{{detail.supply}}</div>
</div>
<div class="sign-info-item" style="flex-basis: 50%">
<div class="sign-info-item-title">执行部门</div>
<div class="sign-info-item-content">{{detail.carry_department}}</div>
</div>
</div>
</div>
3 years ago
<div class="pay-plan">
3 years ago
<div class="pay-plan-title">付款计划</div>
3 years ago
<xy-table :height="240" :list="signPlan" :table-item="planTable" :show-index="false" :btn-width="130" @delete="deletePayPlan" @editor="(row)=>{$refs['detailContractSign'].planId = row.id;$refs['detailContractSign'].isShow = true}"></xy-table>
3 years ago
</div>
3 years ago
<div class="related-processes">
<div class="related-processes-title">相关流程</div>
<div class="related-processes-item">
3 years ago
<div @click="seeBuyProcess"></div>
<div @click="seeSignProcess"></div>
<div @click="seeBidding"></div>
<template v-if="detail.is_plan != 1">
<div @click="seeAskProcess"></div>
</template>
3 years ago
</div>
</div>
<div class="journal">
<div class="journal-title">日志</div>
<xy-table :height="240" :table-item="journalTable" :list="detail.log" :show-index="false">
<template v-slot:btns>
<div></div>
</template>
</xy-table>
</div>
</template>
<template v-slot:footerContent>
<div></div>
</template>
</xy-dialog>
3 years ago
<detailContractSign ref="detailContractSign" @editorSuccess="getDetail(id)"></detailContractSign>
3 years ago
</div>
</template>
<script>
import {detailContract} from "@/api/contract/contract";
3 years ago
import {delContractSign, getContractSign} from "@/api/contractSign/contractSign"
3 years ago
import {parseTime} from "@/utils"
3 years ago
import {getOatoken} from "@/api/oatoken";
3 years ago
import {Message} from "element-ui";
import detailContractSign from "./detailContractSign"
3 years ago
export default {
3 years ago
components:{
detailContractSign
},
3 years ago
data() {
return {
3 years ago
window:{
width:0,
height:0,
top:0,
left:0
},
3 years ago
//合同详情
3 years ago
id:'',
3 years ago
detail:null,
isShowDetail:false,
linkBudgetPlanTable:[
{
label:"ID",
sortable:false,
prop:'id',
width:160
},
{
label:"类型",
width:100,
sortable: false,
customFn:(row)=>{
return (
<div>
<Tag color="primary">
{row.type === 1 ? '部门预算' : '水务计划'}
</Tag>
</div>
)
}
},
{
label:"项目",
width: 140,
sortable: false,
prop:'name'
},
{
label:"金额",
sortable: false,
prop:'money',
align:'right'
}
],
journalTable:[
{
label:'ID',
sortable:false,
prop:'id'
},
{
label:"日志类型",
3 years ago
sortable:false,
prop:'type'
3 years ago
},
{
label:"日志内容",
3 years ago
sortable:false,
prop:'remark'
3 years ago
},
{
label:"操作人",
3 years ago
sortable:false,
prop:'admin.name'
3 years ago
},
{
label:"时间",
sortable:false,
prop:'created_at',
formatter:(cell,data,value)=>{
return parseTime(new Date(value),'{y}-{m}-{d}')
}
}
],
3 years ago
signPlan:[],
planTable:[
{
prop:'date',
label:'日期',
sortable:false,
formatter:(cell,data,value)=>{
return parseTime(new Date(value),'{y}-{m}-{d}')
}
},
{
prop:'money',
label:'金额(元)',
align:'right',
sortable:false,
},
{
prop:'content',
label:'内容',
align:'left',
sortable:false,
},
{
prop:'remark',
label:'备注',
align:'left',
sortable:false,
}
]
3 years ago
}
},
methods: {
3 years ago
async seeBuyProcess(){
if(!this.detail?.purchase_last_flow_id){
Message({
type:"warning",
message:"还未进行采购申请",
duration:2000
})
return
}
let res = await getOatoken()
let url =`${process.env.VUE_APP_OUT_URL}/admin/flow/view/${this.detail.purchase_last_flow_id}?oatoken=${res.oatoken}`
let seeBuy = window.open(url,'seeBuy',`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`)
},
async seeBidding(){
if(!this.detail?.invite_last_flow_id){
Message({
type:"warning",
message:"还未进行招标申请",
duration:2000
})
return
}
let res = await getOatoken()
let url =`${process.env.VUE_APP_OUT_URL}/admin/flow/view/${this.detail.invite_last_flow_id}?oatoken=${res.oatoken}`
let seeBidding = window.open(url,'seeBidding',`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`)
},
async seeSignProcess(){
if(!this.detail?.join_last_flow_id){
Message({
type:"warning",
message:"还未进行会签申请",
duration:2000
})
return
}
let res = await getOatoken()
let url =`${process.env.VUE_APP_OUT_URL}/admin/flow/view/${this.detail.join_last_flow_id}?oatoken=${res.oatoken}`
let seeSign = window.open(url,'seeSign',`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`)
},
async seeAskProcess(){
if(!this.detail?.req_last_flow_id){
Message({
type:"warning",
message:"还未进行请示申请",
duration:2000
})
return
}
let res = await getOatoken()
let url =`${process.env.VUE_APP_OUT_URL}/admin/flow/view/${this.detail.req_last_flow_id}?oatoken=${res.oatoken}`
let seeAsk = window.open(url,'seeAsk',`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`)
},
3 years ago
async getDetail(id){
3 years ago
this.id = id
3 years ago
let res = await detailContract({id:id})
this.detail = res
3 years ago
let plan = await getContractSign({contract_id:id})
this.signPlan = plan.data
3 years ago
},
3 years ago
//删除付款计划
deletePayPlan(row){
delContractSign({id:row.id}).then(res=>{
this.getSignPlan()
Message({
type:'success',
message:"操作成功"
})
})
},
},
computed:{
typeFormatter(){
return function (type){
switch (type){
case 1:
return "服务"
break;
case 2:
return "货品"
break;
case 3:
return "工程"
break;
default:
return "未知"
}
}
}
3 years ago
},
mounted() {
this.window.width = screen.availWidth * 0.8
this.window.height = screen.availHeight * 0.8
this.window.top = (window.screen.height - 30 - this.window.height)/2
this.window.left = (window.screen.width - 10 - this.window.width)/2
3 years ago
}
3 years ago
}
</script>
<style scoped lang="scss">
.contract-detail{
.base-info{
&-title{
font-weight: 600;
padding: 0 10px;
}
&-item{
display: flex;
margin-top: 8px;
&-title{
padding: 0 20px;
}
&-content{
}
&-unit{
margin-left: 20px;
}
}
}
.link-budget-plan{
margin-top: 20px;
&-title{
@extend .base-info-title;
padding-bottom: 10px;
}
}
.sign-info{
&-title{
@extend .link-budget-plan-title;
}
&-item{
@extend .base-info-item;
&-title{
@extend .base-info-item-title;
}
&-content{
@extend .base-info-item-content;
}
&-unit{
@extend .base-info-item-unit;
}
}
}
3 years ago
.pay-plan{
margin-top: 20px;
&-title{
@extend .link-budget-plan-title;
}
}
3 years ago
.related-processes{
margin-top: 20px;
&-title{
@extend .link-budget-plan-title;
}
&-item{
color: red;
3 years ago
3 years ago
display: flex;
&>div{
3 years ago
cursor: pointer;
3 years ago
3 years ago
margin: 0 20px;
3 years ago
}
}
}
.journal{
margin-top: 20px;
&-title{
@extend .link-budget-plan-title;
}
}
}
</style>