[fix]合同详情

This commit is contained in:
sdaduanbilei-d1581 2025-04-27 11:09:53 +08:00
parent 82359539af
commit d632703fa3
4 changed files with 110 additions and 120 deletions

View File

@ -7,73 +7,32 @@
:header="false" :header="false"
:footer="false" :footer="false"
> >
<div v-if="form"> <a-card class="mt-20">
<div> <a-descriptions
<div class="grey-6 bold-500"> v-if="info"
合同编号{{ form.number }} :data="data"
</div> :title="info.name"
<div class="flex flex-center flex-justify-start"> bordered
<div class="font-24 bold">{{ form.name }}</div> />
<div class="ml-20"> <a-empty v-else description="暂无合同"> </a-empty>
<a-dropdown @select="changeStatus"> </a-card>
<a-button
type="primary"
size="small"
:style="
`background-color:` + form.status.remark
"
>{{ form.status.label }}
</a-button>
<template #content>
<a-doption
v-for="item in dict"
:key="item.id"
:value="item"
>{{ item.label }}
</a-doption>
</template>
</a-dropdown>
</div>
</div>
</div>
<div class="mt-20">
<a-descriptions :data="data" bordered>
<a-descriptions-item
v-for="item of data"
:label="item.label"
:key="item.id"
>
<div>{{ item.value }}</div>
</a-descriptions-item>
</a-descriptions>
</div>
<div> <div>
<a-tabs <a-tabs
class="mt-10" class="mt-10"
@change="tabChange" @change="tabChange"
:active-key="tabIndex" :active-key="tabIndex"
> >
<a-tab-pane title="详细信息" key="0"></a-tab-pane> <a-tab-pane title="合同附件" key="0"></a-tab-pane>
<a-tab-pane title="合同附件" key="1"></a-tab-pane> <a-tab-pane title="合同回款" key="1"></a-tab-pane>
<a-tab-pane title="回款记录" key="2"></a-tab-pane>
<a-tab-pane title="操作记录" key="5"></a-tab-pane>
</a-tabs> </a-tabs>
<xbase v-if="tabIndex === 0" :info="form" @ok="update" /> </div>
<files v-else-if="tabIndex === 1" :info="form" />
<pay-log v-else-if="tabIndex === 2" :info="form" /> <div v-if="tabIndex === 0 && info">
<div <attach
v-else :type="2"
class="flex flex-center flex-col grey-6" :query-id="info.id"
style="margin-top: 96px" :project-id="info.projectId"
>
<img
style="width: 100px"
src="https://res.wutongshucloud.com/res/2024/12/09/202412091020938.svg"
/> />
<div>正在开发中</div>
</div>
</div>
</div> </div>
</a-drawer> </a-drawer>
</div> </div>
@ -83,17 +42,20 @@
import xbase from '@/views/contract/components/base.vue' import xbase from '@/views/contract/components/base.vue'
import files from '@/views/contract/components/files.vue' import files from '@/views/contract/components/files.vue'
import payLog from '@/views/contract/components/pay-log.vue' import payLog from '@/views/contract/components/pay-log.vue'
import attach from '@/views/project/components/attach/index.vue'
export default { export default {
components: { components: {
attach,
xbase, xbase,
files, files,
payLog payLog
}, },
props: { props: {
info: { id: {
type: Object, required: true,
default: null type: String,
default: ''
} }
}, },
watch: { watch: {
@ -101,7 +63,7 @@ export default {
handler(val) { handler(val) {
if (val) { if (val) {
this.form = this.info this.form = this.info
this.init() this.fetchInfo()
} else { } else {
this.tabIndex = 0 this.tabIndex = 0
} }
@ -113,13 +75,18 @@ export default {
tabIndex: 0, tabIndex: 0,
show: false, show: false,
form: null, form: null,
info: null,
data: [ data: [
{ {
label: '客户名称', label: '合同编号',
prop: 'customer' prop: 'number'
}, },
{ {
label: '合同金额(元)', label: '合同类型',
prop: 'number'
},
{
label: '合同金额 单位:元',
prop: 'amount' prop: 'amount'
}, },
{ {
@ -127,15 +94,35 @@ export default {
prop: 'signDate' prop: 'signDate'
}, },
{ {
label: '回款金额', label: '合同开始日期',
prop: 'payAmount' prop: 'startDate'
}, },
{ {
label: '负责人', label: '合同结束日期',
prop: 'endDate'
},
{
label: '对方单位名称',
prop: 'customer'
},
{
label: '对方单位联系人',
prop: 'contact'
},
{
label: '我方单位名称',
prop: 'org'
},
{
label: '我方负责联系人',
prop: 'person' prop: 'person'
},
{
label: '备注',
prop: 'remark'
} }
], ]
dict: []
} }
}, },
methods: { methods: {
@ -157,26 +144,33 @@ export default {
this.form = val this.form = val
this.init() this.init()
}, },
init() { fetchInfo() {
const tmp = JSON.parse( this.$api.contract.info({ id: this.id }).then(res => {
sessionStorage.getItem('dict_contract_status') if (res.code === 200) {
) this.info = res.data
if (tmp) { this.fetchData()
this.dict = tmp
} }
// data })
this.data = this.data.map(item => { },
if (item.prop === 'customer') { fetchData() {
item.value = this.form.customer.name this.data = this.data.map(e => {
} else if (item.prop === 'person') { const item = e
item.value = this.form.person.name item.value = this.info[e.prop]
} else { if (e.prop === "person"){
item.value = this.form[item.prop] item.value = this.info.personInfo.name
}
if (e.prop === "org"){
item.value = this.info.org.label
}
if (e.prop === "customer"){
item.value = this.info.customer.name
}
if (e.prop === "contact"){
item.value = this.info.contact.name
} }
return item return item
}) })
console.log(this.data) },
}
} }
} }
</script> </script>

View File

@ -5,7 +5,7 @@
<div class="flex flex-center flex-justify-between"> <div class="flex flex-center flex-justify-between">
<div class="flex flex-center flex-justify-start"> <div class="flex flex-center flex-justify-start">
<a-input <a-input
placeholder="请输入合同名称" placeholder="请输入合同名称或编号"
style="width: 380px" style="width: 380px"
allow-clear allow-clear
@clear="fetchList" @clear="fetchList"
@ -15,9 +15,7 @@
>搜索 >搜索
</a-button> </a-button>
</div> </div>
<div>
<edit-contract @ok="fetchList" />
</div>
</div> </div>
<a-table <a-table
class="mt-20" class="mt-20"
@ -40,7 +38,7 @@
</template> </template>
<template #menu="{ record }"> <template #menu="{ record }">
<div> <div>
<more :info="record" /> <more :id="record.id" />
</div> </div>
</template> </template>
</a-table> </a-table>
@ -50,13 +48,11 @@
<script> <script>
import navbar from '@/components/navbar/index.vue' import navbar from '@/components/navbar/index.vue'
import editContract from '@/views/contract/components/edit-contract.vue'
import more from '@/views/contract/components/more.vue' import more from '@/views/contract/components/more.vue'
export default { export default {
components: { components: {
navbar, navbar,
editContract,
more more
}, },
data() { data() {

View File

@ -76,7 +76,7 @@ export default {
prop: 'number' prop: 'number'
}, },
{ {
label: '合同金额', label: '合同金额 单位:元',
prop: 'amount' prop: 'amount'
}, },
{ {

View File

@ -32,7 +32,7 @@
<div> <div>
</div> </div>
<div class="flex flex-center flex-justify-between"> <div class="flex flex-center flex-justify-between mt-20">
<div class="flex flex-center" > <div class="flex flex-center" >
<a-input placeholder="请输入项目名称" v-model="name" allow-clear> </a-input> <a-input placeholder="请输入项目名称" v-model="name" allow-clear> </a-input>
<a-button type="primary" class="ml-20" @click="fetchList"> 搜索</a-button> <a-button type="primary" class="ml-20" @click="fetchList"> 搜索</a-button>