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

View File

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

View File

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

View File

@ -32,7 +32,7 @@
<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" >
<a-input placeholder="请输入项目名称" v-model="name" allow-clear> </a-input>
<a-button type="primary" class="ml-20" @click="fetchList"> 搜索</a-button>