Files
jjx-web/pages/index/self-support/self-support.vue
T
2026-10-08 18:14:56 +08:00

515 lines
17 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200">
<view class="test">
<text class="pointer active" @click="navTo('/pages/index/self-support/self-support')">自营钢城</text>
<text class="pointer" @click="navTo('/pages/index/self-support/selectType')">平台服务</text>
<text class="pointer" @click="navTo('/pages/index/shop/shop')">特产商城</text>
</view>
<common-swiper page="self-support-index"/>
<div class="flex justify-between items-center w-1200 m-a">
<template v-if="ad32.length">
<el-carousel :height="`100px`" :style="{width: ad33.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad32" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
<template v-if="ad33.length">
<el-carousel :height="`100px`" :style="{width: ad34.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad33" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
</div>
<div class="flex justify-between items-center w-1200 m-a">
<template v-if="ad34.length">
<el-carousel :height="`100px`" :style="{width: ad35.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad34" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
<template v-if="ad35.length">
<el-carousel :height="`100px`" :style="{width: ad35.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad35" :key="index" :style="{width: '100%'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
</div>
<view class="tool-bar">
<view class="search">
<text>交易区域:</text>
<el-cascader :options="options" :props="{label: 'name', value: 'code'}" v-model="address"
clearable @change="getCompanyList"/>
</view>
<view class="flex justify-end items-start">
<view class="flex flex-col justify-center items-center mr-10">
<el-button type="primary" plain class="empty-bg-plain-btn" :disabled="address.length === 0"
@mouseenter.native="showTips = true"
@mouseleave.native="showTips = false"
@click.native="openDialog">
下单询价>
</el-button>
<text class="text-main mt-10 text-20" v-if="showTips && address.length === 0">请先选择交易区域</text>
</view>
<el-button type="primary" @click.native="getList">
我的询价
</el-button>
</view>
</view>
<!-- 合作单位/联营单位-->
<view class="cooperate">
<view class="title">合作单位/联营单位</view>
<u-gap height="5" bg-color="#f3f3f3"/>
<view class="flex justify-start items-start flex-wrap">
<view class="w-25p pointer" v-for="(item, index) in companyList" :key="index"
@click="navToWithAuth(`/pages/yellowPage/info?id=${item.uid}`)">
<view class="border bg-white flex justify-start items-center p-20">
<image v-if="item.businessCard" :src="item.businessCard.logo" class="logo"/>
<image v-else src="/static/images/no-logo.jpg" class="logo" mode="aspectFill"/>
<div class="flex flex-col justify-start items-start ml-20 w-67p">
<span class="text-30 font-bold mb-25">{{ item.company.companyName }}</span>
<span class="mt-20 line-2 w-100p">
主营: {{
(item.mainSpotCategory && item.mainSpotCategory.length > 0) ? item.mainSpotCategory.join() : ''
}}
</span>
</div>
</view>
</view>
</view>
<u-gap height="5" bg-color="#f3f3f3"/>
</view>
</view>
<!-- 现货市场 end -->
<gap height="50"/>
<right-bar></right-bar>
<common-footer></common-footer>
<el-dialog
title="下询价单"
:visible.sync="dialogVisible"
width="60%">
<el-form ref="form" label-width="140px">
<el-form-item label="联系人" required>
<el-select v-model="name" placeholder="点击选择业务联系人"
class="w-100p" @change="selectContact">
<el-option
v-for="(item, index) in contactList"
:key="index"
:label="item.name"
:value="item.name">
</el-option>
<view slot="empty" class="text-gray pointer p-20">
<text>无业务联系人,请到</text>
<text class="text-main mx-15" @click="navToContact">个人中心</text>
<text>添加</text>
</view>
</el-select>
</el-form-item>
<el-form-item label="联系方式" required>
<el-input v-model="phone" placeholder="请输入联系方式" disabled/>
</el-form-item>
<el-form-item label="用户名称" required>
<el-input v-model="company" placeholder="请输入您的名称"/>
</el-form-item>
<el-form-item label="询价单附件" required>
<vk-data-upload v-model="files" list-type="text" accept="*" :on-preview="previewUpload">
</vk-data-upload>
<!-- <p class="text-main text-25">平台目前仅支持PDF文档上传,请你谅解!</p>-->
</el-form-item>
</el-form>
<div class="flex justify-start items-start">
<span>金久信自营说明:</span>
<div>
<p>1、金久信自营目前以不垫资交易方式为主,询价单请备注付款方式,期限和项目名称;</p>
<p>2、你未收到报价可能是你的信用风险评分未达到平台审核标准;</p>
<p>3、提交成功后请您注意接听电话和查看平台信息便于快速准确报价和成交签约。</p>
</div>
</div>
<div class="flex justify-center items-center">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="addFiles">确 定</el-button>
</div>
</el-dialog>
<el-dialog title="我的询价单" :visible.sync="showList" width="60%">
<el-table :data="list" style="width: 100%">
<el-table-column prop="name" label="联系人"/>
<el-table-column label="询价区域">
<template #default="{row}">
{{ row.province.name }}{{ row.city.name }}
</template>
</el-table-column>
<el-table-column prop="phone" label="联系方式"/>
<el-table-column prop="company" label="企业名称"/>
<el-table-column label="附件">
<template #default="{row}">
<file-type v-for="(item, index) in row.files" :key="index" :item="item"/>
</template>
</el-table-column>
<el-table-column prop="_add_time_str" label="询价日期"/>
</el-table>
<div class="mt-20 text-center">
<el-button @click="showList = false">关 闭</el-button>
</div>
</el-dialog>
</view>
</template>
<script>
import UGap from "@/uni_modules/vk-uview-ui/components/u-gap/u-gap.vue";
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
import FileType from "../../../components/file-type/file-type.vue";
export default {
components: {FileType, UGap},
data() {
return {
dialogVisible: false,
address: [],
files: [],
options: [],
companyList: [],
name: null,
phone: null,
company: null,
showList: false,
list: [],
allChildCate: [],
contactList: [],
showTips: false,
ad32: [],
ad33: [],
ad34: [],
ad35: [],
};
},
onLoad(options) {
if (options && options.menu) {
this.currMenu = options.menu
}
this.getCategoryTreeData()
this.options = provinces.map(item => {
item.children = [];
return item
})
this.options.forEach((province, index) => {
citys[index].forEach(city => {
city.children = []
this.options[index].children.push(city)
})
})
this.options.forEach((province, index) => {
citys[index].forEach((city, cityIndex) => {
areas[index][cityIndex].forEach(area => {
this.options[index].children[cityIndex].children.push(area)
})
})
})
this.getContactList()
const user = vk.getVuex('$user.userInfo')
this.company = user.accountType === 2 ? user.company.companyName : user.person.personName
this.getUserInfo()
this.getAd32()
this.getAd33()
this.getAd34()
this.getAd35()
},
methods: {
getCategoryTreeData() {
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.getCompanyList()
}
});
},
menuSelect(e) {
this.currMenu = e
},
navTo(url) {
vk.navigateTo(url);
},
async getUserInfo() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
this.userInfo = userInfo
this.accountNum = accountNum
},
navToWithAuth(url) {
if (!this.userInfo.fadadaConfirm || [-1, 2].includes(this.userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else {
vk.navigateTo(url);
}
},
openDialog() {
if (!this.userInfo.fadadaConfirm || [-1, 2].includes(this.userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else {
this.dialogVisible = true
}
},
async getCompanyList() {
const {rows} = await vk.callFunction({
url: 'client/user/pub/getCompany',
data: {
isCoop: 1,
province: this.address.length > 0 ? [this.address[0]] : []
}
})
this.companyList = rows.map(item => {
item.name = item.company.companyName
item.mainSpotCategory = []
if (item.company && item.company.mainSpotCategoryIds) {
this.allChildCate.forEach(child => {
if (item.company.mainSpotCategoryIds.includes(child._id)) {
item.mainSpotCategory.push(child.name)
}
})
}
return item
})
},
async addFiles() {
if (!this.name) return this.$message({type: 'error', message: '请输入联系人'})
if (!this.phone) return this.$message({type: 'error', message: '请输入联系方式'})
if (!this.company) return this.$message({type: 'error', message: '请输入您的企业名称'})
if (this.files.length === 0) return this.$message({type: 'error', message: '请上传询价单附件'})
if (!vk.getVuex('$user.userInfo.fadadaConfirm') || [-1, 2].includes(vk.getVuex('$user.userInfo.authStatus'))) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
this.dialogVisible = false
return
}
let city, province
this.options.forEach((provinceItem, index) => {
provinceItem.children.forEach(cityItem => {
if (cityItem.code === this.address[1]) {
city = cityItem
province = {code: provinceItem.code, name: provinceItem.name}
}
})
})
await vk.callFunction({
url: 'client/selfSupport/kh/add',
data: {
files: this.files,
city,
province,
name: this.name,
phone: this.phone,
company: this.company,
}
})
await this.$alert('<p style="text-align: center">您已下单成功,感谢您选择金久信</p><p style="text-align: center">请待平台为您提供竭诚服务!</p><p style="text-align: center; color: red">客服电话:400-686-5559</p>', '', {
dangerouslyUseHTMLString: true,
})
this.dialogVisible = false
},
async getList() {
const {rows} = await vk.callFunction({
url: 'client/selfSupport/kh/getList',
})
this.list = rows
this.showList = true
},
async getContactList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.contactList = rows
},
navToContact() {
this.dialogVisible = false
this.showList = false
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
selectContact(name) {
const contact = this.contactList.find(item => item.name === name)
this.phone = contact.phone
},
previewUpload({url}) {
window.open(url)
},
async getAd32() {
this.ad32 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 32,
region: this.address ?? null
}
})
if (res.data) this.ad32 = res.data
},
async getAd33() {
this.ad33 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 33,
region: this.address ?? null
}
})
if (res.data) this.ad33 = res.data
},
async getAd34() {
this.ad34 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 34,
region: this.address ?? null
}
})
if (res.data) this.ad34 = res.data
},
async getAd35() {
this.ad35 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 35,
region: this.address ?? null
}
})
if (res.data) this.ad35 = res.data
}
}
}
</script>
<style lang="scss">
.w-1200 {
width: 1200px;
margin: 20px auto;
background-color: #fff;
.test {
height: 50px;
color: #ffffff;
font-size: 18px;
background-color: #bf2b28;
display: flex;
align-items: center;
justify-content: center;
text {
padding: 0 20px;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
text:hover {
background-color: #690503
}
.active {
background-color: #941411
}
}
.tool-bar {
display: flex;
justify-content: space-between;
align-items: flex-start;
padding: 20px;
font-size: 16px;
.search {
display: flex;
align-items: center;
}
}
.cooperate {
.title {
text-align: center;
color: #bf2b28;
font-size: 28px;
line-height: 3em;
}
.wrap {
flex-wrap: wrap;
}
.grid-content {
display: flex;
justify-content: center;
align-items: center;
padding: 10px;
flex-direction: column;
.comments {
line-height: 2em;
}
}
.bg-purple {
border-top: 1px solid #f3f3f3;
border-right: 1px solid #f3f3f3;
.image {
width: 140px;
}
}
}
}
.logo {
width: 80px;
height: 80px;
}
</style>