This commit is contained in:
2026-10-08 18:20:51 +08:00
parent dec4ebc773
commit 6f1b2dc03a
621 changed files with 47117 additions and 43176 deletions
+264 -208
View File
@@ -10,33 +10,42 @@
<el-breadcrumb-item>
<navigator style="display: inline-block;" url="/pages/spot/goods/goods">现货市场</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item>{{ product.name }}</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="card">
<div class="card-header">
<view class="card-header-left">
<image class="logo" :src="product.user.businessCard.logo" mode="aspectFit"></image>
<image class="logo" :src="product.user.businessCard.logo" mode="aspectFit"
v-if="product.user.businessCard"></image>
<view class="info">
<view v-if="product.user.accountType === 1" class="info-name">
{{ product.user.person.personName }}
</view>
<view v-if="product.user.accountType === 2" class="info-name">
{{ product.user.company.companyName }}
</view>
<template v-if="product.user">
<view v-if="product.user.accountType === 1" class="info-name">
{{ product.user.person.personName }}
</view>
<view v-if="product.user.accountType === 2"
class="info-name flex justify-start items-center">
<text class="mr-25">{{ product.user.company.companyName }}</text>
<el-button type="primary" v-if="product.user.showInYellow === 1" size="small"
@click="navTo(`/pages/yellowPage/info?id=${product.user._id}`)">查看主页
</el-button>
</view>
</template>
<view class="info-update">
<view class="info-update-time">
{{ product._add_time_str }}
</view>
<view class="info-update-business">
主营业务:{{ product.user.businessCard.mainBusiness }}
主营业务:{{
(product.user.company.mainSpotCategory && product.user.company.mainSpotCategory.length > 0) ? product.user.company.mainSpotCategory.join() : ''
}}
</view>
</view>
</view>
</view>
<view class="card-header-right">
<view class="card-header-right flex flex-col justify-center items-center">
<text class="mb-20 text-main">{{ product.quoteNum }}家已申请合作</text>
<el-button v-if="vk.getVuex('$user.userInfo._id') !== product.userId" @click="toCooperate"
type="primary">申请合作
</el-button>
@@ -50,20 +59,36 @@
<div class="part-head">
<h3>现货详情</h3>
</div>
<view v-if="product.user.accountType == 1" class="card-body-name">{{ product.user.person.personName }}
</view>
<view v-if="product.user.accountType == 2" class="card-body-name">{{ product.user.company.companyName }}
</view>
<view class="card-body-stock">库存:{{ product.stock }}吨</view>
<!-- <template v-if="product.user">-->
<!-- <view v-if="product.user.accountType == 1" class="card-body-name">{{-->
<!-- product.user.person.personName-->
<!-- }}-->
<!-- </view>-->
<!-- <view v-if="product.user.accountType == 2" class="card-body-name">-->
<!-- {{ product.user.company.companyName }}-->
<!-- </view>-->
<!-- </template>-->
<view class="card-body-stock">库存约:{{ product.stock }}吨</view>
<view class="card-body-address">
供货地:{{ product.address.province.name + "-" + product.address.city.name + "-" + product.address.area.name }}
供货地:{{
product.address.province.name + "-" + product.address.city.name + "-" + product.address.area.name
}}
</view>
</view>
<view class="card-body">
<div class="part-head">
<h3>报价有效期</h3>
</div>
<view class="card-body-stock">截止: {{
dayjs(product.answerEndTime).format('YYYY-MM-DD HH:mm:ss')
}}
</view>
</view>
<view class="card-body">
<div class="part-head">
<h3>附件</h3>
<h3>产品规格单价</h3>
</div>
<ul class="el-upload-list el-upload-list--text">
<li @click="downloadFile(item)" v-for="(item,index) in product.files" :key="index" tabindex="0"
@@ -76,6 +101,14 @@
</ul>
</view>
<view class="card-body">
<div class="part-head">
<h3>产品现场图片</h3>
</div>
<el-image :preview-src-list="product.images" v-for="(item, index) in product.images" :key="index"
:src="item" style="width: 100px; height: 100px" class="mr-10 mb-15" fit="cover"/>
</view>
<view class="card-body">
<div class="part-head">
<h3>已收到的合作申请</h3>
@@ -84,7 +117,8 @@
:customRightBtns="table1.customRightBtns"></vk-data-table>
</view>
</view>
<Gap/>
<common-footer></common-footer>
<el-dialog :visible.sync="showDialog" width="70%" :show-close="false">
<view slot="title" class="text-main text-40 m-30 flex justify-between items-center">
@@ -93,20 +127,22 @@
</view>
<view class="mt-15" v-if="product">
<view class="request-header">
<text class="flex-1">企业</text>
<text class="flex-1">申请人</text>
<text class="flex-1">申请时间</text>
<text class="flex-1">联系方式</text>
<text class="flex-1">合作留言</text>
<text class="flex-1">申请时间</text>
<text class="flex-1">操作</text>
</view>
<view class="quote" v-for="(item, index) in product.cooperateList" :key="index">
<text class="flex-1">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
item.user.userId !== product.userId ? item.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : item.user.person.personName.replace(/^(.).*(.)$/, "$1*$2")
}}
</text>
<text class="flex-1">{{ item.name }}</text>
<text class="flex-1">{{ item.mobile }}</text>
<text class="flex-1">{{ item.remark }}</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">
{{ item.user.accountType === 1 ? item.user.person.mobile : item.user.company.mobile }}
</text>
<text class="flex-1">
<el-button type="primary" @click.native="doShowInfo(item)">查看申请详情</el-button>
</text>
@@ -115,17 +151,39 @@
</el-dialog>
<el-dialog :visible.sync="form1.props.show" title="申请合作" width="60%" mode="form">
<vk-data-form ref="table1" v-model="form1.data" :action="form1.props.action" :columns="form1.props.columns"
:rules="form1.props.rules" :form-type="form1.props.formType"
:loading.sync="form1.props.loading"
:beforeAction="form1.props.beforeAction" :auto-close="true" label-width="140px"
@success="onFormSuccess"></vk-data-form>
<el-form ref="form" :model="formData" label-width="120px">
<el-form-item label="企业名称" v-if="parseInt(vk.getVuex('$user.userInfo.accountType')) === 2">
<el-input v-model="formData.companyName" placeholder="请输入企业名称"/>
</el-form-item>
<el-form-item label="联系人姓名">
<el-input v-model="formData.name" placeholder="请输入联系人姓名"/>
</el-form-item>
<el-form-item label="联系人电话">
<el-input v-model="formData.mobile" placeholder="请输入联系人电话"/>
</el-form-item>
<el-form-item label="合作留言">
<el-input v-model="formData.remark" placeholder="请输入合作留言"/>
</el-form-item>
<el-form-item label="附件">
<vk-data-upload v-model="formData.files" list-type="text"
accept=".jpg,.jpeg,.png,.xlsx,.doc,.docx,.pdf"/>
</el-form-item>
</el-form>
<view class="text-center">
<el-button type="primary" @click.native="addCoop">确定</el-button>
</view>
<!-- <vk-data-form ref="form1" v-model="form1.data" :action="form1.props.action" :columns="form1.props.columns"-->
<!-- :rules="form1.props.rules" :form-type="form1.props.formType"-->
<!-- :loading.sync="form1.props.loading" :show-cancel="false"-->
<!-- :beforeAction="form1.props.beforeAction" :auto-close="true" label-width="140px"-->
<!-- @success="onFormSuccess">-->
<!-- </vk-data-form>-->
</el-dialog>
<vk-data-dialog
v-model="showInfo"
title="申请详情"
width="600px"
width="60%"
top="14vh"
center
:close-on-click-modal="true"
@@ -145,17 +203,38 @@
</template>
<script>
import Gap from "../../../components/gap/gap.vue";
import dayjs from "dayjs";
export default {
components: {Gap},
data() {
return {
showDialog: false,
showInfo: false,
info: null,
allChildCate: [],
infoColumns: [
{key: "company.companyName", title: "申请人", type: "text"},
{key: "company.mobile", title: "联系方式", type: "text"},
{key: "manager.personName", title: "代理人", type: "text"},
{key: "manager.mobile", title: "代理人联系方式", type: "text"},
{key: "user.company.companyName", title: "企业", type: "text"},
{key: "name", title: "联系人", type: "text"},
{key: "mobile", title: "联系方式", type: "text"},
{key: "remark", title: "合作留言", type: "text"},
{
key: "files", title: "附件", type: "html",
formatter: (val = [], row, column, index) => {
let content = ''
val.forEach((item, itemIndex) => {
content += `<a href="${item}" target="_blank">预览:文件${itemIndex + 1}</a> `
})
return content
}
},
{
key: "_add_time_str",
title: "申请时间",
type: "text",
align: "left",
},
],
product: {
name: '现货详情',
@@ -169,123 +248,52 @@ export default {
},
cooperateList: []
},
formData: {
companyName: '',
name: '',
mobile: '',
remark: '',
accountType: parseInt(vk.getVuex('$user.userInfo.accountType')),
goodsId: null,
goodsUserId: null,
files: [],
},
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {},
data: {
companyName: '',
name: '',
mobile: '',
remark: '',
},
// 表单属性
props: {
// 表单请求地址
action: "client/spot/goods/kh/addCooperate",
// 表单字段显示规则
columns: [{
key: "person",
title: "个人",
type: "object",
showLabel: false,
showRule: (formData) => {
return formData.person.personName != null
},
columns: [{
key: "personName",
title: "姓名",
columns: [
{
key: "companyName",
title: "企业名称",
type: "text",
readonly: true,
disabled: true
},
// {
// key: "idCard",
// title: "身份证号",
// type: "text",
// readonly: true,
// disabled: true
// },
{
key: "mobile",
title: "电话",
type: "text",
readonly: true,
disabled: true
},
]
},
{
key: "company",
title: "企业信息",
type: "object",
showLabel: false,
showRule: (formData) => {
return formData.company.companyName != null
return parseInt(vk.getVuex('$user.userInfo.accountType')) === 2
},
columns: [{
key: "companyName",
title: "企业名称",
type: "text",
readonly: true,
disabled: true
},
{
key: "organization",
title: "统一社会信用代码",
type: "text",
readonly: true,
disabled: true
},
{
key: "legalName",
title: "法人",
type: "text",
readonly: true,
disabled: true
},
{
key: "legalMobile",
title: "法人电话",
type: "text",
readonly: true,
disabled: true
},
]
},
{
key: "manager",
title: "代理人",
type: "object",
showLabel: false,
showRule: (formData) => {
return formData.manager.personName != null
},
columns: [{
key: "personName",
title: "代理人",
type: "text",
readonly: true,
disabled: true
},
// {
// key: "idCard",
// title: "代理人身份证号",
// type: "text",
// readonly: true,
// disabled: true
// },
{
key: "mobile",
title: "代理人电话",
type: "text",
readonly: true,
disabled: true
},
]
key: "name",
title: "联系人姓名",
type: "text",
},
{
key: "mobile",
title: "联系人电话",
type: "text",
},
{
key: "remark",
title: "备注",
title: "合作留言",
type: "textarea",
maxlength: 200,
showWordLimit: true,
@@ -293,11 +301,12 @@ export default {
],
// 表单验证规则
rules: {
text: [{
required: true,
message: "text不能为空",
trigger: "change"
},
text: [
{
required: true,
message: "text不能为空",
trigger: "change"
},
{
required: true,
message: "text不能为空",
@@ -323,55 +332,53 @@ export default {
// 表格数据
data: [],
// 表格字段显示规则
columns: [{
key: "subjectName",
title: "申请人",
type: "text",
width: 400,
formatter: (val, row, column, index) => {
if (vk.getVuex('$user.userInfo._id') === this.product.userId) {
return val
}
if (row.accountType === 1) {
return vk.pubfn.hidden(val, 1, 1);
} else {
return vk.pubfn.hidden(val, 2, 4);
}
}
},
columns: [
{
key: "subjectMobile",
title: "联系方式",
key: "user.company.companyName",
title: "企业",
type: "text",
width: 120,
formatter: (val, row, column, index) => {
let str = val
if (row.managerMobile) {
str = row.managerMobile
if (val) {
if (vk.getVuex('$user.userInfo._id') === this.product.userId) {
return val
}
return val.slice(0, 2) + "******";
}
if (vk.getVuex('$user.userInfo._id') == this.product.userId) {
return str
}
return vk.pubfn.hidden(str, 3, 4);
return ''
}
},
// {
// key: "remark",
// title: "备注",
// type: "textarea",
// width: 280,
// formatter: (val, row, column, index) => {
// let str = val
// if (row.managerMobile) {
// str = row.managerMobile
// }
// if (vk.getVuex('$user.userInfo._id') == this.product.userId) {
// return val
// }
// return "******";
// }
// },
{
key: "name",
title: "申请人",
type: "text",
formatter: (val, row, column, index) => {
if (vk.getVuex('$user.userInfo._id') === this.product.userId) {
return val
}
return val.slice(0, 1) + "**";
}
},
{
key: "mobile",
title: "联系方式",
type: "text",
formatter: (val, row, column, index) => {
if (vk.getVuex('$user.userInfo._id') === this.product.userId) {
return val
}
return "******";
}
},
{
key: "remark",
title: "合作留言",
type: "textarea",
},
{
key: "_add_time",
title: "申请时间",
type: "time",
},
],
customRightBtns: [{
@@ -389,23 +396,9 @@ export default {
}
},
onLoad({
id
}) {
onLoad({id}) {
// 获取现货数据
vk.callFunction({
url: 'client/spot/goods/pub/getDetail',
title: '请求中...',
data: {
_id: id,
},
success: (data) => {
console.log(data);
this.product = data.data
}
});
this.getCategoryTreeData(id)
// 获取用户数据
vk.userCenter.getCurrentUserInfo({
success: (data) => {
@@ -416,22 +409,64 @@ export default {
console.log('form1: ', {
...this.form1.data
});
if (data.userInfo.accountType === 1) {
this.formData.name = data.userInfo.person.personName
this.formData.mobile = data.userInfo.person.mobile
} else {
this.formData.companyName = data.userInfo.company.companyName
this.formData.mobile = data.userInfo.company.mobile
if (data.userInfo.manager) this.formData.name = data.userInfo.manager.personName
}
}
});
},
methods: {
dayjs,
getCategoryTreeData(id) {
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.allChildCate = []
data.rows.forEach(item => {
item.children.forEach(child => {
this.allChildCate.push(child)
})
})
this.getInfo(id)
}
});
},
getInfo(id) {
vk.callFunction({
url: 'client/spot/goods/pub/getDetail',
title: '请求中...',
data: {
_id: id,
},
success: (data) => {
this.product = data.data
this.product.user.company.mainSpotCategory = []
if (this.product.user.company && this.product.user.company.mainSpotCategoryIds) {
this.allChildCate.forEach(child => {
if (this.product.user.company.mainSpotCategoryIds.includes(child._id)) {
this.product.user.company.mainSpotCategory.push(child.name)
}
})
}
}
});
},
downloadFile(url) {
location.href = url
},
showCooperate() {
this.table2.show = true
},
async toCooperate() {
const {userInfo} = await vk.callFunction({
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@@ -439,12 +474,20 @@ export default {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('请完善名片信息', '提示', {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=business-card'});
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (accountNum === 0) {
this.$confirm('请先到个人中心添加收款账户', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=account'});
})
} else {
this.form1.props.show = true
@@ -459,12 +502,25 @@ export default {
}
});
},
onFormSuccess() {
this.form1.props.show = false
},
doShowInfo(info) {
this.info = info
this.showInfo = true
},
addCoop() {
if (!this.formData.name) return this.$message.error('请填写联系人姓名')
if (!this.formData.mobile) return this.$message.error('请填写联系方式')
this.formData.goodsId = this.product._id
this.formData.goodsUserId = this.product.userId
vk.callFunction({
url: 'client/spot/goods/kh/addCooperate',
data: this.formData
})
this.form1.props.show = false
this.$message.success('提交成功')
this.getInfo(this.product._id)
},
navTo(url) {
vk.navigateTo({url})
}
},
filters: {