Files
2026-10-08 18:19:39 +08:00

161 lines
5.9 KiB
Vue

<template>
<div>
<el-descriptions border :column="2" v-if="info">
<el-descriptions-item label="服务">
<div v-for="(item, index) in goods" :key="index">
<p>{{ item.goodsName }}</p>
<template v-if="orderInfo.subType === 2 && item.amountItem">
<p>项基础收费: {{ item.amountItem.amount }}元</p>
<p v-if="item.costNum">清单单品项数: {{ item.costNum }}</p>
<p>项数加价: {{ item.amountItem.addAmount }}元</p>
<p>建议收费: {{ item.amountItem.amount + (item.costNum * item.amountItem.addAmount) }}元</p>
</template>
</div>
</el-descriptions-item>
<el-descriptions-item label="考察对象" v-if="info.type === 0">
<div v-for="(item, index) in info.contentList" :key="index">
<span>类型:{{ item.type }},</span>
<span>{{ item.name }}</span>
<template v-if="item.type && item.type === '个人'">
<span>({{ item.code }})</span>
<span>--{{ item.addressRegion.province.name }}{{
item.addressRegion.city.name
}}{{ item.addressRegion.area.name }}{{ item.address }}</span>
</template>
</div>
</el-descriptions-item>
<el-descriptions-item label="考察产品" v-else>
<p style="margin-bottom: .5rem" v-for="(item, index) in info.contentList" :key="index">{{
item.name
}}--{{ item.addressRegion.province.name }}{{
item.addressRegion.city.name
}}{{ item.addressRegion.area.name }}{{ item.address }}</p>
</el-descriptions-item>
<el-descriptions-item label="文档">
<div v-for="(item, index) in info.contentList" :key="index">
<template v-if="item.files">
<a v-for="(file, fileIndex) in item.files" :key="fileIndex" :href="file"
target="_blank">预览:文件{{ fileIndex + 1 }}</a>
</template>
</div>
</el-descriptions-item>
<el-descriptions-item label="接收文件电子邮箱">
<span>{{ info.email }}</span>
</el-descriptions-item>
<el-descriptions-item label="接收文件微信">
<span>{{ info.wechat }}</span>
</el-descriptions-item>
<el-descriptions-item label="接收文件寄件地址">
<span v-if="info.receiveAddressRegion.province">{{
info.receiveAddressRegion.province.name
}}{{ info.receiveAddressRegion.city.name }}{{
info.receiveAddressRegion.area.name
}}{{ info.receiveAddress }}</span>
</el-descriptions-item>
<el-descriptions-item label="申请人">
<span>{{ info.requestName }}</span>
</el-descriptions-item>
<el-descriptions-item label="业务联系人">
<span>{{ info.contactName }}</span>
</el-descriptions-item>
<el-descriptions-item label="业务联系方式">
<span>{{ info.contact }}</span>
</el-descriptions-item>
<el-descriptions-item label="用户备注">
<span>{{ info.remark ? info.remark : '' }}</span>
</el-descriptions-item>
<el-descriptions-item label="接单公司" v-if="info.companyId">
<span>{{ info.company.company.companyName }}</span>
</el-descriptions-item>
<el-descriptions-item label="结果文件" v-if="orderInfo && orderInfo.resultFiles">
<div v-for="(item, index) in orderInfo.resultFiles" :key="index">
<a :href="item"
target="_blank">预览:文件{{ index + 1 }}</a>
</div>
</el-descriptions-item>
<el-descriptions-item label="发送途径" v-if="orderInfo && orderInfo.sendMethod"><span>{{
orderInfo.sendMethod
}}</span>
</el-descriptions-item>
</el-descriptions>
<template v-if="info && !info.companyId && isSet">
<p style="margin-top: 2rem">接单公司</p>
<el-row :gutter="10">
<el-col :span="6">
<el-select v-model="companyId" placeholder="请选择接单公司" style="width: 100%">
<el-option
v-for="(item, index) in companyList"
:disabled="item._id === info.uid"
:key="item.value"
:label="item.company.companyName"
:value="item._id">
</el-option>
</el-select>
</el-col>
<el-col :span="2">
<el-button type="primary" @click.native="setCompany" :disabled="!companyId">确定</el-button>
</el-col>
</el-row>
</template>
</div>
</template>
<script>
export default {
name: "selfProductInfo",
props: {
orderInfo: null,
orderId: null,
goods: null,
isSet: false,
},
data() {
return {
info: null,
companyId: null,
companyList: [],
}
},
methods: {
async getInfo() {
const {data} = await vk.callFunction({
url: 'admin/selfProduct/order/sys/getDetail',
data: {
orderId: this.orderId
}
})
this.info = data
},
async getCompanyList() {
const data = {type: 2, pageSize: 500}
if (this.info.type === 0) data.isCompanyQuote = true
else if (this.info.type === 1) data.isProductQuote = true
else if (this.info.type === 2) data.isCostQuote = true
const {rows} = await vk.callFunction({
url: 'admin/system/user/sys/getList',
data
})
this.companyList = rows.filter(item => item.company && item.company.companyName !== '' && item.company.companyName)
},
async setCompany() {
if (!this.companyId) return this.$message.error('请选择接单公司')
await vk.callFunction({
url: 'admin/selfProduct/order/sys/setCompany',
data: {
orderId: this.info.orderId,
companyId: this.companyId
}
})
this.close()
},
close() {
this.$emit('close')
}
},
async mounted() {
console.log(this.orderInfo)
await this.getInfo()
if (this.isSet) await this.getCompanyList()
}
}
</script>