This commit is contained in:
2026-10-08 18:14:56 +08:00
parent dec4ebc773
commit 9cc1ff546c
1081 changed files with 238347 additions and 52161 deletions
+72
View File
@@ -5,3 +5,75 @@
/.idea
/uniCloud-aliyun/cloudfunctions/router/node_modules/
/pnpm-lock.yaml
/金久信源码/金久信数据库/fadada-verify-record.json
/金久信源码/金久信数据库/jjx-account.json
/金久信源码/金久信数据库/jjx-ad.json
/金久信源码/金久信数据库/jjx-album.json
/金久信源码/金久信数据库/jjx-article.json
/金久信源码/金久信数据库/jjx-article-category.json
/金久信源码/金久信数据库/jjx-article-collect.json
/金久信源码/金久信数据库/jjx-article-download.json
/金久信源码/金久信数据库/jjx-balance.json
/金久信源码/金久信数据库/jjx-balance-log.json
/金久信源码/金久信数据库/jjx-business-card.json
/金久信源码/金久信数据库/jjx-business-contact.json
/金久信源码/金久信数据库/jjx-cart.json
/金久信源码/金久信数据库/jjx-certificate.json
/金久信源码/金久信数据库/jjx-company-manage-change-log.json
/金久信源码/金久信数据库/jjx-contract.json
/金久信源码/金久信数据库/jjx-contract-template.json
/金久信源码/金久信数据库/jjx-coop-config.json
/金久信源码/金久信数据库/jjx-dict.json
/金久信源码/金久信数据库/jjx-enquiry-attributes.json
/金久信源码/金久信数据库/jjx-enquiry-category.json
/金久信源码/金久信数据库/jjx-enquiry-package.json
/金久信源码/金久信数据库/jjx-enquiry-quote.json
/金久信源码/金久信数据库/jjx-enquiry-sheet.json
/金久信源码/金久信数据库/jjx-enquiry-template.json
/金久信源码/金久信数据库/jjx-ensure-config.json
/金久信源码/金久信数据库/jjx-factory.json
/金久信源码/金久信数据库/jjx-goods.json
/金久信源码/金久信数据库/jjx-goods-category.json
/金久信源码/金久信数据库/jjx-goods-cooperate.json
/金久信源码/金久信数据库/jjx-industry.json
/金久信源码/金久信数据库/jjx-message.json
/金久信源码/金久信数据库/jjx-message-config.json
/金久信源码/金久信数据库/jjx-old.json
/金久信源码/金久信数据库/jjx-old-category.json
/金久信源码/金久信数据库/jjx-old-quote.json
/金久信源码/金久信数据库/jjx-order.json
/金久信源码/金久信数据库/jjx-order-goods.json
/金久信源码/金久信数据库/jjx-order-pay-list.json
/金久信源码/金久信数据库/jjx-order-selfProduct.json
/金久信源码/金久信数据库/jjx-other-article.json
/金久信源码/金久信数据库/jjx-other-article-category.json
/金久信源码/金久信数据库/jjx-process-category.json
/金久信源码/金久信数据库/jjx-process-quote.json
/金久信源码/金久信数据库/jjx-process-sheet.json
/金久信源码/金久信数据库/jjx-quote-num-config.json
/金久信源码/金久信数据库/jjx-qyb.json
/金久信源码/金久信数据库/jjx-self-support.json
/金久信源码/金久信数据库/jjx-self-support-quote-list.json
/金久信源码/金久信数据库/jjx-sign-pay_list.json
/金久信源码/金久信数据库/jjx-site-config.json
/金久信源码/金久信数据库/jjx-spot-ad.json
/金久信源码/金久信数据库/jjx-spot-amount.json
/金久信源码/金久信数据库/jjx-spot-category.json
/金久信源码/金久信数据库/jjx-spot-goods.json
/金久信源码/金久信数据库/jjx-steal-factory.json
/金久信源码/金久信数据库/jjx-user-address.json
/金久信源码/金久信数据库/jjx-user-article.json
/金久信源码/金久信数据库/jjx-user-contract.json
/金久信源码/金久信数据库/jjx-user-level.json
/金久信源码/金久信数据库/jjx-user-quote-num.json
/金久信源码/金久信数据库/opendb-admin-log.json
/金久信源码/金久信数据库/opendb-admin-menus.json
/金久信源码/金久信数据库/opendb-app-list.json
/金久信源码/金久信数据库/opendb-verify-codes.json
/金久信源码/金久信数据库/uni-id-log.json
/金久信源码/金久信数据库/uni-id-permissions.json
/金久信源码/金久信数据库/uni-id-roles.json
/金久信源码/金久信数据库/uni-id-users.json
/金久信源码/金久信数据库/vk-files.json
/金久信源码/金久信数据库/vk-files-categories.json
/金久信源码/金久信数据库/vk-global-data.json
+4 -34
View File
@@ -1,10 +1,9 @@
<script>
import config from '@/app.config.js'
import {version} from './package.json'
export default {
methods: {
},
export default {
methods: {},
// 监听 - 页面404
onPageNotFound: function (e) {
uni.redirectTo({
@@ -28,31 +27,6 @@
uni.vk.updateManager.updateReady(); // 此代码可以让小程序自动检测最新版本
// #endif
// 加载商品分类数据
vk.callFunction({
url: 'client/spot/category/pub/getTree',
loading: false,
data: {
},
success: (data) => {
vk.setVuex('$app.siteData.categoryData', data.rows)
}
});
},
onShow: function () {
if (config.debug) console.log("App Show");
@@ -65,7 +39,8 @@
// 如果不想要alert弹窗提示,可以将vk.alert改成console.log
uni.vk.alert('检测到您当前发布的【体验版】是通过【运行】按钮打包发布的,请重新点击HBX上方菜单的【发行】按钮进行打包发布小程序(如果确定是【发行】按钮打包的,请删除手机上的体验版小程序并重新扫码进入)', '重要提示', '好的');
}
} catch(err){}
} catch (err) {
}
// #endif
},
onHide: function () {
@@ -74,8 +49,3 @@
}
</script>
<style lang="scss">
/*每个页面公共css */
// @import "./uni_modules/vk-uview-ui/index.scss";
@import "./common/css/app.scss";
</style>
+5 -9
View File
@@ -11,16 +11,12 @@ uni-modal,
}
/* #endif */
/* 使用预编译主题,避免 dart-sass 编译 element-ui 源码产生 slash-div 警告并拖垮构建 */
@import "@/common/css/element-theme/index.css";
/* 改变主题色变量 */
$--color-primary: #A92924;
/* 改变 icon 字体路径变量,必需 */
$--font-path: '~element-ui/lib/theme-chalk/fonts';
$--button-border-radius: 12px;
@import "~element-ui/packages/theme-chalk/src/index";
.el-button {
border-radius: 12px;
}
.el-input.is-disabled .el-input__inner {
color: #333333 !important;
+25 -2
View File
@@ -529,6 +529,7 @@ h1, h2, h3, h4, h5 {
white-space: nowrap;
overflow: hidden;
font-size: 0;
height: 44px;
}
.mod-mini-search .mod-hot-query li {
@@ -748,7 +749,7 @@ button, input, select, textarea {
float: left;
width: 220px;
height: 40px;
cursor: pointer;
/*cursor: pointer;*/
position: relative;
}
@@ -892,7 +893,7 @@ button, input, select, textarea {
.cate-menu {
height: 500px;
overflow: hidden;
overflow-y: auto;
width: 100%;
}
@@ -2170,6 +2171,10 @@ input:disabled {
color: #333;
}
.text-blue {
color: #316ccb;
}
.color-6C {
color: #6C6C6C;
}
@@ -2322,6 +2327,10 @@ input:disabled {
width: 33%;
}
.w-35p {
width: 35%;
}
.w-40p {
width: 40%;
}
@@ -2747,3 +2756,17 @@ input:disabled {
word-break: break-all;
white-space: nowrap;
}
.line-2 {
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
.text-line-through {
text-decoration: line-through;
}
+8 -4
View File
@@ -213,7 +213,7 @@ body, html {
}
.mod-inner2Listcenter .inli-mask{
width: 266px;
width: 220px;
position: relative;
float: left;
padding: 13px 5px;
@@ -221,12 +221,12 @@ body, html {
-webkit-transition: all .2s linear;
-o-transition: all .2s linear;
transition: all .2s linear;
margin-right: 45px;
margin-right: 10px;
background-color: #FFFFFF;
margin-bottom: 45rpx;
margin-bottom: 30rpx;
}
.mod-inner2Listcenter .inli-mask:nth-child(4n){
.mod-inner2Listcenter .inli-mask:nth-child(5n){
margin-right: 0;
}
.mod-inner2Listcenter{
@@ -2638,3 +2638,7 @@ letter-spacing: 3px;
.ddddd .shop_check{
color: #a92924;
}
.currentDatePickerClass .el-picker-panel__footer .el-button--text.el-picker-panel__link-btn {
display: none;
}
+179 -51
View File
@@ -14,40 +14,44 @@
<div class="part-category">
<div class="cate-menu" psa="a156">
<ul id="nav-sub" class="">
<li v-for="(item,index) in vk.getVuex('$app.siteData.categoryData')"
<li v-for="(item,index) in categoryData"
@mouseenter="showShowChild(index)"
@mouseleave="hideShowChild(index)"
class="clearfix menuliselected" :key="index">
<i class="cate-menu-icon cate-icon-1"></i>
<h2>
<a href="">{{ item.name }}</a>
<a @click="jumpToIndex(item)" class="pointer cate-name">{{
item.name
}}</a>
</h2>
<div class="cate-item clearfix">
<a v-for="(citem,cindex) in item.children" href=""
<div class="cate-item clearfix" v-if="item.showChild">
<a v-for="(citem,cindex) in item.children" href="javascript:;"
v-show="cindex < 9"
@click="jump(item, citem)"
:key="cindex">{{ citem.name }}</a>
</div>
</li>
</ul>
</div>
<div class="cate-cont" psa="a157" style="">
<div class="item-main" style="">
<div class="part-hot-word">
<div class="item">
<div class="title">
<h2>
<a href="/market/index.html?name2=螺纹钢、高线">螺纹钢</a>
</h2>
<a href="/market/index.html" class="more">更多
<i>&gt;</i></a>
</div>
<div class="cont">
</div>
</div>
</div>
<div class="part-logo-cont">
</div>
</div>
</div>
<!-- <div class="cate-cont" psa="a157" style="">-->
<!-- <div class="item-main" style="">-->
<!-- <div class="part-hot-word">-->
<!-- <div class="item">-->
<!-- <div class="title">-->
<!-- <h2>-->
<!-- <a href="/market/index.html?name2=螺纹钢、高线">螺纹钢</a>-->
<!-- </h2>-->
<!-- <a href="/market/index.html" class="more">更多-->
<!-- <i>&gt;</i></a>-->
<!-- </div>-->
<!-- <div class="cont">-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="part-logo-cont">-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
</div>
</div>
</div>
@@ -59,7 +63,8 @@
<li class="nav ">
<a href="/">首页</a>
</li>
<li class="nav" @click="navTo('/pages/index/self-support/self-support')" :class="[currentPage.includes('self-support') ? 'active' : '']">
<li class="nav" @click="navTo('/pages/index/self-support/self-support')"
:class="[currentPage.includes('self-support') ? 'active' : '']">
<a href="javascript:;">金久信自营</a>
</li>
<li @click="navTo('/pages/spot/goods/goods')" class="nav"
@@ -71,7 +76,7 @@
<li @click="navTo('/pages/enquiry/list')" class="nav "
:class="[currentPage.includes('enquiry') ? 'active' : '']">
<a href="javascript:;" class="navigator">
找买家
找供应
</a>
</li>
<li @click="navTo('/pages/process/list')" class="nav "
@@ -90,14 +95,15 @@
:class="[currentPage.includes('article') ? 'active' : '']">
<a href="javascript:;">金久信学堂</a>
</li>
<li class="nav " @click="navTo('/pages/index/shop/shop')" :class="[currentPage.includes('shop') ? 'active' : '']">
<li class="nav " @click="navTo('/pages/index/shop/shop')"
:class="[(currentPage.includes('shop') && !currentPage.includes('pay')) ? 'active' : '']">
<a href="javascript:;">特产商城</a>
</li>
</ul>
</div>
<div class="classification">
<div class="entry">
<div class="entry-link">
<div class="entry-link " @click="navTo('/pages/index/self-support/self-support')">
<img src="@/static/images/logo-left2.png">
</div>
</div>
@@ -122,9 +128,13 @@
</el-button>
</div>
<div class="login-action">
<el-button type="primary" class="auth-btn">
<img src="@/static/images/id-card.png">
<text>实名认证</text>
<el-button type="primary" class="auth-btn"
@click.native="navTo('/pages/user/user')">
<text class="company-name" style="max-width: 320rpx">{{
JSON.stringify(vk.getVuex('$user.userInfo')) === '{}' ? '实名认证' :
([2, '2'].includes(vk.getVuex('$user.userInfo.accountType')) ? vk.getVuex('$user.userInfo.company.companyName') : vk.getVuex('$user.userInfo.person.personName'))
}}
</text>
</el-button>
</div>
</div>
@@ -132,11 +142,12 @@
<div class="me-tab">
<div class="me-tab-text">
<ul>
<li @click="canShareType = 0" class="tab-left"
<li @click="canShareType = 0;"
class="tab-left"
:class="[canShareType === 0 ? 'active' : '']">
<a href="javascript:void(0)">买家可享</a>
</li>
<li @click="canShareType = 1" class=""
<li @click="canShareType = 1;" class=""
:class="[canShareType === 1 ? 'active' : '']">
<a href="javascript:void(0)">卖家可享</a>
</li>
@@ -144,7 +155,7 @@
</div>
<div class="me-tab-content">
<div class="tab-inner">
<div class="me-step clearfix">
<div class="me-step clearfix" v-if="canShareType === 0">
<dl>
<dt>
<i class="iconNew"><img
@@ -183,7 +194,7 @@
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg15.png"></i>
</dt>
<dd>达成交易</dd>
<dd>完成交易</dd>
</dl>
<dl>
<dt>
@@ -192,7 +203,7 @@
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg15.png"></i>
</dt>
<dd>验收</dd>
<dd>货物验收</dd>
</dl>
<dl>
<dt>
@@ -202,10 +213,71 @@
<dd>我的订单</dd>
</dl>
</div>
<p style="width: 100%;margin:10px 0px;">
<a href="/buyer/index.html"
<div class="me-step clearfix" v-else-if="canShareType === 1">
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg1.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg13.png"></i>
</dt>
<dd>免费注册</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg2.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg13.png"></i>
</dt>
<dd>优势报价</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg3.png"></i>
</dt>
<dd>管理销售</dd>
</dl>
<dl class="dowslf3">
<dt class="clearfix">
<i class="iconNew iconNew-step-arrow2"><img
src="/static/images/lg14.png"></i>
</dt>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg6.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg15.png"></i>
</dt>
<dd>完成交易</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg5.png"></i>
<i class="iconNew iconNew-step-arrow"><img
src="/static/images/lg15.png"></i>
</dt>
<dd>组织发货</dd>
</dl>
<dl>
<dt>
<i class="iconNew"><img
src="/static/images/lg4.png"></i>
</dt>
<dd>我的订单</dd>
</dl>
</div>
<p style="width: 100%;margin:10px 0;">
<a v-if="canShareType === 0" href="javascript:;" @click="navTo('/pages/store/buyer')"
style="text-align: center;color: #a92924;font-size: 13px;line-height: 2">进入买家中心
&gt;</a>
<a v-else-if="canShareType === 1" href="javascript:;" @click="navTo('/pages/store/store')"
style="text-align: center;color: #a92924;font-size: 13px;line-height: 2">进入卖家中心
&gt;</a>
</p>
</div>
<div class="tab-inner" style="display: none;">
@@ -268,8 +340,8 @@
</dl>
</div>
<p style="width: 100%;margin:10px 0px;">
<a href="/seller/index.html"
<p style="width: 100%;margin:10px 0;">
<a href="javascript:;" @click="navTo('/pages/store/store')"
style="text-align: center;color: #a92924;font-size: 13px;line-height: 2">进入卖家中心
&gt;</a>
</p>
@@ -284,19 +356,13 @@
<p>微信公众号</p>
</div>
<div class="wartcharlist">
<img src="/static/images/80705c8b12d05d0ff67a2758749ef09c.jpg"
<img :src="gzhQr"
style="height: 100px;width: 100px;">
</div>
</div>
</div>
</div>
</div>
<!---->
</div>
</div>
</div>
</div>
@@ -317,11 +383,14 @@ export default {
return {
showCategory: false,
canShareType: 0,
currentPage: ''
currentPage: '',
gzhQr: '',
categoryData: []
};
},
mounted() {
let that = this
this.getCateList()
const bannerAllPro = document.getElementById("bannerAllPro")
bannerAllPro.addEventListener("mouseover", () => {
that.showCategory = true
@@ -331,11 +400,56 @@ export default {
})
const routes = getCurrentPages()
this.currentPage = getCurrentPages()[routes.length - 1].route
this.getGzhQr()
},
methods: {
async getGzhQr() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'cd349d8f691400d0033a5408018d2fe7'
},
})
this.gzhQr = res.content
},
navTo(url) {
vk.navigateTo(url);
if (JSON.stringify(vk.getVuex('$user.userInfo')) === '{}') {
if (url === '/pages/user/user') url = '/pages/auth/register/register'
}
vk.navigateTo(url);
},
showShowChild(index) {
this.$set(this.categoryData[index], 'showChild', true)
},
hideShowChild(index) {
this.$set(this.categoryData[index], 'showChild', false)
},
getCateList() {
vk.callFunction({
url: 'client/spot/category/pub/getTree',
loading: false,
data: {},
success: (data) => {
data.rows.map(item => {
item.showChild = false
return item
})
this.categoryData = data.rows
}
});
},
jump(item, citem) {
if (item._id === '657609c48b0da41d31e5f901') this.navTo(`/pages/spot/goods/goods`)
else if (item._id === '5823f6ee68ca6a9101062ab04002e715') this.navTo(`/pages/index/self-support/self-support`)
else this.navTo(`/pages/spot/goods/goods?keyword=${citem.name}`)
},
jumpToIndex(item) {
if (item._id === '657609c48b0da41d31e5f901') this.navTo(`/pages/spot/goods/goods`)
else if (item._id === '5823f6ee68ca6a9101062ab04002e715') this.navTo(`/pages/index/self-support/self-support`)
else this.navTo(`/pages/spot/goods/goods?keyword=${item.name}`)
}
},
watch: {
$route({meta: {pagePath}}) {
@@ -368,7 +482,21 @@ export default {
}
}
}
.el-icon-menu {
padding: 0 4px;
}
.company-name {
display: inline-block;
max-width: 100px;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
white-space: nowrap;
}
.cate-name:hover {
color: #a92924
}
</style>
+165 -83
View File
@@ -7,15 +7,9 @@
<dt>平台服务</dt>
<dd>
<ul>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/index/self-support/self-support')">金久信自营</a></li>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/otherArticle/list?id=657457acf082105ea4d467f0')">常见问题</a>
</li>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/otherArticle/list?id=657457b621821b5c0fca456a')">帮助中心</a>
</li>
<li><a rel="nofollow" href="javascript:;" @click="navTo('/')">实力商家入驻</a></li>
<li v-for="(item, index) in serviceList" :key="index">
<a rel="nofollow" href="javascript:;"
@click="navTo(`/pages/otherArticle/detail?id=${item._id}`)">{{ item.name }}</a></li>
</ul>
</dd>
</dl>
@@ -25,19 +19,10 @@
<dt>交易流程</dt>
<dd>
<ul>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/otherArticle/detail?id=657458e821821b5c0fca7dff')">信誉采购</a>
</li>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/otherArticle/detail?id=6574591f7ad52d34471bd558')">金久信公正</a>
</li>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/otherArticle/list?id=6574592b09664c4f4af2e686')">自主交易</a>
</li>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/index/self-support/self-support')">金久信自营</a></li>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/enquiry/list')">发布询价单</a>
<li v-for="(item, index) in tradeList" :key="index"><a rel="nofollow" href="javascript:;"
@click="navTo(`/pages/otherArticle/detail?id=${item._id}`)">{{
item.name
}}</a>
</li>
</ul>
</dd>
@@ -48,23 +33,10 @@
<dt>关于金久信</dt>
<dd>
<ul>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/otherArticle/list?id=657457b621821b5c0fca456a')">金久信动态</a>
</li>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/otherArticle/list?id=657457b621821b5c0fca456a')">知识产权声明</a>
</li>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/otherArticle/list?id=657457b621821b5c0fca456a')">隐私声明</a>
</li>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/otherArticle/list?id=657457b621821b5c0fca456a')">免责声明</a>
</li>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/otherArticle/list?id=657457b621821b5c0fca456a')">平台交易规则</a>
</li>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/otherArticle/list?id=657457b621821b5c0fca456a')">关于我们</a>
<li v-for="(item, index) in aboutList" :key="index"><a rel="nofollow" href="javascript:;"
@click="navTo(`/pages/otherArticle/detail?id=${item._id}`)">{{
item.name
}}</a>
</li>
</ul>
</dd>
@@ -75,9 +47,10 @@
<dt>旧货交易</dt>
<dd>
<ul>
<li><a rel="nofollow" href="/article/detail/id/19.html">旧货交易流程</a>
</li>
<li><a rel="nofollow" href="/article/detail/id/18.html">如何下单</a>
<li v-for="(item, index) in oldList" :key="index"><a rel="nofollow" href="javascript:;"
@click="navTo(`/pages/otherArticle/detail?id=${item._id}`)">{{
item.name
}}</a>
</li>
</ul>
</dd>
@@ -88,41 +61,45 @@
<dt>找加工</dt>
<dd>
<ul>
<li><a rel="nofollow" href="/article/detail/id/21.html">加工交易流程</a>
</li>
<li><a rel="nofollow" href="/article/detail/id/20.html">如何下加工单</a>
</li>
</ul>
</dd>
</dl>
</div>
<div class="mod-contact">
<dl>
<dt>找合作</dt>
<dd>
<ul>
<li><a rel="nofollow" href="/article/detail/id/23.html">合作施工</a>
</li>
<li><a rel="nofollow" href="/article/detail/id/22.html">合作供货</a>
<li v-for="(item, index) in processList" :key="index"><a rel="nofollow" href="javascript:;"
@click="navTo(`/pages/otherArticle/detail?id=${item._id}`)">{{
item.name
}}</a>
</li>
</ul>
</dd>
</dl>
</div>
<!-- <div class="mod-contact">-->
<!-- <dl>-->
<!-- <dt>找合作</dt>-->
<!-- <dd>-->
<!-- <ul>-->
<!-- <li v-for="(item, index) in coopList" :key="index"><a rel="nofollow" href="javascript:;"-->
<!-- @click="navTo(`/pages/otherArticle/detail?id=${item._id}`)">{{ item.name }}</a>-->
<!-- </li>-->
<!-- </ul>-->
<!-- </dd>-->
<!-- </dl>-->
<!-- </div>-->
<div class="mod-contact">
<dl>
<dt>金久信学堂</dt>
<dd>
<ul>
<li><a rel="nofollow" href="/article/detail/id/27.html">行业动态</a>
</li>
<li><a rel="nofollow" href="/article/detail/id/26.html">技术论坛</a>
</li>
<li><a rel="nofollow" href="/article/detail/id/25.html">执行标准</a>
</li>
<li><a rel="nofollow" href="/article/detail/id/24.html">基础知识</a>
<li><a rel="nofollow" href="javascript:;"
@click="navTo('/pages/otherArticle/list?id=6574521499c62431df5b562c')">行业动态</a>
</li>
<!-- <li><a rel="nofollow" href="javascript:;"-->
<!-- @click="navTo('/pages/otherArticle/list?id=6573d6fcf082105ea4bb5d09')">技术论坛</a>-->
<!-- </li>-->
<!-- <li><a rel="nofollow" href="javascript:;"-->
<!-- @click="navTo('/pages/otherArticle/list?id=6573d704862066d070e8f7be')">执行标准</a>-->
<!-- </li>-->
<!-- <li><a rel="nofollow" href="javascript:;"-->
<!-- @click="navTo('/pages/otherArticle/list?id=6573d70c21392942007c0521')">基础知识</a>-->
<!-- </li>-->
</ul>
</dd>
</dl>
@@ -132,14 +109,11 @@
<dt>金久信金融</dt>
<dd>
<ul>
<li><a rel="nofollow" href="/article/detail/id/31.html">如何还款</a>
<li v-for="(item, index) in jinRongList" :key="index"><a rel="nofollow" href="javascript:;"
@click="navTo(`/pages/otherArticle/detail?id=${item._id}`)">{{
item.name
}}</a>
</li>
<li><a rel="nofollow" href="/article/detail/id/30.html">如何使用额度</a>
</li>
<li><a rel="nofollow" href="/article/detail/id/29.html">申请流程</a>
</li>
<li><a rel="nofollow" href="/article/detail/id/28.html"
>金久信金融简介</a></li>
</ul>
</dd>
</dl>
@@ -150,25 +124,30 @@
<div class="group-copyright-inner">
<div class="mod-inner">
<div class="wuage-other-link">
<div class="wuage-link">
<p class="out-link">
<a rel="nofollow" target="_self" href="http:/yilitong.com">亿利通官网</a>
|<a rel="nofollow" target="_self" href="baidu.com">亿利通</a>
</p>
</div>
<!-- <div class="wuage-link">-->
<!-- <p class="out-link">-->
<!-- <a rel="nofollow" target="_self"-->
<!-- href="https://baike.baidu.com/item/%E5%8D%97%E5%AE%81%E4%BA%BF%E5%88%A9%E9%80%9A%E9%92%A2%E7%AE%A1%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8/23408974?fr=ge_ala">亿利通官网</a>-->
<!-- |<a rel="nofollow" target="_self"-->
<!-- href="https://baike.baidu.com/item/%E5%8D%97%E5%AE%81%E4%BA%BF%E5%88%A9%E9%80%9A%E9%92%A2%E7%AE%A1%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8/23408974?fr=ge_ala">亿利通</a>-->
<!-- </p>-->
<!-- </div>-->
<p class="wuage-copyright">
Copyright © 2020-2021&nbsp;&nbsp; jinjiuxinzg.cn &nbsp;&nbsp;All Rights Reserved &nbsp;&nbsp;版权所有:&nbsp;&nbsp;南宁亿利通钢管有限公司
<a href="https:/beian.miit.gov.cn" rel="nofollow">桂ICP备19008827号-1</a>
<a href="https://beian.miit.gov.cn" rel="nofollow" target="_blank">桂ICP备19008827号-1</a>
<a class="wuage-copyright"
href="https://beian.mps.gov.cn/#/query/webSearch?code=45010702002145" rel="noreferrer"
target="blank">桂公网安备45010702002145</a>
</p>
</div>
<div class="certs-group">
<div class="certs-group" style="margin-right: 80px">
<a class="cert-1" rel="nofollow">
<span class="clearfix"><img
src="http:/jyx.gxwebsoft.com/public/upload/image/20210220/80705c8b12d05d0ff67a2758749ef09c.jpg"><p>公众号</p></span>
:src="gzhQr"><p>公众号</p></span>
</a>
<a class="cert-2" rel="nofollow">
<span class="clearfix"><img
src="http:/jyx.gxwebsoft.com/public/upload/image/20210220/80705c8b12d05d0ff67a2758749ef09c.jpg"><p>手机站</p></span>
:src="mobileQr"><p>手机站</p></span>
</a>
</div>
</div>
@@ -181,13 +160,116 @@
export default {
name: "common-footer",
data() {
return {};
return {
jinRongList: [],
tradeList: [],
aboutList: [],
coopList: [],
processList: [],
oldList: [],
serviceList: [],
gzhQr: '',
mobileQr: '',
};
},
mounted() {
this.getJinRongList()
this.getTradeList()
this.getAboutList()
this.getCoopList()
this.getProcessList()
this.getOldList()
this.getServiceList()
this.getGzhQr()
this.getMobileQr()
},
methods: {
navTo(url) {
vk.navigateTo({
url: url
});
},
async getGzhQr() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'cd349d8f691400d0033a5408018d2fe7'
},
})
this.gzhQr = res.content
},
async getMobileQr() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'da8988ea691400c0033703596b9fec1e'
},
})
this.mobileQr = res.content
},
async getJinRongList() {
const res = await vk.callFunction({
url: 'client/otherArticle/list/pub/getList',
data: {
parentId: "65761c6a09664c4f4a325a05"
}
})
this.jinRongList = res.rows
},
async getTradeList() {
const res = await vk.callFunction({
url: 'client/otherArticle/list/pub/getList',
data: {
parentId: "657458db9755e36c09375be8"
}
})
this.tradeList = res.rows
},
async getAboutList() {
const res = await vk.callFunction({
url: 'client/otherArticle/list/pub/getList',
data: {
parentId: "65761c33e0ec19b504d81f90"
}
})
this.aboutList = res.rows
},
async getCoopList() {
const res = await vk.callFunction({
url: 'client/otherArticle/list/pub/getList',
data: {
parentId: "65761c53337a9f0756a154ee"
}
})
this.coopList = res.rows
},
async getProcessList() {
const res = await vk.callFunction({
url: 'client/otherArticle/list/pub/getList',
data: {
parentId: "65761c49a09a9b1767464f4f"
}
})
this.processList = res.rows
},
async getOldList() {
const res = await vk.callFunction({
url: 'client/otherArticle/list/pub/getList',
data: {
parentId: "65761c40466d41a58495c9ae"
}
})
this.oldList = res.rows
},
async getServiceList() {
const res = await vk.callFunction({
url: 'client/otherArticle/list/pub/getList',
data: {
parentId: "65761c229755e36c0976fb82"
}
})
this.serviceList = res.rows
}
}
}
+179 -49
View File
@@ -9,14 +9,27 @@
<div class="navigation-top clearfix">
<div class="searchBar">
<ul class="searchBar-tab clearfix">
<li @click="searchTypeChange(0)" :class="{'active': searchType == 0}" class="_goods" >商品</li>
<li @click="searchTypeChange(1)" :class="{'active': searchType == 1}" class="_shop">商户</li>
<li @click="searchTypeChange(1)" :class="{'active': searchType === 1}" class="_shop">
现货
</li>
<li @click="searchTypeChange(2)" :class="{'active': searchType === 2}" class="_shop">
找供应
</li>
<li @click="searchTypeChange(3)" :class="{'active': searchType === 3}" class="_shop">
找加工
</li>
<li @click="searchTypeChange(4)" :class="{'active': searchType === 4}" class="_shop">
旧货
</li>
<li @click="searchTypeChange(0)" :class="{'active': searchType === 0}" class="_goods">
特产商品
</li>
</ul>
<div class="clearfix">
<div class="searchBar-input">
<div class="searchBar-input-inner">
<input type="text" :placeholder="searchList[searchType].placeholder"
maxlength="100" autocomplete="off">
maxlength="100" autocomplete="off" v-model="keyword">
</div>
<div class="searchBar-input-list" style="display: none;"></div>
</div>
@@ -26,36 +39,9 @@
</div>
<div class="mod-hot-query">
<ul class="clearfix">
<li>
<a href="/market/index.html?product_name=直缝焊管">直缝焊管</a>
</li>
<li>
<a href="/market/index.html?product_name=架子管">架子管</a>
</li>
<li>
<a href="/market/index.html?product_name=无缝管">无缝管</a>
</li>
<li>
<a href="/market/index.html?product_name=方矩管">方矩管</a>
</li>
<li>
<a href="/market/index.html?product_name=钢板">钢板</a>
</li>
<li>
<a href="/market/index.html?product_name=螺纹钢">螺纹钢</a>
</li>
<li>
<a href="/market/index.html?product_name=H型钢">H型钢</a>
</li>
<li>
<a href="/market/index.html?product_name=工字钢">工字钢</a>
</li>
<li>
<a href="/market/index.html?product_name=槽钢">槽钢</a>
</li>
<li>
<a href="/market/index.html?product_name=镀锌钢管">镀锌钢管</a>
<ul style="width: 480px; overflow-x: auto;">
<li v-for="(item, index) in allChildCate" :key="index">
<a href="javascript:;" @click="navTo(item.name)">{{ item.name }}</a>
</li>
</ul>
</div>
@@ -63,19 +49,20 @@
</div>
<div class="mod-menu">
<div class="hrd">
<a href="/support/index.html" class="hrd-landing">
<a href="javascript:;" class="hrd-landing"
@click="jump('/pages/index/self-support/self-support')">
<img src="@/static/images/logo-left.png">
</a>
</div>
</div>
<div class="mod-download-icon js-download">
<a class="download clearfix" href="" target="_blank">
<span style="float: left;font-size: 13px;padding-top: 27px;padding-right: 10px;">金久信<br>
手机站</span>
<img src="/public/upload/image/20210220/80705c8b12d05d0ff67a2758749ef09c.jpg"
style="height: 90px;width: 90px;float: left;">
</a>
</div>
<!-- <div class="mod-download-icon js-download">-->
<!-- <a class="download clearfix" href="" target="_blank">-->
<!-- <span style="float: left;font-size: 13px;padding-top: 27px;padding-right: 10px;">金久信<br>-->
<!-- 手机站</span>-->
<!-- <img src="/public/upload/image/20210220/80705c8b12d05d0ff67a2758749ef09c.jpg"-->
<!-- style="height: 90px;width: 90px;float: left;">-->
<!-- </a>-->
<!-- </div>-->
</div>
</div>
</view>
@@ -86,27 +73,170 @@
name: "common-header",
data() {
return {
searchType: 0,
searchType: 1,
allChildCate: [],
searchList: [
{
type: 0,
name: '商品',
placeholder:'请输入品名 材质 规格 钢厂等搜索'
placeholder: '请输入商品名称等搜索',
page: '/pages/index/shop/shop'
},
{
type: 1,
name: '商户',
placeholder:'请输入商户名或公司名进行搜索'
}
]
name: '现货',
placeholder: '请输入品名 材质 规格 钢厂等搜索',
page: '/pages/spot/goods/goods'
},
{
type: 2,
name: '找供应',
placeholder: '请输入品名 材质 规格 钢厂等搜索',
page: '/pages/enquiry/list'
},
{
type: 3,
name: '找加工',
placeholder: '请输入品名 材质 规格 钢厂等搜索',
page: '/pages/process/list'
},
{
type: 4,
name: '旧货',
placeholder: '请输入品名 材质 规格 钢厂等搜索',
page: '/pages/index/old/old'
},
],
keyword: null,
currentPage: '',
spotCateList: [],
enquiryCateList: [],
processCateList: [],
oldCateList: [],
goodsCateList: [],
};
},
methods: {
searchTypeChange(e) {
this.searchType = e
switch (e) {
case 0 : {
this.allChildCate = this.goodsCateList
}
break;
case 1 : {
this.allChildCate = this.spotCateList
}
break;
case 2 : {
this.allChildCate = this.enquiryCateList
}
break;
case 3 : {
this.allChildCate = this.processCateList
}
break;
case 4 : {
this.allChildCate = this.oldCateList
}
break;
}
},
search() {
this.$message('这是一条消息提示');
this.navTo(this.keyword)
},
getCateList() {
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.spotCateList = []
data.rows.forEach(item => {
item.children.forEach(child => {
this.spotCateList.push(child)
})
})
this.allChildCate = this.spotCateList
}
});
},
async getEnquiryCateList() {
vk.callFunction({
url: 'client/enquiry/template/pub/getList',
title: '请求中...',
data: {},
success: (data) => {
this.enquiryCateList = data.rows
}
});
},
async getProcessCateList() {
vk.callFunction({
url: 'client/process/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.processCateList = data.rows
}
});
},
async getOldCateList() {
vk.callFunction({
url: 'client/old/pub/getTree',
title: '请求中...',
data: {type: 1},
success: (data) => {
this.oldCateList = data.rows.map(item => {
item.children.forEach(child => {
delete child.children
})
return item
})
}
});
},
getGoodsCate() {
vk.callFunction({
url: 'client/goods/category/pub/getList'
}).then(res => {
this.goodsCateList = res.rows
})
},
navTo(keyword) {
if (this.searchType === 0) {
vk.navigateTo({
url: this.searchList[this.searchType].page + '?cateName=' + keyword
})
} else {
vk.navigateTo({
url: this.searchList[this.searchType].page + '?keyword=' + keyword
})
}
},
jump(url) {
vk.navigateTo({
url: url
})
}
},
mounted() {
this.getCateList()
this.getEnquiryCateList()
this.getProcessCateList()
this.getOldCateList()
this.getGoodsCate()
},
watch: {
$route({meta: {pagePath}}) {
this.currentPage = pagePath
if (this.currentPage.includes('shop')) this.searchType = 0
if (this.currentPage.includes('spot')) this.searchType = 1
if (this.currentPage.includes('enquiry')) this.searchType = 2
if (this.currentPage.includes('process')) this.searchType = 3
if (this.currentPage.includes('old')) this.searchType = 4
// console.log(this.currentPage.includes('process'), this.searchType)
}
}
}
+4 -2
View File
@@ -9,7 +9,7 @@
</div>
<ul class="CenteruserNav-menu">
<li class="" :class="[currentPage.includes('user') ? 'active' : '']"><a href="javascript:;"
<li class="" :class="[(currentPage.includes('user') && !currentPage.includes('school')) ? 'active' : '']"><a href="javascript:;"
@click="jump('/pages/user/user')">个人中心</a>
</li>
<li class="" :class="[currentPage.includes('buyer') ? 'active' : '']"><a href="javascript:;"
@@ -24,7 +24,9 @@
<li class="" :class="[currentPage.includes('contract') ? 'active' : '']"><a href="javascript:;"
@click="jump('/pages/contract/index')">合同管理</a>
</li>
<li><a href="javascript:;" @click="jump('/pages/article/list')">金久信学堂</a></li>
<li :class="[currentPage.includes('school') ? 'active' : '']"><a href="javascript:;"
@click="jump('/pages/user/school')">金久信学堂</a>
</li>
</ul>
</div>
</div>
@@ -0,0 +1,61 @@
<template>
<el-carousel :height="`${height}px`" :style="{width: width}" class="m-a">
<el-carousel-item v-for="(item, index) in list.swiper" :key="item" :style="{width: width}">
<image class="carousel-img" :src="item" mode="scaleToFill" :style="{width: width}" @click="onClick(index)"/>
</el-carousel-item>
</el-carousel>
</template>
<script>
export default {
name: "CommonSwiper",
props: {
page: {
type: String,
default: "index"
},
height: {
type: String | Number,
default: "500"
},
width: {
type: String,
default: "100%"
},
},
data() {
return {
list: []
}
},
methods: {
getList() {
vk.callFunction({
url: 'client/album/pub/list',
data: {
page: this.page
},
success: res => {
this.list = res
console.log(this.list)
}
})
},
onClick(index) {
if (this.list.companyId) vk.navigateTo(`/pages/yellowPage/info?id=${this.list.companyId}`)
}
},
mounted() {
this.getList()
}
}
</script>
<style lang="scss" scoped>
.carousel-img {
width: 100%;
height: 100%;
margin: 0 auto;
}
</style>
+38
View File
@@ -0,0 +1,38 @@
<template>
<view>
<template v-if="['doc', 'docx'].includes(item.split('.').pop())">
<file-word theme="outline" class="pointer" size="40" fill="#4a90e2" strokeLinecap="square"/>
</template>
<template v-else-if="['xls', 'xlsx'].includes(item.split('.').pop())">
<file-excel theme="outline" class="pointer" size="40" fill="#417505" strokeLinecap="square"/>
</template>
<template v-else-if="['pdf'].includes(item.split('.').pop())">
<file-pdf-one theme="outline" class="pointer" size="40" fill="#f5a623"
strokeLinecap="square"/>
</template>
<template v-else>
<el-image :src="item" style="width: 100px; height: 100px" fit="cover"
:preview-src-list="[item]"/>
</template>
</view>
</template>
<script>
import {FileExcel, FilePdfOne, FileWord} from "@icon-park/vue";
export default {
name: "file-type",
components: {FilePdfOne, FileExcel, FileWord},
props: {
item: {
type: String,
default: ''
}
},
data() {
return {}
},
methods: {
},
}
</script>
@@ -0,0 +1,172 @@
<template>
<view>
<template v-if="vk.getVuex('$user.userInfo.userLevel') < 3">
<div class="mt-20 text-main font-bold" v-if="!quoteExpiredAt || monthExpired">剩余报价次数:{{
remainQuoteNum
}}次
</div>
<div class="mt-20 text-main font-bold" v-else-if="quoteExpiredAt && !monthExpired">
报价包月过期时间:{{ dayjs(quoteExpiredAt).format('YYYY-MM-DD HH:mm:ss') }}
</div>
</template>
<el-dialog title="报价次数" :visible.sync="dialogVisible" width="50%">
<p>请选择购买模式</p>
<div class="flex justify-center items-center">
<div class="p-20 rounded m-20 shadow flex flex-col justify-center items-center flex-1 pointer"
:class="[buyQuoteMode === 'single' ? 'buy-quote-mode-active' : '']"
@click="buyQuoteMode = 'single'">
<p>单次购买</p>
<p>{{ amount ? amount : singleQuoteAmount }}元/次</p>
</div>
<div class="p-20 rounded m-20 shadow flex flex-col justify-center items-center flex-1 pointer"
:class="[buyQuoteMode === item._id ? 'buy-quote-mode-active' : '']"
:style="{cursor: 'not-allowed'}"
@click="buyQuoteMode = item._id" v-for="(item, index) in monthlyQuoteAmountList" :key="index">
<p>{{ item.name }}</p>
<p>{{ item.amount }}元</p>
</div>
</div>
<div class="mt-20 flex justify-start items-center"
v-if="vk.getVuex('$user.userInfo.userLevel') === 0 && buyQuoteMode !== 'single'">
<span>您还未成为会员,仅能单次购买。请</span>
<span class="text-main font-bold pointer mx-15 text-35" style="text-decoration: underline"
@click="toUpgrade">升级会员</span>
<span> ,可享受优惠报价套餐。</span>
</div>
<div class="mt-20 " v-if="!vk.getVuex('$user.userInfo.quoteExpiredAt')">
<span>剩余报价次数:</span>
<span class="text-main font-bold text-35">{{ remainQuoteNum }}</span>
<span>次</span>
</div>
<div class="mt-20 text-main font-bold" v-else>
报价包月过期时间:{{ dayjs(quoteExpiredAt).format('YYYY-MM-DD') }}
</div>
<div class="mt-20 flex justify-center items-center">
<el-button type="primary" :disabled="!buyQuoteMode || disabled" @click.native="doBuyQuote">确定
</el-button>
<el-button plain @click.native="cancel">取消</el-button>
</div>
</el-dialog>
</view>
</template>
<script>
import dayjs from "dayjs";
export default {
name: "quote-remain-num",
props: {
amount: Number,
type: String,
id: String,
},
data() {
return {
remainQuoteNum: 0,
quoteExpiredAt: null,
dialogVisible: false,
monthExpired: false,
buyQuoteMode: null,
disabled: false,
singleQuoteAmount: 1,
monthlyQuoteAmount: 10,
monthlyQuoteAmountList: []
}
},
methods: {
dayjs,
async getSingleQuoteAmount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '6587b034466d41a591df881c'
},
})
this.singleQuoteAmount = res.content
},
async getMonthlyAmount() {
const {rows} = await vk.callFunction({
url: 'client/quoteNumConfig/list/pub/list',
})
this.monthlyQuoteAmountList = rows
},
async doBuyQuote() {
const {data} = await vk.callFunction({
url: 'client/enquiry/quoteNum/kh/add',
data: {
buyQuoteMode: this.buyQuoteMode,
type: this.type,
id: this.id,
},
})
this.dialogVisible = false
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
},
cancel() {
this.dialogVisible = false
vk.navigateBack()
},
toUpgrade() {
this.dialogVisible = false
vk.navigateTo({
url: `/pages/user/user?menu=equity`
})
}
},
async mounted() {
await this.getSingleQuoteAmount()
await this.getMonthlyAmount()
vk.userCenter.getCurrentUserInfo({
success: async (data) => {
if (this.amount) {
const res = await vk.callFunction({
url: 'client/user/kh/getUserQuoteNumList',
data: {
type: this.type,
sheetId: this.id,
},
})
console.log('res', res.data)
if (!res.data) this.remainQuoteNum = 0
else this.remainQuoteNum = res.data.num
}
if (this.remainQuoteNum === 0) this.remainQuoteNum = data.userInfo.remainQuoteNum ? parseInt(data.userInfo.remainQuoteNum) : 0
this.quoteExpiredAt = data.userInfo.quoteExpiredAt ? dayjs(data.userInfo.quoteExpiredAt).format('YYYY-MM-DD HH:mm:ss') : null
this.monthExpired = dayjs(data.userInfo.quoteExpiredAt).isBefore(dayjs())
console.log('here', this.remainQuoteNum, this.quoteExpiredAt, vk.getVuex('$user.userInfo.userLevel'))
if (this.remainQuoteNum === 0 && (!this.quoteExpiredAt || dayjs(this.quoteExpiredAt).isBefore(dayjs())) && parseInt(vk.getVuex('$user.userInfo.userLevel')) < 3) {
this.$confirm('您的报价次数已用完/已过期,是否立即购买?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false,
closeOnPressEscape: false,
}).then(async () => {
this.dialogVisible = true
}).catch(() => {
vk.navigateBack()
})
}
}
});
},
watch: {
buyQuoteMode(val) {
if (vk.getVuex('$user.userInfo.userLevel') === 0) {
if (val === 'single') this.disabled = false
else this.disabled = true
}
}
}
}
</script>
<style scoped lang="scss">
.buy-quote-mode-active {
border: 1px solid #a92924;
background-color: #f1c7c7;
}
</style>
+4 -4
View File
@@ -10,7 +10,7 @@
<div class="item">
<i class="wag-icon"><img src="@/static/images/cl1.png"></i>
</div>
<span>找买家</span>
<span>下询价单</span>
</a>
</li>
<li class="side-add-cart"><a rel="nofollow" href="javascript:;"
@@ -18,7 +18,7 @@
<div class="item">
<i class="wag-icon"><img src="@/static/images/cl3.png"></i>
</div>
<span class="txt"> 进货单 </span>
<span class="txt"> 购物车 </span>
</a>
</li>
<li class="side-steel-kefu">
@@ -32,7 +32,7 @@
</a>
</li>
<li class="side-steel-counter">
<a rel="nofollow" href="/counter/index.html">
<a rel="nofollow" href="javascript:;" @click="navTo('/pages/stealCal/stealCal')">
<div class="item">
<i class="wag-icon"><img src="@/static/images/cl5.png"></i>
</div>
@@ -52,7 +52,7 @@
<div class="item">
<agreement theme="outline" size="16" fill="#666" strokeLinecap="square"/>
</div>
<span>签约宝</span>
<span>金久信签约宝</span>
</a>
</li>
+46 -14
View File
@@ -1,9 +1,10 @@
<template>
<view>
<view class=" text-center py-15" style="background-color: red; color: yellow">本站测试中,仅对 特约用户 开放部分功能测试,谢谢您的关注,敬请期待!</view>
<view class="group-wagbar">
<div class="group-inner">
<div class="mod-welcome">
<h5 class="welcome-item slogan js-slogan">欢迎来到金久信钢城首页!</h5>
<h5 class="welcome-item slogan js-slogan">欢迎来到金久信钢材供应链生态服务平台首页!</h5>
<div class="welcome-item login-register">
<navigator v-if="!vk.getVuex('$user.userInfo.nickname')" class="login js-top-bar-login"
@@ -22,6 +23,9 @@
class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>
<navigator url="/pages/contract/index?tab=sign">金久信签约宝</navigator>
</el-dropdown-item>
<el-dropdown-item>
<navigator url="/pages/user/user">个人中心</navigator>
</el-dropdown-item>
@@ -32,19 +36,16 @@
<navigator url="/pages/store/store">卖家中心</navigator>
</el-dropdown-item>
<el-dropdown-item>
<navigator url="/pages/process/my">我的加工</navigator>
</el-dropdown-item>
<el-dropdown-item>
<navigator url="/pages/user/school">金久信学堂</navigator>
<navigator url="/pages/order/order">订单管理</navigator>
</el-dropdown-item>
<el-dropdown-item>
<navigator url="/pages/contract/index">合同管理</navigator>
</el-dropdown-item>
<el-dropdown-item>
<navigator url="/pages/contract/index?tab=sign">签约宝</navigator>
<navigator url="/pages/process/my">我的加工</navigator>
</el-dropdown-item>
<el-dropdown-item>
<navigator url="/pages/user/order">订单管理</navigator>
<navigator url="/pages/user/school">金久信学堂</navigator>
</el-dropdown-item>
<el-dropdown-item command="logout">退出登录</el-dropdown-item>
</el-dropdown-menu>
@@ -101,14 +102,15 @@
</dl>
</div>
</li>
<li class="tool-item">
<li class="tool-item pos-r">
<a rel="nofollow" href="javascript:;" class="bar-title"
@click="navTo('/pages/user/user?menu=notice')"
>我的消息</a>
>我的消息({{ messageUnreadNum }})</a>
<div class="dot" v-if="messageUnreadNum > 0"></div>
</li>
<li class="tool-item2">
<a rel="nofollow" href="" class="bar-title" target="_blank"><span>客服服务热线:+86
0771-3923001</span></a>
<a rel="nofollow" href="javascript:;" class="bar-title"><span>客服服务热线:
{{ serviceContract }}</span></a>
</li>
</ul>
@@ -122,12 +124,24 @@
export default {
name: "top-bar",
data() {
return {};
return {
messageUnreadNum: 0,
serviceContract: '',
};
},
created() {
if (vk.getVuex('$user.userInfo._id')) {
this.getUnreadNum()
this.getServicePhone()
}
},
methods: {
async getUnreadNum() {
const {data} = await vk.callFunction({
url: 'client/message/kh/getUnreadCount',
});
this.messageUnreadNum = data
},
handleCommand(e) {
if (e == 'logout') {
this.logout()
@@ -153,8 +167,16 @@ export default {
}
});
})
},
async getServicePhone() {
const {content} = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '657d8fca55b337cfadbe1063'
}
})
this.serviceContract = content
},
}
}
</script>
@@ -167,4 +189,14 @@ export default {
color: #a92924;
}
}
.dot {
position: absolute;
right: 0;
top: 5px;
width: 10px;
height: 10px;
border-radius: 999px;
background-color: #a92924;
}
</style>
+18
View File
@@ -9,11 +9,29 @@
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<script>
(function () {
var mobileHost = 'm.jinjiuxinzg.cn';
var ua = navigator.userAgent || '';
var isMobile = /Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini|Mobile/i.test(ua) ||
(navigator.maxTouchPoints > 1 && window.innerWidth <= 768);
if (isMobile && location.hostname !== mobileHost) {
location.replace('https://' + mobileHost + '/');
}
})();
</script>
<title></title>
<meta name="keywords" content="金久信签约宝,金久信签约宝会员">
<meta name="description" content="金久信签约宝专注线上电子签约,金久信签约宝会员服务.致力于为您提供一站式金久信签约宝会员服务.">
<!--preload-links-->
<!--app-context-->
<!-- 配置H5的 web图标static/logo.png -->
<link rel="icon" href="./static/logo.png"/>
<script type="text/javascript" src="http://qzonestyle.gtimg.cn/qzone/openapi/qc_loader.js" data-appid="101415280"
data-redirecturi="http://127.0.0.1:8080/"
charset="utf-8"></script>
</head>
<body>
<div id="app"><!--app-html--></div>
+11 -1
View File
@@ -2,7 +2,7 @@
import Vue from 'vue'
import App from './App'
import store from './store'
import config from '@/app.config.js'
import config from './app.config.js'
// 引入 elementUI
import elementUI from "element-ui";
@@ -29,6 +29,16 @@ import vkAdminUI from 'vk-unicloud-admin-ui';
import 'vk-unicloud-admin-ui/theme/index.css';
Vue.use(vkAdminUI);
// 滑块
import dragVerify from 'vue-drag-verify2'
Vue.use(dragVerify);
import VueTianditu from "vue-tianditu";
Vue.use(VueTianditu, {
v: "4.0",
tk: "bfbc6bd9e85fcda67b62788705aa6427"
});
// 自动注册全局组件(必须加在Vue.use(vkAdminUI);的后面)
const modulesFiles = require.context('./components', true, /\.vue$/);
modulesFiles.keys().map((modulePath, index) => {
+1
View File
@@ -5,6 +5,7 @@
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
"sassImplementationName": "node-sass",
"app-plus" : {
"usingComponents" : true,
"nvueCompiler" : "uni-app",
+1069
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -21,12 +21,15 @@
"dependencies": {
"@icon-park/vue": "^1.4.2",
"@vant/area-data": "^1.5.1",
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^1.0.2",
"async-validator": "^4.2.5",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"crypto-js": "^4.2.0",
"dayjs": "^1.11.10",
"element-ui": "2.15.13",
"lodash": "^4.17.21",
"md5": "^2.3.0",
"normalize-wheel": "^1.0.1",
"request": "^2.88.2",
"resize-observer-polyfill": "^1.5.1",
@@ -39,6 +42,8 @@
"vue": "^2.7.15",
"vue-clipboard2": "^0.3.3",
"vue-cropper": "^0.6.4",
"vue-drag-verify2": "^1.2.0",
"vue-tianditu": "^1.2.11",
"vuedraggable": "^2.24.3",
"xe-utils": "^3.5.14"
},
+168 -120
View File
@@ -11,371 +11,419 @@
"style": {
"navigationBarTitleText": "404"
}
}
,{
"path" : "pages/auth/register/register",
"style" :
},
{
"path": "pages/auth/register/register",
"style": {
"navigationBarTitleText": "注册",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/auth/login/login",
"style" :
},
{
"navigationBarTitleText": "登录",
"path": "pages/auth/login/login",
"style": {
"navigationBarTitleText": "金久信签约宝_金久信签约宝会员登录",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/spot/release/release",
"style" :
},
{
"path": "pages/auth/login/wechat",
"style": {
"navigationBarTitleText": "微信登录",
"enablePullDownRefresh": false
}
},
{
"path": "pages/auth/login/wechat_test",
"style": {
"navigationBarTitleText": "微信登录",
"enablePullDownRefresh": false
}
},
{
"path": "pages/auth/login/qq",
"style": {
"navigationBarTitleText": "QQ登录",
"enablePullDownRefresh": false
}
},
{
"path": "pages/auth/login/find",
"style": {
"navigationBarTitleText": "找回密码",
"enablePullDownRefresh": false
}
},
{
"path": "pages/spot/release/release",
"style": {
"navigationBarTitleText": "发布现货",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/spot/goods/goods",
"style" :
},
{
"path": "pages/spot/goods/goods",
"style": {
"navigationBarTitleText": "现货市场",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/user/user",
"style" :
},
{
"path": "pages/user/user",
"style": {
"navigationBarTitleText": "个人中心",
"enablePullDownRefresh": false
}
},
{
"path": "pages/spot/goods/detail",
"style" :
{
"navigationBarTitleText" : "",
"style": {
"navigationBarTitleText": "现货详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/company/company",
"style" :
{
"style": {
"navigationBarTitleText": "黄页",
"enablePullDownRefresh": false
}
},
{
"path": "pages/enquiry/release",
"style" :
{
"style": {
"navigationBarTitleText": "发布询价",
"enablePullDownRefresh": false
}
},
{
"path": "pages/enquiry/list",
"style" :
{
"navigationBarTitleText" : "询价",
"style": {
"navigationBarTitleText": "找供应",
"enablePullDownRefresh": false
}
},
{
"path": "pages/enquiry/my",
"style" :
{
"style": {
"navigationBarTitleText": "我发布的询价单",
"enablePullDownRefresh": false
}
},
{
"path" : "pages/enquiry/detail",
"style" :
"path": "pages/enquiry/quote/my",
"style": {
"navigationBarTitleText": "我的报价",
"enablePullDownRefresh": false
}
},
{
"path": "pages/enquiry/detail",
"style": {
"navigationBarTitleText": "报价单详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/enquiry/quote",
"style" :
{
"style": {
"navigationBarTitleText": "填写报价单",
"enablePullDownRefresh": false
}
},
{
"path": "pages/contract/index",
"style" :
{
"style": {
"navigationBarTitleText": "合同管理",
"enablePullDownRefresh": false
}
},
{
"path" : "pages/process/list",
"style" :
"path": "pages/contract/certificate",
"style": {
"navigationBarTitleText": "司法调证",
"enablePullDownRefresh": false
}
},
{
"path": "pages/process/list",
"style": {
"navigationBarTitleText": "找加工",
"enablePullDownRefresh": false
}
},
{
"path": "pages/process/release",
"style" :
{
"style": {
"navigationBarTitleText": "发布找加工",
"enablePullDownRefresh": false
}
},
{
"path": "pages/process/quote",
"style" :
{
"style": {
"navigationBarTitleText": "加工报价",
"enablePullDownRefresh": false
}
},
{
"path" : "pages/process/detail",
"style" :
"path": "pages/process/quote/my",
"style": {
"navigationBarTitleText": "我的报价",
"enablePullDownRefresh": false
}
},
{
"path": "pages/process/detail",
"style": {
"navigationBarTitleText": "加工单详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/process/my",
"style" :
{
"style": {
"navigationBarTitleText": "我的加工单",
"enablePullDownRefresh": false
}
},
{
"path" : "pages/checkout/checkout",
"style" :
"path": "pages/process/factoryList",
"style": {
"navigationBarTitleText": "加工厂列表",
"enablePullDownRefresh": false
}
},
{
"path": "pages/checkout/checkout",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path": "pages/article/list",
"style" :
"style": {
"navigationBarTitleText": "金久信学堂",
"enablePullDownRefresh": false
}
},
{
"path": "pages/article/detail",
"style": {
"navigationBarTitleText": "金久信学堂",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/self-support/self-support",
"style" :
{
"style": {
"navigationBarTitleText": "金久信自营",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/self-support/companyQuote",
"style" :
{
"style": {
"navigationBarTitleText": "金久信自营",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/self-support/selectType",
"style" :
{
"style": {
"navigationBarTitleText": "金久信自营",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/self-support/productQuote",
"style" :
{
"style": {
"navigationBarTitleText": "金久信自营",
"enablePullDownRefresh": false
}
},
{
"path" : "pages/index/server/server",
"style" :
"path": "pages/index/self-support/costQuote",
"style": {
"navigationBarTitleText": "金久信自营",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/self-support/quote",
"style": {
"navigationBarTitleText": "金久信自营报价",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/server/server",
"style": {
"navigationBarTitleText": "平台服务",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/shop/shop",
"style" :
{
"navigationBarTitleText" : "",
"style": {
"navigationBarTitleText": "特产商城",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/old/old",
"style" :
{
"style": {
"navigationBarTitleText": "旧货交易",
"enablePullDownRefresh": false
}
},
{
"path" : "pages/index/old/list/list",
"style" :
"path": "pages/index/old/quote",
"style": {
"navigationBarTitleText": "旧货交易报价",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/old/quote/my",
"style": {
"navigationBarTitleText": "我的报价",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/old/list/list",
"style": {
"navigationBarTitleText": "旧货交易列表",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/shop/detail",
"style" :
{
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/shop/cart",
"style" :
{
"style": {
"navigationBarTitleText": "购物车",
"enablePullDownRefresh": false
}
},
{
"path": "pages/yellowPage/list",
"style" :
{
"navigationBarTitleText" : "",
"style": {
"navigationBarTitleText": "黄页列表",
"enablePullDownRefresh": false
}
},
{
"path": "pages/yellowPage/info",
"style" :
{
"navigationBarTitleText" : "",
"style": {
"navigationBarTitleText": "黄页详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/user/school",
"style" :
{
"style": {
"navigationBarTitleText": "金久信学堂",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/shop/pay",
"style" :
{
"style": {
"navigationBarTitleText": "订单支付",
"enablePullDownRefresh": false
}
},
{
"path" : "pages/user/order",
"style" :
{
"navigationBarTitleText" : "订单列表",
"enablePullDownRefresh" : false
}
},
{
"path": "pages/index/old/release",
"style" :
{
"style": {
"navigationBarTitleText": "旧货交易",
"enablePullDownRefresh": false
}
},
{
"path": "pages/store/store",
"style" :
{
"style": {
"navigationBarTitleText": "卖家中心",
"enablePullDownRefresh": false
}
},
{
"path": "pages/store/buyer",
"style" :
{
"style": {
"navigationBarTitleText": "买家中心",
"enablePullDownRefresh": false
}
},
{
"path": "pages/spot/goods/my",
"style" :
{
"navigationBarTitleText" : "",
"style": {
"navigationBarTitleText": "我的现货",
"enablePullDownRefresh": false
}
},
{
"path": "pages/order/order",
"style" :
{
"navigationBarTitleText" : "",
"style": {
"navigationBarTitleText": "订单管理",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/old/detail",
"style" :
{
"navigationBarTitleText" : "",
"style": {
"navigationBarTitleText": "旧货详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/otherArticle/list",
"style" :
{
"navigationBarTitleText" : "",
"style": {
"navigationBarTitleText": "文章列表",
"enablePullDownRefresh": false
}
},
{
"path": "pages/otherArticle/detail",
"style" :
{
"style": {
"navigationBarTitleText": "详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/otherArticle/noticeDetail",
"style" :
{
"style": {
"navigationBarTitleText": "详情",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/old/my",
"style" :
{
"style": {
"navigationBarTitleText": "我发布的旧货信息",
"enablePullDownRefresh": false
}
},
{
"path": "pages/stealCal/stealCal",
"style": {
"navigationBarTitleText": "钢材计算器",
"enablePullDownRefresh": false
}
},
{
"path": "pages/yellowPage/factory",
"style": {
"navigationBarTitleText": "加工商信息",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
+220
View File
@@ -0,0 +1,220 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>
<navigator style="display: inline-block;" url="/pages/article/list">金久信学堂</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item>金久信学堂详情</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="w-1200 m-a bg-white p-40">
<view class=" flex justify-between items-center">
<text class="text-50 font-bold">{{ info.name }}</text>
<view class="flex flex-col justify-center items-center">
<star @click.native="changeCollect" theme="outline" size="30" fill="#4a4a4a" strokeLinecap="square"
v-if="!hasCollect" class="pointer"/>
<star @click.native="changeCollect" theme="filled" size="30" fill="#d00243" strokeLinecap="square"
v-else class="pointer"/>
<text>{{ hasCollect ? '已收藏' : '收藏' }}</text>
</view>
</view>
<view class="mt-20 text-gray text-28 pb-20 border-bottom">{{ info._add_time_str }}</view>
<view class="mt-20 text-gray text-28 pb-20 border-bottom" v-if="userInfo">
<span>剩余</span>
<span class="mx-15 text-main font-bold">{{ userInfo.remainArticleDownloadNum }}</span>
<span>次下载次数</span>
</view>
<view class="py-20 border-bottom flex justify-start flex-col items-start " v-if="info.files">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
附件
</view>
</view>
</view>
<view class="flex justify-start items-start flex-wrap my-25">
<view class="mt-15 mr-15" v-for="(item, index) in info.files" :key="index">
<template v-if="['doc', 'docx'].includes(item.split('.').pop())">
<file-word theme="outline" class="pointer" size="100" fill="#4a90e2" strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else-if="['xls', 'xlsx'].includes(item.split('.').pop())">
<file-excel theme="outline" class="pointer" size="100" fill="#417505" strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else-if="['pdf'].includes(item.split('.').pop())">
<file-pdf-one theme="outline" class="pointer" size="100" fill="#f5a623"
strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else>
<el-image :src="item" style="width: 100px; height: 100px" fit="cover"
:preview-src-list="[item]"/>
</template>
</view>
</view>
</view>
<view v-html="info.content" class="mt-20"></view>
</view>
<gap height="50"/>
<common-footer></common-footer>
</view>
</template>
<script>
import {FileExcel, FilePdfOne, FileWord, Star} from "@icon-park/vue";
export default {
name: "detail",
components: {FileWord, FilePdfOne, FileExcel, Star},
data() {
return {
info: {
name: '',
content: ''
},
hasCollect: false,
userInfo: null,
}
},
onLoad(option) {
if (option.id) {
this.getInfo(option.id);
this.addView(option.id)
this.getUserInfo()
}
},
onShow() {
this.getUserInfo()
},
methods: {
async getInfo(id) {
this.info = await vk.callFunction({
url: `client/article/list/pub/getDetail`,
data: {id}
});
await this.checkCollect()
},
async getUserInfo() {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
this.userInfo = userInfo
},
addView(id) {
vk.callFunction({
url: `client/article/list/pub/addView`,
data: {id}
});
},
async openDownload(url) {
await this.getUserInfo()
if (this.userInfo.userLevel < 0) return this.$message.error('非会员,无法下载');
// else if (this.userInfo.userLevel === 0) {
const {data} = await vk.callFunction({
url: 'client/article/list/kh/check',
data: {
id: this.info._id,
}
})
if (!data) {
if (this.userInfo.remainArticleDownloadNum === 0) {
return this.$confirm(`下载次数不足,是否购买次数?`, '提示', {
cancelButtonText: '关闭',
}).then(async () => {
const {data} = await vk.callFunction({
url: 'client/order/kh/addDownloadOrder',
title: '请求中...',
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
})
} else {
this.$confirm(`将消耗1次下载次数,是否继续?`, '提示', {
cancelButtonText: '关闭',
}).then(async () => {
this.userInfo.remainArticleDownloadNum -= 1
// await this.getUserInfo()
vk.callFunction({
url: 'client/article/list/pub/addDownload',
data: {
id: this.info._id,
}
})
vk.callFunction({
url: 'client/user/kh/reduceDownloadNum',
})
vk.callFunction({
url: 'client/article/list/kh/addDownload',
data: {
id: this.info._id,
}
})
window.open(url)
})
}
} else {
window.open(url)
}
// } else {
// vk.callFunction({
// url: 'client/article/list/pub/addDownload',
// data: {
// id: this.info._id
// }
// })
// window.open(url)
// }
},
async checkCollect() {
const {data} = await vk.callFunction({
url: 'client/article/collect/kh/check',
data: {
articleId: this.info._id
},
});
this.hasCollect = data
},
changeCollect() {
this.hasCollect = !this.hasCollect
vk.callFunction({
url: 'client/article/collect/kh/changeCollect',
data: {
articleId: this.info._id
},
});
}
}
}
</script>
<style scoped lang="scss">
.form-title-wrap {
display: flex;
align-items: center;
justify-content: space-between;
.goods-info-title {
display: flex;
align-items: center;
justify-content: flex-start;
}
.form-title {
padding-left: 10px;
color: #A92924;
font-size: 18px;
line-height: 18px;
border-left: 4px solid #A92924;
}
}
</style>
+59 -52
View File
@@ -4,67 +4,77 @@
<common-header></common-header>
<category-bar></category-bar>
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<common-swiper page="article"/>
</view>
<view class="filter-outer">
<view class="cate">
<view class="item" :class="[activeCateIndex === 0 ? 'active' : '']"
@click="selectCate(0)">
<text class="title">{{ cateList[0].name }}</text>
<text class="remark mt-10">{{ cateList[0].remark }}</text>
<view class="item" v-for="(item, index) in cateList" :key="index" :class="[activeCateIndex === index ? 'active' : '']"
@click="selectCate(index)">
<text class="title">{{ item.name }}</text>
<text class="remark mt-10">{{ item.remark }}</text>
</view>
<view class="item" :class="[activeCateIndex === 1 ? 'active' : '']"
@click="selectCate(1)">
<text class="title">{{ cateList[1].name }}</text>
<text class="remark mt-10">{{ cateList[1].remark }}</text>
</view>
<view class="item" :class="[activeCateIndex === -1 ? 'active' : '']"
@click="selectCate(-1)">
<text class="title">乐邦团</text>
<text class="remark mt-10">可提问一些与钢材有关的专业知识问答</text>
</view>
<view class="item" :class="[activeCateIndex === 2 ? 'active' : '']"
@click="selectCate(2)">
<text class="title">{{ cateList[2].name }}</text>
<text class="remark mt-10">{{ cateList[2].remark }}</text>
</view>
<view class="item" :class="[activeCateIndex === -2 ? 'active' : '']"
@click="selectCate(-2)">
<text class="title">金久信风向标</text>
<text class="remark mt-10">平台客户可将宝贵意见和平台需要改进的意见在此发表</text>
</view>
<view class="item mt-20" @click="toMySchool">
<!-- <view class="item" :class="[activeCateIndex === 1 ? 'active' : '']"-->
<!-- @click="selectCate(1)">-->
<!-- <text class="title">{{ cateList[1].name }}</text>-->
<!-- <text class="remark mt-10">{{ cateList[1].remark }}</text>-->
<!-- </view>-->
<!-- <view class="item" :class="[activeCateIndex === -1 ? 'active' : '']"-->
<!-- @click="selectCate(-1)">-->
<!-- <text class="title">乐邦团</text>-->
<!-- <text class="remark mt-10">可提问一些与钢材有关的专业知识问答</text>-->
<!-- </view>-->
<!-- <view class="item" :class="[activeCateIndex === 1 ? 'active' : '']"-->
<!-- @click="selectCate(1)">-->
<!-- <text class="title">{{ cateList[1].name }}</text>-->
<!-- <text class="remark mt-10">{{ cateList[1].remark }}</text>-->
<!-- </view>-->
<!-- <view class="item" :class="[activeCateIndex === -2 ? 'active' : '']"-->
<!-- @click="selectCate(-2)">-->
<!-- <text class="title">金久信风向标</text>-->
<!-- <text class="remark mt-10">平台客户可将宝贵意见和平台需要改进的意见在此发表</text>-->
<!-- </view>-->
<view class="item mt-20" @click="navTo('/pages/user/school')">
<text class="title text-main">我的学堂</text>
<text class="remark mt-10">我上传和下载的文档</text>
</view>
</view>
<view class="content-wrap">
<el-input @keyup.enter.native="getContentList" clearable placeholder="关键字搜索" v-model="keyword">
<el-input @keyup.enter.native="getContentList()" clearable placeholder="关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="getContentList" type="primary" slot="append" style="border-radius: 0">搜索
<el-button @click="getContentList()" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
<view class="flex flex-col justify-start items-start pointer w-100p">
<view v-for="(item, index) in list" :key="index" class="content-item-wrap"
@click="openDownload(item._id, item.files[0])">
<file-word theme="outline" size="80" fill="#4a90e2" strokeLinecap="square"/>
@click="navTo(`/pages/article/detail?id=${item._id}`)">
<template v-if="item.files && item.files.length > 0">
<template v-if="['doc', 'docx'].includes(item.files[0].split('.').pop())">
<file-word theme="outline" class="pointer" size="80" fill="#4a90e2" strokeLinecap="square"/>
</template>
<template v-else-if="['xls', 'xlsx'].includes(item.files[0].split('.').pop())">
<file-excel theme="outline" class="pointer" size="80" fill="#417505" strokeLinecap="square"/>
</template>
<template v-else-if="['pdf'].includes(item.files[0].split('.').pop())">
<file-pdf-one theme="outline" class="pointer" size="80" fill="#f5a623" strokeLinecap="square"/>
</template>
<template v-else>
<el-image :src="item.files[0]" style="width: 100px; height: 100px" fit="cover"
:preview-src-list="[item.files]"/>
</template>
</template>
<view class="content">
<text class="title">{{ item.name }}</text>
<view class="desc">
<text class="item">{{ item._add_time_str }}</text>
<text class="item">{{ item.viewNum }}人浏览</text>
<text class="item">{{ item.downloadNum }}次下载</text>
<text class="item">{{ item.amount === 0 ? '免费下载' : `${item.amount}元下载` }}</text>
<!-- <text class="item">{{ item.amount === 0 ? '免费下载' : `${item.amount}元下载` }}</text>-->
<!-- <text class="item">{{ item._add_time_str }}</text>-->
</view>
</view>
</view>
<el-pagination @current-change="getContentList" background layout="prev, pager, next"
:total="total"></el-pagination>
</view>
</view>
</view>
@@ -74,16 +84,18 @@
</template>
<script>
import {FileWord} from '@icon-park/vue'
import {FilePdfOne, FileExcel, FileWord} from '@icon-park/vue'
export default {
name: "list",
components: {FileWord},
components: {FilePdfOne, FileExcel, FileWord},
data() {
return {
cateList: [],
activeCateIndex: 0,
list: [],
total: 0,
pageSize: 10,
keyword: null
}
},
@@ -99,30 +111,25 @@ export default {
this.activeCateIndex = index
this.getContentList()
},
async getContentList() {
const {rows} = await vk.callFunction({
async getContentList(pageIndex = 1) {
const {rows, total} = await vk.callFunction({
url: 'client/article/list/pub/getList',
data: {
pageIndex,
pageSize: this.pageSize,
parentId: this.cateList[this.activeCateIndex]._id,
keyword: this.keyword
}
})
this.list = rows
this.total = total
window.scrollTo({top: 0})
},
toMySchool() {
navTo(url) {
vk.navigateTo({
url: '/pages/user/school'
url
})
},
async openDownload(id, url) {
await vk.callFunction({
url: 'client/article/list/pub/addDownload',
data: {
id
}
})
window.open(url)
}
},
onLoad() {
this.getCateList()
+633
View File
@@ -0,0 +1,633 @@
<template>
<view>
<div class="outter-wrapper">
<div class="login-page">
<div class="header w-1180 flex-h-ac">
<a href="" class="zg-logo fl nuxt-link-active">
<img src="@/static/images/logo-small.png" alt="买卖钢材,上金久信">
</a>
</div>
<div class="main-container">
<div class="w-1180 flex-h-e">
<div class="login-container">
<h2 style="margin-bottom: 15px;">找回密码</h2>
<div id="from" action="">
<div class="tabContent">
<!--企业用户登录-->
<div class="login-con active" id="rc">
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_user"></i>
</div>
<input type="text" class="form-control" v-model="form1.mobile"
placeholder="请输入手机号" autocomplete="off">
</div>
<div class="input-group clear">
<input type="text" class="form-control" v-model="form1.code"
placeholder="请输入短信验证码" autocomplete="off"/>
<div @click="sendSmsCode" id="btnSendCode1" type="button"
class="btn-default" value="">{{ smsTips }}
</div>
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_password"></i>
</div>
<input type="password" class="form-control" v-model="form1.password"
placeholder="请输入新密码" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_password"></i>
</div>
<input type="password" class="form-control" v-model="form1.repassword"
placeholder="请再次输入新密码" autocomplete="off">
</div>
</div>
</div>
<div class="input-groupp clear">
<button @click="handleSubmit" type="submit" id="login" class="btnMarymt"
style="width: 100%;">确认密码
</button>
</div>
</div>
<div class="input-groupwp clear">
<navigator url="/pages/auth/register/register" style="float: left;text-align: left;">
免费注册新账号
</navigator>
<a href="javascript:;" style="float: right;text-align: right;">
<navigator url="/pages/auth/login/login" style="float: left;text-align: left;">
登录
</navigator>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</view>
</template>
<script>
var vk = uni.vk
let timer = null
let timeS = 60
export default {
data() {
return {
memberType: 'business', // business 企业 、、personal个人
loginMethod: 'username', // username 用户名 + 密码 、、mobile 手机号 + 验证码
smsTips: '获取验证码',
form1: {
mobile: '',
password: '',
repassword: '',
code: '',
username: ''
},
};
},
methods: {
handleSubmit() {
if (this.testForm()) {
const {
password,
mobile,
code
} = this.form1
vk.userCenter.resetPasswordByMobile({
data: {
password,
mobile,
code
},
success: (data) => {
// 成功后的逻辑
this.$message({
message: "密码重置成功",
type:'success'
})
vk.redirectTo({
url: '/pages/auth/login/login'
})
}
});
}
},
sendSmsCode() {
if (timer != null) {
return
}
vk.userCenter.sendSmsCode({
loading: false,
data: {
mobile: this.form1.mobile,
type: 'reset-pwd',
},
success: (data) => {
this.$message({
message: "验证码已发送",
type: 'success'
})
timeS = 60
timer = setInterval(() => {
timeS--
if (timeS <= 0) {
this.smsTips = "重新发送"
this.stopTimer()
} else {
this.smsTips = timeS + "秒"
}
}, 1000)
}
});
},
stopTimer() {
if (timer != null) {
clearInterval(timer)
timer = null
}
},
loginSuccess() {
uni.reLaunch({
url: '/'
})
},
testForm() {
const {
mobile, // 手机号
code, // 短信验证码4-8位
password, // 密码 6-20位
repassword, // 重复输入密码
} = this.form1;
// 手机号验证
if (!mobile || !/^1[3456789]\d{9}$/.test(mobile)) {
this.$message({
message: '手机号为空或格式不正确',
type: 'error'
})
return false
}
// 短信验证码验证
if (!code || !/^\d{4,8}$/.test(code)) {
// 短信验证码为空或格式不正确
// 处理错误逻辑
this.$message({
message: '短信验证码为空或格式不正确',
type: 'error'
})
return false
}
// 密码验证
if (!password || password.length < 6 || password.length > 20) {
// 密码为空或长度不符合要求
this.$message({
message: '密码长度不符合要求',
type: 'error'
})
return false
// 处理错误逻辑
}
// 重复输入密码验证
if (password !== repassword) {
// 两次输入的密码不一致
this.$message({
message: '两次输入的密码不一致',
type: 'error'
})
return false
// 处理错误逻辑
}
return true
},
},
onUnload() {
if (timer != null) {
clearInterval(timer)
timer = null
}
}
}
</script>
<style lang="scss" scoped>
@charset "utf-8";
.login-method {
display: flex;
justify-content: space-between;
font-size: 14px;
margin-bottom: 2px;
&-item {
color: #d0111a;
cursor: pointer;
}
}
.outter-wrapper {
background-color: #fff;
}
.zg-logo img {
width: 230px;
border: none;
}
.layout-common-footer {
text-align: center;
margin: 15px 0px 10px;
}
.layout-common-footer .copyright .link > a {
color: #666;
padding: 0 10px;
display: inline-block;
line-height: 2
}
.w-1180 {
width: 1200px;
margin: 0px auto;
box-sizing: border-box;
}
.flex-h-ac {
display: flex;
align-items: center;
}
.header {
height: 90px;
}
.main-container {
min-width: 1200px;
padding: 60px 0;
background: #e8f5fd url(/static/images/login-bg.jpg) 50% no-repeat;
}
.flex-h-e,
.flex-h-e-ac {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
.main-container .login-container {
width: 350px;
box-sizing: border-box;
padding: 30px 35px 30px;
background-color: #fff;
}
.login-container h2 {
text-align: center;
line-height: 2;
color: #000;
font-size: 25px;
margin-bottom: 25px;
}
.btnMarymt {
height: 48px;
line-height: 48px;
background: #a92924;
color: #fff !important;
text-align: center;
width: 100%;
background: linear-gradient(90deg, #f0242e, #d0111a);
font-size: 16px;
cursor: pointer;
text-align: center;
}
.btnMarymt:hover {
background: #f12d36
}
.input-group {
width: 100%;
height: 46px;
}
.input-group-addon {
}
.input-group .form-control {
flex: 1;
height: 100%;
border: none;
background: none;
margin-left: 12px;
outline: none;
font-size: 13px;
color: #333;
}
.input-group {
display: flex;
align-items: center;
border: 1px solid #d4d4d4;
margin-bottom: 15px;
position: relative;
}
.input-group-addon i {
background: url(/static/images/iconsmall.png) no-repeat center center;
width: 38px;
border-right: 1px solid #d4d4d4;
height: 26px;
overflow: hidden;
display: inline-block
}
.input-group-addon .icon_user {
background-position: -212px -35px;
}
.input-group-addon .icon_phone {
background-position: -212px -67px;
}
.input-group-addon .icon_password {
background-position: -212px -100px;
}
.input-group-addon .icon_yaoqingma {
background-position: -209px -318px;
}
.input-groupp {
width: 100%;
}
#btnSendCode1 {
position: absolute;
right: 1px;
top: 8px;
line-height: 31px;
color: #d0111a;
width: 79px;
text-align: center;
cursor: pointer;
border-left: 1px solid;
background: none;
font-size: 14px;
}
.input-group.focus {
background-color: #fff;
box-shadow: 0 2px 11px 0 rgba(0, 0, 0, .04)
}
.input-groupwp {
width: 100%;
text-align: center;
height: 60px;
line-height: 60px;
font-size: 14px;
margin-bottom: 10px;
}
.input-groupwpg a {
display: inline-block;
}
.input-groupwpg .dsf-wetChat i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -218px -132px;
}
.input-groupwpg .dsf-qq i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -216px -178px;
margin: 0px 24px;
}
.input-groupwpg .dsf-dx i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -215px -224px;
}
.threeBorder {
position: relative;
text-align: center;
}
.threeBorder:after {
content: '';
position: absolute;
z-index: 0;
bottom: 10px;
left: 10px;
width: 95%;
height: 1px;
border-bottom: 1px solid #CCCCCC;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
-webkit-transform-origin: 0 100%;
transform-origin: 0 100%;
}
.threeBorder span {
color: #888888;
background: #fff;
width: 90px;
margin: 0 auto;
z-index: 1002;
position: relative;
display: block;
}
.input-groupwpg {
width: 100%;
text-align: center;
height: 48px;
font-size: 14px;
margin-top: 22px;
}
.login-con {
display: none;
}
.input-grouptabs span {
color: #666;
cursor: pointer;
font-size: 16px;
line-height: 23px;
font-weight: normal;
display: inline-block;
padding: 0px 18px;
text-align: center;
margin: 0px auto;
}
.input-grouptabs {
text-align: center;
margin: 0px auto 30px;
width: 100%;
}
.input-grouptabs i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 25px;
height: 25px;
float: left;
margin-right: 5px;
}
.input-grouptabs .tab-active#normal i {
background-position: -218px -269px;
}
.input-grouptabs .tab-active#nopw i {
background-position: -218px -269px;
}
.input-grouptabs #normal i {
background-position: -218px -293px;
}
.input-grouptabs #nopw i {
background-position: -218px -293px;
}
.input-grouptabs span.tab-active {
color: #a92924
}
.active {
display: block;
}
.input-groupread {
height: 40px;
line-height: 30px;
width: 100%;
text-align: left;
}
.agreement_dialogs {
position: fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
width: 100%;
height: 100%;
z-index: 99999;
text-align: center;
display: none;
background-color: rgba(35, 35, 35, 0.4);
-webkit-transition: all 0.5s linear;
transition: all 0.5s linear;
}
.agreement_dialogs .dialog_lay_1syd {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
display: inline-block;
width: 750px;
color: #656565;
font-size: 12px;
line-height: 20px;
background-color: #fff;
text-align: left;
vertical-align: middle;
-webkit-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.agreement_dialogs .dialog_foot_1hHfr {
height: 80px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
border-top: 1px solid #d5d5d5;
margin: 0;
text-align: center;
}
.agreement_dialogs .dialog_minorBtn_1u8nf {
display: inline-block;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border: 1px #316ccb solid;
padding: 0 30px;
height: 40px;
background: #a92924;
background: linear-gradient(90deg, #f0242e, #d0111a);
line-height: 40px;
cursor: pointer;
font-size: 16px;
vertical-align: top;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
color: #fff;
border-color: #fff;
}
.agreement_titley {
height: 55px;
line-height: 55px;
font-size: 16px;
color: #666;
text-align: center;
border-bottom: 1px solid #d5d5d5;
font-weight: 400;
}
.agreement_content {
margin: 23px 32px;
}
.con-subhead {
font-size: 14px;
font-weight: 500;
color: #333;
margin-bottom: 16px;
}
.con-content {
height: 240px;
overflow-y: scroll;
line-height: 2;
font-size: 13px;
}
</style>
+102 -49
View File
@@ -12,19 +12,21 @@
<div class="login-container">
<h2 style="margin-bottom: 15px;">会员登录</h2>
<div id="from" action="">
<div class="input-grouptabs clear">
<span @click="memberType = 'business'"
:class="{'tab-active': memberType === 'business'}" class="nopassword" data-id="1"
id="nopw"><i></i>企业用户</span>
<span @click="memberType = 'personal'"
:class="{'tab-active': memberType === 'personal'}" class="normal" data-id="0"
id="normal"><i></i>个人用户</span>
</div>
<!-- <div class="input-grouptabs clear">-->
<!-- <span @click="memberType = 'business'"-->
<!-- :class="{'tab-active': memberType === 'business'}" class="nopassword"-->
<!-- data-id="1"-->
<!-- id="nopw"><i></i>企业用户</span>-->
<!-- <span @click="memberType = 'personal'"-->
<!-- :class="{'tab-active': memberType === 'personal'}" class="normal" data-id="0"-->
<!-- id="normal"><i></i>个人用户</span>-->
<!-- </div>-->
<!-- 账号密码登录 -->
<view class="login-method">
<view @click="loginMethod = 'username'" class="login-method-item">账号密码登录</view>
<view @click="loginMethod = 'mobile'" class="login-method-item">验证码登录</view>
</view>
<!-- <view class="login-method">-->
<!-- <view @click="loginMethod = 'username'" class="login-method-item">账号密码登录-->
<!-- </view>-->
<!-- <view @click="loginMethod = 'mobile'" class="login-method-item">验证码登录</view>-->
<!-- </view>-->
<div class="tabContent">
<!--企业用户登录-->
<div class="login-con active" id="rc">
@@ -60,29 +62,41 @@
<input type="text" class="form-control" v-model="form1.smsCode"
placeholder="请输入短信验证码" autocomplete="off"/>
<view @click="sendSmsCode" id="btnSendCode1" type="button"
class="btn-default" value="">{{smsTips}}</view>
class="btn-default" value="">{{ smsTips }}
</view>
</div>
</div>
</div>
<div class="my-25">
<drag-verify ref="dragVerify" :width="280" :isPassing.sync="isPassing"
text="请按住滑块拖动" successText="验证通过"
handlerIcon="el-icon-d-arrow-right" successIcon="el-icon-circle-check">
<i v-show="!isPassing" slot="textBefore" class="el-icon-lock"></i>
</drag-verify>
</div>
<div class="input-groupp clear">
<button @click="handleSubmit" type="submit" id="login" class="btnMarymt"
style="width: 100%;">立即登录</button>
style="width: 100%;">立即登录
</button>
</div>
</div>
<div class="input-groupwp clear">
<navigator url="/pages/auth/register/register" style="float: left;text-align: left;">免费注册新账号</navigator>
<a href="/user/find_pwd.html" style="float: right;text-align: right;">找回密码</a>
<navigator url="/pages/auth/register/register" style="float: left;text-align: left;">
免费注册新账号
</navigator>
<a href="javascript:;" style="float: right;text-align: right;">
<navigator url="/pages/auth/login/find" style="float: left;text-align: left;">
找回密码
</navigator>
</a>
</div>
<div class=" threeBorder"><span>第三方登录</span></div>
<div class="input-groupwpg clear">
<!-- <a href="" class="dsf-wetChat" title="微信"><i></i></a>-->
<a href="/user/qq_login.html" class="dsf-qq" title="QQ"><i></i></a>
<a href="javascript:;" @click="toWechat" class="dsf-wetChat" title="微信"><i></i></a>
<!-- <a href="javascript:;" @click="toQQ" class="dsf-qq" title="QQ"><i></i></a>-->
<!-- <a href="" class="dsf-dx" title="短信"><i></i></a>-->
</div>
</div>
@@ -95,6 +109,8 @@
</template>
<script>
import dayjs from "dayjs";
var vk = uni.vk
let timer = null
let timeS = 60
@@ -109,25 +125,31 @@
password: '',
smsCode: '',
username: ''
}
},
isPassing: false,
errNum: 0
};
},
methods: {
handleSubmit() {
let data = {}
if (!this.isPassing) return this.$message.error('请先完成滑块验证')
const {
username,
password,
mobile,
smsCode
} = this.form1
if (localStorage.getItem(username) && dayjs(localStorage.getItem(username)) > dayjs().unix()) {
const minute = dayjs(localStorage.getItem(username)).diff(dayjs(), 'minute')
return this.$message.error(`您的账户已锁定,请${minute}分钟后重试`)
}
let data = {}
if (this.loginMethod == 'username') {
if (this.loginMethod === 'username') {
data = {
username,
password
password,
// accountType: this.memberType === 'business' ? 2 : 1
}
vk.userCenter.login({
loading: false,
@@ -135,9 +157,20 @@
success: (data) => {
this.loginSuccess()
}
});
}).catch((err) => {
console.log(err.code, err.code === 10102, this.errNum)
if (err.code === 10102) {
if (this.errNum < 5) this.errNum += 1
else {
if (this.errNum === 4) {
this.$message.error(`您的账户已连错5次密码,请15分钟后重试`)
localStorage.setItem(username, dayjs().add(15, 'minute').unix())
}
}
}
// this.$refs.dragVerify.reset()
})
} else {
vk.userCenter.loginBySms({
loading: false,
data: {
@@ -147,10 +180,10 @@
success: (data) => {
this.loginSuccess()
}
});
}).catch(() => {
// this.$refs.dragVerify.reset()
})
}
},
sendSmsCode() {
if (timer != null) {
@@ -177,7 +210,6 @@
} else {
this.smsTips = timeS + "秒"
}
}, 1000)
}
});
@@ -187,13 +219,30 @@
clearInterval(timer)
timer = null
}
},
loginSuccess() {
uni.reLaunch({
url: '/'
})
}
},
async toQQ() {
// const redirect_uri = 'http://static-mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5.next.bspapp.com/#/pages/auth/login/qq'
const redirect_uri = 'https://tcb-nnexmh3j3i5hwh5-7caw62c422be-1252168680.tcloudbaseapp.com/#/pages/auth/login/qq'
const state = `jjx_` + (this.memberType === 'business' ? 2 : 1)
let url = `https://graph.qq.com/oauth2.0/authorize?response_type=code&state=${state}&client_id=101795826`
url += '&redirect_uri=' + encodeURIComponent(redirect_uri)
window.location.href = url
},
async toWechat() {
// const redirect_uri = 'https://tcb-nnexmh3j3i5hwh5-7caw62c422be-1252168680.tcloudbaseapp.com/#/pages/auth/login/wechat'
const redirect_uri = 'https://www.jinjiuxinzg.cn/#/pages/auth/login/wechat'
// const redirect_uri = 'https://tcb-nnexmh3j3i5hwh5-7caw62c422be-1252168680.tcloudbaseapp.com/#/pages/auth/login/wechat_test'
const state = `jjx_` + (this.memberType === 'business' ? 2 : 1)
let url = 'https://open.weixin.qq.com/connect/qrconnect?appid=wxf44c1b32124fe1d5'
url += '&redirect_uri=' + encodeURIComponent(redirect_uri)
url += `&response_type=code&scope=snsapi_login&state=${state}#wechat_redirect`
window.location.href = url
},
},
onUnload() {
if (timer != null) {
@@ -219,9 +268,9 @@
}
}
.outter-wrapper {
background-color: #fff;
background-color: #e8f5fd;
height: calc(100vh);
}
.zg-logo img {
@@ -231,7 +280,7 @@
.layout-common-footer {
text-align: center;
margin: 15px 0px 10px;
margin: 15px 0 10px;
}
.layout-common-footer .copyright .link > a {
@@ -243,7 +292,7 @@
.w-1180 {
width: 1200px;
margin: 0px auto;
margin: 0 auto;
box-sizing: border-box;
}
@@ -259,7 +308,8 @@
.main-container {
min-width: 1200px;
padding: 60px 0;
background: #e8f5fd url(/static/images/login-bg.jpg)50% no-repeat;
background: #850911 url(/static/images/logo-bg.jpg) no-repeat;
background-size: 1920px 990px;
}
.flex-h-e,
@@ -267,6 +317,7 @@
display: flex;
flex-direction: row;
justify-content: flex-end;
height: calc(100vh - 90px);
}
.main-container .login-container {
@@ -274,6 +325,7 @@
box-sizing: border-box;
padding: 30px 35px 30px;
background-color: #fff;
height: 500px;
}
.login-container h2 {
@@ -306,7 +358,8 @@
height: 46px;
}
.input-group-addon {}
.input-group-addon {
}
.input-group .form-control {
flex: 1;
@@ -402,7 +455,7 @@
height: 40px;
display: block;
background-position: -216px -178px;
margin: 0px 24px;
margin: 0 24px;
}
.input-groupwpg .dsf-dx i {
@@ -464,14 +517,14 @@
line-height: 23px;
font-weight: normal;
display: inline-block;
padding: 0px 18px;
padding: 0 18px;
text-align: center;
margin: 0px auto;
margin: 0 auto;
}
.input-grouptabs {
text-align: center;
margin: 0px auto 30px;
margin: 0 auto 30px;
width: 100%;
}
@@ -516,10 +569,10 @@
.agreement_dialogs {
position: fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
z-index: 99999;
+651
View File
@@ -0,0 +1,651 @@
<template>
<view>
<div class="outter-wrapper">
<div class="login-page">
<div class="header w-1180 flex-h-ac">
<a href="" class="zg-logo fl nuxt-link-active">
<img src="@/static/images/logo-small.png" alt="买卖钢材,上金久信">
</a>
</div>
<div class="main-container">
<div class="w-1180 flex-h-e">
<div class="login-container">
<h2 style="margin-bottom: 15px;">QQ登录</h2>
<template v-if="showBind">
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_user"></i>
</div>
<input v-model="form1.mobile" type="text" class="form-control" name="mobile"
placeholder="请输入手机号" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_phone"></i>
</div>
<input type="text" class="form-control" v-model="form1.smsCode" name="smsCode"
placeholder="请输入短信验证码" autocomplete="off"/>
<view @click="sendSmsCode" id="btnSendCode1" type="button"
class="btn-default" value="">{{ smsTips }}
</view>
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_password"></i>
</div>
<input type="password" class="form-control" v-model="form1.password" name="password"
placeholder="设置登录密码" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_password"></i>
</div>
<input type="password" class="form-control" v-model="form1.repassword"
placeholder="确认登录密码" autocomplete="off">
</div>
<div class="input-groupp clear">
<button @click="handleSubmit" type="submit" id="login" class="btnMarymt"
style="width: 100%;">绑定并登录
</button>
</div>
</template>
</div>
</div>
</div>
</div>
</div>
</view>
</template>
<script>
import {Loading} from "element-ui";
var vk = uni.vk
let timer = null
let timeS = 60
export default {
data() {
return {
showBind: false,
smsTips: '获取验证码',
form1: {
mobile: '',
password: '',
repassword: '',
smsCode: '',
username: ''
},
accountType: null
};
},
methods: {
handleSubmit() {
if (this.testForm()) {
vk.userCenter.bindMobile({
data: {
mobile: this.form1.mobile,
code: this.form1.smsCode,
},
success: () => {
vk.userCenter.resetPwd({
data: {
password: this.form1.password,
},
success: () => {
vk.redirectTo({url: '/pages/auth/login/login'})
}
})
}
})
}
},
sendSmsCode() {
if (timer != null) {
return
}
vk.userCenter.sendSmsCode({
loading: false,
data: {
mobile: this.form1.mobile,
type: 'bind',
},
success: (data) => {
this.$message({
message: "验证码已发送",
type: 'success'
})
timeS = 60
timer = setInterval(() => {
timeS--
if (timeS <= 0) {
this.smsTips = "重新发送"
this.stopTimer()
} else {
this.smsTips = timeS + "秒"
}
}, 1000)
}
});
},
stopTimer() {
if (timer != null) {
clearInterval(timer)
timer = null
}
},
loginSuccess() {
uni.reLaunch({
url: '/'
})
},
async loginByQQ(code, accountType) {
let loadingInstance1 = Loading.service({fullscreen: true, text: '登录中...'});
const res = await vk.callFunction({
url: 'user/pub/loginByQQ',
data: {code, accountType}
})
loadingInstance1.close()
if (res.code === 0) {
this.loading = false
if (!res.mobileConfirmed) {
this.showBind = !res.mobileConfirmed
this.accountType = parseInt(accountType)
} else this.loginSuccess()
}
},
testForm() {
const {
mobile, // 手机号
smsCode, // 短信验证码4-8位
password, // 密码 6-20位
repassword, // 重复输入密码
} = this.form1;
// 手机号验证
if (!mobile || !/^1[3456789]\d{9}$/.test(mobile)) {
this.$message({
message: '手机号为空或格式不正确',
type: 'error'
})
return false
}
// 短信验证码验证
if (!smsCode || !/^\d{4,8}$/.test(smsCode)) {
// 短信验证码为空或格式不正确
// 处理错误逻辑
this.$message({
message: '短信验证码为空或格式不正确',
type: 'error'
})
return false
}
// 密码验证
if (!password || password.length < 6 || password.length > 20) {
// 密码为空或长度不符合要求
this.$message({
message: '密码长度不符合要求',
type: 'error'
})
return false
// 处理错误逻辑
}
const reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]+$/
if (!reg.test(password)) {
this.$message({
message: '密码必须由数字和字母组成',
type: 'error'
})
return false
}
// 重复输入密码验证
if (password !== repassword) {
// 两次输入的密码不一致
this.$message({
message: '两次输入的密码不一致',
type: 'error'
})
return false
// 处理错误逻辑
}
return true
},
},
onLoad(options) {
if (options.state && options.state.includes('jjx')) {
this.loginByQQ(options.code, options.state.split('_')[1])
} else vk.redirectTo({url: '/pages/index/index'})
},
onUnload() {
if (timer != null) {
clearInterval(timer)
timer = null
}
}
}
</script>
<style lang="scss" scoped>
@charset "utf-8";
.login-method {
display: flex;
justify-content: space-between;
font-size: 14px;
margin-bottom: 2px;
&-item {
color: #d0111a;
cursor: pointer;
}
}
.outter-wrapper {
background-color: #fff;
}
.zg-logo img {
width: 230px;
border: none;
}
.layout-common-footer {
text-align: center;
margin: 15px 0px 10px;
}
.layout-common-footer .copyright .link > a {
color: #666;
padding: 0 10px;
display: inline-block;
line-height: 2
}
.w-1180 {
width: 1200px;
margin: 0px auto;
box-sizing: border-box;
}
.flex-h-ac {
display: flex;
align-items: center;
}
.header {
height: 90px;
}
.main-container {
min-width: 1200px;
padding: 60px 0;
background: #e8f5fd url(/static/images/login-bg.jpg) 50% no-repeat;
}
.flex-h-e,
.flex-h-e-ac {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
.main-container .login-container {
height: 530px;
width: 350px;
box-sizing: border-box;
padding: 30px 35px 30px;
background-color: #fff;
}
.login-container h2 {
text-align: center;
line-height: 2;
color: #000;
font-size: 25px;
margin-bottom: 25px;
}
.btnMarymt {
height: 48px;
line-height: 48px;
background: #a92924;
color: #fff !important;
text-align: center;
width: 100%;
background: linear-gradient(90deg, #f0242e, #d0111a);
font-size: 16px;
cursor: pointer;
text-align: center;
}
.btnMarymt:hover {
background: #f12d36
}
.input-group {
width: 100%;
height: 46px;
}
.input-group-addon {
}
.input-group .form-control {
flex: 1;
height: 100%;
border: none;
background: none;
margin-left: 12px;
outline: none;
font-size: 13px;
color: #333;
}
.input-group {
display: flex;
align-items: center;
border: 1px solid #d4d4d4;
margin-bottom: 15px;
position: relative;
}
.input-group-addon i {
background: url(/static/images/iconsmall.png) no-repeat center center;
width: 38px;
border-right: 1px solid #d4d4d4;
height: 26px;
overflow: hidden;
display: inline-block
}
.input-group-addon .icon_user {
background-position: -212px -35px;
}
.input-group-addon .icon_phone {
background-position: -212px -67px;
}
.input-group-addon .icon_password {
background-position: -212px -100px;
}
.input-group-addon .icon_yaoqingma {
background-position: -209px -318px;
}
.input-groupp {
width: 100%;
}
#btnSendCode1 {
position: absolute;
right: 1px;
top: 8px;
line-height: 31px;
color: #d0111a;
width: 79px;
text-align: center;
cursor: pointer;
border-left: 1px solid;
background: none;
font-size: 14px;
}
.input-group.focus {
background-color: #fff;
box-shadow: 0 2px 11px 0 rgba(0, 0, 0, .04)
}
.input-groupwp {
width: 100%;
text-align: center;
height: 60px;
line-height: 60px;
font-size: 14px;
margin-bottom: 10px;
}
.input-groupwpg a {
display: inline-block;
}
.input-groupwpg .dsf-wetChat i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -218px -132px;
}
.input-groupwpg .dsf-qq i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -216px -178px;
margin: 0px 24px;
}
.input-groupwpg .dsf-dx i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -215px -224px;
}
.threeBorder {
position: relative;
text-align: center;
}
.threeBorder:after {
content: '';
position: absolute;
z-index: 0;
bottom: 10px;
left: 10px;
width: 95%;
height: 1px;
border-bottom: 1px solid #CCCCCC;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
-webkit-transform-origin: 0 100%;
transform-origin: 0 100%;
}
.threeBorder span {
color: #888888;
background: #fff;
width: 90px;
margin: 0 auto;
z-index: 1002;
position: relative;
display: block;
}
.input-groupwpg {
width: 100%;
text-align: center;
height: 48px;
font-size: 14px;
margin-top: 22px;
}
.login-con {
display: none;
}
.input-grouptabs span {
color: #666;
cursor: pointer;
font-size: 16px;
line-height: 23px;
font-weight: normal;
display: inline-block;
padding: 0px 18px;
text-align: center;
margin: 0px auto;
}
.input-grouptabs {
text-align: center;
margin: 0px auto 30px;
width: 100%;
}
.input-grouptabs i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 25px;
height: 25px;
float: left;
margin-right: 5px;
}
.input-grouptabs .tab-active#normal i {
background-position: -218px -269px;
}
.input-grouptabs .tab-active#nopw i {
background-position: -218px -269px;
}
.input-grouptabs #normal i {
background-position: -218px -293px;
}
.input-grouptabs #nopw i {
background-position: -218px -293px;
}
.input-grouptabs span.tab-active {
color: #a92924
}
.active {
display: block;
}
.input-groupread {
height: 40px;
line-height: 30px;
width: 100%;
text-align: left;
}
.agreement_dialogs {
position: fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
width: 100%;
height: 100%;
z-index: 99999;
text-align: center;
display: none;
background-color: rgba(35, 35, 35, 0.4);
-webkit-transition: all 0.5s linear;
transition: all 0.5s linear;
}
.agreement_dialogs .dialog_lay_1syd {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
display: inline-block;
width: 750px;
color: #656565;
font-size: 12px;
line-height: 20px;
background-color: #fff;
text-align: left;
vertical-align: middle;
-webkit-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.agreement_dialogs .dialog_foot_1hHfr {
height: 80px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
border-top: 1px solid #d5d5d5;
margin: 0;
text-align: center;
}
.agreement_dialogs .dialog_minorBtn_1u8nf {
display: inline-block;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border: 1px #316ccb solid;
padding: 0 30px;
height: 40px;
background: #a92924;
background: linear-gradient(90deg, #f0242e, #d0111a);
line-height: 40px;
cursor: pointer;
font-size: 16px;
vertical-align: top;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
color: #fff;
border-color: #fff;
}
.agreement_titley {
height: 55px;
line-height: 55px;
font-size: 16px;
color: #666;
text-align: center;
border-bottom: 1px solid #d5d5d5;
font-weight: 400;
}
.agreement_content {
margin: 23px 32px;
}
.con-subhead {
font-size: 14px;
font-weight: 500;
color: #333;
margin-bottom: 16px;
}
.con-content {
height: 240px;
overflow-y: scroll;
line-height: 2;
font-size: 13px;
}
</style>
+728
View File
@@ -0,0 +1,728 @@
<template>
<view>
<div class="outter-wrapper">
<div class="login-page">
<div class="header w-1180 flex-h-ac">
<a href="" class="zg-logo fl nuxt-link-active">
<img src="@/static/images/logo-small.png" alt="买卖钢材,上金久信">
</a>
</div>
<div class="main-container">
<div class="w-1180 flex-h-e">
<div class="login-container">
<h2 style="margin-bottom: 15px;">手机号绑定</h2>
<template v-if="showBind">
<div class="input-grouptabs clear">
<span @click="form1.accountType = 2"
:class="{'tab-active': form1.accountType === 2}" class="nopassword"
data-id="1"
id="nopw"><i></i>企业用户</span>
<span @click="form1.accountType = 1"
:class="{'tab-active': form1.accountType === 1}" class="normal" data-id="0"
id="normal"><i></i>个人用户</span>
</div>
<div v-show="form1.accountType === 1" class="input-group clear">
<div class="input-group-addon">
<i class="icon_yaoqingma"></i>
</div>
<input type="text" class="form-control" v-model="form1.nickname"
placeholder="请输入姓名" autocomplete="off">
</div>
<div v-show="form1.accountType === 2" class="input-group clear">
<div class="input-group-addon">
<i class="icon_yaoqingma"></i>
</div>
<input type="text" class="form-control" v-model="form1.nickname"
placeholder="请输入公司名称" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_user"></i>
</div>
<input v-model="form1.mobile" type="text" class="form-control" name="mobile"
placeholder="请输入手机号" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_phone"></i>
</div>
<input type="text" class="form-control" v-model="form1.smsCode" name="smsCode"
placeholder="请输入短信验证码" autocomplete="off"/>
<view @click="sendSmsCode" id="btnSendCode1" type="button"
class="btn-default" value="">{{ smsTips }}
</view>
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_password"></i>
</div>
<input type="password" class="form-control" v-model="form1.password" name="password"
placeholder="设置登录密码" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_password"></i>
</div>
<input type="password" class="form-control" v-model="form1.repassword"
placeholder="确认登录密码" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_yaoqingma"></i>
</div>
<input type="text" class="form-control" v-model="form1.inviteCode"
placeholder="请输入邀请码,选填" autocomplete="off">
</div>
<div class="input-groupread clear">
<el-checkbox v-model="agree"></el-checkbox>
<label class="ml-20">阅读并同意<a href="javascript:;" style="display: inline-block;"
@click="getInfo">
<span style="color: #3288b2">《金久信注册协议》</span></a></label>
</div>
<div class="input-groupp clear">
<button @click="handleSubmit" type="submit" id="login" class="btnMarymt"
style="width: 100%;">绑定
</button>
</div>
</template>
</div>
</div>
</div>
</div>
</div>
<el-dialog title="" :visible.sync="dialogVisible" width="40%">
<div v-html="info"></div>
</el-dialog>
</view>
</template>
<script>
import {Loading} from "element-ui";
var vk = uni.vk
let timer = null
let timeS = 60
export default {
data() {
return {
dialogVisible: false,
agree: false,
info: null,
showBind: false,
smsTips: '获取验证码',
form1: {
mobile: '',
password: '',
repassword: '',
smsCode: '',
username: '',
inviteCode: '',
accountType: 2,
nickname: '',
},
accountType: null,
code: null,
loginType: null,
uid: null
};
},
methods: {
async handleSubmit() {
if (!this.agree) {
this.$message({
message: '请先阅读并同意《金久信注册协议》',
type: 'warning'
})
return
}
if (this.testForm()) {
await vk.callFunction({
url: '/client/user/kh/updateLoginInfo',
data: {
uid: this.uid,
accountType: this.form1.accountType,
nickname: this.form1.nickname,
inviteCode: this.form1.inviteCode,
}
})
vk.userCenter.bindMobile({
data: {
mobile: this.form1.mobile,
code: this.form1.smsCode,
},
success: () => {
vk.userCenter.resetPwd({
data: {
password: this.form1.password,
},
success: async () => {
vk.redirectTo({url: '/pages/auth/login/login'})
}
})
}
})
}
},
sendSmsCode() {
if (timer != null) {
return
}
vk.userCenter.sendSmsCode({
loading: false,
data: {
mobile: this.form1.mobile,
type: 'bind',
},
success: (data) => {
this.$message({
message: "验证码已发送",
type: 'success'
})
timeS = 60
timer = setInterval(() => {
timeS--
if (timeS <= 0) {
this.smsTips = "重新发送"
this.stopTimer()
} else {
this.smsTips = timeS + "秒"
}
}, 1000)
}
});
},
stopTimer() {
if (timer != null) {
clearInterval(timer)
timer = null
}
},
loginSuccess() {
uni.reLaunch({url: '/'})
},
testForm() {
const {
mobile, // 手机号
smsCode, // 短信验证码4-8位
password, // 密码 6-20位
repassword, // 重复输入密码
nickname
} = this.form1;
// 手机号验证
if (!mobile || !/^1[3456789]\d{9}$/.test(mobile)) {
this.$message({
message: '手机号为空或格式不正确',
type: 'error'
})
return false
}
// 短信验证码验证
if (!smsCode || !/^\d{4,8}$/.test(smsCode)) {
// 短信验证码为空或格式不正确
// 处理错误逻辑
this.$message({
message: '短信验证码为空或格式不正确',
type: 'error'
})
return false
}
// 密码验证
if (!password || password.length < 6 || password.length > 20) {
// 密码为空或长度不符合要求
this.$message({
message: '密码长度不符合要求',
type: 'error'
})
return false
// 处理错误逻辑
}
const reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]+$/
if (!reg.test(password)) {
this.$message({
message: '密码必须由数字和字母组成',
type: 'error'
})
return false
}
// 重复输入密码验证
if (password !== repassword) {
// 两次输入的密码不一致
this.$message({
message: '两次输入的密码不一致',
type: 'error'
})
return false
// 处理错误逻辑
}
if (!nickname) {
return this.$message({
message: '请输入' + (this.form1.accountType === 2 ? '公司名称' : '您的姓名'),
type: 'error'
})
}
return true
},
async getInfo() {
const {content} = await vk.callFunction({
url: `client/otherArticle/list/pub/getDetail`,
data: {id: '65792dc8652341901b34a0bc'}
});
this.info = content
this.dialogVisible = true
}
},
async onLoad(options) {
if (options.state && options.state.includes('jjx')) {
this.form1.accountType = parseInt(options.state.split('_')[1])
if (options.code) {
this.code = options.code
const {uid, type, mobileConfirmed} = await vk.callFunction({
url: 'user/pub/loginByWeixin',
data: {
code: this.code,
accountType: this.form1.accountType,
},
})
this.uid = uid
this.showBind = type === "register"
if (mobileConfirmed) this.loginSuccess()
else this.showBind = true
} else {
this.showBind = !vk.getVuex('$user.userInfo.mobile')
}
} else this.loginSuccess()
},
onUnload() {
if (timer != null) {
clearInterval(timer)
timer = null
}
}
}
</script>
<style lang="scss" scoped>
@charset "utf-8";
.login-method {
display: flex;
justify-content: space-between;
font-size: 14px;
margin-bottom: 2px;
&-item {
color: #d0111a;
cursor: pointer;
}
}
.outter-wrapper {
background-color: #fff;
}
.zg-logo img {
width: 230px;
border: none;
}
.layout-common-footer {
text-align: center;
margin: 15px 0px 10px;
}
.layout-common-footer .copyright .link > a {
color: #666;
padding: 0 10px;
display: inline-block;
line-height: 2
}
.w-1180 {
width: 1200px;
margin: 0px auto;
box-sizing: border-box;
}
.flex-h-ac {
display: flex;
align-items: center;
}
.header {
height: 90px;
}
.main-container {
min-width: 1200px;
padding: 60px 0;
background: #e8f5fd url(/static/images/login-bg.jpg) 50% no-repeat;
}
.flex-h-e,
.flex-h-e-ac {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
.main-container .login-container {
height: 640px;
width: 350px;
box-sizing: border-box;
padding: 30px 35px 30px;
background-color: #fff;
}
.login-container h2 {
text-align: center;
line-height: 2;
color: #000;
font-size: 25px;
margin-bottom: 25px;
}
.btnMarymt {
height: 48px;
line-height: 48px;
background: #a92924;
color: #fff !important;
text-align: center;
width: 100%;
background: linear-gradient(90deg, #f0242e, #d0111a);
font-size: 16px;
cursor: pointer;
text-align: center;
}
.btnMarymt:hover {
background: #f12d36
}
.input-group {
width: 100%;
height: 46px;
}
.input-group-addon {
}
.input-group .form-control {
flex: 1;
height: 100%;
border: none;
background: none;
margin-left: 12px;
outline: none;
font-size: 13px;
color: #333;
}
.input-group {
display: flex;
align-items: center;
border: 1px solid #d4d4d4;
margin-bottom: 15px;
position: relative;
}
.input-group-addon i {
background: url(/static/images/iconsmall.png) no-repeat center center;
width: 38px;
border-right: 1px solid #d4d4d4;
height: 26px;
overflow: hidden;
display: inline-block
}
.input-group-addon .icon_user {
background-position: -212px -35px;
}
.input-group-addon .icon_phone {
background-position: -212px -67px;
}
.input-group-addon .icon_password {
background-position: -212px -100px;
}
.input-group-addon .icon_yaoqingma {
background-position: -209px -318px;
}
.input-groupp {
width: 100%;
}
#btnSendCode1 {
position: absolute;
right: 1px;
top: 8px;
line-height: 31px;
color: #d0111a;
width: 79px;
text-align: center;
cursor: pointer;
border-left: 1px solid;
background: none;
font-size: 14px;
}
.input-group.focus {
background-color: #fff;
box-shadow: 0 2px 11px 0 rgba(0, 0, 0, .04)
}
.input-groupwp {
width: 100%;
text-align: center;
height: 60px;
line-height: 60px;
font-size: 14px;
margin-bottom: 10px;
}
.input-groupwpg a {
display: inline-block;
}
.input-groupwpg .dsf-wetChat i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -218px -132px;
}
.input-groupwpg .dsf-qq i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -216px -178px;
margin: 0px 24px;
}
.input-groupwpg .dsf-dx i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -215px -224px;
}
.threeBorder {
position: relative;
text-align: center;
}
.threeBorder:after {
content: '';
position: absolute;
z-index: 0;
bottom: 10px;
left: 10px;
width: 95%;
height: 1px;
border-bottom: 1px solid #CCCCCC;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
-webkit-transform-origin: 0 100%;
transform-origin: 0 100%;
}
.threeBorder span {
color: #888888;
background: #fff;
width: 90px;
margin: 0 auto;
z-index: 1002;
position: relative;
display: block;
}
.input-groupwpg {
width: 100%;
text-align: center;
height: 48px;
font-size: 14px;
margin-top: 22px;
}
.login-con {
display: none;
}
.input-grouptabs span {
color: #666;
cursor: pointer;
font-size: 16px;
line-height: 23px;
font-weight: normal;
display: inline-block;
padding: 0px 18px;
text-align: center;
margin: 0px auto;
}
.input-grouptabs {
text-align: center;
margin: 0px auto 30px;
width: 100%;
}
.input-grouptabs i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 25px;
height: 25px;
float: left;
margin-right: 5px;
}
.input-grouptabs .tab-active#normal i {
background-position: -218px -269px;
}
.input-grouptabs .tab-active#nopw i {
background-position: -218px -269px;
}
.input-grouptabs #normal i {
background-position: -218px -293px;
}
.input-grouptabs #nopw i {
background-position: -218px -293px;
}
.input-grouptabs span.tab-active {
color: #a92924
}
.active {
display: block;
}
.input-groupread {
height: 40px;
line-height: 30px;
width: 100%;
text-align: left;
}
.agreement_dialogs {
position: fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
width: 100%;
height: 100%;
z-index: 99999;
text-align: center;
display: none;
background-color: rgba(35, 35, 35, 0.4);
-webkit-transition: all 0.5s linear;
transition: all 0.5s linear;
}
.agreement_dialogs .dialog_lay_1syd {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
display: inline-block;
width: 750px;
color: #656565;
font-size: 12px;
line-height: 20px;
background-color: #fff;
text-align: left;
vertical-align: middle;
-webkit-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.agreement_dialogs .dialog_foot_1hHfr {
height: 80px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
border-top: 1px solid #d5d5d5;
margin: 0;
text-align: center;
}
.agreement_dialogs .dialog_minorBtn_1u8nf {
display: inline-block;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border: 1px #316ccb solid;
padding: 0 30px;
height: 40px;
background: #a92924;
background: linear-gradient(90deg, #f0242e, #d0111a);
line-height: 40px;
cursor: pointer;
font-size: 16px;
vertical-align: top;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
color: #fff;
border-color: #fff;
}
.agreement_titley {
height: 55px;
line-height: 55px;
font-size: 16px;
color: #666;
text-align: center;
border-bottom: 1px solid #d5d5d5;
font-weight: 400;
}
.agreement_content {
margin: 23px 32px;
}
.con-subhead {
font-size: 14px;
font-weight: 500;
color: #333;
margin-bottom: 16px;
}
.con-content {
height: 240px;
overflow-y: scroll;
line-height: 2;
font-size: 13px;
}
</style>
+717
View File
@@ -0,0 +1,717 @@
<template>
<view>
<div class="outter-wrapper">
<div class="login-page">
<div class="header w-1180 flex-h-ac">
<a href="" class="zg-logo fl nuxt-link-active">
<img src="@/static/images/logo-small.png" alt="买卖钢材,上金久信">
</a>
</div>
<div class="main-container">
<div class="w-1180 flex-h-e">
<div class="login-container">
<h2 style="margin-bottom: 15px;">手机号绑定</h2>
<template v-if="showBind">
<div class="input-grouptabs clear">
<span @click="form1.accountType = 2"
:class="{'tab-active': form1.accountType === 2}" class="nopassword"
data-id="1"
id="nopw"><i></i>企业用户</span>
<span @click="form1.accountType = 1"
:class="{'tab-active': form1.accountType === 1}" class="normal" data-id="0"
id="normal"><i></i>个人用户</span>
</div>
<div v-show="form1.accountType === 1" class="input-group clear">
<div class="input-group-addon">
<i class="icon_yaoqingma"></i>
</div>
<input type="text" class="form-control" v-model="form1.nickname"
placeholder="请输入姓名" autocomplete="off">
</div>
<div v-show="form1.accountType === 2" class="input-group clear">
<div class="input-group-addon">
<i class="icon_yaoqingma"></i>
</div>
<input type="text" class="form-control" v-model="form1.nickname"
placeholder="请输入公司名称" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_user"></i>
</div>
<input v-model="form1.mobile" type="text" class="form-control" name="mobile"
placeholder="请输入手机号" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_phone"></i>
</div>
<input type="text" class="form-control" v-model="form1.smsCode" name="smsCode"
placeholder="请输入短信验证码" autocomplete="off"/>
<view @click="sendSmsCode" id="btnSendCode1" type="button"
class="btn-default" value="">{{ smsTips }}
</view>
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_password"></i>
</div>
<input type="password" class="form-control" v-model="form1.password" name="password"
placeholder="设置登录密码" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_password"></i>
</div>
<input type="password" class="form-control" v-model="form1.repassword"
placeholder="确认登录密码" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_yaoqingma"></i>
</div>
<input type="text" class="form-control" v-model="form1.inviteCode"
placeholder="请输入邀请码,选填" autocomplete="off">
</div>
<div class="input-groupread clear">
<el-checkbox v-model="agree"></el-checkbox>
<label class="ml-20">阅读并同意<a href="javascript:;" style="display: inline-block;"
@click="getInfo">
<span style="color: #3288b2">《金久信注册协议》</span></a></label>
</div>
<div class="input-groupp clear">
<button @click="handleSubmit" type="submit" id="login" class="btnMarymt"
style="width: 100%;">绑定
</button>
</div>
</template>
</div>
</div>
</div>
</div>
</div>
<el-dialog title="" :visible.sync="dialogVisible" width="40%">
<div v-html="info"></div>
</el-dialog>
</view>
</template>
<script>
import {Loading} from "element-ui";
var vk = uni.vk
let timer = null
let timeS = 60
export default {
data() {
return {
dialogVisible: false,
agree: false,
info: null,
showBind: false,
smsTips: '获取验证码',
form1: {
mobile: '',
password: '',
repassword: '',
smsCode: '',
username: '',
inviteCode: '',
accountType: 2,
nickname: '',
},
accountType: null,
code: null,
loginType: null,
uid: null
};
},
methods: {
async handleSubmit() {
if (!this.agree) {
this.$message({
message: '请先阅读并同意《金久信注册协议》',
type: 'warning'
})
return
}
if (this.testForm()) {
await vk.callFunction({
url: '/client/user/kh/updateLoginInfo',
data: {
uid: this.uid,
accountType: this.form1.accountType,
nickname: this.form1.nickname,
}
})
vk.userCenter.bindMobile({
data: {
mobile: this.form1.mobile,
code: this.form1.smsCode,
},
success: () => {
vk.userCenter.resetPwd({
data: {
password: this.form1.password,
},
success: async () => {
vk.redirectTo({url: '/pages/auth/login/login'})
}
})
}
})
}
},
sendSmsCode() {
if (timer != null) {
return
}
vk.userCenter.sendSmsCode({
loading: false,
data: {
mobile: this.form1.mobile,
type: 'bind',
},
success: (data) => {
this.$message({
message: "验证码已发送",
type: 'success'
})
timeS = 60
timer = setInterval(() => {
timeS--
if (timeS <= 0) {
this.smsTips = "重新发送"
this.stopTimer()
} else {
this.smsTips = timeS + "秒"
}
}, 1000)
}
});
},
stopTimer() {
if (timer != null) {
clearInterval(timer)
timer = null
}
},
loginSuccess() {
uni.reLaunch({url: '/'})
},
testForm() {
const {
mobile, // 手机号
smsCode, // 短信验证码4-8位
password, // 密码 6-20位
repassword, // 重复输入密码
nickname
} = this.form1;
// 手机号验证
if (!mobile || !/^1[3456789]\d{9}$/.test(mobile)) {
this.$message({
message: '手机号为空或格式不正确',
type: 'error'
})
return false
}
// 短信验证码验证
if (!smsCode || !/^\d{4,8}$/.test(smsCode)) {
// 短信验证码为空或格式不正确
// 处理错误逻辑
this.$message({
message: '短信验证码为空或格式不正确',
type: 'error'
})
return false
}
// 密码验证
if (!password || password.length < 6 || password.length > 20) {
// 密码为空或长度不符合要求
this.$message({
message: '密码长度不符合要求',
type: 'error'
})
return false
// 处理错误逻辑
}
// 重复输入密码验证
if (password !== repassword) {
// 两次输入的密码不一致
this.$message({
message: '两次输入的密码不一致',
type: 'error'
})
return false
// 处理错误逻辑
}
if (!nickname) {
return this.$message({
message: '请输入' + (this.form1.accountType === 2 ? '公司名称' : '您的姓名'),
type: 'error'
})
}
return true
},
async getInfo() {
const {content} = await vk.callFunction({
url: `client/otherArticle/list/pub/getDetail`,
data: {id: '65792dc8652341901b34a0bc'}
});
this.info = content
this.dialogVisible = true
}
},
async onLoad(options) {
// if (options.state && options.state.includes('jjx')) {
// this.form1.accountType = parseInt(options.state.split('_')[1])
// if (options.code) {
// this.code = options.code
// const {uid, type, mobileConfirmed} = await vk.callFunction({
// url: 'user/pub/loginByWeixin',
// data: {
// code: this.code,
// accountType: this.form1.accountType,
// },
// })
// this.uid = uid
// this.showBind = type === "register"
// if (mobileConfirmed) this.loginSuccess()
//
// } else {
// this.showBind = !vk.getVuex('$user.userInfo.mobile')
// }
// } else this.loginSuccess()
},
onUnload() {
if (timer != null) {
clearInterval(timer)
timer = null
}
}
}
</script>
<style lang="scss" scoped>
@charset "utf-8";
.login-method {
display: flex;
justify-content: space-between;
font-size: 14px;
margin-bottom: 2px;
&-item {
color: #d0111a;
cursor: pointer;
}
}
.outter-wrapper {
background-color: #fff;
}
.zg-logo img {
width: 230px;
border: none;
}
.layout-common-footer {
text-align: center;
margin: 15px 0px 10px;
}
.layout-common-footer .copyright .link > a {
color: #666;
padding: 0 10px;
display: inline-block;
line-height: 2
}
.w-1180 {
width: 1200px;
margin: 0px auto;
box-sizing: border-box;
}
.flex-h-ac {
display: flex;
align-items: center;
}
.header {
height: 90px;
}
.main-container {
min-width: 1200px;
padding: 60px 0;
background: #e8f5fd url(/static/images/login-bg.jpg) 50% no-repeat;
}
.flex-h-e,
.flex-h-e-ac {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
.main-container .login-container {
height: 640px;
width: 350px;
box-sizing: border-box;
padding: 30px 35px 30px;
background-color: #fff;
}
.login-container h2 {
text-align: center;
line-height: 2;
color: #000;
font-size: 25px;
margin-bottom: 25px;
}
.btnMarymt {
height: 48px;
line-height: 48px;
background: #a92924;
color: #fff !important;
text-align: center;
width: 100%;
background: linear-gradient(90deg, #f0242e, #d0111a);
font-size: 16px;
cursor: pointer;
text-align: center;
}
.btnMarymt:hover {
background: #f12d36
}
.input-group {
width: 100%;
height: 46px;
}
.input-group-addon {
}
.input-group .form-control {
flex: 1;
height: 100%;
border: none;
background: none;
margin-left: 12px;
outline: none;
font-size: 13px;
color: #333;
}
.input-group {
display: flex;
align-items: center;
border: 1px solid #d4d4d4;
margin-bottom: 15px;
position: relative;
}
.input-group-addon i {
background: url(/static/images/iconsmall.png) no-repeat center center;
width: 38px;
border-right: 1px solid #d4d4d4;
height: 26px;
overflow: hidden;
display: inline-block
}
.input-group-addon .icon_user {
background-position: -212px -35px;
}
.input-group-addon .icon_phone {
background-position: -212px -67px;
}
.input-group-addon .icon_password {
background-position: -212px -100px;
}
.input-group-addon .icon_yaoqingma {
background-position: -209px -318px;
}
.input-groupp {
width: 100%;
}
#btnSendCode1 {
position: absolute;
right: 1px;
top: 8px;
line-height: 31px;
color: #d0111a;
width: 79px;
text-align: center;
cursor: pointer;
border-left: 1px solid;
background: none;
font-size: 14px;
}
.input-group.focus {
background-color: #fff;
box-shadow: 0 2px 11px 0 rgba(0, 0, 0, .04)
}
.input-groupwp {
width: 100%;
text-align: center;
height: 60px;
line-height: 60px;
font-size: 14px;
margin-bottom: 10px;
}
.input-groupwpg a {
display: inline-block;
}
.input-groupwpg .dsf-wetChat i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -218px -132px;
}
.input-groupwpg .dsf-qq i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -216px -178px;
margin: 0px 24px;
}
.input-groupwpg .dsf-dx i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 50px;
height: 40px;
display: block;
background-position: -215px -224px;
}
.threeBorder {
position: relative;
text-align: center;
}
.threeBorder:after {
content: '';
position: absolute;
z-index: 0;
bottom: 10px;
left: 10px;
width: 95%;
height: 1px;
border-bottom: 1px solid #CCCCCC;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
-webkit-transform-origin: 0 100%;
transform-origin: 0 100%;
}
.threeBorder span {
color: #888888;
background: #fff;
width: 90px;
margin: 0 auto;
z-index: 1002;
position: relative;
display: block;
}
.input-groupwpg {
width: 100%;
text-align: center;
height: 48px;
font-size: 14px;
margin-top: 22px;
}
.login-con {
display: none;
}
.input-grouptabs span {
color: #666;
cursor: pointer;
font-size: 16px;
line-height: 23px;
font-weight: normal;
display: inline-block;
padding: 0px 18px;
text-align: center;
margin: 0px auto;
}
.input-grouptabs {
text-align: center;
margin: 0px auto 30px;
width: 100%;
}
.input-grouptabs i {
background: url(/static/images/iconsmall.png) no-repeat;
width: 25px;
height: 25px;
float: left;
margin-right: 5px;
}
.input-grouptabs .tab-active#normal i {
background-position: -218px -269px;
}
.input-grouptabs .tab-active#nopw i {
background-position: -218px -269px;
}
.input-grouptabs #normal i {
background-position: -218px -293px;
}
.input-grouptabs #nopw i {
background-position: -218px -293px;
}
.input-grouptabs span.tab-active {
color: #a92924
}
.active {
display: block;
}
.input-groupread {
height: 40px;
line-height: 30px;
width: 100%;
text-align: left;
}
.agreement_dialogs {
position: fixed;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
width: 100%;
height: 100%;
z-index: 99999;
text-align: center;
display: none;
background-color: rgba(35, 35, 35, 0.4);
-webkit-transition: all 0.5s linear;
transition: all 0.5s linear;
}
.agreement_dialogs .dialog_lay_1syd {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
display: inline-block;
width: 750px;
color: #656565;
font-size: 12px;
line-height: 20px;
background-color: #fff;
text-align: left;
vertical-align: middle;
-webkit-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.agreement_dialogs .dialog_foot_1hHfr {
height: 80px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
border-top: 1px solid #d5d5d5;
margin: 0;
text-align: center;
}
.agreement_dialogs .dialog_minorBtn_1u8nf {
display: inline-block;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border: 1px #316ccb solid;
padding: 0 30px;
height: 40px;
background: #a92924;
background: linear-gradient(90deg, #f0242e, #d0111a);
line-height: 40px;
cursor: pointer;
font-size: 16px;
vertical-align: top;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
color: #fff;
border-color: #fff;
}
.agreement_titley {
height: 55px;
line-height: 55px;
font-size: 16px;
color: #666;
text-align: center;
border-bottom: 1px solid #d5d5d5;
font-weight: 400;
}
.agreement_content {
margin: 23px 32px;
}
.con-subhead {
font-size: 14px;
font-weight: 500;
color: #333;
margin-bottom: 16px;
}
.con-content {
height: 240px;
overflow-y: scroll;
line-height: 2;
font-size: 13px;
}
</style>
+155 -57
View File
@@ -5,14 +5,15 @@
<category-bar></category-bar>
<div class="outter-wrapper">
<div class="login-page">
<div class="main-container">
<div class="main-container" :style="registerPageStyle">
<div class="w-1180 flex-h-e">
<div class="login-container">
<h2 style="margin-bottom: 15px;">免费注册会员</h2>
<view id="from" action="">
<div class="input-grouptabs clear">
<span @click="form1.accountType = 2"
:class="{'tab-active': form1.accountType === 2}" class="nopassword" data-id="1"
:class="{'tab-active': form1.accountType === 2}" class="nopassword"
data-id="1"
id="nopw"><i></i>企业用户</span>
<span @click="form1.accountType = 1"
:class="{'tab-active': form1.accountType === 1}" class="normal" data-id="0"
@@ -20,50 +21,16 @@
</div>
<div class="tabContent">
<div class="login-con active" id="rc">
<div class="input-group clear">
<div v-show="form1.accountType == 1" class="input-group clear">
<div class="input-group-addon">
<i class="icon_user"></i>
</div>
<input v-model="form1.mobile" type="text" class="form-control" name="mobile"
placeholder="请输入手机号" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_phone"></i>
</div>
<input type="text" class="form-control" v-model="form1.smsCode" name="smsCode"
placeholder="请输入短信验证码" autocomplete="off" />
<view @click="sendSmsCode" id="btnSendCode1" type="button"
class="btn-default" value="">{{smsTips}}</view>
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_password"></i>
</div>
<input type="password" class="form-control" v-model="form1.password" name="password"
placeholder="设置登录密码" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_password"></i>
</div>
<input type="password" class="form-control" v-model="form1.repassword"
placeholder="确认登录密码" autocomplete="off">
</div>
<div v-show="form1.accountType == 1" class="input-group clear">
<div class="input-group-addon">
<i class="icon_yaoqingma"></i>
</div>
<input type="text" class="form-control" v-model="form1.person.personName"
placeholder="请输入姓名" autocomplete="off">
placeholder="请输入姓名或昵称" autocomplete="off">
</div>
<div v-show="form1.accountType == 2" class="input-group clear">
<div class="input-group-addon">
<i class="icon_yaoqingma"></i>
<i class="icon_user"></i>
</div>
<input type="text" class="form-control" v-model="form1.company.companyName"
placeholder="请输入公司名称" autocomplete="off">
@@ -75,28 +42,86 @@
<input type="text" class="form-control" v-model="form1.inviteCode"
placeholder="请输入邀请码,选填" autocomplete="off">
</div>
<div class="input-group clear" style="margin-bottom: 0">
<div class="input-group-addon">
<i class="icon_password"></i>
</div>
<input type="password" class="form-control" v-model="form1.password"
name="password"
placeholder="设置登录密码" autocomplete="off">
</div>
<p class="tips mb-15 text-gray">6~20位的数字、字母组合</p>
<div class="input-group clear" style="margin-bottom: 0">
<div class="input-group-addon">
<i class="icon_password"></i>
</div>
<input type="password" class="form-control" v-model="form1.repassword"
placeholder="确认登录密码" autocomplete="off">
</div>
<p class="tips mb-15 text-gray">6~20位的数字、字母组合</p>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_phone"></i>
</div>
<input v-model="form1.mobile" type="text" class="form-control" name="mobile"
placeholder="请输入手机号" autocomplete="off">
</div>
<div class="input-group clear">
<div class="input-group-addon">
<i class="icon_phone"></i>
</div>
<input type="text" class="form-control" v-model="form1.smsCode"
name="smsCode"
placeholder="请输入短信验证码" autocomplete="off"/>
<view @click="sendSmsCode" id="btnSendCode1" type="button"
class="btn-default" value="">{{ smsTips }}
</view>
</div>
</div>
</div>
<div class="input-groupread clear">
<input id="check" type="checkbox" class="check" name="is_read">
<label>阅读并同意<a href="javascript:;" style="display: inline-block;"
id="register-xieyi">
<span style="color: #3288b2">《金久信注册协议》</span></a></label>
<el-checkbox v-model="agree" @click.native="clickAgree"
:disabled="!hasRead"></el-checkbox>
<label class="ml-20">已阅读并同意<a href="javascript:;" style="display: inline-block;"
@click="getInfo">
<span style="color: #3288b2">《用户协议和隐私政策》</span></a></label>
</div>
<div class="input-groupp clear">
<button @click="handleSubmit" type="button" class="btnMarymt"
style="width: 100%;">立即免费注册</button>
style="width: 100%;">立即免费注册
</button>
</div>
</view>
<div class="input-groupwp clear">
<navigator url="/pages/auth/login/login">已有账号?<span style="color: #a92924">去登录</span></navigator>
</div>
</div>
</div>
<navigator url="/pages/auth/login/login">已有账号?<span
style="color: #a92924">去登录</span></navigator>
</div>
<div class=" threeBorder"><span>第三方登录</span></div>
<div class="input-groupwpg clear">
<a href="javascript:;" @click="toWechat" class="dsf-wetChat" title="微信"><i></i></a>
<!-- <a href="javascript:;" @click="toQQ" class="dsf-qq" title="QQ"><i></i></a>-->
<!-- <a href="" class="dsf-dx" title="短信"><i></i></a>-->
</div>
</div>
</div>
</div>
</div>
</div>
<el-dialog title="" :visible.sync="dialogVisible" width="70%" :close-on-press-escape="false"
:close-on-click-modal="false" :show-close="false"
>
<div v-html="info"></div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogVisible = false;hasRead = true" :disabled="readCountDown > 0">确
定{{
readCountDown === 0 ? '' : `${readCountDown}秒`
}}
</el-button>
</div>
</el-dialog>
</view>
</template>
@@ -107,7 +132,8 @@
export default {
data() {
return {
dialogVisible: false,
agree: false,
smsTips: '点击获取',
form1: {
accountType: 2, // business 企业 、、personal个人
@@ -122,11 +148,22 @@
company: {
companyName: ''
}
}
},
info: null,
hasRead: false,
registerBgImage: '',
readCountDown: 10,
readInterval: null
};
},
onLoad(option) {
if (option.code) this.form1.inviteCode = option.code
this.loadSiteConfig()
},
computed: {
registerPageStyle() {
return this.registerBgImage ? {backgroundImage: `url(${this.registerBgImage})`} : {}
}
},
methods: {
sendSmsCode() {
@@ -153,12 +190,17 @@
} else {
this.smsTips = timeS + "秒"
}
}, 1000)
}
});
},
handleSubmit() {
if (!this.agree) {
this.$message({
message: '请先阅读并同意《金久信注册协议》',
type: 'warning'
})
} else {
if (this.testForm()) {
const {
mobile, // 手机号
@@ -181,7 +223,6 @@
accountType,
company,
person
},
success: (data) => {
uni.reLaunch({
@@ -191,7 +232,7 @@
}
});
}
}
},
testForm() {
const {
@@ -236,6 +277,15 @@
// 处理错误逻辑
}
const reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]+$/
if (!reg.test(password)) {
this.$message({
message: '密码必须由数字和字母组成',
type: 'error'
})
return false
}
// 重复输入密码验证
if (password !== repassword) {
// 两次输入的密码不一致
@@ -272,8 +322,53 @@
clearInterval(timer)
timer = null
}
},
async loadSiteConfig() {
try {
const {data = {}} = await vk.callFunction({
url: 'client/site_config/pub/detail',
loading: false
})
this.registerBgImage = data.registerPcBgImage || ''
} catch (e) {
this.registerBgImage = ''
}
},
navTo(url) {
vk.navigateTo({
url
})
},
async getInfo() {
const {content} = await vk.callFunction({
url: `client/otherArticle/list/pub/getDetail`,
data: {id: '65792dc8652341901b34a0bc'}
});
this.info = content
this.dialogVisible = true
this.readCountDown = 10
this.readInterval = setInterval(() => {
this.readCountDown--
if (this.readCountDown <= 0) {
clearInterval(this.readInterval)
}
}, 1000)
},
clickAgree(check) {
if (check && !this.hasRead) {
this.agree = false
return this.$message.error('请先阅读并同意《金久信注册协议》')
}
},
async toWechat() {
const redirect_uri = 'https://www.jinjiuxinzg.cn/#/pages/auth/login/wechat'
// const redirect_uri = 'https://tcb-nnexmh3j3i5hwh5-7caw62c422be-1252168680.tcloudbaseapp.com/#/pages/auth/login/wechat_test'
const state = `jjx_` + (this.memberType === 'business' ? 2 : 1)
let url = 'https://open.weixin.qq.com/connect/qrconnect?appid=wxf44c1b32124fe1d5'
url += '&redirect_uri=' + encodeURIComponent(redirect_uri)
url += `&response_type=code&scope=snsapi_login&state=${state}#wechat_redirect`
window.location.href = url
}
},
onUnload() {
if (timer != null) {
@@ -322,7 +417,9 @@
.main-container {
min-width: 1200px;
padding: 60px 0;
background: #e8f5fd url(/static/images/login-bg.jpg)50% no-repeat;
background: #850911 url(/static/images/logo-bg.jpg) no-repeat;
background-size: 1920px 990px;
background-position: center center;
}
.flex-h-e,
@@ -369,7 +466,8 @@
height: 46px;
}
.input-group-addon {}
.input-group-addon {
}
.input-group .form-control {
flex: 1;
@@ -571,7 +669,7 @@
}
.input-groupread {
height: 40px;
//height: 40px;
line-height: 30px;
width: 100%;
text-align: left;
+439
View File
@@ -0,0 +1,439 @@
<template>
<view class="">
<top-bar></top-bar>
<common-nav></common-nav>
<view class="w-1200">
<view class="certificate-container bg-white p-20">
<!-- 申请表格 -->
<div v-html="content"></div>
<!-- 出证样板选择 -->
<view class="form-item mb-20">
<view class="form-label">出证样板查看</view>
</view>
<!-- 出证方式 -->
<view class="form-item mb-20">
<view class="form-label">出证方式</view>
<view class="form-content">
<el-radio v-model="form.certificateType" label="normal">(正常)出证时效({{ amount }}元/份)</el-radio>
<el-radio v-model="form.certificateType" label="urgent">(加急)出证时效({{
urgentAmount
}}元/份)
</el-radio>
</view>
</view>
<!-- 发票类型 -->
<view class="form-item mb-20">
<view class="form-label">发票类型</view>
<view class="form-content">
<el-radio v-model="form.invoiceTypes" label="none">无需开具发票</el-radio>
<el-radio v-model="form.invoiceTypes" label="electronic">增值税专用发票(电子发票)</el-radio>
<el-radio v-model="form.invoiceTypes" label="normal">普票(电子发票)</el-radio>
</view>
</view>
<!-- 发票抬头 -->
<template v-if="form.invoiceTypes !== 'none'">
<view class="form-item mb-20">
<view class="form-label">发票抬头</view>
<view class="form-content">
<el-form :model="form.invoice" label-width="100px">
<el-form-item label="名称:" required>
<el-input v-model="form.invoice.companyName" placeholder="请输入企业名称或个人姓名"></el-input>
</el-form-item>
<el-form-item label="税号/证号:" required>
<el-input v-model="form.invoice.taxNumber" placeholder="请输入税号或身份证号"></el-input>
</el-form-item>
<el-form-item label="开户行:">
<el-input v-model="form.invoice.bankName"></el-input>
</el-form-item>
<el-form-item label="开户账号:">
<el-input v-model="form.invoice.bankAccount"></el-input>
</el-form-item>
<el-form-item label="联系电话:" required>
<el-input v-model="form.invoice.phone"></el-input>
</el-form-item>
</el-form>
</view>
</view>
<!-- 电子发票接收信息 -->
<!-- <view class="form-item mb-20">-->
<!-- <view class="form-label">电子发票接收信息</view>-->
<!-- <view class="form-content">-->
<!-- <el-form :model="form.electronicInvoice" label-width="100px">-->
<!-- <el-form-item label="收票人:" required>-->
<!-- <el-input v-model="form.electronicInvoice.receiver"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="手机号码:" required>-->
<!-- <el-input v-model="form.electronicInvoice.phone"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="邮箱:" required>-->
<!-- <el-input v-model="form.electronicInvoice.email"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- </view>-->
<!-- </view>-->
</template>
<!-- 出证交付方式 -->
<view class="form-item mb-20">
<view class="form-label">出证交付方式</view>
<view class="form-content">
<el-checkbox v-model="form.deliveryMethods.electronic" @change="selectEle">电子</el-checkbox>
<!-- <el-form v-if="form.deliveryMethods.electronic" :model="form.electronicDelivery" label-width="100px">-->
<!-- <el-form-item label="收件人姓名:" class="required">-->
<!-- <el-input v-model="form.electronicDelivery.receiver"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="手机号码:" class="required">-->
<!-- <el-input v-model="form.electronicDelivery.phone"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="收件邮箱:" class="required">-->
<!-- <el-input v-model="form.electronicDelivery.email"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<el-checkbox v-model="form.deliveryMethods.paper" @change="selectPaper">纸质邮寄</el-checkbox>
<el-form v-if="form.deliveryMethods.paper" :model="form.paperDelivery" label-width="100px">
<el-form-item label="收件人姓名:" class="required">
<el-input v-model="form.paperDelivery.receiver"></el-input>
</el-form-item>
<el-form-item label="手机号码:" class="required">
<el-input v-model="form.paperDelivery.phone"></el-input>
</el-form-item>
<el-form-item label="收件地址:" class="required">
<el-input v-model="form.paperDelivery.address" placeholder="请输入详细地址"></el-input>
</el-form-item>
</el-form>
</view>
</view>
<!-- 支付方式 -->
<view class="form-item mb-20">
<view class="form-label">支付方式</view>
<view class="form-content">
<el-radio v-model="form.paymentMethod" label="online">在线支付</el-radio>
<el-radio v-model="form.paymentMethod" label="advance">公对公支付</el-radio>
</view>
</view>
<view v-if="form.paymentMethod === 'advance'" v-html="bankAccount"></view>
<!-- 提交按钮 -->
<view class="text-center mb-20">
<el-button type="primary" @click="submitForm" v-if="form.paymentMethod === 'online'">提交支付</el-button>
<vk-data-upload v-else v-model="form.payVoucher" :cloudPathRemoveChinese="false" list-type="text"
:limit="1" button-text="上传付款记录"
accept=".jpg,.jpeg,.png" :on-success="uploadSuccess" ref="uploader"
:show-file-list="false">
</vk-data-upload>
</view>
<!-- 客服电话 -->
<view class="text-center">
<view class="service-phone">客服电话:400 686 5559</view>
</view>
</view>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
form: {
sampleSelected: false,
paidConfirm: false,
hasReport: false,
certificateType: 'normal',
lawPrice: '100',
agreementPrice: '150',
invoiceTypes: 'none',
invoice: {
companyName: '',
taxNumber: '',
bankName: '',
bankAccount: '',
phone: ''
},
electronicInvoice: {
receiver: '',
phone: '',
email: ''
},
deliveryMethods: {
electronic: true,
paper: false
},
electronicDelivery: {
receiver: '',
phone: '',
email: ''
},
paperDelivery: {
receiver: '',
phone: '',
address: ''
},
paymentMethod: 'online',
payVoucher: ''
},
contractId: null,
transactionId: null,
amount: null,
urgentAmount: null,
content: null,
bankAccount: null,
}
},
onLoad({contractId, transactionId,}) {
this.contractId = contractId;
this.transactionId = transactionId;
this.getContent()
this.getAmount()
this.getUrgentAmount()
this.getUserInfo()
this.getBankAccount()
},
methods: {
async getUserInfo() {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
this.form.invoice.companyName = userInfo.accountType === 2 ? userInfo.company.companyName : userInfo.person.personName
this.form.invoice.taxNumber = userInfo.accountType === 2 ? userInfo.company.organization : userInfo.person.idCard
this.form.invoice.phone = userInfo.accountType === 2 ? userInfo.company.mobile : userInfo.person.mobile
},
async getContent() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'e647148e684a458a0295b0a239c3d539'
},
})
this.content = res.content
},
async getAmount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'd77d384f684a47b6029a135220ecf4c9'
},
})
this.amount = res.content
},
async getUrgentAmount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '8524406c684a47c402985cb55941b3cb'
},
})
this.urgentAmount = res.content
},
uploadSuccess(response, file, fileList) {
this.form.payVoucher = response.url;
this.submitForm()
},
submitForm() {
// 表单验证
if (!this.validateForm()) {
return;
}
if (this.form.certificateType === 'normal') {
this.form.amount = this.amount;
} else {
this.form.amount = this.urgentAmount;
}
this.$confirm(`司法调证服务需向数据中心付费(${this.form.amount}元/次),是否继续?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
// 提交表单
this.form.contractId = this.contractId;
this.form.contractNo = this.transactionId;
vk.callFunction({
url: 'client/contract/kh/certificateAdd',
title: '提交中...',
data: this.form,
success: async (res) => {
this.$message({
message: '申请提交成功',
type: 'success'
});
if (this.form.paymentMethod === 'online') {
const {data} = await vk.callFunction({
url: 'client/contract/kh/buy',
title: '请求中...',
data: {
contractId: this.contractId,
contractNo: this.transactionId,
amount: this.form.amount
},
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
} else {
this.$message({
message: '请等待后台审核',
type: 'success'
});
setTimeout(() => {
vk.navigateTo({
url: `/pages/contract/index?tab=2`
})
}, 1500)
}
}
});
})
},
validateForm() {
// 验证必填项
// if (this.form.deliveryMethods.electronic) {
// if (!this.form.electronicDelivery.receiver) {
// this.$message.error('请填写电子发送邮箱的收件人姓名');
// return false;
// }
// if (!this.form.electronicDelivery.phone) {
// this.$message.error('请填写电子发送邮箱的手机号码');
// return false;
// }
// if (!this.form.electronicDelivery.email) {
// this.$message.error('请填写电子发送邮箱的收件邮箱');
// return false;
// }
// }
if (this.form.deliveryMethods.paper) {
if (!this.form.paperDelivery.receiver) {
this.$message.error('请填写纸质邮寄的收件人姓名');
return false;
}
if (!this.form.paperDelivery.phone) {
this.$message.error('请填写纸质邮寄的手机号码');
return false;
}
if (!this.form.paperDelivery.address) {
this.$message.error('请填写纸质邮寄的收件地址');
return false;
}
}
return true;
},
selectEle(e) {
if (e) {
this.form.deliveryMethods.electronic = true;
this.form.deliveryMethods.paper = false;
} else {
this.form.deliveryMethods.electronic = false;
this.form.deliveryMethods.paper = true;
}
},
selectPaper(e) {
if (!e) {
this.form.deliveryMethods.electronic = true;
this.form.deliveryMethods.paper = false;
} else {
this.form.deliveryMethods.electronic = false;
this.form.deliveryMethods.paper = true;
}
},
async getBankAccount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'b5ad93e068f343230344c7b63cb1aac5'
},
})
this.bankAccount = res.content
},
}
}
</script>
<style scoped lang="scss">
.w-1200 {
width: 1200px;
margin: 20px auto;
}
.certificate-container {
border-radius: 4px;
}
.title {
font-size: 24px;
font-weight: bold;
}
.certificate-table {
width: 100%;
table {
border-collapse: collapse;
width: 100%;
th, td {
border: 1px solid #dcdfe6;
padding: 8px;
text-align: center;
}
th {
background-color: #f5f7fa;
}
}
}
.notice {
border: 1px solid #dcdfe6;
padding: 10px;
border-radius: 4px;
.notice-title {
font-weight: bold;
margin-bottom: 5px;
}
.notice-item {
font-size: 14px;
line-height: 1.5;
color: #606266;
}
}
.form-item {
margin-bottom: 20px;
.form-label {
font-weight: bold;
margin-bottom: 10px;
}
.form-content {
padding: 0 20px;
}
}
.w-100 {
width: 100px;
}
.required ::v-deep .el-form-item__label:before {
content: '*';
color: #f56c6c;
margin-right: 4px;
}
.service-phone {
font-size: 16px;
font-weight: bold;
color: #333;
}
</style>
+1539 -98
View File
File diff suppressed because it is too large Load Diff
+87 -100
View File
@@ -1,6 +1,6 @@
<template>
<view class="border-bottom pt-20">
<el-form ref="form" :model="form1" label-width="80px" :rules="form1.props.rules">
<el-form ref="form" :model="form1" label-width="140px" :rules="form1.props.rules">
<view class="flex flex-wrap justify-start items-start">
<view class="w-25p">
<el-form-item label="商品名称">
@@ -15,49 +15,51 @@
</el-form-item>
</view>
<view class="w-25p" v-for="(item, index) in goodsAttributes" :key="index">
<el-form-item :label="item.label">
<el-select v-model="form1.data.model[item.label]" placeholder="请选择">
<template v-if="goodsAttributes && goodsAttributes.length > 0">
<el-form-item :label="item.label" v-if="item.label">
<el-select v-model="form1.data.model[index].value" placeholder="请选择">
<el-option
v-for="(item, index) in item.values"
:key="index"
:label="item"
:value="item">
v-for="(value, valueIndex) in item.values" :key="valueIndex" :label="value"
:value="value">
</el-option>
</el-select>
</el-form-item>
</template>
</view>
</view>
<el-row :gutter="10">
<el-col :span="10">
<el-form-item label="单件长度">
<el-input placeholder="请输入内容" v-model="form1.data.singleLength" class="input-with-select">
<el-select v-model="form1.data.singleLengthUnit" slot="append" placeholder="请选择">
<template v-if=" attributes.find(attr => attr.label === '单件长度')">
<el-option
v-for="(item, index) in attributes.find(attr => attr.label === '单件长度').options"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</template>
</el-select>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="材质">
<el-select v-model="form1.data.materialQuality" placeholder="请选择">
<template v-if=" attributes.find(attr => attr.label === '材质')">
<el-option
v-for="(item, index) in attributes.find(attr => attr.label === '材质').options"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</template>
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :span="10">-->
<!-- <el-form-item label="单件长度">-->
<!-- <el-input placeholder="请输入内容" v-model="form1.data.singleLength" class="input-with-select"-->
<!-- type="number">-->
<!-- <template slot="append">米</template>-->
<!--&lt;!&ndash; <el-select v-model="form1.data.singleLengthUnit" slot="append" placeholder="请选择">&ndash;&gt;-->
<!--&lt;!&ndash; <template v-if=" attributes.find(attr => attr.label === '单件长度')">&ndash;&gt;-->
<!--&lt;!&ndash; <el-option&ndash;&gt;-->
<!--&lt;!&ndash; v-for="(item, index) in attributes.find(attr => attr.label === '单件长度').options"&ndash;&gt;-->
<!--&lt;!&ndash; :key="index"&ndash;&gt;-->
<!--&lt;!&ndash; :label="item.label"&ndash;&gt;-->
<!--&lt;!&ndash; :value="item.value">&ndash;&gt;-->
<!--&lt;!&ndash; </el-option>&ndash;&gt;-->
<!--&lt;!&ndash; </template>&ndash;&gt;-->
<!--&lt;!&ndash; </el-select>&ndash;&gt;-->
<!-- </el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- <el-form-item label="尺寸">-->
<!-- <el-select v-model="form1.data.materialQuality" placeholder="请选择">-->
<!-- <template v-if=" attributes.find(attr => attr.label === '尺寸')">-->
<!-- <el-option-->
<!-- v-for="(item, index) in attributes.find(attr => attr.label === '尺寸').options"-->
<!-- :key="index"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </template>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="6">
<el-form-item label="交货服务">
<el-select v-model="form1.data.deliverService" placeholder="请选择">
@@ -72,24 +74,6 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="采购数量">
<el-input v-model="form1.data.procureNumber" class="input-with-select">
<el-select v-model="form1.data.procureUnit" slot="append" placeholder="请选择">
<template v-if=" attributes.find(attr => attr.label === '单位')">
<el-option
v-for="(item, index) in attributes.find(attr => attr.label === '单位').options"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</template>
</el-select>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="计价形式">
<el-select v-model="form1.data.pricingForm" placeholder="请选择">
@@ -106,53 +90,38 @@
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="6">
<el-form-item label="交货时限">
<el-date-picker
v-model="form1.data.deliveryTime"
type="date"
placeholder="选择日期">
</el-date-picker>
<el-col :span="12">
<el-form-item label="采购数量">
<el-input v-model="form1.data.procureNumber" class="input-with-select" type="number">
<el-select v-model="form1.data.procureUnit" slot="append" placeholder="请选择">
<template v-if=" attributes.find(attr => attr.label === '单位')">
<el-option
v-for="(item, index) in attributes.find(attr => attr.label === '单位').options"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</template>
</el-select>
</el-input>
</el-form-item>
</el-col>
<el-col :span="18">
<el-form-item label="交货地点" class="ml-10">
<el-row :gutter="10">
<el-col :span="5">
<el-select v-model="provinceIndex" placeholder="省" @change="selectProvince">
<el-option v-for="(item, index) in provinceData" :key="index" :value="index"
:label="item.name"/>
<!-- <span slot="prefix">省</span>-->
</el-select>
</el-col>
<el-col :span="5">
<el-select v-model="cityIndex" placeholder="市" @change="selectCity">
<template v-if="provinceIndex !== null">
<el-option v-for="(item, index) in cityData[provinceIndex]" :key="index"
:value="index"
:label="item.name"/>
<el-col :span="12">
<el-form-item label="装货、卸货费用承担">
<el-select v-model="form1.data.loadPaidBy" placeholder="请选择" style="width: 100%">
<template v-if="attributes.find(attr => attr.label === '装货、卸货费用承担')">
<el-option
v-for="(item, index) in attributes.find(attr => attr.label === '装货、卸货费用承担').options"
:key="index"
:label="item.label"
:value="item.label">
</el-option>
</template>
<!-- <span slot="prefix">市</span>-->
</el-select>
</el-col>
<el-col :span="5">
<el-select v-model="areaIndex" placeholder="区/县" @change="selectArea">
<template v-if="provinceIndex !== null && cityIndex !== null">
<el-option v-for="(item, index) in areaData[provinceIndex][cityIndex]"
:key="index" :value="index"
:label="item.name"/>
</template>
<!-- <span slot="prefix">区/县</span>-->
</el-select>
</el-col>
<el-col :span="8">
<el-input v-model="form1.data.addressDetail"
placeholder="详细地址或几公里范围内"></el-input>
</el-col>
</el-row>
</el-form-item>
</el-col>
</el-row>
</el-form>
</view>
</template>
@@ -183,6 +152,11 @@ export default {
},
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now();
},
},
provinceData: provinces,
cityData: citys,
areaData: areas,
@@ -211,6 +185,7 @@ export default {
deliverService: null,
standard: null,
pricingForm: null,
loadPaidBy: '供货方承担装车费用,采购方承担卸货费用',
deliveryTime: null,
len: null,
extraAttributes: {},
@@ -277,8 +252,6 @@ export default {
} else {
this.form1.props.columns[2].columns = []
}
}
},
{
@@ -499,6 +472,7 @@ export default {
getGoodsList() {
vk.callFunction({
url: 'client/enquiry/template/pub/getList',
pageSize: 500,
title: '请求中',
success: ({rows}) => {
this.goodsList = rows
@@ -506,10 +480,17 @@ export default {
})
},
selectGoods(val) {
this.form1.data.model = []
this.goodsList.forEach(({_id, name, extraAttributes}) => {
if (_id === val) {
this.form1.data.goodsName = name
this.goodsAttributes = extraAttributes
this.goodsAttributes.forEach(attr => {
if (attr.label) this.form1.data.model.push({
label: attr.label,
value: null
})
})
}
})
},
@@ -525,14 +506,20 @@ export default {
},
watch: {
"form1.data"(val) {
"form1.data": {
immediate: true,
handler(val) {
this.$emit('input', val)
console.log("this.$emit('input', val.data)");
}
},
value(val) {
value: {
immediate: true,
handler(val) {
this.form1.data = val
console.log("this.form1.data = val", val);
}
}
}
}
@@ -547,7 +534,7 @@ export default {
</style>
<style>
/deep/ .input-with-select .el-input-group__append {
::v-deep .input-with-select .el-input-group__append {
background-color: #fff !important;
width: 130px !important;
}
+550 -138
View File
@@ -16,12 +16,13 @@
<view class="page-main" v-if="sheet">
<view class="flex justify-between items-center">
<text class="text-gray">加工询价单编号:{{ sheet.orderNo }}</text>
<text class="text-gray">询价单编号:{{ sheet.enquiryNo }}</text>
<text class="text-gray">发布时间:{{ sheet._add_time_str }}</text>
</view>
<view class="my-25 flex justify-between items-center">
<view class="flex justify-start items-center">
<text class="text-40 font-bold">{{ sheet.title }}</text>
<el-tag type="success" v-if="sheet.tradeMethod === 0" size="small" class="ml-20">自主交易</el-tag>
<view class="ml-20 flex justify-start items-center">
<building-one theme="outline" size="24" fill="#a92924" strokeLinecap="square"/>
<view class="text-main ">
@@ -34,15 +35,15 @@
</view>
</view>
<view class="flex justify-end items-end"
v-if="sheet.answerEndTime && dayjs().diff(dayjs(sheet.answerEndTime), 'second') > 0">
v-if="sheet.answerEndTime && dayjs(sheet.answerEndTime).diff(dayjs(), 'second') > 0">
<text>距离报价结束还有:</text>
<view class="border-main countdown text-main">{{
dayjs().diff(dayjs(sheet.answerEndTime), 'day')
dayjs(sheet.answerEndTime).diff(dayjs(), 'day')
}}
</view>
<text>天</text>
<view class="border-main countdown text-main">
{{ (dayjs().diff(dayjs(sheet.answerEndTime), 'hour')) % 24 }}
{{ (dayjs(sheet.answerEndTime).diff(dayjs(), 'hour')) % 24 }}
</view>
<text>时</text>
</view>
@@ -50,19 +51,78 @@
<view class="my-25 flex justify-between items-center pb-20 border-bottom">
<view class="flex justify-start items-center">
<id-card theme="outline" size="24" fill="#a92924" strokeLinecap="square"/>
<text class="ml-15 text-gray">
<text class="ml-15 text-gray" v-if="sheet.user">
{{
sheet.user.accountType === 1 ? sheet.user.person.personName : sheet.user.company.companyName
sheet.user.accountType === 1 ? sheet.user.person.personName.replace(/^(.).*$/, "$1**") :
((sheet.user && sheet.user.company) ? sheet.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : '')
}}
</text>
</view>
<el-button type="primary" @click.native="toQuote"
v-if="vk.getVuex('$user.userInfo._id') !== sheet.userId && sheet.status === 0">我要报价
<template v-if="vk.getVuex('$user.userInfo._id') !== sheet.userId">
<el-button type="primary" disabled
v-if="sheet.status > 0">此询价单采购商已确认合作方,请您及时查看平台信息发布,及时报价,以免错过商机。
</el-button>
<el-button type="primary" @click.native="showDialog = true"
v-else-if="vk.getVuex('$user.userInfo._id') === sheet.userId">查看收到的申请报价
<el-button type="primary" @click.native="toQuote" :disabled="sheet.disabled"
v-else>{{
sheet.disabled ? '已超时无法报价' : '我要报价'
}}
</el-button>
</template>
<template v-else>
<el-button type="primary" @click.native="openQuoteDialog">查看收到的申请报价
</el-button>
</template>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
主要商品
</view>
</view>
</view>
<view class="mt-20" v-if="sheet.fillType === 1">{{
batchProductNames
}}
</view>
<view v-else class="mt-20">
<el-descriptions :title="item.goodsName" v-for="(item, index) in sheet.productList" :key="index"
class="pb-20 border-bottom">
<el-descriptions-item :label="model.label" v-for="(model, modelIndex) in item.model"
:key="modelIndex">{{ model.value }}
</el-descriptions-item>
<el-descriptions-item label="单价长度">{{
item.singleLength ? item.singleLength : ''
}}{{ item.singleLengthUnit ? item.singleLengthUnit : '' }}
</el-descriptions-item>
<el-descriptions-item label="交货服务">{{
item.deliverService ? item.deliverService : '无'
}}
</el-descriptions-item>
<el-descriptions-item label="采购数量">{{
item.procureNumber ? item.procureNumber : ''
}}{{ item.procureUnit ? item.procureUnit : '' }}
</el-descriptions-item>
<el-descriptions-item label="计价形式">{{
item.pricingForm ? item.pricingForm : '无'
}}
</el-descriptions-item>
<el-descriptions-item label="交货时限">{{
sheet.deliveryTime ? sheet.deliveryTime : '无'
}}
</el-descriptions-item>
<el-descriptions-item label="交货地点">{{
sheet.fullAddress
}}
</el-descriptions-item>
<el-descriptions-item label="装货、卸货费用承担">{{
item.loadPaidBy ? item.loadPaidBy : '无'
}}
</el-descriptions-item>
</el-descriptions>
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
@@ -71,13 +131,35 @@
</view>
</view>
</view>
<template v-if="sheet.files">
<view class="mt-15 mr-15" v-for="(item, index) in sheet.files" :key="index">
<el-image :src="item" style="width: 100px; height: 100px" fit="cover"
:preview-src-list="sheet.files"/>
<file-type :item="item" @click.native="openFile(item)"/>
</view>
</template>
<template v-if="sheet.multiFiles">
<view class="mt-15 mr-15" v-for="(item, index) in sheet.multiFiles" :key="index">
<template v-if="['doc', 'docx'].includes(item.split('.').pop())">
<file-word theme="outline" class="pointer" size="40" fill="#4a90e2" strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else-if="['xls', 'xlsx'].includes(item.split('.').pop())">
<file-excel theme="outline" class="pointer" size="40" fill="#417505" strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else-if="['pdf'].includes(item.split('.').pop())">
<file-pdf-one theme="outline" class="pointer" size="40" fill="#f5a623"
strokeLinecap="square"
@click.native="openDownload(item)"/>
</template>
<template v-else>
<el-image :src="item" style="width: 100px; height: 100px" fit="cover"
:preview-src-list="[item]"/>
</template>
</view>
</template>
</view>
<view class="item-wrap">
<view class="item-wrap" v-if="sheet.remark">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
@@ -92,14 +174,21 @@
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
纳税和税票
发票要求
</view>
</view>
</view>
<view class="mt-15">是否含税:{{ sheet.invoice ? '含税' : '不含税' }}</view>
<template v-if="sheet.invoice">
<view class="mt-15">开票时间:{{ WRITE_INVOICE_TIME[sheet.writeInvoiceTime] }}</view>
<view class="mt-15">发票种类:{{ INVOICE_TYPE[sheet.invoiceType] }}</view>
<view class="mt-15">其他要求:{{ sheet.invoiceOther }}</view>
<view class="mt-15" v-if="sheet.invoiceOther">税票要求:{{ sheet.invoiceOther }}</view>
<template v-else>
<view class="mt-15">纳税人身份:{{ sheet.taxType ? sheet.taxType : '无' }}</view>
<view class="mt-15">发票种类:{{ sheet.invoiceType ? sheet.invoiceType : '无' }}</view>
<view class="mt-15">税率:{{ sheet.taxRate ? sheet.taxRate : '无' }}</view>
</template>
</template>
</view>
<view class="item-wrap">
@@ -110,9 +199,28 @@
</view>
</view>
</view>
<view class="mt-15">随货资料:{{ sheet.transportDocuments.join() }}</view>
<view class="mt-15">其他要求:{{ sheet.otherTransportDocuments }}</view>
<view class="mt-15" v-if="sheet.transportDocuments && sheet.transportDocuments.length > 0">
随货资料:{{ sheet.transportDocuments.join() }}
</view>
<view class="mt-15" v-if="sheet.otherTransportDocuments">其他要求:{{
sheet.otherTransportDocuments
}}
</view>
<view class="mt-15">运输限制要求:{{ sheet.transportLimit ? '有' : '无' }}</view>
<view class="mt-15" v-if="sheet.transportLimit && sheet.otherTransportRequest">
运输限制说明:{{ sheet.otherTransportRequest }}
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
交易模式
</view>
</view>
</view>
<view class="mt-15">{{ sheet.tradeMethod === 0 ? '自主交易' : '金久信公证' }}</view>
</view>
<view class="item-wrap">
@@ -123,7 +231,13 @@
</view>
</view>
</view>
<view class="mt-15">付款方式:{{ PROCESS_PAY_METHOD[sheet.payMethod] }}</view>
<view class="mt-15">付款方式:{{ PROCESS_PAY_METHOD[sheet.payMethod] }}{{
sheet.payMethod === 0 ? `${sheet.advancePayRate}%货到付全款` : ''
}}{{
sheet.payMethod === 3 ? `${sheet.reputationPayDay}天` :
(sheet.payMethod === 4 ? `:${sheet.otherPayMethod}` : '')
}}
</view>
<view class="mt-15">报价形式:{{ sheet.offerType === 0 ? '整单报价' : '可分项报价' }}</view>
<view class="mt-15">报价期限:
<text v-if="sheet.answerStartTime && sheet.answerEndTime">{{
@@ -137,7 +251,82 @@
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
简易合同备注和其他补充条款
采购商信息
</view>
<text class="tip-text ml-10">(注册可查看信息)</text>
</view>
</view>
<view class="mt-15">项目名称:{{ sheet.projectName ? sheet.projectName : '' }}</view>
<view class="mt-15">项目地址:{{ sheet.fullAddress }}</view>
<template
v-if="isLoggedIn && (sheet.isMine || sheet.hasQuote || userInfo.userLevel > 0)">
<view class="mt-15" v-if="sheet.companyName">公司信息:{{
sheet.companyName ? sheet.companyName : ''
}}
</view>
<view class="mt-15" v-if="sheet.companyMobile">公司联系方式:{{
sheet.companyMobile ? sheet.companyMobile : ''
}}
</view>
<view class="mt-15">授权业务咨询人:{{
sheet.businessName ? sheet.businessName : ''
}}
</view>
<view class="mt-15">业务咨询联系方式:{{
sheet.businessMobile ? sheet.businessMobile : ''
}}
</view>
</template>
<template v-else>
<view class="mt-15" v-if="sheet.companyName">公司信息:{{
sheet.companyName ? sheet.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : ''
}}
</view>
<view class="mt-15" v-if="sheet.companyMobile">公司联系方式:{{
sheet.companyMobile ? sheet.companyMobile.replace(/^(.)(.)(.).*$/, "$1$2$3****") : ''
}}
</view>
<view class="mt-15">授权业务咨询人:{{
sheet.businessName ? sheet.businessName.replace(/^(.).*(.)$/, "$1***$2") : ''
}}
</view>
<view class="mt-15">业务咨询联系方式:{{
sheet.businessMobile ? sheet.businessMobile.replace(/^(.)(.)(.).*$/, "$1$2$3****") : ''
}}
</view>
</template>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
交易保证金要求
</view>
</view>
</view>
<view class="mt-15">{{ sheet.earnestMoney ? parseFloat(sheet.earnestMoney).toFixed(2) : '无' }}</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
签约模式
</view>
</view>
</view>
<view class="mt-15">{{
sheet.signMethod === 0 ? '线上签约-标准合同' : (sheet.signMethod !== 1 ? '线上签约-双方协商合同' : '线下签约')
}}
</view>
</view>
<view class="item-wrap" v-if="sheet.signMethod === 0">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
合同条款
</view>
</view>
</view>
@@ -157,21 +346,53 @@
<view class="mt-15">
本合同的全部内容由双方平等共同协商一致,共同起草制定,非一方事先拟定,不属于格式条款。本合同自双方签字盖章后生效(包括电子签字、盖章),按本合同内容地址、联系方式寄送的一切文书、函件送达与否,均为视为送达有法律效力,通知途径和本合同内联系方式或地址送达文件双方均予以验证。
</view>
<view class="mt-15">采购方补充条款: 供货方逾期供货承担采购方一切损失</view>
<view class="mt-15"> 供应方补充条款:</view>
<view class="mt-15">采购方补充条款: {{ sheet.supplementary }}</view>
<!-- <view class="mt-15">供应方补充条款:</view>-->
</view>
<template v-else-if="sheet.signMethod === 2">
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
合同附件
</view>
</view>
</view>
</view>
<view v-for="(item, index) in sheet.contractAttachment" :key="index" class="mr-25 my-25">
<file-type :item="item" @click.native="openFile(item)"/>
</view>
</template>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
已收到的加工申请
{{ sheet.quoteList.length }}家已报价
</view>
</view>
</view>
<!-- 报价列表 -->
<vk-data-table :data="sheet.quoteList" :columns="table1.columns" title="adasda "
:customRightBtns="table1.customRightBtns"></vk-data-table>
<!-- <vk-data-table :data="sheet.quoteList" :columns="table1.columns"-->
<!-- :customRightBtns="table1.customRightBtns"></vk-data-table>-->
</view>
<view class="item-wrap" v-if="spotAdList.length > 0">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
相关推荐
</view>
</view>
</view>
<view class="spot-ad-list">
<image v-for="(item, index) in spotAdList" :key="index"
@click="adJump(item)"
class="spot-ad-item pointer"
:src="item.swiper"
mode="aspectFill"/>
</view>
</view>
</view>
@@ -185,46 +406,81 @@
<view class="mt-15">
<view class="request-header">
<text class="flex-1">供应商</text>
<text class="flex-1">报价时间</text>
<text class="flex-1">{{ sheet.type === 2 && sheet.rentType === 1 ? '询价' : '报价' }}时间</text>
<text class="flex-1">联系方式</text>
<text class="flex-1">报价</text>
<text class="flex-1">{{ sheet.type === 2 && sheet.rentType === 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 sheet.quoteList" :key="index">
<text class="flex-1">{{ item.subjectName }}</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">{{ item.subjectMobile }}</text>
<text class="flex-1">{{ item.totalPrice }}元</text>
<text class="flex-1">{{ item.totalPrice }}{{ sheet.type === 2 && sheet.rentType === 1 ? '' : '元' }}</text>
<view class="flex-1">
<view class="mt-15 mr-15" v-for="(file, fileIndex) in item.files" :key="fileIndex">
<file-type :item="file" @click.native="previewFile(file)"/>
</view>
</view>
<text class="flex-1">{{ item.remark }}</text>
<text class="flex-1">{{ item.supplierExt ? item.supplierExt : '无' }}</text>
<text class="flex-1">
<el-button type="primary" v-if="sheet.status === 0" @click.native="confirm(item)">选择
</el-button>
<el-button type="primary" v-else>已选择供应商
</el-button>
</text>
</view>
</view>
</el-dialog>
<el-dialog title="图片预览" :visible.sync="showImagePreview" width="80%" append-to-body>
<img v-if="previewImageUrl" class="preview-image" :src="previewImageUrl" alt="附件预览"/>
</el-dialog>
</view>
</template>
<script>
import {BuildingOne, IdCard} from "@icon-park/vue";
import {BuildingOne, IdCard, FileWord, FileExcel, FilePdfOne} from "@icon-park/vue";
import dayjs from "dayjs";
import {WRITE_INVOICE_TIME, INVOICE_TYPE, PROCESS_PAY_METHOD} from '@/util'
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: {BuildingOne, IdCard},
components: {FileType, BuildingOne, IdCard, FileWord, FileExcel, FilePdfOne},
data() {
return {
userInfo: {
userLevel: 0
},
accountNum: 0,
spotAdList: [],
provinceData: provinces,
cityData: citys,
areaData: areas,
WRITE_INVOICE_TIME,
INVOICE_TYPE,
PROCESS_PAY_METHOD,
enquiryId: undefined,
showDialog: false,
showImagePreview: false,
previewImageUrl: '',
hasQuote: false,
productList: [],
sheetTitle: '',
sheet: {
user: {},
productList: [],
transportDocuments: []
transportDocuments: [],
quoteList: [],
files: [],
multiFiles: [],
otherCate: null,
contractAttachment: []
},
table1: {
// 表格数据
@@ -234,18 +490,7 @@ export default {
key: "subjectName",
title: "供应商",
type: "text",
width: 300,
formatter: (val, row, column, index) => {
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId) {
return val
}
if (row.accountType == 1) {
return vk.pubfn.hidden(val, 1, 1);
} else {
return vk.pubfn.hidden(val, 2, 4);
}
}
width: 300
},
{
key: "_add_time_str",
@@ -263,7 +508,7 @@ export default {
if (row.managerMobile) {
str = row.managerMobile
}
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId) {
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId || row.userId == vk.getVuex('$user.userInfo._id')) {
return str
}
return vk.pubfn.hidden(str, 3, 4);
@@ -279,103 +524,163 @@ export default {
if (row.managerMobile) {
str = row.managerMobile
}
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId) {
return val
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId || row.userId == vk.getVuex('$user.userInfo._id')) {
return `${val}元`
}
return "******";
}
},
{
key: "remark",
title: "详情",
type: "text",
formatter: (val, row, column, index) => {
let str = val
if (row.managerMobile) {
str = row.managerMobile
}
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId || row.userId == vk.getVuex('$user.userInfo._id')) {
return val
}
return "******";
}
}
],
customRightBtns: [
{
title: '合同',
type: 'primary',
icon: 'el-icon-search',
show: (row) => {
return vk.getVuex('$user.userInfo._id') == this.sheet.userId && row.status == 1
},
onClick: (item) => {
vk.navigateTo('/pages/contract/index');
},
},
{
title: '选择',
type: 'primary',
icon: 'el-icon-search',
show: (row) => {
return vk.getVuex('$user.userInfo._id') == this.sheet.userId && row.status == 0
},
onClick: (item) => {
vk.callFunction({
url: 'client/enquiry/quote/kh/confirmQuote',
title: '请求中...',
data: {
quoteId: item._id,
},
success: (data) => {
vk.navigateTo('/pages/contract/index');
}
});
},
},
{
title: '查看报价详情',
type: 'primary',
icon: 'el-icon-search',
disabled: (item) => {
return vk.getVuex('$user.userInfo._id') != this.sheet.userId
},
onClick: (item) => {
this.showDialog = true
}
},
]
},
};
},
onLoad(options = {}) {
const {
id
} = options
const {id} = options
if (!id) {
vk.navigateTo('/pages/enquiry/list');
return
}
this.enquiryId = id
this.getEnquiryDetail()
this.getUserInfo()
},
computed: {
isLoggedIn() {
return !!vk.getVuex('$user.userInfo._id')
},
batchProductNames() {
if (this.sheet.otherCate) return this.sheet.otherCate
return this.sheet.productList.map(item => item.goodsName + `${item.materialQuality ? `(${item.materialQuality})` : ''}`).join(',')
}
},
methods: {
dayjs,
normalizeSheet(data = {}) {
return {
user: {},
productList: [],
transportDocuments: [],
quoteList: [],
files: [],
multiFiles: [],
otherCate: null,
contractAttachment: [],
...data,
user: data.user || {},
productList: Array.isArray(data.productList) ? data.productList : [],
transportDocuments: Array.isArray(data.transportDocuments) ? data.transportDocuments : [],
quoteList: Array.isArray(data.quoteList) ? data.quoteList : [],
files: Array.isArray(data.files) ? data.files : [],
multiFiles: Array.isArray(data.multiFiles) ? data.multiFiles : [],
contractAttachment: Array.isArray(data.contractAttachment) ? data.contractAttachment : []
}
},
async getUserInfo() {
if (!this.isLoggedIn) return
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
this.userInfo = userInfo
this.accountNum = accountNum
},
/**
* 打开报价窗口
*/
toQuote() {
// 获取用户信息
vk.userCenter.getCurrentUserInfo({
success: (data) => {
const {
userInfo
} = data
if (userInfo.quoteTimes > 3) {
}
this.$confirm(`今日报价次数${userInfo.quoteTimes || 0}, 是否继续?`, '提示', {
openQuoteDialog() {
const h = this.$createElement
this.$confirm(h('div', {class: 'dialog-confirm-content'}, [
h('p', '1、请您谨慎点击"选择",选择供应商后,系统将自动关闭您此条询价信息,无法返回,只能再次发布询价信息;'),
h('p', '2、点击"选择"前,您可通过供应商联系方式,仔细商讨:商品明细、数量、单价、执行标准、交货方式、交货期、验收方式、合同条款等细节关键题确认,各种交易细节无误后要求供应商进行最终报价;'),
h('p', '3、您承诺对此次交易的内容用途已经完全了解并知悉经过严格仔细审核后实施,此次交易为合法经营,如违反相关法律规定,您将承担全部责任,与平台无关。您确认以上描述无误后请点击"选择"。')
]), '重点提示', {
confirmButtonText: '同意悉知',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.showDialog = true
}).catch(() => {})
},
openQuoteServiceFeeDialog() {
const rate = this.sheet.notaryServiceRate || 0.1
return this.$confirm(`提示着您成功签约交易,平台将收取总交易金额 ${rate}%服务费,如您存在利用系统漏洞恶意逃避支付服务费的情况,平台有将您的失信行为进行公布,情况严重的平台予以劝退。
并有权依法追回平台服务费。您承诺此次交易为合法经营,如违反相关法律法规您将承担全部任与平台无关。您已经完全理解并知悉,您不同意请点击'取消',取消报价,您同意以上约定请点击'同意并知悉'。`, '重要提示', {
confirmButtonText: '同意并知悉',
cancelButtonText: '取消',
type: 'warning'
})
},
/**
* 打开报价窗口
*/
async toQuote() {
if (!this.userInfo.fadadaConfirm || [-1, 2].includes(this.userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
center: true
}).then(res => {
vk.navigateTo('/pages/enquiry/quote?enquiryId=' + this.enquiryId);
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(this.userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (this.accountNum === 0) {
this.$confirm('请先到个人中心添加收款账户', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=account'});
})
} else {
if (this.userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
if (this.sheet.earnestMoney && this.sheet.earnestMoney > 0 && this.userInfo.paidEnsure < this.sheet.earnestMoney) {
this.$confirm('保证金不足,是否去充值保证金?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=grade'});
})
return
}
if (this.sheet.tradeMethod === 1) {
try {
await this.openQuoteServiceFeeDialog()
} catch (e) {
return
}
}
vk.navigateTo('/pages/enquiry/quote?enquiryId=' + this.enquiryId);
}
});
},
/**
* 获取询价单详情
@@ -388,27 +693,57 @@ export default {
_id: this.enquiryId
},
success: (res) => {
const {
productList
} = res.data
let title = []
productList.forEach(item => {
const keys = Object.keys(item.extraAttributes)
keys.forEach(citem => {
item.extraAttributes[citem] = JSON.parse(item.extraAttributes[
citem])
})
title.push(item.goodsName)
})
this.productList = productList
delete res.data.productList
this.sheet = {...res.data, ...{title: title.join()}}
this.sheet = this.normalizeSheet(res.data)
this.sheet.disabled = (!this.sheet.answerEndTime || dayjs(this.sheet.answerEndTime).isBefore(dayjs()))
this.sheet.fullAddress = ''
if (this.sheet.deliveryTime) this.sheet.deliveryTime = dayjs(this.sheet.deliveryTime).format('YYYY-MM-DD HH:mm:ss')
this.sheet.fullAddress = (this.sheet.addressRegion && this.sheet.addressRegion.province) ? `${this.sheet.addressRegion.province.name}${this.sheet.addressRegion.city.name}${this.sheet.addressRegion.area.name}` : ''
if (this.sheet.addressRegion && this.sheet.addressRegion.addressDetail) {
this.sheet.fullAddress += this.sheet.addressRegion.addressDetail
}
this.getSpotAd()
}
});
},
confirm(item) {
async getSpotAd() {
this.spotAdList = []
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 37,
spotGoodsId: this.enquiryId
}
})
if (res.data) this.spotAdList = res.data
},
adJump(item) {
if (item.spotGoodsId) {
if (item.spotGoodsId === this.enquiryId) return
vk.navigateTo(`/pages/enquiry/detail?id=${item.spotGoodsId}`)
} else if (item.type === 'goods' && item.goodsId) {
vk.navigateTo(`/pages/index/shop/detail?id=${item.goodsId}`)
} else if (item.companyId) {
vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)
}
},
showNotaryBusinessTip() {
this.$alert('请您先至个人中心-卖家中心-金久信公正银联资料,完成银联资料收集,并联系金久信客服开通功能。才能进行金久信公正交易', '温馨提示', {
confirmButtonText: '确定'
})
},
showNotaryServiceFeeTip(item) {
const rate = this.sheet.notaryServiceRate || 0.1
this.$confirm(`提示若您成功签约交易,平台将收取总交易金额 x${rate}%服务费,如您存在利用系统漏洞恶意逃避支付服务费的情况。
平台有将您的失信行为进行公布,情况严重的平台予以劝退。
并有权依法追回平台服务费。您承诺此次交易为合法经营,如违反相关法律法规您将承担全部任与平台无关。您己经完全理解并知悉,您不同意请点击“取消”,取消报价,您同意以上约定请点击“同意并知悉”。`, '温馨提示', {
confirmButtonText: '同意并知悉',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.doConfirm(item)
}).catch(() => {})
},
doConfirm(item) {
vk.callFunction({
url: 'client/enquiry/quote/kh/confirmQuote',
title: '请求中...',
@@ -416,21 +751,75 @@ export default {
quoteId: item._id,
},
success: (data) => {
vk.navigateTo('/pages/contract/index');
this.showDialog = false
if (this.sheet.signMethod === 0) vk.navigateTo('/pages/contract/index?tab=1')
else {
if (this.sheet.signMethod === 1) vk.navigateTo('/pages/store/buyer')
else vk.navigateTo('/pages/contract/index?tab=0')
}
this.$message({
type: 'success',
message: '报价确认成功'
})
}
});
},
confirm(item) {
if (this.sheet.tradeMethod === 1 && (!this.sheet.user || this.sheet.user.isNotaryBusiness !== 1)) {
this.showNotaryBusinessTip()
return
}
if (this.sheet.tradeMethod === 1) {
this.showNotaryServiceFeeTip(item)
return
}
this.doConfirm(item)
},
getFileExt(url = "") {
const cleanUrl = String(url).split("?")[0].split("#")[0]
const match = cleanUrl.match(/\.([a-z0-9]+)$/i)
return match ? match[1].toLowerCase() : ""
},
isImageFile(url) {
return ["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg"].includes(this.getFileExt(url))
},
isPdfFile(url) {
return this.getFileExt(url) === "pdf"
},
isOfficeFile(url) {
return ["doc", "docx", "xls", "xlsx", "ppt", "pptx"].includes(this.getFileExt(url))
},
getOfficePreviewUrl(url) {
return `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(url)}`
},
previewFile(url) {
if (!url) return
if (this.isImageFile(url)) {
this.previewImageUrl = url
this.showImagePreview = true
return
}
if (this.isPdfFile(url)) {
window.open(url, "_blank")
return
}
if (this.isOfficeFile(url)) {
window.open(this.getOfficePreviewUrl(url), "_blank")
return
}
window.open(url, "_blank")
},
openDownload(url) {
this.previewFile(url)
},
openFile(url) {
this.previewFile(url)
}
}
}
</script>
<style lang="scss" scoped>
@import "@/common/css/app.scss";
.page-main {
width: 1200px;
margin: 20px auto;
@@ -460,15 +849,19 @@ export default {
.form-title {
padding-left: 10px;
color: $--color-primary;
color: #A92924;
font-size: 18px;
line-height: 18px;
border-left: 4px solid $--color-primary;
border-left: 4px solid #A92924;
}
}
}
.tip-text {
color: #f56c6c;
}
.request-header {
border: 1px solid #EDEDED;
background-color: #FFF8F1;
@@ -496,4 +889,23 @@ export default {
text-align: center;
}
}
.spot-ad-list {
display: flex;
flex-wrap: wrap;
gap: 20px;
margin-top: 15px;
}
.spot-ad-item {
width: calc(50% - 10px);
height: 100px;
}
.preview-image {
display: block;
max-width: 100%;
max-height: 75vh;
margin: 0 auto;
}
</style>
+258 -246
View File
@@ -4,26 +4,15 @@
<common-header></common-header>
<category-bar></category-bar>
<!-- <view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
</el-breadcrumb>
</view> -->
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<common-swiper page="enquiry"/>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布询价单</el-button>
<el-button @click="toMyEnquiry" type="primary" round plain class="post-btn">我发布的询价单
</el-button>
<el-button @click="toMyQuote" type="primary" round plain class="post-btn">我的报价
</el-button>
</el-row>
</view>
</view>
@@ -33,76 +22,50 @@
<view class="filter-outer">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词:" class="border-bottom pb-30">
<el-input @keyup.enter.native="search(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
<el-input @keyup.enter.native="searchKeyword" clearable placeholder="输入关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="search(1)" type="primary" slot="append" style="border-radius: 0">搜索
<el-button @click="searchKeyword" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
</el-form-item>
<el-form-item label="分类:" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="clickedCateIndex = -1" class="pointer mr-25"
:class="[clickedCateIndex === -1 ? 'text-main selected-cate' : '']">全部
<text @click="selectAll" class="pointer mr-25"
:class="[checkCategoryList.length === 0 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in categoryTreeData" :key="index">
<text @click="clickedCateIndex = index" class="pointer mr-25"
:class="[clickedCateIndex === index ? 'text-main selected-cate' : '']"
v-if="index < 10">
<view v-for="(item, index) in allProductList" :key="index">
<text @click="selectCate(item.name)" class="pointer mr-25"
:class="[checkCategoryList.includes(item.name) ? 'text-main selected-cate' : '']">
{{ item.name }}
</text>
</view>
<text @click="selectCate(-2)" class="pointer mr-25"
:class="[checkCategoryList.includes(-2) ? 'text-main selected-cate' : '']">
其他
</text>
</view>
<view class="child-cate flex justify-start items-center flex-wrap">
<template v-if="clickedCateIndex === -1">
<text class="pointer mr-25" @click="selectCate(item._id)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in allChildCate" :key="index">{{ item.name }}
</text>
</template>
<template v-else>
<text class="pointer mr-25" @click="selectCate(item._id)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in categoryTreeData[clickedCateIndex].children" :key="index">
{{ item.name }}
</text>
</template>
<!-- <text @click="showAllTexture = !showAllTexture" class="pointer mr-25" >查看更多-->
<!-- <view class="child-cate flex justify-start items-center flex-wrap">-->
<!-- <template v-if="clickedCateIndex === -1">-->
<!-- <text class="pointer mr-25" @click="selectCate(item._id)"-->
<!-- :class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"-->
<!-- v-for="(item, index) in allChildCate" :key="index">{{ item.name }}-->
<!-- </text>-->
</view>
<!-- </template>-->
<!-- <template v-else-if="clickedCateIndex > -1">-->
<!-- <text class="pointer mr-25" @click="selectCate(item._id)"-->
<!-- :class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"-->
<!-- v-for="(item, index) in categoryTreeData[clickedCateIndex].children" :key="index">-->
<!-- {{ item.name }}-->
<!-- </text>-->
<!-- </template>-->
<!-- &lt;!&ndash; <text @click="showAllTexture = !showAllTexture" class="pointer mr-25" >查看更多&ndash;&gt;-->
<!-- &lt;!&ndash; </text>&ndash;&gt;-->
<!-- </view>-->
</el-form-item>
<el-form-item label="材质:" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectTexture(-1)" class="pointer mr-25"
:class="[checkTextureList.length === 0 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in attributes" :key="index">
<text @click="selectTexture(item.value)" class="pointer mr-25"
:class="[checkTextureList.includes(item.value) ? 'text-main selected-cate' : '']"
v-if="index < 10 || showAllTexture">
{{ item.name }}
</text>
</view>
<text @click="showAllTexture = !showAllTexture" class="pointer mr-25"
v-if="attributes.length > 10">查看更多
</text>
</view>
</el-form-item>
<el-form-item label="供应商:" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectCompany(-1)" class="pointer mr-25"
:class="[checkCompanyList.length === 0 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in companyList" :key="index">
<text @click="selectCompany(item._id)" class="pointer mr-25"
:class="[checkCompanyList.includes(item._id) ? 'text-main selected-cate' : '']"
v-if="index < 10 || showAllCompany">
{{ item.name }}
</text>
</view>
<text @click="showAllCompany = !showAllCompany" class="pointer mr-25"
v-if="companyList.length > 10">查看更多
</text>
</view>
<el-form-item label="区域筛选">
<el-cascader :options="areaOptions" :props="{label: 'name', value: 'code', checkStrictly: true}"
v-model="address"
clearable style="width: 300px;" @change="selectArea"/>
</el-form-item>
<el-form-item label="已选择">
<view class="tags">
@@ -111,26 +74,56 @@
</el-form-item>
</el-form>
</view>
<div class="flex justify-between items-center w-1200 m-a">
<template v-if="ad11.length">
<el-carousel :height="`100px`" :style="{width: '600px'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad11" :key="index" :style="{width: '600px'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '600px'}"/>
</el-carousel-item>
</el-carousel>
</template>
<template v-if="ad112.length">
<el-carousel :height="`100px`" :style="{width: '600px'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad112" :key="index" :style="{width: '600px'}">
<image @click="vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '600px'}"/>
</el-carousel-item>
</el-carousel>
</template>
</div>
<!-- 商品列表 -->
<view class="sheet-list">
<view class="flex justify-start items-center my-20">
<el-button @click="changeStatus('notPick')" type="primary" :plain="status === 'picked'" round>正在询价
</el-button>
<el-button @click="changeStatus('picked')" type="primary" :plain="status === 'notPick'" round>合作成交
</el-button>
</view>
<el-table :data="list.rows" style="width: 100%">
<el-table-column align="center" label="品名/材质">
<template v-slot="{ row }">
<p class="text-main">{{ row.productList.map(item => `${item.goodsName}(${item.materialQuality})`).join("/") }}</p>
<p v-if="row.productList && row.productList.length" class="text-main">{{
row.productList.map(item => `${item.goodsName}${item.materialQuality ? `(${item.materialQuality})` : ''}`).join("/")
}}</p>
<p class="text-main" v-else>{{ row.projectName }}</p>
</template>
</el-table-column>
<el-table-column align="center" label="采购量">
<template v-slot="{ row }">
<p class="text-main">
{{ row.productList.map(item => item.procureNumber + item.procureUnit).join("/") }}</p>
{{
row.productList.map(item => (item.procureNumber ? item.procureNumber : '') + (item.procureUnit ? item.procureUnit : '')).join("/")
}}</p>
</template>
</el-table-column>
<el-table-column prop="fullAddress" label="收货地"/>
<el-table-column align="center" label="采购企业">
<template v-slot="{ row }">
<p>{{
row.user.accountType === 1 ? row.user.person.personName : row.user.company.companyName
<p v-if="row.user">{{
row.user.accountType === 1 ? row.user.person.personName.replace(/^(.).*(.)$/, "$1*$2") : row.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6")
}}</p>
</template>
</el-table-column>
@@ -178,6 +171,7 @@ export default {
cityData: citys,
areaData: areas,
checkCategoryList: [],
allProductList: [],
checkTextureList: [],
checkCompanyList: [],
attributes: [],
@@ -188,129 +182,18 @@ export default {
},
pageSize: 20,
queryParam: {},
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: (obj = {}) => {
let {data, success, fail, complete} = obj;
console.log(data)
vk.callFunction({
url: `client/enquiry/sheet/pub/getList`,
data: data,
success: (res) => {
if (typeof success === "function") {
success({
rows: res.rows, // 列表数据
total: res.total, // 总记录数
});
}
},
fail: (err => {
}),
complete: (res) => {
if (typeof complete === "function") complete(res);
}
})
},
customRightBtns: [{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/enquiry/detail?id=' + item._id);
}
},],
// 表格字段显示规则
columns: [
{
key: "productList",
title: "品名/材质",
type: "text",
formatter: (val, row, column, index) => {
// console.log(val)
return val.map(item => item.goodsName).join("/")
}
},
{
key: "productList",
title: "采购量",
type: "text",
formatter: (val, row, column, index) => {
return val.map(item => item.procureNumber + item.procureUnit).join("/")
}
},
{
key: "productList",
title: "收货地",
type: "text",
formatter: (val, row, column, index) => {
let str = ''
if (val.length > 0 && val[0].addressRegion.length > 0) {
let provinceIndex = 0, cityIndex = 0, areaIndex = 0
this.provinceData.forEach((item, index) => {
if (parseInt(val[0].addressRegion[0]) === parseInt(item.code)) {
provinceIndex = index
str = item.name
}
})
this.cityData[provinceIndex].forEach((item, index) => {
if (parseInt(val[0].addressRegion[1]) === parseInt(item.code)) {
cityIndex = index
str += item.name
}
})
this.areaData[provinceIndex][cityIndex].forEach((item, index) => {
if (parseInt(val[0].addressRegion[2]) === parseInt(item.code)) {
areaIndex = index
str += item.name
}
})
str += val[0].addressDetail
}
return str
}
},
{
key: "user",
title: "采购企业",
type: "text",
formatter: (val, row, column, index) => {
if (val.accountType === 1) {
return val.person.personName
} else {
return val.company.companyName
}
}
},
{
key: "",
title: "报价情况",
type: "text",
formatter: (val, row, column, index) => {
return `${val.quoteNum}家已报价`
}
},
{
key: "_add_time_srt",
title: "发布时间",
type: "time",
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
areaOptions: [],
address: [],
area: null,
status: 'notPick',
ad11: [],
ad112: [],
};
},
onShow() {
// this.search(1)
vk.callFunction({
url: 'client/spot/category/pub/getTree',
url: 'client/enquiry/template/pub/getList',
title: '请求中...',
data: {},
success: (data) => {
@@ -323,31 +206,80 @@ export default {
})
}
});
this.getAttributes()
this.getCompany()
// this.getAttributes()
// this.getCompany()
// this.getStealFactory()
this.search()
},
onLoad(options) {
this.getCate()
if (options && options.keyword) this.keyword = options.keyword
this.areaOptions = provinces.map(item => {
item.children = [];
return item
})
this.areaOptions.forEach((province, index) => {
citys[index].forEach(city => {
city.children = []
this.areaOptions[index].children.push(city)
})
})
this.areaOptions.forEach((province, index) => {
province.children.forEach((city, cityIndex) => {
this.areaOptions[index].children[cityIndex].children.push(...areas[index][cityIndex])
})
})
},
methods: {
selectCate(id) {
const index = this.checkCategoryList.indexOf(id)
if (index === -1) this.checkCategoryList.push(id)
else this.checkCategoryList.splice(index, 1)
async getCate() {
const {rows} = await vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
});
this.allProductList = []
this.productCateList = rows.map(item => {
item.children.forEach(child => {
this.allProductList.push({
...child,
parentName: item.name
})
})
item.idList = []
return item
})
},
searchKeyword(){
this.clickedCateIndex = -1
this.checkCategoryList = []
this.search(1)
},
selectTexture(id) {
if (id === -1) this.checkTextureList = []
selectCate(name) {
if (name === -2) {
this.clickedCateIndex = -2
this.checkCategoryList = [-2]
} else {
// const index = this.checkCategoryList.indexOf(name)
// if (index === -1) this.checkCategoryList.push(name)
// else this.checkCategoryList.splice(index, 1)
this.checkCategoryList = [name]
}
this.keyword = ''
this.search(1)
},
selectTexture(name) {
if (name === -1) this.checkTextureList = []
else {
const index = this.checkTextureList.indexOf(id)
if (index === -1) this.checkTextureList.push(id)
const index = this.checkTextureList.indexOf(name)
if (index === -1) this.checkTextureList.push(name)
else this.checkTextureList.splice(index, 1)
}
this.search(1)
},
selectCompany(id) {
if (id === -1) this.checkCompanyList = []
selectCompany(name) {
if (name === -1) this.checkCompanyList = []
else {
const index = this.checkCompanyList.indexOf(id)
if (index === -1) this.checkCompanyList.push(id)
const index = this.checkCompanyList.indexOf(name)
if (index === -1) this.checkCompanyList.push(name)
else this.checkCompanyList.splice(index, 1)
}
this.search(1)
@@ -357,12 +289,17 @@ export default {
url: '/pages/enquiry/my'
})
},
toMyQuote() {
vk.navigateTo({
url: '/pages/enquiry/quote/my'
})
},
async toRelease() {
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'
@@ -370,59 +307,71 @@ 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 {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/enquiry/release'
})
}
},
selectArea(e) {
this.area = e
this.search(1)
},
changeStatus(status) {
this.status = status
this.search(1)
},
search(pageIndex = 1) {
let cateList = [], material = []
if (this.checkCategoryList.length === 1 && this.checkCategoryList[0] === -2) cateList.push(0)
else {
cateList = this.checkCategoryList
}
vk.callFunction({
url: 'client/enquiry/sheet/pub/getList',
title: '请求中...',
data: {
pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
companyList: this.checkCompanyList,
categoryIds: this.checkCategoryList
// categoryIds: this.checkCategoryList
cateList,
material: this.checkTextureList,
area: this.area,
status: this.status,
},
success: (data) => {
this.list = data
this.list.rows.forEach((val, index) => {
let fullAddress = ''
if (val.productList !== undefined && val.productList.length > 0 && val.productList[0].addressRegion !== undefined && val.productList[0].addressRegion.length > 0) {
let provinceIndex = 0, cityIndex = 0, areaIndex = 0
this.provinceData.forEach((item, index) => {
if (val.productList[0].addressRegion !== undefined && parseInt(val.productList[0].addressRegion[0]) === parseInt(item.code)) {
provinceIndex = index
fullAddress = item.name
}
})
this.cityData[provinceIndex].forEach((item, index) => {
if (val.productList[0].addressRegion !== undefined && parseInt(val.productList[0].addressRegion[1]) === parseInt(item.code)) {
cityIndex = index
fullAddress += item.name
}
})
this.areaData[provinceIndex][cityIndex].forEach((item, index) => {
if (val.productList[0].addressRegion !== undefined && parseInt(val.productList[0].addressRegion[2]) === parseInt(item.code)) {
areaIndex = index
fullAddress += item.name
}
})
fullAddress += val.productList[0].addressDetail
}
this.list.rows[index].fullAddress = fullAddress
this.list.rows[index].fullAddress = (val.addressRegion && val.addressRegion.province) ? `${val.addressRegion.province.name}${val.addressRegion.city.name}${val.addressRegion.area.name}` : ''
if (val.addressDetail) this.list.rows[index].fullAddress += val.addressDetail
})
this.getAd11()
this.getAd112()
}
});
@@ -453,24 +402,86 @@ export default {
}
});
},
selectAll() {
this.clickedCateIndex = -1
this.keyword = ''
this.checkCategoryList = []
this.search(1)
},
async getAd11() {
this.ad11 = []
if (this.checkCategoryList.length === 0 || (this.checkCategoryList.length === 1 && this.checkCategoryList[0] === -2)) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 11,
region: this.area
}
})
if (res.data) this.ad11 = res.data
} else {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 11,
categoryNames: this.checkCategoryList,
region: this.area
}
})
if (res.data) this.ad11 = res.data
}
},
async getAd112() {
this.ad112 = []
if (this.checkCategoryList.length === 0 || (this.checkCategoryList.length === 1 && this.checkCategoryList[0] === -2)) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 112,
region: this.area
}
})
if (res.data) this.ad112 = res.data
} else {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 112,
categoryNames: this.checkCategoryList,
region: this.area
}
})
if (res.data) this.ad112 = res.data
}
},
},
computed: {
checkCategoryArr() {
const arr = []
this.allChildCate.forEach(item => {
if (this.checkCategoryList.includes(item._id)) arr.push(item)
})
if (this.checkCategoryList.length === 1 && this.checkCategoryList[0] !== -2) arr.push({name: this.checkCategoryList[0]})
this.attributes.forEach(item => {
if (this.checkTextureList.includes(item.value)) {
arr.push(item)
}
})
this.companyList.forEach(item => {
if (this.checkCompanyList.includes(item._id)) {
arr.push(item)
if (this.area && this.area.length) {
const nameArr = []
if (this.area.length > 0) {
const province = this.provinceData.find(item => item.code === this.area[0])
nameArr.push(province.name)
if (this.area.length > 1) {
const city = province.children.find(item => item.code === this.area[1])
nameArr.push(city.name)
if (this.area.length > 2) {
const area = city.children.find(item => item.code === this.area[2])
nameArr.push(area.name)
}
}
}
console.log(nameArr)
if (nameArr.length) arr.push({name: nameArr.join('/')})
}
})
return arr
}
@@ -528,6 +539,7 @@ export default {
.post-btn {
background: none;
color: #A92924;
}
.post-btn:hover {
+44 -61
View File
@@ -12,13 +12,14 @@
</view> -->
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<!-- <el-carousel height="170px">-->
<!-- <el-carousel-item v-for="item in 4" :key="item">-->
<!-- <image class="carousel-img"-->
<!-- src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"-->
<!-- mode="aspectFill"></image>-->
<!-- </el-carousel-item>-->
<!-- </el-carousel>-->
<common-swiper page="enquiry-mine" :height="200"/>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布询价单</el-button>
@@ -62,7 +63,7 @@ export default {
},
table1: {
// 表格数据请求地址
action: "client/enquiry/sheet/pub/getList",
action: "client/enquiry/sheet/kh/getList",
customRightBtns: [
{
title: '详情',
@@ -77,8 +78,10 @@ export default {
icon: 'el-icon-delete',
type: 'primary',
onClick: (item) => {
this.$confirm('').then(() => {
this.$confirm('如果你要删除此条信息,之前其他客户填写的留言将无法查看', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.callFunction({
url: 'client/enquiry/sheet/kh/delete',
@@ -90,63 +93,37 @@ export default {
this.$refs.table1.refresh()
})
})
}
},
],
// 表格字段显示规则
columns: [
{
key: "productList",
title: "品名/材质",
key: "enquiryNo",
title: "单号",
type: "text",
width: 280,
formatter: (val, row, column, index) => {
return val.map(item => `${item.goodsName}(${item.materialQuality})`).join("/")
}
},
{
key: "title",
title: "品名/材质",
type: "text"
},
{
key: "productList",
title: "采购量",
type: "text",
width: 100,
formatter: (val, row, column, index) => {
return val.map(item => item.procureNumber + item.procureUnit).join("/")
if (row.fillType === 0) return val.map(item => (item.procureNumber ? item.procureNumber : '') + (item.procureUnit ? item.procureUnit : '')).join("/")
else return row.procureUnit ? `${row.procureNumber}${row.procureUnit}` : ''
}
},
{
key: "productList",
key: "addressRegion",
title: "收货地",
type: "text",
minWidth: 200,
formatter: (val, row, column, index) => {
let fullAddress = ""
try {
let provinceIndex = 0, cityIndex = 0, areaIndex = 0
this.provinceData.forEach((item, index) => {
if (row.productList[0].addressRegion !== undefined && parseInt(row.productList[0].addressRegion[0]) === parseInt(item.code)) {
provinceIndex = index
fullAddress = item.name
}
})
this.cityData[provinceIndex].forEach((item, index) => {
if (row.productList[0].addressRegion !== undefined && parseInt(row.productList[0].addressRegion[1]) === parseInt(item.code)) {
cityIndex = index
fullAddress += item.name
}
})
this.areaData[provinceIndex][cityIndex].forEach((item, index) => {
if (row.productList[0].addressRegion !== undefined && parseInt(row.productList[0].addressRegion[2]) === parseInt(item.code)) {
areaIndex = index
fullAddress += item.name
}
})
fullAddress += row.productList[0].addressDetail
} catch (err) {
fullAddress = ""
}
let fullAddress = (val && val.province) ? `${val.province.name}${val.city.name}${val.area.name}` : ''
if (row.addressDetail) fullAddress += ` ${row.addressDetail}`
return fullAddress
}
},
@@ -154,23 +131,29 @@ export default {
key: "user",
title: "采购单位",
type: "text",
width: 280,
formatter: (val, row, column, index) => {
if (!val) return ''
if (val.accountType == 1) {
return val.person.personName
} else {
return val.company.companyName
}
}
},
// {
// key: "_add_time_srt",
// title: "添加时间",
// type: "time",
// width: 160
// },
{
key: "quoteNum",
title: "报价数",
type: "text",
formatter: (val, row, column, index) => {
return `${val}家已报价`
}
},
{
key: "_add_time_str",
title: "发布时间",
type: "time",
width: 160
},
],
// 多选框选中的值
multipleSelection: [],
@@ -188,20 +171,20 @@ export default {
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.getCertUrl()
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('请完善名片信息', '提示', {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card');
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
uni.navigateTo({
+219 -32
View File
@@ -15,6 +15,55 @@
</view>
<view class="page-main">
<quote-remain-num v-if="reloaded" :amount="sheet.quoteAmount" type="enquiry" :id="enquiryId"/>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
采购商信息
</view>
<text class="tip-text ml-10">(注册可查看信息)</text>
</view>
</view>
<view class="mt-15">项目名称:{{ sheet.projectName ? sheet.projectName : '' }}</view>
<view class="mt-15">项目地址:{{ sheet.fullAddress ? sheet.fullAddress : '' }}</view>
<template v-if="canViewBuyerInfo">
<view class="mt-15" v-if="sheet.companyName">公司信息:{{
sheet.companyName ? sheet.companyName : ''
}}
</view>
<view class="mt-15" v-if="sheet.companyMobile">公司联系方式:{{
sheet.companyMobile ? sheet.companyMobile : ''
}}
</view>
<view class="mt-15">授权业务咨询人:{{
sheet.businessName ? sheet.businessName : ''
}}
</view>
<view class="mt-15">业务咨询联系方式:{{
sheet.businessMobile ? sheet.businessMobile : ''
}}
</view>
</template>
<template v-else>
<view class="mt-15" v-if="sheet.companyName">公司信息:{{
sheet.companyName ? sheet.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : ''
}}
</view>
<view class="mt-15" v-if="sheet.companyMobile">公司联系方式:{{
sheet.companyMobile ? sheet.companyMobile.replace(/^(.)(.)(.).*$/, "$1$2$3****") : ''
}}
</view>
<view class="mt-15">授权业务咨询人:{{
sheet.businessName ? sheet.businessName.replace(/^(.).*(.)$/, "$1***$2") : ''
}}
</view>
<view class="mt-15">业务咨询联系方式:{{
sheet.businessMobile ? sheet.businessMobile.replace(/^(.)(.)(.).*$/, "$1$2$3****") : ''
}}
</view>
</template>
</view>
<vk-data-form
ref="form1"
v-model="form1.data"
@@ -23,27 +72,54 @@
:rules="form1.props.rules"
:form-type="form1.props.formType"
:loading.sync="form1.props.loading"
:auto-close="true"
label-width="140px"
:auto-close="false"
:need-alert="false"
:show-cancel="false"
label-width="160px"
@success="onFormSuccess"
></vk-data-form>
@fail="onFormFail"
>
<template v-slot:totalPrice>
<el-input v-model="form1.data.totalPrice" placeholder="请输入货款总价"
@change="formatNumber"></el-input>
</template>
</vk-data-form>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
import dayjs from "dayjs";
export default {
data() {
return {
userInfo: {
userLevel: 0
},
sheet: {
files: [],
multiFiles: [],
quoteList: [],
transportDocuments: [],
productList: [],
user: {},
fullAddress: ''
},
enquiryId: null,
reloaded: false,
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
// radio: 1,
// checkbox : [1,2]
sheetId: null
sheetId: null,
totalPrice: null,
files: [],
},
// 表单属性
props: {
@@ -51,14 +127,29 @@ export default {
action: "client/enquiry/quote/kh/addQuote",
// 表单字段显示规则
columns: [
{key: "totalPrice", title: "货款总价", type: "number"},
{key: "totalPriceStr", title: "人民币大写", type: "text"},
{key: "remark", title: "报价单详情", type: "editor"},
{
key: "totalPrice",
title: "货款总价(人民币:元)",
type: "html"
},
// {key: "totalPrice", title: "货款总价(人民币:元)", type: "number", precision: 2},
{
key: "files",
title: "附件",
type: "file",
accept: '.pdf',
tips: '仅支持纵向PDF文档,报价附件将生成标准合同附件,请认真审阅。'
},
{key: "remark", title: "报价单详情", type: "textarea"},
{key: "supplierExt", title: "供应商合同补充条款", type: "textarea", autosize: {minRows: 4, maxRows: 10},},
],
// 表单验证规则
rules: {
text: [
{required: true, message: "text不能为空", trigger: "change"},
totalPrice: [
{required: true, message: "货款总价不能为空", trigger: "change,blur"},
],
files: [
{required: true, message: "附件不能为空", trigger: "change,blur"},
]
},
// add 代表添加 update 代表修改
@@ -73,7 +164,6 @@ export default {
};
},
onLoad(options = {}) {
console.log(options)
const {
enquiryId
} = options
@@ -84,9 +174,26 @@ export default {
this.enquiryId = enquiryId
this.form1.data.sheetId = enquiryId
this.userInfo = vk.getVuex('$user.userInfo') || {userLevel: 0}
this.getEnquiryDetail()
},
computed: {
isLoggedIn() {
return !!vk.getVuex('$user.userInfo._id')
},
canViewBuyerInfo() {
const remainQuoteNum = Number(this.userInfo && this.userInfo.remainQuoteNum) || 0
const quoteExpiredAt = this.userInfo && this.userInfo.quoteExpiredAt
const monthlyQuoteActive = !!(quoteExpiredAt && dayjs(quoteExpiredAt).isAfter(dayjs()))
return this.isLoggedIn && (
this.sheet.isMine ||
this.sheet.hasQuote ||
Number(this.userInfo.userLevel) > 0 ||
remainQuoteNum > 0 ||
monthlyQuoteActive
)
},
totalPriceStr() {
if (this.totalPrice == 0) {
@@ -96,24 +203,66 @@ export default {
}
},
methods: {
onFormSuccess() {
vk.navigateBack()
dayjs,
normalizeSheet(data = {}) {
return {
files: [],
multiFiles: [],
quoteList: [],
transportDocuments: [],
productList: [],
user: {},
fullAddress: '',
...data,
files: Array.isArray(data.files) ? data.files : [],
multiFiles: Array.isArray(data.multiFiles) ? data.multiFiles : [],
quoteList: Array.isArray(data.quoteList) ? data.quoteList : [],
transportDocuments: Array.isArray(data.transportDocuments) ? data.transportDocuments : [],
productList: Array.isArray(data.productList) ? data.productList : [],
user: data.user || {},
}
},
onFormSuccess() {
vk.redirectTo({url: `/pages/enquiry/detail?id=${this.enquiryId}`})
},
onFormFail(data) {
if (data.data.code === 12) {
this.$confirm(data.data.msg, '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.redirectTo({url: `/pages/user/user?menu=grade`})
})
} else {
this.$confirm(data.data.msg, '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.navigateBack()
})
}
},
// 提交报价单
async submit() {
const data = await vk.userCenter.getCurrentUserInfo();
const {userInfo} = data
if (userInfo.quoteTimes > 3) {
if (userInfo.remainQuoteNum === 0 || !userInfo.remainQuoteNum) {
}
this.$confirm(`今日报价次数${userInfo.quoteTimes || 0}, 是否继续?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
center: true
}).then(res => {
// this.$confirm(`今日报价次数${userInfo.quoteTimes || 0}, 是否继续?`, '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning',
// center: true
// }).then(res => {
//
// })
vk.callFunction({
url: 'client/enquiry/quote/kh/addQuote',
title: '请求中...',
@@ -126,8 +275,11 @@ export default {
message: "报价成功",
type: 'success'
})
},
fail: err => {
console.log(err)
}
});
})
@@ -143,21 +295,23 @@ export default {
_id: this.enquiryId
},
success: (res) => {
res.data.productList.forEach(item => {
item.unitPrice = 0
const keys = Object.keys(item.extraAttributes)
keys.forEach(citem => {
item.extraAttributes[citem] = JSON.parse(item.extraAttributes[
citem])
})
})
this.sheet = res.data
this.sheet = this.normalizeSheet(res.data)
this.sheet.fullAddress = (this.sheet.addressRegion && this.sheet.addressRegion.province) ? `${this.sheet.addressRegion.province.name}${this.sheet.addressRegion.city.name}${this.sheet.addressRegion.area.name}` : ''
if (this.sheet.addressRegion && this.sheet.addressRegion.addressDetail) {
this.sheet.fullAddress += this.sheet.addressRegion.addressDetail
}
}
});
},
formatNumber(e) {
this.form1.data.totalPrice = parseFloat(this.form1.data.totalPrice).toFixed(2)
}
},
onShow() {
this.reloaded = false
setTimeout(() => {
this.reloaded = true
}, 500)
}
}
</script>
@@ -168,6 +322,7 @@ export default {
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
border-radius: 5px;
}
.description {
@@ -175,6 +330,38 @@ export default {
width: 800px;
}
.item-wrap {
margin: 24px 0;
.form-title-wrap {
display: flex;
align-items: center;
justify-content: space-between;
.goods-info-title {
display: flex;
align-items: center;
justify-content: flex-start;
}
.form-title {
padding-left: 10px;
color: #A92924;
font-size: 18px;
line-height: 18px;
border-left: 4px solid #A92924;
}
}
}
.tip-text {
color: #f56c6c;
}
.item-wrap + .el-form {
margin-top: 24px;
}
.quote {
display: flex;
align-items: center;
+184
View File
@@ -0,0 +1,184 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<!-- <view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
</el-breadcrumb>
</view> -->
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布询价单</el-button>
<!-- <el-button type="primary" round plain>我发布的询价单</el-button> -->
</el-row>
</view>
</view>
<!-- 商品列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns"
:pagination="true"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
keyword: '',
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: "client/enquiry/quote/kh/getList",
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/enquiry/detail?id=' + item.sheetId);
}
},
],
// 表格字段显示规则
columns: [
{
key: "sheet.title",
title: "供应标题",
type: "text",
},
{
key: "totalPrice",
title: "金额",
type: "text",
formatter: (val, row, column, index) => {
return `${val}元`
}
},
{
key: "status",
title: "状态",
type: "select",
data: [
{value: 0, label: '待选商'},
{value: 1, label: '已被选商'},
]
},
{
key: "remark",
title: "备注",
type: "text",
},
{
key: "_add_time_str",
title: "发布时间",
type: "time",
width: 160
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
},
methods: {
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
uni.navigateTo({
url: '/pages/enquiry/release'
})
}
},
}
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
.el-tag {
margin-right: 10px;
}
}
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
</style>
+708 -392
View File
File diff suppressed because it is too large Load Diff
+587 -234
View File
File diff suppressed because it is too large Load Diff
+476 -208
View File
@@ -8,9 +8,9 @@
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>
<navigator style="display: inline-block;" url="/pages/old">旧货交易</navigator>
<navigator style="display: inline-block;" url="/pages/index/old/old">旧货交易</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item>旧货详情</el-breadcrumb-item>
<el-breadcrumb-item>{{ oldType[sheet.type] }}</el-breadcrumb-item>
</el-breadcrumb>
</view>
@@ -19,54 +19,49 @@
<text class="text-gray">发布时间:{{ sheet._add_time_str }}</text>
</view>
<view class="my-25 flex justify-between items-center">
<!-- <view class="flex justify-start items-center">-->
<!-- <text class="text-40 font-bold">{{ sheet.title }}</text>-->
<!-- <view class="ml-20 flex justify-start items-center">-->
<!-- <building-one theme="outline" size="24" fill="#a92924" strokeLinecap="square"/>-->
<!-- <view class="text-main ">-->
<!-- <text class="mx-20">{{-->
<!-- (sheet.quoteList && sheet.quoteList.length > 0) ? sheet.quoteList.length : 0-->
<!-- }}-->
<!-- </text>-->
<!-- <text>家已报价</text>-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<view class="flex justify-end items-end"
v-if="sheet.expiredTime && dayjs().diff(dayjs(sheet.expiredTime), 'second') > 0">
<text>距离报价结束还有:</text>
<view class="border-main countdown text-main">{{
dayjs().diff(dayjs(sheet.expiredTime), 'day')
<view class="flex justify-start items-center">
<text class="text-main" v-if="sheet.isUrgent">[加急]</text>
<text class="text-40 font-bold">{{ sheet.title }}</text>
<view class="ml-20 flex justify-start items-center" v-if="sheet.type < 3">
<building-one theme="outline" size="24" fill="#a92924" strokeLinecap="square"/>
<view class="text-main ">
<text class="mx-20">{{
(sheet.quoteList && sheet.quoteList.length > 0) ? sheet.quoteList.length : 0
}}
</text>
<text>家已报价</text>
</view>
<text>天</text>
<view class="border-main countdown text-main">
{{ (dayjs().diff(dayjs(sheet.expiredTime), 'hour')) % 24 }}
</view>
<text>时</text>
</view>
</view>
<view class="my-25 flex justify-between items-center pb-20 border-bottom">
<view class="flex justify-start items-center">
<id-card theme="outline" size="24" fill="#a92924" strokeLinecap="square"/>
<text class="ml-15 text-gray">
<text class="ml-15 text-gray" v-if="sheet.user" :class="[sheet.user.showInYellow ? 'pointer hover' : '']"
@click="toCompany">
{{
sheet.supplier.companyName
(sheet.supplier && sheet.supplier.companyName) ? sheet.supplier.companyName : sheet.buyer.companyName
}}
</text>
</view>
<!-- <el-button type="primary" @click.native="toQuote"-->
<!-- v-if="vk.getVuex('$user.userInfo._id') !== sheet.userId && sheet.status === 0">我要报价-->
<!-- </el-button>-->
<!-- <el-button type="primary" @click.native="showDialog = true"-->
<!-- v-else-if="vk.getVuex('$user.userInfo._id') === sheet.userId">查看收到的申请报价-->
<!-- </el-button>-->
<template v-if="sheet.type < 3">
<template v-if="sheet.type !== 3 && sheet.rentType !== 1">
<el-button type="primary" @click.native="toQuote"
v-if="vk.getVuex('$user.userInfo._id') !== sheet.uid && sheet.status === 0">
{{ (sheet.type === 3 || (sheet.type === 2 && sheet.rentType === 1)) ? '我要询价' : '我要报价' }}
</el-button>
<el-button type="primary" @click.native="showDialog = true"
v-else-if="vk.getVuex('$user.userInfo._id') === sheet.uid">查看收到的申请报价
</el-button>
</template>
</template>
</view>
<view class="item-wrap" v-if="sheet.files && sheet.files.length > 0">
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
实物
物资信息
</view>
</view>
</view>
@@ -74,35 +69,71 @@
<el-image :src="item" style="width: 100px; height: 100px" fit="cover"
:preview-src-list="sheet.files"/>
</view>
<view class="mt-15">物资分类:{{ sheet.category[1] }}</view>
<view class="mt-15" v-if="sheet.addressRegion && sheet.addressRegion.city">
物资所在地:{{ sheet.addressRegion.province.name }}{{
sheet.addressRegion.city.name
}}{{ sheet.addressRegion.area.name }}{{ sheet.addressDetail }}
</view>
<view class="mt-15" v-if="[2].includes(sheet.type) && sheet.deliverAddressRegion.city">
{{
sheet.type === 2 ? (sheet.rentType === 0 ? '物资交货地' : '物资装货地') : '物资交货地'
}}:{{ sheet.deliverAddressRegion.province.name }}{{
sheet.deliverAddressRegion.city.name
}}{{ sheet.deliverAddressRegion.area.name }}{{ sheet.deliverAddressDetail }}
</view>
<view class="mt-15">详情:{{ sheet.desc ? sheet.desc : '无' }}</view>
<template v-if="sheet.type === 0">
<view class="mt-15">起拍计价单位:
<!-- <text>{{-->
<!-- sheet.startNum ? sheet.startNum : '无'-->
<!-- }}-->
<!-- </text>-->
<text v-if="sheet.unit">{{ sheet.unit ? sheet.unit : '无' }}</text>
</view>
<view class="mt-15">起拍人民币单价:{{ sheet.startAmount ? `${sheet.startAmount}元` : '无' }}</view>
<view class="mt-15">拍卖信息失效时间:{{ sheet.expiredTime ? sheet.expiredTime : '无' }}</view>
</template>
</view>
<view class="item-wrap">
<view class="item-wrap" v-if="[1, 2].includes(sheet.type)">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
详情
发票要求
</view>
</view>
</view>
<view class="mt-15">{{ sheet.desc }}</view>
<view class="mt-15">是否含税:{{ sheet.invoice ? '含税' : '不含税' }}</view>
<template v-if="sheet.invoice">
<view class="mt-15">
开票时间:{{
(sheet.writeInvoiceTime !== undefined && sheet.writeInvoiceTime !== null) ? WRITE_INVOICE_TIME[sheet.writeInvoiceTime] : '无'
}}
</view>
<template v-if="sheet.type === 1">
<view class="mt-15" v-if="sheet.invoiceOther">税票要求:{{ sheet.invoiceOther }}</view>
<template v-else>
<view class="mt-15">纳税人身份:{{ sheet.taxType ? sheet.taxType : '无' }}</view>
<view class="mt-15">发票种类:{{ sheet.invoiceType ? sheet.invoiceType : '无' }}</view>
<view class="mt-15">税率:{{ sheet.taxRate ? sheet.taxRate : '无' }}</view>
</template>
</template>
<template v-else>
<view class="mt-15">发票种类:{{ sheet.invoiceType ? INVOICE_TYPE[sheet.invoiceType] : '无' }}</view>
<view class="mt-15" v-if="sheet.type === 2">报价明细:{{
sheet.invoiceDetail ? sheet.invoiceDetail : '无'
}}
</view>
<view class="mt-15" v-if="sheet.invoiceOther">其他要求:{{
sheet.invoiceOther ? sheet.invoiceOther : '无'
}}
</view>
</template>
</template>
</view>
<!-- <view class="item-wrap">-->
<!-- <view class="form-title-wrap">-->
<!-- <view class="goods-sheet-title">-->
<!-- <view class="form-title">-->
<!-- 纳税和税票-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="mt-15">是否含税:{{ sheet.invoice ? '含税' : '不含税' }}</view>-->
<!-- <view class="mt-15">开票时间:{{ WRITE_INVOICE_TIME[sheet.writeInvoiceTime] }}</view>-->
<!-- <view class="mt-15">发票种类:{{ INVOICE_TYPE[sheet.invoiceType] }}</view>-->
<!-- <view class="mt-15">其他要求:{{ sheet.invoiceOther }}</view>-->
<!-- </view>-->
<view class="item-wrap">
<view class="item-wrap" v-if="sheet.type !== 3">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
@@ -110,15 +141,156 @@
</view>
</view>
</view>
<view class="mt-15">付款方式:{{ sheet.payMethod }}</view>
<view class="mt-15">报价区域:{{
sheet.offerAddressNoLimit ? '不限区域' :
(sheet.offerAddressRegion && sheet.offerAddressRegion.province) ? `${sheet.offerAddressRegion.province.name} ${sheet.offerAddressRegion.city ? sheet.offerAddressRegion.city.name : '无'} ${sheet.offerAddressRegion.area ? sheet.offerAddressRegion.area.name : '无'}` : '无'
}}
</view>
<view class="mt-15" v-if="sheet.payMethod !== '其他付款方式描述'">
付款方式:{{ sheet.payMethod ? sheet.payMethod : '无' }} {{ sheet.prePayRate ? `${sheet.prePayRate}%` : '' }}
</view>
<view class="mt-15" v-else>付款方式:{{
sheet.otherPayMethodDesc ? sheet.otherPayMethodDesc : '无'
}}
</view>
<!-- <view class="mt-15">报价形式:{{ sheet.offerType === 0 ? '整单报价' : '可分项报价' }}</view>-->
</view>
<template v-if="sheet.type === 1">
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
简易合同备注和其他补充条款
采购商信息
</view>
<text class="tip-text ml-10">(注册可查看信息)</text>
</view>
</view>
<template v-if="isLoggedIn && (sheet.isMine || sheet.hasQuote || userInfo.userLevel > 0)">
<view class="mt-15" v-if="sheet.buyer.companyName">公司信息:{{
sheet.buyer.companyName ? sheet.buyer.companyName : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.contract">公司联系方式:{{
sheet.buyer.contract ? sheet.buyer.contract : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.personalName">个人信息:{{
sheet.buyer.personalName ? sheet.buyer.personalName : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.personalContract">个人联系方式:{{
sheet.buyer.personalContract ? sheet.buyer.personalContract : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.managerName">授权人姓名:{{
sheet.buyer.managerName ? sheet.buyer.managerName : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.managerContract">授权联系方式:{{
sheet.buyer.managerContract ? sheet.buyer.managerContract : ''
}}
</view>
</template>
<template v-else>
<view class="mt-15" v-if="sheet.buyer.companyName">公司信息:{{
sheet.buyer.companyName ? sheet.buyer.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.contract">公司联系方式:{{
sheet.buyer.contract ? (sheet.buyer.contract.slice(0, 3) + '*'.repeat(sheet.buyer.contract.length - 7) + sheet.buyer.contract.slice(-4)) : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.personalName">个人信息:{{
sheet.buyer.personalName ? sheet.buyer.personalName.replace(/^(.).*(.)$/, "$1***$2") : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.personalContract">个人联系方式:{{
sheet.buyer.personalContract ? sheet.buyer.personalContract.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.managerName">授权人姓名:{{
sheet.buyer.managerName ? sheet.buyer.managerName.replace(/^(.).*(.)$/, "$1***$2") : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.managerContract">授权联系方式:{{
sheet.buyer.managerContract ? sheet.buyer.managerContract.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
</template>
</view>
</template>
<template v-else>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
{{ sheet.type === 3 ? '回收单位信息' : '供货商信息' }}
</view>
<text class="tip-text ml-10">(注册可查看信息)</text>
</view>
</view>
<template v-if="isLoggedIn && (sheet.isMine || sheet.hasQuote || userInfo.userLevel > 0)">
<view class="mt-15" v-if="sheet.supplier.companyName">公司信息:{{
sheet.supplier.companyName ? sheet.supplier.companyName : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.contract">公司联系方式:{{
sheet.supplier.contract ? sheet.supplier.contract : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.personalName">个人信息:{{
sheet.supplier.personalName ? sheet.supplier.personalName : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.personalContract">
个人联系方式:{{
sheet.supplier.personalContract ? sheet.supplier.personalContract : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.managerName">授权人姓名:{{
sheet.supplier.managerName ? sheet.supplier.managerName : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.managerContract">授权联系方式:{{
sheet.supplier.managerContract ? sheet.supplier.managerContract : ''
}}
</view>
</template>
<template v-else>
<view class="mt-15" v-if="sheet.supplier.companyName">公司信息:{{
sheet.supplier.companyName ? sheet.supplier.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.contract">公司联系方式:{{
sheet.supplier.contract ? (sheet.supplier.contract.slice(0, 3) + '*'.repeat(sheet.supplier.contract.length - 7) + sheet.supplier.contract.slice(-4)) : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.personalName">个人信息:{{
sheet.supplier.personalName ? sheet.supplier.personalName.replace(/^(.).*(.)$/, "$1***$2") : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.personalContract">
个人联系方式:{{
sheet.supplier.personalContract ? sheet.supplier.personalContract.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.managerName">授权人姓名:{{
sheet.supplier.managerName ? sheet.supplier.managerName.replace(/^(.).*(.)$/, "$1***$2") : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.managerContract">授权联系方式:{{
sheet.supplier.managerContract ? sheet.supplier.managerContract.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
</template>
</view>
</template>
<view class="item-wrap" v-if="sheet.signMethod === 0">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
合同条款
</view>
</view>
</view>
@@ -138,67 +310,105 @@
<view class="mt-15">
本合同的全部内容由双方平等共同协商一致,共同起草制定,非一方事先拟定,不属于格式条款。本合同自双方签字盖章后生效(包括电子签字、盖章),按本合同内容地址、联系方式寄送的一切文书、函件送达与否,均为视为送达有法律效力,通知途径和本合同内联系方式或地址送达文件双方均予以验证。
</view>
<view class="mt-15">采购方补充条款: 供货方逾期供货承担采购方一切损失</view>
<view class="mt-15"> 供应方补充条款:</view>
<view class="mt-15">采购方补充条款: {{ sheet.supplementary }}</view>
</view>
<!-- <view class="item-wrap">-->
<!-- <view class="form-title-wrap">-->
<!-- <view class="goods-info-title">-->
<!-- <view class="form-title">-->
<!-- 已收到的加工申请-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- &lt;!&ndash; 报价列表 &ndash;&gt;-->
<!-- <vk-data-table :data="sheet.quoteList" :columns="table1.columns" title="adasda "-->
<!-- :customRightBtns="table1.customRightBtns"></vk-data-table>-->
<!-- </view>-->
<template v-else-if="sheet.signMethod === 2">
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
合同附件
</view>
</view>
</view>
</view>
<view v-for="(item, index) in sheet.contractAttachment" :key="index" class="mr-25 my-25">
<file-type :item="item" @click.native="previewFile(item)"/>
</view>
</template>
</view>
<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">-->
<!-- <text>收到的报价</text>-->
<!-- <el-button type="primary" @click.native="showDialog = false">关闭</el-button>-->
<!-- </view>-->
<!-- <view class="mt-15">-->
<!-- <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>-->
<!-- </view>-->
<!-- <view class="quote" v-for="(item, index) in sheet.quoteList" :key="index">-->
<!-- <text class="flex-1">{{ item.subjectName }}</text>-->
<!-- <text class="flex-1">{{ item._add_time_str }}</text>-->
<!-- <text class="flex-1">{{ item.subjectMobile }}</text>-->
<!-- <text class="flex-1">{{ item.totalPrice }}元</text>-->
<!-- <text class="flex-1">-->
<!-- <el-button type="primary" v-if="sheet.status === 0">选择</el-button>-->
<!-- </text>-->
<!-- </view>-->
<!-- </view>-->
<!-- </el-dialog>-->
<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">
<text>收到的报价</text>
<el-button type="primary" @click.native="showDialog = false">关闭</el-button>
</view>
<view class="mt-15">
<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>
<text class="flex-1">操作</text>
</view>
<view class="quote" v-for="(item, index) in sheet.quoteList" :key="index">
<text class="flex-1">{{ item.subjectName }}</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1" v-if="item.user">{{ item.user.mobile }}</text>
<text class="flex-1">{{ item.totalPrice }}元</text>
<text class="flex-1">{{ item.remark }}</text>
<text class="flex-1">{{ item.supplierExt ? item.supplierExt : '无' }}</text>
<view class="flex-1">
<view class="flex-1">
<view class="mt-15 mr-15" v-for="(file, fileIndex) in item.files" :key="fileIndex">
<file-type :item="file" @click.native="previewFile(file)"/>
</view>
</view>
</view>
<text class="flex-1">
<el-button type="primary" v-if="sheet.status === 0 && sheet.type !== 3"
@click.native="confirmQuote(item._id)">
选择
</el-button>
<el-button type="primary" v-if="sheet.status === 1 && sheet.type !== 3"
@click.native="toSign(item._id)">
去签约
</el-button>
</text>
</view>
</view>
</el-dialog>
<el-dialog title="图片预览" :visible.sync="showImagePreview" width="80%" append-to-body>
<img v-if="previewImageUrl" class="preview-image" :src="previewImageUrl" alt="附件预览"/>
</el-dialog>
</view>
</template>
<script>
import {BuildingOne, IdCard} from "@icon-park/vue";
import {BuildingOne, FileExcel, FilePdfOne, FileWord, IdCard} from "@icon-park/vue";
import dayjs from "dayjs";
import {WRITE_INVOICE_TIME, INVOICE_TYPE, PROCESS_PAY_METHOD} from '@/util'
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: {BuildingOne, IdCard},
components: {FileType, FileExcel, FilePdfOne, FileWord, BuildingOne, IdCard},
data() {
return {
oldType: [
'拍卖信息',
'采购信息',
'承租信息',
'物资回收信息',
],
provinceData: provinces,
cityData: citys,
areaData: areas,
WRITE_INVOICE_TIME,
INVOICE_TYPE,
PROCESS_PAY_METHOD,
id: undefined,
showDialog: false,
showImagePreview: false,
previewImageUrl: '',
productList: [],
sheetTitle: '',
sheet: {
@@ -206,129 +416,36 @@ export default {
productList: [],
transportDocuments: []
},
table1: {
// 表格数据
data: [],
// 表格字段显示规则
columns: [{
key: "subjectName",
title: "供应商",
type: "text",
width: 300,
formatter: (val, row, column, index) => {
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId) {
return val
userInfo: {
userLevel: -1
}
if (row.accountType == 1) {
return vk.pubfn.hidden(val, 1, 1);
} else {
return vk.pubfn.hidden(val, 2, 4);
}
}
},
{
key: "_add_time_str",
title: "报价时间",
type: "text",
width: 200
},
{
key: "subjectMobile",
title: "联系方式",
type: "text",
width: 120,
formatter: (val, row, column, index) => {
let str = val
if (row.managerMobile) {
str = row.managerMobile
}
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId) {
return str
}
return vk.pubfn.hidden(str, 3, 4);
}
},
{
key: "totalPrice",
title: "报价",
type: "textarea",
width: 130,
formatter: (val, row, column, index) => {
let str = val
if (row.managerMobile) {
str = row.managerMobile
}
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId) {
return val
}
return "******";
}
},
],
customRightBtns: [
{
title: '合同',
type: 'primary',
icon: 'el-icon-search',
show: (row) => {
return vk.getVuex('$user.userInfo._id') == this.sheet.userId && row.status == 1
},
onClick: (item) => {
vk.navigateTo('/pages/contract/index');
},
},
{
title: '选择',
type: 'primary',
icon: 'el-icon-search',
show: (row) => {
return vk.getVuex('$user.userInfo._id') == this.sheet.userId && row.status == 0
},
onClick: (item) => {
vk.callFunction({
url: 'client/enquiry/quote/kh/confirmQuote',
title: '请求中...',
data: {
quoteId: item._id,
},
success: (data) => {
vk.navigateTo('/pages/contract/index');
}
});
},
},
{
title: '查看报价详情',
type: 'primary',
icon: 'el-icon-search',
disabled: (item) => {
return vk.getVuex('$user.userInfo._id') != this.sheet.userId
},
onClick: (item) => {
this.showDialog = true
}
},
]
},
};
},
onLoad(options = {}) {
async onLoad(options = {}) {
const {
id
} = options
if (!id) {
vk.navigateTo('/pages/enquiry/list');
vk.navigateBack()
return
}
this.id = id
if (this.isLoggedIn) {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
this.userInfo = userInfo
}
this.getDetail()
},
computed: {
isLoggedIn() {
return !!vk.getVuex('$user.userInfo._id')
}
},
methods: {
dayjs,
/**
@@ -343,16 +460,152 @@ export default {
},
success: (res) => {
this.sheet = res
this.sheet.address = ''
this.sheet.deliverAddress = ''
this.sheet.offerAddress = ''
if (this.sheet.addressRegion && this.sheet.addressRegion.length > 0)
this.sheet.address = this.sheet?.addressRegion[0]?.name + this.sheet?.addressRegion[1]?.name + this.sheet?.addressRegion[2]?.name + this.sheet.addressDetail
if (this.sheet.deliverAddress && this.sheet.deliverAddress.length > 0)
this.sheet.deliverAddress = this.sheet?.deliverAddressRegion[0]?.name + this.sheet?.deliverAddressRegion[1]?.name + this.sheet?.deliverAddressRegion[2]?.name + this.sheet.addressDetail
if (this.sheet.offerAddress && this.sheet.offerAddress.length > 0)
this.sheet.offerAddress = !this.sheet.offerAddressNoLimit ? (this.sheet?.offerAddressRegion[0]?.name + this.sheet?.offerAddressRegion[1]?.name + this.sheet?.offerAddressRegion[2]?.name) : '无限制'
this.sheet.expiredTime = dayjs(this.sheet.expiredTime).format('YYYY-MM-DD')
}
});
},
async toQuote() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
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 {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: `/pages/index/old/quote?id=${this.id}`
})
}
},
async confirmQuote(quoteId) {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (userInfo.qybNum <= 0) {
this.showDialog = false
this.$confirm('您的金久信签约宝次数不足,请先购买', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/contract/index?tab=sign'});
})
return
}
await vk.callFunction({
url: 'client/old/kh/confirmQuote',
title: '请求中...',
data: {
quoteId,
}
});
this.showDialog = false
this.$message({
message: "选择成功",
type: 'success'
})
if (this.sheet.signMethod === 0) vk.navigateTo('/pages/contract/index?tab=1')
else {
if (this.sheet.signMethod === 1) vk.navigateTo('/pages/store/store?menuIndex=2')
else vk.navigateTo('/pages/contract/index?tab=0&tradeMethod=0')
}
},
toSign() {
this.showDialog = false
if (this.sheet.signMethod === 0) vk.navigateTo('/pages/contract/index?tab=1')
else {
if (this.sheet.signMethod === 1) vk.navigateTo('/pages/store/store?menuIndex=2')
else vk.navigateTo('/pages/contract/index?tab=0&tradeMethod=0')
}
},
getFileExt(url = "") {
const cleanUrl = String(url).split("?")[0].split("#")[0]
const match = cleanUrl.match(/\.([a-z0-9]+)$/i)
return match ? match[1].toLowerCase() : ""
},
isImageFile(url) {
return ["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg"].includes(this.getFileExt(url))
},
isPdfFile(url) {
return this.getFileExt(url) === "pdf"
},
isOfficeFile(url) {
return ["doc", "docx", "xls", "xlsx", "ppt", "pptx"].includes(this.getFileExt(url))
},
getOfficePreviewUrl(url) {
return `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(url)}`
},
previewFile(url) {
if (!url) return
if (this.isImageFile(url)) {
this.previewImageUrl = url
this.showImagePreview = true
return
}
if (this.isPdfFile(url)) {
window.open(url, "_blank")
return
}
if (this.isOfficeFile(url)) {
window.open(this.getOfficePreviewUrl(url), "_blank")
return
}
window.open(url, "_blank")
},
openDownload(url) {
this.previewFile(url)
},
toCompany() {
if (this.sheet.user.showInYellow && this.sheet.user.showInYellow === 1) {
vk.navigateTo({
url: `/pages/yellowPage/info?id=${this.sheet.user._id}`
})
}
}
}
}
</script>
<style lang="scss" scoped>
@import "@/common/css/app.scss";
.page-main {
width: 1200px;
margin: 20px auto;
@@ -382,15 +635,19 @@ export default {
.form-title {
padding-left: 10px;
color: $--color-primary;
color: #A92924;
font-size: 18px;
line-height: 18px;
border-left: 4px solid $--color-primary;
border-left: 4px solid #A92924;
}
}
}
.tip-text {
color: #f56c6c;
}
.request-header {
border: 1px solid #EDEDED;
background-color: #FFF8F1;
@@ -418,4 +675,15 @@ export default {
text-align: center;
}
}
.hover:hover {
color: #a92924;
}
.preview-image {
display: block;
max-width: 100%;
max-height: 75vh;
margin: 0 auto;
}
</style>
+580 -46
View File
@@ -8,9 +8,9 @@
<el-breadcrumb separator=">">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>
<navigator style="display: inline-block;" url="/pages/index/old/list/list">旧货交易</navigator>
<navigator style="display: inline-block;" url="/pages/index/old/old">旧货交易</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item class="text-main">采购信息</el-breadcrumb-item>
<el-breadcrumb-item class="text-main">{{ oldType[type] }}</el-breadcrumb-item>
</el-breadcrumb>
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布旧货交易</el-button>
@@ -19,39 +19,41 @@
</el-row>
</view>
<!-- 筛选表单 -->
<view class="filter-outer">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词" class="border-bottom pb-30">
<el-input @keyup.enter.native="search(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
<el-input @keyup.enter.native="searchKeyword(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="search(1)" type="primary" slot="append" style="border-radius: 0">搜索
<el-button @click="searchKeyword(1)" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
</el-form-item>
<el-form-item label="物资分类" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="clickedCateIndex = -1" class="pointer mr-25"
<text @click="selectCate(-1)" class="pointer mr-25"
:class="[clickedCateIndex === -1 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in categoryTreeData" :key="index">
<text @click="clickedCateIndex = index" class="pointer mr-25"
:class="[clickedCateIndex === index ? 'text-main selected-cate' : '']"
v-if="index < 10">
:class="[clickedCateIndex === index ? 'text-main selected-cate' : '']">
{{ item.name }}
</text>
</view>
<text @click="selectCate(-2)" class="pointer mr-25"
:class="[clickedCateIndex === -2 ? 'text-main selected-cate' : '']">
其他
</text>
</view>
<view class="child-cate flex justify-start items-center flex-wrap">
<view class="child-cate flex justify-start items-center flex-wrap" v-if="clickedCateIndex !== -2">
<template v-if="clickedCateIndex === -1">
<text class="pointer mr-25" @click="selectCate(item._id)"
<text class="pointer mr-25" @click="selectCate(item._id, item.name)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in allChildCate" :key="index">{{ item.name }}
</text>
</template>
<template v-else>
<text class="pointer mr-25" @click="selectCate(item._id)"
<text class="pointer mr-25" @click="selectCate(item._id, item.name)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in categoryTreeData[clickedCateIndex].children" :key="index">
{{ item.name }}
@@ -59,7 +61,7 @@
</template>
</view>
</el-form-item>
<el-form-item label="筛选区域" class="border-bottom pb-30">
<el-form-item label="筛选省份" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectProvince(-1)" class="pointer mr-25 flex-grow-0"
:class="[checkProvinceList.length === 0 ? 'text-main selected-cate' : '']">全国
@@ -71,9 +73,17 @@
{{ item.name }}
</text>
</view>
<text @click="showAllProvince = !showAllProvince" class="pointer mr-25">查看更多
</view>
</el-form-item>
<el-form-item label="筛选城市" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap" v-if="provinceIndex > -1">
<view v-for="(item, index) in cityData[provinceIndex]" :key="index" class="flex-grow-0 pointer mr-25">
<text @click="selectCity(item.code)"
:class="[checkedCity === item.code? 'text-main selected-cate' : '']">
{{ item.name }}
</text>
</view>
</view>
</el-form-item>
<el-form-item label="已选">
<view class="tags">
@@ -83,24 +93,129 @@
</el-form>
</view>
<div class="flex justify-between items-center w-1200 m-a" v-if="type === 0">
<template v-if="ad15.length">
<el-carousel :height="`100px`" :style="{width: ad16.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad15" :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="ad16.length">
<el-carousel :height="`100px`" :style="{width: ad15.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad16" :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" v-if="type === 1">
<template v-if="ad17.length">
<el-carousel :height="`100px`" :style="{width: ad18.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad17" :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="ad18.length">
<el-carousel :height="`100px`" :style="{width: ad17.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad18" :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" v-if="type === 2">
<template v-if="ad19.length">
<el-carousel :height="`100px`" :style="{width: ad20.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad19" :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="ad20.length">
<el-carousel :height="`100px`" :style="{width: ad19.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad20" :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" v-if="type === 3">
<template v-if="ad21.length">
<el-carousel :height="`100px`" :style="{width: ad22.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad21" :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="ad22.length">
<el-carousel :height="`100px`" :style="{width: ad21.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad22" :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="goods-list">
<view class="flex justify-start items-center my-20" v-if="parseInt(type) === 2">
<el-button @click="changeType(0)" type="primary" :plain="rentType === 1" round>承租信息</el-button>
<el-button @click="changeType(1)" type="primary" :plain="rentType === 0" round>出租信息
</el-button>
</view>
<view v-for="(item, index) in goodsData.rows" :key="index" class="goods">
<view class="goods-info">
<!-- <el-image src="https://oss.wsdns.cn/20231204/d35332fa6a3b4596b522edf9527ac612.png"-->
<!-- class="goods-img"/>-->
<view class="info">
<view class="goods-name pointer" @click="navTo(`/pages/index/old/detail?id=${item._id}`)">{{ item.title }}</view>
<view class="goods-name pointer" @click="navTo(`/pages/index/old/detail?id=${item._id}`)">
<span>{{ item.title }}</span>
<span v-if="item.isUrgent" class="text-main font-bold">[加急]</span>
</view>
<view class="field">
<view class="desc">
<template v-if="![0, 2, 3].includes(item.type) ">
<template v-if="item.buyer.companyName">
<view class="text">企 业</view>
<view>{{ item.buyer.companyName }}</view>
</template>
<template v-if="item.buyer.personName">
<view class="text">个 人</view>
<view>{{ item.buyer.personName }}</view>
</template>
</template>
<template v-else>
<template v-if="item.supplier.companyName">
<view class="text">企 业</view>
<view>{{ item.supplier.companyName }}</view>
</template>
<template v-if="item.supplier.personalName">
<view class="text">个 人</view>
<view>{{ item.supplier.personalName }}</view>
</template>
</template>
</view>
<view class="desc"></view>
<view class="desc">
<view class="text">所属分类</view>
<view>{{ item.category }}</view>
<view>{{ item.category[1] }}</view>
</view>
<view class="desc">
<view class="text">发布时间</view>
@@ -118,12 +233,35 @@
</view>
</view>
<view class="buttons">
<button type="default" class="btn" plain @click="showCntract(item)">查看电话
<button type="default" class="btn" plain @click="doShowContract(index)">查看电话
</button>
<button type="default" class="btn green" plain>添加微信
<button type="default" class="btn green" plain @click="doShowWechat(index)">添加微信
</button>
<button type="default" class="btn" plain>向此卖家询价
<template v-if="item.type !== 3">
<button type="default" class="btn" plain v-if="item.type !== 2"
@click="navTo(`/pages/index/old/detail?id=${item._id}`)">
{{ item.uid === vk.getVuex('$user.userInfo._id') ? '查看报价' : '我要报价' }}
</button>
<button type="default" class="btn" plain v-else-if="item.type === 2 && item.rentType === 0"
@click="navTo(`/pages/index/old/detail?id=${item._id}`)">
{{ item.uid === vk.getVuex('$user.userInfo._id') ? '查看报价' : '我要报价' }}
</button>
</template>
<view class="wechat"
v-if="item.user && parseInt(item.user.accountType) === 2 && item.user.businessCard && item.user.businessCard.companyWechat && item.showWechat">
<el-image :src="item.user.businessCard.companyWechat" style="width: 100%; height: 100%"/>
</view>
<view class="wechat"
v-if="item.user && parseInt(item.user.accountType) === 1 && item.user.businessCard && item.user.businessCard.personalWechat && item.showWechat">
<el-image :src="item.user.businessCard.personalWechat" style="width: 100%; height: 100%"/>
</view>
<view class="mobile" v-if="item.user && item.showContract && item.user.businessCard">
<i class="el-icon-phone"></i>
<text class="ml-20">{{
(item.user.businessCard && item.user.businessCard.companyMobile) ? item.user.businessCard.companyMobile : '暂无电话'
}}
</text>
</view>
</view>
</view>
@@ -140,35 +278,55 @@
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import dayjs from "dayjs";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
export default {
data() {
return {
oldType: [
'拍卖信息',
'采购信息',
'承租信息',
'物资回收信息',
],
categoryTreeData: [],
allChildCate: [],
checkCategoryList: [],
clickedCateIndex: -1,
provinceData: provinces,
cityData: citys,
checkProvinceList: [],
provinceIndex: -1,
checkedCity: null,
keyword: '',
goodsData: {
total: 0,
rows: []
},
showAllProvince: false,
showAllProvince: true,
type: 0,
pageSize: 20,
rentType: 0,
ad15: [],
ad16: [],
ad17: [],
ad18: [],
ad19: [],
ad20: [],
ad21: [],
ad22: [],
};
},
onLoad(option) {
if (option.type) this.type = option.type
if (option.type) this.type = parseInt(option.type)
console.log(this.cityData)
},
onShow() {
this.search(1)
vk.callFunction({
url: 'client/spot/category/pub/getTree',
url: 'client/old/pub/getTree',
title: '请求中...',
data: {},
data: {type: parseInt(this.type)},
success: (data) => {
this.categoryTreeData = data.rows
this.allChildCate = []
@@ -186,19 +344,48 @@ export default {
url
})
},
selectCate(id) {
const index = this.checkCategoryList.indexOf(id)
if (index === -1) this.checkCategoryList.push(id)
else this.checkCategoryList.splice(index, 1)
searchKeyword() {
this.clickedCateIndex = -1
this.checkCategoryList = []
this.search(1)
},
selectProvince(code) {
if (code === -1) this.checkProvinceList = []
else {
const index = this.checkProvinceList.indexOf(code)
if (index === -1) this.checkProvinceList.push(code)
else this.checkProvinceList.splice(index, 1)
selectCate(id, name) {
if (id === -2) {
this.clickedCateIndex = -2
this.checkCategoryList = [-2]
this.search(1)
} else if (id === -1) {
this.clickedCateIndex = -1
this.checkCategoryList = []
this.search(1)
} else {
const index = this.checkCategoryList.indexOf(id)
if (index === -1) {
this.checkCategoryList.push(id)
} else {
this.checkCategoryList.splice(index, 1)
}
this.keyword = null
this.search(1)
}
},
selectProvince(code) {
this.provinceIndex = -1
if (code === -1) {
this.checkProvinceList = []
this.checkedCity = null
} else {
// const index = this.checkProvinceList.indexOf(code)
// if (index === -1) this.checkProvinceList.push(code)
// else this.checkProvinceList.splice(index, 1)
this.checkProvinceList = [code]
this.provinceIndex = this.provinceData.findIndex(item => item.code === code)
}
this.search(1)
},
selectCity(code) {
if (this.checkedCity === code) this.checkedCity = null
else this.checkedCity = code
this.search(1)
},
async toRelease() {
@@ -208,7 +395,7 @@ export default {
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@@ -218,18 +405,30 @@ export default {
});
})
} 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'
url: '/pages/user/user?menu=fadada'
});
})
} else {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
let url = '/pages/index/old/release'
if (this.type !== undefined) {
url += `?type=${this.type}`
}
vk.navigateTo({
url: '/pages/index/old/release'
url
})
}
},
@@ -240,20 +439,20 @@ export default {
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm && userInfo.authStatus === 1) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.getCertUrl()
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('/pages/user/user?menu=business-card');
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
vk.navigateTo({
@@ -263,24 +462,62 @@ export default {
},
search(pageIndex) {
let categoryIds = []
if (this.checkCategoryList.length === 1 && this.checkCategoryList[0] === -2) categoryIds.push(0)
else {
categoryIds = this.checkCategoryList
this.allChildCate.map(item => {
if (this.checkCategoryList.indexOf(item._id) > -1) categoryIds.push(item.name)
})
}
vk.callFunction({
url: 'client/old/pub/getList',
title: '加载中...',
data: {
pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
type: this.type,
categoryIds: this.checkCategoryList,
provinceCodes: this.checkProvinceList
categoryIds,
provinceCodes: this.checkProvinceList,
cityCode: this.checkedCity,
rentType: this.rentType
},
success: (data) => {
console.log('data: ', data);
data.rows.map(item => {
item.addressStr = item.addressRegion[0].name + "-" + item.addressRegion[1].name
item.expiredTime = dayjs(item.expiredTime).format('YYYY-MM-DD')
if (item.type === 1) item.addressStr = (item.deliverAddressRegion && item.deliverAddressRegion.city) ? (item.deliverAddressRegion.province.name + "-" + item.deliverAddressRegion.city.name) : ''
else {
if (item.type === 2) {
if (item.addressRegion && item.addressRegion.city) {
item.addressStr = (item.addressRegion && item.addressRegion.city) ? (item.addressRegion.province.name + "-" + item.addressRegion.city.name) : ''
} else {
if (item.deliverAddressRegion && item.deliverAddressRegion.city) {
item.addressStr = (item.deliverAddressRegion && item.deliverAddressRegion.city) ? (item.deliverAddressRegion.province.name + "-" + item.deliverAddressRegion.city.name) : ''
}
}
}else {
item.addressStr = (item.addressRegion && item.addressRegion.city) ? (item.addressRegion.province.name + "-" + item.addressRegion.city.name) : (item.deliverAddressRegion.province.name + "-" + item.deliverAddressRegion.city.name)
}
}
item.expiredTime = item.expiredTime ? dayjs(item.expiredTime).format('YYYY-MM-DD') : ''
item.showWechat = false
item.showContract = false
return item
})
this.goodsData = data
if (this.type === 0) {
this.getAd15()
this.getAd16()
} else if (this.type === 1) {
this.getAd17()
this.getAd18()
} else if (this.type === 2) {
this.getAd19()
this.getAd20()
} else if (this.type === 3) {
this.getAd21()
this.getAd22()
}
}
});
},
@@ -292,6 +529,270 @@ export default {
}
});
},
doShowWechat(index) {
if (parseInt(this.goodsData.rows[index].user.accountType) === 2 && !this.goodsData.rows[index].user.businessCard.companyWechat)
return vk.toast('用户暂未上传')
else if (parseInt(this.goodsData.rows[index].user.accountType) === 1 && !this.goodsData.rows[index].user.businessCard.personalWechat)
return vk.toast('用户暂未上传')
this.goodsData.rows[index].showContract = false
this.goodsData.rows[index].showWechat = !this.goodsData.rows[index].showWechat
},
doShowContract(index) {
this.goodsData.rows[index].showWechat = false
this.goodsData.rows[index].showContract = !this.goodsData.rows[index].showContract
},
changeType(type) {
this.rentType = type
this.search(1)
},
async getAd15() {
this.ad15 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 15,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad15 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 1,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad15.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
async getAd16() {
this.ad16 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 16,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad16 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 2,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad16.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
async getAd17() {
this.ad17 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 17,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad17 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 1,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad17.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
async getAd18() {
this.ad18 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 18,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad18 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 2,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad18.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
async getAd19() {
this.ad19 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 19,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad19 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 1,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad19.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
async getAd20() {
this.ad20 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 20,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad20 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 2,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad20.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
async getAd21() {
this.ad21 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 21,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad21 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 1,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad21.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
async getAd22() {
this.ad22 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 22,
region: this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
}
})
if (res.data) this.ad22 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 2,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad22.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
},
computed: {
checkCategoryArr() {
@@ -304,6 +805,13 @@ export default {
arr.push(item)
}
})
if (this.provinceIndex > -1) {
this.cityData[this.provinceIndex].forEach(item => {
if (this.checkedCity === item.code) {
arr.push(item)
}
})
}
return arr
}
@@ -413,6 +921,7 @@ export default {
display: flex;
flex-direction: column;
justify-content: space-around;
position: relative;
.btn {
width: 120px;
@@ -422,6 +931,31 @@ export default {
background-color: #7ec050 !important;
color: #ffffff;
}
.wechat {
position: absolute;
left: -140px;
top: 0;
width: 150px;
height: 150px;
background-color: white;
border-radius: 10px;
padding: 5px;
box-shadow: 0 1px 10px 0 #eee
}
.mobile {
position: absolute;
left: -110px;
top: 10px;
background-color: white;
border-radius: 10px;
padding: 5px;
box-shadow: 0 1px 10px 0 #eee;
display: flex;
align-items: center;
justify-content: center;
}
}
&-title {
+91 -37
View File
@@ -12,13 +12,14 @@
</view> -->
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<!-- <el-carousel height="170px">-->
<!-- <el-carousel-item v-for="item in 4" :key="item">-->
<!-- <image class="carousel-img"-->
<!-- src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"-->
<!-- mode="aspectFill"></image>-->
<!-- </el-carousel-item>-->
<!-- </el-carousel>-->
<common-swiper page="old-mine" :height="200"/>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布旧货交易</el-button>
@@ -29,7 +30,8 @@
<!-- 商品列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns" :customRightBtns="table1.customRightBtns"
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns"
:pagination="true" :query-form-param="queryForm1"></vk-data-table>
</view>
@@ -69,8 +71,10 @@
icon: 'el-icon-delete',
type: 'primary',
onClick: (item) => {
this.$confirm('').then(()=> {
this.$confirm('如果你要删除此条信息,之前其他客户填写的留言将无法查看', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.callFunction({
url: 'client/old/kh/delete',
@@ -82,28 +86,39 @@
this.$refs.table1.refresh()
})
})
},
show: (item) => {
console.log(item.status)
return item.status === 0
}
},
],
// 表格字段显示规则
columns: [
{
key: "标题",
title: "title",
key: "title",
title: "标题",
type: "text",
width: 280
},
{
key: "productList",
key: "addressRegion",
title: "所在地",
type: "text",
minWidth: 200,
formatter: (val, row, column, index) => {
let str = ""
try {
str = val.map(item=>{
return item.addressRegion[0].name + "-" + item.addressRegion[1].name
}).join("/")
if (row.type === 1) str = (row.deliverAddressRegion && row.deliverAddressRegion.city) ? (row.deliverAddressRegion.province.name + "-" + row.deliverAddressRegion.city.name) : ''
else str = (row.addressRegion && row.addressRegion.city) ? (row.addressRegion.province.name + "-" + row.addressRegion.city.name) : ''
// if (row.type === 2) {
// str = row.offerAddressRegion.province.name + row.offerAddressRegion.city.name + row.offerAddressRegion.area.name
// } else if (row.type === 1) {
// str = row.deliverAddressRegion.province.name + row.deliverAddressRegion.city.name + row.deliverAddressRegion.area.name
// } else {
// str = val.province.name + val.city.name + val.area.name
// }
} catch (err) {
str = ""
}
@@ -112,12 +127,38 @@
}
},
{
key: "supplier.companyName",
title: "供应商",
key: "quoteNum",
title: "报价数",
type: "text",
formatter: (val, row, column, index) => {
return `${val}家已报价`
}
},
{
key: "_add_time_srt",
key: "type",
title: "类型",
type: "select",
data: [
{value: 0, label: '拍卖'},
{value: 1, label: '采购'},
{value: 2, label: '租赁'},
{value: 3, label: '物资回收'},
]
},
// {
// key: "supplier",
// title: "供应商",
// type: "text",
// formatter: (val, row, column, index) => {
// console.log(val.companyName, val.companyName === '')
// if (val.companyName && val.companyName !== '') return val.companyName
// else return val.personName
// // console.log((val.companyName && val.companyName !== ''), val.companyName)
// // return ((val.companyName && val.companyName !== '') ? val.companyName : val.personName)
// }
// },
{
key: "_add_time_str",
title: "添加时间",
type: "time",
width: 160
@@ -137,33 +178,47 @@
},
methods: {
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.getCertUrl()
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('请完善名片信息', '提示', {
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card');
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
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 {
uni.navigateTo({
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/index/old/release'
})
}
},
},
computed: {
@@ -225,7 +280,6 @@
}
.paginatio {
float: none;
width: 1200px;
+214 -119
View File
@@ -4,74 +4,74 @@
<common-header></common-header>
<category-bar></category-bar>
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img" src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
<el-carousel height="500px">
<common-swiper page="old"/>
</el-carousel>
<view class="goods-options">
<el-row class="">
<el-button @click="navTo('/pages/index/old/release')" type="primary" round>发布旧货交易</el-button>
<el-button @click="toRelease" type="primary" round>发布旧货交易</el-button>
<el-button @click="navTo('/pages/index/old/my')" type="primary" round plain
class="empty-bg-plain-btn">我发布的信息
</el-button>
<el-button @click="navTo('/pages/index/old/quote/my')" type="primary" round plain
class="empty-bg-plain-btn">我的报价
</el-button>
</el-row>
</view>
</view>
<view class="nav-tool">
<view class="btn pointer" @click="navTo('/pages/index/old/list/list')">
<image src="https://oss.wsdns.cn/20231204/bbd54039c69e4d0292c6889bce0ac088.png" mode="widthFix"/>
<image src="/static/images/old/btn01.png" mode="widthFix"/>
<text>拍卖信息</text>
</view>
<view class="btn pointer" @click="navTo('/pages/index/old/list/list?type=1')">
<image src="https://oss.wsdns.cn/20231204/bbd54039c69e4d0292c6889bce0ac088.png" mode="widthFix"/>
<image src="/static/images/old/btn02.png" mode="widthFix"/>
<text>采购信息</text>
</view>
<view class="btn pointer" @click="navTo('/pages/index/old/list/list?type=2')">
<image src="https://oss.wsdns.cn/20231204/bbd54039c69e4d0292c6889bce0ac088.png" mode="widthFix"/>
<image src="/static/images/old/btn03.png" mode="widthFix"/>
<text>租赁信息</text>
</view>
<view class="btn pointer" @click="navTo('/pages/index/old/list/list?type=3')">
<image src="https://oss.wsdns.cn/20231204/bbd54039c69e4d0292c6889bce0ac088.png" mode="widthFix"/>
<image src="/static/images/old/btn04.png" mode="widthFix"/>
<text>物资回收信息</text>
</view>
</view>
<view class="carousel news-list-1">
<view class="title">
成交动态
</view>
<view class="news-list">
<el-row class="wrap" type="flex" :gutter="10" justify="space-between">
<el-col :span="7" v-for="(item, index) in list" :key="index">
<view class="item">
<view class="text">[南宁]{{ item.title }}</view>
<view class="date-time">11-15</view>
</view>
</el-col>
</el-row>
</view>
</view>
<!-- <view class="carousel news-list-1">-->
<!-- <view class="title">-->
<!-- 成交动态-->
<!-- </view>-->
<!-- <view class="news-list">-->
<!-- <el-row class="wrap" type="flex" :gutter="10" justify="space-between">-->
<!-- <el-col :span="7" v-for="(item, index) in list" :key="index">-->
<!-- <view class="item">-->
<!-- <view class="text">[南宁]{{ item.title }}</view>-->
<!-- <view class="date-time">11-15</view>-->
<!-- </view>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </view>-->
<!-- </view>-->
<view class="carousel ad">
<el-row class="wrap" type="flex" :gutter="10" justify="space-between">
<el-col :span="12">
<div class="ad-img">
<el-image
src="http://jyx.gxwebsoft.com/uploads/20210817/57f8333bed0d3a4e2aac3fd251e19007.jpg"/>
</div>
</el-col>
<el-col :span="12">
<div class="ad-img">
<el-image
src="http://jyx.gxwebsoft.com/uploads/20210506/f3afbd29ce99dc6e2fdf4c8f3ec16221.jpg"/>
</div>
</el-col>
</el-row>
</view>
<!-- <view class="carousel ad">-->
<!-- <el-row class="wrap" type="flex" :gutter="10" justify="space-between">-->
<!-- <el-col :span="12">-->
<!-- <div class="ad-img">-->
<!-- <el-image-->
<!-- src="http://jyx.gxwebsoft.com/uploads/20210817/57f8333bed0d3a4e2aac3fd251e19007.jpg"/>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <div class="ad-img">-->
<!-- <el-image-->
<!-- src="http://jyx.gxwebsoft.com/uploads/20210506/f3afbd29ce99dc6e2fdf4c8f3ec16221.jpg"/>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </view>-->
<view class="carousel news-list-1">
@@ -79,26 +79,32 @@
加急公告
</view>
<view class="news-gg">
<el-row class="wrap" type="flex" :gutter="0" justify="space-between">
<el-col :span="12" v-for="(item, index) in Math.ceil(noticeList.length / 3)" :key="index">
<view class="item">
<view class="new-avatar">
<el-image class="image" fit="cover"
:src="noticeList[index].cover[0]"/>
</view>
<view class="list3">
<view v-for="(noticeItem, noticeIndex) in 3" :key="noticeIndex"
@click="navTo(`/pages/otherArticle/noticeDetail?id=${noticeList[index * 3 + noticeIndex]._id}`)">
<view class="text pointer" v-if="index * 3 + noticeIndex < noticeList.length">
<span>[{{ noticeList[index * 3 + noticeIndex].address.city.name }}]</span>
<text>{{ noticeList[index * 3 + noticeIndex].name }}</text>
<span class="ml-20">{{ noticeList[index * 3 + noticeIndex].addTime }}</span>
<el-carousel height="50px" direction="vertical" autoplay class="w-100p">
<el-carousel-item v-for="i in Math.ceil(urgentList.length / 4)" :key="i">
<view class="flex justify-start items-start flex-wrap">
<view class="item w-50p mb-10" v-for="index in 4" :key="index">
<template v-if="urgentList[(i - 1) * 4 + (index - 1)]">
<view
@click="navTo(`/pages/index/old/detail?id=${urgentList[(i - 1) * 4 + (index - 1)]._id}`)">
<view class="text pointer">
<span class="text-gray" v-if="urgentList[(i - 1) * 4 + (index - 1)].addressRegion && urgentList[(i - 1) * 4 + (index - 1)].addressRegion.city">[{{
urgentList[(i - 1) * 4 + (index - 1)].addressRegion.city.name
}}]</span>
<span class="text-gray" v-if="!urgentList[(i - 1) * 4 + (index - 1)].addressRegion && urgentList[(i - 1) * 4 + (index - 1)].deliverAddressRegion && urgentList[(i - 1) * 4 + (index - 1)].deliverAddressRegion.city">
{{ urgentList[(i - 1) * 4 + (index - 1)].deliverAddressRegion.city.name }}
</span>
<span class="urgent">[加急]</span>
<text>{{ urgentList[(i - 1) * 4 + (index - 1)].title }}</text>
<span class="ml-20">{{
urgentList[(i - 1) * 4 + (index - 1)].addTime
}}</span>
</view>
</view>
</template>
</view>
</view>
</el-col>
</el-row>
</el-carousel-item>
</el-carousel>
</view>
</view>
@@ -115,13 +121,19 @@
<view class="list8">
<view class="article pointer" v-for="(item, index) in dataList[0]" :key="index"
@click="navTo(`/pages/index/old/detail?id=${item._id}`)">
<view class="title2" v-if="index < 3">
<span>[{{ item.addressRegion[1].name }}]</span>
<view class="title2 " v-if="index < 8">
<view class="flex justify-start">
<span v-if="item.addressRegion && item.addressRegion.city ">[{{
item.addressRegion.city.name
}}]</span>
<span v-else>[区域不限]</span>
<span class="urgent" v-if="item.isUrgent">[加急]</span>
<text class="line-1 ">{{ item.title }}</text>
</view>
<view class="date-time">{{ item.addDate }}</view>
</view>
</view>
</view>
</el-card>
</el-col>
<el-col :span="12">
@@ -135,13 +147,23 @@
<view class="list8">
<view class="article pointer" v-for="(item, index) in dataList[1]" :key="index"
@click="navTo(`/pages/index/old/detail?id=${item._id}`)">
<view class="title2" v-if="index < 3">
<span>[{{ item.addressRegion[1].name }}]</span>
<view class="title2" v-if="index < 8">
<view class="flex justify-start">
<span v-if="item.addressRegion && item.addressRegion.city">[{{
item.addressRegion.city.name
}}]</span>
<template v-else>
<span v-if="item.deliverAddressRegion && item.deliverAddressRegion.city">[{{
item.deliverAddressRegion.city.name
}}]</span>
</template>
<span class="urgent" v-if="item.isUrgent">[加急]</span>
<text class="line-1 ">{{ item.title }}</text>
</view>
<view class="date-time">{{ item.addDate }}</view>
</view>
</view>
</view>
</el-card>
</el-col>
<el-col :span="12">
@@ -155,13 +177,19 @@
<view class="list8">
<view class="article pointer" v-for="(item, index) in dataList[2]" :key="index"
@click="navTo(`/pages/index/old/detail?id=${item._id}`)">
<view class="title2" v-if="index < 3">
<span>[{{ item.addressRegion[1].name }}]</span>
<view class="title2" v-if="index < 8">
<view class="flex justify-start">
<span v-if="item.offerAddressRegion && item.offerAddressRegion.city">[{{
item.offerAddressRegion.city.name
}}]</span>
<span v-else>[区域不限]</span>
<span class="urgent" v-if="item.isUrgent">[加急]</span>
<text class="line-1">{{ item.title }}</text>
</view>
<view class="date-time">{{ item.addDate }}</view>
</view>
</view>
</view>
</el-card>
</el-col>
<el-col :span="12">
@@ -175,13 +203,19 @@
<view class="list8">
<view class="article pointer" v-for="(item, index) in dataList[3]" :key="index"
@click="navTo(`/pages/index/old/detail?id=${item._id}`)">
<view class="title2" v-if="index < 3">
<span>[{{ item.addressRegion[1].name }}]</span>
<view class="title2" v-if="index < 8">
<view class="flex justify-start">
<span v-if="item.addressRegion && item.addressRegion.city">[{{
item.addressRegion.city.name
}}]</span>
<span v-else>[区域不限]</span>
<span class="urgent" v-if="item.isUrgent">[加急]</span>
<text class="line-1">{{ item.title }}</text>
</view>
<view class="date-time">{{ item.addDate }}</view>
</view>
</view>
</view>
</el-card>
</el-col>
</el-row>
@@ -194,13 +228,22 @@
style="width: 180px"/>
</view>
<u-gap height="1" 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">
<view class="border bg-white flex flex-col justify-center items-center p-20">
<image :src="item.businessCard.logo" class="logo"/>
<span class="mt-20 line-1 w-100p text-center">
主营: {{ item.businessCard.mainBusiness }}
<view class="flex justify-start items-center flex-wrap">
<view class="w-25p pointer" v-for="(item, index) in companyList" :key="index"
@click="navTo(`/pages/yellowPage/info?id=${item.uid}`)">
<view class="border bg-white flex flex-col justify-start items-start p-20" style="height: 250rpx">
<view class="flex justify-start items-start">
<image v-if="item.businessCard" :src="item.businessCard.logo" class="logo"/>
<image v-else src="/static/images/no-logo.jpg" class="logo" mode="aspectFill"/>
<p class="text-28 font-bold mb-25 ml-10 text-center mt-10">{{ item.company.companyName }}</p>
</view>
<div class="flex flex-col justify-start items-start w-100p">
<span class="mt-20 line-2 w-100p">
主营: {{
(item.mainSpotCategory && item.mainSpotCategory.length > 0) ? item.mainSpotCategory.join() : ''
}}
</span>
</div>
</view>
</view>
</view>
@@ -227,54 +270,81 @@ export default {
name: ''
},
companyList: [],
list: [
{
id: 1,
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
{
id: 2,
image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
title: '身无彩凤双飞翼,心有灵犀一点通'
},
{
id: 3,
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
},
{
id: 4,
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
},
{
id: 5,
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
},
{
id: 6,
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}
],
dataList: [],
noticeList: [],
urgentList: [],
allChildCate: [],
};
},
onLoad(options) {
if (options && options.id) {
this.getInfo(options.id)
}
this.getCompanyList()
this.getCategoryTreeData()
this.getDataList()
this.getNoticeList()
this.getUrgentList()
},
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()
}
});
},
navTo(url) {
vk.navigateTo(url);
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
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 {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/index/old/release'
})
}
},
async getInfo(id) {
this.info = await vk.callFunction({
url: 'client/goods/list/pub/getDetail',
@@ -283,21 +353,23 @@ export default {
}
})
},
async getNoticeList() {
const {rows} = await vk.callFunction({
url: 'client/notice/list/pub/getList'
})
this.noticeList = rows.map(item => {
item.addTime = dayjs(item._add_time).format('MM-DD')
return item
})
},
async getCompanyList() {
const {rows} = await vk.callFunction({
url: 'client/user/pub/getCompany',
data: {isCoop: 1}
})
this.companyList = rows
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 getDataList() {
for (let i = 0; i < 4; i++) {
@@ -311,8 +383,20 @@ export default {
item.addDate = dayjs(item._add_time).format('MM-DD')
return item
})
this.$forceUpdate()
}
console.log(this.dataList)
},
async getUrgentList() {
const {rows} = await vk.callFunction({
url: 'client/old/pub/getList',
data: {
isUrgent: true
}
})
this.urgentList = rows.map(item => {
item.addDate = dayjs(item._add_time).format('MM-DD')
return item
})
}
}
}
@@ -463,6 +547,7 @@ export default {
.new-box {
margin-bottom: 20px;
height: 600rpx;
.title {
color: #bf2b28;
@@ -481,6 +566,7 @@ export default {
}
.article {
.title2 {
display: flex;
justify-content: space-between;
line-height: 2em;
@@ -490,6 +576,11 @@ export default {
}
}
.title2:hover {
color: #a92924;
}
}
.text {
line-height: 1.8em;
overflow: hidden;
@@ -534,8 +625,8 @@ export default {
}
.logo {
width: 80px;
height: 80px;
width: 40px;
height: 40px;
}
}
@@ -577,4 +668,8 @@ export default {
.intro {
border-top: 1px solid #F95F6E;
}
.urgent {
color: #bf2b28 !important;
}
</style>
+429
View File
@@ -0,0 +1,429 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>
<navigator style="display: inline-block;" url="/pages/index/old/old">旧货交易</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item>填写报价信息</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="page-main">
<quote-remain-num v-if="reloaded" :amount="sheet.quoteAmount" type="old" :id="id"/>
<template v-if="sheet.type === 1">
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
采购商信息
</view>
<text class="tip-text ml-10">(注册可查看信息)</text>
</view>
</view>
<template v-if="isLoggedIn && (sheet.isMine || sheet.hasQuote || userInfo.userLevel > 0)">
<view class="mt-15" v-if="sheet.buyer.companyName">公司信息:{{
sheet.buyer.companyName ? sheet.buyer.companyName : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.contract">公司联系方式:{{
sheet.buyer.contract ? sheet.buyer.contract : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.personalName">个人信息:{{
sheet.buyer.personalName ? sheet.buyer.personalName : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.personalContract">个人联系方式:{{
sheet.buyer.personalContract ? sheet.buyer.personalContract : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.managerName">授权人姓名:{{
sheet.buyer.managerName ? sheet.buyer.managerName : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.managerContract">授权联系方式:{{
sheet.buyer.managerContract ? sheet.buyer.managerContract : ''
}}
</view>
</template>
<template v-else>
<view class="mt-15" v-if="sheet.buyer.companyName">公司信息:{{
sheet.buyer.companyName ? sheet.buyer.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.contract">公司联系方式:{{
sheet.buyer.contract ? (sheet.buyer.contract.slice(0, 3) + '*'.repeat(sheet.buyer.contract.length - 7) + sheet.buyer.contract.slice(-4)) : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.personalName">个人信息:{{
sheet.buyer.personalName ? sheet.buyer.personalName.replace(/^(.).*(.)$/, "$1***$2") : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.personalContract">个人联系方式:{{
sheet.buyer.personalContract ? sheet.buyer.personalContract.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.managerName">授权人姓名:{{
sheet.buyer.managerName ? sheet.buyer.managerName.replace(/^(.).*(.)$/, "$1***$2") : ''
}}
</view>
<view class="mt-15" v-if="sheet.buyer.managerContract">授权联系方式:{{
sheet.buyer.managerContract ? sheet.buyer.managerContract.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
</template>
</view>
</template>
<template v-else>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
{{ sheet.type === 3 ? '回收单位信息' : '供货商信息' }}
</view>
<text class="tip-text ml-10">(注册可查看信息)</text>
</view>
</view>
<template v-if="isLoggedIn && (sheet.isMine || sheet.hasQuote || userInfo.userLevel > 0)">
<view class="mt-15" v-if="sheet.supplier.companyName">公司信息:{{
sheet.supplier.companyName ? sheet.supplier.companyName : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.contract">公司联系方式:{{
sheet.supplier.contract ? sheet.supplier.contract : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.personalName">个人信息:{{
sheet.supplier.personalName ? sheet.supplier.personalName : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.personalContract">
个人联系方式:{{
sheet.supplier.personalContract ? sheet.supplier.personalContract : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.managerName">授权人姓名:{{
sheet.supplier.managerName ? sheet.supplier.managerName : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.managerContract">授权联系方式:{{
sheet.supplier.managerContract ? sheet.supplier.managerContract : ''
}}
</view>
</template>
<template v-else>
<view class="mt-15" v-if="sheet.supplier.companyName">公司信息:{{
sheet.supplier.companyName ? sheet.supplier.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.contract">公司联系方式:{{
sheet.supplier.contract ? (sheet.supplier.contract.slice(0, 3) + '*'.repeat(sheet.supplier.contract.length - 7) + sheet.supplier.contract.slice(-4)) : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.personalName">个人信息:{{
sheet.supplier.personalName ? sheet.supplier.personalName.replace(/^(.).*(.)$/, "$1***$2") : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.personalContract">
个人联系方式:{{
sheet.supplier.personalContract ? sheet.supplier.personalContract.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.managerName">授权人姓名:{{
sheet.supplier.managerName ? sheet.supplier.managerName.replace(/^(.).*(.)$/, "$1***$2") : ''
}}
</view>
<view class="mt-15" v-if="sheet.supplier.managerContract">授权联系方式:{{
sheet.supplier.managerContract ? sheet.supplier.managerContract.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2") : ''
}}
</view>
</template>
</view>
</template>
<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"
:auto-close="false"
label-width="140px"
:show-cancel="false"
@success="onFormSuccess"
>
<template v-slot:totalPrice>
<el-input v-if="sheet.type === 2 && sheet.rentType === 1" v-model="form1.data.totalPrice"
placeholder="请输入询价内容"/>
<el-input v-else v-model="form1.data.totalPrice" placeholder="请输入总价"
@change="formatNumber"></el-input>
</template>
</vk-data-form>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
import dayjs from "dayjs";
export default {
data() {
return {
id: null,
userInfo: {
userLevel: -1
},
sheet: {
buyer: {},
supplier: {}
},
reloaded: false,
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
// radio: 1,
// checkbox : [1,2]
sheetId: null,
files: []
},
// 表单属性
props: {
// 表单请求地址
action: "client/old/kh/addQuote",
// 表单字段显示规则
columns: [
{
key: "totalPrice", title: "总价(人民币:元)", type: "number", showRule: () => {
return this.sheet.type !== 0 && (this.sheet.type !== 2 || (this.sheet.type === 2 && this.sheet.rentType === 0))
}
},
{
key: "unit", title: "计价单位", type: "text", showRule: () => {
return this.sheet.type === 0
}
},
{
key: "totalPrice", title: "单价(人民币:元)", type: "number", showRule: () => {
return this.sheet.type === 0
}
},
{
key: "totalPrice", title: '简述询价内容', type: "number", showRule: () => {
return this.sheet.type === 2 && this.sheet.rentType === 1
}
},
{key: "files", title: "附件", type: "file", accept: '.pdf', tips: '仅支持纵向PDF文档,报价附件将生成标准合同附件,请认真审阅。'},
{
key: "remark", title: "报价单详情", type: "textarea", showRule: () => {
return this.sheet.type !== 2 || (this.sheet.type === 2 && this.sheet.rentType === 0)
}
},
{
key: "remark", title: "询价详情", type: "textarea", showRule: () => {
return this.sheet.type === 2 && this.sheet.rentType === 1
}
},
{
key: "supplierExt", title: "报价补充条款", type: "textarea", showRule: () => {
return this.sheet.type !== 2 || (this.sheet.type === 2 && this.sheet.rentType === 0)
}
},
],
// 表单验证规则
rules: {
totalPrice: [
{required: true, message: "总价不能为空", trigger: "change,blur"},
],
unit: [
{required: true, message: "计价单位不能为空", trigger: "change,blur"},
],
files: [
{required: true, message: "附件不能为空", trigger: "change,blur"},
],
},
// add 代表添加 update 代表修改
formType: "",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false
}
},
// 表单相关结束-----------------------------------------------------------
};
},
async onLoad(options = {}) {
const {
id
} = options
if (!id) {
vk.navigateTo('/pages/index/old/old');
return
}
this.id = id
this.form1.data.sheetId = id
if (this.isLoggedIn) {
const {userInfo} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
this.userInfo = userInfo
}
this.getDetail()
},
computed: {
isLoggedIn() {
return !!vk.getVuex('$user.userInfo._id')
},
totalPriceStr() {
if (this.totalPrice === 0) {
return "零元"
}
return vk.myfn.convertCurrency(this.totalPrice / 100)
}
},
methods: {
getDetail() {
this.reloaded = false
vk.callFunction({
url: 'client/old/pub/getDetail',
title: '请求中...',
data: {
id: this.id
},
success: (res) => {
this.sheet = res
this.reloaded = true
}
}).catch(err => {
if (err.code === -1) {
setTimeout(() => {
vk.navigateBack()
}, 1500)
}
})
},
formatNumber(e) {
this.form1.data.totalPrice = parseFloat(this.form1.data.totalPrice).toFixed(2)
},
onFormSuccess() {
vk.redirectTo({url: `/pages/index/old/detail?id=${this.id}`})
},
// 提交报价单
async submit() {
const data = await vk.userCenter.getCurrentUserInfo();
const {userInfo} = data
if (userInfo.quoteTimes > 3) {
}
// this.$confirm(`今日报价次数${userInfo.quoteTimes || 0}, 是否继续?`, '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning',
// center: true
// }).then(res => {
vk.callFunction({
url: 'client/enquiry/quote/kh/addQuote',
title: '请求中...',
// data: {
// sheet: this.sheet,
// totalPrice: this.totalPrice
// },
success: (data) => {
this.$message({
message: "报价成功",
type: 'success'
})
}
});
// })
},
},
onShow() {
this.reloaded = false
setTimeout(() => {
this.reloaded = true
}, 500)
}
}
</script>
<style lang="scss" scoped>
.page-main {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
border-radius: 5px;
}
.description {
margin-bottom: 40px;
width: 800px;
}
.item-wrap {
margin: 24px 0;
.form-title-wrap {
display: flex;
align-items: center;
justify-content: space-between;
.goods-info-title {
display: flex;
align-items: center;
justify-content: flex-start;
}
.form-title {
padding-left: 10px;
color: #A92924;
font-size: 18px;
line-height: 18px;
border-left: 4px solid #A92924;
}
}
}
.tip-text {
color: #f56c6c;
}
.item-wrap + .el-form {
margin-top: 24px;
}
.quote {
display: flex;
align-items: center;
justify-content: space-between;
}
.quote-form {
width: 260px;
}
.form-footer {
height: 40px;
line-height: 40px;
background: #fff;
padding-top: 0;
text-align: center;
display: block;
}
</style>
+195
View File
@@ -0,0 +1,195 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<!-- <view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
</el-breadcrumb>
</view> -->
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布旧货交易</el-button>
<!-- <el-button type="primary" round plain>我发布的询价单</el-button> -->
</el-row>
</view>
</view>
<!-- 商品列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns"
:pagination="true"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
keyword: '',
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: "client/old/kh/getMyQuoteList",
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/index/old/detail?id=' + item.sheetId);
}
},
],
// 表格字段显示规则
columns: [
{
key: "sheet.title",
title: "旧货标题",
type: "text",
},
{
key: "sheet.type",
title: "旧货类型",
type: "select",
data: [
{value: 0, label: '拍卖'},
{value: 1, label: '采购'},
{value: 2, label: '租赁'},
{value: 3, label: '物资回收'},
]
},
{
key: "totalPrice",
title: "金额",
type: "text",
formatter: (val, row, column, index) => {
return `${val}元`
}
},
{
key: "status",
title: "状态",
type: "select",
data: [
{value: 0, label: '待选商'},
{value: 1, label: '已被选商'},
]
},
{
key: "remark",
title: "备注",
type: "text",
},
{
key: "_add_time_str",
title: "发布时间",
type: "time",
width: 160
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
},
methods: {
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
uni.navigateTo({
url: '/pages/index/old/release'
})
}
},
}
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
.el-tag {
margin-right: 10px;
}
}
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
</style>
+111 -7
View File
@@ -8,16 +8,23 @@
<view class="p-20">
<el-tabs v-model="activeName" stretch>
<el-tab-pane label="拍卖信息发布" name="0">
<type_0/>
<type_0 v-if="parseInt(activeName) === 0" :urgentAmount="urgentAmount" :remainOldNum="remainOldNum" :unitList="unitList"
:buyOldNumAmount="buyOldNumAmount" :agreement="agreement"
:commonContractUrl="commonContractUrl" :contactList="contactList"/>
</el-tab-pane>
<el-tab-pane label="采购信息发布" name="1">
<type_1/>
<type_1 v-if="parseInt(activeName) === 1" :urgentAmount="urgentAmount" :remainOldNum="remainOldNum"
:buyOldNumAmount="buyOldNumAmount" :agreement="agreement"
:commonContractUrl="commonContractUrl" :contactList="contactList"/>
</el-tab-pane>
<el-tab-pane label="承租信息发布" name="2">
<type_2/>
<el-tab-pane label="承租、租赁信息发布" name="2">
<type_2 v-if="parseInt(activeName) === 2" :urgentAmount="urgentAmount" :remainOldNum="remainOldNum"
:buyOldNumAmount="buyOldNumAmount" :agreement="agreement"
:commonContractUrl="commonContractUrl" :contactList="contactList"/>
</el-tab-pane>
<el-tab-pane label="物资回收信息发布" name="3">
<type_3/>
<type_3 v-if="parseInt(activeName) === 3" :urgentAmount="urgentAmount" :remainOldNum="remainOldNum"
:buyOldNumAmount="buyOldNumAmount" :agreement="agreement" :contactList="contactList"/>
</el-tab-pane>
</el-tabs>
</view>
@@ -38,9 +45,106 @@ export default {
components: {Type_3, Type_2, Type_1, Type_0},
data() {
return {
activeName: '0'
activeName: '0',
urgentAmount: 1,
remainOldNum: vk.getVuex('$user.userInfo.remainOldNum') ? parseInt(vk.getVuex('$user.userInfo.remainOldNum')) : 0,
buyOldNumAmount: 5,
agreement: '',
commonContractUrl: '',
contactList: [],
unitList: [],
}
},
methods: {}
methods: {
async getUrgentAmount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '6587dd2fe0ec19027452c5b5'
},
})
this.urgentAmount = res.content
},
async getBuyOldAmount() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '6587dd54189f86d49b3d5ff5'
},
})
this.buyOldNumAmount = res.content
},
async getUnitList() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'a45325976635f10600341a7f2f472cd1'
},
})
this.unitList = res.content.split(',')
},
async getAgreement() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '65885d5b862066f18a4e4a36'
},
})
this.agreement = res.content
},
async getCommonContractUrl() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '657d36befe975f63af1f24e7'
},
})
this.commonContractUrl = res.content
},
async getContactList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.contactList = rows
},
},
onLoad(e) {
if (e && e.type) this.activeName = e.type
this.getUnitList()
this.getUrgentAmount()
this.getBuyOldAmount()
this.getAgreement()
this.getCommonContractUrl()
this.getContactList()
},
onShow() {
vk.userCenter.getCurrentUserInfo({
success: (data) => {
this.remainOldNum = data.userInfo.remainOldNum ? parseInt(data.userInfo.remainOldNum) : 0
if (this.remainOldNum === 0) {
this.$confirm('您的旧货发布次数已用完,是否立即购买?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const {data} = await vk.callFunction({
url: 'client/old/kh/buyNum',
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
}).catch(() => {
vk.navigateBack()
})
}
}
});
}
}
</script>
<style>
::v-deep .el-tabs__item{
font-size: 1.2rem!important;
}
</style>
+449 -113
View File
@@ -3,38 +3,30 @@
<text class="text-50">发布我的拍卖信息</text>
<text class="text-gray">拍卖信息越完整,成功交易越容易</text>
<el-form ref="form" :model="form" label-width="140px" class="mt-20">
<el-form-item label="物资分类:">
<el-radio-group v-model="form.category" size="small">
<el-radio label="机械设备">
<text>机械设备</text>
</el-radio>
<el-radio label="成品钢材">
<text>成品钢材</text>
</el-radio>
<el-radio label="废旧钢材">
<text>废旧钢材</text>
</el-radio>
<el-radio label="旧架子管">
<text>旧架子管</text>
</el-radio>
<el-radio label="旧扣件">
<text>旧扣件</text>
</el-radio>
</el-radio-group>
<el-form-item label="物资分类:" required>
<div class="flex justify-start items-center">
<el-cascader :options="cateData" v-model="form.category" :disabled="form.otherCate"
:props="{'label': 'name', 'value': 'name'}"/>
<el-checkbox v-model="form.otherCate" class="mx-20">其他分类</el-checkbox>
<el-input v-model="form.otherCateName" :disabled="!form.otherCate"
placeholder="如物资分类选项中不能描述您的信息物资主要内容,请在此用专业或通用术语填写"
class="ml-20"/>
</div>
</el-form-item>
<el-form-item label="信息标题:">
<el-form-item label="信息标题:" required>
<el-input v-model="form.title" placeholder="一句话简介物资,如拍卖直缝钢管200吨等"/>
</el-form-item>
<el-form-item label="采购物资详情:">
<el-input v-model="form.desc" placeholder="请详细描述物资信息,描述内容:材料名称、材质......(限300字以内)"
<el-input v-model="form.desc"
placeholder="请详细描述物资信息,描述内容:材料名称、材质、是否含税等关键信息......(限300字以内)"
type="textarea" show-word-limit maxlength="300"/>
</el-form-item>
<el-form-item label="拍卖实物:">
<vk-data-upload v-model="form.files"
<vk-data-upload v-model="form.files" list-type="text"
accept="image/*">
</vk-data-upload>
</el-form-item>
<el-form-item label="物资所在地" class="ml-10">
<el-form-item label="物资所在地" class="ml-10" required>
<el-row :gutter="10">
<el-col :span="5">
<el-select v-model="provinceIndex" placeholder="省" @change="selectProvince">
@@ -70,8 +62,8 @@
<el-col :span="8">
<view class="flex justify-start items-center">
<el-form-item label="起拍计价单位:">
<el-input v-model="form.startNum" class="input-with-select">
<el-select v-model="form.unit" slot="append">
<!-- <el-input v-model="form.startNum" class="input-with-select">-->
<el-select v-model="form.unit">
<el-option
v-for="(item, index) in unitList"
:key="index"
@@ -79,10 +71,10 @@
:value="item">
</el-option>
</el-select>
</el-input>
<!-- </el-input>-->
</el-form-item>
<text class="flex-1">(电议)</text>
<!-- <text class="flex-1">(电议)</text>-->
</view>
</el-col>
<el-col :span="8">
@@ -90,22 +82,92 @@
<el-form-item label="起拍人民币单价:">
<el-input v-model="form.startAmount" placeholder="请输入" style="width: 160px"/>
</el-form-item>
<text class="flex-1">(电议)</text>
<!-- <text class="flex-1">(电议)</text>-->
</view>
</el-col>
<el-col :span="8">
<view class="flex justify-start items-center">
<el-form-item label="拍卖信息失效时间:">
<el-form-item label="拍卖信息失效时间:" required>
<el-date-picker
:picker-options="pickerOptions"
v-model="form.expiredTime"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
<div class="text-main text-25 mt-10">温馨提示:为保证信息有效性发布最长时限为1年(12个月)到期后需重新发布。</div>
</el-form-item>
</view>
</el-col>
</el-row>
<view class="form-title-wrap">
<view class="form-title-wrap"
style="justify-content: flex-start; flex-direction: column; align-items: flex-start">
<view class="goods-info-title mb-25">
<view class="form-title">
发票详情
</view>
</view>
<view class="my-20">
<el-radio-group v-model="form.invoice">
<el-radio :label="true">含税</el-radio>
<el-radio :label="false">不含税</el-radio>
</el-radio-group>
</view>
</view>
<view class="p-30">
<template v-if="form.invoice">
<view class="mb-20 flex justify-start items-center">
<text>开票时间:</text>
<el-radio-group v-model="form.writeInvoiceTime">
<el-radio :label="0">付款当月(限20号之前付款,20号之后付款次月开票)</el-radio>
<el-radio :label="1">付款后次月</el-radio>
<el-radio :label="2">付款前</el-radio>
</el-radio-group>
</view>
<view class="mb-20 flex justify-start items-center">
<view class="flex-1 flex justify-start items-center">
<text style="width: 30%">纳税人身份:</text>
<el-select v-model="form.taxType" placeholder="纳税人身份" style="width: 100%">
<el-option
v-for="item in ['一般纳税人', '小规模公司', '个体工商户']"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</view>
<view class="flex-1 flex justify-start items-center ml-20">
<text style="width: 30%">发票种类:</text>
<el-select v-model="form.invoiceType" placeholder="发票种类" style="width: 100%">
<el-option
v-for="item in ['专用发票', '普通发票']"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</view>
</view>
<view class="mb-20 flex justify-start items-center">
<view class="flex-1 flex justify-start items-center">
<text style="width: 30%">税率:</text>
<el-select v-model="form.taxRate" placeholder="税率" style="width: 100%">
<el-option
v-for="item in ['13%', '9%', '6%', '4%', '3%', '1%']"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</view>
<view class="ml-20 flex justify-start items-center flex-1 ml-20">
<text style="width: 30%">手动填写税票要求:</text>
<el-input v-model="form.invoiceOther" placeholder="如:一般纳税人 专用发票 税率13%"
size="small"/>
</view>
</view>
</template>
</view>
<view class="form-title-wrap mt-25">
<view class="goods-info-title">
<view class="form-title">
交易说明
@@ -150,37 +212,52 @@
<el-form-item label="付款方式:">
<view class="flex justify-start items-center">
<view class="flex justify-start items-center mr-35">
<el-radio label="预付" v-model="form.payMethod">
<el-radio label="预付" v-model="form.payMethod" @change="changePayMethod('预付')">
<text>预付</text>
</el-radio>
<el-input v-model="form.prePayRate" style="width: 200px"/>
<el-input v-model="form.prePayRate" style="width: 200px" :disabled="form.payMethod !== '预付'"/>
<text>%货到付全款</text>
</view>
<el-radio label="提货付全款" v-model="form.payMethod">
<el-radio label="提货付全款" v-model="form.payMethod" @change="changePayMethod('提货付全款')">
<text>提货付全款</text>
</el-radio>
</view>
<view class="flex justify-start items-center mt-40">
<el-radio label="其他付款方式描述" v-model="form.payMethod">
<el-radio label="其他付款方式描述" v-model="form.payMethod"
@change="changePayMethod('其他付款方式描述')">
<text>其他付款方式描述</text>
</el-radio>
<el-input v-model="form.otherPayMethodDesc"
type="textarea" show-word-limit maxlength="300"/>
</view>
</el-form-item>
<view class="form-title-wrap">
<view class="form-title-wrap mt-20">
<view class="goods-info-title">
<view class="form-title">
简易合同备注和其他补充条款
合同条款
</view>
</view>
</view>
<view class="p-30">
<view class="mb-20 flex justify-start items-center">
<el-radio v-model="form.signMethod" :label="0">法大大</el-radio>
<el-radio v-model="form.signMethod" :label="0">线上签约-标准合同</el-radio>
<el-radio v-model="form.signMethod" :label="2">线上签约-双方协商合同</el-radio>
<el-radio v-model="form.signMethod" :label="1">线下签约</el-radio>
</view>
<view class="my-25" v-if="form.signMethod === 2">
<view class="p-30">
<view class="mb-20 flex justify-start items-center">
<text style="width: 140px">合同附件:</text>
<vk-data-upload v-model="form.contractAttachment"
:on-preview="previewUpload"
accept=".pdf" list-type="text"/>
</view>
</view>
</view>
<view v-if="form.signMethod === 0">
<view @click="openDownload" class="pointer my-25 text-main">
点击查看标准合同
</view>
<view class="flex justify-start items-start border">
<view class="m-10 sign-method-header">违约责任:</view>
<view class="border-left m-10 pl-20 flex-1">
@@ -209,56 +286,56 @@
</view>
</view>
<view class="flex justify-start items-start border">
<view class="m-10 sign-method-header">采购方补充条款:</view>
<view class="m-10 sign-method-header">委托人补充条款:</view>
<view class="border-left m-10 pl-20 flex-1">
供货方逾期供货承担采购方一切损失
<el-input v-model="form.supplementary" placeholder="请输入委托人补充条款"/>
</view>
</view>
</view>
</view>
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
采购商信息
</view>
</view>
</view>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="公司信息">
<el-input v-model="form.buyer.companyName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="公司联系方式">
<el-input v-model="form.buyer.contract"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="个人信息">
<el-input v-model="form.buyer.personalName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="个人联系方式">
<el-input v-model="form.buyer.personalContract"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="授权人姓名">
<el-input v-model="form.buyer.managerName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="授权联系方式">
<el-input v-model="form.buyer.managerContract"/>
</el-form-item>
</el-col>
</el-row>
<!-- <view class="form-title-wrap">-->
<!-- <view class="goods-info-title">-->
<!-- <view class="form-title">-->
<!-- 采购商信息-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- <el-row :gutter="10">-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="公司信息">-->
<!-- <el-input v-model="form.buyer.companyName"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="公司联系方式">-->
<!-- <el-input v-model="form.buyer.contract"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row :gutter="10">-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="个人信息">-->
<!-- <el-input v-model="form.buyer.personalName"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="个人联系方式">-->
<!-- <el-input v-model="form.buyer.personalContract"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row :gutter="10">-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="授权人姓名">-->
<!-- <el-input v-model="form.buyer.managerName"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="授权联系方式">-->
<!-- <el-input v-model="form.buyer.managerContract"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
@@ -266,7 +343,7 @@
</view>
</view>
</view>
<el-row :gutter="10">
<el-row :gutter="10" v-if="vk.getVuex('$user.userInfo.accountType') === 2">
<el-col :span="12">
<el-form-item label="公司信息">
<el-input v-model="form.supplier.companyName"/>
@@ -278,7 +355,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-row :gutter="10" v-if="vk.getVuex('$user.userInfo.accountType') === 1">
<el-col :span="12">
<el-form-item label="个人信息">
<el-input v-model="form.supplier.personalName"/>
@@ -286,19 +363,32 @@
</el-col>
<el-col :span="12">
<el-form-item label="个人联系方式">
<el-input v-model="form.supplier.personalContract"/>
<el-input v-model="form.supplier.personalContract" type="number"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="授权人姓名">
<el-input v-model="form.supplier.managerName"/>
<el-col :span="12" class="flex justify-start items-center">
<el-form-item label="授权业务咨询人">
<el-select v-model="form.supplier.managerName" 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="navTo">个人中心</text>
<text>添加</text>
</view>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="授权联系方式">
<el-input v-model="form.supplier.managerContract"/>
<el-col :span="12" class="flex justify-start items-center">
<el-form-item label="业务咨询联系方式">
<el-input v-model="form.supplier.managerContract" type="number" disabled/>
</el-form-item>
</el-col>
</el-row>
@@ -312,9 +402,32 @@
<text>否</text>
</el-radio>
</view>
<view class="flex justify-center items-center mt-30 m-a">
<el-button type="primary" :disabled="checked === '否'" @click="publish">立即发布</el-button>
<view class="mt-20 flex justify-start items-center">
<text class="mr-25">是否加急({{ urgentAmount }}元/次,将在旧货交易页面加急展示区展示):</text>
<el-radio :label="true" v-model="form.isUrgent">
<text>是</text>
</el-radio>
<el-radio :label="false" v-model="form.isUrgent">
<text>否</text>
</el-radio>
</view>
<view class="my-25 text-main font-bold">本月剩余旧货发布次数:{{ remainOldNum }}</view>
<view class="flex justify-start items-center">
<el-checkbox v-model="agree">我已阅读并同意</el-checkbox>
<span class="text-main pointer font-bold" @click="showAgreement">《金久信旧货交易协议》</span>
</view>
<view class="flex justify-center items-center mt-30 m-a">
<el-button type="primary" @click="save" plain>暂存</el-button>
<el-button type="primary" :disabled="checked === '否' || !agree || disabled" @click="publish">立即发布</el-button>
</view>
<el-dialog title="金久信旧货交易协议" :visible.sync="dialogVisible" width="70%" close-on-press-escape
close-on-click-modal show-close
>
<div v-html="agreement"></div>
<div class="flex justify-end items-center">
<el-button type="primary" @click="agreeNClose">已阅读并同意</el-button>
</div>
</el-dialog>
</view>
</template>
@@ -325,30 +438,75 @@ import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
export default {
name: "type_0",
props: {
urgentAmount: {
type: Number,
default: 10
},
remainOldNum: {
type: Number,
default: 0
},
agreement: {
type: String,
default: ''
},
commonContractUrl: {
type: String,
default: ''
},
contactList: {
type: Array,
default: ''
},
unitList: {
type: Array,
default: ''
},
},
data() {
return {
unitList: ['吨', '万吨'],
pickerOptions: {
disabledDate(time) {
const maxDate = new Date();
maxDate.setFullYear(maxDate.getFullYear() + 1);
return time.getTime() < Date.now() || time.getTime() > maxDate.getTime();
},
},
agree: false,
provinceData: provinces,
cityData: citys,
areaData: areas,
allChildCate: [],
cateData: [],
form: {
type: 0,
category: 0,
files: [],
otherCate: false,
otherCateName: '',
title: '',
desc: '',
addressRegion: [],
addressRegion: {},
addressDetail: '',
startNum: '',
unit: '吨',
startAmount: '',
expiredTime: '',
offerAddressRegion: [],
offerAddressRegion: {},
offerAddressNoLimit: false,
payMethod: '预付',
prePayRate: '',
otherPayMethodDesc: '',
signMethod: 0,
invoice: true,
writeInvoiceTime: 0,
taxType: '',
taxRate: '',
invoiceType: '',
invoiceOther: '',
invoiceDetail: '',
buyer: {
companyName: '',
contract: '',
@@ -365,7 +523,9 @@ export default {
managerName: '',
managerContract: '',
},
contractAttachment: [],
isUrgent: false,
supplementary: ''
},
provinceIndex: null,
cityIndex: null,
@@ -373,52 +533,223 @@ export default {
offerProvinceIndex: null,
offerCityIndex: null,
offerAreaIndex: null,
checked: '否'
checked: '否',
dialogVisible: false,
disabled: false,
}
},
methods: {
selectProvince(index) {
this.form.addressRegion[0] = this.provinceData[index]
this.form.addressRegion.province = this.provinceData[index]
},
selectCity(index) {
this.form.addressRegion[1] = this.cityData[this.provinceIndex][index]
this.form.addressRegion.city = this.cityData[this.provinceIndex][index]
},
selectArea(index) {
this.form.addressRegion[2] = this.areaData[this.provinceIndex][this.cityIndex][index]
this.form.addressRegion.area = this.areaData[this.provinceIndex][this.cityIndex][index]
},
selectOfferProvince(index) {
this.form.offerAddressRegion[0] = this.provinceData[index]
this.form.offerAddressRegion.province = this.provinceData[index]
},
selectOfferCity(index) {
this.form.offerAddressRegion[1] = this.cityData[this.offerProvinceIndex][index]
this.form.offerAddressRegion.city = this.cityData[this.offerProvinceIndex][index]
},
selectOfferArea(index) {
this.form.offerAddressRegion[2] = this.areaData[this.offerProvinceIndex][this.offerCityIndex][index]
this.form.offerAddressRegion.area = this.areaData[this.offerProvinceIndex][this.offerCityIndex][index]
},
changeOfferAddressNoLimit(val) {
if (val) {
this.form.offerAddressRegion = []
this.form.offerAddressRegion = {}
this.offerProvinceIndex = this.offerCityIndex = this.offerAreaIndex = null
}
},
async publish() {
await vk.callFunction({
if (this.remainOldNum === 0) {
this.$confirm('您的旧货发布次数已用完,是否立即购买?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async ({confirm}) => {
if (confirm) {
const {data} = await vk.callFunction({
url: 'client/old/kh/buyNum',
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
}
})
return
}
if (this.provinceIndex === null || this.cityIndex === null || this.areaIndex === null) return this.$message({
message: "请选择完整的物资所在地",
type: 'warning'
})
if (!this.form.addressDetail) return this.$message({
message: "请填写详细物资所在地",
type: 'warning'
})
if (!this.form.title) return this.$message({
message: "请填写标题",
type: 'warning'
})
if (!this.form.otherCate) {
if (!this.form.category) return this.$message({
message: "请选择分类",
type: 'warning'
})
} else {
if (!this.form.otherCateName) return this.$message({
message: "请输入其他分类",
type: 'warning'
})
this.form.category = ['', this.form.otherCateName]
}
if (!this.form.expiredTime) return this.$message({
message: "请选择失效时间",
type: 'warning'
})
const maxExpiredTime = new Date();
maxExpiredTime.setFullYear(maxExpiredTime.getFullYear() + 1);
if (new Date(this.form.expiredTime).getTime() > maxExpiredTime.getTime()) return this.$message({
message: "为保证信息有效性发布最长时限为1年(12个月)",
type: 'warning'
})
if (this.form.payMethod === '预付' && !this.form.prePayRate) {
return this.$message({
message: "请填写预付比例",
type: 'warning'
})
}
if (this.form.invoice) {
if (!this.form.invoiceOther) {
// if (!this.form.writeInvoiceTime) return this.$message({
// message: "请选择开票时间",
// type: 'warning'
// })
if (!this.form.taxType) return this.$message({
message: "请选择纳税人身份",
type: 'warning'
})
if (!this.form.invoiceType) return this.$message({
message: "请选择发票种类",
type: 'warning'
})
if (!this.form.taxRate) return this.$message({
message: "请选择税率",
type: 'warning'
})
}
}
this.disabled = true
const res = await vk.callFunction({
url: 'client/old/kh/add',
data: this.form
})
this.disabled = false
this.$message({
message: "提交成功",
message: "您的信息已经提交,等待管理员审核,请您耐心等待!",
type: 'success'
})
vk.navigateBack()
localStorage.removeItem("old_0")
setTimeout(() => {
if (this.form.isUrgent) {
vk.navigateTo({
url: `/pages/index/shop/pay?id=${res.data}`
})
} else {
vk.redirectTo({url: '/pages/index/old/old'});
}
}, 1500)
},
showAgreement() {
// this.$confirm(this.agreement, '金久信旧货交易协议', {
// cancelButtonText: '关闭',
// showConfirmButton: false,
// dangerouslyUseHTMLString: true,
// customClass: 'confirm-box'
// })
this.dialogVisible = true
},
openDownload() {
window.open(this.commonContractUrl)
},
previewUpload({url}) {
window.open(url)
},
navTo() {
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
selectContact(name) {
const contact = this.contactList.find(item => item.name === name)
this.form.supplier.managerContract = contact.phone
},
changePayMethod(payMethod) {
if (payMethod !== '预付') {
this.form.prePayRate = null
}
},
save() {
localStorage.setItem("old_0", JSON.stringify({
form: this.form,
provinceIndex: this.provinceIndex,
cityIndex: this.cityIndex,
areaIndex: this.areaIndex,
offerProvinceIndex: this.offerProvinceIndex,
offerCityIndex: this.offerCityIndex,
offerAreaIndex: this.offerAreaIndex
}))
this.$message({
message: "已保存",
type: 'success'
})
},
agreeNClose() {
this.dialogVisible = false
this.agree = true
}
},
mounted() {
vk.callFunction({
url: 'client/old/pub/getTree',
title: '请求中...',
data: {type: 0},
success: (data) => {
this.cateData = data.rows.map(item => {
item.children.forEach(child => {
delete child.children
})
return item
})
}
});
if (vk.getVuex('$user.userInfo.accountType') === 2) {
this.form.supplier.companyName = vk.getVuex('$user.userInfo.company.companyName')
this.form.supplier.contract = vk.getVuex('$user.userInfo.company.mobile')
} else {
this.form.supplier.personalName = vk.getVuex('$user.userInfo.person.personName')
this.form.supplier.personalContract = vk.getVuex('$user.userInfo.person.mobile')
}
if (!!localStorage.getItem("old_0")) {
this.$confirm('您有一份暂存数据,是否恢复?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
const savedData = JSON.parse(localStorage.getItem("old_0"))
this.form = savedData.form
this.provinceIndex = savedData.provinceIndex
this.cityIndex = savedData.cityIndex
this.areaIndex = savedData.areaIndex
this.offerProvinceIndex = savedData.offerProvinceIndex
this.offerCityIndex = savedData.offerCityIndex
this.offerAreaIndex = savedData.offerAreaIndex
})
}
}
}
</script>
<style lang="scss" scoped>
@import "@/common/css/app.scss";
.form-title-wrap {
display: flex;
align-items: center;
@@ -432,10 +763,10 @@ export default {
.form-title {
padding-left: 10px;
color: $--color-primary;
color: #A92924;
font-size: 18px;
line-height: 18px;
border-left: 4px solid $--color-primary;
border-left: 4px solid #A92924;
}
}
@@ -443,15 +774,20 @@ export default {
.sign-method-header {
width: 120px;
}
</style>
<style>
/deep/ .input-with-select{
::v-deep .input-with-select {
width: 200px;
}
/deep/ .input-with-select .el-input-group__append {
::v-deep .input-with-select .el-input-group__append {
background-color: #fff !important;
width: 80px !important;
}
::v-deep .el-message-box__wrapper .confirm-box {
width: 70% !important;
}
</style>
+485 -158
View File
@@ -5,70 +5,64 @@
<el-form ref="form" :model="form" label-width="140px" class="mt-20">
<el-form-item label="信息失效时间:">
<el-date-picker
:picker-options="pickerOptions"
v-model="form.expiredTime"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
<div class="text-main text-25 mt-10">温馨提示:为保证信息有效性发布最长时限为1年(12个月)到期后需重新发布。</div>
</el-form-item>
<el-form-item label="物资分类:">
<el-radio-group v-model="form.category" size="small">
<el-radio label="机械设备">
<text>机械设备</text>
</el-radio>
<el-radio label="成品钢材">
<text>成品钢材</text>
</el-radio>
<el-radio label="废旧钢材">
<text>废旧钢材</text>
</el-radio>
<el-radio label="旧架子管">
<text>旧架子管</text>
</el-radio>
<el-radio label="旧扣件">
<text>旧扣件</text>
</el-radio>
</el-radio-group>
<el-form-item label="物资分类:" required>
<div class="flex justify-start items-center">
<el-cascader :options="cateData" v-model="form.category" :disabled="form.otherCate"
:props="{'label': 'name', 'value': 'name'}"/>
<el-checkbox v-model="form.otherCate" class="mx-20">其他分类</el-checkbox>
<el-input v-model="form.otherCateName" :disabled="!form.otherCate"
placeholder="如物资分类选项中不能描述您的信息物资主要内容,请在此用专业或通用术语填写"
class="ml-20"/>
</div>
</el-form-item>
<el-form-item label="信息标题:">
<el-input v-model="form.title" placeholder="一句话简介物资,如拍卖直缝钢管200吨等"/>
<el-form-item label="信息标题:" required>
<el-input v-model="form.title" placeholder="一句话简介物资,如采购直缝钢管200吨等"/>
</el-form-item>
<el-form-item label="采购物资详情:">
<el-input v-model="form.desc" placeholder="请详细描述物资信息,描述内容:材料名称、材质......(限300字以内)"
<el-form-item label="采购物资详情:" required>
<el-input v-model="form.desc"
placeholder="请详细描述物资信息,描述内容:材料名称、材质、是否含税等关键信息......(限300字以内)"
type="textarea" show-word-limit maxlength="300"/>
</el-form-item>
<el-form-item label="物资装货地" class="ml-10">
<el-row :gutter="10">
<el-col :span="5">
<el-select v-model="provinceIndex" placeholder="省" @change="selectProvince">
<el-option v-for="(item, index) in provinceData" :key="index" :value="index"
:label="item.name"/>
</el-select>
</el-col>
<el-col :span="5">
<el-select v-model="cityIndex" placeholder="市" @change="selectCity">
<template v-if="provinceIndex !== null">
<el-option v-for="(item, index) in cityData[provinceIndex]" :key="index"
:value="index"
:label="item.name"/>
</template>
</el-select>
</el-col>
<el-col :span="5">
<el-select v-model="areaIndex" placeholder="区/县" @change="selectArea">
<template v-if="provinceIndex !== null && cityIndex !== null">
<el-option v-for="(item, index) in areaData[provinceIndex][cityIndex]"
:key="index" :value="index"
:label="item.name"/>
</template>
</el-select>
</el-col>
<el-col :span="8">
<el-input v-model="form.addressDetail"
placeholder="详细地址或几公里范围内"></el-input>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="物资交货地" class="ml-10">
<!-- <el-form-item label="物资装货地" class="ml-10" v>-->
<!-- <el-row :gutter="10">-->
<!-- <el-col :span="5">-->
<!-- <el-select v-model="provinceIndex" placeholder="省" @change="selectProvince">-->
<!-- <el-option v-for="(item, index) in provinceData" :key="index" :value="index"-->
<!-- :label="item.name"/>-->
<!-- </el-select>-->
<!-- </el-col>-->
<!-- <el-col :span="5">-->
<!-- <el-select v-model="cityIndex" placeholder="市" @change="selectCity">-->
<!-- <template v-if="provinceIndex !== null">-->
<!-- <el-option v-for="(item, index) in cityData[provinceIndex]" :key="index"-->
<!-- :value="index"-->
<!-- :label="item.name"/>-->
<!-- </template>-->
<!-- </el-select>-->
<!-- </el-col>-->
<!-- <el-col :span="5">-->
<!-- <el-select v-model="areaIndex" placeholder="区/县" @change="selectArea">-->
<!-- <template v-if="provinceIndex !== null && cityIndex !== null">-->
<!-- <el-option v-for="(item, index) in areaData[provinceIndex][cityIndex]"-->
<!-- :key="index" :value="index"-->
<!-- :label="item.name"/>-->
<!-- </template>-->
<!-- </el-select>-->
<!-- </el-col>-->
<!-- <el-col :span="8">-->
<!-- <el-input v-model="form.addressDetail"-->
<!-- placeholder="详细地址或几公里范围内"></el-input>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </el-form-item>-->
<el-form-item label="物资交货地" class="ml-10" required>
<el-row :gutter="10">
<el-col :span="5">
<el-select v-model="deliverProvinceIndex" placeholder="省" @change="selectDeliverProvince">
@@ -100,42 +94,98 @@
</el-col>
</el-row>
</el-form-item>
<view class="form-title-wrap" style="justify-content: flex-start">
<view class="goods-info-title">
<view class="form-title-wrap"
style="justify-content: flex-start; flex-direction: column; align-items: flex-start">
<view class="goods-info-title mb-25">
<view class="form-title">
纳税和税票要求
税票要求
</view>
</view>
<view class="my-20">
<el-radio-group v-model="form.invoice">
<el-radio :label="true">含税</el-radio>
<el-radio :label="false">不含税</el-radio>
</el-radio-group>
</view>
</view>
<view class="p-30">
<template v-if="form.invoice">
<el-form-item label="开票时间:">
<view class="mb-20 flex justify-start items-center">
<text>开票时间:</text>
<el-radio-group v-model="form.writeInvoiceTime">
<el-radio :label="0">付款当月(限20号之前付款,20号之后付款次月开票)</el-radio>
<el-radio :label="1">付款后次月</el-radio>
<el-radio :label="2">付款前</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="发票种类:">
<el-radio-group v-model="form.invoiceType">
<el-radio :label="0">增值税专用发票13%</el-radio>
<el-radio :label="1">增值税普通发票</el-radio>
<el-radio :label="2">普通发票</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="其他要求:">
<el-input v-model="form.invoiceOther" placeholder="请输入" size="small" type="textarea"/>
</el-form-item>
<el-form-item label="报价明细:">
<el-input v-model="form.invoiceDetail" placeholder="请输入" size="small" type="textarea"/>
</el-form-item>
</view>
<view class="mb-20 flex justify-start items-center">
<view class="flex-1 flex justify-start items-center">
<text style="width: 30%">纳税人身份:</text>
<el-select v-model="form.taxType" placeholder="纳税人身份" style="width: 100%">
<el-option
v-for="item in ['一般纳税人', '小规模公司', '个体工商户']"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</view>
<view class="flex-1 flex justify-start items-center ml-20">
<text style="width: 30%">发票种类:</text>
<el-select v-model="form.invoiceType" placeholder="发票种类" style="width: 100%">
<el-option
v-for="item in ['专用发票', '普通发票']"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</view>
</view>
<view class="mb-20 flex justify-start items-center">
<view class="flex-1 flex justify-start items-center">
<text style="width: 30%">税率:</text>
<el-select v-model="form.taxRate" placeholder="税率" style="width: 100%">
<el-option
v-for="item in ['13%', '9%', '6%', '4%', '3%', '1%']"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</view>
<view class="ml-20 flex justify-start items-center flex-1 ml-20">
<text style="width: 30%">手动填写税票要求:</text>
<el-input v-model="form.invoiceOther" placeholder="如:一般纳税人 专用发票 税率13%"
size="small"/>
</view>
</view>
</template>
<el-form-item label="报价失效时间:">
<!-- <template v-if="form.invoice">-->
<!-- <el-form-item label="开票时间:">-->
<!-- <el-radio-group v-model="form.writeInvoiceTime">-->
<!-- <el-radio :label="0">付款当月(限20号之前付款,20号之后付款次月开票)</el-radio>-->
<!-- <el-radio :label="1">付款后次月</el-radio>-->
<!-- <el-radio :label="2">付款前</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="发票种类:">-->
<!-- <el-radio-group v-model="form.invoiceType">-->
<!-- <el-radio :label="0">增值税专用发票13%</el-radio>-->
<!-- <el-radio :label="1">增值税普通发票</el-radio>-->
<!-- <el-radio :label="2">普通发票</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="其他要求:">-->
<!-- <el-input v-model="form.invoiceOther" placeholder="请输入" size="small" type="textarea"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="报价明细:">-->
<!-- <el-input v-model="form.invoiceDetail" placeholder="请输入" size="small" type="textarea"/>-->
<!-- </el-form-item>-->
<!-- </template>-->
<el-form-item label="报价截止时间:">
<el-date-picker
:picker-options="pickerOptions"
v-model="form.offerExpiredTime"
type="datetime"
placeholder="选择日期时间">
@@ -187,18 +237,18 @@
<el-form-item label="付款方式:">
<view class="flex justify-start items-center">
<view class="flex justify-start items-center mr-35">
<el-radio label="预付" v-model="form.payMethod">
<el-radio label="预付" v-model="form.payMethod" @change="changePayMethod('预付')">
<text>预付</text>
</el-radio>
<el-input v-model="form.prePayRate" style="width: 200px"/>
<el-input v-model="form.prePayRate" style="width: 200px" :disabled="form.payMethod !== '预付'"/>
<text>%货到付全款</text>
</view>
<el-radio label="提货付全款" v-model="form.payMethod">
<el-radio label="提货付全款" v-model="form.payMethod" @change="changePayMethod('提货付全款')">
<text>提货付全款</text>
</el-radio>
</view>
<view class="flex justify-start items-center mt-40">
<el-radio label="其他付款方式描述" v-model="form.payMethod">
<el-radio label="其他付款方式描述" v-model="form.payMethod" @change="changePayMethod('其他付款方式描述')">
<text>其他付款方式描述</text>
</el-radio>
<el-input v-model="form.otherPayMethodDesc"
@@ -216,16 +266,29 @@
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
简易合同备注和其他补充条款
合同条款
</view>
</view>
</view>
<view class="p-30">
<view class="mb-20 flex justify-start items-center">
<el-radio v-model="form.signMethod" :label="0">法大大</el-radio>
<el-radio v-model="form.signMethod" :label="0">线上签约-标准合同</el-radio>
<el-radio v-model="form.signMethod" :label="2">线上签约-双方协商合同</el-radio>
<el-radio v-model="form.signMethod" :label="1">线下签约</el-radio>
</view>
<view class="my-25" v-if="form.signMethod === 2">
<view class="p-30">
<view class="mb-20 flex justify-start items-center">
<text style="width: 140px">合同附件:</text>
<vk-data-upload v-model="form.contractAttachment" accept=".pdf" list-type="text"
:on-preview="previewUpload"/>
</view>
</view>
</view>
<view v-if="form.signMethod === 0">
<view @click="openDownload" class="pointer my-25 text-main">
点击查看标准合同
</view>
<view class="flex justify-start items-start border">
<view class="m-10 sign-method-header">违约责任:</view>
<view class="border-left m-10 pl-20 flex-1">
@@ -256,7 +319,7 @@
<view class="flex justify-start items-start border">
<view class="m-10 sign-method-header">采购方补充条款:</view>
<view class="border-left m-10 pl-20 flex-1">
供货方逾期供货承担采购方一切损失
<el-input v-model="form.supplementary" placeholder="请输入采购方补充条款"/>
</view>
</view>
</view>
@@ -268,7 +331,7 @@
</view>
</view>
</view>
<el-row :gutter="10">
<el-row :gutter="10" v-if="vk.getVuex('$user.userInfo.accountType') === 2">
<el-col :span="12">
<el-form-item label="公司信息">
<el-input v-model="form.buyer.companyName"/>
@@ -280,7 +343,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-row :gutter="10" v-if="vk.getVuex('$user.userInfo.accountType') === 1">
<el-col :span="12">
<el-form-item label="个人信息">
<el-input v-model="form.buyer.personalName"/>
@@ -288,65 +351,78 @@
</el-col>
<el-col :span="12">
<el-form-item label="个人联系方式">
<el-input v-model="form.buyer.personalContract"/>
<el-input v-model="form.buyer.personalContract" type="number"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="授权人姓名">
<el-input v-model="form.buyer.managerName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="授权联系方式">
<el-input v-model="form.buyer.managerContract"/>
</el-form-item>
</el-col>
</el-row>
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
供货商信息
<el-col :span="12" class="flex justify-start items-center">
<el-form-item label="授权业务咨询人">
<el-select v-model="form.buyer.managerName" 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="navTo">个人中心</text>
<text>添加</text>
</view>
</view>
</view>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="公司信息">
<el-input v-model="form.supplier.companyName"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="公司联系方式">
<el-input v-model="form.supplier.contract"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="个人信息">
<el-input v-model="form.supplier.personalName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="个人联系方式">
<el-input v-model="form.supplier.personalContract"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="授权人姓名">
<el-input v-model="form.supplier.managerName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="授权联系方式">
<el-input v-model="form.supplier.managerContract"/>
<el-col :span="12" class="flex justify-start items-center">
<el-form-item label="业务咨询联系方式">
<el-input v-model="form.buyer.managerContract" type="number" disabled/>
</el-form-item>
</el-col>
</el-row>
<!-- <view class="form-title-wrap">-->
<!-- <view class="goods-info-title">-->
<!-- <view class="form-title">-->
<!-- 供货商信息-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- <el-row :gutter="10">-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="公司信息">-->
<!-- <el-input v-model="form.supplier.companyName"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="公司联系方式">-->
<!-- <el-input v-model="form.supplier.contract"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row :gutter="10">-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="个人信息">-->
<!-- <el-input v-model="form.supplier.personalName"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="个人联系方式">-->
<!-- <el-input v-model="form.supplier.personalContract"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row :gutter="10">-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="授权人姓名">-->
<!-- <el-input v-model="form.supplier.managerName"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="授权联系方式">-->
<!-- <el-input v-model="form.supplier.managerContract"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
</el-form>
<view class="mt-20 flex justify-start items-center">
<text class="mr-25">您是否对以上信息进行了详细核实:</text>
@@ -357,9 +433,31 @@
<text>否</text>
</el-radio>
</view>
<view class="flex justify-center items-center mt-30 m-a">
<el-button type="primary" :disabled="checked === '否'" @click="publish">立即发布</el-button>
<view class="mt-20 flex justify-start items-center">
<text class="mr-25">是否加急({{ urgentAmount }}元/次,将在旧货交易页面加急展示区展示):</text>
<el-radio :label="true" v-model="form.isUrgent">
<text>是</text>
</el-radio>
<el-radio :label="false" v-model="form.isUrgent">
<text>否</text>
</el-radio>
</view>
<view class="my-25 text-main font-bold">本月剩余旧货发布次数:{{ remainOldNum }}</view>
<view class="flex justify-start items-center">
<el-checkbox v-model="agree">我已阅读并同意</el-checkbox>
<span class="text-main pointer font-bold" @click="showAgreement">《金久信旧货交易协议》</span>
</view>
<view class="flex justify-center items-center mt-30 m-a">
<el-button type="primary" @click="save" plain>暂存</el-button>
<el-button type="primary" :disabled="checked === '否' || !agree || disabled" @click="publish">立即发布</el-button>
</view>
<el-dialog title="金久信旧货交易协议" :visible.sync="dialogVisible" width="70%" close-on-press-escape
close-on-click-modal show-close>
<div v-html="agreement"></div>
<div class="flex justify-end items-center">
<el-button type="primary" @click="agreeNClose">已阅读并同意</el-button>
</div>
</el-dialog>
</view>
</template>
@@ -370,23 +468,59 @@ import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
export default {
name: "type_1",
props: {
urgentAmount: {
type: Number,
default: 10
},
remainOldNum: {
type: Number,
default: 0
},
agreement: {
type: String,
default: ''
},
commonContractUrl: {
type: String,
default: ''
},
contactList: {
type: Array,
default: ''
},
},
data() {
return {
pickerOptions: {
disabledDate(time) {
const maxDate = new Date();
maxDate.setFullYear(maxDate.getFullYear() + 1);
return time.getTime() < Date.now() || time.getTime() > maxDate.getTime();
},
},
agree: false,
provinceData: provinces,
cityData: citys,
areaData: areas,
allChildCate: [],
cateData: [],
form: {
otherCate: false,
otherCateName: '',
type: 1,
category: 0,
files: [],
title: '',
desc: '',
addressRegion: [],
addressRegion: {},
addressDetail: '',
deliverAddressRegion: [],
deliverAddressRegion: {},
deliverAddressDetail: '',
invoice: false,
writeInvoiceTime: '',
invoice: true,
writeInvoiceTime: 0,
taxType: '',
taxRate: '',
invoiceType: '',
invoiceOther: '',
invoiceDetail: '',
@@ -415,7 +549,9 @@ export default {
managerName: '',
managerContract: '',
},
contractAttachment: [],
isUrgent: false,
supplementary: ''
},
provinceIndex: null,
cityIndex: null,
@@ -426,36 +562,39 @@ export default {
offerProvinceIndex: null,
offerCityIndex: null,
offerAreaIndex: null,
checked: '否'
checked: '否',
dialogVisible: false,
disabled: false,
}
},
methods: {
selectProvince(index) {
this.form.addressRegion[0] = this.provinceData[index]
this.form.addressRegion.province = this.provinceData[index]
},
selectCity(index) {
this.form.addressRegion[1] = this.cityData[this.provinceIndex][index]
this.form.addressRegion.city = this.cityData[this.provinceIndex][index]
},
selectArea(index) {
this.form.addressRegion[2] = this.areaData[this.provinceIndex][this.cityIndex][index]
this.form.addressRegion.area = this.areaData[this.provinceIndex][this.cityIndex][index]
},
selectDeliverProvince(index) {
this.form.deliverAddressRegion[0] = this.provinceData[index]
this.form.deliverAddressRegion.province = this.provinceData[index]
},
selectDeliverCity(index) {
this.form.deliverAddressRegion[1] = this.cityData[this.deliverProvinceIndex][index]
this.form.deliverAddressRegion.city = this.cityData[this.deliverProvinceIndex][index]
},
selectDeliverArea(index) {
this.form.deliverAddressRegion[2] = this.areaData[this.deliverProvinceIndex][this.deliverCityIndex][index]
this.form.deliverAddressRegion.area = this.areaData[this.deliverProvinceIndex][this.deliverCityIndex][index]
},
selectOfferProvince(index) {
this.form.offerAddressRegion[0] = this.provinceData[index]
this.form.offerAddressRegion.province = this.provinceData[index]
},
selectOfferCity(index) {
this.form.offerAddressRegion[1] = this.cityData[this.offerProvinceIndex][index]
this.form.offerAddressRegion.city = this.cityData[this.offerProvinceIndex][index]
},
selectOfferArea(index) {
this.form.offerAddressRegion[2] = this.areaData[this.offerProvinceIndex][this.offerCityIndex][index]
this.form.offerAddressRegion.area = this.areaData[this.offerProvinceIndex][this.offerCityIndex][index]
},
changeOfferAddressNoLimit(val) {
if (val) {
@@ -464,23 +603,211 @@ export default {
}
},
async publish() {
await vk.callFunction({
if (this.remainOldNum === 0) {
this.$confirm('您的旧货发布次数已用完,是否立即购买?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async ({confirm}) => {
if (confirm) {
const {data} = await vk.callFunction({
url: 'client/old/kh/buyNum',
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
}
})
return
}
// if (this.provinceIndex === null || this.cityIndex === null || this.areaIndex === null) return this.$message({
// message: "请选择完整的装货地址",
// type: 'warning'
// })
if (this.deliverProvinceIndex === null || this.deliverCityIndex === null || this.deliverAreaIndex === null) return this.$message({
message: "请选择完整的交货地址",
type: 'warning'
})
// if (!this.form.addressDetail) return this.$message({
// message: "请填写详细装货地址",
// type: 'warning'
// })
if (!this.form.deliverAddressDetail) return this.$message({
message: "请填写交货详细地址",
type: 'warning'
})
if (!this.form.title) return this.$message({
message: "请填写标题",
type: 'warning'
})
if (!this.form.otherCate) {
if (!this.form.category) return this.$message({
message: "请选择分类",
type: 'warning'
})
} else {
if (!this.form.otherCateName) return this.$message({
message: "请输入其他分类",
type: 'warning'
})
this.form.category = ['', this.form.otherCateName]
}
if (!this.form.expiredTime) return this.$message({
message: "请选择失效时间",
type: 'warning'
})
const maxExpiredTime = new Date();
maxExpiredTime.setFullYear(maxExpiredTime.getFullYear() + 1);
if (new Date(this.form.expiredTime).getTime() > maxExpiredTime.getTime()) return this.$message({
message: "为保证信息有效性发布最长时限为1年(12个月)",
type: 'warning'
})
if (!this.form.offerExpiredTime) return this.$message({
message: "请选择报价截止时间",
type: 'warning'
})
if (this.form.payMethod === '预付' && !this.form.prePayRate) {
return this.$message({
message: "请填写预付比例",
type: 'warning'
})
}
if (this.form.invoice) {
if (!this.form.invoiceOther) {
// if (!this.form.writeInvoiceTime) return this.$message({
// message: "请选择开票时间",
// type: 'warning'
// })
if (!this.form.taxType) return this.$message({
message: "请选择纳税人身份",
type: 'warning'
})
if (!this.form.invoiceType) return this.$message({
message: "请选择发票种类",
type: 'warning'
})
if (!this.form.taxRate) return this.$message({
message: "请选择税率",
type: 'warning'
})
}
}
this.disabled = true
const res = await vk.callFunction({
url: 'client/old/kh/add',
data: this.form
})
this.disabled = false
localStorage.removeItem("old_1")
this.$message({
message: "提交成功",
message: "您的信息已经提交,等待管理员审核,请您耐心等待!",
type: 'success'
})
vk.navigateBack()
setTimeout(() => {
if (this.form.isUrgent) {
vk.navigateTo({
url: `/pages/index/shop/pay?id=${res.data}`
})
} else {
vk.redirectTo({url: '/pages/index/old/old'});
}
}, 1500)
},
showAgreement() {
// this.$confirm(this.agreement, '金久信旧货交易协议', {
// cancelButtonText: '关闭',
// showConfirmButton: false,
// dangerouslyUseHTMLString: true,
// customClass: 'confirm-box'
// })
this.dialogVisible = true
},
openDownload() {
window.open(this.commonContractUrl)
},
previewUpload({url}) {
window.open(url)
},
navTo() {
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
selectContact(name) {
const contact = this.contactList.find(item => item.name === name)
this.form.buyer.managerContract = contact.phone
},
changePayMethod(payMethod) {
if (payMethod !== '预付') {
this.form.prePayRate = null
}
},
save() {
localStorage.setItem("old_1", JSON.stringify({
form: this.form,
deliverProvinceIndex: this.deliverProvinceIndex,
deliverCityIndex: this.deliverCityIndex,
deliverAreaIndex: this.deliverAreaIndex,
offerProvinceIndex: this.offerProvinceIndex,
offerCityIndex: this.offerCityIndex,
offerAreaIndex: this.offerAreaIndex
}))
this.$message({
message: "已保存",
type: 'success'
})
},
agreeNClose() {
this.dialogVisible = false
this.agree = true
}
},
mounted() {
vk.callFunction({
url: 'client/old/pub/getTree',
title: '请求中...',
data: {type: 1},
success: (data) => {
this.cateData = data.rows.map(item => {
item.children.forEach(child => {
delete child.children
})
return item
})
}
});
if (vk.getVuex('$user.userInfo.accountType') === 2) {
this.form.buyer.companyName = vk.getVuex('$user.userInfo.company.companyName')
this.form.buyer.contract = vk.getVuex('$user.userInfo.company.mobile')
} else {
this.form.buyer.personalName = vk.getVuex('$user.userInfo.person.personName')
this.form.buyer.personalContract = vk.getVuex('$user.userInfo.person.mobile')
}
if (!!localStorage.getItem("old_1")) {
this.$confirm('您有一份暂存数据,是否恢复?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
const savedData = JSON.parse(localStorage.getItem("old_1"))
this.form = savedData.form
this.deliverProvinceIndex = savedData.deliverProvinceIndex
this.deliverCityIndex = savedData.deliverCityIndex
this.deliverAreaIndex = savedData.deliverAreaIndex
this.offerProvinceIndex = savedData.offerProvinceIndex
this.offerCityIndex = savedData.offerCityIndex
this.offerAreaIndex = savedData.offerAreaIndex
})
}
}
}
</script>
<style lang="scss" scoped>
@import "@/common/css/app.scss";
.form-title-wrap {
display: flex;
align-items: center;
@@ -494,10 +821,10 @@ export default {
.form-title {
padding-left: 10px;
color: $--color-primary;
color: #A92924;
font-size: 18px;
line-height: 18px;
border-left: 4px solid $--color-primary;
border-left: 4px solid #A92924;
}
}
@@ -508,11 +835,11 @@ export default {
</style>
<style>
/deep/ .input-with-select{
::v-deep .input-with-select {
width: 200px;
}
/deep/ .input-with-select .el-input-group__append {
::v-deep .input-with-select .el-input-group__append {
background-color: #fff !important;
width: 80px !important;
}
+459 -151
View File
@@ -1,42 +1,53 @@
<template>
<view class="flex flex-col justify-start items-start">
<text class="text-50">发布我的承租信息</text>
<text class="text-gray">承租信息越完整,成功交易越容易</text>
<text class="text-50">发布我的{{ form.rentType === 0 ? '承租' : '租赁' }}信息</text>
<text class="text-gray my-15">建议合同中的采购方补充条款</text>
<el-form ref="form" :model="form" label-width="140px" class="mt-20">
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="信息失效时间:">
<el-date-picker
:picker-options="pickerOptions"
v-model="form.expiredTime"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
<div class="text-main text-25 mt-10">温馨提示:为保证信息有效性发布最长时限为1年(12个月)到期后需重新发布。</div>
</el-form-item>
<el-form-item label="物资分类:">
<el-radio-group v-model="form.category" size="small">
<el-radio label="机械设备">
<text>机械设备</text>
</el-radio>
<el-radio label="成品钢材">
<text>成品钢材</text>
</el-radio>
<el-radio label="废旧钢材">
<text>废旧钢材</text>
</el-radio>
<el-radio label="旧架子管">
<text>旧架子管</text>
</el-radio>
<el-radio label="旧扣件">
<text>旧扣件</text>
</el-radio>
</el-radio-group>
</el-col>
<el-col :span="8">
<el-form-item label="租赁分类:">
<el-select v-model="form.rentType">
<el-option label="承租信息" :value="0"/>
<el-option label="出租信息" :value="1"/>
</el-select>
</el-form-item>
<el-form-item label="信息标题:">
<el-input v-model="form.title" placeholder="一句话简介物资,如拍卖直缝钢管200吨等"/>
</el-col>
</el-row>
<el-form-item label="物资分类:" required>
<div class="flex justify-start items-center">
<el-cascader :options="cateData" v-model="form.category" :disabled="form.otherCate"
:props="{'label': 'name', 'value': 'name'}"/>
<el-checkbox v-model="form.otherCate" class="mx-20">其他分类</el-checkbox>
<el-input v-model="form.otherCateName" :disabled="!form.otherCate"
placeholder="如物资分类选项中不能描述您的信息物资主要内容,请在此用专业或通用术语填写"
class="ml-20"/>
</div>
</el-form-item>
<el-form-item label="出租物资详情:">
<el-form-item label="信息标题:" required>
<el-input v-model="form.title" placeholder="一句话简介物资,如 承租或出租架子管、扣件、建筑机械等"/>
</el-form-item>
<el-form-item label="附件上传:">
<vk-data-upload v-model="form.files" list-type="text"
accept="image/*">
</vk-data-upload>
</el-form-item>
<el-form-item label="租赁详情:">
<el-input v-model="form.desc" placeholder="请详细描述物资信息,描述内容:材料名称、材质......(限300字以内)"
type="textarea" show-word-limit maxlength="300"/>
</el-form-item>
<el-form-item label="物资装货地" class="ml-10">
<el-form-item label="物资装货地" class="ml-10" v-if="form.rentType === 0">
<el-row :gutter="10">
<el-col :span="5">
<el-select v-model="provinceIndex" placeholder="省" @change="selectProvince">
@@ -68,7 +79,7 @@
</el-col>
</el-row>
</el-form-item>
<el-form-item label="物资交货地" class="ml-10">
<el-form-item :label="form.rentType === 0 ? '物资交货地' : '物资装货地'" class="ml-10" required>
<el-row :gutter="10">
<el-col :span="5">
<el-select v-model="deliverProvinceIndex" placeholder="省" @change="selectDeliverProvince">
@@ -95,22 +106,25 @@
</el-select>
</el-col>
<el-col :span="8">
<el-input v-model="form.addressDetail"
<el-input v-model="form.deliverAddressDetail"
placeholder="详细地址或几公里范围内"></el-input>
</el-col>
</el-row>
</el-form-item>
<view class="form-title-wrap" style="justify-content: flex-start">
<view class="goods-info-title">
<view class="form-title-wrap"
style="justify-content: flex-start; flex-direction: column; align-items: flex-start">
<view class="goods-info-title mb-25">
<view class="form-title">
纳税和税票要求
税票要求
</view>
</view>
<view class="my-20">
<el-radio-group v-model="form.invoice">
<el-radio :label="true">含税</el-radio>
<el-radio :label="false">不含税</el-radio>
</el-radio-group>
</view>
</view>
<view class="p-30">
<template v-if="form.invoice">
<el-form-item label="开票时间:">
@@ -120,27 +134,72 @@
<el-radio :label="2">付款前</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="发票种类:">
<el-radio-group v-model="form.invoiceType">
<el-radio :label="0">增值税专用发票13%</el-radio>
<el-radio :label="1">增值税普通发票</el-radio>
<el-radio :label="2">普通发票</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="其他要求:">
<el-input v-model="form.invoiceOther" placeholder="请输入" size="small" type="textarea"/>
</el-form-item>
<el-form-item label="报价明细:">
<el-input v-model="form.invoiceDetail" placeholder="请输入" size="small" type="textarea"/>
<!-- <el-form-item label="发票种类:">-->
<!-- <el-radio-group v-model="form.invoiceType">-->
<!-- <el-radio :label="0">增值税专用发票13%</el-radio>-->
<!-- <el-radio :label="1">增值税普通发票</el-radio>-->
<!-- <el-radio :label="2">普通发票</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="其他要求:">-->
<!-- <el-input v-model="form.invoiceOther" placeholder="请输入其他要求" size="small"-->
<!-- type="textarea"/>-->
<!-- </el-form-item>-->
<view class="mb-20 flex justify-start items-center">
<view class="flex-1 flex justify-start items-center">
<text style="width: 30%">纳税人身份:</text>
<el-select v-model="form.taxType" placeholder="纳税人身份" style="width: 100%">
<el-option
v-for="item in ['一般纳税人', '小规模公司', '个体工商户']"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</view>
<view class="flex-1 flex justify-start items-center ml-20">
<text style="width: 30%">发票种类:</text>
<el-select v-model="form.invoiceType" placeholder="发票种类" style="width: 100%">
<el-option
v-for="item in ['专用发票', '普通发票']"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</view>
</view>
<view class="mb-20 flex justify-start items-center">
<view class="flex-1 flex justify-start items-center">
<text style="width: 30%">税率:</text>
<el-select v-model="form.taxRate" placeholder="税率" style="width: 100%">
<el-option
v-for="item in ['13%', '9%', '6%', '4%', '3%', '1%']"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</view>
<view class="ml-20 flex justify-start items-center flex-1 ml-20">
<text style="width: 30%">手动填写税票要求:</text>
<el-input v-model="form.invoiceOther" placeholder="如:一般纳税人 专用发票 税率13%"
size="small"/>
</view>
</view>
<el-form-item label="发票明细说明:">
<el-input v-model="form.invoiceDetail" placeholder="请输入发票明细说明" size="small"
type="textarea"/>
</el-form-item>
</template>
<el-form-item label="报价失效时间:">
<el-date-picker
v-model="form.offerExpiredTime"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="报价失效时间:" >-->
<!-- <el-date-picker-->
<!-- :picker-options="pickerOptions"-->
<!-- v-model="form.offerExpiredTime"-->
<!-- type="datetime"-->
<!-- placeholder="选择日期时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
</view>
<view class="form-title-wrap">
<view class="goods-info-title">
@@ -185,25 +244,26 @@
</el-form-item>
</el-row>
<el-form-item label="付款方式:">
<view class="flex justify-start items-center">
<view class="flex justify-start items-center mr-35">
<el-radio label="预付" v-model="form.payMethod">
<text>预付</text>
</el-radio>
<el-input v-model="form.prePayRate" style="width: 200px"/>
<text>%货到付全款</text>
</view>
<el-radio label="提货付全款" v-model="form.payMethod">
<text>提货付全款</text>
</el-radio>
</view>
<view class="flex justify-start items-center mt-40">
<el-radio label="其他付款方式描述" v-model="form.payMethod">
<text>其他付款方式描述</text>
</el-radio>
<el-input v-model="form.otherPayMethodDesc"
type="textarea" show-word-limit maxlength="300"/>
</view>
<el-input v-model="form.otherPayMethodDesc" placeholder="请输入付款方式" size="small" type="textarea"/>
<!-- <view class="flex justify-start items-center">-->
<!-- <view class="flex justify-start items-center mr-35">-->
<!-- <el-radio label="预付" v-model="form.payMethod">-->
<!-- <text>预付</text>-->
<!-- </el-radio>-->
<!-- <el-input v-model="form.prePayRate" style="width: 200px"/>-->
<!-- <text>%货到付全款</text>-->
<!-- </view>-->
<!-- <el-radio label="提货付全款" v-model="form.payMethod">-->
<!-- <text>提货付全款</text>-->
<!-- </el-radio>-->
<!-- </view>-->
<!-- <view class="flex justify-start items-center mt-40">-->
<!-- <el-radio label="其他付款方式描述" v-model="form.payMethod">-->
<!-- <text>其他付款方式描述</text>-->
<!-- </el-radio>-->
<!-- <el-input v-model="form.otherPayMethodDesc"-->
<!-- type="textarea" show-word-limit maxlength="300"/>-->
<!-- </view>-->
</el-form-item>
<el-form-item label="报价形式:">
<el-radio label="整单报价" v-model="form.offerType">
@@ -216,16 +276,30 @@
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
简易合同备注和其他补充条款
合同条款
</view>
</view>
</view>
<view class="p-30">
<view class="mb-20 flex justify-start items-center">
<el-radio v-model="form.signMethod" :label="0">法大大</el-radio>
<el-radio v-model="form.signMethod" :label="0">线上签约-标准合同</el-radio>
<el-radio v-model="form.signMethod" :label="2">线上签约-双方协商合同</el-radio>
<el-radio v-model="form.signMethod" :label="1">线下签约</el-radio>
</view>
<view class="my-25" v-if="form.signMethod === 2">
<view class="p-30">
<view class="mb-20 flex justify-start items-center">
<text style="width: 140px">合同附件:</text>
<vk-data-upload v-model="form.contractAttachment"
:on-preview="previewUpload"
accept=".pdf" list-type="text"/>
</view>
</view>
</view>
<view v-if="form.signMethod === 0">
<view @click="openDownload" class="pointer my-25 text-main">
点击查看标准合同
</view>
<view class="flex justify-start items-start border">
<view class="m-10 sign-method-header">违约责任:</view>
<view class="border-left m-10 pl-20 flex-1">
@@ -254,56 +328,56 @@
</view>
</view>
<view class="flex justify-start items-start border">
<view class="m-10 sign-method-header">采购方补充条款:</view>
<view class="m-10 sign-method-header">{{ form.rentType === 0 ? '采购方补充条款:' : '出租方补充条款' }}</view>
<view class="border-left m-10 pl-20 flex-1">
供货方逾期供货承担采购方一切损失
<el-input v-model="form.supplementary" :placeholder="form.rentType === 0 ? '请输入采购方补充条款:' : '请输入出租方补充条款'"/>
</view>
</view>
</view>
</view>
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
采购商信息
</view>
</view>
</view>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="公司信息">
<el-input v-model="form.buyer.companyName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="公司联系方式">
<el-input v-model="form.buyer.contract"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="个人信息">
<el-input v-model="form.buyer.personalName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="个人联系方式">
<el-input v-model="form.buyer.personalContract"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="授权人姓名">
<el-input v-model="form.buyer.managerName"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="授权联系方式">
<el-input v-model="form.buyer.managerContract"/>
</el-form-item>
</el-col>
</el-row>
<!-- <view class="form-title-wrap">-->
<!-- <view class="goods-info-title">-->
<!-- <view class="form-title">-->
<!-- 采购商信息-->
<!-- </view>-->
<!-- </view>-->
<!-- </view>-->
<!-- <el-row :gutter="10">-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="公司信息">-->
<!-- <el-input v-model="form.buyer.companyName"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="公司联系方式">-->
<!-- <el-input v-model="form.buyer.contract"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row :gutter="10">-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="个人信息">-->
<!-- <el-input v-model="form.buyer.personalName"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="个人联系方式">-->
<!-- <el-input v-model="form.buyer.personalContract"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row :gutter="10">-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="授权人姓名">-->
<!-- <el-input v-model="form.buyer.managerName"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="授权联系方式">-->
<!-- <el-input v-model="form.buyer.managerContract"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
@@ -311,7 +385,7 @@
</view>
</view>
</view>
<el-row :gutter="10">
<el-row :gutter="10" v-if="vk.getVuex('$user.userInfo.accountType') === 2">
<el-col :span="12">
<el-form-item label="公司信息">
<el-input v-model="form.supplier.companyName"/>
@@ -323,7 +397,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-row :gutter="10" v-if="vk.getVuex('$user.userInfo.accountType') === 1">
<el-col :span="12">
<el-form-item label="个人信息">
<el-input v-model="form.supplier.personalName"/>
@@ -331,19 +405,32 @@
</el-col>
<el-col :span="12">
<el-form-item label="个人联系方式">
<el-input v-model="form.supplier.personalContract"/>
<el-input v-model="form.supplier.personalContract" type="number"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="授权人姓名">
<el-input v-model="form.supplier.managerName"/>
<el-col :span="12" class="flex justify-start items-center">
<el-form-item label="授权业务咨询人">
<el-select v-model="form.supplier.managerName" 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="navTo">个人中心</text>
<text>添加</text>
</view>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="授权联系方式">
<el-input v-model="form.supplier.managerContract"/>
<el-col :span="12" class="flex justify-start items-center">
<el-form-item label="业务咨询联系方式">
<el-input v-model="form.supplier.managerContract" type="number" disabled/>
</el-form-item>
</el-col>
</el-row>
@@ -357,9 +444,32 @@
<text>否</text>
</el-radio>
</view>
<view class="flex justify-center items-center mt-30 m-a">
<el-button type="primary" :disabled="checked === '否'" @click="publish">立即发布</el-button>
<view class="mt-20 flex justify-start items-center">
<text class="mr-25">是否加急({{ urgentAmount }}元/次,将在旧货交易页面加急展示区展示):</text>
<el-radio :label="true" v-model="form.isUrgent">
<text>是</text>
</el-radio>
<el-radio :label="false" v-model="form.isUrgent">
<text>否</text>
</el-radio>
</view>
<view class="my-25 text-main font-bold">本月剩余旧货发布次数:{{ remainOldNum }}</view>
<view class="flex justify-start items-center">
<el-checkbox v-model="agree">我已阅读并同意</el-checkbox>
<span class="text-main pointer font-bold" @click="showAgreement">《金久信旧货交易协议》</span>
</view>
<view class="flex justify-center items-center mt-30 m-a">
<el-button type="primary" @click="save" plain>暂存</el-button>
<el-button type="primary" :disabled="checked === '否' || !agree || disabled" @click="publish">立即发布</el-button>
</view>
<el-dialog title="金久信旧货交易协议" :visible.sync="dialogVisible" width="70%" close-on-press-escape
close-on-click-modal show-close
>
<div v-html="agreement"></div>
<div class="flex justify-end items-center">
<el-button type="primary" @click="agreeNClose">已阅读并同意</el-button>
</div>
</el-dialog>
</view>
</template>
@@ -370,31 +480,66 @@ import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
export default {
name: "type_2",
props: {
urgentAmount: {
type: Number,
default: 10
},
remainOldNum: {
type: Number,
default: 0
},
agreement: {
type: String,
default: ''
},
commonContractUrl: {
type: String,
default: ''
},
contactList: {
type: Array,
default: ''
},
},
data() {
return {
pickerOptions: {
disabledDate(time) {
const maxDate = new Date();
maxDate.setFullYear(maxDate.getFullYear() + 1);
return time.getTime() < Date.now() || time.getTime() > maxDate.getTime();
},
},
agree: false,
provinceData: provinces,
cityData: citys,
areaData: areas,
allChildCate: [],
cateData: [],
form: {
otherCate: false,
otherCateName: '',
type: 2,
rentType: 0,
category: 0,
files: [],
title: '',
desc: '',
addressRegion: [],
addressRegion: {},
addressDetail: '',
deliverAddressRegion: [],
deliverAddressRegion: {},
deliverAddressDetail: '',
invoice: false,
writeInvoiceTime: '',
invoice: true,
writeInvoiceTime: 0,
invoiceType: '',
invoiceOther: '',
invoiceDetail: '',
expiredTime: '',
offerExpiredTime: '',
offerAddressRegion: [],
offerAddressRegion: {},
offerAddressNoLimit: false,
payMethod: '预付',
payMethod: '其他付款方式描述',
offerType: '整单报价',
prePayRate: '',
otherPayMethodDesc: '',
@@ -415,7 +560,9 @@ export default {
managerName: '',
managerContract: '',
},
contractAttachment: [],
isUrgent: false,
supplementary: ''
},
provinceIndex: null,
cityIndex: null,
@@ -426,36 +573,39 @@ export default {
offerProvinceIndex: null,
offerCityIndex: null,
offerAreaIndex: null,
checked: '否'
checked: '否',
dialogVisible: false,
disabled: false,
}
},
methods: {
selectProvince(index) {
this.form.addressRegion[0] = this.provinceData[index]
this.form.addressRegion.province = this.provinceData[index]
},
selectCity(index) {
this.form.addressRegion[1] = this.cityData[this.provinceIndex][index]
this.form.addressRegion.city = this.cityData[this.provinceIndex][index]
},
selectArea(index) {
this.form.addressRegion[2] = this.areaData[this.provinceIndex][this.cityIndex][index]
this.form.addressRegion.area = this.areaData[this.provinceIndex][this.cityIndex][index]
},
selectDeliverProvince(index) {
this.form.deliverAddressRegion[0] = this.provinceData[index]
this.form.deliverAddressRegion.province = this.provinceData[index]
},
selectDeliverCity(index) {
this.form.deliverAddressRegion[1] = this.cityData[this.deliverProvinceIndex][index]
this.form.deliverAddressRegion.city = this.cityData[this.deliverProvinceIndex][index]
},
selectDeliverArea(index) {
this.form.deliverAddressRegion[2] = this.areaData[this.deliverProvinceIndex][this.deliverCityIndex][index]
this.form.deliverAddressRegion.area = this.areaData[this.deliverProvinceIndex][this.deliverCityIndex][index]
},
selectOfferProvince(index) {
this.form.offerAddressRegion[0] = this.provinceData[index]
this.form.offerAddressRegion.province = this.provinceData[index]
},
selectOfferCity(index) {
this.form.offerAddressRegion[1] = this.cityData[this.offerProvinceIndex][index]
this.form.offerAddressRegion.city = this.cityData[this.offerProvinceIndex][index]
},
selectOfferArea(index) {
this.form.offerAddressRegion[2] = this.areaData[this.offerProvinceIndex][this.offerCityIndex][index]
this.form.offerAddressRegion.area = this.areaData[this.offerProvinceIndex][this.offerCityIndex][index]
},
changeOfferAddressNoLimit(val) {
if (val) {
@@ -464,23 +614,181 @@ export default {
}
},
async publish() {
await vk.callFunction({
// if (this.provinceIndex === null || this.cityIndex === null || this.areaIndex === null) return this.$message({
// message: "请选择完整的装货地址",
// type: 'warning'
// })
if (this.deliverProvinceIndex === null || this.deliverCityIndex === null || this.deliverAreaIndex === null) return this.$message({
message: "请选择完整的交货地址",
type: 'warning'
})
// if (!this.form.addressDetail) return this.$message({
// message: "请填写详细装货地址",
// type: 'warning'
// })
if (!this.form.deliverAddressDetail) return this.$message({
message: "请填写交货详细地址",
type: 'warning'
})
if (!this.form.title) return this.$message({
message: "请填写标题",
type: 'warning'
})
if (!this.form.otherCate) {
if (!this.form.category) return this.$message({
message: "请选择分类",
type: 'warning'
})
} else {
if (!this.form.otherCateName) return this.$message({
message: "请输入其他分类",
type: 'warning'
})
this.form.category = ['', this.form.otherCateName]
}
if (!this.form.expiredTime) return this.$message({
message: "请选择失效时间",
type: 'warning'
})
const maxExpiredTime = new Date();
maxExpiredTime.setFullYear(maxExpiredTime.getFullYear() + 1);
if (new Date(this.form.expiredTime).getTime() > maxExpiredTime.getTime()) return this.$message({
message: "为保证信息有效性发布最长时限为1年(12个月)",
type: 'warning'
})
if (this.form.invoice) {
if (!this.form.invoiceOther) {
// if (!this.form.writeInvoiceTime) return this.$message({
// message: "请选择开票时间",
// type: 'warning'
// })
if (!this.form.taxType) return this.$message({
message: "请选择纳税人身份",
type: 'warning'
})
if (!this.form.invoiceType) return this.$message({
message: "请选择发票种类",
type: 'warning'
})
if (!this.form.taxRate) return this.$message({
message: "请选择税率",
type: 'warning'
})
}
}
// if (!this.form.offerExpiredTime) return this.$message({
// message: "请选择报价失效时间",
// type: 'warning'
// })
this.disable = true
const res = await vk.callFunction({
url: 'client/old/kh/add',
data: this.form
})
this.disable = false
localStorage.removeItem("old_2")
this.$message({
message: "提交成功",
message: "您的信息已经提交,等待管理员审核,请您耐心等待!",
type: 'success'
})
vk.navigateBack()
setTimeout(() => {
if (this.form.isUrgent) {
vk.navigateTo({
url: `/pages/index/shop/pay?id=${res.data}`
})
} else {
vk.redirectTo({url: '/pages/index/old/old'});
}
}, 1500)
},
showAgreement() {
// this.$confirm(this.agreement, '金久信旧货交易协议', {
// cancelButtonText: '关闭',
// showConfirmButton: false,
// dangerouslyUseHTMLString: true,
// customClass: 'confirm-box'
// })
this.dialogVisible = true
},
openDownload() {
window.open(this.commonContractUrl)
},
previewUpload({url}) {
window.open(url)
},
navTo() {
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
selectContact(name) {
const contact = this.contactList.find(item => item.name === name)
this.form.supplier.managerContract = contact.phone
},
save() {
localStorage.setItem("old_2", JSON.stringify({
form: this.form,
deliverProvinceIndex: this.deliverProvinceIndex,
deliverCityIndex: this.deliverCityIndex,
deliverAreaIndex: this.deliverAreaIndex,
offerProvinceIndex: this.offerProvinceIndex,
offerCityIndex: this.offerCityIndex,
offerAreaIndex: this.offerAreaIndex
}))
this.$message({
message: "已保存",
type: 'success'
})
},
agreeNClose() {
this.dialogVisible = false
this.agree = true
}
},
mounted() {
vk.callFunction({
url: 'client/old/pub/getTree',
title: '请求中...',
data: {type: 2},
success: (data) => {
this.cateData = data.rows.map(item => {
item.children.forEach(child => {
delete child.children
})
return item
})
}
});
if (vk.getVuex('$user.userInfo.accountType') === 2) {
this.form.supplier.companyName = vk.getVuex('$user.userInfo.company.companyName')
this.form.supplier.contract = vk.getVuex('$user.userInfo.company.mobile')
} else {
this.form.supplier.personalName = vk.getVuex('$user.userInfo.person.personName')
this.form.supplier.personalContract = vk.getVuex('$user.userInfo.person.mobile')
}
if (!!localStorage.getItem("old_2")) {
this.$confirm('您有一份暂存数据,是否恢复?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
const savedData = JSON.parse(localStorage.getItem("old_2"))
this.form = savedData.form
this.deliverProvinceIndex = savedData.deliverProvinceIndex
this.deliverCityIndex = savedData.deliverCityIndex
this.deliverAreaIndex = savedData.deliverAreaIndex
this.offerProvinceIndex = savedData.offerProvinceIndex
this.offerCityIndex = savedData.offerCityIndex
this.offerAreaIndex = savedData.offerAreaIndex
})
}
}
}
</script>
<style lang="scss" scoped>
@import "@/common/css/app.scss";
.form-title-wrap {
display: flex;
align-items: center;
@@ -494,10 +802,10 @@ export default {
.form-title {
padding-left: 10px;
color: $--color-primary;
color: #A92924;
font-size: 18px;
line-height: 18px;
border-left: 4px solid $--color-primary;
border-left: 4px solid #A92924;
}
}
@@ -508,11 +816,11 @@ export default {
</style>
<style>
/deep/ .input-with-select{
::v-deep .input-with-select {
width: 200px;
}
/deep/ .input-with-select .el-input-group__append {
::v-deep .input-with-select .el-input-group__append {
background-color: #fff !important;
width: 80px !important;
}
+236 -48
View File
@@ -3,45 +3,37 @@
<text class="text-50">发布我的回收信息</text>
<text class="text-gray">回收信息越完整,成功交易越容易</text>
<el-form ref="form" :model="form" label-width="140px" class="mt-20">
<el-form-item label="信息失效时间:">
<el-form-item label="信息失效时间:" required>
<el-date-picker
:picker-options="pickerOptions"
v-model="form.expiredTime"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
<div class="text-main text-25 mt-10">温馨提示:为保证信息有效性发布最长时限为1年(12个月)到期后需重新发布。</div>
</el-form-item>
<el-form-item label="物资分类:">
<el-radio-group v-model="form.category" size="small">
<el-radio label="机械设备">
<text>机械设备</text>
</el-radio>
<el-radio label="成品钢材">
<text>成品钢材</text>
</el-radio>
<el-radio label="废旧钢材">
<text>废旧钢材</text>
</el-radio>
<el-radio label="旧架子管">
<text>旧架子管</text>
</el-radio>
<el-radio label="旧扣件">
<text>旧扣件</text>
</el-radio>
</el-radio-group>
<el-form-item label="物资分类:" required>
<div class="flex justify-start items-center">
<el-cascader :options="cateData" v-model="form.category" :disabled="form.otherCate"
:props="{'label': 'name', 'value': 'name'}"/>
<el-checkbox v-model="form.otherCate" class="mx-20">其他分类</el-checkbox>
<el-input v-model="form.otherCateName" :disabled="!form.otherCate" placeholder="如物资分类选项中不能描述您的信息物资主要内容,请在此用专业或通用术语填写"
class="ml-20"/>
</div>
</el-form-item>
<el-form-item label="信息标题:">
<el-input v-model="form.title" placeholder="一句话简介物资,如拍卖直缝钢管200吨等"/>
<el-form-item label="信息标题:" required>
<el-input v-model="form.title" placeholder="一句话简介回收内容,如 常年回收 二手、废旧螺纹钢、型材等"/>
</el-form-item>
<el-form-item label="回收方简述:">
<el-input v-model="form.desc" placeholder="请详细描述物资信息,描述内容:材料名称、材质......(限300字以内)"
type="textarea" show-word-limit maxlength="300"/>
</el-form-item>
<el-form-item label="回收物实景照片:">
<vk-data-upload v-model="form.files"
<vk-data-upload v-model="form.files" list-type="text"
accept="image/*">
</vk-data-upload>
</el-form-item>
<el-form-item label="回收单位地址" class="ml-10">
<el-form-item label="回收单位地址" class="ml-10" required>
<el-row :gutter="10">
<el-col :span="5">
<el-select v-model="provinceIndex" placeholder="省" @change="selectProvince">
@@ -80,7 +72,7 @@
</view>
</view>
</view>
<el-row :gutter="10">
<el-row :gutter="10" v-if="vk.getVuex('$user.userInfo.accountType') === 2">
<el-col :span="12">
<el-form-item label="公司信息">
<el-input v-model="form.supplier.companyName"/>
@@ -92,7 +84,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-row :gutter="10" v-if="vk.getVuex('$user.userInfo.accountType') === 1">
<el-col :span="12">
<el-form-item label="个人信息">
<el-input v-model="form.supplier.personalName"/>
@@ -105,14 +97,27 @@
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="授权人姓名">
<el-input v-model="form.supplier.managerName"/>
<el-col :span="12" class="flex justify-start items-center">
<el-form-item label="授权业务咨询人">
<el-select v-model="form.supplier.managerName" 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="navTo">个人中心</text>
<text>添加</text>
</view>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="授权联系方式">
<el-input v-model="form.supplier.managerContract"/>
<el-col :span="12" class="flex justify-start items-center">
<el-form-item label="业务咨询联系方式">
<el-input v-model="form.supplier.managerContract" type="number" disabled/>
</el-form-item>
</el-col>
</el-row>
@@ -126,9 +131,31 @@
<text>否</text>
</el-radio>
</view>
<view class="flex justify-center items-center mt-30 m-a">
<el-button type="primary" :disabled="checked === '否'" @click="publish">立即发布</el-button>
<view class="mt-20 flex justify-start items-center">
<text class="mr-25">是否加急({{ urgentAmount }}元/次,将在旧货交易页面加急展示区展示):</text>
<el-radio :label="true" v-model="form.isUrgent">
<text>是</text>
</el-radio>
<el-radio :label="false" v-model="form.isUrgent">
<text>否</text>
</el-radio>
</view>
<view class="my-25 text-main font-bold">本月剩余旧货发布次数:{{ remainOldNum }}</view>
<view class="flex justify-start items-center">
<el-checkbox v-model="agree">我已阅读并同意</el-checkbox>
<span class="text-main pointer font-bold" @click="showAgreement">《金久信旧货交易协议》</span>
</view>
<view class="flex justify-center items-center mt-30 m-a">
<el-button type="primary" :disabled="checked === '否' || !agree" @click="publish">立即发布</el-button>
</view>
<el-dialog title="金久信旧货交易协议" :visible.sync="dialogVisible" width="70%" close-on-press-escape
close-on-click-modal show-close
>
<div v-html="agreement"></div>
<div class="flex justify-end items-center">
<el-button type="primary" @click="agreeNClose">已阅读并同意</el-button>
</div>
</el-dialog>
</view>
</template>
@@ -139,18 +166,48 @@ import areas from "@/uni_modules/vk-uview-ui/libs/address/areas.json";
export default {
name: "type_3",
props: {
urgentAmount: {
type: Number,
default: 10
},
remainOldNum: {
type: Number,
default: 0
},
agreement: {
type: String,
default: ''
},
contactList: {
type: Array,
default: ''
},
},
data() {
return {
pickerOptions: {
disabledDate(time) {
const maxDate = new Date();
maxDate.setFullYear(maxDate.getFullYear() + 1);
return time.getTime() < Date.now() || time.getTime() > maxDate.getTime();
},
},
agree: false,
provinceData: provinces,
cityData: citys,
areaData: areas,
allChildCate: [],
cateData: [],
form: {
otherCate: false,
otherCateName: '',
type: 3,
category: 0,
files: [],
title: '',
desc: '',
addressRegion: [],
addressRegion: {},
addressDetail: '',
expiredTime: '',
supplier: {
@@ -161,42 +218,169 @@ export default {
managerName: '',
managerContract: '',
},
isUrgent: false
},
provinceIndex: null,
cityIndex: null,
areaIndex: null,
checked: '否'
checked: '否',
dialogVisible: false
}
},
methods: {
selectProvince(index) {
this.form.addressRegion[0] = this.provinceData[index]
this.form.addressRegion.province = this.provinceData[index]
},
selectCity(index) {
this.form.addressRegion[1] = this.cityData[this.provinceIndex][index]
this.form.addressRegion.city = this.cityData[this.provinceIndex][index]
},
selectArea(index) {
this.form.addressRegion[2] = this.areaData[this.provinceIndex][this.cityIndex][index]
this.form.addressRegion.area = this.areaData[this.provinceIndex][this.cityIndex][index]
},
async publish() {
await vk.callFunction({
if (this.remainOldNum === 0) {
this.$confirm('您的旧货发布次数已用完,是否立即购买?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async ({confirm}) => {
if (confirm) {
const {data} = await vk.callFunction({
url: 'client/old/kh/buyNum',
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
}
})
return
}
if (this.provinceIndex === null || this.cityIndex === null || this.areaIndex === null) return this.$message({
message: "请选择完整的地址",
type: 'warning'
})
if (!this.form.addressDetail) return this.$message({
message: "请填写详细地址",
type: 'warning'
})
if (!this.form.title) return this.$message({
message: "请填写标题",
type: 'warning'
})
if (!this.form.otherCate) {
if (!this.form.category) return this.$message({
message: "请选择分类",
type: 'warning'
})
} else {
if (!this.form.otherCateName) return this.$message({
message: "请输入其他分类",
type: 'warning'
})
this.form.category = ['', this.form.otherCateName]
}
if (!this.form.expiredTime) return this.$message({
message: "请选择失效时间",
type: 'warning'
})
const maxExpiredTime = new Date();
maxExpiredTime.setFullYear(maxExpiredTime.getFullYear() + 1);
if (new Date(this.form.expiredTime).getTime() > maxExpiredTime.getTime()) return this.$message({
message: "为保证信息有效性发布最长时限为1年(12个月)",
type: 'warning'
})
const res = await vk.callFunction({
url: 'client/old/kh/add',
data: this.form
})
localStorage.removeItem("old_3")
this.$message({
message: "提交成功",
message: "您的信息已经提交,等待管理员审核,请您耐心等待!",
type: 'success'
})
vk.navigateBack()
if (this.form.isUrgent) {
vk.navigateTo({
url: `/pages/index/shop/pay?id=${res.data}`
})
} else {
vk.redirectTo({url: '/pages/index/old/old'});
}
},
showAgreement() {
// this.$confirm(this.agreement, '金久信旧货交易协议', {
// cancelButtonText: '关闭',
// showConfirmButton: false,
// dangerouslyUseHTMLString: true,
// customClass: 'confirm-box'
// })
this.dialogVisible = true
},
navTo() {
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
selectContact(name) {
const contact = this.contactList.find(item => item.name === name)
this.form.supplier.managerContract = contact.phone
},
save() {
localStorage.setItem("old_3", JSON.stringify({
form: this.form,
provinceIndex: this.provinceIndex,
cityIndex: this.cityIndex,
areaIndex: this.areaIndex,
}))
this.$message({
message: "已保存",
type: 'success'
})
},
agreeNClose(){
this.dialogVisible = false
this.agree = true
}
},
mounted() {
vk.callFunction({
url: 'client/old/pub/getTree',
title: '请求中...',
data: {type: 3},
success: (data) => {
this.cateData = data.rows.map(item => {
item.children.forEach(child => {
delete child.children
})
return item
})
}
});
if (vk.getVuex('$user.userInfo.accountType') === 2) {
this.form.supplier.companyName = vk.getVuex('$user.userInfo.company.companyName')
this.form.supplier.contract = vk.getVuex('$user.userInfo.company.mobile')
} else {
this.form.supplier.personalName = vk.getVuex('$user.userInfo.person.personName')
this.form.supplier.personalContract = vk.getVuex('$user.userInfo.person.mobile')
}
if (!!localStorage.getItem("old_3")) {
this.$confirm('您有一份暂存数据,是否恢复?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
const savedData = JSON.parse(localStorage.getItem("old_3"))
this.form = savedData.form
this.provinceIndex = savedData.provinceIndex
this.cityIndex = savedData.cityIndex
this.areaIndex = savedData.areaIndex
})
}
}
}
</script>
<style lang="scss" scoped>
@import "@/common/css/app.scss";
.form-title-wrap {
display: flex;
align-items: center;
@@ -210,10 +394,10 @@ export default {
.form-title {
padding-left: 10px;
color: $--color-primary;
color: #A92924;
font-size: 18px;
line-height: 18px;
border-left: 4px solid $--color-primary;
border-left: 4px solid #A92924;
}
}
@@ -224,12 +408,16 @@ export default {
</style>
<style>
/deep/ .input-with-select{
::v-deep .input-with-select {
width: 200px;
}
/deep/ .input-with-select .el-input-group__append {
::v-deep .input-with-select .el-input-group__append {
background-color: #fff !important;
width: 80px !important;
}
.confirm-box .el-dialog {
width: 70%;
}
</style>
+384 -133
View File
@@ -4,54 +4,72 @@
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a">
<u-swiper :list="list" :height="380" borderRadius="0"></u-swiper>
<common-swiper page="self-support-company-swiper"/>
<view class="flex justify-end items-center text-main pointer my-20 " @click="demoDownload">示例下载</view>
<view class="bg-white p-40">
<view v-for="(item, index) in configList" :key="index"
class="my-20 flex flex-col justify-start items-start">
class="server-item my-20 flex flex-col justify-start items-start">
<el-checkbox v-model="configList[index].checked" @change="changeCheck(index, item.name, $event)">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center text-35 mb-20">
<text>服务内容:{{ item.name }}</text>
<view class="flex flex-col justify-start items-start">
<view v-for="(content, contentIndex) in item.contents" :key="contentIndex"
class="mb-40 flex justify-start items-center">
<view class="ml-35">
<view class="name">{{ item.name }}</view>
<view class="ml-15">
<text>业务编号:</text>
<text>{{ content.code }}</text>
<text v-if="item.contentIndex !== null">{{
item.contents[item.contentIndex].code
}}
</text>
</view>
<view class="flex justify-start items-center">
<text class="ml-35">服务服务项目:</text>
<el-checkbox v-model="configList[index].contents[contentIndex].checked"
:disabled="!content.amountList || content.amountList.length === 0">
{{ content.title }}
</el-checkbox>
</view>
<view class="flex justify-start items-center ml-35">
<el-select v-model="configList[index].contents[contentIndex].amountIndex"
clearable @change="selectAmount(index, contentIndex, $event)"
:disabled="!content.amountList || content.amountList.length === 0">
<el-option v-for="(amount, amountIndex) in content.amountList"
<view class="server-item-content">
<view class="server-select-row">
<text class="ml-15 nowrap-label">服务项目:</text>
<el-select v-model="configList[index].contentIndex" clearable
class="server-select"
:disabled="!contentList.includes(index)">
<el-option v-for="(content, contentIndex) in item.contents" :key="contentIndex"
:label="content.title" :value="contentIndex"/>
</el-select>
<template v-if="item.contentIndex !== null">
<text class="ml-15 nowrap-label">金额:</text>
<el-select v-model="configList[index].amountIndex"
clearable class="server-select ml-15">
<el-option
v-for="(amount, amountIndex) in item.contents[item.contentIndex].amountList"
:key="amountIndex"
:label="amount.title" :value="amountIndex"/>
</el-select>
<text class="ml-35" v-if="content.amountIndex !== null">
{{ content.amountList[content.amountIndex].amount }}元/次
</text>
</template>
</view>
<view class="server-amount-text" v-if="item.contentIndex !== null && item.amountIndex!== null">
{{ item.contents[item.contentIndex].amountList[item.amountIndex].amount }}元/次
</view>
<view class="server-amount-text" v-else>
元/次
</view>
</view>
</view>
<view class="remark">备注: {{ item.remark }}</view>
</view>
<view>备注: {{ item.remark }}</view>
</view>
</el-checkbox>
</view>
<el-form ref="form" :model="form" label-width="200px">
<view v-for="(item, companyIndex) in companyList" :key="companyIndex">
<el-form-item label="考察对象(个人/企业全称):" required>
<el-divider>{{ item.name }}</el-divider>
<el-form-item label="考察对象类型:" required>
<el-select v-model="companyList[companyIndex].type" placeholder="请选择考察对象类型">
<el-option label="企业" value="企业"></el-option>
<!-- <el-option label="个人" value="个人"></el-option>-->
<el-option label="项目" value="项目"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="`考察对象(全称):`" required>
<el-input v-model="companyList[companyIndex].name"/>
</el-form-item>
<el-form-item label="考察对象(个人身份证/企业信用代码):">
<template v-if="item.type === '个人'">
<el-form-item label="考察对象(全称): " required>
<el-input v-model="companyList[companyIndex].code"/>
</el-form-item>
<el-form-item label="考察对象(个人/单位)所在地:">
<el-form-item label="考察对象所在地:" required>
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][0]" placeholder="请选择省">
@@ -92,71 +110,11 @@
</el-col>
</el-row>
</el-form-item>
<el-form-item label="接收文件电子邮箱:">
<el-input v-model="companyList[companyIndex].email"/>
</el-form-item>
<el-form-item label="接收文件微信:">
<el-input v-model="companyList[companyIndex].wechat"/>
</el-form-item>
<el-form-item label="接收文件寄件地址">
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="receiveAddressIndex[companyIndex][0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[companyIndex][1]" placeholder="请选择市"
:disabled="receiveAddressIndex[companyIndex].length === 0">
<template v-if="receiveAddressIndex[companyIndex][0] !== null">
<el-option
v-for="(item, index) in cityData[receiveAddressIndex[companyIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[companyIndex][2]" placeholder="请选择区"
:disabled="receiveAddressIndex[companyIndex].length === 1">
<template
v-if="receiveAddressIndex[companyIndex][0] !== null && receiveAddressIndex[companyIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[receiveAddressIndex[companyIndex][0]][receiveAddressIndex[companyIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="companyList[companyIndex].receiveAddress" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="申请人:">
<el-input v-model="companyList[companyIndex].requestName"/>
</el-form-item>
<el-form-item label="联系人:">
<el-input v-model="companyList[companyIndex].contactName"/>
</el-form-item>
<el-form-item label="联系方式:">
<el-input v-model="companyList[companyIndex].contact"/>
</el-form-item>
<el-form-item label="本次服务费用小计:">
<view class="flex justify-between items-start mb-20 w-100p">
<view class="flex justify-start items-center">
<el-input v-model="amount" disabled/>
<view class="ml-20">
<el-button type="primary" @click.native="addCompany">增加考察对象
</el-button>
</view>
<view class="ml-20">
<el-button type="primary" plain @click.native="removeCompany(companyIndex)"
class="ml-20"
@@ -166,18 +124,120 @@
</view>
</view>
</el-form-item>
</view>
<el-divider/>
<el-button type="primary" @click.native="addCompany">增加考察对象
</el-button>
<el-form-item label="接收文件电子邮箱:" required>
<el-input v-model="email"/>
</el-form-item>
<el-form-item label="接收文件微信:" required>
<el-input v-model="wechat"/>
</el-form-item>
<el-form-item label="接收文件寄件地址" required>
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="receiveAddressIndex[0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[1]" placeholder="请选择市"
:disabled="receiveAddressIndex.length === 0">
<template v-if="receiveAddressIndex[0] !== null">
<el-option
v-for="(item, index) in cityData[receiveAddressIndex[0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[2]" placeholder="请选择区"
:disabled="receiveAddressIndex.length === 1">
<template
v-if="receiveAddressIndex[0] !== null && receiveAddressIndex[1] !== null">
<el-option
v-for="(item, index) in areaData[receiveAddressIndex[0]][receiveAddressIndex[1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="receiveAddress"
placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<p class="text-main text-25 text-center" style="margin-bottom: 80rpx">接收文件电子邮箱/ 接收文件微信/
接收文件寄件地址,以上三项选填一项即可</p>
<el-row :gutter="10">
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="申请人:" required>
<el-input v-model="requestName"/>
</el-form-item>
</el-col>
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="业务联系人:" required>
<el-input v-model="contactName"/>
</el-form-item>
</el-col>
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="业务咨询联系方式:" required>
<el-input v-model="contact"/>
</el-form-item>
</el-col>
<!-- <el-col :span="8" class="flex justify-start items-center">-->
<!-- <el-form-item label="业务联系人:" required>-->
<!-- <el-select v-model="contactName" 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="navTo">个人中心</text>-->
<!-- <text>添加</text>-->
<!-- </view>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8" class="flex justify-start items-center">-->
<!-- <el-form-item label="业务咨询联系方式:" required>-->
<!-- <el-input v-model="contact" type="number" disabled/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
<!-- <el-form-item label="联系方式:" required>-->
<!-- <el-input v-model="contact" disabled/>-->
<!-- </el-form-item>-->
</el-form>
<view class="mt-40 flex justify-center items-center">
<view class="flex justify-center items-center">
<text>总价:</text>
<text class="text-main font-bold text-35">{{ totalAmount }}元</text>
</view>
<view class="ml-35">客服联系方式: 0771-3923001</view>
<view class="ml-35">客服联系方式: 400-686-5559</view>
</view>
<view class="flex justify-start items-center">
<el-checkbox v-model="agree">我已阅读并同意</el-checkbox>
<span class="text-main pointer font-bold" @click="dialogVisible = true">《金久信自营交易协议》</span>
</view>
<view class="mt-40 flex justify-center items-center">
<el-button type="primary" @click="newOrder"
:disabled="companyList.length === 0 || !companyList[0].name">
:disabled="companyList.length === 0 || !companyList[0].name || !agree">
立即支付
</el-button>
</view>
@@ -185,6 +245,12 @@
</view>
<gap/>
<common-footer></common-footer>
<el-dialog
title="金久信自营交易协议"
:visible.sync="dialogVisible"
width="70%">
<div v-html="agreement"></div>
</el-dialog>
</view>
</template>
@@ -202,12 +268,6 @@ export default {
provinceData: provinces,
cityData: citys,
areaData: areas,
list: [
{
image: '/static/images/selfSupport/swiper.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
],
form: {},
configList: [],
checkList: [],
@@ -215,18 +275,21 @@ export default {
contentNameList: [],
addressIndex: [[null, null, null]],
addressDetail: '',
receiveAddressIndex: [[null, null, null]],
receiveAddressIndex: [null, null, null],
receiveAddressDetail: '',
companyList: [
{
name: '',
code: '',
type: '企业',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
}
],
email: '',
wechat: '',
receiveAddressRegion: {
@@ -238,11 +301,14 @@ export default {
requestName: '',
contactName: '',
contact: '',
}
],
agreement: '',
agree: false,
dialogVisible: false,
contactList: []
}
},
methods: {
async getConfigList() {
const {rows} = await vk.callFunction({
url: 'client/coop/config/pub/getList',
@@ -250,36 +316,34 @@ export default {
})
if (rows) {
this.configList = rows.map(item => {
item.contents.map(content => {
content.checked = false
content.amountIndex = null
return content
})
item.checked = false
item.contentIndex = null
item.amountIndex = null
return item
})
}
},
changeCheck(itemIndex, name, checked) {
this.configList.forEach((item, index) => {
item.checked = checked && index === itemIndex
if (index !== itemIndex || !checked) {
item.contentIndex = null
item.amountIndex = null
}
})
this.contentList = checked ? [itemIndex] : []
this.contentNameList = checked ? [name] : []
},
addCompany() {
this.companyList.push({
name: '',
code: '',
type: '企业',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
})
this.addressIndex.push([null, null, null])
this.receiveAddressIndex.push([null, null, null])
@@ -292,11 +356,11 @@ export default {
async newOrder() {
const amountList = []
this.configList.forEach(item => {
item.contents.forEach(content => {
if (content.checked && content.amountList.length > 0) {
item.contents.forEach((content, contentIndex) => {
if (contentIndex === item.contentIndex && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === content.amountIndex) {
amountList.push(amount._index)
if (amountIndex === item.amountIndex) {
amountList.push(`${content._index},${amount._index}`)
}
})
}
@@ -306,45 +370,166 @@ export default {
message: '请至少选择一项服务',
type: 'error'
})
// if (this.addressIndex[0][2] === null) return this.$message({
// message: '请选择地址',
// type: 'error'
// })
if (!this.email && !this.wechat && this.receiveAddressIndex[0][2] === null) return this.$message({
message: '请选择接收文件地址/微信/邮箱',
type: 'error'
})
this.companyList.forEach((item, index) => {
if (this.addressIndex[index][2]) {
const companyProvince = this.provinceData[this.addressIndex[index][0]]
const companyCity = this.cityData[this.addressIndex[index][0]][this.addressIndex[index][1]]
const companyArea = this.areaData[this.addressIndex[index][0]][this.addressIndex[index][1]][this.addressIndex[index][2]]
this.companyList[index].addressRegion = {
province: this.provinceData[this.addressIndex[index][0]],
city: this.cityData[this.addressIndex[index][0]][this.addressIndex[index][1]],
area: this.areaData[this.addressIndex[index][0]][this.addressIndex[index][1]][this.addressIndex[index][2]],
province: {code: companyProvince.code, name: companyProvince.name},
city: {code: companyCity.code, name: companyCity.name},
area: {code: companyArea.code, name: companyArea.name},
}
this.companyList[index].receiveAddressRegion = {
province: this.provinceData[this.receiveAddressIndex[index][0]],
city: this.cityData[this.receiveAddressIndex[index][0]][this.receiveAddressIndex[index][1]],
area: this.areaData[this.receiveAddressIndex[index][0]][this.receiveAddressIndex[index][1]][this.receiveAddressIndex[index][2]],
}
})
for (let i = 0; i < this.companyList.length; i++) {
if (!this.companyList[i].name) return this.$message({
message: '请填写考察对象名称',
type: 'error'
})
if (this.companyList[i].type === '个人') {
if (!this.companyList[i].code) return this.$message({
type: 'error',
message: '请填写考察个人身份证号',
})
if (!this.companyList[i].address) return this.$message({
type: 'error',
message: '请填写个人地址',
})
if (this.addressIndex[i][2] === null) return this.$message({
type: 'error',
message: '请填写个人地址',
})
}
}
if (!this.requestName) return this.$message({
type: 'error',
message: '请填写申请人',
})
if (!this.contactName) return this.$message({
type: 'error',
message: '请填写业务联系人姓名',
})
if (!this.contact) return this.$message({
type: 'error',
message: '请填写联系人电话',
})
if (this.receiveAddressIndex.length > 0 && this.receiveAddressIndex[2] !== null) {
const province = this.provinceData[this.receiveAddressIndex[0]]
const city = this.cityData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]]
const area = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]][this.receiveAddressIndex[2]]
this.receiveAddressRegion = {
province: {code: province.code, name: province.name},
city: {code: city.code, name: city.name},
area: {code: area.code, name: area.name},
}
}
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/addOrder',
title: '提交中...',
data: {
type: 0,
amountList,
contentList: this.companyList
contentList: this.companyList,
receiveAddressRegion: this.receiveAddressRegion,
email: this.email,
wechat: this.wechat,
receiveAddress: this.receiveAddress,
requestName: this.requestName,
contactName: this.contactName,
contact: this.contact,
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
},
selectAmount(index, contentIndex, e) {
console.log(index, contentIndex, e)
showAgreement() {
this.$confirm(this.agreement, '金久信自营交易协议', {
cancelButtonText: '关闭',
showConfirmButton: false,
dangerouslyUseHTMLString: true,
})
},
async getAgreement() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '65885d4c09664c1c8d8e8476'
},
})
this.agreement = res.content
},
demoDownload() {
vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '6588642a99c624e89199fbb4'
},
success: res => {
window.open(res.content)
}
})
},
async getContactList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.contactList = rows
},
navTo() {
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
selectContact(name) {
const contact = this.contactList.find(item => item.name === name)
this.contact = contact.phone
}
},
onLoad() {
const userInfo = vk.getVuex('$user.userInfo')
if (parseInt(userInfo.accountType) === 2) {
this.email = userInfo.company.contactEmail
this.requestName = userInfo.manager.personName
this.contactName = userInfo.manager.personName
this.contact = userInfo.company.mobile
if (userInfo.company && userInfo.company.addressRegion) {
this.receiveAddressIndex[0] = this.provinceData.findIndex(item => item.name === userInfo.company.addressRegion.province.name)
this.receiveAddressIndex[1] = this.cityData[this.receiveAddressIndex[0]].findIndex(item => item.name === userInfo.company.addressRegion.city.name)
this.receiveAddressIndex[2] = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]].findIndex(item => item.name === userInfo.company.addressRegion.area.name)
}
if (userInfo.company.addressDetail) this.receiveAddress = userInfo.company.addressDetail
} else {
if (userInfo.businessCard && userInfo.businessCard.email) this.email = userInfo.businessCard.email
this.requestName = userInfo.person.personName
this.contactName = userInfo.person.personName
this.contact = userInfo.person.mobile
if (userInfo.person && userInfo.person.addressRegion) {
this.receiveAddressIndex[0] = this.provinceData.findIndex(item => item.name === userInfo.person.addressRegion.province.name)
this.receiveAddressIndex[1] = this.cityData[this.receiveAddressIndex[0]].findIndex(item => item.name === userInfo.person.addressRegion.city.name)
this.receiveAddressIndex[2] = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]].findIndex(item => item.name === userInfo.person.addressRegion.area.name)
}
if (userInfo.person.addressDetail) this.receiveAddress = userInfo.person.addressDetail
}
this.getAgreement()
this.getConfigList()
// this.getContactList()
},
computed: {
amount() {
let tmpAmount = 0
this.configList.forEach(item => {
item.contents.forEach(content => {
if (content.checked && content.amountList.length > 0) {
item.contents.forEach((content, contentIndex) => {
if (contentIndex === item.contentIndex && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === content.amountIndex) {
if (amountIndex === item.amountIndex) {
tmpAmount += parseFloat(amount.amount)
}
})
@@ -359,3 +544,69 @@ export default {
}
}
</script>
<style lang="scss" scoped>
.server-item {
background-color: #fbf8f8;
border: 2px solid #fbebf1;
padding: 10px;
display: flex;
justify-content: space-between;
margin-bottom: 20px;
.items-center {
width: 1100px;
display: flex;
justify-content: space-between;
align-items: center;
flex: 1;
view {
width: 300px;
}
.ml-35 {
font-weight: normal;
font-size: 13px;
}
}
.server-item-content {
display: flex;
align-items: center;
width: 600px !important;
}
.server-select-row {
display: flex;
align-items: center;
width: auto !important;
flex-shrink: 0;
}
.server-select {
width: 180px;
flex-shrink: 0;
}
.server-amount-text {
width: 80px !important;
margin-left: 15px;
}
.nowrap-label {
white-space: nowrap;
flex-shrink: 0;
}
.remark {
color: #999999;
font-weight: normal;
}
}
.divider-title {
font-size: 17px;
font-weight: bold;
}
</style>
+532
View File
@@ -0,0 +1,532 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a">
<common-swiper page="self-support-quote-swiper"/>
<view class="flex justify-end items-center text-main pointer my-20 " @click="demoDownload">示例下载</view>
<view class="bg-white p-40">
<view v-for="(item, index) in configList" :key="index"
class="server-item my-20 flex flex-col justify-start items-start">
<el-checkbox @change="changeCheck(index, item.name)">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center text-35 mb-20">
<view class="name" style="width: 120px;">{{ item.name }}</view>
<view class="ml-15" style="width: 120px;">
<text>业务编号:</text>
<text v-if="item.contentIndex !== null">{{
item.contents[item.contentIndex].code
}}
</text>
</view>
<view class="server-item-content">
<text class="ml-15">服务项目:</text>
<el-select v-model="configList[index].contentIndex" clearable style="width: 200px"
:disabled="!contentList.includes(index)">
<el-option v-for="(content, contentIndex) in item.contents" :key="contentIndex"
:label="content.title" :value="contentIndex"/>
</el-select>
<template v-if="item.contentIndex !== null">
<el-select v-model="configList[index].amountIndex" @change="changeAmountIndex(index)"
clearable class="ml-15" style="width: 300px">
<el-option
v-for="(amount, amountIndex) in item.contents[item.contentIndex].amountList"
:key="amountIndex"
:label="amount.title" :value="amountIndex"/>
</el-select>
<template v-if="configList[index].amountIndex !== null">
<text class="ml-15">清单单品项数:</text>
<el-input v-model="configList[index].num" style="width: 200px"/>
</template>
</template>
</view>
</view>
<view class="remark">备注: {{ item.remark }}</view>
</view>
</el-checkbox>
</view>
<el-form ref="form" :model="form" label-width="200px">
<view v-for="(item, companyIndex) in companyList" :key="companyIndex">
<el-divider>{{ item.name }}</el-divider>
<el-form-item label="产品明细:" required>
<vk-data-upload v-model="companyList[companyIndex].files" list-type="text"
:on-preview="previewUpload"
accept=".jpg,.jpeg,.png,.xlsx,.doc,.docx,.pdf">
</vk-data-upload>
</el-form-item>
<el-form-item label="产品应用地址:" required>
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][1]" placeholder="请选择市"
:disabled="addressIndex[companyIndex].length === 0">
<template v-if="addressIndex[companyIndex][0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[companyIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[companyIndex][2]" placeholder="请选择区"
:disabled="addressIndex[companyIndex].length === 1">
<template
v-if="addressIndex[companyIndex][0] !== null && addressIndex[companyIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[addressIndex[companyIndex][0]][addressIndex[companyIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="companyList[companyIndex].address" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
</view>
<el-divider/>
<el-form-item label="接收文件电子邮箱:" required>
<el-input v-model="email"/>
</el-form-item>
<el-form-item label="接收文件微信:" required>
<el-input v-model="wechat"/>
</el-form-item>
<el-form-item label="接收文件寄件地址" required>
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="receiveAddressIndex[0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[1]" placeholder="请选择市"
:disabled="receiveAddressIndex.length === 0">
<template v-if="receiveAddressIndex[0] !== null">
<el-option
v-for="(item, index) in cityData[receiveAddressIndex[0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[2]" placeholder="请选择区"
:disabled="receiveAddressIndex.length === 1">
<template
v-if="receiveAddressIndex[0] !== null && receiveAddressIndex[1] !== null">
<el-option
v-for="(item, index) in areaData[receiveAddressIndex[0]][receiveAddressIndex[1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="receiveAddress" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<p class="text-main text-25 text-center" style="margin-bottom: 80rpx">接收文件电子邮箱/ 接收文件微信/
接收文件寄件地址,以上三项选填一项即可</p>
<el-row :gutter="10">
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="申请人:" required>
<el-input v-model="requestName"/>
</el-form-item>
</el-col>
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="业务联系人:" required>
<el-input v-model="contactName"/>
</el-form-item>
</el-col>
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="业务咨询联系方式:" required>
<el-input v-model="contact"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<view class="mt-40 flex justify-center items-center">
<view class="ml-35">客服联系方式: 400-686-5559</view>
</view>
<view class="flex justify-start items-center">
<el-checkbox v-model="agree">我已阅读并同意</el-checkbox>
<span class="text-main pointer font-bold" @click="dialogVisible = true">《金久信自营交易协议》</span>
</view>
<view class="mt-40 flex justify-center items-center">
<el-button type="primary" @click="newOrder"
:disabled="companyList.length === 0 || !agree">
立即提交
</el-button>
</view>
</view>
</view>
<gap/>
<common-footer></common-footer>
<el-dialog
title="金久信自营交易协议"
:visible.sync="dialogVisible"
width="70%">
<div v-html="agreement"></div>
</el-dialog>
</view>
</template>
<script>
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 Gap from "../../../components/gap/gap.vue";
export default {
name: "companyQuote",
components: {Gap},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
form: {},
configList: [],
checkList: [],
contentList: [],
contentNameList: [],
addressIndex: [[null, null, null]],
addressDetail: '',
receiveAddressIndex: [null, null, null],
receiveAddressDetail: '',
companyList: [
{
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
}
],
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
agreement: '',
agree: false,
dialogVisible: false,
contactList: []
}
},
methods: {
async getConfigList() {
const {rows} = await vk.callFunction({
url: 'client/coop/config/pub/getList',
data: {type: 2}
})
if (rows) {
this.configList = rows.map(item => {
item.contentIndex = null
item.amountIndex = null
item.num = null
return item
})
}
},
changeCheck(itemIndex, name) {
const index = this.contentList.indexOf(itemIndex)
if (index === -1) {
this.contentList.push(itemIndex)
this.contentNameList.push(name)
} else {
this.contentList.splice(index, 1)
this.contentNameList.splice(index, 1)
this.configList[itemIndex].contentIndex = null
this.configList[itemIndex].amountIndex = null
}
},
addCompany() {
this.companyList.push({
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
})
this.addressIndex.push([null, null, null])
this.receiveAddressIndex.push([null, null, null])
},
removeCompany(index) {
this.companyList.splice(index, 1)
this.addressIndex.splice(index, 1)
this.receiveAddressIndex.splice(index, 1)
},
async newOrder() {
const amountList = []
this.configList.forEach(item => {
item.contents.forEach((content, contentIndex) => {
if (contentIndex === item.contentIndex && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === item.amountIndex) {
amountList.push(`${content._index},${amount._index},${item.num}`)
}
})
}
})
})
if (amountList.length === 0) return this.$message({
message: '请至少选择一项服务',
type: 'error'
})
if (this.addressIndex[0][2] === null) return this.$message({
message: '请选择地址',
type: 'error'
})
if (!this.email && !this.wechat && this.receiveAddressIndex[0][2] === null) return this.$message({
message: '请选择接收文件地址/微信/邮箱',
type: 'error'
})
this.companyList.forEach((item, index) => {
const companyProvince = this.provinceData[this.addressIndex[index][0]]
const companyCity = this.cityData[this.addressIndex[index][0]][this.addressIndex[index][1]]
const companyArea = this.areaData[this.addressIndex[index][0]][this.addressIndex[index][1]][this.addressIndex[index][2]]
this.companyList[index].addressRegion = {
province: {code: companyProvince.code, name: companyProvince.name},
city: {code: companyCity.code, name: companyCity.name},
area: {code: companyArea.code, name: companyArea.name},
}
})
for (let i = 0; i < this.companyList.length; i++) {
if (!this.companyList[i].files || this.companyList[i].files.length === 0) return this.$message({
message: '请上传产品明细',
type: 'error'
})
if (!this.companyList[i].address) return this.$message({
type: 'error',
message: '请填写产品应用地址',
})
if (this.addressIndex[i][2] === null) return this.$message({
type: 'error',
message: '请填写产品应用地址',
})
}
if (!this.requestName) return this.$message({
type: 'error',
message: '请填写申请人',
})
if (!this.contactName) return this.$message({
type: 'error',
message: '请填写业务联系人姓名',
})
if (!this.contact) return this.$message({
type: 'error',
message: '请填写联系人电话',
})
if (this.receiveAddressIndex.length > 0 && this.receiveAddressIndex[2] !== null) {
const province = this.provinceData[this.receiveAddressIndex[0]]
const city = this.cityData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]]
const area = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]][this.receiveAddressIndex[2]]
this.receiveAddressRegion = {
province: {code: province.code, name: province.name},
city: {code: city.code, name: city.name},
area: {code: area.code, name: area.name},
}
}
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/addOrder',
title: '提交中...',
data: {
type: 2,
amountList,
contentList: this.companyList,
receiveAddressRegion: this.receiveAddressRegion,
email: this.email,
wechat: this.wechat,
receiveAddress: this.receiveAddress,
requestName: this.requestName,
contactName: this.contactName,
contact: this.contact,
}
})
this.$message({
type: 'success',
message: '已提交',
})
vk.navigateBack()
},
showAgreement() {
this.$confirm(this.agreement, '金久信自营交易协议', {
cancelButtonText: '关闭',
showConfirmButton: false,
dangerouslyUseHTMLString: true,
})
},
async getAgreement() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '65885d4c09664c1c8d8e8476'
},
})
this.agreement = res.content
},
demoDownload() {
vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '6588642a99c624e89199fbb4'
},
success: res => {
window.open(res.content)
}
})
},
async getContactList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.contactList = rows
},
navTo() {
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
selectContact(name) {
const contact = this.contactList.find(item => item.name === name)
this.contact = contact.phone
},
changeAmountIndex(configIndex) {
const config = this.configList[configIndex]
if (config.contentIndex !== null && config.amountIndex !== null) {
this.configList[configIndex].num = config.contents[config.contentIndex].amountList[config.amountIndex].defaultNum
}
},
previewUpload({url}) {
window.open(url)
}
},
onLoad() {
const userInfo = vk.getVuex('$user.userInfo')
// console.log('userInfo', userInfo)
if (parseInt(userInfo.accountType) === 2) {
this.email = userInfo.company.contactEmail
this.requestName = userInfo.manager.personName
this.contactName = userInfo.manager.personName
this.contact = userInfo.company.mobile
if (userInfo.company && userInfo.company.addressRegion) {
this.receiveAddressIndex[0] = this.provinceData.findIndex(item => item.name === userInfo.company.addressRegion.province.name)
this.receiveAddressIndex[1] = this.cityData[this.receiveAddressIndex[0]].findIndex(item => item.name === userInfo.company.addressRegion.city.name)
this.receiveAddressIndex[2] = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]].findIndex(item => item.name === userInfo.company.addressRegion.area.name)
}
if (userInfo.company.addressDetail) this.receiveAddress = userInfo.company.addressDetail
} else {
if (userInfo.businessCard && userInfo.businessCard.email) this.email = userInfo.businessCard.email
this.requestName = userInfo.person.personName
this.contactName = userInfo.person.personName
this.contact = userInfo.person.mobile
if (userInfo.person && userInfo.person.addressRegion) {
this.receiveAddressIndex[0] = this.provinceData.findIndex(item => item.name === userInfo.person.addressRegion.province.name)
this.receiveAddressIndex[1] = this.cityData[this.receiveAddressIndex[0]].findIndex(item => item.name === userInfo.person.addressRegion.city.name)
this.receiveAddressIndex[2] = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]].findIndex(item => item.name === userInfo.person.addressRegion.area.name)
}
if (userInfo.person.addressDetail) this.receiveAddress = userInfo.person.addressDetail
}
this.getAgreement()
this.getConfigList()
// this.getContactList()
},
computed: {
amount() {
let tmpAmount = 0
this.configList.forEach(item => {
item.contents.forEach((content, contentIndex) => {
if (contentIndex === item.contentIndex && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === item.amountIndex) {
tmpAmount += parseFloat(amount.amount)
}
})
}
})
})
return tmpAmount
},
totalAmount() {
return this.amount * this.companyList.length
}
}
}
</script>
<style lang="scss" scoped>
.server-item {
background-color: #fbf8f8;
border: 2px solid #fbebf1;
padding: 10px;
display: flex;
justify-content: space-between;
margin-bottom: 20px;
.items-center {
width: 1100px;
display: flex;
justify-content: space-between;
align-items: center;
flex: 1;
view {
width: 300px;
}
.ml-35 {
font-weight: normal;
font-size: 13px;
}
}
.server-item-content {
display: flex;
align-items: center;
flex: 1;
//width: 600px !important;
}
.remark {
color: #999999;
font-weight: normal;
}
}
.divider-title {
font-size: 17px;
font-weight: bold;
}
</style>
+410 -154
View File
@@ -4,52 +4,69 @@
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a">
<u-swiper :list="list" :height="380" borderRadius="0"></u-swiper>
<common-swiper page="self-support-product-swiper"/>
<view class="flex justify-end items-center text-main pointer my-20 " @click="demoDownload">示例下载</view>
<view class="bg-white p-40">
<view v-for="(item, index) in configList" :key="index"
class="my-20 flex flex-col justify-start items-start">
class="server-item my-20 flex flex-col justify-start items-start">
<el-checkbox @change="changeCheck(index, item.name)">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center text-35 mb-20">
<text>服务内容:{{ item.name }}</text>
<view class="flex flex-col justify-start items-start">
<view v-for="(content, contentIndex) in item.contents" :key="contentIndex"
class="mb-40 flex justify-start items-center">
<view class="ml-35">
<view class="name">{{ item.name }}</view>
<view class="ml-15">
<text>业务编号:</text>
<text>{{ content.code }}</text>
<text v-if="item.contentIndex !== null">{{
item.contents[item.contentIndex].code
}}
</text>
</view>
<view class="flex justify-start items-center">
<text class="ml-35">服务服务项目:</text>
<el-checkbox v-model="configList[index].contents[contentIndex].checked"
@change="selectContent(content)"
:disabled="!content.amountList || content.amountList.length === 0">
{{ content.title }}
</el-checkbox>
</view>
<view class="flex justify-start items-center ml-35">
<el-select v-model="configList[index].contents[contentIndex].amountIndex"
clearable
:disabled="!content.amountList || content.amountList.length === 0">
<el-option v-for="(amount, amountIndex) in content.amountList"
<view class="server-item-content">
<text class="ml-15">服务项目:</text>
<el-select v-model="configList[index].contentIndex" clearable
:disabled="!contentList.includes(index)">
<el-option v-for="(content, contentIndex) in item.contents" :key="contentIndex"
:label="content.title" :value="contentIndex"/>
</el-select>
<template v-if="item.contentIndex !== null">
<el-select v-model="configList[index].amountIndex"
clearable class="ml-15">
<el-option
v-for="(amount, amountIndex) in item.contents[item.contentIndex].amountList"
:key="amountIndex"
:label="amount.title" :value="amountIndex"/>
</el-select>
<text class="ml-35" v-if="content.amountIndex !== null">
{{ content.amountList[content.amountIndex].amount }}元/次
</text>
</template>
</view>
<text>金额:</text>
<view class="ml-15" v-if="item.contentIndex !== null && item.amountIndex !== null">
{{ item.contents[item.contentIndex].amountList[item.amountIndex].amount }}元/次
</view>
<view class="ml-15" v-else>
元/次
</view>
<el-button type="primary" size="small"
@click="addToAmountList(index, configList[index].contentIndex, item.amountIndex)"
:disabled="item.amountIndex === null">
添加
</el-button>
</view>
<view>备注: {{ item.remark }}</view>
<view class="remark">备注: {{ item.remark }}</view>
</view>
</el-checkbox>
</view>
<el-form ref="form" :model="form" label-width="200px">
<view v-for="(item, productIndex) in productList" :key="productIndex">
<el-form-item label="检测产品:" required>
<el-input v-model="productList[productIndex].name"/>
</el-form-item>
<el-form-item label="文档上传:">
<vk-data-upload v-model="productList[productIndex].files" list-type="text"
:on-preview="previewUpload"
accept=".jpg,.jpeg,.png,.xlsx,.doc,.docx,.pdf">
</vk-data-upload>
</el-form-item>
<el-form-item label="检测内容">
{{ contentNameList.join() }}
</el-form-item>
@@ -94,70 +111,10 @@
</el-col>
</el-row>
</el-form-item>
<el-form-item label="接收文件电子邮箱:">
<el-input v-model="productList[productIndex].email"/>
</el-form-item>
<el-form-item label="接收文件微信:">
<el-input v-model="productList[productIndex].wechat"/>
</el-form-item>
<el-form-item label="接收文件寄件地址">
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="receiveAddressIndex[productIndex][0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[productIndex][1]" placeholder="请选择市"
:disabled="receiveAddressIndex[productIndex].length === 0">
<template v-if="receiveAddressIndex[productIndex][0] !== null">
<el-option
v-for="(item, index) in cityData[receiveAddressIndex[productIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[productIndex][2]" placeholder="请选择区"
:disabled="receiveAddressIndex[productIndex].length === 1">
<template
v-if="receiveAddressIndex[productIndex][0] !== null && receiveAddressIndex[productIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[receiveAddressIndex[productIndex][0]][receiveAddressIndex[productIndex][1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="productList[productIndex].receiveAddress" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="申请人:">
<el-input v-model="productList[productIndex].requestName"/>
</el-form-item>
<el-form-item label="联系人:">
<el-input v-model="productList[productIndex].contactName"/>
</el-form-item>
<el-form-item label="联系方式:">
<el-input v-model="productList[productIndex].contact"/>
</el-form-item>
<el-form-item label="本次服务费用小计:">
<view class="flex justify-between items-start mb-20 w-100p">
<view class="flex justify-start items-center">
<el-input v-model="amount" disabled/>
<view class="ml-20">
<el-button type="primary" @click.native="addProduct">增加考察对象
</el-button>
</view>
<view class="ml-20">
<el-button type="primary" plain @click.native="removeProduct(productIndex)"
@@ -166,20 +123,140 @@
</el-button>
</view>
</view>
</view>
</el-form-item>
<el-divider/>
</view>
<el-form-item label="接收文件电子邮箱:">
<el-input v-model="email"/>
</el-form-item>
<el-form-item label="接收文件微信:">
<el-input v-model="wechat"/>
</el-form-item>
<el-form-item label="接收文件寄件地址">
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="receiveAddressIndex[0]" placeholder="请选择省">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[1]" placeholder="请选择市"
:disabled="receiveAddressIndex.length === 0">
<template v-if="receiveAddressIndex[0] !== null">
<el-option
v-for="(item, index) in cityData[receiveAddressIndex[0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="receiveAddressIndex[2]" placeholder="请选择区"
:disabled="receiveAddressIndex.length === 1">
<template
v-if="receiveAddressIndex[0] !== null && receiveAddressIndex[1] !== null">
<el-option
v-for="(item, index) in areaData[receiveAddressIndex[0]][receiveAddressIndex[1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="receiveAddress"
placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<p class="text-main text-25 text-center" style="margin-bottom: 80rpx">接收文件电子邮箱/ 接收文件微信/
接收文件寄件地址,以上三项选填一项即可</p>
<!-- <el-form-item label="申请人:">-->
<!-- <el-input v-model="requestName"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="联系人:">-->
<!-- <el-input v-model="contactName"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="联系方式:">-->
<!-- <el-input v-model="contact"/>-->
<!-- </el-form-item>-->
<el-row :gutter="10">
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="申请人:" required>
<el-input v-model="requestName"/>
</el-form-item>
</el-col>
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="业务联系人:" required>
<el-input v-model="contactName"/>
</el-form-item>
</el-col>
<el-col :span="8" class="flex justify-start items-center">
<el-form-item label="业务咨询联系方式:" required>
<el-input v-model="contact"/>
</el-form-item>
</el-col>
<!-- <el-col :span="8" class="flex justify-start items-center">-->
<!-- <el-form-item label="联系人:" required>-->
<!-- <el-select v-model="contactName" 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="navTo">个人中心</text>-->
<!-- <text>添加</text>-->
<!-- </view>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8" class="flex justify-start items-center">-->
<!-- <el-form-item label="业务咨询联系方式:" required>-->
<!-- <el-input v-model="contact" type="number" disabled/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
<el-form-item label="备注:">
<el-input v-model="remark"/>
</el-form-item>
<el-button type="primary" @click.native="addProduct">增加考察对象
</el-button>
</el-form>
<view class="mt-20">
<view>已选项目:</view>
<view v-for="(item, index) in amountList" :key="index" class="mt-20 flex justify-start items-center">
<el-button type="primary" size="small" @click="removeFromAmountList(index)">删除</el-button>
<p class="ml-20">{{ configList[item.index].name }} -- {{ configList[item.index].contents[item.contentIndex].title }} --
{{
configList[item.index].contents[item.contentIndex].amountList[item.amountIndex].title
}},{{ configList[item.index].contents[item.contentIndex].amountList[item.amountIndex].amount }}元</p>
</view>
</view>
<view class="mt-40 flex justify-center items-center">
<view class="flex justify-center items-center">
<text>总价:</text>
<text class="text-main font-bold text-35">{{ totalAmount }}元</text>
</view>
<view class="ml-35">客服联系方式: 0771-3923001</view>
<view class="ml-35">客服联系方式: 400-686-5559</view>
</view>
<view class="flex justify-start items-center">
<el-checkbox v-model="agree">我已阅读并同意</el-checkbox>
<span class="text-main pointer font-bold" @click="dialogVisible = true">《金久信自营交易协议》</span>
</view>
<view class="mt-40 flex justify-center items-center">
<el-button type="primary" @click.native="newOrder"
:disabled="productList.length === 0 || !productList[0].name">
:disabled="productList.length === 0 || !productList[0].name || !agree">
立即支付
</el-button>
</view>
@@ -187,6 +264,12 @@
</view>
<gap/>
<common-footer></common-footer>
<el-dialog
title="金久信自营交易协议"
:visible.sync="dialogVisible"
width="70%">
<div v-html="agreement"></div>
</el-dialog>
</view>
</template>
@@ -202,12 +285,6 @@ export default {
provinceData: provinces,
cityData: citys,
areaData: areas,
list: [
{
image: '/static/images/selfSupport/swiper.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
],
form: {},
configList: [],
checkList: [],
@@ -215,7 +292,7 @@ export default {
contentNameList: [],
addressIndex: [[null, null, null]],
addressDetail: '',
receiveAddressIndex: [[null, null, null]],
receiveAddressIndex: [null, null, null],
receiveAddressDetail: '',
productList: [
{
@@ -227,6 +304,8 @@ export default {
area: null,
},
address: '',
}
],
email: '',
wechat: '',
receiveAddressRegion: {
@@ -238,8 +317,13 @@ export default {
requestName: '',
contactName: '',
contact: '',
}
],
remark: '',
agreement: '',
agree: false,
dialogVisible: false,
contactList: [],
files: [],
amountList: []
}
},
methods: {
@@ -250,11 +334,8 @@ export default {
})
if (rows) {
this.configList = rows.map(item => {
item.contents.map(content => {
content.checked = false
content.amountIndex = null
return content
})
item.contentIndex = null
item.amountIndex = null
return item
})
}
@@ -269,89 +350,219 @@ export default {
area: null,
},
address: '',
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
contact: '',
})
this.addressIndex.push([null, null, null])
this.receiveAddressIndex.push([null, null, null])
},
removeProduct(index) {
this.productList.splice(index, 1)
this.addressIndex.splice(index, 1)
this.receiveAddressIndex.splice(index, 1)
},
selectContent(content) {
const index = this.contentNameList.indexOf(content.title)
if (index === -1) this.contentNameList.push(content.title)
else this.contentNameList.splice(index, 1)
addToAmountList(index, contentIndex, amountIndex) {
this.amountList.push({
index,
contentIndex,
amountIndex,
contentIndexVal: this.configList[index].contents[contentIndex]._index,
amountIndexVal: this.configList[index].contents[contentIndex].amountList[amountIndex]._index,
amount: this.configList[index].contents[contentIndex].amountList[amountIndex].amount
})
this.configList[index].contentIndex = null
this.configList[index].amountIndex = null
},
removeFromAmountList(index) {
this.amountList.splice(index, 1)
},
async newOrder() {
const amountList = []
this.configList.forEach(item => {
item.contents.forEach(content => {
if (content.checked && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === content.amountIndex) {
amountList.push(amount._index)
}
})
}
})
})
if (amountList.length === 0) return this.$message({
// const amountList = []
// this.configList.forEach(item => {
// item.contents.forEach((content, contentIndex) => {
// if (contentIndex === item.contentIndex && content.amountList.length > 0) {
// content.amountList.forEach((amount, amountIndex) => {
// if (amountIndex === item.amountIndex) {
// amountList.push(`${content._index},${amount._index}`)
// }
// })
// }
// })
// })
if (this.amountList.length === 0) return this.$message({
message: '请至少选择一项服务',
type: 'error'
})
this.productList.forEach((item, index) => {
this.productList[index].addressRegion = {
province: this.provinceData[this.addressIndex[index][0]],
city: this.cityData[this.addressIndex[index][0]][this.addressIndex[index][1]],
area: this.areaData[this.addressIndex[index][0]][this.addressIndex[index][1]][this.addressIndex[index][2]],
if (!this.email && !this.wechat && this.receiveAddressIndex[0][2] === null) return this.$message({
message: '请选择接收文件地址/微信/邮箱',
type: 'error'
})
if (!this.requestName) return this.$message({
type: 'error',
message: '请填写申请人',
})
if (!this.contactName) return this.$message({
type: 'error',
message: '请填写联系人姓名',
})
if (!this.contact) return this.$message({
type: 'error',
message: '请填写联系人电话',
})
for (let i = 0; i < this.productList.length; i++) {
if (!this.productList[i].name) return this.$message({
message: '请填写考察产品名称',
type: 'error'
})
if (!this.productList[i].address) return this.$message({
type: 'error',
message: '请填写考察产品地址',
})
if (this.addressIndex[i][2] === null) return this.$message({
type: 'error',
message: '请填写考察产品地址',
})
}
this.productList[index].receiveAddressRegion = {
province: this.provinceData[this.receiveAddressIndex[index][0]],
city: this.cityData[this.receiveAddressIndex[index][0]][this.receiveAddressIndex[index][1]],
area: this.areaData[this.receiveAddressIndex[index][0]][this.receiveAddressIndex[index][1]][this.receiveAddressIndex[index][2]],
if (this.receiveAddressIndex.length > 0 && this.receiveAddressIndex[2] !== null) {
const province = this.provinceData[this.receiveAddressIndex[0]]
const city = this.cityData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]]
const area = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]][this.receiveAddressIndex[2]]
this.receiveAddressRegion = {
province: {code: province.code, name: province.name},
city: {code: city.code, name: city.name},
area: {code: area.code, name: area.name},
}
}
this.productList.forEach((item, index) => {
const companyProvince = this.provinceData[this.addressIndex[index][0]]
const companyCity = this.cityData[this.addressIndex[index][0]][this.addressIndex[index][1]]
const companyArea = this.areaData[this.addressIndex[index][0]][this.addressIndex[index][1]][this.addressIndex[index][2]]
this.productList[index].addressRegion = {
province: {code: companyProvince.code, name: companyProvince.name},
city: {code: companyCity.code, name: companyCity.name},
area: {code: companyArea.code, name: companyArea.name},
}
})
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/addOrder',
title: '请求中...',
data: {
type: 1,
amountList,
contentList: this.productList
amountList: this.amountList.map(item => `${item.contentIndexVal},${item.amountIndexVal}`),
contentList: this.productList,
receiveAddressRegion: this.receiveAddressRegion,
email: this.email,
wechat: this.wechat,
receiveAddress: this.receiveAddress,
requestName: this.requestName,
contactName: this.contactName,
contact: this.contact,
remark: this.remark,
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
},
changeCheck(itemIndex, name) {
const index = this.contentList.indexOf(itemIndex)
if (index === -1) {
this.contentList.push(itemIndex)
this.contentNameList.push(name)
} else {
this.contentList.splice(index, 1)
this.contentNameList.splice(index, 1)
this.configList[itemIndex].contentIndex = null
this.configList[itemIndex].amountIndex = null
}
},
showAgreement() {
this.$confirm(this.agreement, '金久信自营交易协议', {
cancelButtonText: '关闭',
showConfirmButton: false,
dangerouslyUseHTMLString: true,
})
},
async getAgreement() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '65885d4c09664c1c8d8e8476'
},
})
this.agreement = res.content
},
demoDownload() {
vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '6588648da7c432e4a360bb34'
},
success: res => {
window.open(res.content)
}
})
},
async getContactList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.contactList = rows
},
navTo() {
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
selectContact(name) {
const contact = this.contactList.find(item => item.name === name)
this.contact = contact.phone
},
previewUpload({url}) {
window.open(url)
}
},
onLoad() {
const userInfo = vk.getVuex('$user.userInfo')
// console.log('userInfo', userInfo)
if (parseInt(userInfo.accountType) === 2) {
this.email = userInfo.company.contactEmail
this.requestName = userInfo.manager.personName
this.contactName = userInfo.manager.personName
this.contact = userInfo.company.mobile
if (userInfo.company && userInfo.company.addressRegion) {
this.receiveAddressIndex[0] = this.provinceData.findIndex(item => item.name === userInfo.company.addressRegion.province.name)
this.receiveAddressIndex[1] = this.cityData[this.receiveAddressIndex[0]].findIndex(item => item.name === userInfo.company.addressRegion.city.name)
this.receiveAddressIndex[2] = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]].findIndex(item => item.name === userInfo.company.addressRegion.area.name)
}
if (userInfo.company.addressDetail) this.receiveAddress = userInfo.company.addressDetail
} else {
if (userInfo.businessCard && userInfo.businessCard.email) this.email = userInfo.businessCard.email
this.requestName = userInfo.person.personName
this.contactName = userInfo.person.personName
this.contact = userInfo.person.mobile
if (userInfo.person && userInfo.person.addressRegion) {
this.receiveAddressIndex[0] = this.provinceData.findIndex(item => item.name === userInfo.person.addressRegion.province.name)
this.receiveAddressIndex[1] = this.cityData[this.receiveAddressIndex[0]].findIndex(item => item.name === userInfo.person.addressRegion.city.name)
this.receiveAddressIndex[2] = this.areaData[this.receiveAddressIndex[0]][this.receiveAddressIndex[1]].findIndex(item => item.name === userInfo.person.addressRegion.area.name)
}
if (userInfo.person.addressDetail) this.receiveAddress = userInfo.person.addressDetail
}
this.getConfigList()
this.getAgreement()
// this.getContactList()
},
computed: {
amount() {
let tmpAmount = 0
this.configList.forEach(item => {
item.contents.forEach(content => {
if (content.checked && content.amountList.length > 0) {
content.amountList.forEach((amount, amountIndex) => {
if (amountIndex === content.amountIndex) {
tmpAmount += parseFloat(amount.amount)
}
})
}
})
// this.configList.forEach(item => {
// item.contents.forEach((content, contentIndex) => {
// if (contentIndex === item.contentIndex && content.amountList.length > 0) {
// content.amountList.forEach((amount, amountIndex) => {
// if (amountIndex === item.amountIndex) {
// tmpAmount += parseFloat(amount.amount)
// }
// })
// }
// })
// })
this.amountList.forEach(item => {
tmpAmount += item.amount
})
return tmpAmount
},
@@ -361,3 +572,48 @@ export default {
}
}
</script>
<style lang="scss" scoped>
.server-item {
background-color: #fbf8f8;
border: 2px solid #fbebf1;
padding: 10px;
display: flex;
justify-content: space-between;
margin-bottom: 20px;
.items-center {
width: 1100px;
display: flex;
justify-content: space-between;
align-items: center;
flex: 1;
view {
width: 300px;
}
.ml-35 {
font-weight: normal;
font-size: 13px;
}
}
.server-item-content {
display: flex;
align-items: center;
width: 600px !important;
}
.remark {
color: #999999;
font-weight: normal;
}
}
.divider-title {
font-size: 17px;
font-weight: bold;
}
</style>
+214
View File
@@ -0,0 +1,214 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>
<navigator style="display: inline-block;" url="/pages/self-support/self-support">金久信自营</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item>填写报价信息</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="page-main">
<quote-remain-num v-if="reloaded"/>
<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"
:auto-close="false"
:show-cancel="false"
label-width="160px"
@success="onFormSuccess"
>
<template v-slot:desc>
<span>{{ sheet.desc }}</span>
</template>
<template v-slot:amount>
<el-input v-model="form1.data.amount" placeholder="请输入货款总价" @change="formatNumber"></el-input>
</template>
<template v-slot:sheetFile="{ row, column, index }">
<p v-for="(item, index) in sheet.files" :key="index" class="text-main">
<a :href="item" target="_blank">预览:文件{{index + 1}}</a>
</p>
</template>
</vk-data-form>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
reloaded: false,
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
// radio: 1,
// checkbox : [1,2]
sheetId: null,
amount: null,
},
// 表单属性
props: {
// 表单请求地址
action: "client/selfSupport/kh/addQuote",
// 表单字段显示规则
columns: [
{key: "sheetFile", title: "询价文件", type: "html"},
{key: "desc", title: "产品描述", type: "html"},
{key: "amount", title: "货款总价(人民币:元)", type: "html"},
{key: "files", title: "附件", type: "file", accept: '.pdf'},
{key: "remark", title: "报价单详情", type: "textarea"},
],
// 表单验证规则
rules: {
amount: [
{required: true, message: "货款总价不能为空", trigger: "change,blur"},
]
},
// add 代表添加 update 代表修改
formType: "",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false
}
},
// 表单相关结束-----------------------------------------------------------
sheet: null
};
},
onLoad(options = {}) {
console.log(options)
const {
id
} = options
if (!id) {
vk.navigateTo('/pages/self-support/self-support');
return
}
this.enquiryId = id
this.form1.data.sheetId = id
this.getEnquiryDetail()
},
computed: {
totalPriceStr() {
if (this.totalPrice == 0) {
return "零元"
}
return vk.myfn.convertCurrency(this.totalPrice / 100)
}
},
methods: {
onFormSuccess() {
vk.redirectTo({url: `/pages/index/index`})
},
// 提交报价单
async submit() {
const data = await vk.userCenter.getCurrentUserInfo();
const {userInfo} = data
if (userInfo.remainQuoteNum === 0 || !userInfo.remainQuoteNum) {
}
// this.$confirm(`今日报价次数${userInfo.quoteTimes || 0}, 是否继续?`, '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning',
// center: true
// }).then(res => {
//
// })
vk.callFunction({
url: 'client/enquiry/quote/kh/addQuote',
title: '请求中...',
// data: {
// sheet: this.sheet,
// totalPrice: this.totalPrice
// },
success: (data) => {
this.$message({
message: "报价成功",
type: 'success'
})
}
});
},
/**
* 获取询价单详情
*/
getEnquiryDetail() {
vk.callFunction({
url: 'client/selfSupport/kh/getDetail',
title: '请求中...',
data: {
_id: this.enquiryId
},
success: (res) => {
this.sheet = res
}
});
},
formatNumber(e){
this.form1.data.amount = parseFloat(this.form1.data.amount).toFixed(2)
}
},
onShow() {
this.reloaded = false
setTimeout(() => {
this.reloaded = true
}, 500)
}
}
</script>
<style lang="scss" scoped>
.page-main {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.description {
margin-bottom: 40px;
width: 800px;
}
.quote {
display: flex;
align-items: center;
justify-content: space-between;
}
.quote-form {
width: 260px;
}
.form-footer {
height: 40px;
line-height: 40px;
background: #fff;
padding-top: 0;
text-align: center;
display: block;
}
</style>
+55 -4
View File
@@ -4,12 +4,22 @@
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200 m-a">
<u-swiper :list="list" :height="380" borderRadius="0"></u-swiper>
<!-- <el-carousel :height="`500px`" :style="{width: '1200px'}" class="m-a">-->
<!-- <el-carousel-item v-for="(item, index) in list" :key="index" :style="{width: '1200px'}">-->
<!-- <image :src="item.image" mode="scaleToFill" :style="{width: '1200px', height: '500px'}"/>-->
<!-- </el-carousel-item>-->
<!-- </el-carousel>-->
<common-swiper page="self-support-main"/>
<view class="flex flex-col">
<image src="/static/images/selfSupport/company.jpg" class="w-100p pointer" mode="widthFix"
<image :src="companyImg" class="w-100p pointer"
style="height: 150px"
@click="navTo('/pages/index/self-support/companyQuote')"/>
<image src="/static/images/selfSupport/product.jpg" class="w-100p pointer mt-20" mode="widthFix"
<image :src="productImg" class="w-100p pointer mt-20"
style="height: 150px"
@click="navTo('/pages/index/self-support/productQuote')"/>
<image :src="costImg" class="w-100p pointer mt-20"
style="height: 150px"
@click="navTo('/pages/index/self-support/costQuote')"/>
</view>
</view>
<common-footer></common-footer>
@@ -26,13 +36,54 @@ export default {
image: '/static/images/selfSupport/swiper.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
]
],
companyImg: '',
productImg: '',
costImg: '',
}
},
methods: {
navTo(url) {
vk.navigateTo(url);
},
async getCompanyImg(){
vk.callFunction({
url: 'client/album/pub/list',
data: {
page: 'self-support-company'
},
success: ({swiper}) => {
this.companyImg = swiper[0]
}
})
},
async getProductImg(){
vk.callFunction({
url: 'client/album/pub/list',
data: {
page: 'self-support-product'
},
success: ({swiper}) => {
this.productImg = swiper[0]
}
})
},
async getCostImg(){
vk.callFunction({
url: 'client/album/pub/list',
data: {
page: 'self-support-quote'
},
success: ({swiper}) => {
this.costImg = swiper[0]
}
})
},
},
onLoad(){
this.getCompanyImg()
this.getProductImg()
this.getCostImg()
}
}
</script>
+336 -37
View File
@@ -3,24 +3,73 @@
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200">
<u-swiper :list="list" :height="380" borderRadius="0"></u-swiper>
<view class="test">
<text class="pointer" @click="navTo('/pages/index/self-support/self-support')">自营钢城</text>
<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"
@change="getCompanyList" clearable/>
clearable @change="getCompanyList"/>
</view>
<view class="buy-btn">
<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"
@click.native="dialogVisible = true">
@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>
<!-- 合作单位/联营单位-->
@@ -28,12 +77,19 @@
<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">
<view class="border bg-white flex flex-col justify-center items-center p-20">
<image :src="item.businessCard.logo" class="logo"/>
<span class="mt-20 line-1 w-100p text-center">
主营: {{ item.businessCard.mainBusiness }}
<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>
@@ -48,10 +104,68 @@
title="下询价单"
:visible.sync="dialogVisible"
width="60%">
<vk-data-upload v-model="files" accept="*">
<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>
@@ -60,77 +174,254 @@
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: {UGap},
components: {FileType, UGap},
data() {
return {
dialogVisible: false,
address: [],
files: [],
list: [
{
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
{
image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
title: '身无彩凤双飞翼,心有灵犀一点通'
},
{
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}
],
options: [],
companyList: []
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.getCompanyList()
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,
city: this.address.length > 0 ? [this.address[1]] : []
province: this.address.length > 0 ? [this.address[0]] : []
}
})
this.companyList = rows
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: this.address.length > 0 ? this.address[1] : []
city,
province,
name: this.name,
phone: this.phone,
company: this.company,
}
})
this.$message({
message: '下单成功',
type: 'success'
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
}
}
}
@@ -152,18 +443,26 @@ export default {
justify-content: center;
text {
margin: 0 20px;
padding: 0 20px;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
text:hover {
color: #F2CFCE;
background-color: #690503
}
.active {
background-color: #941411
}
}
.tool-bar {
display: flex;
justify-content: space-between;
align-items: center;
align-items: flex-start;
padding: 20px;
font-size: 16px;
+3 -3
View File
@@ -244,15 +244,15 @@ export default {
data() {
return {
list: [{
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
image: '/static/images/swiper_5.png',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
{
image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
image: '/static/images/swiper_5.png',
title: '身无彩凤双飞翼,心有灵犀一点通'
},
{
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
image: '/static/images/swiper_5.png',
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}
],
+50 -18
View File
@@ -9,11 +9,11 @@
<text class="font-bold text-40">
购物车(全部{{ list.length }})
</text>
<view class="flex justify-end items-center">
<text>已选商品(不含运费)</text>
<text class="text-main text-40 font-bold mx-20">¥{{ amount }}</text>
<el-button type="primary" round>结算</el-button>
</view>
<!-- <view class="flex justify-end items-center">-->
<!-- <text>已选商品(不含运费)</text>-->
<!-- <text class="text-main text-40 font-bold mx-20">¥{{ amount }}</text>-->
<!-- <el-button type="primary" round @click.native="addFromCart">结算</el-button>-->
<!-- </view>-->
</view>
<view class="py-20">
<el-row :gutter="10">
@@ -48,21 +48,22 @@
</el-checkbox>
<el-image :src="item.goods.cover" class="cover ml-20" fit="fit"/>
<view class="flex flex-col justify-start items-start ml-20">
{{ item.goods.name }}
<text class="font-bold mb-15">{{ item.goods.name }}</text>
<text class="text-gray">{{ item.sku.label }}</text>
</view>
</view>
</el-col>
<el-col :span="3">
<text class="text-35 font-bold flex-1">¥{{ item.goods.amount }}</text>
<text class="text-35 font-bold flex-1">¥{{ item.sku.values }}</text>
</el-col>
<el-col :span="3">
<text class="text-35 font-bold flex-1">
<el-input-number v-model="list[index].num" @change="changeNum" :min="1" size="small"/>
<el-input-number v-model="list[index].num" @change="changeNum(index)" :min="1" size="small"/>
</text>
</el-col>
<el-col :span="3">
<text class="text-35 font-bold flex-1 text-main">¥{{
parseFloat(item.goods.amount) * item.num
parseFloat(item.sku.values) * item.num
}}
</text>
</el-col>
@@ -72,16 +73,16 @@
</el-row>
</view>
<view class="mt-20 flex justify-between items-center">
<el-button type="text">移出购物车</el-button>
<el-button type="text" @click.native="removeMulti" :disabled="selectedList.length === 0">移出购物车</el-button>
<view class="flex justify-end items-center">
<view>
<text>已选商品</text>
<text class="mx-15 font-bold text-35 text-main">{{ selectedList.length }}</text>
<text>件</text>
</view>
<text class="ml-35">合计(不含运费):</text>
<text class="ml-35">合计:</text>
<text class="mx-15 font-bold text-40 text-main">¥{{ amount }}</text>
<el-button type="primary" round :disabled="selectedList.length === 0">结算</el-button>
<el-button type="primary" round :disabled="selectedList.length === 0" @click.native="addFromCart">结算</el-button>
</view>
</view>
</view>
@@ -106,18 +107,27 @@ export default {
const {rows} = await vk.callFunction({
url: "client/cart/kh/getList"
})
this.selectedAll = false
this.list = rows.map(item => {
item.checked = false
return item
})
},
doSelectAll() {
this.selectedList = []
this.list.forEach((item, index) => {
this.list[index].checked = this.selectedAll
if (this.selectedAll) this.selectedList.push(item._id)
})
},
changeNum(e) {
console.log(e)
changeNum(index) {
vk.callFunction({
url: "client/cart/kh/changeNum",
data: {
id: this.list[index]._id,
num: this.list[index].num
}
})
},
changeCheck(e, id) {
const index = this.selectedList.indexOf(id)
@@ -126,15 +136,38 @@ export default {
this.selectedAll = this.selectedList.length === this.list.length
},
remove(index) {
this.list.splice(index, 1)
vk.callFunction({
url: "client/cart/kh/delete",
data: {
ids: [this.list[index]._id]
}
})
this.list.splice(index, 1)
},
async removeMulti() {
if (this.selectedList.length === 0) return
await vk.callFunction({
url: "client/cart/kh/delete",
data: {
ids: this.selectedList
}
})
this.selectedList = []
await this.getList()
},
async addFromCart(){
const {data} = await vk.callFunction({
url: "client/order/kh/addFromList",
data: {
type: 0,
ids: this.selectedList
}
})
this.selectedAll = false
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
}
},
onShow() {
this.getList()
@@ -143,8 +176,7 @@ export default {
amount() {
let tmpAmount = 0
this.list.forEach(item => {
console.log(item.checked)
if (item.checked) tmpAmount += parseFloat(item.goods.amount) * parseInt(item.num)
if (item.checked) tmpAmount += parseFloat(item.sku.values) * parseInt(item.num)
})
return tmpAmount
}
+109 -9
View File
@@ -14,7 +14,7 @@
</el-breadcrumb>
</view>
<view class="bg-white p-40 flex justify-start items-start">
<el-carousel height="400px" class="album">
<el-carousel height="500px" class="album">
<el-carousel-item v-for="(item, index) in info.album" :key="index">
<image :src="item" class="album-item" mode="aspectFill"/>
</el-carousel-item>
@@ -25,17 +25,67 @@
<text>产品介绍:</text>
<view class="desc p-20 mt-20">{{ info.desc }}</view>
</view>
<view class="flex justify-between items-center w-100p mt-20">
<view class="flex flex-col items-start justify-start w-100p mt-20">
<view class="flex flex-col justify-start items-start flex-1 mr-25 w-100p">
<view class="flex justify-start items-center">
<text>零售价:</text>
<text class="font-bold text-main">¥{{ info.amount }}</text>
</view>
<view class="flex justify-end is-center">
<el-button type="danger" round class="add-to-cart-btn" @click.native="addToCart">加入购物车</el-button>
<el-button type="primary" round class="ml-35" @click.native="newOrder">立即购买</el-button>
<view class="flex-1 w-100p" v-if="info.sku">
<view class="w-100p my-25 flex flex-1 justify-center items-center p-15">
<text class="flex-1 text-center">规格/分类/说明</text>
<text class="flex-1 text-center">数量</text>
<text class="flex-1 text-center">价格</text>
</view>
<view class="border my-25 flex justify-center items-center p-15 pointer sku"
v-for="(item, index) in info.sku" :key="index"
:class="[selectedSku === item._index ? 'sku-selected' : '']">
<el-image v-if="item.image" :src="item.image" style="width: 40px; height: 40px"
@click="selectedSku = item._index"/>
<text class="flex-1 text-center" @click="selectedSku = item._index">{{
item.label
}}
</text>
<view class="flex-1 flex justify-center items-center" style="z-index: 999">
<el-input-number v-model="info.sku[index].num" :min="1" size="small"/>
</view>
<text class="flex-1 text-center" @click="selectedSku = item._index">{{
item.values
}}元
</text>
</view>
</view>
</view>
<view class="flex justify-center items-center w-100p mt-20">
<el-button type="danger" round
:class="selectedSku ? 'add-to-cart-btn' : 'add-to-cart-btn-disabled'"
@click.native="addToCart" :disabled="!selectedSku">
加入购物车
</el-button>
<el-button type="primary" round class="ml-35" @click.native="newOrder"
:disabled="!selectedSku">立即购买
</el-button>
</view>
<view class="mt-20 flex justify-start items-center">
<template v-if="info.express">
<transporter theme="outline" size="16" fill="#9b9b9b" strokeLinecap="square"/>
<text class="ml-10">快递:{{ info.express }}</text>
</template>
<text v-if="info.deliverDate" class="ml-35">{{ info.deliverDate }}</text>
<text v-if="info.expressAmount !== undefined && info.expressAmount !== null" class="ml-35">
运费:{{ info.expressAmount === 0 ? '免运费' : info.expressAmount }}
</text>
</view>
<view class="mt-20 flex justify-start items-center" v-if="info.ensureService">
<like theme="outline" size="16" fill="#9b9b9b" strokeLinecap="square"/>
<text class="ml-10">{{ info.ensureService }}</text>
</view>
</view>
</view>
</view>
<view class="mt-40" v-if="info.video">
<view class="intro-title">视频介绍</view>
<video :src="info.video" autoplay controls style="width: 100%; height: 800px"></video>
</view>
<view class="mt-40">
<view class="intro-title">商品介绍</view>
@@ -52,15 +102,18 @@
<script>
import UGap from "@/uni_modules/vk-uview-ui/components/u-gap/u-gap.vue";
import {Transporter, Like} from '@icon-park/vue'
export default {
components: {UGap},
components: {UGap, Transporter, Like},
data() {
return {
id: null,
info: {
name: ''
}
},
num: 1,
selectedSku: null
};
},
onLoad(options) {
@@ -78,12 +131,31 @@ export default {
url: 'client/goods/list/pub/getDetail',
data: {id}
})
if (this.info.sku && this.info.sku.length > 0) {
this.info.sku.map((sku, index) => {
this.$set(this.info.sku[index], 'num', 1)
return sku
})
this.selectedSku = this.info.sku[0]._index
}
},
addToCart() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm') || ([-1, 2].includes(vk.getVuex('$user.userInfo.authStatus')) && !vk.getVuex('$user.userInfo.userType'))) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
return
}
vk.callFunction({
url: 'client/cart/kh/add',
data: {
goodsId: this.id,
skuId: this.selectedSku,
num: this.info.sku.find(item => item._index === this.selectedSku).num,
},
success: (res) => {
this.$message({
@@ -94,18 +166,30 @@ export default {
})
},
async newOrder() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm') || ([-1, 2].includes(vk.getVuex('$user.userInfo.authStatus')) && !vk.getVuex('$user.userInfo.userType'))) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
return
}
const {data} = await vk.callFunction({
url: 'client/order/kh/add',
title: '请求中...',
data: {
goodsId: this.id,
num: 1,
skuId: this.selectedSku,
num: this.info.sku.find(item => item._index === this.selectedSku).num,
type: 0
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
}
},
}
}
</script>
@@ -128,6 +212,10 @@ export default {
background-color: #FF7300;
}
.add-to-cart-btn-disabled {
background-color: #f6aa6b;
}
.intro-title {
background-color: #EF0021;
padding: 10px 20px;
@@ -137,6 +225,18 @@ export default {
}
.intro {
padding: 20px;
border-top: 1px solid #F95F6E;
white-space: pre-wrap;
}
.sku:hover {
background-color: #F5E2E3;
border: 1px solid #EF0021;
}
.sku-selected {
background-color: #F5E2E3;
border: 1px solid #EF0021;
}
</style>
+400 -56
View File
@@ -13,7 +13,7 @@
<text class="font-bold text-35">商品详情</text>
<view class="flex justify-start items-start my-20">
<text class="w-15p" v-if="info.type === 0">封面</text>
<text class="w-40p">名称</text>
<text class="w-40p">商品详情</text>
<text class="w-15p">数量</text>
<text class="w-15p">单价</text>
<text class="w-15p">小计</text>
@@ -22,33 +22,144 @@
<text class="w-15p" v-if="info.type === 0">
<image :src="item.goodsCover" mode="aspectFit" class="goods-cover"/>
</text>
<text class="w-40p font-bold text-35">{{ item.goodsName }}</text>
<template v-if="info.type === 0">
<view class="flex flex-col justify-start items-start w-40p">
<text class=" font-bold text-35">{{ item.goodsName }}</text>
<text class="mt-15 text-gray">{{ item.sku.label }}</text>
</view>
<text class="w-15p">x{{ item.num }}</text>
<text class="w-15p text-main">¥{{ item.sku.values }}</text>
<text class="w-15p font-bold">¥{{ item.sku.values * item.num }}</text>
</template>
<template v-else>
<view class="flex flex-col justify-start items-start w-40p">
<text class=" font-bold text-35">{{ item.goodsName }}</text>
</view>
<text class="w-15p">x{{ item.num }}</text>
<text class="w-15p text-main">¥{{ item.goodsPrice }}</text>
<text class="w-15p">{{ item.goodsPrice * item.num }}</text>
<text class="w-15p font-bold">¥{{ item.goodsPrice * item.num }}</text>
</template>
</view>
</view>
</template>
<template v-if="info.type === 0">
<div class="p-20 rounded border m-30 pointer address" v-if="!address" @click="showAddress">
点击选择地址
</div>
<div v-else
class="py-20 flex justify-between items-center">
<div class="flex flex-col justify-start items-start">
<div class="flex justify-start items-center">
<text class="font-bold">{{ address.name }}</text>
</div>
<text>{{ address.phone }}</text>
<text v-if="address.addressRegion && address.addressRegion.province">{{
address.addressRegion.province.name
}}{{
address.addressRegion.city.name
}}{{ address.addressRegion.area.name }}{{ address.addressDetail }}
</text>
<text v-else-if="info.address.province">{{ info.address.province.name }}{{
info.address.city.name
}}{{ info.address.area.name }}{{ info.addressDetail }}
</text>
</div>
<div class="flex justify-center items-center">
<el-button type="primary" @click="showAddress">
变更
</el-button>
</div>
</div>
</template>
<view class="mt-40 font-bold text-main">您的会员等级:
{{ getUserLevelLabel(vk.getVuex('$user.userInfo.userLevel')) }}
{{ info.offRate !== 100 ? `,享受${info.offRate / 10}折优惠,已为您优惠${info.saveAmount}元` : '' }}
</view>
<div v-if="info.type === 0" class="my-20">
<p>备注和要求:</p>
<el-input v-model="remark" type="textarea"/>
</div>
<view class="mt-40 w-50p flex flex-col justify-center items-center m-a">
<text class=" mb-20"
:class="[info.amount !== info.offAmount ? 'text-line-through text-30' : 'text-main font-bold text-40']"
v-if="info">
订单金额:¥{{ info.amount }}
</text>
<text class="text-main font-bold text-40 mb-20" v-if="info && info.amount !== info.offAmount">
优惠后金额:¥{{ parseFloat(info.offAmount).toFixed(2) }}
</text>
<el-button type="primary" round
:disabled="(info.type === 0 && !address)" @click="onPay">
立即支付
</el-button>
</view>
<div class="pay-price" v-if="billQRCode">
<uv-qrcode ref="qrcode" size="240px" :value="billQRCode"></uv-qrcode>
<div class="pay-desc">微信、支付宝、云闪付扫码完成支付</div>
<el-button type="success" @click="onPayStatus">已完成支付</el-button>
</div>
</view>
<gap height="50"/>
<common-footer></common-footer>
<right-bar></right-bar>
<el-dialog :visible.sync="dialogVisible" :title="dialogTitle" width="50%" :close-on-click-modal="false"
@close="dialogVisible = false">
<template v-if="dialogVisible && dialogType === 'address-list'">
<div v-for="(item, index) in addressList" :key="index"
class="py-20 border-bottom flex justify-between items-center">
<div class="flex flex-col justify-start items-start">
<div class="flex justify-start items-center">
<text v-if="item.isDefault" class="default-address">默</text>
<text class="font-bold">{{ item.name }}</text>
</div>
<text>{{ item.phone }}</text>
<text>{{ item.addressRegion.province.name }}{{
item.addressRegion.city.name
}}{{ item.addressRegion.area.name }}{{ item.addressDetail }}
</text>
</div>
<div class="flex justify-center items-center">
<el-button type="primary" @click="address = item; dialogVisible = false" size="small">
选择
</el-button>
<el-button type="warning" @click="addressEdit(item)" plain size="small" class="mt-20">
编辑
</el-button>
</div>
</div>
<div class="text-center mt-15">
<el-button plain @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="dialogType = 'address-action'; dialogTitle = '新增地址'">
新增地址
</el-button>
</div>
</template>
<div class="flex flex-col justify-start" v-else-if="dialogVisible && dialogType === 'address-action'">
<el-form ref="form" label-width="100px">
<el-row :gutter="10" class="mb-20">
<el-col :span="4">
<el-col :span="12">
<el-form-item label="收件人姓名">
<el-input v-model="name" placeholder="请输入收件人姓名"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-col :span="12">
<el-form-item label="收件人手机号">
<el-input v-model="phone" placeholder="请输入收件人手机号"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10" class="border-bottom pb-20">
<el-col :span="4">
<el-select v-model="addressIndex[0]" placeholder="请选择省">
<el-form-item label="收件人地址">
<el-row :gutter="10">
<el-col :span="6">
<el-select v-model="addressIndex[0]" placeholder="请选择省" class="w-100p">
<el-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[1]" placeholder="请选择市"
<el-col :span="6">
<el-select v-model="addressIndex[1]" placeholder="请选择市" class="w-100p"
:disabled="addressIndex.length === 0">
<template v-if="addressIndex[0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[0]]" :key="index"
@@ -58,8 +169,8 @@
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[2]" placeholder="请选择区"
<el-col :span="6">
<el-select v-model="addressIndex[2]" placeholder="请选择区" class="w-100p"
:disabled="addressIndex.length === 1">
<template v-if="addressIndex[0] !== null && addressIndex[1] !== null">
<el-option v-for="(item, index) in areaData[addressIndex[0]][addressIndex[1]]"
@@ -70,27 +181,21 @@
</template>
</el-select>
</el-col>
<el-col :span="12">
<el-input v-model="addressDetail" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</template>
<view class="mt-20 w-50p flex flex-col justify-center items-center m-a">
<text class="text-main font-bold text-40 mb-20" v-if="info">订单金额:¥{{ info.amount }}</text>
<el-button type="primary" round
:disabled="(info.type === 0 && (!phone || !name || addressIndex.length < 3))" @click="onPay">
立即支付
</el-button>
</view>
<div class="pay-price" v-if="billQRCode">
<uv-qrcode ref="qrcode" size="240px" :value="billQRCode"></uv-qrcode>
<div class="pay-desc">请打开手机微信,扫一扫完成支付</div>
<el-button type="success" @click="onPayStatus">已完成支付</el-button>
</el-form-item>
<el-form-item label="详细地址">
<el-input v-model="addressDetail" placeholder="请输入详细地址"/>
</el-form-item>
<el-form-item label="默认地址">
<el-switch v-model="isDefault"/>
</el-form-item>
</el-form>
<div class="flex justify-center items-center">
<el-button type="primary" @click="onAddressAction">保存</el-button>
<el-button @click="dialogTitle = '地址列表'; dialogType = 'address-list'">取消</el-button>
</div>
</view>
<gap height="50"/>
<common-footer></common-footer>
<right-bar></right-bar>
</div>
</el-dialog>
</view>
</template>
@@ -99,21 +204,39 @@ 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 dayjs from "dayjs";
import {Loading} from "element-ui";
import {getUserLevelLabel} from "../../../util";
const OpenSdk = require('../../user/lib/base').default;
const sdk = new OpenSdk({
appId: '10037e6f6823b20801682b6a5e5a0006',
appKey: '1c4e3b16066244ae9b236a09e5b312e8'
// appId: '10037e6f6823b20801682b6a5e5a0006',
// appKey: '1c4e3b16066244ae9b236a09e5b312e8'
// 正式
appId: '8a81c1db8fc5238d01910b9e312d0692',
appKey: 'a15ceac60f5b464eb758c4fe7800ee9f'
// 测试分账
// appId: 'f0ec96ad2c3848b5b810e7aadf369e2f',
// appKey: '775481e2556e4564985f5439a5e6a277'
})
// 正式
// const mid = '8984501521190CF'
// const tid = '20713432'
// 测试
const mid = '898450100002303'
const tid = 'G5SBN2XJ'
// const mid = '898310060514001'
// const tid = '00000001'
export default {
name: "order",
data() {
return {
id: null,
info: {
type: null
type: null,
offRate: 100
},
provinceData: provinces,
cityData: citys,
@@ -124,68 +247,197 @@ export default {
phone: '',
billQRCode: null,
checkPayInterval: null,
dialogVisible: false,
dialogTitle: '',
dialogType: '',
address: null,
addressList: [],
selectedAddressId: null,
isDefault: false,
remark: ''
}
},
methods: {
async getInfo() {
getUserLevelLabel,
async getInfo(resetOrderNo = false) {
this.info = await vk.callFunction({
url: 'client/order/kh/getInfo',
data: {
id: this.id
id: this.id,
resetOrderNo
}
})
if (this.info.orderStatus === 1) {
if (this.info.name && (this.info.address || this.info.addressRegion)) {
if (this.info.address) {
this.address = {
name: this.info.name,
phone: this.info.phone,
addressDetail: this.info.addressDetail,
addressRegion: {
province: this.info.address.province,
city: this.info.address.city,
area: this.info.address.area,
},
}
}else {
this.address = {
name: this.info.name,
phone: this.info.phone,
addressDetail: this.info.addressDetail,
addressRegion: {
province: this.info.addressRegion.province,
city: this.info.addressRegion.city,
area: this.info.addressRegion.area,
},
}
}
}
if (this.info.orderStatus === -1) {
this.$message.error('订单已取消')
if (this.checkPayInterval) clearInterval(this.checkPayInterval)
vk.redirectTo({
url: '/pages/order/order?menuIndex=1',
})
}
if ([1, 4].includes(this.info.orderStatus)) {
if (this.checkPayInterval) clearInterval(this.checkPayInterval)
this.$message({
type: 'success',
message: '订单已支付成功'
})
setTimeout(() => {
this.$router.push({
path: '/pages/user/order',
if ([7, 11].includes(this.info.type)) {
vk.navigateBack()
} else if (this.info.type === 10) {
vk.redirectTo({
url: '/pages/index/old/release',
})
} else if (this.info.type === 2 || this.info.type === 3) {
this.$confirm(`恭喜您已成功支付,点击'确定'返回平台权益核对`, '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'success'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=equity'});
})
} else if (this.info.type === 13) {
vk.redirectTo({
url: '/pages/contract/index?tab=sign',
})
} else {
vk.redirectTo({
url: '/pages/order/order?menuIndex=1',
})
}
}, 1000)
}
},
async onPay() {
if (this.info.type === 0) {
if (this.addressIndex.length > 2 && this.addressIndex[2] === null) {
if (!this.address) return this.$message({type: 'error', message: '请选择地址'})
await vk.callFunction({
url: 'client/order/kh/updateAddress',
data: {
id: this.id,
address: [provinces[this.addressIndex[0]], citys[this.addressIndex[0]][this.addressIndex[1]], areas[this.addressIndex[0]][this.addressIndex[1]][this.addressIndex[2]]],
addressDetail: this.addressDetail,
phone: this.phone,
name: this.name,
address: {
province: this.address.addressRegion.province,
city: this.address.addressRegion.city,
area: this.address.addressRegion.area,
},
addressDetail: this.address.addressDetail,
phone: this.address.phone,
name: this.address.name,
remark: this.remark
}
})
}
}
// await vk.callFunction({
// url: 'client/user/pub/pay',
// data: {
// orderNo: this.info.orderNo,
// billStatus: 'PAID',
// billPayment: JSON.stringify({
// payTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
// receiptAmount: this.info.offAmount * 100,
// paySeqId: 'asdasd'
// })Ï
// }
// })
// this.checkPayInterval = setInterval(() => {
// this.getInfo()
// }, 1000)
// return
const requestTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss')
const timestamp = dayjs().format('YYYYMMDDHHmmss')
const goods = []
let goodsName = this.info.goods[0].goodsName
goods.push({goodsName})
if (this.info.goods.length > 1) goodsName += `等${this.info.goods.length - 1}件商品`
// 平台分账金额
let platformAmount = 0
const goodsList = []
// let goodsName = this.info.goods[0].goodsName
// goods.push({goodsName})
// if (this.info.goods.length > 1) goodsName += `等${this.info.goods.length - 1}件商品`
let subOrderAmount = 0
let attachedData = this.info.goods[0].goodsName
if (this.info.goods.length > 1) attachedData += `等${this.info.goods.length - 1}件商品`
this.info.goods.forEach((goods, index) => {
const goodsData = {
goodsName: goods.goodsName
}
if (goods.company && goods.company.mid && goods.company.settleRate) {
// subOrderAmount += parseInt((goods.company.settleRate * goods.price).toString())
// goodsData['subOrderAmount'] = parseInt((goods.company.settleRate * goods.price).toString())
subOrderAmount += 9
goodsData['subOrderAmount'] = 9
goodsData['subMerchantId'] = goods.company.mid
goodsData['merOrderId'] = this.info.orderNo + index
}
goodsList.push(goodsData)
})
if (subOrderAmount > 0) platformAmount = this.info.offAmount * 100 - subOrderAmount
// let data = {
// queryUrl: 'https://test-api-open.chinaums.com/v1/inip/upsp/shop/csb/get-qrcode',
// sysSource: 'OPT',
// vaMchntNo: mid,
// vaTermNo: tid,
// timestamp,
// nonce: 'rp84ufhfn20yneo3tp',
// billNo: this.info.orderNo,
// totalAmount: 10,
// notifyUrl: 'https://www.jinjiuxinzg.cn/pay_notify',
// vaFld:
// }
let data = {
queryUrl: 'https://test-api-open.chinaums.com/v1/netpay/bills/get-qrcode',
queryUrl: 'https://api-mop.chinaums.com/v1/netpay/bills/get-qrcode',
timestamp,
nonce: 'rp84ufhfn20yneo3tp',
content: {
billNo: this.info.orderNo,
requestTimestamp,
mid: '898201612345678',
tid: '88880001',
mid,
tid,
instMid: 'QRPAYDEFAULT',
totalAmount: 1,
notifyUrl: 'https://fc-mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5.next.bspapp.com/pay_notify',
goods
totalAmount: parseInt(this.info.offAmount * 100).toFixed(0),
notifyUrl: 'https://tcb-n44byxi8bmrfrki-d4bn1c4a206d.service.tcloudbase.com/pay_notify',
// notifyUrl: 'https://www.jinjiuxinzg.cn/pay_notify',
goods: goodsList,
attachedData,
billDesc: attachedData,
}
}
if (platformAmount > 0) {
data['divisionFlag'] = true
data['platformAmount'] = 0
}
console.log(data)
/**
* 调用函数
*/
const loadingInstance = Loading.service({fullscreen: true, text: '请求中'});
sdk.exec(data).then(res => {
this.$nextTick(() => {
loadingInstance.close();
});
const h = this.$createElement;
const result = JSON.parse(res);
if (result.errCode === 'SUCCESS') {
@@ -197,15 +449,88 @@ export default {
}, 1000)
}, 3000)
}
}).catch(err => {
this.$nextTick(() => {
loadingInstance.close();
});
this.$message({
type: 'error',
message: '服务器繁忙,请稍后再试或联系平台客服'
})
setTimeout(() => {
vk.redirectTo({
url: '/pages/order/order?activeName=0&menuIndex=1',
})
}, 1500)
})
},
async onAddressAction() {
if (!this.name) return this.$message({type: 'error', message: '请填写收件人姓名'})
if (!this.phone) return this.$message({type: 'error', message: '请填写收件人手机号'})
if (!this.addressDetail || this.addressIndex[2] === null) return this.$message({
type: 'error',
message: '请填写地址'
})
const province = this.provinceData[this.addressIndex[0]]
const city = this.cityData[this.addressIndex[0]][this.addressIndex[1]]
const area = this.areaData[this.addressIndex[0]][this.addressIndex[1]][this.addressIndex[2]]
this.addressRegion = {
province: {code: province.code, name: province.name},
city: {code: city.code, name: city.name},
area: {code: area.code, name: area.name},
}
await vk.callFunction({
url: 'client/userAddress/kh/addUpdate',
data: {
id: this.selectedAddressId ?? null,
name: this.name,
phone: this.phone,
addressDetail: this.addressDetail,
addressRegion: this.addressRegion,
isDefault: this.isDefault
}
})
this.name = ''
this.phone = ''
this.addressDetail = ''
this.addressIndex = [null, null, null,]
this.dialogType = 'address-list'
this.dialogTitle = '地址列表'
await this.getUserAddress()
},
async getUserAddress() {
const {rows} = await vk.callFunction({
url: 'client/userAddress/kh/getList'
})
this.addressList = rows
},
showAddress() {
this.dialogType = 'address-list'
this.dialogTitle = '选择地址'
this.dialogVisible = true
},
addressEdit(item) {
this.selectedAddressId = item._id
this.name = item.name
this.phone = item.phone
this.addressDetail = item.addressDetail
this.addressIndex[0] = this.provinceData.findIndex(i => i.code === item.addressRegion.province.code)
this.addressIndex[1] = this.cityData[this.addressIndex[0]].findIndex(i => i.code === item.addressRegion.city.code)
this.addressIndex[2] = this.areaData[this.addressIndex[0]][this.addressIndex[1]].findIndex(i => i.code === item.addressRegion.area.code)
this.dialogType = 'address-action';
this.dialogTitle = ' 编辑地址'
}
},
onLoad(options) {
if (options && options.id) {
this.id = options.id
this.getInfo()
this.getInfo(true)
this.getUserAddress()
}
},
beforeDestroy() {
if (this.checkPayInterval) clearInterval(this.checkPayInterval)
},
onUnload() {
if (this.checkPayInterval) clearInterval(this.checkPayInterval)
}
@@ -226,4 +551,23 @@ export default {
font-size: 16px;
line-height: 2em;
}
.address:hover {
border: 1px solid #a92924;
background-color: #f1c7c7;
}
.default-address {
background-color: #a92924;
color: #fff;
font-size: 14px;
width: 20px;
height: 20px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 5px;
padding: 2px;
}
</style>
+125 -33
View File
@@ -4,15 +4,27 @@
<common-header></common-header>
<category-bar></category-bar>
<view class="w-1200">
<u-swiper :list="list" :height="380" borderRadius="0"></u-swiper>
<common-swiper page="shop"/>
<view class="tool-bar">
<view class="search">
<text>地区:</text>
<el-cascader :options="options" :props="{label: 'name', value: 'code'}" v-model="address"
<el-row :gutter="10" flex justify="center" align="center">
<el-col :span="8">
<el-input v-model="keyword" placeholder="请输入商品名称" clearable @clear="getGoodsList()"
@keyup.enter.native="getGoodsList()" class="w-100"/>
</el-col>
<el-col :span="10">
<view class="flex justify-start items-center">
<text class="text-25">特产地区:</text>
<el-cascader :options="options" :props="{label: 'name', value: 'code'}"
v-model="address"
@change="getGoodsList()" clearable/>
</view>
<view class="buy-btn">
<image src="https://oss.wsdns.cn/20231204/bcc976f4396e437abf19deb11c1f06b4.png" mode="widthFix"/>
</el-col>
<el-col :span="6">
<image src="https://oss.wsdns.cn/20231204/bcc976f4396e437abf19deb11c1f06b4.png"
mode="widthFix"/>
</el-col>
</el-row>
</view>
</view>
<view class="tool-bar">
@@ -24,16 +36,30 @@
</view>
</view>
</view>
<div class="m-a w-1200 flex justify-start items-center flex-wrap" v-if="adLoaded">
<div v-for="(ad, adIndex) in adList" :key="adIndex"
:style="{width: '600px'}">
<template v-if="ad.length > 0">
<el-carousel :height="`100px`" class="m-a">
<el-carousel-item v-for="(item, index) in ad" :key="index" :style="{width: '600px'}">
<image @click="adJump(item)"
class="pointer" :src="item.swiper" mode="aspectFill"
:style="{width: '100%', height: '100px'}"/>
</el-carousel-item>
</el-carousel>
</template>
</div>
</div>
<view class="goods-list">
<view class="flex flex-wrap justify-start is-status">
<view class="w-20p " v-for="(item, index) in goodsList" :key="index">
<view class="p-20 ">
<view class="grid-content bg-purple pointer"
<view class="grid-content bg-purple pointer pos-r"
@click="navTo(`/pages/index/shop/detail?id=${item._id}`)">
<text class="recommend" v-if="item.recommend === 1">荐</text>
<image :src="item.cover" mode="aspectFill"/>
<view class="comments">
<view class="goods-name">
<view class="goods-name" style="height: 60px">
{{ item.name }}
</view>
<view class="goods-price">¥{{ item.amount }}</view>
@@ -71,32 +97,27 @@ export default {
return {
categoryList: [],
goodsList: [],
list: [
{
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
{
image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
title: '身无彩凤双飞翼,心有灵犀一点通'
},
{
image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}
],
options: [],
address: [],
pageIndex: 1,
pageSize: 20,
total: 0,
categoryId: null
categoryId: null,
keyword: null,
adList: [],
adNum: 0,
adLoaded: false
};
},
onLoad(options) {
if (options && options.menu) {
this.currMenu = options.menu
async onLoad(options) {
await this.getCategoryList()
if (options && options.menu) this.currMenu = options.menu
if (options && options.keyword) this.keyword = options.keyword
if (options && options.cateName) {
const cate = this.categoryList.find(item => item.name === options.cateName)
if (cate) this.categoryId = cate._id
}
this.options = provinces.map(item => {
item.children = [];
return item
@@ -106,7 +127,9 @@ export default {
this.options[index].children.push(city)
})
})
this.getCategoryList()
console.error(this.options)
this.getGoodsList()
},
methods: {
@@ -116,12 +139,11 @@ export default {
navTo(url) {
vk.navigateTo(url);
},
getCategoryList() {
vk.callFunction({
async getCategoryList() {
const res = await vk.callFunction({
url: 'client/goods/category/pub/getList'
}).then(res => {
this.categoryList = res.rows
})
this.categoryList = res.rows
},
getGoodsList(pageIndex = 1) {
vk.callFunction({
@@ -130,17 +152,76 @@ export default {
pageIndex,
pageSize: this.pageSize,
city: this.address.length > 1 ? this.address[1] : null,
parentId: this.categoryId
parentId: this.categoryId,
keyword: this.keyword
}
}).then(res => {
this.goodsList = res.rows
this.getAdList()
})
},
selectCate(cateId) {
if (this.categoryId === cateId) this.categoryId = null
else this.categoryId = cateId
this.getGoodsList()
},
adJump(item){
if ((item.type === 'company' || !item.type) && item.companyId)
vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)
else if (item.type === 'goods' && item.goodsId)
vk.navigateTo(`/pages/index/shop/detail?id=${item.goodsId}`)
},
async getAdList() {
this.adList = [[], [], [], [], []]
if (this.address.length === 0) {
if (!this.categoryId) {
for (let i = 0; i < 5; i++) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 27 + i
}
})
if (res.data) this.adList[i] = res.data
}
} else {
const cate = this.categoryList.find(item => item._id === this.categoryId)
if (cate.ad && cate.ad.length > 0) {
cate.ad.forEach(item => {
this.adList[item.adKey - 27].push(item)
})
}
}
} else {
for (let i = 0; i < 5; i++) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 27 + i,
region: this.address[0]
}
})
if (res.data) this.adList[i] = res.data
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.adList[i].push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
}
}
this.adNum = 0
for (let i = 0; i < 5; i++) {
if (this.adList[i].length > 0) {
this.adNum += 1
}
}
this.adLoaded = true
this.$forceUpdate()
},
}
}
</script>
@@ -218,7 +299,7 @@ export default {
.goods-name {
font-size: 16px;
display: flex;
align-items: center;
align-items: flex-start;
}
.goods-price {
@@ -246,4 +327,15 @@ export default {
display: flex;
justify-content: center;
}
.recommend {
position: absolute;
right: 0;
top: 0;
padding: 5px;
background-color: #bf2b28;
color: white;
font-size: 30rpx;
z-index: 999;
}
</style>
+39
View File
@@ -0,0 +1,39 @@
<template>
<el-form ref="form" label-width="80px">
<el-form-item label="物流公司">
{{ info.expressName }}
</el-form-item>
<el-form-item label="物流单号">
{{ info.expressNo }}
</el-form-item>
<el-form-item label="发货单">
<el-image v-for="(item, index) in info.expressPhoto" :key="index" :src="item"
class="mr-10 mb-10"
:preview-src-list="info.expressPhoto" style="width: 100px;height: 100px"/>
</el-form-item>
<el-form-item label="备注">
{{ info.remark }}
</el-form-item>
<div class="mt-20 flex justify-center items-center text-center">
<el-button type="primary" size="small" plain @click.native="close">关闭</el-button>
</div>
</el-form>
</template>
<script>
export default {
name: "expressInfo",
props: {
info: Object
},
data() {
return {}
},
methods: {
close() {
this.$emit('close')
},
}
}
</script>
+138
View File
@@ -0,0 +1,138 @@
<template>
<view>
<view class="py-20">
<el-row :gutter="10">
<el-col :span="12">
<text class="text-35 font-bold">商品信息</text>
</el-col>
<el-col :span="4">
<text class="text-35 font-bold flex-1">单价</text>
</el-col>
<el-col :span="4">
<text class="text-35 font-bold flex-1">数量</text>
</el-col>
<el-col :span="4">
<text class="text-35 font-bold flex-1">金额</text>
</el-col>
</el-row>
</view>
<view class="p-20 mb-20" v-for="(item, index) in goods" :key="index">
<el-row :gutter="10">
<el-col :span="12">
<view class="flex justify-start items-start">
<el-image :src="getGoodsImage(item)" class="cover ml-20" fit="cover" v-if="getGoodsImage(item)"/>
<view class="flex flex-col justify-start items-start ml-20">
<text class="font-bold mb-15">{{ item.goodsName }}</text>
<text class="text-gray" v-if="order.type === 0">{{ item.sku.label }}</text>
</view>
</view>
</el-col>
<el-col :span="4">
<text class="text-35 font-bold flex-1" v-if="order.type === 0">¥{{ item.sku.values }}</text>
<text class="text-35 font-bold flex-1" v-else>¥{{ item.goodsPrice }}</text>
</el-col>
<el-col :span="4">
<text class="text-35 font-bold flex-1">
x{{ item.num }}
</text>
</el-col>
<el-col :span="4">
<text class="text-35 font-bold flex-1 text-main" v-if="order.type === 0">¥{{
parseFloat(item.sku.values) * item.num
}}
</text>
<text class="text-35 font-bold flex-1 text-main" v-else>¥{{
parseFloat(item.goodsPrice) * item.num
}}
</text>
</el-col>
</el-row>
</view>
<view v-if="order.type === 1">
<p class="text-35 font-bold mb-25">服务详情</p>
<el-descriptions border :column="2">
<el-descriptions-item label="考察对象" v-if="selfProduct.type === 0">
<div style="margin-bottom: .5rem" v-for="(item, index) in selfProduct.contentList" :key="index">
<span>{{ item.name }}</span>
<template v-if="item.type && item.type === '个人'">
({{
item.code
}})--{{ item.addressRegion.province.name }}{{
item.addressRegion.city.name
}}{{ item.addressRegion.area.name }}{{ item.address }}
</template>
</div>
</el-descriptions-item>
<el-descriptions-item label="考察产品" v-else>
<p style="margin-bottom: .5rem" v-for="(item, index) in selfProduct.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="接收文件电子邮箱">
<span>{{ selfProduct.email }}</span>
</el-descriptions-item>
<el-descriptions-item label="接收文件微信">
<span>{{ selfProduct.wechat }}</span>
</el-descriptions-item>
<el-descriptions-item label="接收文件寄件地址">
<span v-if="selfProduct.receiveAddressRegion.province">{{
selfProduct.receiveAddressRegion.province.name
}}{{ selfProduct.receiveAddressRegion.city.name }}{{
selfProduct.receiveAddressRegion.area.name
}}{{ selfProduct.receiveAddress }}</span>
</el-descriptions-item>
<el-descriptions-item label="申请人">
<span>{{ selfProduct.requestName }}</span>
</el-descriptions-item>
<el-descriptions-item label="业务联系人">
<span>{{ selfProduct.contactName }}</span>
</el-descriptions-item>
<el-descriptions-item label="业务联系方式">
<span>{{ selfProduct.contact }}</span>
</el-descriptions-item>
<el-descriptions-item label="结果文件" v-if="order && order.resultFiles">
<div v-for="(item, index) in order.resultFiles" :key="index">
<a :href="item"
target="_blank">预览:文件{{ index + 1 }}</a>
</div>
</el-descriptions-item>
<el-descriptions-item label="发送途径" v-if="order && order.sendMethod">{{ order.sendMethod }}
</el-descriptions-item>
</el-descriptions>
</view>
</view>
</template>
<script>
export default {
name: "goods",
props: {
goods: Array,
order: Object,
selfProduct: Object,
},
data() {
return {}
},
methods: {
getGoodsImage(item) {
if (!item) return ''
if (item.sku && item.sku.image) return item.sku.image
if (item.goods && item.goods.cover) return item.goods.cover
return ''
}
}
}
</script>
<style lang="scss" scoped>
.cover {
width: 80px;
height: 80px;
}
</style>
+207
View File
@@ -0,0 +1,207 @@
<template>
<view>
<div class="font-bold">
<span>订单编号: {{ orderInfo.orderNo }}</span>
<span class="ml-20 text-main" v-if="orderInfo.orderStatus > 1">(已发货)</span>
</div>
<div class="font-bold my-25">订单总额: {{ orderInfo.amount }}元</div>
<div class="text-main text-25 my-25" style="line-height: 1.9;">
<p>情况1、如遇有大额多车次,多批次交易,应涉及进度款,如100万合同,前期到两车,可以申请进度款;</p>
<p>情况2、如果单次可一次性送达则实行全款。</p>
<p>情况3、如为定制产品,双方协商可给协商比例的进度款。</p>
<p>情况4、有可能有剩余款项,交易完成可申请平台退款。</p>
<p>情况5、有可能实际发货量大于订货量,货款不足。</p>
</div>
<el-form ref="form" label-width="80px">
<el-form-item label="支付类型" required >
<el-select v-model="payInfo.type" @change="changeType">
<el-option
v-for="item in payTypeList"
:key="item"
:label="item"
:value="item"
:disabled="isPayTypeDisabled(item)"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="payInfo.type" required>
<el-input v-model="payInfo.amount" placeholder="请输入金额"/>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="payInfo.remark"/>
</el-form-item>
<template v-if="[0, 1].includes(orderInfo.orderStatus)">
<el-row :gutter="10">
<el-col :span="6">
<el-form-item label="是否发货">
<el-radio-group v-model="payInfo.isExpress"
:disabled="['货到付款', '全款'].includes(payInfo.type)">
<el-radio :label="true">是</el-radio>
<el-radio :label="false">否</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<!-- <el-col :span="12">-->
<!-- <el-form-item label="物流公司" required>-->
<!-- <el-input v-model="payInfo.expressName" placeholder="请输入物流公司"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="物流单号" required>-->
<!-- <el-input v-model="payInfo.expressNo" placeholder="请输入物流单号"/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
<el-form-item label="凭证" v-if="!payInfo.isExpress">
<vk-data-upload v-model="payInfo.photos"></vk-data-upload>
</el-form-item>
<el-form-item label="凭证" v-else required>
<vk-data-upload v-model="payInfo.expressPhoto"></vk-data-upload>
</el-form-item>
</template>
<el-form-item label="附件">
<vk-data-upload v-model="payInfo.ext"></vk-data-upload>
</el-form-item>
</el-form>
<el-row>
<el-col :span="24" class="text-center">
<el-button type="primary" size="mini" @click="setPayList">提交</el-button>
<el-button type="warning" size="mini" @click="close">取消
</el-button>
</el-col>
</el-row>
</view>
</template>
<script>
export default {
name: "makePay",
props: {
info: {
type: Object,
default: () => {
return {}
}
},
payTypeList: {
type: Array,
default: () => {
return []
}
},
},
data() {
return {
payInfo: {
orderId: this.info._id,
amount: null,
type: null,
remark: '',
buyerRemark: '',
photos: [],
payerUid: null,
hasPaid: false,
paidVoucher: '',
paidAt: '',
sellerConfirm: false,
confirmAt: '',
buyerUid: this.info.uid,
sellerUid: this.info.sellerUid,
status: 0,
buyerRefuse: false,
refuseReason: null,
buyerPhotos: [],
expressPhoto: [],
isExpress: false,
expressName: null,
expressNo: null,
ext: [],
},
orderInfo: {
payStatus: 0
}
}
},
methods: {
close() {
this.$emit("close")
},
async getOrderInfo() {
this.orderInfo = await vk.callFunction({
url: 'client/order/kh/getInfo',
data: {
id: this.info._id
}
})
},
async setPayList() {
if (!this.payInfo.type) return this.$message({
type: 'error',
message: '请选择支付类型'
})
if (!this.payInfo.amount) return this.$message({
type: 'error',
message: '请输入支付金额'
})
if (this.payInfo.isExpress && this.payInfo.expressPhoto.length === 0) return this.$message({
type: 'error',
message: '请上传凭证'
})
// if (this.payInfo.isExpress && !this.payInfo.expressName) return this.$message({
// type: 'error',
// message: '请输入物流公司'
// })
// if (this.payInfo.isExpress && !this.payInfo.expressNo) return this.$message({
// type: 'error',
// message: '请输入物流单号'
// })
if (this.payInfo.isExpress) {
this.$confirm('发货状态一旦确定无法修改,请谨慎操作', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
await vk.callFunction({
url: 'client/order/kh/makePay',
title: '请求中...',
data: {payInfo: this.payInfo}
})
this.$message({
type: 'success',
message: '支付单创建成功'
})
this.close()
})
} else {
await vk.callFunction({
url: 'client/order/kh/makePay',
title: '请求中...',
data: {payInfo: this.payInfo}
})
this.$message({
type: 'success',
message: '支付单创建成功'
})
this.close()
}
},
changeType() {
this.payInfo.isExpress = ['货到付款', '全款'].includes(this.payInfo.type)
console.log(this.payInfo.isExpress, this.payInfo.type)
},
isNotaryPaidOrder() {
return Number(this.orderInfo.signMethod) === 0
&& Number(this.orderInfo.type) > 3
&& Number(this.orderInfo.notaryPayStatus) === 1
},
isPayTypeDisabled(item) {
if (this.isNotaryPaidOrder()) return false
return (!['预付款', '货到付款', '全款'].includes(item) && this.orderInfo.payStatus === 0)
|| (['预付款', '货到付款', '全款'].includes(item) && this.orderInfo.payStatus > 0)
}
},
mounted() {
this.getOrderInfo()
}
}
</script>
+451
View File
@@ -0,0 +1,451 @@
<template>
<view>
<view style="margin-bottom: 16px; padding: 12px; background: #fff8e8; color: #8a5a00; line-height: 1.7;">
<view>服务提供方(卖家):请于系统确认支付方已依照协议或约定支付对应订单款项后,再启动对应服务。申请款项付款方在系统端完成划款授权确认操作后,款项到账时间约为工作日T+1,请届时查询确认。</view>
<view style="margin-top: 8px;">服务需求方(买家):请于依照交易规则和协议完成对应服务验收后,再在系统端完成对应申请款项的授权确认操作,系统默认确认时限为72小时(含工作日,届时系统仅提供信息提醒服务),请及时完成该项确认。若您届时未确认且未提出正当异议,系统将默认您已收货或同意支付申请。</view>
</view>
<view v-for="(item, index) in payList" :key="index" class="py-20 border-bottom">
<el-descriptions :title="item.type" :column="2" border :labelStyle="{width: '120px'}">
<template slot="extra">
<div class="flex justify-start items-center">
<template v-if="!item.buyerRefuse">
<template v-if="item.type !== '尾款'">
<el-button plain type="primary" size="mini" @click="showNotaryPayWithConfirm(item)"
v-if="canShowPayButton(item)">{{ isNotaryOrder() ? '公证支付' : '立即支付' }}
</el-button>
</template>
<template v-else>
<el-button plain type="primary" size="mini" @click="showPayWithConfirm(item)"
v-if="item.status === 0 && item.isBuyer && !item.hasPaid">同意授权支付
</el-button>
</template>
<el-button type="primary" size="mini" class="mx-20" @click="confirmPay(item)"
v-if="canShowConfirmButton(item)">
{{ isNotaryOrder() ? '通过申请' : '确认收款' }}
</el-button>
<el-button plain type="primary" size="mini" class="mx-20" @click="paidRefuse(item)"
v-if="canShowRefuseButton(item)">
驳回
</el-button>
</template>
</div>
</template>
<el-descriptions-item v-if="item.type !== '尾款'" label="支付金额">{{ item.amount }}</el-descriptions-item>
<template v-else>
<template v-if="item.status === 0">
<el-descriptions-item label="卖家申请金额">{{ item.amount }}</el-descriptions-item>
<el-descriptions-item label="卖家备注">{{ item.sellerRemark }}</el-descriptions-item>
<el-descriptions-item label="买家授权金额">{{ item.amount }}</el-descriptions-item>
</template>
<template v-else>
<el-descriptions-item label="支付金额">{{ item.amount }}</el-descriptions-item>
</template>
</template>
<el-descriptions-item label="支付凭证">
<template v-if="!item.buyerRefuse">
<span v-if="item.isNotaryFullPay && !item.hasPaid">待买方公证支付</span>
<span v-else-if="item.isNotaryFullPay && item.hasPaid">已支付到公证平台</span>
<span v-else-if="item.isNotaryApply">{{ item.sellerConfirm ? '买家已通过,已划付' : '无需二次支付,待买家通过申请' }}</span>
<span v-else-if="item.isSeller && !item.hasPaid">待买方支付</span>
<view v-else-if="item.paidVoucher">
<el-image :src="item.paidVoucher[0]" style="width: 80px; height: 80px" fit="cover"
:preview-src-list="item.paidVoucher"/>
</view>
<view v-else-if="!item.paidVoucher">
<span>未上传凭证</span>
</view>
</template>
<template v-else>
<div>
<span class="text-main">买家已拒绝: {{ item.refuseReason }}</span>
</div>
<div class="mt-10" v-if="!item.isNotaryApply">
<el-button
plain
type="warning"
size="mini"
@click="refundQuery(item)"
>
退款查询
</el-button>
</div>
</template>
</el-descriptions-item>
<el-descriptions-item label="交货凭证">
<el-image v-for="(photo, photoIndex) in item.expressPhoto" :key="photoIndex" :src="photo"
style="width: 80px; height: 80px" fit="cover"
:preview-src-list="item.expressPhoto"/>
</el-descriptions-item>
<el-descriptions-item label="备注">
<text>{{ item.remark ? item.remark : '无' }}</text>
</el-descriptions-item>
<el-descriptions-item label="买家备注">
<text>{{ item.buyerRemark ? item.buyerRemark : '无' }}</text>
</el-descriptions-item>
<el-descriptions-item label="图片">
<template v-if="item.photos && item.photos.length > 0">
<el-image v-for="(photo, photoIndex) in item.photos" :key="photoIndex" :src="photo"
style="width: 80px; height: 80px" fit="cover"
:preview-src-list="item.photos"/>
</template>
<span v-else>无</span>
</el-descriptions-item>
<el-descriptions-item label="我方状态">
<template v-if="item.isSeller">
<span v-if="item.isNotaryFullPay && !item.hasPaid">待公证支付</span>
<span v-else-if="item.isNotaryFullPay && item.hasPaid">已支付到公证平台</span>
<span v-else-if="!item.hasPaid && !item.buyerRefuse">待买方支付</span>
<span v-else-if="!item.sellerConfirm && item.hasPaid">{{ isNotaryOrder() && item.isNotaryApply ? '待买家通过申请' : '待确认收款' }}</span>
<span v-else-if="item.sellerConfirm && item.hasPaid">{{ isNotaryOrder() && item.isNotaryApply ? '已划付' : '已完成' }}</span>
</template>
<template v-if="item.isBuyer">
<span v-if="item.isNotaryFullPay && !item.hasPaid">待公证支付</span>
<span v-else-if="item.isNotaryFullPay && item.hasPaid">已支付到公证平台</span>
<span v-else-if="!item.hasPaid && !item.buyerRefuse">待支付</span>
<span v-else-if="!item.sellerConfirm && item.hasPaid">{{ isNotaryOrder() && item.isNotaryApply ? '待通过申请' : '完成支付' }}</span>
<span v-else-if="item.sellerConfirm && item.hasPaid">{{ isNotaryOrder() && item.isNotaryApply ? '已划付' : '已完成' }}</span>
</template>
</el-descriptions-item>
<el-descriptions-item label="对方状态">
<!-- 自己是卖家则对方是买家-->
<template v-if="item.isSeller">
<span v-if="item.isNotaryFullPay && !item.hasPaid">待公证支付</span>
<span v-else-if="item.isNotaryFullPay && item.hasPaid">已支付到公证平台</span>
<span v-else-if="!item.hasPaid && !item.buyerRefuse">待支付</span>
<span v-else-if="!item.sellerConfirm && item.hasPaid">{{ isNotaryOrder() && item.isNotaryApply ? '待通过申请' : '完成支付' }}</span>
<span v-else-if="item.sellerConfirm && item.hasPaid">{{ isNotaryOrder() && item.isNotaryApply ? '已划付' : '已完成' }}</span>
</template>
<template v-if="item.isBuyer">
<span v-if="item.isNotaryFullPay && !item.hasPaid">待公证支付</span>
<span v-else-if="item.isNotaryFullPay && item.hasPaid">已支付到公证平台</span>
<span v-else-if="!item.hasPaid && !item.buyerRefuse">待买方支付</span>
<span v-else-if="!item.sellerConfirm && item.hasPaid">{{ isNotaryOrder() && item.isNotaryApply ? '待买家通过申请' : '待确认收款' }}</span>
<span v-else-if="item.sellerConfirm && item.hasPaid">{{ isNotaryOrder() && item.isNotaryApply ? '已划付' : '已完成' }}</span>
</template>
</el-descriptions-item>
</el-descriptions>
</view>
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="50%" append-to-body="">
<template v-if="dialogVisible && dialogType === 'do-pay'">
<div class="font-bold">支付金额: {{ payInfo.amount }}元</div>
<el-form ref="form" label-width="80px">
<el-form-item label="支付凭证" required>
<vk-data-upload v-model="payInfo.paidVoucher"></vk-data-upload>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="payInfo.buyerRemark"/>
</el-form-item>
<el-form-item label="图片">
<vk-data-upload v-model="payInfo.buyerPhotos"></vk-data-upload>
</el-form-item>
</el-form>
<el-row>
<el-col :span="24" class="text-center">
<el-button type="primary" size="mini" @click="uploadPayVoucher">提交</el-button>
<el-button type="warning" size="mini" @click="dialogVisible = false">取消
</el-button>
</el-col>
</el-row>
</template>
</el-dialog>
</view>
</template>
<script>
import ExpressInfo from "./expressInfo.vue";
import Goods from "./goods.vue";
import SetExpress from "./setExpress.vue";
import MakePay from "./makePay.vue";
import {Loading} from "element-ui";
import dayjs from "dayjs";
const NOTARY_PAY_CONFIRM_CONTENT = `1、您已充分知悉、了解并认可本订单及合同的全部内容,以及各方的权利义务;<br>2、您需将本订单全部货款支付至金久信平台银联监管账户;<br>3、供货或服务提供方提起付款申请后,在满足双方约定条款的前提下,您应及时批准划付申请款项;若您未及时处理,系统将在7个工作日内自动默认您无异议,并自动同意该付款申请。如您对供货或服务提供存在异议,请及时在供货或服务提供方平台申请单中驳回申请,并说明驳回意见并及时与对方沟通原因;若您支付合同金额与实际交易应付金额存在差额,您可办理补付或申请退款。`
const OpenSdk = require('../../user/lib/base').default;
const sdk = new OpenSdk({
// appId: '10037e6f6823b20801682b6a5e5a0006',
// appKey: '1c4e3b16066244ae9b236a09e5b312e8'
// 正式
appId: '8a81c1db8fc5238d01910b9e312d0692',
appKey: 'a15ceac60f5b464eb758c4fe7800ee9f'
// 测试分账
// appId: 'f0ec96ad2c3848b5b810e7aadf369e2f',
// appKey: '775481e2556e4564985f5439a5e6a277'
})
// 正式
// const mid = '898450108428573'
// const tid = 'ZDUL21ZA'
const mid = '898450100002303'
const tid = 'G5SBN2XJ'
export default {
name: "payList",
components: {MakePay, SetExpress, Goods, ExpressInfo},
props: {
payList: {
type: Array,
default: []
},
orderInfo: {
type: Object,
default: () => {
return {}
}
}
},
data() {
return {
dialogVisible: false,
dialogType: '',
dialogTitle: '',
payInfo: null,
rate: 0,
subMerchantIdMain: ''
}
},
mounted() {
this.getPlatformRate()
this.getSubMerchantIdMain()
console.log('this.orderInfo', this.orderInfo)
},
methods: {
isNotaryOrder() {
return !!(this.orderInfo && Number(this.orderInfo.signMethod) === 0 && Number(this.orderInfo.type) > 3)
},
canShowPayButton(item) {
console.log('canShowPayButton this.isNotaryOrder()', item.isNotaryFullPay, item.status, item.isBuyer)
if (this.isNotaryOrder()) return item.isNotaryFullPay && item.status === 0 && item.isBuyer && !item.hasPaid
return item.status === 0 && item.isBuyer && !item.hasPaid
},
canShowConfirmButton(item) {
// console.log('canShowConfirmButton this.isNotaryOrder()', item.isNotaryApply , item.hasPaid , item.isBuyer , !item.sellerConfirm , !item.buyerRefuse)
if (this.isNotaryOrder()) return item.isNotaryApply && item.hasPaid && item.isBuyer && !item.sellerConfirm && !item.buyerRefuse
return item.hasPaid && item.isSeller && !item.sellerConfirm
},
canShowRefuseButton(item) {
if (this.isNotaryOrder()) return item.isNotaryApply && item.isBuyer && item.status === 0 && !item.sellerConfirm && !item.buyerRefuse
return item.isBuyer && item.status === 0 && !item.sellerConfirm && !item.hasPaid
},
getSellerMid(item) {
const seller = (item && item.seller) || (this.orderInfo && this.orderInfo.seller) || {}
return String(seller.mid || '').trim()
},
async getPlatformRate() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: 'd84694f2696818f20c28f55f36764783'
},
})
this.rate = res.content
},
async getSubMerchantIdMain() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '345cf9926ab107ad00db527f06fdbb6e'
},
})
this.subMerchantIdMain = String((res && res.content) || '').trim()
},
async unionPay(item) {
const subMerchantId = this.getSellerMid(item)
if (!subMerchantId) {
return this.$message.error('乙方未配置商户号,无法支付')
}
if (!this.subMerchantIdMain) {
await this.getSubMerchantIdMain()
}
if (!this.subMerchantIdMain) {
return this.$message.error('平台分账商户号未配置,无法支付')
}
const res = await vk.callFunction({
url: 'client/order/kh/resetPayListOrderNo',
data: {
id: item._id
},
})
let rate = this.rate
if (this.orderInfo.sheet && this.orderInfo.sheet.notaryServiceRate)
rate = this.orderInfo.sheet.notaryServiceRate
const orderNo = res.data
let subAmount = parseInt(item.amount * 100 * ((100 - parseFloat(rate)) / 100)).toFixed(0)
let platformAmount = parseInt(item.amount * 100 * (parseFloat(rate) / 100)).toFixed(0)
// let subAmount = parseInt(item.amount * (100 - parseFloat(this.rate))).toFixed(0)
const requestTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss')
const timestamp = dayjs().format('YYYYMMDDHHmmss')
console.log('subAmount', subAmount, subMerchantId)
console.log('subAmountMain', platformAmount, this.subMerchantIdMain)
// const goodsList = [{
// goodsId: item._id,
// goodsName: item.type,
// quantity: 1,
// price: parseInt(item.amount * 100).toFixed(0),
// }]
let data = {
queryUrl: 'https://api-mop.chinaums.com/v1/netpay/upg/order',
timestamp,
authorization: 'OPEN-FORM-PARAM',
nonce: 'rp84ufhfn20yneo3tp',
content: {
merOrderId: orderNo,
requestTimestamp,
mid,
tid,
instMid: 'WGDEFAULT',
chnlType: 'PC',
totalAmount: parseInt(item.amount * 100).toFixed(0),
notifyUrl: 'https://tcb-n44byxi8bmrfrki-d4bn1c4a206d.service.tcloudbase.com/pay_notify',
// transType: vk.getVuex('$user.userInfo.accountType') === 1 ? 'UPG_PERSONAL' : 'UPG_BUSINESS',
transType: 'UPG_BUSINESS',
bizType: '100003',
feeRatio: 'aaa',
// notifyUrl: 'https://www.jinjiuxinzg.cn/pay_notify',
// goods: goodsList,
}
}
data['content']['divisionFlag'] = true
data['content']['platformAmount'] = 0
data['content']['subOrders'] = [
{
mid: subMerchantId,
totalAmount: subAmount,
},
{
mid: this.subMerchantIdMain,
totalAmount: platformAmount,
},
]
console.log(data)
/**
* 调用函数
*/
const loadingInstance = Loading.service({fullscreen: true, text: '请求中'});
// const res = sdk.exec(data)
window.open(await sdk.exec(data))
loadingInstance.close()
this.showPayResultConfirm()
},
showNotaryPayWithConfirm(item) {
if (!this.isNotaryOrder()) return this.unionPay(item)
this.$confirm(NOTARY_PAY_CONFIRM_CONTENT, '公证支付', {
confirmButtonText: '我已知晓',
cancelButtonText: '取消',
showCancelButton: true,
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
this.unionPay(item)
}).catch(() => {})
},
showPayResultConfirm() {
this.$confirm('您是否已支付成功', '提示', {
confirmButtonText: '已支付成功',
cancelButtonText: '未支付成功',
showCancelButton: true,
distinguishCancelAndClose: true,
closeOnClickModal: false,
closeOnPressEscape: false,
}).then(() => {
this.$emit('refresh')
}).catch(() => {
this.$emit('refresh')
})
},
showPay(item) {
this.payInfo = item;
this.dialogTitle = '支付'
this.dialogType = 'do-pay';
this.dialogVisible = true;
},
showPayWithConfirm(item) {
this.$confirm('尾款为双方交易最后一次结算,请交易双方协商共同确定最终结算金额后进行,结算完毕将默认此订单结束,无法再次系统发起请款或付款动作,如您已知晓并双方已经协商确认最终结算金额,请进行确认后进入尾款流程',
'温馨提示', {
showCancelButton: true,
}).then(async ({value}) => {
this.payInfo = item;
this.dialogTitle = '支付'
this.dialogType = 'do-pay';
this.dialogVisible = true;
})
},
async confirmPay({_id, type}) {
await vk.callFunction({
url: 'client/order/kh/paidConfirm',
title: '请求中...',
data: {
id: _id
}
})
this.$message({
type: 'success',
message: this.isNotaryOrder() ? '确认划付成功' : '确认成功'
})
if (['尾款', '货到付款'].includes(type)) this.$emit('refresh', '4')
else this.$emit('refresh')
},
paidRefuse({_id}) {
this.$prompt('请输入驳回理由', '提示', {
showCancelButton: true,
showInput: true,
}).then(async ({value}) => {
await vk.callFunction({
url: 'client/order/kh/payRefuse',
title: '请求中...',
data: {
id: _id,
refuseReason: value,
}
})
this.$emit('refresh')
this.$message({
type: 'success',
message: '驳回成功'
})
})
},
async refundQuery(item) {
try {
const res = await vk.callFunction({
url: 'client/order/kh/refundQuery',
title: '请求中...',
data: {
id: item._id
}
})
const result = res.data || {}
const msg = result.errMsg || result.msg || res.msg || '查询完成'
this.$alert(
`退款单号: ${item.refundApplyPayload && item.refundApplyPayload.refundOrderId ? item.refundApplyPayload.refundOrderId : '无'}\n状态码: ${result.errCode || '无'}\n信息: ${msg}`,
'退款查询结果',
{
confirmButtonText: '确定'
}
)
this.$emit('refresh')
} catch (err) {
this.$message.error((err && err.message) || '退款查询失败')
}
},
async uploadPayVoucher() {
if (this.payInfo.paidVoucher.length === 0) return this.$message.error()
await vk.callFunction({
url: 'client/order/kh/uploadPayVoucher',
title: '请求中...',
data: this.payInfo
})
this.$message({
type: 'success',
message: '上传成功'
})
this.$emit('refresh')
this.dialogVisible = false
},
}
}
</script>
+84
View File
@@ -0,0 +1,84 @@
<template>
<el-form ref="form" label-width="80px">
<el-form-item label="客户信息" required>
<p>收件人: {{ info.name }}</p>
<p>收件人联系方式: {{ info.phone }}</p>
<p>收件地址: {{ info.addressRegion.province.name }}{{ info.addressRegion.city.name }}{{ info.addressRegion.area.name }}{{ info.addressDetail }}</p>
</el-form-item>
<el-form-item label="物流公司" required>
<el-input v-model="expressName" placeholder="请输入物流公司"/>
</el-form-item>
<el-form-item label="物流单号" required>
<el-input v-model="expressNo" placeholder="请输入物流单号"/>
</el-form-item>
<el-form-item label="发货单" required>
<vk-data-upload v-model="expressPhoto"></vk-data-upload>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="remark" placeholder="请输入备注"/>
</el-form-item>
<div class="mt-20 flex justify-center items-center text-center">
<el-button type="primary" size="small" plain @click.native="cancel">取消</el-button>
<el-button type="primary" size="small" @click.native="confirm">确定</el-button>
</div>
</el-form>
</template>
<script>
export default {
name: "setExpress",
props: {
id: Number | String,
info: Object
},
data() {
return {
expressName: null,
expressNo: null,
remark: null,
expressPhoto: [],
}
},
methods: {
close() {
this.$emit('close')
},
cancel() {
this.expressName = null
this.expressNo = null
this.remark = null
this.expressPhoto = []
this.$emit('close')
},
async confirm() {
if (!this.expressName) return this.$message({
type: 'error',
message: '请填写物流公司'
})
if (!this.expressNo) return this.$message({
type: 'error',
message: '请填写物流单号'
})
if (this.expressPhoto.length === 0) return this.$message({
type: 'error',
message: '请上传发货单'
})
await vk.callFunction({
url: 'client/order/kh/setExpress',
data: {
id: this.id,
expressName: this.expressName,
expressNo: this.expressNo,
remark: this.remark,
expressPhoto: this.expressPhoto
}
})
this.$emit('close')
this.$message({
type: 'success',
message: '发货成功'
})
}
}
}
</script>
+60
View File
@@ -0,0 +1,60 @@
<template>
<el-form ref="form" label-width="80px">
<el-form-item label="退款原因" required>
<el-input v-model="refundReason" placeholder="请输入退款原因"/>
</el-form-item>
<el-form-item label="图片">
<vk-data-upload v-model="refundPhotos"></vk-data-upload>
</el-form-item>
<div class="mt-20 flex justify-center items-center text-center">
<el-button type="primary" size="small" plain @click.native="cancel">取消</el-button>
<el-button type="primary" size="small" @click.native="confirm">确定</el-button>
</div>
</el-form>
</template>
<script>
export default {
name: "setRefund",
props: {
id: Number | String
},
data() {
return {
refundReason: null,
refundPhotos: [],
}
},
methods: {
close() {
this.$emit('close')
},
cancel() {
this.refundReason = null
this.refundPhotos = []
this.close()
},
async confirm() {
if (!this.refundReason) return this.$message({
type: 'error',
message: '请填写退款原因'
})
const res = await vk.callFunction({
url: 'client/order/kh/refund',
data: {
id: this.id,
refundReason: this.refundReason,
refundPhotos: this.refundPhotos,
}
}).catch(err => false)
if (res) {
this.$emit('close')
this.$message({
type: 'success',
message: '平台将在2个工作日内审核,请您耐心等待'
})
}
}
}
}
</script>
+141
View File
@@ -0,0 +1,141 @@
<template>
<view>
<el-descriptions title="金久信自营订单详情" :column="2" border :labelStyle="{width: '120px'}" v-if="info">
<el-descriptions-item label="服务">
<p v-for="(item, index) in orderInfo.goods" :key="index">{{ item.goodsName }}</p>
</el-descriptions-item>
<el-descriptions-item label="考察对象" v-if="info.type === 0">
<div style="margin-bottom: .5rem" v-for="(item, index) in info.contentList" :key="index">
<span>{{ item.name }}</span>
<template v-if="item.type && item.type === '个人' && item.addressRegion">
({{
item.code
}})--{{ item.addressRegion.province.name }}{{
item.addressRegion.city.name
}}{{ item.addressRegion.area.name }}{{ item.address }}
</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="接单公司" v-if="info.companyId">
<span>{{ info.company.company.companyName }}</span>
</el-descriptions-item>
<el-descriptions-item label="文件上传">
<vk-data-upload v-model="resultFiles"
:limit="9"
:on-preview="previewUpload"
accept=".jpg,.jpeg,.png,.xlsx,.doc,.docx,.pdf" list-type="text">
</vk-data-upload>
</el-descriptions-item>
<el-descriptions-item label="发送途径">
<el-select v-model="sendMethod" placeholder="请选择发送途径">
<el-option label="接收文件电子邮箱" value="接收文件电子邮箱"/>
<el-option label="接收文件微信" value="接收文件微信"/>
<el-option label="邮寄接收文件地址" value="邮寄接收文件地址"/>
</el-select>
</el-descriptions-item>
<template slot="extra">
<div class="flex justify-start items-center">
<el-button type="primary" size="mini" @click="setSend">确认完成
</el-button>
<el-button plain type="primary" size="mini" class="mx-20" @click="close">
关闭
</el-button>
</div>
</template>
</el-descriptions>
</view>
</template>
<script>
export default {
name: "setSend",
props: {
orderInfo: Object
},
data() {
return {
info: null,
sendMethod: null,
resultFiles: []
}
},
methods: {
async getInfo() {
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/getDetailByOrder',
data: {
orderId: this.orderInfo._id
}
})
this.info = data
},
async setSend() {
if (this.resultFiles.length === 0) {
vk.toast("请上传文件")
return
}
if (!this.sendMethod) {
vk.toast("请选择发送途径")
return
}
await vk.callFunction({
url: 'client/order/kh/changeOrderStatus',
data: {
id: this.orderInfo._id,
orderStatus: 3,
sendMethod: this.sendMethod,
resultFiles: this.resultFiles,
}
})
this.close()
},
close() {
this.$emit("close")
},
previewUpload({url}) {
window.open(url)
}
},
mounted() {
console.log(this.orderInfo)
this.getInfo()
}
}
</script>
+119
View File
@@ -0,0 +1,119 @@
<template>
<view>
<el-table :data="tableData.rows" style="width: 100%" border stripe>
<el-table-column prop="orderNo" label="订单号" width="200"/>
<el-table-column label="订单类型">
<template v-slot="{ row }">
<span>{{ row.type === 0 ? '普通订单' : '金久信自营订单' }}</span>
</template>
</el-table-column>
<el-table-column label="商品列表" width="250">
<template v-slot="{ row }">
<view class="flex flex-col justify-start items-start">
<view v-for="(item, index) in row.goods" :key="index"
class="flex justify-start items-start">
<image :src="item.goodsCover" class="goods-cover" v-if="row.type === 0"/>
<view class="ml-20 flex flex-col justify-start items-start">
<text class="text-main font-bold">{{ item.goodsName }}</text>
<text class="mt-20">¥{{ item.goodsPrice }}</text>
<text class="mt-20">x{{ item.num }}</text>
</view>
</view>
</view>
</template>
</el-table-column>
<el-table-column prop="amount" label="订单金额"/>
<el-table-column prop="payAmount" label="支付金额"/>
<el-table-column label="订单状态">
<template v-slot="{ row }">
<span v-if="row.orderStatus === 0">待支付</span>
<span v-if="row.orderStatus === 1">已支付</span>
<span v-if="row.orderStatus === 2">待收货</span>
<span v-if="row.orderStatus === 3">已完成</span>
</template>
</el-table-column>
<el-table-column prop="_add_time_str" label="下单时间"/>
<el-table-column label="操作">
<template v-slot="{ row }">
<text v-if="row.orderStatus === 0" class="text-main pointer" @click="repay(row)">去支付</text>
</template>
</el-table-column>
</el-table>
<view class="text-center mt-20">
<el-pagination
:page-size="pageSize"
@current-change="getOrderList"
background
layout="prev, pager, next"
:total="tableData.total">
</el-pagination>
</view>
</view>
</template>
<script>
export default {
name: "shopOrder",
props: {
tableData: Object
},
data() {
return {
tableData: [],
activeIndex: 0,
pageSize: 20,
total: 0,
}
},
methods: {
async repay(row) {
await vk.callFunction({
url: 'client/order/kh/resetOrderNo',
data: {
id: row._id,
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${row._id}`
})
},
getOrderList(index){
this.$emit('change-page', index)
}
},
onLoad(options) {
}
}
</script>
<style lang="scss" scoped>
.main-wrap {
width: 1200px;
margin: 20px auto;
position: relative;
.left-wrap {
position: absolute;
width: 220px;
left: -240px;
top: 0;
view {
padding: 20px;
}
.active {
background-color: #a92924;
color: white;
}
}
}
.goods-cover {
width: 80px;
height: 80px;
}
</style>
+816 -457
View File
File diff suppressed because it is too large Load Diff
+13 -3
View File
@@ -6,7 +6,7 @@
<gap height="50"/>
<view class="w-1200 m-a bg-white p-40">
<view class="text-50 font-bold">{{ info.name }}</view>
<view class="mt-20 text-gray text-28 pb-20 border-bottom">{{ info._add_time_str }}</view>
<view class="mt-20 text-gray text-28 pb-20 border-bottom">{{ info._update_time ? info._update_time : info._add_time_str }}</view>
<view v-html="info.content" class="mt-20"></view>
</view>
<gap height="50"/>
@@ -26,14 +26,24 @@ export default {
}
},
onLoad(option) {
if (option.id) this.getInfo(option.id);
if (option.id) {
this.getInfo(option.id);
this.addViewNum(option.id);
}
},
methods: {
async getInfo(id) {
this.info = await vk.callFunction({
const res = await vk.callFunction({
url: `client/otherArticle/list/pub/getDetail`,
data: {id}
});
this.info = res
},
addViewNum(_id){
vk.callFunction({
url: `client/otherArticle/list/pub/addViewNum`,
data: {_id}
});
}
}
}
+56 -3
View File
@@ -1,13 +1,66 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<gap height="50"/>
<view class="w-1200 m-a bg-white p-40">
<view v-for="(item, index) in list" :key="index"
@click="navTo(item._id)"
class="py-30 border-bottom flex justify-between items-center pointer">
<text class="font-bold">{{ item.name }}</text>
<text class="text-gray">{{ item._add_time_str }}</text>
</view>
<view class="text-center">
<el-pagination
:page-size="pageSize"
@current-change="getList"
background
layout="prev, pager, next"
:total="total">
</el-pagination>
</view>
</view>
<gap height="50"/>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
name: "list",
data() {
return {}
return {
list: [],
parentId: null,
pageSize: 20,
total: 0,
}
},
methods: {}
methods: {
getList(pageIndex) {
vk.callFunction({
url: 'client/otherArticle/list/pub/getList',
pageSize: this.pageSize,
pageIndex,
data: {
parentId: this.parentId
},
success: res => {
this.list = res.rows;
this.total = res.total;
}
})
},
navTo(id) {
vk.navigateTo({
url: `/pages/otherArticle/detail?id=${id}`
})
}
},
onLoad(options) {
if (options) this.parentId = options.id;
this.getList();
}
}
</script>
+385 -29
View File
@@ -20,7 +20,7 @@
</view>
</view>
<view class="flex justify-end items-end"
v-if="info.answerEndTime && dayjs().diff(dayjs(info.answerEndTime), 'second') < 0">
v-if="info.answerEndTime && dayjs(info.answerEndTime).diff(dayjs(), 'second') > 0">
<text>距离加工结束还有:</text>
<view class="border-main countdown text-main">{{
dayjs(info.answerEndTime).diff(dayjs(), 'day')
@@ -36,15 +36,17 @@
<view class="my-25 flex justify-between items-center pb-20 border-bottom">
<view class="flex justify-start items-center">
<id-card theme="outline" size="24" fill="#a92924" strokeLinecap="square"/>
<text class="ml-15 text-gray">
<text class="ml-15 text-gray" v-if="info.user">
{{ info.user.accountType === 1 ? info.user.person.personName : info.user.company.companyName }}
</text>
</view>
<el-button type="primary" @click.native="toQuote"
v-if="vk.getVuex('$user.userInfo._id') !== info.userId && info.status === 0">我要申请加工
<el-button type="primary" @click.native="toQuote" :disabled="info.disabled"
v-if="vk.getVuex('$user.userInfo._id') !== info.userId && info.status === 0">{{
info.disabled ? '已超时无法报价' : '我要申请合作'
}}
</el-button>
<el-button type="primary" @click.native="showDialog = true"
v-else-if="vk.getVuex('$user.userInfo._id') === info.userId">查看收到的申请加工
v-else-if="vk.getVuex('$user.userInfo._id') === info.userId">查看收到的申请合作
</el-button>
</view>
<view class="item-wrap">
@@ -55,6 +57,25 @@
</view>
</view>
</view>
<view class="mt-15 mr-15" v-if="info.files">
<file-type :item="item" v-for="(item, index) in info.files" :key="index" @click.native="previewFile(item)"/>
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
加工产品交货地址
</view>
</view>
</view>
<view class="mt-15">{{
info.addressRegion ? `${info.addressRegion.province.name}${info.addressRegion.city.name}${info.addressRegion.area ? info.addressRegion.area.name : ''}` : ``
}}{{
info.addressDetail ? info.addressDetail : ''
}}
</view>
</view>
<view class="item-wrap">
@@ -66,20 +87,45 @@
</view>
</view>
<view class="mt-15">{{ info.remark }}</view>
<template v-if="info.multiFiles">
<file-type :item="item" v-for="(item, index) in info.multiFiles" :key="index"
@click.native="previewFile(item)"/>
<!-- <el-image :src="item" v-for="(item, index) in info.multiFiles" :key="index" style="width: 100px; height: 100px" fit="cover"-->
<!-- :preview-src-list="info.multiFiles"/>-->
</template>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
纳税和税票
主要商品
</view>
</view>
</view>
<view class="mt-15">{{ info.title }}</view>
<view class="mt-15">加工产品简述:{{ info.detail }}</view>
<view class="mt-15">加工量:{{ info.num }}</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
发票要求
</view>
</view>
</view>
<view class="mt-15">是否含税:{{ info.invoice ? '含税' : '不含税' }}</view>
<template v-if="info.invoice">
<view class="mt-15">开票时间:{{ WRITE_INVOICE_TIME[info.writeInvoiceTime] }}</view>
<view class="mt-15">发票种类:{{ INVOICE_TYPE[info.invoiceType] }}</view>
<view class="mt-15">其他要求:{{ info.invoiceOther }}</view>
<view class="mt-15" v-if="info.invoiceOther">税票要求:{{ info.invoiceOther }}</view>
<template v-else>
<view class="mt-15">纳税人身份:{{ info.taxType ? info.taxType : '无' }}</view>
<view class="mt-15">发票种类:{{ info.invoiceType ? info.invoiceType : '无' }}</view>
<view class="mt-15">税率:{{ info.taxRate ? info.taxRate : '无' }}</view>
</template>
</template>
</view>
<view class="item-wrap">
@@ -90,20 +136,46 @@
</view>
</view>
</view>
<view class="mt-15">随货资料:{{ info.transportDocuments.join() }}</view>
<view class="mt-15">其他要求:{{ info.otherTransportDocuments }}</view>
<view class="mt-15" v-if="info.transportDocuments && info.transportDocuments.length > 0">
随货资料:{{ info.transportDocuments.join() }}
</view>
<view class="mt-15" v-if="info.otherTransportDocuments">其他要求:{{ info.otherTransportDocuments }}</view>
<view class="mt-15">运输限制要求:{{ info.transportLimit ? '有' : '无' }}</view>
<view class="mt-15" v-if="info.transportLimit && info.otherTransportRequest">
运输限制说明:{{ info.otherTransportRequest }}
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="goods-sheet-title">
<view class="form-title">
交易模式
</view>
</view>
</view>
<view class="mt-15">{{ info.tradeMethod === 0 ? '自主交易' : '金久信公证' }}</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
交易说明
</view>
</view>
</view>
<view class="mt-15">付款方式:{{ PROCESS_PAY_METHOD[info.payMethod] }}</view>
<!-- <view class="mt-15" v-if="info.payMethod === 0">付款方式:{{ PROCESS_PAY_METHOD[info.payMethod] }}{{-->
<!-- info.payMethod === 0 ? `${info.advancePayRate}%货到付全款` : ''-->
<!-- }}{{ info.payMethod === 3 ? `${info.reputationPayDay}天` :-->
<!-- ( info.payMethod === 4 ? `:${info.otherPayMethod}` : '') }}-->
<!-- </view>-->
<view class="mt-15" v-if="info.payMethod === 0">付款方式:预付{{ info.advancePayRate }}%货到付全款</view>
<view class="mt-15" v-if="info.payMethod === 1">付款方式:加工验收合格后付全款</view>
<view class="mt-15" v-if="info.payMethod === 3">付款方式:加工验收合格后{{
info.reputationPayDay
}}天内支付全款
</view>
<view class="mt-15">报价形式:{{ info.offerType === 0 ? '整单报价' : '可分项报价' }}</view>
<view class="mt-15">报价期限:
<text v-if="info.answerStartTime && info.answerEndTime">{{
@@ -112,12 +184,80 @@
</text>
</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
交易保证金要求
</view>
</view>
</view>
<view class="mt-15">{{ info.earnestMoney }}</view>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
采购商信息
</view>
<text class="tip-text ml-10">(注册可查看信息)</text>
</view>
</view>
<template v-if="isLoggedIn && userInfo.userLevel > 1">
<view class="mt-15" v-if="info.companyName">
公司信息:{{ info.companyName }}
</view>
<view class="mt-15" v-if="info.companyMobile">公司联系方式:{{
info.companyMobile
}}
</view>
<view class="mt-15" v-if="info.businessName">
授权业务咨询人:{{ info.businessName }}
</view>
<view class="mt-15" v-if="info.businessMobile">业务咨询联系方式:{{
info.businessMobile
}}
</view>
</template>
<template v-else>
<view class="mt-15" v-if="info.companyName">
公司信息:{{ info.companyName ? info.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : '' }}
</view>
<view class="mt-15" v-if="info.companyMobile">公司联系方式:{{
info.companyMobile ? info.companyMobile.replace(/^(.)(.)(.).*$/, "$1$2$3****") : ''
}}
</view>
<view class="mt-15" v-if="info.businessName">
授权业务咨询人:{{ info.businessName ? info.businessName.replace(/^(.).*(.)$/, "$1***$2") : '' }}
</view>
<view class="mt-15" v-if="info.businessMobile">业务咨询联系方式:{{
info.businessMobile ? info.businessMobile.replace(/^(.)(.)(.).*$/, "$1$2$3****") : ''
}}
</view>
</template>
</view>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
签约模式
</view>
</view>
</view>
<view class="mt-15">{{
info.signMethod === 0 ? '线上签约-标准合同' : (info.signMethod !== 1 ? '线上签约-双方协商合同' : '线下签约')
}}
</view>
</view>
<view class="item-wrap" v-if="info.signMethod === 0">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
简易合同备注和其他补充条款
合同条款
</view>
</view>
</view>
@@ -137,10 +277,24 @@
<view class="mt-15">
本合同的全部内容由双方平等共同协商一致,共同起草制定,非一方事先拟定,不属于格式条款。本合同自双方签字盖章后生效(包括电子签字、盖章),按本合同内容地址、联系方式寄送的一切文书、函件送达与否,均为视为送达有法律效力,通知途径和本合同内联系方式或地址送达文件双方均予以验证。
</view>
<view class="mt-15">采购方补充条款: 供货方逾期供货承担采购方一切损失</view>
<view class="mt-15"> 供应方补充条款:</view>
<view class="mt-15">采购方补充条款: {{ info.supplementary }}</view>
</view>
<template v-else-if="info.signMethod === 2">
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
合同附件
</view>
</view>
</view>
</view>
<view v-for="(item, index) in info.contractAttachment" :key="index" class="mr-25 my-25">
<file-type :item="item" @click.native="previewFile(item)"/>
</view>
</template>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
@@ -155,7 +309,7 @@
<text class="flex-1">申请时间</text>
</view>
<view class="quote" v-for="(item, index) in info.quoteList.rows" :key="index">
<text class="flex-1">{{
<text class="flex-1" v-if="info.user">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
}}
</text>
@@ -163,43 +317,98 @@
</view>
</view>
</view>
<view class="item-wrap" v-if="spotAdList.length > 0">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
相关推荐
</view>
</view>
</view>
<view class="spot-ad-list">
<image v-for="(item, index) in spotAdList" :key="index"
@click="adJump(item)"
class="spot-ad-item pointer"
:src="item.swiper"
mode="aspectFill"/>
</view>
</view>
</view>
<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">
<text>收到的加工申请</text>
<text>收到的加工合作申请</text>
<el-button type="primary" @click.native="showDialog = false">关闭</el-button>
</view>
<view class="mt-15" v-if="info && info.quoteList">
<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 info.quoteList.rows" :key="index">
<text class="flex-1">{{
<text class="flex-1" v-if="info.user">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
}}
</text>
<text class="flex-1">{{ item.totalPrice }}元</text>
<view class="flex-1">
<view class="flex-1">
<!-- <view class="mt-15 mr-15" v-for="(item, index) in item.files" :key="index">-->
<!-- <template v-if="['doc', 'docx'].includes(item.split('.').pop())">-->
<!-- <file-word theme="outline" class="pointer" size="40" fill="#4a90e2" strokeLinecap="square"-->
<!-- @click.native="openDownload(item)"/>-->
<!-- </template>-->
<!-- <template v-else-if="['xls', 'xlsx'].includes(item.split('.').pop())">-->
<!-- <file-excel theme="outline" class="pointer" size="40" fill="#417505" strokeLinecap="square"-->
<!-- @click.native="openDownload(item)"/>-->
<!-- </template>-->
<!-- <template v-else-if="['pdf'].includes(item.split('.').pop())">-->
<!-- <file-pdf-one theme="outline" class="pointer" size="40" fill="#f5a623"-->
<!-- strokeLinecap="square"-->
<!-- @click.native="openDownload(item)"/>-->
<!-- </template>-->
<!-- <template v-else>-->
<!-- <el-image :src="item" style="width: 100px; height: 100px" fit="cover"-->
<!-- :preview-src-list="[item]"/>-->
<!-- </template>-->
<!-- </view>-->
<file-type :item="file" v-for="(file, fileIndex) in item.files" :key="fileIndex"
@click.native="previewFile(file)"/>
</view>
</view>
<view class="flex-1 flex flex-col justify-start items-start">
<text>采购方补充条款:{{ info.supplementary ? info.supplementary : '无' }}</text>
<text>加工方补充条款:{{ item.supplierExt ? item.supplierExt : '无' }}</text>
</view>
<text class="flex-1">{{ item.remark }}</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">
<el-button type="primary" @click.native="createContract(item)" v-if="info.status === 0">选择</el-button>
<el-button type="primary" @click.native="createContract(item)" v-if="info.status === 0">选择
</el-button>
</text>
</view>
</view>
</el-dialog>
<el-dialog title="图片预览" :visible.sync="showImagePreview" width="80%" append-to-body>
<img v-if="previewImageUrl" class="preview-image" :src="previewImageUrl" alt="附件预览"/>
</el-dialog>
</view>
</template>
<script>
import {BuildingOne, IdCard} from '@icon-park/vue'
import {BuildingOne, FileExcel, FilePdfOne, FileWord, IdCard} from '@icon-park/vue'
import dayjs from "dayjs";
import {WRITE_INVOICE_TIME, INVOICE_TYPE, PROCESS_PAY_METHOD} from '@/util'
import FileType from "../../components/file-type/file-type.vue";
export default {
components: {BuildingOne, IdCard},
components: {FileType, FileWord, FilePdfOne, FileExcel, BuildingOne, IdCard,},
data() {
return {
WRITE_INVOICE_TIME,
@@ -207,11 +416,17 @@ export default {
PROCESS_PAY_METHOD,
id: null,
info: null,
showDialog: false
showDialog: false,
showImagePreview: false,
previewImageUrl: '',
spotAdList: []
};
},
methods: {
dayjs,
userInfo: {
userLevel: 0
},
getInfo() {
vk.callFunction({
url: 'client/process/sheet/pub/getInfo',
@@ -220,14 +435,86 @@ export default {
}
}).then((res) => {
this.info = res
this.info.disabled = (!this.info.answerEndTime || dayjs(this.info.answerEndTime).isBefore(dayjs()))
this.getSpotAd()
})
},
toQuote() {
async getSpotAd() {
this.spotAdList = []
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 38,
spotGoodsId: this.id
}
})
if (res.data) this.spotAdList = res.data
},
adJump(item) {
if (item.spotGoodsId) {
if (item.spotGoodsId === this.id) return
vk.navigateTo(`/pages/process/detail?id=${item.spotGoodsId}`)
} else if (item.type === 'goods' && item.goodsId) {
vk.navigateTo(`/pages/index/shop/detail?id=${item.goodsId}`)
} else if (item.companyId) {
vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)
}
},
async toQuote() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (userInfo.factoryStatus !== 1) return this.$message.error('非加工厂,无法报价,请去个人中心申请加工厂')
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
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 {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
if (this.info.earnestMoney && this.info.earnestMoney > 0 && userInfo.paidEnsure < this.info.earnestMoney) {
this.$confirm('保证金不足,是否去充值保证金?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=grade'});
})
return
}
vk.navigateTo(`/pages/process/quote?sheetId=${this.id}`)
}
},
createContract({totalPrice, uid, _id}) {
vk.callFunction({
url: 'client/contract/kh/add',
title: '请求中...',
data: {
type: 'process',
productTitle: this.info.title,
@@ -245,23 +532,69 @@ export default {
message: '选择成功',
type: 'success'
})
this.showDialog = false
setTimeout(() => {
vk.navigateTo('/pages/contract/index')
if (this.info.signMethod === 0) vk.navigateTo('/pages/contract/index?tab=1')
else {
if (this.info.signMethod === 1) vk.navigateTo('/pages/store/buyer?menuIndex=0')
else vk.navigateTo('/pages/contract/index?tab=0')
}
}, 1500)
})
},
getFileExt(url = "") {
const cleanUrl = String(url).split("?")[0].split("#")[0]
const match = cleanUrl.match(/\.([a-z0-9]+)$/i)
return match ? match[1].toLowerCase() : ""
},
isImageFile(url) {
return ["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg"].includes(this.getFileExt(url))
},
isPdfFile(url) {
return this.getFileExt(url) === "pdf"
},
isOfficeFile(url) {
return ["doc", "docx", "xls", "xlsx", "ppt", "pptx"].includes(this.getFileExt(url))
},
getOfficePreviewUrl(url) {
return `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(url)}`
},
previewFile(url) {
if (!url) return
if (this.isImageFile(url)) {
this.previewImageUrl = url
this.showImagePreview = true
return
}
if (this.isPdfFile(url)) {
window.open(url, "_blank")
return
}
if (this.isOfficeFile(url)) {
window.open(this.getOfficePreviewUrl(url), "_blank")
return
}
window.open(url, "_blank")
},
openDownload(url) {
this.previewFile(url)
}
},
onLoad(option) {
if (!option.id) vk.navigateBack()
this.id = option.id
this.userInfo = vk.getVuex('$user.userInfo') || {userLevel: 0}
this.getInfo()
}
},
computed: {
isLoggedIn() {
return !!vk.getVuex('$user.userInfo._id')
},
},
}
</script>
<style lang="scss" scoped>
@import "@/common/css/app.scss";
.page-main {
width: 1200px;
margin: 20px auto;
@@ -291,15 +624,19 @@ export default {
.form-title {
padding-left: 10px;
color: $--color-primary;
color: #A92924;
font-size: 18px;
line-height: 18px;
border-left: 4px solid $--color-primary;
border-left: 4px solid #A92924;
}
}
}
.tip-text {
color: #f56c6c;
}
.request-header {
border: 1px solid #EDEDED;
background-color: #FFF8F1;
@@ -327,4 +664,23 @@ export default {
text-align: center;
}
}
.spot-ad-list {
display: flex;
flex-wrap: wrap;
gap: 20px;
margin-top: 15px;
}
.spot-ad-item {
width: calc(50% - 10px);
height: 100px;
}
.preview-image {
display: block;
max-width: 100%;
max-height: 75vh;
margin: 0 auto;
}
</style>
+602
View File
@@ -0,0 +1,602 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="page-nav">
<el-breadcrumb separator=">">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item>
<navigator style="display: inline-block;" url="/pages/index/process/list">找加工</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item class="text-main">加工厂列表</el-breadcrumb-item>
</el-breadcrumb>
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布加工单</el-button>
<el-button @click="toMyEnquiry" type="primary" round plain>我发布的加工单</el-button>
</el-row>
</view>
<view class="w-1200 m-a">
<common-swiper page="factory"/>
</view>
<!-- 筛选表单 -->
<view class="w-1200 m-a" style="margin-top: 30rpx">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词:" class="border-bottom pb-30">
<el-input @keyup.enter.native="search(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="search(1)" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
</el-form-item>
<el-form-item label="分类:" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectCate({name: -1})" class="pointer mr-25"
:class="[(checkCategoryList.includes(-1) || checkCategoryList.length === 0) ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in categoryTreeData" :key="index">
<text @click="selectCate(item)" class="pointer mr-25"
:class="[checkCategoryList.includes(item.name) ? 'text-main selected-cate' : '']">
{{ item.name }}
</text>
</view>
</view>
</el-form-item>
<el-form-item label="地区" class="border-bottom pb-30">
<el-cascader :options="areaOptions"
:props="{label: 'name', value: 'code', checkStrictly: true}"
v-model="area"
clearable
style="width: 300px;"
@change="selectArea"/>
</el-form-item>
</el-form>
</view>
<div class="flex justify-between items-center w-1200 m-a">
<template v-if="ad12.length">
<el-carousel :height="`100px`" :style="{width: '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad12" :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="ad122.length">
<el-carousel :height="`100px`" :style="{width: '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad122" :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="goods-list">
<view v-for="(item, index) in list.rows" :key="index" class="goods">
<view class="goods-info" @click="navTo(`/pages/yellowPage/factory?userId=${item.uid}`)">
<!-- <el-image src="https://oss.wsdns.cn/20231204/d35332fa6a3b4596b522edf9527ac612.png"-->
<!-- class="goods-img"/>-->
<view class="info">
<view class="field">
<view class="desc" style="width: 1000px">
<view class="text">加工主体</view>
<view class="font-bold" v-if="item.user">{{
item.user.accountType === 2 ? item.user.company.companyName : item.user.person.personName
}}
</view>
</view>
<view class="desc">
<view class="text">所在地区</view>
<view>{{ item.addressRegion.province.name }}{{ item.addressRegion.city.name }}</view>
</view>
<view class="desc">
<view class="text">成立年限</view>
<view>{{ item.year }}年</view>
</view>
<view class="desc">
<view class="text">年产值</view>
<view>{{ item.yearsIncome }}万元</view>
</view>
<view class="desc">
<view class="text">员工人数</view>
<view>{{ item.employeeNum }}人</view>
</view>
<view class="desc">
<view class="text">流水线数量</view>
<view>{{ item.flowNum }}条</view>
</view>
<view class="desc">
<view class="text">厂房归属</view>
<view>{{ item.blongTo }}</view>
</view>
<view class="desc">
<view class="text">厂房面积</view>
<view>{{ item.size }}㎡</view>
</view>
<view class="desc">
<view class="text">服务信息</view>
<view>{{ item.serviceInfo }}</view>
</view>
<view class="desc" v-if="item.mainSpotCategory && item.mainSpotCategory.length > 0">
<view class="text">主营类别</view>
<view>{{ item.mainSpotCategory.join() }}</view>
</view>
<view class="desc">
<view class="text">主营工艺和业务范围</view>
<view>{{ item.mainProcess }}</view>
</view>
</view>
</view>
</view>
<view class="buttons">
<button type="default" class="btn" plain @click="doShowContract(index)">查看电话
</button>
<button type="default" class="btn green mt-20" plain @click="doShowWechat(index)">添加微信
</button>
<button type="default" class="btn mt-20" plain @click="navTo(`/pages/yellowPage/factory?userId=${item.uid}`)">
查看详情
</button>
<view class="wechat"
v-if="item.user && parseInt(item.user.accountType) === 2 && item.user.businessCard && item.user.businessCard.companyWechat && item.showWechat">
<el-image :src="item.user.businessCard.companyWechat" style="width: 100%; height: 100%"/>
</view>
<view class="wechat"
v-if="item.user && parseInt(item.user.accountType) === 1 && item.user.businessCard && item.user.businessCard.personalWechat && item.showWechat">
<el-image :src="item.user.businessCard.personalWechat" style="width: 100%; height: 100%"/>
</view>
<view class="mobile" v-if="item.user && item.showContract && item.user.businessCard">
<i class="el-icon-phone"></i>
<text class="ml-20">{{
(item.user.businessCard && item.user.businessCard.companyMobile) ? item.user.businessCard.companyMobile : '暂无电话'
}}
</text>
</view>
</view>
</view>
<view class="paginatio">
<el-pagination @current-change="search" background layout="prev, pager, next" :total="list.total"
:page-size="pageSize">
</el-pagination>
</view>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
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 dayjs from "dayjs";
export default {
data() {
return {
checkCategoryList: [],
clickedCateIndex: -1,
provinceData: provinces,
cityData: citys,
areaData: areas,
areaOptions: [],
area: [],
checkProvinceList: [],
keyword: '',
list: {
total: 0,
rows: []
},
showAllProvince: false,
type: 0,
pageSize: 20,
ad12: [],
ad122: [],
categoryTreeData: [],
};
},
onLoad(option) {
if (option.type) this.type = option.type
this.areaOptions = provinces.map(item => {
item.children = [];
return item
})
this.areaOptions.forEach((province, index) => {
citys[index].forEach(city => {
city.children = []
this.areaOptions[index].children.push(city)
})
})
this.areaOptions.forEach((province, index) => {
province.children.forEach((city, cityIndex) => {
this.areaOptions[index].children[cityIndex].children.push(...areas[index][cityIndex])
})
})
vk.callFunction({
url: 'client/process/category/pub/getTree',
title: '请求中...',
success: (data) => {
this.categoryTreeData = data.rows
this.allChildCate = []
this.categoryTreeData.forEach(item => {
item.children.forEach(child => {
this.allChildCate.push(child)
})
})
}
});
},
onShow() {
this.search(1)
},
methods: {
navTo(url) {
vk.navigateTo({
url
})
},
selectCate({name}) {
if (name === -1) this.checkCategoryList = []
const index = this.checkCategoryList.indexOf(name)
if (index === -1) {
this.checkCategoryList = [name]
} else {
this.checkCategoryList = []
}
console.log(this.checkCategoryList)
this.search(1)
},
selectProvince(code) {
if (code === -1) this.checkProvinceList = []
else {
this.checkProvinceList = [code]
}
this.search(1)
},
selectArea(e) {
this.area = e
this.checkProvinceList = e && e.length ? [e[0]] : []
this.search(1)
},
toMyEnquiry() {
vk.navigateTo({
url: '/pages/process/my'
})
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
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 {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/process/release'
})
}
},
search(pageIndex) {
// const categoryIds = []
// this.allChildCate.map(item => {
// if (this.checkCategoryList.indexOf(item._id) > -1) categoryIds.push(item.name)
// })
vk.callFunction({
url: 'client/factory/pub/getList',
title: '加载中...',
data: {
pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
mainSpotCategory: this.checkCategoryList.length ? this.checkCategoryList[0] : null,
area: this.area
},
success: ({data}) => {
data.rows.map(item => {
item.showWechat = false
item.showContract = false
return item
})
this.list = data
this.getAd12()
this.getAd122()
}
});
},
getCertUrl() {
vk.callFunction({
url: 'client/fadada.getVerifyUrl',
success: (res) => {
location.href = res.data.url
}
});
},
doShowWechat(index) {
if (parseInt(this.list.rows[index].user.accountType) === 2 && !this.list.rows[index].user.businessCard.companyWechat)
return vk.toast('用户暂未上传')
else if (parseInt(this.list.rows[index].user.accountType) === 1 && !this.list.rows[index].user.businessCard.personalWechat)
return vk.toast('用户暂未上传')
this.list.rows[index].showContract = false
this.list.rows[index].showWechat = !this.list.rows[index].showWechat
},
doShowContract(index) {
this.list.rows[index].showWechat = false
this.list.rows[index].showContract = !this.list.rows[index].showContract
},
async getAd12() {
this.ad12 = []
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 12,
categoryName: this.checkCategoryList.length ? this.checkCategoryList[0] : null,
region: this.area && this.area.length ? this.area : (this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null)
}
})
if (res.data) this.ad12 = res.data
},
async getAd122() {
this.ad122 = []
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 122,
categoryName: this.checkCategoryList.length ? this.pickValue : null,
categoryNames: this.checkCategoryList.length ? [this.pickValue] : null,
region: this.area && this.area.length ? this.area : (this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null)
}
})
if (res.data) this.ad122 = res.data
},
},
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
}
.page-nav {
display: flex;
justify-content: space-between;
}
.carousel-img {
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
flex-wrap: wrap;
.el-tag {
margin-right: 10px;
}
}
.goods-list {
width: 1200px;
margin: 20px auto;
display: flex;
flex-direction: row;
justify-content: space-between;
flex-wrap: wrap;
}
.goods {
background-color: #FFFFFF;
box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.05);
text-align: center;
width: 1200px;
margin: 10px auto;
padding: 20px;
display: flex;
justify-content: space-between;
.goods-info {
display: flex;
flex: 1;
.goods-img {
width: 200px;
height: 150px;
}
.info {
width: 1000px;
text-align: left;
margin-left: 20px;
.goods-name {
font-size: 20px;
font-weight: 500;
line-height: 2.5em;
}
.field {
display: flex;
flex-wrap: wrap;
.desc {
display: flex;
width: 330px;
line-height: 2.5em;
.text {
width: 140px;
color: #999999;
}
}
}
}
}
.buttons {
padding: 0 20px;
width: 200px;
border-left: 1px solid #f3f3f3;
display: flex;
flex-direction: column;
justify-content: space-around;
position: relative;
.btn {
width: 120px;
}
.green {
background-color: #7ec050 !important;
color: #ffffff;
}
.wechat {
position: absolute;
left: -140px;
top: 0;
width: 150px;
height: 150px;
background-color: white;
border-radius: 10px;
padding: 5px;
box-shadow: 0 1px 10px 0 #eee
}
.mobile {
position: absolute;
left: -110px;
top: 10px;
background-color: white;
border-radius: 10px;
padding: 5px;
box-shadow: 0 1px 10px 0 #eee;
display: flex;
align-items: center;
justify-content: center;
}
}
&-title {
font-size: 15px;
color: #101010;
height: 62px;
padding-top: 20px;
font-weight: bold;
}
&-stock {
font-size: 12px;
color: #BD3124;
}
&-address {
font-size: 12px;
margin: 10px 0;
}
&-image {
width: 200px;
height: 70px;
margin: 0 auto;
image {
width: 100%;
height: 100%;
}
}
&-company {
color: #4F4F4F;
font-size: 14px;
margin: 10px 0;
}
&-buy {
width: 108px;
height: 30px;
line-height: 30px;
background-color: rgba(255, 255, 255, 1);
color: rgba(169, 41, 36, 1);
font-size: 13px;
text-align: center;
font-family: Roboto;
border: 1px solid rgba(169, 41, 36, 1);
margin: 0 auto;
cursor: pointer;
}
.goods-image {
width: 100%;
}
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
.selected-cate {
border-bottom: 2px solid #BD3124;
line-height: 40rpx;
}
.child-cate {
background-color: #DB8382;
color: white;
margin-top: 10rpx;
border-radius: 15rpx;
padding: 0 20rpx;
}
</style>
+284 -87
View File
@@ -12,17 +12,13 @@
</view> -->
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<common-swiper page="process"/>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布加工单</el-button>
<el-button @click="toMyEnquiry" type="primary" round plain>我发布的加工单</el-button>
<el-button @click="toMyQuote" type="primary" round plain>我的报价</el-button>
<el-button @click="navTo('/pages/process/factoryList')" type="success" round plain>加工厂列表</el-button>
</el-row>
</view>
</view>
@@ -32,59 +28,66 @@
<view class="filter-outer">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词:" class="border-bottom pb-30">
<el-input @keyup.enter.native="search(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
<el-input @keyup.enter.native="keywordSearch" clearable placeholder="输入关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="search(1)" type="primary" slot="append" style="border-radius: 0">搜索
<el-button @click="keywordSearch" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
</el-form-item>
<el-form-item label="分类:" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="clickedCateIndex = -1" class="pointer mr-25"
:class="[clickedCateIndex === -1 ? 'text-main selected-cate' : '']">全部
<text @click="selectCate({_id: -1})" class="pointer mr-25"
:class="[checkCategoryList.length === 0 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in categoryTreeData" :key="index">
<text @click="clickedCateIndex = index" class="pointer mr-25"
:class="[clickedCateIndex === index ? 'text-main selected-cate' : '']"
v-if="index < 10">
<text @click="selectCate(item)" class="pointer mr-25"
:class="[checkCategoryList.length && checkCategoryList.includes(item._id) ? 'text-main selected-cate' : '']">
{{ item.name }}
</text>
</view>
</view>
<view class="child-cate flex justify-start items-center flex-wrap">
<template v-if="clickedCateIndex === -1">
<text class="pointer mr-25" @click="selectCate(item)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in allChildCate" :key="index">{{ item.name }}
</text>
</template>
<template v-else>
<text class="pointer mr-25" @click="selectCate(item)"
:class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"
v-for="(item, index) in categoryTreeData[clickedCateIndex].children" :key="index">
{{ item.name }}
</text>
</template>
<!-- <text @click="showAllTexture = !showAllTexture" class="pointer mr-25" >查看更多-->
<!-- <view class="child-cate flex justify-start items-center flex-wrap">-->
<!-- <template v-if="clickedCateIndex === -1">-->
<!-- <text class="pointer mr-25" @click="selectCate(item)"-->
<!-- :class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"-->
<!-- v-for="(item, index) in allChildCate" :key="index">{{ item.name }}-->
<!-- </text>-->
</view>
<!-- </template>-->
<!-- <template v-else>-->
<!-- <text class="pointer mr-25" @click="selectCate(item)"-->
<!-- :class="[checkCategoryList.includes(item._id) ? 'text-main' : '']"-->
<!-- v-for="(item, index) in categoryTreeData[clickedCateIndex].children" :key="index">-->
<!-- {{ item.name }}-->
<!-- </text>-->
<!-- </template>-->
<!-- &lt;!&ndash; <text @click="showAllTexture = !showAllTexture" class="pointer mr-25" >查看更多&ndash;&gt;-->
<!-- &lt;!&ndash; </text>&ndash;&gt;-->
<!-- </view>-->
</el-form-item>
<el-form-item label="供应商:" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectCompany(-1)" class="pointer mr-25"
:class="[checkCompanyList.length === 0 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in companyList" :key="index">
<text @click="selectCompany(item._id)" class="pointer mr-25"
:class="[checkCompanyList.includes(item._id) ? 'text-main selected-cate' : '']"
v-if="index < 10 || showAllCompany">
{{ item.name }}
</text>
</view>
<text @click="showAllCompany = !showAllCompany" class="pointer mr-25"
v-if="companyList.length > 10">查看更多
</text>
</view>
<!-- <el-form-item label="供应商:" class="border-bottom pb-30">-->
<!-- <view class="flex justify-start items-center flex-wrap">-->
<!-- <text @click="selectCompany(-1)" class="pointer mr-25"-->
<!-- :class="[checkCompanyList.length === 0 ? 'text-main selected-cate' : '']">全部-->
<!-- </text>-->
<!-- <view v-for="(item, index) in companyList" :key="index">-->
<!-- <text @click="selectCompany(item._id)" class="pointer mr-25"-->
<!-- :class="[checkCompanyList.includes(item._id) ? 'text-main selected-cate' : '']"-->
<!-- v-if="index < 10 || showAllCompany">-->
<!-- {{ item.name }}-->
<!-- </text>-->
<!-- </view>-->
<!-- <text @click="showAllCompany = !showAllCompany" class="pointer mr-25"-->
<!-- v-if="companyList.length > 10">查看更多-->
<!-- </text>-->
<!-- </view>-->
<!-- </el-form-item>-->
<el-form-item label="地区:" class="border-bottom pb-30">
<el-cascader :options="areaOptions"
:props="{label: 'name', value: 'code', checkStrictly: true}"
v-model="area"
clearable
style="width: 300px;"
@change="selectArea"/>
</el-form-item>
<el-form-item label="已选择">
<view class="tags">
@@ -93,33 +96,69 @@
</el-form-item>
</el-form>
</view>
<div class="flex justify-between items-center w-1200 m-a">
<template v-if="ad13.length">
<el-carousel :height="`100px`" :style="{width: ad14.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad13" :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="ad14.length">
<el-carousel :height="`100px`" :style="{width: ad13.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad14" :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="sheet-list">
<el-table :data="list.rows" style="width: 100%">
<view class="flex justify-start items-center my-20">
<el-button @click="changeStatus(0)" type="primary" :plain="status === 1" round>正在询价</el-button>
<el-button @click="changeStatus(1)" type="primary" :plain="status === 0" round>合作成交
</el-button>
</view>
<el-table :data="list.rows" style="width: 100%" :loading="loading">
<el-table-column align="center" label="标题">
<template v-slot="{ row }">
<p class="text-main">{{ row.title }}</p>
</template>
</el-table-column>
<el-table-column prop="num" label="加工量"/>
<el-table-column align="center" label="采购企业">
<el-table-column prop="num" label="加工量" width="80"/>
<el-table-column align="center" label="采购企业" width="260">
<template v-slot="{ row }">
<p>{{
<p v-if="row.user">{{
row.user.accountType === 1 ? row.user.person.personName : row.user.company.companyName
}}</p>
</template>
</el-table-column>
<el-table-column align="center" label="加工产品交货地址">
<template v-slot="{ row }">
<p v-if="row.addressRegion && row.addressRegion.province">{{
row.addressRegion.province.name
}}{{ row.addressRegion.city.name }}{{
row.addressRegion.area.name
}}</p>
</template>
</el-table-column>
<el-table-column align="center" label="报价情况">
<template v-slot="{ row }">
<p>{{ `${row.quoteNum}家已报价` }}</p>
</template>
</el-table-column>
<el-table-column align="center" prop="_add_time_srt" label="发布时间"/>
<el-table-column align="center" prop="_add_time_str" label="发布时间"/>
<el-table-column align="center" label="操作">
<template v-slot="{ row }">
<el-button size="mini" type="primary" plain @click.native="toDetail(row._id)">
{{ vk.getVuex('$user.userInfo._id') === row.userId ? '查看' : '申请加工' }}
<el-button size="mini" type="primary" plain @click.native="toDetail(row._id)" v-if="status === 0">
{{ vk.getVuex('$user.userInfo._id') === row.userId ? '查看' : '申请合作' }}
</el-button>
<el-button size="mini" type="primary" plain @click.native="toDetail(row._id)" v-if="status === 1">
查看详情
</el-button>
</template>
</el-table-column>
@@ -136,6 +175,9 @@
</template>
<script>
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";
export default {
data() {
@@ -155,20 +197,46 @@ export default {
rows: [],
total: 0
},
pageSize: 20
pageSize: 20,
provinceData: provinces,
cityData: citys,
areaData: areas,
areaOptions: [],
area: [],
showAllProvince: true,
loading: true,
status: 0,
ad13: [],
ad14: [],
};
},
onLoad() {
onLoad(options) {
if (options && options.keyword) this.keyword = options.keyword
this.areaOptions = provinces.map(item => {
item.children = [];
return item
})
this.areaOptions.forEach((province, index) => {
citys[index].forEach(city => {
city.children = []
this.areaOptions[index].children.push(city)
})
})
this.areaOptions.forEach((province, index) => {
province.children.forEach((city, cityIndex) => {
this.areaOptions[index].children[cityIndex].children.push(...areas[index][cityIndex])
})
})
// this.search(1)
vk.callFunction({
url: 'client/spot/category/pub/getTree',
url: 'client/process/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.categoryTreeData = data.rows
this.allChildCate = []
this.categoryTreeData.forEach(item => {
item.children.forEach(child => {
console.log(child)
this.allChildCate.push(child)
})
})
@@ -178,34 +246,38 @@ export default {
this.getCompany()
},
methods: {
keywordSearch() {
this.checkCategoryList = []
this.checkCategoryNameList = []
this.search(1)
},
selectCate({_id, name}) {
if (_id === -1) {
this.checkCategoryList = []
this.checkCategoryNameList = []
return this.search(1)
}
const index = this.checkCategoryList.indexOf(_id)
console.log(_id, name, index)
if (index === -1) {
this.checkCategoryList.push(_id)
this.checkCategoryNameList.push(name)
this.checkCategoryList = [_id]
this.checkCategoryNameList = [name]
} else {
this.checkCategoryList.splice(index, 1)
this.checkCategoryNameList.splice(index, 1)
}
this.keyword = ''
this.search(1)
},
selectTexture(id) {
if (id === -1) this.checkTextureList = []
selectProvince(code) {
if (code === -1) this.checkProvinceList = []
else {
const index = this.checkTextureList.indexOf(id)
if (index === -1) this.checkTextureList.push(id)
else this.checkTextureList.splice(index, 1)
this.checkProvinceList = [code]
}
this.search(1)
},
selectCompany(id) {
if (id === -1) this.checkCompanyList = []
else {
const index = this.checkCompanyList.indexOf(id)
if (index === -1) this.checkCompanyList.push(id)
else this.checkCompanyList.splice(index, 1)
}
selectArea(e) {
this.area = e
this.checkProvinceList = e && e.length ? [e[0]] : []
this.search(1)
},
getCompany() {
@@ -226,12 +298,17 @@ export default {
url: '/pages/process/my'
})
},
toMyQuote() {
vk.navigateTo({
url: '/pages/process/quote/my'
})
},
async toRelease() {
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'
@@ -239,14 +316,30 @@ 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 {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/process/release'
})
@@ -257,7 +350,7 @@ export default {
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm && userInfo.authStatus === 1) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@@ -265,14 +358,22 @@ 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('/pages/user/user?menu=business-card');
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: `/pages/process/detail?id=${id}`
})
@@ -281,16 +382,22 @@ export default {
search(pageIndex = 1) {
vk.callFunction({
url: 'client/process/sheet/pub/getList',
title: '请求中...',
data: {
pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
companyList: this.checkCompanyList,
categoryIds: this.checkCategoryList
// companyList: this.checkCompanyList,
categoryIds: this.checkCategoryList.length ? this.checkCategoryList : null,
area: this.area,
provinceCodes: this.checkProvinceList,
status: this.status,
},
success: (data) => {
this.list = data
console.log(this.list)
this.loading = false
this.getAd13()
this.getAd14()
}
});
},
@@ -302,6 +409,78 @@ export default {
}
});
},
navTo(url) {
vk.navigateTo({url});
},
changeStatus(status) {
this.status = status
this.search(1)
},
async getAd13() {
this.ad13 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 13,
categoryIds: this.checkCategoryList.length ? this.checkCategoryList : null,
region: this.area && this.area.length ? this.area : (this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null)
}
})
if (res.data) this.ad13 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 1,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad13.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
async getAd14() {
this.ad14 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 14,
categoryIds: this.checkCategoryList.length ? this.checkCategoryList : null,
region: this.area && this.area.length ? this.area : (this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null)
}
})
if (res.data) this.ad14 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 2,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad14.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
},
computed: {
checkCategoryArr() {
@@ -311,12 +490,30 @@ export default {
arr.push({name})
})
this.checkProvinceList.forEach(item => {
arr.push({
...item
})
this.provinceData.forEach(item => {
if (this.checkProvinceList.includes(item.code) && (!this.area || this.area.length <= 1)) {
arr.push(item)
}
})
if (this.area && this.area.length > 1) {
const province = this.provinceData.find(item => item.code === this.area[0])
if (province) {
const nameArr = [province.name]
if (this.area.length > 1) {
const city = province.children && province.children.find(item => item.code === this.area[1])
if (city) {
nameArr.push(city.name)
if (this.area.length > 2) {
const area = city.children && city.children.find(item => item.code === this.area[2])
if (area) nameArr.push(area.name)
}
}
}
if (nameArr.length > 1) arr.push({name: nameArr.join('/')})
}
}
return arr
}
+95 -41
View File
@@ -12,13 +12,14 @@
</view> -->
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<!-- <el-carousel height="170px">-->
<!-- <el-carousel-item v-for="item in 4" :key="item">-->
<!-- <image class="carousel-img"-->
<!-- src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"-->
<!-- mode="aspectFill"></image>-->
<!-- </el-carousel-item>-->
<!-- </el-carousel>-->
<common-swiper page="process-mine" :height="200"/>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布加工单</el-button>
@@ -57,7 +58,8 @@ export default {
url: `client/process/sheet/pub/getList`,
data: {
...data, ...{
userId: vk.getVuex('$user.userInfo._id')
userId: vk.getVuex('$user.userInfo._id'),
isUser: true
}
},
success: (res) => {
@@ -76,16 +78,45 @@ export default {
}
})
},
customRightBtns: [{
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/process/detail?id=' + item._id);
}
},],
},
{
title: '删除',
icon: 'el-icon-delete',
type: 'primary',
onClick: (item) => {
this.$confirm('如果你要删除此条信息,之前其他客户填写的留言将无法查看', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.callFunction({
url: 'client/process/sheet/kh/delete',
title: '请求中...',
data: {
_id: item._id
},
}).then(res => {
this.$refs.table1.refresh()
})
})
}
},
],
// 表格字段显示规则
columns: [
{
key: "orderNo",
title: "单号",
type: "text",
},
{
key: "title",
title: "标题",
@@ -97,25 +128,33 @@ export default {
type: "text"
},
{
key: "productList",
title: "收货地",
key: "quoteNum",
title: "报价数",
type: "text",
minWidth: 200,
formatter: (val, row, column, index) => {
let str = ""
try {
str = val.map(item => {
const addressStr = item.address.region.province.name + "-" + item.address.region.city.name + "-" + item.address.region.area.name
return addressStr
}).join("/")
} catch (err) {
str = ""
}
return str
return `${val}家已报价`
}
},
// {
// key: "productList",
// title: "收货地",
// type: "text",
// minWidth: 200,
// formatter: (val, row, column, index) => {
// let str = ""
// try {
// str = val.map(item => {
// const addressStr = item.address.region.province.name + "-" + item.address.region.city.name + "-" + item.address.region.area.name
// return addressStr
// }).join("/")
// } catch (err) {
// str = ""
// }
//
// return str
// }
// },
// {
// key: "user",
// title: "采购单位",
// type: "text",
@@ -130,10 +169,9 @@ export default {
//
// },
{
key: "_add_time_srt",
title: "添加时间",
key: "_add_time_str",
title: "发布时间",
type: "time",
width: 160
},
],
@@ -167,31 +205,47 @@ export default {
url: '/pages/enquiry/my'
})
},
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.getCertUrl()
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('请完善名片信息', '提示', {
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card');
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
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 {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/process/release'
})
}
},
search(pageIndex) {
const categoryIds = []
+62 -32
View File
@@ -15,6 +15,7 @@
</view>
<view class="page-main">
<quote-remain-num v-if="reloaded" :amount="sheet.quoteAmount" type="process" :id="sheetId"/>
<vk-data-form
ref="form1"
v-model="form1.data"
@@ -24,9 +25,16 @@
:form-type="form1.props.formType"
:loading.sync="form1.props.loading"
:auto-close="true"
label-width="140px"
label-width="180px"
:show-cancel="false"
@success="onFormSuccess"
></vk-data-form>
:need-alert="false"
@fail="onFormFail"
>
<template v-slot:totalPrice>
<el-input v-model="form1.data.totalPrice" placeholder="请输入货款总价" @change="formatNumber"></el-input>
</template>
</vk-data-form>
</view>
<common-footer></common-footer>
@@ -37,13 +45,17 @@
export default {
data() {
return {
reloaded: false,
sheet: null,
sheetId: null,
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
// radio: 1,
// checkbox : [1,2]
sheetId: null
sheetId: null,
totalPrice: null,
},
// 表单属性
props: {
@@ -51,14 +63,15 @@ export default {
action: "client/process/quote/kh/addQuote",
// 表单字段显示规则
columns: [
{key: "totalPrice", title: "货款总价", type: "number"},
{key: "totalPriceStr", title: "人民币大写", type: "text"},
{key: "remark", title: "报价单详情", type: "editor"},
{key: "totalPrice", title: "加工总价(人民币:元)", type: "html"},
{key: "files", title: "附件", type: "file", accept: '.pdf', tips: '仅限PDF格式附件或合同,非协议合同将读取为合同附件,请仔细核查'},
{key: "remark", title: "报价单详情", type: "textarea"},
{key: "supplierExt", title: "合同补充条款", type: "textarea"},
],
// 表单验证规则
rules: {
text: [
{required: true, message: "text不能为空", trigger: "change"},
totalPrice: [
{required: true, message: "货款总价不能为空", trigger: "change,blur"},
]
},
// add 代表添加 update 代表修改
@@ -84,7 +97,7 @@ export default {
this.sheetId = sheetId
this.form1.data.sheetId = sheetId
// this.getEnquiryDetail()
this.getDetail()
},
computed: {
@@ -97,7 +110,26 @@ export default {
},
methods: {
onFormSuccess() {
vk.redirectTo({url: `/pages/process/detail?id=${this.sheetId}`})
},
onFormFail(data) {
if (data.data.code === 12) {
this.$confirm(data.data.msg, '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.redirectTo({url: `/pages/user/user?menu=grade`})
})
}else {
this.$confirm(data.data.msg, '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.navigateBack()
})
}
},
// 提交报价单
async submit() {
@@ -127,29 +159,27 @@ export default {
/**
* 获取询价单详情
*/
// getEnquiryDetail() {
// vk.callFunction({
// url: 'client/progress/sheet/pub/getDetail',
// title: '请求中...',
// data: {
// _id: this.sheetId
// },
// success: (res) => {
//
// res.data.productList.forEach(item => {
// item.unitPrice = 0
// const keys = Object.keys(item.extraAttributes)
// keys.forEach(citem => {
// item.extraAttributes[citem] = JSON.parse(item.extraAttributes[
// citem])
// })
// })
//
//
// this.sheet = res.data
// }
// });
// }
getDetail() {
vk.callFunction({
url: 'client/process/sheet/pub/getInfo',
title: '请求中...',
data: {
id: this.sheetId
},
success: (res) => {
this.sheet = res
}
});
},
formatNumber(e){
this.form1.data.totalPrice = parseFloat(this.form1.data.totalPrice).toFixed(2)
}
},
onShow() {
this.reloaded = false
setTimeout(() => {
this.reloaded = true
}, 500)
}
}
</script>
+290
View File
@@ -0,0 +1,290 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<!-- <view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
</el-breadcrumb>
</view> -->
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布加工单</el-button>
<!-- <el-button @click="toMyEnquiry" type="primary" round plain>我发布的加工单</el-button>-->
</el-row>
</view>
</view>
<!-- 加工单列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns"
:pagination="true"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
categoryTreeData: [],
checkCategoryList: [],
checkProvinceList: [],
keyword: '',
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: (obj = {}) => {
let {data, success, fail, complete} = obj;
vk.callFunction({
url: `client/process/quote/kh/getList`,
data: {
...data, ...{
userId: vk.getVuex('$user.userInfo._id')
}
},
success: (res) => {
if (typeof success === "function") {
success({
rows: res.rows, // 列表数据
total: res.total, // 总记录数
});
}
},
fail: (err => {
}),
complete: (res) => {
if (typeof complete === "function") complete(res);
}
})
},
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/process/detail?id=' + item.sheetId);
}
},
],
// 表格字段显示规则
columns: [
{
key: "sheet.title",
title: "加工标题",
type: "text",
},
{
key: "sheet.num",
title: "加工量",
type: "text"
},
{
key: "totalPrice",
title: "金额",
type: "text",
formatter: (val, row, column, index) => {
return `${val}元`
}
},
{
key: "remark",
title: "备注",
type: "text"
},
{
key: "_add_time_str",
title: "发布时间",
type: "time",
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
// this.search(1)
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.categoryTreeData = data.rows
for (var i = 0; i < data.rows.length; i++) {
this.checkCategoryList.push([])
}
}
});
},
methods: {
toMyEnquiry() {
vk.navigateTo({
url: '/pages/enquiry/my'
})
},
async toRelease() {
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(userInfo.businessCard)) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
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 {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/process/release'
})
}
},
search(pageIndex) {
const categoryIds = []
this.checkCategoryList.forEach(item => {
item.forEach(sitem => {
categoryIds.push(sitem._id)
})
})
let provinceCodes = this.checkProvinceList.map(item => item.code)
if (provinceCodes.includes(9999)) {
provinceCodes = []
}
vk.callFunction({
url: 'client/process/sheet/pub/getList',
data: {
pageIndex: pageIndex,
pageSize: 20,
keyword: this.keyword,
},
success: (data) => {
console.log('data: ', data);
this.goodsData = data
}
});
},
},
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryList.forEach(item => {
arr.push(...item)
})
this.checkProvinceList.forEach(item => {
arr.push({
...item
})
})
return arr
}
}
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
.el-tag {
margin-right: 10px;
}
}
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
</style>
+431 -296
View File
@@ -31,43 +31,74 @@
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
加工信息
加工分类
</view>
</view>
<view class="sales-code flex justify-end items-center">
<text>金九信业务员编号:</text>
<el-input v-model="form1.data.salesCode" placeholder="请输入编号没有则留空" size="small"/>
</view>
</view>
<view class="p-30">
<el-form-item label="品名/材质" required>
<el-input v-model="form1.data.title" disabled/>
</el-form-item>
<!-- <el-form-item label="品名/材质" required>-->
<!-- <el-input v-model="form1.data.title" disabled/>-->
<!-- </el-form-item>-->
<view class="flex justify-start items-center my-20">
<text class="text-30">点击添加加工商品</text>
<text class="text-gray text-25">(至少选择1个商品,最多选择5个商品)</text>
<text class="text-gray text-25">(请选择1个类别)</text>
</view>
<view class="flex justify-start items-start flex-wrap mb-40">
<text class="text-35 mr-25 mb-20 pointer"
:class="[form1.data.productList.includes(item._id) ? 'text-main' : '']"
<text class="product-item"
:class="[form1.data.productList.includes(item._id) ? 'product-item-active' : '']"
v-for="(item, index) in productList"
:key="index" @click="selectGoods(item)">{{ item.name }}
</text>
</view>
<view class="form-title-wrap mb-25">
<view class="goods-info-title">
<view class="form-title">
加工信息
</view>
</view>
<view class="sales-code flex justify-end items-center">
<text>金久信业务员编号:</text>
<el-input v-model="form1.data.salesCode" placeholder="请输入编号没有则留空" size="small"/>
</view>
</view>
<el-form-item label="加工产品简述:">
<el-input v-model="form1.data.detail" placeholder="如产品名称、加工内容等"/>
</el-form-item>
<el-form-item label="加工量" required>
<el-input v-model="form1.data.num" type="number"/>
<el-input v-model="form1.data.num"/>
</el-form-item>
<el-form-item label="附件内容" required>
<!-- <el-upload action="#" :before-upload="upload">-->
<vk-data-upload v-model="form1.data.files" v-if="!form1.data.attachment" :limit="1" accept="image/*,application/pdf"/>
<data-file theme="two-tone" size="24" :fill="['#333' ,'#ffffff']" strokeLinecap="square"
v-else/>
<vk-data-upload v-model="form1.data.files"
:on-preview="previewUpload"
accept="*" list-type="text"/>
<!-- <data-file theme="two-tone" size="24" :fill="['#333' ,'#ffffff']" strokeLinecap="square"-->
<!-- v-else/>-->
<!-- <el-image v-else :url="form1.data.attachment" fit="cover"/>-->
</el-form-item>
</view>
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
加工产品交货地址
</view>
</view>
</view>
<view class="my-25">
<el-row :gutter="10">
<el-col :span="6">
<vk-data-input-address v-model="form1.data.addressRegion" placeholder="请选择省市区"
:level="3" class="w-100p"/>
</el-col>
<el-col :span="18">
<el-input v-model="form1.data.addressDetail" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</view>
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
@@ -84,9 +115,15 @@
<view class="pos-r">
<el-input type="textarea" v-model="form1.data.remark" :disabled="!hasRequire"
placeholder="复杂加工提供图纸、简单加工详细说明加工内容,如:镀锌、刷漆、防腐、折弯、裁剪等"
:rows="5"/>
:rows="15"/>
<view class="remark-upload">
<i class="el-icon-plus"/>
<view class="flex flex-col justify-start items-start">
<p class="tips mb-20">仅限PDF格式附件或合同,非协议合同将读取为合同附件,请仔细核查</p>
<vk-data-upload v-model="form1.data.multiFiles" accept=".pdf"
:on-preview="previewUpload"
list-type="text">
</vk-data-upload>
</view>
</view>
</view>
</view>
@@ -98,37 +135,93 @@
</view>
</view>
</view>
<view class="p-30">
<view class="mb-20">
<view class="my-20">
<el-radio-group v-model="form1.data.invoice">
<el-radio :label="true">含税</el-radio>
<el-radio :label="false">不含税</el-radio>
</el-radio-group>
</view>
<template v-if="form1.data.invoice">
<view class="mb-20 flex justify-start items-center">
<view class="my-20 flex justify-start items-center" v-if="form1.data.invoice">
<text>开票时间:</text>
<el-radio-group v-model="form1.data.writeInvoiceTime">
<el-radio v-for="(item, index) in WRITE_INVOICE_TIME" :key="index" :label="index">
{{ item }}
</el-radio>
<el-radio :label="0">付款当月(限20号之前付款,20号之后付款次月开票)</el-radio>
<el-radio :label="1">付款后次月</el-radio>
<el-radio :label="2">付款前</el-radio>
</el-radio-group>
</view>
<view class="mb-20 flex justify-start items-center">
<text>发票种类:</text>
<el-radio-group v-model="form1.data.invoiceType">
<el-radio v-for="(item, index) in INVOICE_TYPE" :key="index" :label="index">{{
item
}}
</el-radio>
</el-radio-group>
<view class="ml-20 flex justify-start items-center">
<text class="label-width">其他要求:</text>
<el-input v-model="form1.data.invoiceOther" placeholder="请输入" size="small"/>
<view class="mb-20 flex justify-start items-center" v-if="form1.data.invoice">
<view class="flex-1 flex justify-start items-center">
<text style="width: 30%">纳税人身份:</text>
<el-select v-model="form1.data.taxType" placeholder="纳税人身份" style="width: 100%">
<el-option
v-for="item in ['一般纳税人', '小规模公司', '个体工商户']"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</view>
<view class="flex-1 flex justify-start items-center ml-20">
<text style="width: 30%">发票种类:</text>
<el-select v-model="form1.data.invoiceType" placeholder="发票种类" style="width: 100%">
<el-option
v-for="item in ['专用发票', '普通发票']"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</view>
</view>
</template>
<view class="mb-20 flex justify-start items-center" v-if="form1.data.invoice">
<view class="flex-1 flex justify-start items-center">
<text style="width: 30%">税率:</text>
<el-select v-model="form1.data.taxRate" placeholder="税率" style="width: 100%">
<el-option
v-for="item in ['13%', '9%', '6%', '4%', '3%', '1%']"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</view>
<view class="ml-20 flex justify-start items-center flex-1 ml-20">
<text style="width: 30%">手动填写税票要求:</text>
<el-input v-model="form1.data.invoiceOther" placeholder="如:一般纳税人 专用发票 税率13%"
size="small"/>
</view>
</view>
<!-- <view class="p-30">-->
<!-- <view class="mb-20">-->
<!-- <el-radio-group v-model="form1.data.invoice">-->
<!-- <el-radio :label="true">含税</el-radio>-->
<!-- <el-radio :label="false">不含税</el-radio>-->
<!-- </el-radio-group>-->
<!-- </view>-->
<!-- <template v-if="form1.data.invoice">-->
<!-- <view class="mb-20 flex justify-start items-center">-->
<!-- <text>开票时间:</text>-->
<!-- <el-radio-group v-model="form1.data.writeInvoiceTime">-->
<!-- <el-radio v-for="(item, index) in WRITE_INVOICE_TIME" :key="index" :label="index">-->
<!-- {{ item }}-->
<!-- </el-radio>-->
<!-- </el-radio-group>-->
<!-- </view>-->
<!-- <view class="mb-20 flex justify-start items-center">-->
<!-- <text>发票种类:</text>-->
<!-- <el-radio-group v-model="form1.data.invoiceType">-->
<!-- <el-radio v-for="(item, index) in INVOICE_TYPE" :key="index" :label="index">{{-->
<!-- item-->
<!-- }}-->
<!-- </el-radio>-->
<!-- </el-radio-group>-->
<!-- <view class="ml-20 flex justify-start items-center">-->
<!-- <text class="label-width">其他要求:</text>-->
<!-- <el-input v-model="form1.data.invoiceOther" placeholder="请输入" size="small"/>-->
<!-- </view>-->
<!-- </view>-->
<!-- </template>-->
<!-- </view>-->
<view class="form-title-wrap">
<view class="goods-info-title">
@@ -146,6 +239,9 @@
<el-checkbox label="销售清单"/>
<el-checkbox label="磅重"/>
</el-checkbox-group>
<view style="margin-left: 30px">
<el-checkbox label="全选" @change="changeDocumentAll"/>
</view>
</view>
<view class="mb-20 flex justify-start items-center">
<text class="label-width">其他要求:</text>
@@ -157,6 +253,10 @@
<el-radio :label="false">无</el-radio>
<el-radio :label="true">有</el-radio>
</el-radio-group>
<view class="ml-20 flex justify-start items-center" v-if="form1.data.transportLimit">
<el-input v-model="form1.data.otherTransportRequest" placeholder="请输入运输限制说明"
style="width: 400px"/>
</view>
</view>
</view>
@@ -171,8 +271,8 @@
<view class="mb-20 flex justify-start items-center">
<text>交易模式:</text>
<el-radio-group v-model="form1.data.tradeMethod">
<el-radio :label="0">自主交易</el-radio>
<el-radio :label="1">金久信公证</el-radio>
<el-radio :label="0">自主交易</el-radio>
</el-radio-group>
</view>
</view>
@@ -187,22 +287,23 @@
<view class="p-30">
<view class="mb-20 flex justify-start items-center">
<text>付款方式:</text>
<el-radio v-model="form1.data.payMethod" :label="0">预付</el-radio>
<el-radio v-model="form1.data.payMethod" :label="0" @change="changePayMethod(0)">预付</el-radio>
<view class="flex justify-start items-center">
<el-input v-model="form1.data.advancePayRate"
<el-input-number min="0" max="95" v-model="form1.data.advancePayRate" :disabled="form1.data.payMethod !== 0"
class="advance-pay-rate"/>
<text>%货到付全款</text>
<text>%加工验收合格后付全款</text>
</view>
<view class="mx-20">
<el-radio v-model="form1.data.payMethod" :label="1">货到验收后付款</el-radio>
<el-radio v-model="form1.data.payMethod" :label="1" @change="changePayMethod(1)">加工验收合格后付全款
</el-radio>
</view>
<el-radio v-model="form1.data.payMethod" :label="2">提货付全款</el-radio>
<!-- <el-radio v-model="form1.data.payMethod" :label="2" @change="changePayMethod(2)">加工验收合格后</el-radio>-->
<view class="mx-20 flex justify-start items-center">
<el-radio v-model="form1.data.payMethod" :label="3">信誉采购,货到签单后账期:</el-radio>
<el-input v-model="form1.data.reputationPayDay"
<el-radio v-model="form1.data.payMethod" :label="3" @change="changePayMethod(3)">加工验收合格后</el-radio>
<el-input v-model="form1.data.reputationPayDay" :disabled="form1.data.payMethod !== 3"
class="advance-pay-rate">
<template slot="suffix">天</template>
</el-input>
<text>天内支付全款</text>
</view>
</view>
<view class="mb-20 flex justify-start items-center">
@@ -218,11 +319,11 @@
<view class="mb-20 flex justify-start items-center">
<text>报价时限:</text>
<view class="flex justify-start items-center">
<el-date-picker
<el-date-picker :picker-options="pickerOptions"
v-model="form1.data.answerStartTime"
type="datetime"/>
<view class="mx-15">~</view>
<el-date-picker
<el-date-picker :picker-options="pickerOptions"
v-model="form1.data.answerEndTime"
type="datetime"/>
</view>
@@ -232,30 +333,48 @@
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
交易说明
交易保证金要求
</view>
</view>
</view>
<view class="p-30">
<view class="mb-20 flex justify-start items-center">
<text style="width: 140px">交保证金要求:</text>
<el-input v-model="form1.data.earnestMoney" placeholder="请输入交保证金要求(如无要求则留空)"/>
<text style="width: 140px">人民币金额≥</text>
<el-input-number :min="0" :precision="2" v-model="form1.data.earnestMoney"
placeholder="请输入交易保证金要求(如无要求则留空)"/>
</view>
</view>
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
简易合同备注和其他补充条款
合同条款
</view>
</view>
</view>
<view class="p-30">
<view class="mb-20 flex justify-start items-center">
<el-radio v-model="form1.data.signMethod" :label="0">法大大</el-radio>
<el-radio v-model="form1.data.signMethod" :label="1">线下签约</el-radio>
<el-radio v-model="form1.data.signMethod" :label="0">线上签约-标准合同</el-radio>
<el-radio v-model="form1.data.signMethod" :label="2">线上签约-双方协商合同</el-radio>
<el-radio v-model="form1.data.signMethod" :label="1" v-if="form1.data.tradeMethod === 0">
线下签约
</el-radio>
</view>
<view class="my-25" v-if="form1.data.signMethod === 2">
<view class="p-30">
<view class="mb-20 flex justify-start items-center">
<text style="width: 140px">合同附件:</text>
<vk-data-upload :on-preview="previewUpload" v-model="form1.data.contractAttachment" accept=".pdf"
list-type="text"/>
</view>
</view>
</view>
<view v-if="form1.data.signMethod === 0">
<view @click="openDownload" class="pointer my-25 text-main" v-if="form1.data.signMethod === 0">
点击查看标准合同
</view>
<view v-if="form1.data.signMethod === 0" class="mb-15">补充条款</view>
<view class="flex justify-start items-start border">
<view class="m-10 sign-method-header">违约责任:</view>
<view class="border-left m-10 pl-20 flex-1">
@@ -286,16 +405,95 @@
<view class="flex justify-start items-start border">
<view class="m-10 sign-method-header">采购方补充条款:</view>
<view class="border-left m-10 pl-20 flex-1">
供货方逾期供货承担采购方一切损失
<el-input v-if="form1.data.signMethod === 0" v-model="form1.data.supplementary"
placeholder="请输入采购方补充条款"/>
</view>
</view>
</view>
</view>
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
采购商信息
</view>
</view>
</view>
<view class="p-30">
<el-row :gutter="10" class="mb-20">
<el-col :span="12" class="flex justify-start items-center">
<text style="width: 160px">{{
userInfo.accountType === 2 ? '公司信息' : '个人信息'
}}:
</text>
<el-input v-model="form1.data.companyName" placeholder=""/>
</el-col>
<el-col :span="12" class="flex justify-start items-center">
<text style="width: 160px">{{
userInfo.accountType === 2 ? '公司联系方式' : '个人联系方式'
}}:
</text>
<el-input v-model="form1.data.companyMobile"/>
</el-col>
</el-row>
<el-row :gutter="10" class="mb-20">
<el-col :span="12" class="flex justify-start items-center">
<text style="width: 160px">授权业务咨询人:</text>
<el-select v-model="form1.data.businessName" 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="navTo">个人中心</text>
<text>添加</text>
</view>
</el-select>
</el-col>
<el-col :span="12" class="flex justify-start items-center">
<text style="width: 160px">业务咨询联系方式:</text>
<el-input v-model="form1.data.businessMobile" type="number" disabled/>
</el-col>
</el-row>
<el-row :gutter="10" class="mb-20">
<el-col :span="12" class="flex justify-start items-center">
<text style="width: 160px">授权业务签收人:</text>
<el-select v-model="form1.data.signName" placeholder="点击选择授权业务签收人"
class="w-100p" @change="selectSignContact">
<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="navTo">个人中心</text>
<text>添加</text>
</view>
</el-select>
</el-col>
<el-col :span="12" class="flex justify-start items-center">
<text style="width: 160px">授权业务签收人联系方式:</text>
<el-input v-model="form1.data.signMobile" type="number" disabled/>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12" class="flex justify-start items-center">
<text style="width: 160px">授权业务签收人身份证号:</text>
<el-input v-model="form1.data.signIdCard" type="number" disabled/>
</el-col>
</el-row>
</view>
</el-form>
<view class="form-footer">
<el-button type="" @click="draft">保存草稿</el-button>
<el-button type="primary" @click="submit">提交加工单</el-button>
<p class="text-main my-20">如发布错误无法重新编辑,请仔细检查后再提交。</p>
<!-- <el-button type="" @click="draft" :disabled="disabled">保存草稿</el-button>-->
<el-button type="primary" @click="submit" :disabled="disabled">提交加工单</el-button>
</view>
<!-- <el-divider content-position="left">其他设置</el-divider> -->
</view>
@@ -309,16 +507,27 @@ import Gap from "../../components/gap/gap.vue";
import {DataFile} from '@icon-park/vue'
import dayjs from "dayjs";
import {WRITE_INVOICE_TIME, INVOICE_TYPE} from '@/util'
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
export default {
components: {Gap, DataFile},
data() {
return {
addressOptions: [],
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now();
},
},
WRITE_INVOICE_TIME,
INVOICE_TYPE,
// 表单相关开始-----------------------------------------------------------
productList: [{}],
baseAttributes: [],
addressIndex: [null, null],
disabled: false,
commonContractUrl: '',
form1: {
// 表单请求数据,此处可以设置默认值
data: {
@@ -331,11 +540,14 @@ export default {
remark: '',
transportDocuments: [],
writeInvoiceTime: 0,
invoiceType: 0,
invoiceType: '',
invoiceOther: '',
taxType: '',
taxRate: '',
otherTransportDocuments: '',
transportLimit: false,
tradeMethod: 0,
otherTransportRequest: '',
tradeMethod: 1,
payMethod: 0,
advancePayRate: null,
reputationPayDay: null,
@@ -346,240 +558,57 @@ export default {
earnestMoney: '',
signMethod: 0,
attachment: '',
productList: []
productList: [],
multiFiles: [],
files: null,
contractAttachment: [],
supplementary: '',
companyName: '',
companyMobile: '',
businessName: '',
businessMobile: '',
addressDetail: '',
detail: '',
},
// 表单属性
props: {
// 表单请求地址
action: "client/process/sheet/kh/add",
// 表单字段显示规则
columns: [
{key: "", title: "加工信息", type: "bar-title"},
{key: "title", title: "标题", type: "text",},
{
key: "address",
title: "交货地点",
type: "object",
// justify: "start",
showLabel: false,
columns: [
{key: "region", title: "交货地点", type: "address",},
{key: "detail", title: "详细交货地址", type: "textarea",},
],
},
{
key: "files",
title: "附件",
type: "file",
tips: '上传自有加工单图片或文档,支持jpg/png/word/excel'
},
{key: "", title: "采购商其他要求", type: "bar-title"},
{key: "remark", title: "其他要求", type: "textarea",},
{key: "", title: "发票要求", type: "bar-title"},
{
key: "invoice", title: "发票要求", type: "radio",
data: [
{value: true, label: "含税"},
{value: false, label: "不含税"}
],
},
{
key: "writeInvoiceTime",
title: "开票时间",
type: "radio",
data: [
{
value: '付款当月(限20号之前付款,20号之后付款次月开票)',
label: "付款当月(限20号之前付款,20号之后付款次月开票)"
},
{value: '付款后次月', label: "付款后次月"},
{value: '付款前', label: "付款前"},
],
showRule: 'invoice == true'
},
{
key: "nvoiceType",
title: "发票种类",
type: "radio",
data: [
{value: '增值税专用发票13%', label: "增值税专用发票13%"},
{value: '增值税普通发票', label: "增值税普通发票"},
{value: '普通发票', label: "普通发票"},
],
showRule: 'invoice == true'
},
{key: "", title: "运输要求", type: "bar-title"},
{
key: "transportDocuments",
title: "随货资料",
type: "checkbox",
data: [
{value: '合格证', label: "合格证"},
{value: '检测报告', label: "检测报告"},
{value: '销售清单', label: "销售清单"},
{value: '磅重', label: "磅重"},
],
},
{key: "otherTransportDocuments", title: "其他资料", type: "text"},
{
key: "transportLimit",
title: "运输限制",
type: "text",
},
{key: "", title: "交易说明", type: "bar-title", component: 'custom-form-section'},
{
key: "tradeMethod",
title: "交易模式",
type: "radio",
data: [
{value: 1, label: "自主交易"},
{value: 0, label: "金久信公证"},
],
},
// {key: "", title: "交易说明", type: "bar-title"},
{
key: "payMethod",
title: "付款方式",
type: "radio",
data: [
{value: 1, label: "预付x%货到付全款"},
{value: 2, label: "货到验收后付款"},
{value: 3, label: "提货付全款"},
{value: 4, label: "信誉采购"},
{value: 5, label: "其他付款方式"},
],
},
{
key: "", title: "", type: 'group', showLabel: false, justify: "start", columns: [
{
key: "advancePayRate",
title: "预付百分比",
type: "percentage",
showRule: "payMethod==1"
},
{key: "otherPayMethod", title: "其他付款方式", type: "text", showRule: "payMethod==5"},
{
key: "reputationPayDay",
title: "货到签单后账期天数",
type: "number",
showRule: "payMethod==4",
rightText: '天'
},
]
},
{key: "answerTime", title: "报价时限", type: "date", dateType: "datetime"},
{key: "earnestMoney", title: "保证金要求", type: "text"},
{key: "", title: "合同要求", type: "bar-title"},
{
key: 'signMethod', title: '签约方式', type: 'radio', data: [
{value: 0, label: "法大大"},
{value: 1, label: "线下签约"},
]
},
{
key: 'contractType', title: '合同选择', type: 'radio', showRule: 'signMethod==0', data: [
{value: 0, label: "标准合同模板"},
{value: 1, label: "自定义合同"},
]
},
{
key: "breachLiability",
title: "违约责任",
type: "textarea",
readonly: true,
showRule: 'signMethod==0&&contractType==0'
},
{
key: "solveDispute",
title: "解决纠纷的方法",
type: "textarea",
readonly: true,
showRule: 'signMethod==0&&contractType==0'
},
{
key: "forceMajeure",
title: "不可抗力",
type: "textarea",
readonly: true,
showRule: 'signMethod==0&&contractType==0'
},
{
key: "contracOther",
title: "其他",
type: "textarea",
readonly: true,
showRule: 'signMethod==0&&contractType==0'
},
{
key: "buyerSupplement",
title: "采购方补充条款",
type: "textarea",
readonly: true,
showRule: 'signMethod==0&&contractType==0'
},
{
key: "sellerSupplement",
title: "供应方补充条款",
type: "textarea",
showRule: 'signMethod==0&&contractType==0'
},
// {key: "", title: "采购商信息", type: "bar-title"},
{
key: "files",
title: "附件文档",
type: "file",
buttonText: "点击上传",
limit: 9,
accept: ".jpg,.png,.xlsx,.doc,.docx",
tips: '上传自有采购单图片或文档,支持jpg/png/word/excel'
},
],
// 表单验证规则
rules: {
title: [
{required: true, message: '标题不能为空', trigger: ["change", "blur"]}
],
invoice: [
{required: true, message: '发票要求不能为空', trigger: ["change", "blur"]}
],
writeInvoiceTime: [
{required: true, message: '开票时间不能为空', trigger: ["change", "blur"]}
],
nvoiceType: [
{required: true, message: '发票类型不能为空', trigger: ["change", "blur"]}
],
},
// add 代表添加 update 代表修改
formType: "add",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false,
beforeAction: (formData) => {
formData.productList = JSON.parse(JSON.stringify(this.productList))
return formData
}
}
},
// 表单相关结束-----------------------------------------------------------
hasRequire: false
hasRequire: false,
contactList: [],
userInfo: null
};
},
onLoad() {
this.addressOptions = provinces.map(item => {
item.children = [];
return item
})
this.addressOptions.forEach((province, index) => {
citys[index].forEach(city => {
this.addressOptions[index].children.push(city)
})
})
this.getProductList()
this.getCommonContractUrl()
this.getContactList()
},
onShow() {
this.userInfo = vk.getVuex('$user.userInfo')
this.form1.data.companyName = this.userInfo.accountType === 2 ? this.userInfo.company?.companyName : this.userInfo.person?.personName
this.form1.data.companyMobile = this.userInfo.accountType === 2 ? this.userInfo.company?.mobile : this.userInfo.person?.mobile
},
methods: {
getProductList() {
this.productList = []
vk.callFunction({
url: 'client/spot/category/pub/getList',
url: 'client/process/category/pub/getList',
data: {
whereJson: {
level: 1
}
},
}).then(({data}) => {
data.forEach(item => {
if (item.parent_id) this.productList.push(item)
this.productList.push(item)
})
})
},
@@ -597,21 +626,55 @@ export default {
this.submitAll()
},
async submitAll() {
if (!this.form1.data.title) return this.$message({message: '请选择加工商品', type: 'error'})
if (!this.form1.data.num) return this.$message({message: '请输入加工量', type: 'error'})
if (!this.form1.data.addressRegion || !this.form1.data.addressDetail) return this.$message({
message: '请选择地址',
type: 'error'
})
if (!this.form1.data.answerEndTime || !this.form1.data.answerStartTime) return this.$message({
message: '请选择报价时限',
type: 'error'
})
if (dayjs(this.form1.data.answerEndTime).isBefore(this.form1.data.answerStartTime)) return this.$message({
message: '报价结束时限不能早于开始时间',
type: 'error'
})
if (this.form1.data.payMethod === 0 && !this.form1.data.advancePayRate) return this.$message({
message: '请填写预付比例',
type: 'error'
})
if (this.form1.data.payMethod === 3 && !this.form1.data.reputationPayDay) return this.$message({
message: '请填写回款日期',
type: 'error'
})
// if (this.addressIndex[1])
// let city, province
// this.addressOptions.forEach((provinceItem, index) => {
// provinceItem.children.forEach(cityItem => {
// if (cityItem.code === this.addressIndex[1]) {
// city = cityItem
// province = {code: provinceItem.code, name: provinceItem.name}
// }
// })
// })
// this.$refs.form1.submitForm()
this.disabled = true
vk.callFunction({
url: this.form1.props.action,
url: 'client/process/sheet/kh/add',
data: {
...this.form1.data, ...{
orderNo: dayjs().format('YYYYMMDDHHmm') + Math.ceil((Math.random() * 1000))
orderNo: dayjs().format('YYYYMMDDHHmm') + Math.ceil((Math.random() * 1000)),
}
}
}).then(() => {
this.disabled = false
this.$message({
message: "已提交",
message: "您的信息已经提交,等待管理员审核,请您耐心等待!",
type: 'success'
})
setTimeout(() => {
vk.navigateBack()
vk.redirectTo({url: '/pages/process/list'});
}, 1500)
})
},
@@ -637,18 +700,70 @@ export default {
console.log(file)
},
selectGoods(item) {
const index = this.form1.data.productList.indexOf(item._id)
if (this.form1.data.productList.length === 5 && index === -1) return this.$message({
message: "最多选择5个商品",
type: 'error'
})
if (index === -1) this.form1.data.productList.push(item._id)
else this.form1.data.productList.splice(index, 1)
// const index = this.form1.data.productList.indexOf(item._id)
// if (this.form1.data.productList.length === 5 && index === -1) return this.$message({
// message: "最多选择5个商品",
// type: 'error'
// })
// if (index === -1) this.form1.data.productList.push(item._id)
// else this.form1.data.productList.splice(index, 1)
this.form1.data.productList = [item._id]
const list = []
this.productList.forEach(item => {
if (this.form1.data.productList.includes(item._id)) list.push(item.name)
})
this.form1.data.title = list.join()
},
async getCommonContractUrl() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '657d36befe975f63af1f24e7'
},
})
this.commonContractUrl = res.content
},
openDownload() {
window.open(this.commonContractUrl)
},
async getContactList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.contactList = rows
},
navTo() {
vk.navigateTo({url: '/pages/user/user?menu=business-contact'})
},
selectContact(name) {
const contact = this.contactList.find(item => item.name === name)
this.form1.data.businessMobile = contact.phone
},
selectSignContact(name) {
const contact = this.contactList.find(item => item.name === name)
this.form1.data.signMobile = contact.phone
this.form1.data.signIdCard = contact.idCard
},
changePayMethod(payMethod) {
if ([1, 2].includes(payMethod)) {
this.form1.data.advancePayRate = null
this.form1.data.reputationPayDay = null
}
},
changeDocumentAll() {
if (this.form1.data.transportDocuments.length !== 4) {
this.form1.data.transportDocuments = ['合格证', '检测报告', '销售清单', '磅重']
} else this.form1.data.transportDocuments = []
},
previewUpload({url}) {
let openUrl = url
const userAgent = window.navigator.userAgent.toLowerCase();
if (userAgent.match(/micromessenger/i)) {
window.open(`https://www.jinjiuxinzg.cn/pdfjs/web/viewer.html?file=${encodeURIComponent(openUrl)}`)
} else {
window.open(openUrl)
}
}
}
@@ -656,8 +771,6 @@ export default {
</script>
<style lang="scss" scoped>
@import "@/common/css/app.scss";
.form-view {
width: 1200px;
margin: 0 auto;
@@ -687,8 +800,8 @@ export default {
}
.form-footer {
height: 40px;
line-height: 40px;
//height: 40px;
//line-height: 40px;
background: #fff;
padding-top: 0;
text-align: center;
@@ -709,10 +822,10 @@ export default {
.form-title {
padding-left: 10px;
color: $--color-primary;
color: #A92924;
font-size: 18px;
line-height: 18px;
border-left: 4px solid $--color-primary;
border-left: 4px solid #A92924;
}
.enquiry-no {
@@ -766,10 +879,32 @@ export default {
}
.advance-pay-rate {
width: 100px;
width: 200px;
}
.sign-method-header {
width: 120px;
}
.product-item {
font-size: 35rpx;
margin: 10rpx;
padding: 20rpx;
cursor: pointer;
}
.product-item:hover {
background-color: #f1c7c7;
color: #a92924;
border-radius: 5px;
}
.product-item-active {
background-color: #f1c7c7;
color: #a92924;
border-radius: 5px;
}
</style>
+293 -187
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">
<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">
{{ product.user.company.companyName }}
<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>
<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>
</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,27 @@
</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" v-if="spotAdList.length > 0">
<div class="part-head">
<h3>相关推荐</h3>
</div>
<view class="spot-ad-list">
<image v-for="(item, index) in spotAdList" :key="index"
@click="adJump(item)"
class="spot-ad-item pointer"
:src="item.swiper"
mode="aspectFill"/>
</view>
</view>
<view class="card-body">
<div class="part-head">
<h3>已收到的合作申请</h3>
@@ -84,7 +130,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 +140,23 @@
</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
<text class="flex-1" v-if="item.user.accountType === 2">{{
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" v-else>个人用户</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 +165,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 +217,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 +262,53 @@ export default {
},
cooperateList: []
},
spotAdList: [],
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: "姓名",
type: "text",
readonly: true,
disabled: true
},
// {
// key: "idCard",
// title: "身份证号",
// type: "text",
// readonly: true,
// disabled: true
// },
columns: [
{
key: "mobile",
title: "电话",
type: "text",
readonly: true,
disabled: true
},
]
},
{
key: "company",
title: "企业信息",
type: "object",
showLabel: false,
showRule: (formData) => {
return formData.company.companyName != null
},
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
return parseInt(vk.getVuex('$user.userInfo.accountType')) === 2
},
columns: [{
key: "personName",
title: "代理人",
},
{
key: "name",
title: "联系人姓名",
type: "text",
readonly: true,
disabled: true
},
// {
// key: "idCard",
// title: "代理人身份证号",
// type: "text",
// readonly: true,
// disabled: true
// },
{
key: "mobile",
title: "代理人电话",
title: "联系人电话",
type: "text",
readonly: true,
disabled: true
},
]
},
{
key: "remark",
title: "备注",
title: "合作留言",
type: "textarea",
maxlength: 200,
showWordLimit: true,
@@ -293,7 +316,8 @@ export default {
],
// 表单验证规则
rules: {
text: [{
text: [
{
required: true,
message: "text不能为空",
trigger: "change"
@@ -323,55 +347,54 @@ export default {
// 表格数据
data: [],
// 表格字段显示规则
columns: [{
key: "subjectName",
columns: [
{
key: "user.company.companyName",
title: "企业",
type: "text",
formatter: (val, row, column, index) => {
if (val) {
if (vk.getVuex('$user.userInfo._id') === this.product.userId) {
return val
}
return val.slice(0, 2) + "******";
}
if (row.user.accountType === 1) return '个人用户'
return ''
}
},
{
key: "name",
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);
}
return val.slice(0, 1) + "**";
}
},
{
key: "subjectMobile",
key: "mobile",
title: "联系方式",
type: "text",
width: 120,
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
}
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: "remark",
title: "合作留言",
type: "textarea",
},
{
key: "_add_time",
title: "申请时间",
type: "time",
},
],
customRightBtns: [{
@@ -389,23 +412,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 +425,85 @@ 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)
}
})
}
this.getSpotAd()
}
});
},
async getSpotAd() {
this.spotAdList = []
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 36
}
})
if (res.data) this.spotAdList = res.data
},
adJump(item) {
if (item.spotGoodsId) {
if (item.spotGoodsId === this.product._id) return
this.navTo(`/pages/spot/goods/detail?id=${item.spotGoodsId}`)
} else if (item.type === 'goods' && item.goodsId) {
this.navTo(`/pages/index/shop/detail?id=${item.goodsId}`)
} else if (item.companyId) {
this.navTo(`/pages/yellowPage/info?id=${item.companyId}`)
}
},
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 +511,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 +539,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: {
@@ -500,6 +593,19 @@ export default {
.card-body-address {
font-size: 14px;
}
.spot-ad-list {
display: flex;
flex-wrap: wrap;
gap: 16px;
}
.spot-ad-item {
width: calc(50% - 8px);
height: 100px;
border-radius: 6px;
overflow: hidden;
}
}
.card-header {
+288 -35
View File
@@ -12,13 +12,7 @@
</view> -->
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<common-swiper page="spot"/>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布现货</el-button>
@@ -33,15 +27,15 @@
<view class="filter-outer">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词" class="border-bottom pb-30">
<el-input @keyup.enter.native="search(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
<el-input @keyup.enter.native="keywordSearch" clearable placeholder="输入关键字搜索" v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
<el-button @click="search(1)" type="primary" slot="append" style="border-radius: 0">搜索
<el-button @click="keywordSearch" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
</el-input>
</el-form-item>
<el-form-item label="现货分类" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="clickedCateIndex = -1" class="pointer mr-25"
<text @click="selectCate(-1)" class="pointer mr-25"
:class="[clickedCateIndex === -1 ? 'text-main selected-cate' : '']">全部
</text>
<view v-for="(item, index) in categoryTreeData" :key="index">
@@ -68,7 +62,7 @@
</template>
</view>
</el-form-item>
<el-form-item label="城市" class="border-bottom pb-30">
<el-form-item label="地区" class="border-bottom pb-30">
<view class="flex justify-start items-center flex-wrap">
<text @click="selectProvince(-1)" class="pointer mr-25 flex-grow-0"
:class="[checkProvinceList.length === 0 ? 'text-main selected-cate' : '']">全国
@@ -80,7 +74,25 @@
{{ item.name }}
</text>
</view>
<text @click="showAllProvince = !showAllProvince" class="pointer mr-25">查看更多
</view>
<view class="child-cate flex justify-start items-center flex-wrap" v-if="selectedProvince">
<text @click="selectCity(-1)" class="pointer mr-25"
:class="[checkCityList.length === 0 ? 'text-main' : '']">全部城市
</text>
<text class="pointer mr-25" @click="selectCity(item.code)"
:class="[checkCityList.includes(item.code) ? 'text-main' : '']"
v-for="(item, index) in currentCityList" :key="`city-${index}`">
{{ item.name }}
</text>
</view>
<view class="child-cate flex justify-start items-center flex-wrap" v-if="selectedCity">
<text @click="selectArea(-1)" class="pointer mr-25"
:class="[checkAreaList.length === 0 ? 'text-main' : '']">全部区县
</text>
<text class="pointer mr-25" @click="selectArea(item.code)"
:class="[checkAreaList.includes(item.code) ? 'text-main' : '']"
v-for="(item, index) in currentAreaList" :key="`area-${index}`">
{{ item.name }}
</text>
</view>
</el-form-item>
@@ -92,30 +104,70 @@
</el-form>
</view>
<div class="flex justify-between items-center w-1200 m-a">
<template v-if="ad9.length">
<el-carousel :height="`100px`" :style="{width: ad10.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad9" :key="index" :style="{width: '100%'}">
<image @click="adJump(item)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
<template v-if="ad10.length">
<el-carousel :height="`100px`" :style="{width: ad9.length ? '50%' : '100%'}" class="m-a">
<el-carousel-item v-for="(item, index) in ad10" :key="index" :style="{width: '100%'}">
<image @click="adJump(item)"
class="pointer carousel-img" :src="item.swiper" mode="aspectFill"
:style="{width: '100%'}"/>
</el-carousel-item>
</el-carousel>
</template>
</div>
<!-- 商品列表 -->
<template v-if="!loading">
<template v-if="goodsData.rows.length > 0">
<view class="goods-list">
<view v-for="(item, index) in goodsData.rows" :key="index" class="goods"
:style="{marginRight:( (index + 1) % 5 === 0 && index > 0) ? 0 : '28px'}">
<view class="top" v-if="item.isTop">特别推荐</view>
<view class="top" v-if="!item.isTop && index < 10">最新</view>
<view class="goods-title">{{ item.name }}</view>
<view class="goods-stock mt-40">现货库存:{{ item.stock }}吨</view>
<view class="goods-address text-gray">供货地:{{ item.addressStr }}</view>
<!-- <view class="goods-image">-->
<!-- <image :src="item.user.businessCard.logo" mode="aspectFit"></image>-->
<!-- </view>-->
<view v-if="item.user.accountType == 1" class="goods-company">{{ item.user.person.personName }}</view>
<view v-if="item.user.accountType == 2" class="goods-company">{{ item.user.company.companyName }}</view>
<el-button @click="vk.navigateTo('/pages/spot/goods/detail?id=' + item._id);" type="primary" plain
<view class="goods-company">
<template v-if="item.user">
<view v-if="item.user.accountType == 1">{{
item.user.person.personName.replace(/^(.).*$/, "$1**")
}}
</view>
<view v-if="item.user.accountType == 2">{{
item.user.company.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6")
}}
</view>
</template>
</view>
<el-button @click="vk.navigateTo('/pages/spot/goods/detail?id=' + item._id);" type="primary"
plain
class="empty-bg-plain-btn"
size="small">立即查看
</el-button>
</view>
</view>
</template>
<view v-else class="flex justify-center items-center flex-col">
<data-null theme="outline" size="24" fill="#9b9b9b" strokeLinecap="square"/>
<text class="text-gray mt-20">暂无内容</text>
</view>
</template>
<view class="paginatio">
<el-pagination
:page-size="pageSize"
:current-page="goodsData.page"
:current-page="pageIndex"
@current-change="search"
background
layout="prev, pager, next"
@@ -129,30 +181,44 @@
<script>
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 {DataNull} from '@icon-park/vue'
export default {
components: {DataNull},
data() {
return {
pageSize: 20,
pageIndex: 1,
categoryTreeData: [],
allChildCate: [],
checkCategoryList: [],
clickedCateIndex: -1,
provinceData: provinces,
cityData: citys,
areaData: areas,
checkProvinceList: [],
checkCityList: [],
checkAreaList: [],
keyword: '',
goodsData: {
total: 0,
rows: []
},
showAllProvince: false
showAllProvince: true,
loading: false,
ad9: [],
ad10: [],
};
},
onLoad(options) {
if (options && options.keyword) this.keyword = options.keyword
},
onShow() {
this.search(1)
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.categoryTreeData = data.rows
@@ -167,26 +233,57 @@ export default {
},
methods: {
selectCate(id) {
if (id === -1) {
this.clickedCateIndex = -1
this.checkCategoryList = []
} else {
const index = this.checkCategoryList.indexOf(id)
if (index === -1) this.checkCategoryList.push(id)
else this.checkCategoryList.splice(index, 1)
}
this.keyword = ''
this.search(1)
},
selectProvince(code) {
if (code === -1) this.checkProvinceList = []
if (code === -1) {
this.checkProvinceList = []
this.checkCityList = []
this.checkAreaList = []
}
else {
const index = this.checkProvinceList.indexOf(code)
if (index === -1) this.checkProvinceList.push(code)
else this.checkProvinceList.splice(index, 1)
this.checkProvinceList = [code]
this.checkCityList = []
this.checkAreaList = []
}
this.search(1)
},
selectCity(code) {
if (code === -1) {
this.checkCityList = []
this.checkAreaList = []
} else {
this.checkCityList = [code]
this.checkAreaList = []
}
this.search(1)
},
selectArea(code) {
if (code === -1) this.checkAreaList = []
else this.checkAreaList = [code]
this.search(1)
},
adJump(item) {
if (item.spotGoodsId) vk.navigateTo(`/pages/spot/goods/detail?id=${item.spotGoodsId}`)
else if (item.type === 'goods' && item.goodsId) vk.navigateTo(`/pages/index/shop/detail?id=${item.goodsId}`)
else if (item.companyId) vk.navigateTo(`/pages/yellowPage/info?id=${item.companyId}`)
},
async toRelease() {
const {userInfo} = await vk.callFunction({
const {userInfo, accountNum} = await vk.callFunction({
url: 'user/kh/getMyUserInfo'
})
console.log(userInfo.businessCard)
if (!userInfo.fadadaConfirm || [-1, 2].includes(userInfo.authStatus)) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@@ -194,14 +291,38 @@ 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 {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
if (userInfo.userLevel < 1) {
this.$confirm('非年费会员,无法发布现货', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/spot/release/release'
})
@@ -212,40 +333,63 @@ export default {
url: 'user/kh/getMyUserInfo'
})
if (!userInfo.fadadaConfirm && userInfo.authStatus === 1) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.getCertUrl()
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('/pages/user/user?menu=business-card');
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
if (userInfo.businessCard.status !== 1) {
this.$confirm('您的名片信息未审核,请耐心等待', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
if (userInfo.userLevel < 1) {
this.$confirm('非年费会员,无法发布现货', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
return
}
vk.navigateTo({
url: '/pages/spot/goods/my'
})
}
},
keywordSearch() {
this.checkCategoryList = []
this.search(1)
},
search(pageIndex) {
this.loading = true
vk.callFunction({
url: 'client/spot/goods/pub/getList',
title: '请求中...',
data: {
pageIndex: pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
categoryIds: this.checkCategoryList,
provinceCodes: this.checkProvinceList
provinceCodes: this.checkProvinceList,
cityCodes: this.checkCityList,
areaCodes: this.checkAreaList
},
success: (data) => {
console.log('data: ', data);
this.loading = false
data.rows.forEach(item => {
try {
item.addressStr = item.address.province.name + "-" + item.address.city.name + "-" + item.address.area.name
@@ -254,6 +398,8 @@ export default {
}
})
this.goodsData = data
this.getAd9()
this.getAd10()
}
});
},
@@ -265,8 +411,96 @@ export default {
}
});
},
async getAd9() {
this.ad9 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 9,
categoryIds: this.checkCategoryList,
region: this.currentRegion
}
})
if (res.data) this.ad9 = res.data
// }else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 1,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad9.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
async getAd10() {
this.ad10 = []
// if (this.checkProvinceList.length === 0) {
const res = await vk.callFunction({
url: 'client/ad/pub/getList',
data: {
adKey: 10,
categoryIds: this.checkCategoryList,
region: this.currentRegion
}
})
if (res.data) this.ad10 = res.data
// } else {
// const {rows} = await vk.callFunction({
// url: 'client/user/pub/getCompany',
// data: {
// pageIndex: 2,
// pageSize: 5,
// isCoop: 1,
// province: this.checkProvinceList
// }
// })
// rows.forEach(item => {
// if (item.businessCard.album && item.businessCard.album.length > 0) {
// this.ad10.push({
// swiper: Array.isArray(item.businessCard.album) ? item.businessCard.album[0] : item.businessCard.album,
// companyId: item._id
// })
// }
// })
// }
},
},
computed: {
selectedProvince() {
return this.checkProvinceList.length > 0 ? this.checkProvinceList[0] : null
},
selectedCity() {
return this.checkCityList.length > 0 ? this.checkCityList[0] : null
},
currentCityList() {
const provinceIndex = this.provinceData.findIndex(item => item.code === this.selectedProvince)
if (provinceIndex === -1) return []
return this.cityData[provinceIndex] || []
},
currentAreaList() {
const provinceIndex = this.provinceData.findIndex(item => item.code === this.selectedProvince)
if (provinceIndex === -1) return []
const cityIndex = this.currentCityList.findIndex(item => item.code === this.selectedCity)
if (cityIndex === -1) return []
return (this.areaData[provinceIndex] && this.areaData[provinceIndex][cityIndex]) ? this.areaData[provinceIndex][cityIndex] : []
},
currentRegion() {
if (this.checkAreaList.length > 0) return [this.selectedProvince, this.selectedCity, this.checkAreaList[0]]
if (this.checkCityList.length > 0) return [this.selectedProvince, this.checkCityList[0]]
if (this.checkProvinceList.length > 0) return this.checkProvinceList[0]
return null
},
checkCategoryArr() {
const arr = []
this.allChildCate.forEach(item => {
@@ -277,6 +511,12 @@ export default {
arr.push(item)
}
})
this.currentCityList.forEach(item => {
if (this.checkCityList.includes(item.code)) arr.push(item)
})
this.currentAreaList.forEach(item => {
if (this.checkAreaList.includes(item.code)) arr.push(item)
})
return arr
}
@@ -333,6 +573,17 @@ export default {
margin-right: 20px;
margin-bottom: 25px;
padding: 10px 20px;
position: relative;
.top {
position: absolute;
right: 0;
top: 0;
background-color: rgba(169, 41, 36, 1);
padding: 2px 5px;
border-radius: 0 0 0 5px;
color: #FFFFFF;
}
&-title {
font-size: 15px;
@@ -350,6 +601,7 @@ export default {
&-address {
font-size: 12px;
margin: 10px 0;
height: 35px;
}
&-image {
@@ -367,6 +619,7 @@ export default {
color: #4F4F4F;
font-size: 14px;
margin: 10px 0;
height: 45px;
}
&-buy {
+14 -13
View File
@@ -4,13 +4,14 @@
<common-header></common-header>
<category-bar></category-bar>
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<!-- <el-carousel height="170px">-->
<!-- <el-carousel-item v-for="item in 4" :key="item">-->
<!-- <image class="carousel-img"-->
<!-- src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"-->
<!-- mode="aspectFill"></image>-->
<!-- </el-carousel-item>-->
<!-- </el-carousel>-->
<common-swiper page="spot-mine" :height="200"/>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布现货</el-button>
@@ -67,7 +68,7 @@
type: 'warning'
}).then(() => {
vk.callFunction({
url: 'client/enquiry/sheet/kh/delete',
url: 'client/spot/goods/kh/delete',
title: '请求中...',
data: {
_id: item._id
@@ -101,7 +102,7 @@
},
{
key: "_add_time_srt",
key: "_add_time_str",
title: "发布时间",
type: "time",
width: 160
@@ -123,20 +124,20 @@
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.getCertUrl()
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('请完善名片信息', '提示', {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card');
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
uni.navigateTo({
+309 -38
View File
@@ -7,33 +7,138 @@
<view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item><navigator style="display: inline-block;" url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
<el-breadcrumb-item>
<navigator style="display: inline-block;" url="/pages/spot/goods/goods">现货市场</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item>发布现货</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="form-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"
:before-action="form1.props.beforeAction" :auto-close="true" label-width="140px"
@success="onFormSuccess">
<template v-slot:name="{ form, keyName }">
<el-input v-model="productName" readonly placeholder="请添加现货分类"></el-input>
</template>
</vk-data-form>
<!-- <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"-->
<!-- :before-action="form1.props.beforeAction" :auto-close="true" label-width="140px"-->
<!-- :show-cancel="false"-->
<!-- @success="onFormSuccess">-->
<!-- <template v-slot:name="{ form, keyName }">-->
<!-- <el-input v-model="productName" readonly placeholder="请添加现货分类"></el-input>-->
<!-- </template>-->
<!-- </vk-data-form>-->
<el-form ref="form" :model="form1.data" label-width="140px">
<el-form-item label="现货名称">
<el-input v-model="form1.data.name" placeholder="请输入现货名称" readonly></el-input>
</el-form-item>
<el-form-item label="现货分类" required>
<!-- <el-checkbox-group v-model="form1.data.categoryIds" @change="makeTitle">-->
<!-- <el-checkbox v-for="(item, index) in category" :key="index" :label="item._id">{{-->
<!-- item.name-->
<!-- }}-->
<!-- </el-checkbox>-->
<!-- </el-checkbox-group>-->
<div class="flex justify-center items-start">
<div v-for="(item, index) in category" class="flex-1" :key="index">
<div class="flex justify-start items-center">
<image :src="item.icon" style="width: 15px; height: 15px"/>
<span class="ml-10">{{ item.name }}</span>
</div>
<div class="ml-25 flex flex-wrap justify-start items-start">
<span class="mr-25 mt-10 pointer" @click="changeCheck(productItem)"
:class="[form1.data.categoryIds.includes(productItem._id) ? 'text-main' : '']"
v-for="(productItem, productIndex) in item.children"
:key="productIndex"> {{ productItem.name }}</span>
</div>
</div>
</div>
<div class="flex justify-start items-center flex-wrap mt-20">
<span style="margin: 10px 10px 0 0">已选:</span>
<div class="flex justify-start items-center pointer" @click="changeCheck(productItem)"
v-for="(productItem, productIndex) in categoryAll.filter(all => form1.data.categoryIds.includes(all._id))"
:key="productIndex" style="margin: 10px 10px 0 0">
<image src="/static/images/check.png" style="width: 12px; height: 12px; margin-right: 5px"/>
<span style="line-height: 18px">{{ productItem.name }}</span>
</div>
</div>
</el-form-item>
<el-form-item label="库存(吨)" required>
<el-input v-model="form1.data.stock" placeholder="请输入库存(吨)" type="number"/>
</el-form-item>
<el-form-item label="现货存放地" required>
<vk-data-input-address :level="3" v-model="form1.data.address" @change="getAmount()"/>
</el-form-item>
<el-form-item label="产品规格单价">
<vk-data-upload v-model="form1.data.files" list-type="text" :on-preview="previewUpload"
accept=".jpg,.jpeg,.png,.xlsx,.doc,.docx,.pdf"/>
</el-form-item>
<el-form-item label="上传报价单样板">
<span class="text-main pointer" @click="download">下载样板</span>
<p class="tips">为平台格式统一性和用户便于对比请尽量使用建议格式</p>
</el-form-item>
<el-form-item label="报价有效期">
<el-date-picker :picker-options="pickerOptions"
v-model="form1.data.answerEndTime"
type="datetime"/>
</el-form-item>
<el-form-item label="产品现场图片">
<vk-data-upload v-model="form1.data.images" list-type="text" accept=".jpg,.jpeg,.png"/>
</el-form-item>
<el-form-item label="是否购买全国广告位">
<el-radio-group v-model="form1.data.buyAll" @change="getAmount(true)">
<el-radio :label="true">是</el-radio>
<el-radio :label="false">否</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否购买省份广告位">
<p class="tips text-main" v-if="!form1.data.buyAll && JSON.stringify(form1.data.address) === '{}'">
请先选择现货存放地</p>
<el-radio-group v-model="form1.data.buyTop" @change="getAmount()"
:disabled="form1.data.buyAll || JSON.stringify(form1.data.address) === '{}'">
<el-radio :label="true">是</el-radio>
<el-radio :label="false">否</el-radio>
</el-radio-group>
</el-form-item>
<p class="text-main text-25 my-20" v-if="form1.data.buyAll">
您已选择购买全国广告位,无法继续购买省份广告位</p>
<el-form-item label="购买时长(月)" v-if="form1.data.buyTop || form1.data.buyAll">
<el-input-number v-model="form1.data.buyTopNum" :min="1"/>
</el-form-item>
<el-form-item label="广告位价格">
{{ totalAmount }}元
</el-form-item>
</el-form>
<div class="text-center">
<el-button type="primary" @click="add">发布</el-button>
</div>
</view>
</view>
</template>
<script>
export default {
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now();
},
},
category: [],
categoryAll: [],
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
name: '',
stock: '',
buyTop: false,
buyAll: false,
buyTopNum: 1,
categoryIds: [],
files: [],
images: [],
address: {},
answerEndTime: null,
},
// 表单属性
props: {
@@ -48,28 +153,30 @@
{
key: "categoryIds",
title: "现货分类",
type: "checkbox",
action: "client/spot/category/pub/getList",
actionData: {
whereJson: {
level: 2
}
},
props: {
list: "data",
value: "_id",
label: "name"
},
watch: ({
option
}) => {
console.log('res: ', option)
this.form1.data.name = option.map(item => item.name).join('、')
this.productName = option.map(item => item.name).join('、')
console.log(this.form1);
}
type: "html",
// action: "client/spot/category/pub/getList",
// actionData: {
// whereJson: {
// level: 2
// }
// },
// props: {
// list: "data",
// value: "_id",
// label: "name"
// },
// watch: ({
// option
// }) => {
// if (this.form1.data.categoryIds.length > 5) {
// this.$message.error('最多选择五个分类')
// this.form1.data.categoryIds.splice(-1, 1)
// return
// }
//
// this.form1.data.name = option.map(item => item.name).join('、')
// this.productName = option.map(item => item.name).join('、')
// },
},
{
key: "stock",
@@ -87,10 +194,65 @@
type: "file",
buttonText: "点击上传",
limit: 9,
accept: ".jpg,.png,.xlsx,.doc,.docx",
accept: ".jpg,.jpeg,.png,.xlsx,.doc,.docx,.pdf",
tips: '上传自有采购单图片或文档,支持jpg/png/word/excel'
},
{
key: "buyAll",
title: "是否购买全国广告位",
type: "radio",
data: [
{
value: true,
label: "是"
},
{
value: false,
label: "否"
}
],
watch: ({value, formData}) => {
if (value) {
formData.buyTop = false
}
}
},
{
key: "buyTop",
title: "是否购买广告位",
type: "radio",
data: [
{
value: true,
label: "是"
},
{
value: false,
label: "否"
}
],
disabled: formData => {
return formData.buyAll
}
},
{
key: "buyTopNum",
title: "购买广告位时长(月)",
type: "number",
controls: true,
precision: 0,
min: 1,
step: 1,
rightText: '月'
},
{
key: "amount",
title: "价格",
type: "text",
readonly: true,
placeholder: '请选择供货地'
},
],
// 表单验证规则
@@ -132,7 +294,6 @@
trigger: ['blur', 'change']
}
]
},
// add 代表添加 update 代表修改
formType: "add",
@@ -142,11 +303,13 @@
show: false
}
},
productName: ''
productName: '',
amount: '',
// 表单相关结束-----------------------------------------------------------
};
},
onLoad() {
this.getCategory()
vk.callFunction({
url: 'client/spot/goods/kh/getSelfOne',
success: (res) => {
@@ -155,13 +318,121 @@
this.$refs.form1.resetForm();
this.productName = res.data.name
}
}
});
},
methods: {
onFormSuccess() {
vk.navigateBack()
changeCheck(product) {
const index = this.form1.data.categoryIds.findIndex(item => item === product._id)
if (index > -1) {
this.form1.data.categoryIds.splice(index, 1)
} else {
if (this.form1.data.categoryIds.length === 5) {
return this.$message.error('最多选择五个分类');
}
this.form1.data.categoryIds.push(product._id)
}
console.log(this.form1.data.categoryIds)
this.form1.data.name = this.categoryAll.filter(item => this.form1.data.categoryIds.includes(item._id)).map(item => item.name).join(',')
this.$forceUpdate()
},
onFormSuccess(res) {
if (this.form1.data.buyTop) {
vk.navigateTo({
url: `/pages/index/shop/pay?id=${res.data.data}`
})
} else vk.redirectTo({url: '/pages/spot/goods/goods'});
},
getCategory() {
vk.callFunction({
url: 'client/spot/category/pub/getTree',
success: (res) => {
this.categoryAll = []
this.category = res.rows.map(item => {
item.children.map(child => {
this.categoryAll.push(child)
return child
})
return item
});
console.log(this.category)
}
});
},
makeTitle(val) {
if (val.length > 5) {
this.form1.data.categoryIds.splice(-1)
return this.$message.error('最多选择五个分类');
}
this.form1.data.name = this.category.filter(item => val.includes(item._id)).map(item => item.name).join('、')
this.$forceUpdate()
},
getAmount(isAll = false) {
if (!this.form1.data.buyTop && !this.form1.data.buyAll) {
this.amount = 0
return
}
this.amount = 0
if (!isAll && JSON.stringify(this.form1.data.address) === '{}') return
vk.callFunction({
url: 'client/spot/amount/pub/getDetail',
data: {
province: isAll ? -1 : this.form1.data.address.province.code,
},
success: (res) => {
if (res.data) {
this.amount = parseFloat(res.data.amount)
} else {
if (!isAll) this.form1.data.buyTop = false
}
}
});
},
async add() {
if (this.form1.data.categoryIds.length === 0) return this.$message.error('请选择分类')
if (!this.form1.data.stock) return this.$message.error('请填写库存')
if (JSON.stringify(this.form1.data.address) === '{}') return this.$message.error('请选择供货地')
const res = await vk.callFunction({
title: '请求中...',
url: 'client/spot/goods/kh/addUpdate',
data: this.form1.data
})
if (this.form1.data.buyTop || this.form1.data.buyAll) {
vk.navigateTo({
url: `/pages/index/shop/pay?id=${res.data}`
})
} else vk.redirectTo({url: '/pages/spot/goods/goods'});
},
async download() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '7433728469140dac03352ade6cb069c8'
},
})
let openUrl = res.content
const userAgent = window.navigator.userAgent.toLowerCase();
if (userAgent.match(/micromessenger/i)) {
window.open(`https://www.jinjiuxinzg.cn/pdfjs/web/viewer.html?file=${encodeURIComponent(openUrl)}`)
} else {
window.open(openUrl)
}
},
previewUpload({url}) {
let openUrl = url
const userAgent = window.navigator.userAgent.toLowerCase();
if (userAgent.match(/micromessenger/i)) {
window.open(`https://www.jinjiuxinzg.cn/pdfjs/web/viewer.html?file=${encodeURIComponent(openUrl)}`)
} else {
window.open(openUrl)
}
}
},
computed: {
totalAmount() {
let amount = 0
if (this.amount) amount = this.amount * this.form1.data.buyTopNum
return amount
}
}
}
+24
View File
@@ -0,0 +1,24 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<view class="flex justify-center items-center p-20 bg-white" style="overflow: hidden">
<iframe src="/static/gangcai-cal/index.html" frameborder="0" scrolling="no"
style="width: 500px; height: 600px;overflow: hidden"></iframe>
<image src="/static/images/banner@2x.png" class="ml-20" style="width: 406px;height: 512px"/>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
name: "stealCal",
data() {
return {}
},
methods: {}
}
</script>
+445 -85
View File
@@ -8,16 +8,32 @@
<el-menu @select="menuSelect" :default-active="menuIndex" class="el-menu-vertical-demo">
<el-menu-item index="1">
<i class="el-icon-warning-outline"></i>
<span slot="title">询价单管理</span>
<span slot="title">询价单列表</span>
</el-menu-item>
<el-menu-item index="0">
<i class="el-icon-edit"></i>
<span slot="title">加工单管理</span>
<span slot="title">加工单列表</span>
</el-menu-item>
<el-menu-item index="3">
<i class="el-icon-attract"></i>
<span slot="title">旧货</span>
</el-menu-item>
<el-menu-item index="2">
<i class="el-icon-s-order"></i>
<span slot="title">自营询价单列表</span>
</el-menu-item>
</el-menu>
</el-col>
<el-col :span="18">
<el-card shadow="never">
<el-alert
v-if="showNotaryBusinessBanner"
class="notary-business-tip"
title="请您先至个人中心-卖家中心-金久信公正银联资料,完成银联资料收集,并联系金久信客服开通功能。才能进行金久信公正交易"
type="warning"
show-icon
:closable="false"
/>
<el-card shadow="never" v-if="['0', '1'].includes(menuIndex)">
<el-tabs v-model="activeName" @tab-click="changeStatus">
<el-tab-pane :label="`全部(${allNum})`" name="all">
</el-tab-pane>
@@ -25,42 +41,54 @@
<el-tab-pane :label="`待选商(${notPickNum})`" name="notPick"></el-tab-pane>
<el-tab-pane :label="`已选商(${pickedNum})`" name="picked"></el-tab-pane>
</el-tabs>
<!-- <div class="search">-->
<!-- <view class="p">-->
<!-- <el-select v-model="value2" placeholder="请选择">-->
<!-- <el-option v-for="item in options2" :key="item.value" :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </view>-->
<!-- <view class="p">-->
<!-- <el-date-picker v-model="value1" type="date" placeholder="选择日期">-->
<!-- </el-date-picker>-->
<!-- </view>-->
<!-- <view class="p">-->
<!-- <el-input placeholder="请输入内容" v-model="input3" class="input-with-select"-->
<!-- @change="onSearch">-->
<!-- <i slot="append" class="el-icon-search" @click="onSearch"></i>-->
<!-- </el-input>-->
<!-- </view>-->
<!-- </div>-->
</el-card>
<el-card shadow="never" style="margin-top: 20px;">
<el-card shadow="never" v-if="['3'].includes(menuIndex)">
<el-tabs v-model="oldSignMethod" @tab-click="changeOldStatus">
<el-tab-pane :label="`全部`" name="all">
</el-tab-pane>
<el-tab-pane :label="`线上签约`" name="0"></el-tab-pane>
<el-tab-pane :label="`线下签约`" name="1"></el-tab-pane>
</el-tabs>
</el-card>
<el-card shadow="never" v-if="['2'].includes(menuIndex)">
<el-tabs v-model="selfStatus" @tab-click="changeSelfStatus">
<el-tab-pane :label="`全部`" name="all">
</el-tab-pane>
<el-tab-pane :label="`待选商`" name="1"></el-tab-pane>
<el-tab-pane :label="`已选商`" name="2"></el-tab-pane>
</el-tabs>
</el-card>
<el-card shadow="never" style="margin-top: 20px;" v-if="['0', '1', '2', '3'].includes(menuIndex)">
<template v-if="menuIndex === '0'">
<view class="transaction-list">
<view class="item" v-for="(item, index) in processList" :key="index">
<view class="info ">
<view class="title">
<view class="name">
<view class="fabu-status">
<view class="fabu-status pointer"
@click="navTo(`/pages/process/detail?id=${item._id}`)">
<view class="text">{{
item.status === 0 ? '发布中' : '已选商'
}}
</view>
<view class="sjx"></view>
</view>
<span>{{ item.title }}</span>
<el-tag effect="plain" size="mini" class="el-tag">签单宝</el-tag>
<span class="item-title pointer"
@click="navTo(`/pages/process/detail?id=${item._id}`)">{{
item.title
}}</span>
<el-tag effect="plain" size="mini" class="el-tag">
{{ item.signMethod === 1 ? '线下签单' : '线上签约' }}
</el-tag>
<view v-if="item.status === 1 && item.signMethod === 1"
class="ml-20 flex justify-start items-center">
<switch-icon theme="outline" size="20" fill="#000000"
strokeLinecap="square"/>
<el-tag size="mini" type="warning" class="pointer"
@click.native="processChangeToOnlineSign(item._id, index)">
切换至线上交易
</el-tag>
</view>
</view>
</view>
<view class="caigou">
@@ -73,15 +101,6 @@
<view class="unit">{{ item.num }}</view>
</view>
</view>
<!-- <view class="item" style="margin-left: 100px;">-->
<!-- <view class="icon">-->
<!-- <i class="el-icon-location-outline"></i>-->
<!-- </view>-->
<!-- <view class="infos">-->
<!-- <view class="name">交易地址</view>-->
<!-- <view class="unit">广西壮族自治区-南宁市-五象航洋城</view>-->
<!-- </view>-->
<!-- </view>-->
</view>
<view class="sub-title">
<text>交易编号:{{ item.orderNo }}</text>
@@ -91,30 +110,38 @@
<view class="icon">
<img src="/static/images/store/choose.png" alt=""
v-if="item.status === 1"/>
<img src="/static/images/store/unchoose.png" alt="" v-else/>
<img src="/static/images/store/unchoose.png" alt=""
v-else-if="item.status === 0"/>
</view>
</view>
</view>
<view class="tool">
<view class="btn">
<el-button size="small" plain style="width: 160px;" v-if="item.status === 0"
@click.native="editEnquiry(item._id)">编辑询价详情
</el-button>
<el-button size="small" type="success" style="width: 160px;" v-else
@click.native="navTo('/pages/contract/index')">去创建合同
<!-- <el-button size="small" plain style="width: 160px;" v-if="item.status === 0"-->
<!-- @click.native="editEnquiry(item._id)">编辑询价详情-->
<!-- </el-button>-->
<el-button size="small" type="success" style="width: 160px;"
v-if="item.status !== 0 && item.signMethod !== 1 && item.contract"
@click.native="navTo(`/pages/contract/index?tab=${item.contract ? (item.contract.status === 1 ? 1 : (item.contract.status === 2 ) ? 2 : 0) : 0}`)"
>
{{
item.contract ? (item.contract.status === 1 ? '去签署合同' : (item.contract.status === 0) ? '去创建合同' : '查看合同')
: '去创建合同'
}}
</el-button>
</view>
<view class="btn">
<el-button size="small" type="danger" v-if="item.status === 0"
@click.native="showProcessModal(item)"
style="width: 160px;">查看收到的报价列表
@click.native="openCooperationDialog('process', item)"
style="width: 160px;">查看意向合作列表
</el-button>
<el-button size="small" type="success" plain style="width: 160px;" v-else
@click.native="showOtherUser(item)"
>查看交易方
</el-button>
</view>
<view class="btn">
<el-button size="small" type="text"
<el-button size="small" type="text" @click.native="showProcessModal(item)"
style="width: 160px;">共收到{{ item.quoteNum }}个报价
</el-button>
</view>
@@ -134,20 +161,22 @@
<view class="info ">
<view class="title">
<view class="name">
<view class="fabu-status">
<view class="fabu-status pointer"
@click="navTo(`/pages/enquiry/detail?id=${item._id}`)">
<view class="text">{{
item.status === 0 ? '发布中' : '已选商'
}}
</view>
<view class="sjx"></view>
<view class="sjx pointer"></view>
</view>
<span>{{
item.productList.map(row => `${row.goodsName}(${row.materialQuality})`).join("/")
<span class="item-title pointer"
@click="navTo(`/pages/enquiry/detail?id=${item._id}`)">{{
item.title
}}</span>
<el-tag effect="plain" size="mini" class="el-tag">
{{ item.signMethod === 0 ? '平台交易' : '线下签单' }}
{{ item.signMethod === 1 ? '线下签单' : '线上签约' }}
</el-tag>
<view v-if="item.status === 0 && item.signMethod === 1"
<view v-if="item.status === 1 && item.signMethod === 1"
class="ml-20 flex justify-start items-center">
<switch-icon theme="outline" size="20" fill="#000000"
strokeLinecap="square"/>
@@ -166,7 +195,7 @@
<view class="infos">
<view class="name">采购量</view>
<view class="unit">{{
item.productList.map(row => row.procureNumber + row.procureUnit).join("/")
item.productNum
}}
</view>
</view>
@@ -176,7 +205,7 @@
<i class="el-icon-location-outline"></i>
</view>
<view class="infos">
<view class="name">交易地址</view>
<view class="name">交货地址</view>
<view class="unit">{{ item.fullAddress }}</view>
</view>
</view>
@@ -188,37 +217,208 @@
<view class="status">
<view class="icon">
<img src="/static/images/store/choose.png" alt=""
v-if="item.status === 1"/>
<img src="/static/images/store/unchoose.png" alt="" v-else/>
v-if="[1, 2].includes(item.status)"/>
<img src="/static/images/store/unchoose.png" alt=""
v-if="item.status === 0"/>
</view>
</view>
</view>
<view class="tool">
<view class="btn">
<el-button size="small" plain style="width: 160px;" v-if="item.status === 0"
@click.native="editEnquiry(item._id)">编辑询价详情
<!-- <el-button size="small" plain style="width: 160px;" v-if="item.status === 0"-->
<!-- @click.native="editEnquiry(item._id)">编辑询价详情-->
<!-- </el-button>-->
<el-button size="small" type="success" style="width: 160px;"
v-if="item.status !== 0 && item.signMethod !== 1 && item.contract"
@click.native="navTo(`/pages/contract/index?tab=${item.contract ? (item.contract.status === 1 ? 1 : (item.contract.status === 2 ) ? 2 : 0) : 0}`)"
>
{{
item.contract ? (item.contract.status === 1 ? '去签署合同' : (item.contract.status === 0) ? '去创建合同' : '查看合同')
: '去创建合同'
}}
</el-button>
<el-button size="small" type="success" style="width: 160px;" v-else
@click.native="navTo('/pages/contract/index')">去创建合同
</view>
<view class="btn">
<el-button size="small" type="success" style="width: 160px;"
v-if="item.status === 2 && parseInt(item.tradeMethod) === 1 && item.order && item.order.orderNo"
@click.native="navTo(`/pages/order/order?menuIndex=1&orderNo=${item.order.orderNo}`)">去订单
</el-button>
</view>
<view class="btn">
<el-button size="small" type="danger" v-if="item.status === 0"
@click.native="showEnquiryModal(item)"
style="width: 160px;">查看收到的报价列表
@click.native="openCooperationDialog('enquiry', item)"
style="width: 160px;">查看意向合作列表
</el-button>
<el-button size="small" type="success" plain style="width: 160px;" v-else
>查看交易方
@click.native="showOtherUser(item)">查看交易方
</el-button>
</view>
<view class="btn">
<el-button size="small" type="text"
<el-button size="small" type="text" @click.native="showEnquiryModal(item)"
style="width: 160px;">共收到{{ item.quoteNum }}个报价
</el-button>
</view>
</view>
</view>
<view class="paginatio">
<el-pagination background layout="prev, pager, next" :total="total"
:page-size="pageSize" @current-change="handleCurrentChange">
</el-pagination>
</view>
</view>
</template>
<template v-if="menuIndex === '2'">
<view class="transaction-list">
<view class="item" v-for="(item, index) in selfSupportList.rows" :key="index">
<view class="info ">
<view class="title">
<view class="name">
<view class="fabu-status pointer">
<view class="text">{{
item.status === 0 ? '待报价' : (item.status === 1 ? '待选商' : '已选商')
}}
</view>
<view class="sjx pointer"></view>
</view>
</view>
</view>
<view class="caigou">
<view class="item">
<view class="icon">
<i class="el-icon-location-outline"></i>
</view>
<view class="infos">
<view class="name">{{ item.desc ? `产品描述:${item.desc}` : '自营询价' }}</view>
<view class="unit">{{ item.province.name }}{{
item.city.name
}}
</view>
</view>
</view>
</view>
<view class="sub-title">
<text>发布时间:{{ item._add_time_str }}</text>
</view>
<view class="status">
<view class="icon">
<img src="/static/images/store/choose.png" alt=""
v-if="item.status === 2"/>
<img src="/static/images/store/unchoose.png" alt=""
v-if="item.status === 1"/>
</view>
</view>
</view>
<view class="tool">
<el-button size="small" type="success" style="width: 160px;"
v-if="item.status !== 0 && item.signMethod !== 1 && item.contract"
@click.native="navTo(`/pages/contract/index?tab=${item.contract ? (item.contract.status === 1 ? 1 : (item.contract.status === 2 ) ? 2 : 0) : 0}`)"
>
{{
item.contract ? (item.contract.status === 1 ? '去签署合同' : (item.contract.status === 0) ? '去创建合同' : '查看合同')
: '去创建合同'
}}
</el-button>
<el-button size="small" plain style="width: 160px;margin: 10px"
@click.native="showDetail(item)">查看详情
</el-button>
<el-button size="small" type="success" plain style="width: 160px;margin: 10px"
v-if="item.status === 2"
@click.native="showOtherUser(item)">查看交易方
</el-button>
</view>
</view>
<view class="paginatio">
<el-pagination background layout="prev, pager, next" :total="selfSupportList.total"
:page-size="pageSize" @current-change="handleCurrentChange">
</el-pagination>
</view>
</view>
</template>
<template v-if="menuIndex === '3'">
<view class="transaction-list">
<view class="item" v-for="(item, index) in oldList" :key="index">
<view class="info pointer" @click="navTo(`/pages/index/old/detail?id=${item._id}`)">
<view class="title">
<view class="name">
<view class="fabu-status">
<view class="text">{{
item.status === 0 ? '发布中' : '已选商'
}}
</view>
<view class="sjx"></view>
</view>
<span class="item-title">{{
item.title
}}</span>
<template v-if="item.type !== 3">
<el-tag effect="plain" size="mini" class="el-tag">
{{ item.signMethod === 0 ? '线上签约' : '线下签单' }}
</el-tag>
</template>
</view>
</view>
<view class="caigou">
<view class="item">
<view class="icon">
<i class="el-icon-shopping-bag-1"></i>
</view>
<view class="infos">
<view class="name">类型</view>
<view class="unit">{{
item.typeStr
}}
</view>
</view>
</view>
<view class="item" style="margin-left: 100px;">
<view class="icon">
<i class="el-icon-location-outline"></i>
</view>
<view class="infos">
<view class="name">交易地址</view>
<view class="unit"
v-if="item.addressRegion && item.addressRegion.province">
{{
item.addressRegion.province.name
}}{{
item.addressRegion.city.name
}}{{ item.addressRegion.area.name }}{{ item.addressDetail }}
</view>
</view>
</view>
</view>
<view class="sub-title">
<text>交易编号:{{ item._id }}</text>
<text>发布时间:{{ item._add_time_str }}</text>
</view>
</view>
<view class="tool">
<el-button size="mini" type="success" style="width: 160px;margin: 10px"
v-if="item.status !== 0 && item.signMethod !== 1 && item.contract && item.contract.status === 1"
@click.native="$jump('/pages/contract/index?tab=1')">
签署合同
</el-button>
<el-button size="mini" type="success" style="width: 160px;margin: 10px"
v-if="item.status !== 0 && item.signMethod !== 1 && item.contract && item.contract.status === 2"
@click.native="$jump('/pages/contract/index?tab=2')">
查看合同
</el-button>
<el-button size="mini" type="success" style="width: 160px;margin: 10px"
v-if="item.status !== 0 && item.signMethod !== 1 && (!item.contract || item.contract.status === 0)"
@click.native="$jump('/pages/contract/index?tab=0')">
合同待创建
</el-button>
<el-button size="small" plain style="width: 160px;margin: 10px"
@click.native="navTo(`/pages/index/old/detail?id=${item._id}`)">查看详情
</el-button>
<el-button size="small" type="success" plain style="width: 160px;margin: 10px"
v-if="item.status === 2"
@click.native="showOtherUser(item)">查看交易方
</el-button>
</view>
</view>
<view class="paginatio">
<el-pagination background layout="prev, pager, next" :total="total"
:page-size="pageSize" @current-change="handleCurrentChange">
@@ -227,6 +427,7 @@
</view>
</template>
</el-card>
<enquiry-data v-else/>
</el-col>
</el-row>
@@ -234,6 +435,7 @@
<common-footer></common-footer>
<enquiry-modal ref="enquiryModal"/>
<process-modal ref="processModal"/>
<self-support-modal ref="selfSupportModal"/>
</view>
</template>
@@ -247,9 +449,22 @@ import {
} from "@icon-park/vue";
import EnquiryModal from "./components/enquiryModal.vue";
import ProcessModal from "./components/processModal.vue";
import EnquiryData from "./components/enquiryData.vue";
import selfSupport from "../index/self-support/self-support.vue";
import SelfSupportModal from "./components/selfSupportModal.vue";
export default {
computed: {
showNotaryBusinessBanner() {
return Number(vk.getVuex('$user.userInfo.isNotaryBusiness') || 0) !== 1
},
selfSupport() {
return selfSupport
}
},
components: {
SelfSupportModal,
EnquiryData,
ProcessModal,
EnquiryModal,
Agreement,
@@ -262,19 +477,7 @@ export default {
areaData: areas,
activeName: 'all',
value: '',
value1: '',
options: [{
value: '金久信自营',
label: '金久信自营'
}],
value2: '',
options2: [{
value: '未开发票',
label: '自主交易'
}],
input3: '',
menuIndex: '1',
isSign: false,
formData: {
status: 0,
tradeMethod: null
@@ -283,19 +486,36 @@ export default {
pageSize: 10,
enquiryList: [],
processList: [],
selfSupportList: {},
total: 0,
notPickNum: 0,
pickedNum: 0,
noQuoteNum: 0,
allNum: 0,
oldList: [],
oldSignMethod: 'all',
selfStatus: 'all',
}
},
onLoad(options) {
if (!vk.getVuex('$user.userInfo.mobile')) {
this.$confirm('请先绑定手机号', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.redirectTo(`/pages/auth/login/wechat?state=jjx_` + vk.getVuex('$user.userInfo.accountType'))
}).catch(() => {
vk.redirectTo(`/pages/auth/login/wechat?state=jjx_` + vk.getVuex('$user.userInfo.accountType'))
})
return
}
if (options.menuIndex) {
this.menuIndex = String(options.menuIndex)
}
if (this.menuIndex === '1') this.getEnquiryList()
else this.getProcessList()
else if (this.menuIndex === '0') this.getProcessList()
else if (this.menuIndex === '2') this.getSelfSupportList()
},
methods: {
navTo(url) {
@@ -306,20 +526,57 @@ export default {
menuSelect(e) {
this.menuIndex = String(e)
this.formData.status = Number(e)
this.isSign = false
this.handleCurrentChange(1)
},
handleCurrentChange(page) {
if (this.menuIndex === '1') this.getEnquiryList(page)
else this.getProcessList(page)
else if (this.menuIndex === '0') this.getProcessList(page)
else if (this.menuIndex === '2') this.getSelfSupportList(page)
else if (this.menuIndex === '3') this.getOldList(page)
},
changeStatus() {
if (this.menuIndex === '1') this.getEnquiryList(1)
else this.getProcessList(1)
else if (this.menuIndex === '0') this.getProcessList(1)
else if (this.menuIndex === '2') this.getSelfSupportList(1)
else if (this.menuIndex === '3') this.getOldList(1)
},
changeOldStatus() {
this.getOldList(1)
},
changeSelfStatus() {
this.getSelfSupportList(1)
},
getOldList(pageIndex = 1) {
vk.callFunction({
url: 'client/old/kh/getList',
data: {
quoteUid: vk.getVuex('$user.userInfo._id'),
pageIndex,
pageSize: this.pageSize,
signMethod: this.oldSignMethod === 'all' ? null : this.oldSignMethod,
buyerOnly: true
},
success: (res) => {
this.oldList = res.rows.map(item => {
if (item.type === 0) item.typeStr = '拍卖'
else if (item.type === 1) item.typeStr = '采购'
else if (item.type === 2) {
item.typeStr = '租赁'
if (item.rentType === 0) item.typeStr += '-承租'
else item.typeStr += '-出租'
} else if (item.type === 3) item.typeStr = '物资回收'
if (item.addressRegion && item.addressRegion.length > 0)
item.address = item?.addressRegion[0]?.name + item?.addressRegion[1]?.name + item?.addressRegion[2]?.name + item.addressDetail
return item
})
this.total = res.total
}
})
},
getEnquiryList(pageIndex = 1) {
vk.callFunction({
url: 'client/enquiry/sheet/pub/getList',
url: 'client/enquiry/sheet/kh/getList',
title: '加载中...',
data: {
userId: vk.getVuex('$user.userInfo._id'),
pageIndex,
@@ -329,6 +586,7 @@ export default {
success: (res) => {
this.enquiryList = res.rows.map(val => {
let str = ''
val.productNum = ''
if (val.productList !== undefined && val.productList.length > 0 && val.productList[0].addressRegion !== undefined && val.productList[0].addressRegion.length > 0) {
let provinceIndex = 0, cityIndex = 0, areaIndex = 0
this.provinceData.forEach((item, index) => {
@@ -351,12 +609,21 @@ export default {
})
// str += val.productList[0].addressDetail
}
val.fullAddress = str
const productNumList = []
val.productList.forEach((item, index) => {
if (item.procureNumber) productNumList.push(item.procureNumber + item.procureUnit)
})
val.productNum = productNumList.join('/')
// val.fullAddress = str
if (val.addressRegion) {
if (val.addressRegion.province) val.fullAddress = val.addressRegion.province.name + val.addressRegion.city.name + val.addressRegion.area.name + val.addressDetail
}
return val
})
this.total = res.total
this.allNum = res.all
this.notPickNum = res.notPickNum
this.noQuoteNum = res.noQuoteNum
this.pickedNum = res.pickedNum
this.quoteNum = res.quoteNum
}
@@ -365,7 +632,9 @@ export default {
getProcessList(pageIndex = 1) {
vk.callFunction({
url: 'client/process/sheet/pub/getList',
title: '加载中...',
data: {
isUser: true,
userId: vk.getVuex('$user.userInfo._id'),
pageIndex,
pageSize: this.pageSize,
@@ -378,14 +647,42 @@ export default {
this.notPickNum = res.notPickNum
this.pickedNum = res.pickedNum
this.quoteNum = res.quoteNum
this.noQuoteNum = res.noQuoteNum
}
})
},
showEnquiryModal({status, quoteList}) {
this.$refs.enquiryModal.open(status, quoteList)
async getSelfSupportList(pageIndex = 1) {
const data = await vk.callFunction({
url: 'client/selfSupport/kh/getList',
data: {
pageIndex,
pageSize: this.pageSize,
status: this.selfStatus === 'all' ? null : this.selfStatus,
}
})
this.selfSupportList = data
this.showList = true
},
showProcessModal({status, quoteList}) {
this.$refs.processModal.open(status, quoteList)
showEnquiryModal(item) {
this.$refs.enquiryModal.open(item)
},
showProcessModal(item) {
this.$refs.processModal.open(item)
},
openCooperationDialog(type, item) {
const h = this.$createElement
this.$confirm(h('div', {class: 'dialog-confirm-content'}, [
h('p', '1、请您谨慎点击"选择",选择供应商后,系统将自动关闭您此条询价信息,无法返回,只能再次发布询价信息;'),
h('p', '2、点击"选择"前,您可通过供应商联系方式,仔细商讨:商品明细、数量、单价、执行标准、交货方式、交货期、验收方式、合同条款等细节关键题确认,各种交易细节无误后要求供应商进行最终报价;'),
h('p', '3、您承诺对此次交易的内容用途已经完全了解并知悉经过严格仔细审核后实施,此次交易为合法经营,如违反相关法律规定,您将承担全部责任,与平台无关。您确认以上描述无误后请点击"选择"。')
]), '重点提示', {
confirmButtonText: '同意悉知',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (type === 'process') this.showProcessModal(item)
else this.showEnquiryModal(item)
}).catch(() => {})
},
editEnquiry(id) {
vk.navigateTo({
@@ -393,13 +690,66 @@ export default {
})
},
enquiryChangeToOnlineSign(id, index) {
vk.callFunction({
this.$confirm('确认将该订单转为线上签订吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
await vk.callFunction({
url: ' client/enquiry/sheet/kh/changeToOnlineSign',
title: '加载中...',
data: {
id
}
})
this.$confirm('切换成功,是否去创建合同?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/contract/index'});
})
this.enquiryList[index].signMethod = 0
})
},
processChangeToOnlineSign(id, index) {
this.$confirm('确认将该订单转为线上签订吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
await vk.callFunction({
url: ' client/process/sheet/kh/changeToOnlineSign',
title: '加载中...',
data: {
id
}
})
this.$confirm('切换成功,是否去创建合同?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/contract/index'});
})
this.enquiryList[index].signMethod = 0
})
},
showOtherUser(item) {
if (item.otherUser) {
this.$confirm(`交易方联系方式:${item.otherUser.company.mobile ?? item.otherUser.person.mobile}`, '', {
cancelButtonText: '关闭',
showConfirmButton: false
})
} else {
this.$confirm(`交易方未留下联系方式`, '', {
cancelButtonText: '关闭',
showConfirmButton: false
})
}
},
showDetail(info) {
this.$refs.selfSupportModal.open(info)
}
}
}
@@ -411,6 +761,10 @@ export default {
margin: 20px auto;
}
.notary-business-tip {
margin-bottom: 20px;
}
.contract-list {
background-color: #FFFFFF;
padding: 10px 20px 20px;
@@ -444,6 +798,7 @@ export default {
margin-right: 20px;
font-weight: normal;
display: flex;
width: 95px;
.text {
padding: 0 10px 0 20px;
@@ -458,12 +813,17 @@ export default {
position: relative;
}
// .text{
// color: #fff;
// background-color: #A92924
// }
}
.item-title {
width: 200px;
}
.buyer,
.seller {
font-size: 14px;
+77
View File
@@ -0,0 +1,77 @@
<template>
<el-card>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
询价单管理
</view>
</view>
<text class="text-gray text-25 pointer">查看全部 <i class="el-icon-arrow-right"></i></text>
</view>
</view>
<view class="flex justify-center items-center">
<view class="flex flex-col justify-center items-center">
<text class="text-main text-50">{{ enquiry.noQuote }}</text>
<text>待报价</text>
</view>
<view class="flex flex-col justify-center items-center">
<text class="text-main text-50">{{ enquiry.notPick }}</text>
<text>待选商</text>
</view>
<view class="flex flex-col justify-center items-center">
<text class="text-main text-50">{{ enquiry.picked }}</text>
<text>已选商</text>
</view>
<view class="flex flex-col justify-center items-center">
<text class="text-main text-50">{{ enquiry.closed }}</text>
<text>已关闭</text>
</view>
</view>
</el-card>
</template>
<script>
export default {
name: "enquiryData",
data() {
return {
enquiry: {
noQuote: 0,
notPick: 0,
picked: 0,
closed: 0
},
}
},
methods: {}
}
</script>
<style scoped lang="scss">
.item-wrap {
margin: 24px 0;
.form-title-wrap {
display: flex;
align-items: center;
justify-content: space-between;
.goods-info-title {
display: flex;
align-items: center;
justify-content: flex-start;
}
.form-title {
padding-left: 10px;
color: #A92924;
font-size: 18px;
line-height: 18px;
border-left: 4px solid #A92924;
}
}
}
</style>
+78 -6
View File
@@ -11,21 +11,36 @@
<view class="mt-15">
<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>
<text class="flex-1">附件</text>
<text class="flex-1">操作</text>
</view>
<view class="quote" v-for="(item, index) in quoteList" :key="index">
<text class="flex-1">{{ item.subjectName }}</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">{{ item.subjectMobile }}</text>
<text class="flex-1">{{ item.totalPrice }}元</text>
<text class="flex-1">{{ item.remark ? item.remark : '无' }}</text>
<text class="flex-1">{{ item.supplierExt ? item.supplierExt : '无' }}</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">
<el-button type="primary" v-if="status === 0" @click.native="confirm(item)">选择</el-button>
<template v-if="item.files && item.files.length > 0">
<file-type v-for="(file, fileIndex) in item.files" :key="fileIndex" :item="file"
@click.native="previewFile(file)"/>
</template>
<text v-else>无</text>
</text>
<text class="flex-1">
<el-button type="primary" v-if="item.status === 0" @click.native="confirm(item)">选择</el-button>
</text>
</view>
</view>
<el-dialog title="图片预览" :visible.sync="showImagePreview" width="80%" append-to-body>
<img v-if="previewImageUrl" class="preview-image" :src="previewImageUrl" alt="附件预览"/>
</el-dialog>
</el-dialog>
</template>
@@ -33,8 +48,11 @@
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 {
name: "enquiryModal",
components: {FileType},
data() {
return {
provinceData: provinces,
@@ -42,13 +60,16 @@ export default {
areaData: areas,
id: null,
dialogVisible: false,
showImagePreview: false,
previewImageUrl: '',
quoteList: [],
status: 0
info: null
}
},
methods: {
open(status, quoteList) {
this.quoteList = quoteList
open(info) {
this.info = info
this.quoteList = info.quoteList
this.dialogVisible = true
},
handleClose() {
@@ -72,8 +93,52 @@ export default {
type: 'success',
message: '报价确认成功'
})
setTimeout(() => {
if (this.info.signMethod === 0) vk.navigateTo('/pages/contract/index?tab=1')
else {
if (this.info.signMethod === 1) vk.navigateTo('/pages/store/buyer')
else vk.navigateTo('/pages/contract/index?tab=0')
}
}, 500)
}
});
},
getFileExt(url = "") {
const cleanUrl = String(url).split("?")[0].split("#")[0]
const match = cleanUrl.match(/\.([a-z0-9]+)$/i)
return match ? match[1].toLowerCase() : ""
},
isImageFile(url) {
return ["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg"].includes(this.getFileExt(url))
},
isPdfFile(url) {
return this.getFileExt(url) === "pdf"
},
isOfficeFile(url) {
return ["doc", "docx", "xls", "xlsx", "ppt", "pptx"].includes(this.getFileExt(url))
},
getOfficePreviewUrl(url) {
return `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(url)}`
},
previewFile(url) {
if (!url) return
if (this.isImageFile(url)) {
this.previewImageUrl = url
this.showImagePreview = true
return
}
if (this.isPdfFile(url)) {
window.open(url, "_blank")
return
}
if (this.isOfficeFile(url)) {
window.open(this.getOfficePreviewUrl(url), "_blank")
return
}
window.open(url, "_blank")
},
openDownload(url) {
this.previewFile(url)
}
}
}
@@ -108,4 +173,11 @@ export default {
text-align: center;
}
}
.preview-image {
display: block;
max-width: 100%;
max-height: 75vh;
margin: 0 auto;
}
</style>
+225
View File
@@ -0,0 +1,225 @@
<template>
<view>
<el-dialog
title="报价列表"
:visible.sync="dialogVisible"
width="60%"
:before-close="handleClose">
<view slot="title" class="text-main text-40 m-30 flex justify-between items-center">
<text>收到的报价列表</text>
<el-button type="primary" @click.native="dialogVisible = false">关闭</el-button>
</view>
<view class="mt-15" v-if="quoteList">
<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>
<text class="flex-1">操作</text>
</view>
<view class="quote" v-for="(item, index) in quoteList" :key="index">
<text class="flex-1">{{ item.subjectName }}</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">{{ item.user.mobile }}</text>
<text class="flex-1">{{ item.totalPrice }}元</text>
<text class="flex-1">{{ item.remark }}</text>
<text class="flex-1">{{ item.supplierExt ? item.supplierExt : '无' }}</text>
<view class="flex-1">
<view class="flex-1">
<view class="mt-15 mr-15" v-for="(file, fileIndex) in item.files" :key="fileIndex">
<file-type :item="file" @click.native="previewFile(file)"/>
</view>
</view>
</view>
<text class="flex-1">
<el-button type="primary" @click.native="createContract(item._id)" v-if="status === 0">选择</el-button>
</text>
</view>
</view>
</el-dialog>
<vk-data-dialog
v-model="showInfo"
title="申请详情"
width="600px"
top="14vh"
center
:close-on-click-modal="true"
>
<vk-data-detail-table
:data="info"
:columns="infoColumns"
size="medium"
label-width="150px"
></vk-data-detail-table>
<template v-slot:footer>
<el-button @click="showInfo = false">关闭</el-button>
</template>
</vk-data-dialog>
<el-dialog title="图片预览" :visible.sync="showImagePreview" width="80%" append-to-body>
<img v-if="previewImageUrl" class="preview-image" :src="previewImageUrl" alt="附件预览"/>
</el-dialog>
</view>
</template>
<script>
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 {FileExcel, FilePdfOne, FileWord} from "@icon-park/vue";
import FileType from "../../../components/file-type/file-type.vue";
export default {
name: "oldModal",
components: {FileType, FilePdfOne, FileExcel, FileWord},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
id: null,
dialogVisible: false,
quoteList: [],
status: 0,
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"},
],
info: null,
showInfo: false,
showImagePreview: false,
previewImageUrl: '',
signMethod: 0
}
},
methods: {
open(id, status, quoteList, signMethod) {
this.id = id
this.status = status
this.quoteList = quoteList
this.signMethod = signMethod
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
toQuote() {
vk.navigateTo(`/pages/process/quote?sheetId=${this.id}`)
},
async createContract(quoteId) {
await vk.callFunction({
url: 'client/old/kh/confirmQuote',
title: '请求中...',
data: {
quoteId,
}
});
this.dialogVisible = false
this.$message({
message: "选择成功",
type: 'success'
})
if (this.signMethod === 0) vk.navigateTo('/pages/contract/index?tab=1')
else {
if (this.signMethod === 1) vk.navigateTo('/pages/store/store?menuIndex=2')
else vk.navigateTo('/pages/contract/index?tab=0&tradeMethod=0')
}
},
getOldInfo() {
vk.callFunction({
url: 'client/old/pub/getDetail',
title: '请求中...',
data: {
id: this.id,
}
}).then(res => {
this.info = res.data
})
},
doShowInfo(info) {
this.info = info
this.showInfo = true
},
getFileExt(url = "") {
const cleanUrl = String(url).split("?")[0].split("#")[0]
const match = cleanUrl.match(/\.([a-z0-9]+)$/i)
return match ? match[1].toLowerCase() : ""
},
isImageFile(url) {
return ["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg"].includes(this.getFileExt(url))
},
isPdfFile(url) {
return this.getFileExt(url) === "pdf"
},
isOfficeFile(url) {
return ["doc", "docx", "xls", "xlsx", "ppt", "pptx"].includes(this.getFileExt(url))
},
getOfficePreviewUrl(url) {
return `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(url)}`
},
previewFile(url) {
if (!url) return
if (this.isImageFile(url)) {
this.previewImageUrl = url
this.showImagePreview = true
return
}
if (this.isPdfFile(url)) {
window.open(url, "_blank")
return
}
if (this.isOfficeFile(url)) {
window.open(this.getOfficePreviewUrl(url), "_blank")
return
}
window.open(url, "_blank")
},
openDownload(url) {
this.previewFile(url)
}
}
}
</script>
<style lang="scss" scoped>
.request-header {
border: 1px solid #EDEDED;
background-color: #FFF8F1;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
margin-top: 30px;
text {
text-align: center;
}
}
.quote {
border-left: 1px solid #EDEDED;
border-right: 1px solid #EDEDED;
border-bottom: 1px solid #EDEDED;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
text {
text-align: center;
}
}
.preview-image {
display: block;
max-width: 100%;
max-height: 75vh;
margin: 0 auto;
}
</style>
+77 -8
View File
@@ -10,23 +10,36 @@
</view>
<view class="mt-15">
<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 quoteList.rows" :key="index">
<text class="flex-1">{{
<text class="flex-1" v-if="item.user">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
}}
</text>
<text class="flex-1">{{ item.totalPrice }}元</text>
<view class="flex-1 flex flex-col justify-start items-start">
<text>加工方补充条款:{{ item.supplierExt ? item.supplierExt : '无' }}</text>
</view>
<!-- <text class="flex-1">{{ item.remark }}</text>-->
<text class="flex-1">
<file-type v-for="(file, fileIndex) in item.files" :key="fileIndex" :item="file"
@click.native="previewFile(file)"/>
</text>
<text class="flex-1">{{ item._add_time_str }}</text>
<text class="flex-1">
<el-button type="primary" @click.native="createContract(item)" v-if="status === 0">选择</el-button>
<el-button type="primary" @click.native="createContract(item)" v-if="item.status === 0">选择</el-button>
</text>
</view>
</view>
<el-dialog title="图片预览" :visible.sync="showImagePreview" width="80%" append-to-body>
<img v-if="previewImageUrl" class="preview-image" :src="previewImageUrl" alt="附件预览"/>
</el-dialog>
</el-dialog>
</template>
@@ -34,23 +47,30 @@
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 {
name: "processModal",
components: {FileType},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
id: null,
info: null,
dialogVisible: false,
showImagePreview: false,
previewImageUrl: '',
quoteList: [],
status: 0
}
},
methods: {
open(status, quoteList) {
console.log(status, quoteList)
this.quoteList = quoteList
open(info) {
this.info = info
this.id = info._id
this.quoteList = info.quoteList
this.dialogVisible = true
},
handleClose() {
@@ -75,14 +95,56 @@ export default {
signCount: 0,
}
}).then((res) => {
this.dialogVisible = false
this.$message({
message: '选择成功',
type: 'success'
})
setTimeout(() => {
vk.navigateTo('/pages/contract/index')
}, 1500)
if (this.info.signMethod === 0) vk.navigateTo('/pages/contract/index?tab=1')
else {
if (this.info.signMethod === 1) vk.navigateTo('/pages/store/buyer')
else vk.navigateTo('/pages/contract/index?tab=0')
}
}, 500)
})
},
getFileExt(url = "") {
const cleanUrl = String(url).split("?")[0].split("#")[0]
const match = cleanUrl.match(/\.([a-z0-9]+)$/i)
return match ? match[1].toLowerCase() : ""
},
isImageFile(url) {
return ["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg"].includes(this.getFileExt(url))
},
isPdfFile(url) {
return this.getFileExt(url) === "pdf"
},
isOfficeFile(url) {
return ["doc", "docx", "xls", "xlsx", "ppt", "pptx"].includes(this.getFileExt(url))
},
getOfficePreviewUrl(url) {
return `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(url)}`
},
previewFile(url) {
if (!url) return
if (this.isImageFile(url)) {
this.previewImageUrl = url
this.showImagePreview = true
return
}
if (this.isPdfFile(url)) {
window.open(url, "_blank")
return
}
if (this.isOfficeFile(url)) {
window.open(this.getOfficePreviewUrl(url), "_blank")
return
}
window.open(url, "_blank")
},
openDownload(url) {
this.previewFile(url)
}
}
}
@@ -117,4 +179,11 @@ export default {
text-align: center;
}
}
.preview-image {
display: block;
max-width: 100%;
max-height: 75vh;
margin: 0 auto;
}
</style>
+178
View File
@@ -0,0 +1,178 @@
<template>
<el-dialog
title="自营询价详情"
:visible.sync="dialogVisible"
width="60%"
:before-close="handleClose">
<el-descriptions border size="small" :column="2">
<el-descriptions-item label="询价区域">
<span>{{ info.province.name }}{{ info.city.name }} </span>
</el-descriptions-item>
<el-descriptions-item label="联系人">
<span>{{ info.name }}</span>
</el-descriptions-item>
<el-descriptions-item label="联系方式">
<span>{{ info.phone }}</span>
</el-descriptions-item>
<el-descriptions-item label="用户名称">
<span>{{ info.company }}</span>
</el-descriptions-item>
<el-descriptions-item label="询价单附件">
<view class="mt-15 mr-15" v-for="(file, fileIndex) in info.files" :key="fileIndex">
<file-type :item="file" @click.native="previewFile(file)"/>
</view>
</el-descriptions-item>
<template v-if="info.quoteList && info.status === 1">
<el-descriptions-item label="报价列表">
<div class="py-20 border-bottom" v-for="(item, index) in info.quoteList" :key="index">
<p>公司:{{ item.user.company.companyName }}</p>
<template v-if="item.amount">
<p>报价:¥{{ item.amount }}</p>
<span v-if="item.remark">备注:{{ item.remark }}</span>
<view class="mt-15 mr-15" v-for="(file, fileIndex) in item.files" :key="fileIndex">
<file-type :item="file" @click.native="previewFile(file)"/>
</view>
</template>
<p v-else>未报价</p>
</div>
</el-descriptions-item>
</template>
<template v-if="info.quoteList && info.status === 2">
<el-descriptions-item label="报价公司">
<div class="py-20 border-bottom" v-for="(item, index) in info.quoteList.filter(q => q.status === 1)"
:key="index">
<p>{{ item.user.company.companyName }}</p>
</div>
</el-descriptions-item>
</template>
<template v-if="info.quote">
<el-descriptions-item label="报价">
<span>¥{{ info.quote.amount }}</span>
</el-descriptions-item>
<el-descriptions-item label="备注">
<span>{{ info.quote.remark }}</span>
</el-descriptions-item>
<el-descriptions-item label="报价单附件">
<view class="mt-15 mr-15" v-for="(file, fileIndex) in info.quote.files" :key="fileIndex">
<file-type :item="file" @click.native="previewFile(file)"/>
</view>
</el-descriptions-item>
</template>
</el-descriptions>
<el-dialog title="图片预览" :visible.sync="showImagePreview" width="80%" append-to-body>
<img v-if="previewImageUrl" class="preview-image" :src="previewImageUrl" alt="附件预览"/>
</el-dialog>
</el-dialog>
</template>
<script>
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 {
name: "selfSupportModal",
components: {FileType},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
id: null,
info: null,
dialogVisible: false,
showImagePreview: false,
previewImageUrl: '',
quoteList: [],
status: 0,
quote: null,
}
},
methods: {
open(info) {
this.info = info
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
getFileExt(url = "") {
const cleanUrl = String(url).split("?")[0].split("#")[0]
const match = cleanUrl.match(/\.([a-z0-9]+)$/i)
return match ? match[1].toLowerCase() : ""
},
isImageFile(url) {
return ["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg"].includes(this.getFileExt(url))
},
isPdfFile(url) {
return this.getFileExt(url) === "pdf"
},
isOfficeFile(url) {
return ["doc", "docx", "xls", "xlsx", "ppt", "pptx"].includes(this.getFileExt(url))
},
getOfficePreviewUrl(url) {
return `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(url)}`
},
previewFile(url) {
if (!url) return
if (this.isImageFile(url)) {
this.previewImageUrl = url
this.showImagePreview = true
return
}
if (this.isPdfFile(url)) {
window.open(url, "_blank")
return
}
if (this.isOfficeFile(url)) {
window.open(this.getOfficePreviewUrl(url), "_blank")
return
}
window.open(url, "_blank")
},
openDownload(url) {
this.previewFile(url)
}
}
}
</script>
<style lang="scss" scoped>
.request-header {
border: 1px solid #EDEDED;
background-color: #FFF8F1;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
margin-top: 30px;
text {
text-align: center;
}
}
.quote {
border-left: 1px solid #EDEDED;
border-right: 1px solid #EDEDED;
border-bottom: 1px solid #EDEDED;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
text {
text-align: center;
}
}
.preview-image {
display: block;
max-width: 100%;
max-height: 75vh;
margin: 0 auto;
}
</style>
@@ -0,0 +1,153 @@
<template>
<el-dialog
title="自营询价详情"
:visible.sync="dialogVisible"
width="60%"
:before-close="handleClose">
<el-descriptions border size="small" :column="2">
<el-descriptions-item label="询价区域">
<span>{{ info.sheet.province.name }}{{ info.sheet.city.name }} </span>
</el-descriptions-item>
<el-descriptions-item label="联系人">
<span>{{ info.sheet.name }}</span>
</el-descriptions-item>
<el-descriptions-item label="联系方式">
<span>{{ info.sheet.phone }}</span>
</el-descriptions-item>
<el-descriptions-item label="用户名称">
<span>{{ info.sheet.company }}</span>
</el-descriptions-item>
<el-descriptions-item label="询价单附件">
<view class="mt-15 mr-15" v-for="(file, fileIndex) in info.files" :key="fileIndex">
<file-type :item="file" @click.native="previewFile(file)"/>
</view>
</el-descriptions-item>
<el-descriptions-item label="报价">
<span>¥{{ info.amount }}</span>
</el-descriptions-item>
<el-descriptions-item label="备注">
<span>{{ info.remark }}</span>
</el-descriptions-item>
<el-descriptions-item label="报价单附件">
<view class="mt-15 mr-15" v-for="(file, fileIndex) in info.files" :key="fileIndex">
<file-type :item="file" @click.native="previewFile(file)"/>
</view>
</el-descriptions-item>
</el-descriptions>
<el-dialog title="图片预览" :visible.sync="showImagePreview" width="80%" append-to-body>
<img v-if="previewImageUrl" class="preview-image" :src="previewImageUrl" alt="附件预览"/>
</el-dialog>
</el-dialog>
</template>
<script>
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 {
name: "selfSupportQuoteModal",
components: {FileType},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
id: null,
info: null,
dialogVisible: false,
showImagePreview: false,
previewImageUrl: '',
quoteList: [],
status: 0
}
},
methods: {
open(info) {
this.info = info
console.log(this.info)
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
getFileExt(url = "") {
const cleanUrl = String(url).split("?")[0].split("#")[0]
const match = cleanUrl.match(/\.([a-z0-9]+)$/i)
return match ? match[1].toLowerCase() : ""
},
isImageFile(url) {
return ["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg"].includes(this.getFileExt(url))
},
isPdfFile(url) {
return this.getFileExt(url) === "pdf"
},
isOfficeFile(url) {
return ["doc", "docx", "xls", "xlsx", "ppt", "pptx"].includes(this.getFileExt(url))
},
getOfficePreviewUrl(url) {
return `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(url)}`
},
previewFile(url) {
if (!url) return
if (this.isImageFile(url)) {
this.previewImageUrl = url
this.showImagePreview = true
return
}
if (this.isPdfFile(url)) {
window.open(url, "_blank")
return
}
if (this.isOfficeFile(url)) {
window.open(this.getOfficePreviewUrl(url), "_blank")
return
}
window.open(url, "_blank")
},
openDownload(url) {
this.previewFile(url)
}
}
}
</script>
<style lang="scss" scoped>
.request-header {
border: 1px solid #EDEDED;
background-color: #FFF8F1;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
margin-top: 30px;
text {
text-align: center;
}
}
.quote {
border-left: 1px solid #EDEDED;
border-right: 1px solid #EDEDED;
border-bottom: 1px solid #EDEDED;
display: flex;
align-items: center;
justify-content: center;
padding: 15px;
text {
text-align: center;
}
}
.preview-image {
display: block;
max-width: 100%;
max-height: 75vh;
margin: 0 auto;
}
</style>
+61 -13
View File
@@ -12,23 +12,23 @@
</view>
<view class="mt-15" v-if="cooperateList">
<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>
<text class="flex-1">附件</text>
<text class="flex-1">申请时间</text>
</view>
<view class="quote" v-for="(item, index) in cooperateList" :key="index">
<text class="flex-1">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
}}
</text>
<text class="flex-1">{{ item.user.company.companyName }}</text>
<text class="flex-1">{{ item.name }}</text>
<text class="flex-1"> {{ item.mobile }}</text>
<text class="flex-1">{{ item.remark }}</text>
<view class="flex-1">
<file-type v-for="(file, fileIndex) in item.files" :key="fileIndex" :item="file"
@click.native="previewFile(file)"/>
</view>
<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>
</view>
</view>
</el-dialog>
@@ -50,6 +50,9 @@
<el-button @click="showInfo = false">关闭</el-button>
</template>
</vk-data-dialog>
<el-dialog title="图片预览" :visible.sync="showImagePreview" width="80%" append-to-body>
<img v-if="previewImageUrl" class="preview-image" :src="previewImageUrl" alt="附件预览"/>
</el-dialog>
</view>
</template>
@@ -57,9 +60,11 @@
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 {
name: "spotModal",
components: {FileType},
data() {
return {
provinceData: provinces,
@@ -77,6 +82,8 @@ export default {
],
info: null,
showInfo: false,
showImagePreview: false,
previewImageUrl: '',
}
},
methods: {
@@ -118,6 +125,40 @@ export default {
doShowInfo(info) {
this.info = info
this.showInfo = true
},
getFileExt(url = "") {
const cleanUrl = String(url).split("?")[0].split("#")[0]
const match = cleanUrl.match(/\.([a-z0-9]+)$/i)
return match ? match[1].toLowerCase() : ""
},
isImageFile(url) {
return ["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg"].includes(this.getFileExt(url))
},
isPdfFile(url) {
return this.getFileExt(url) === "pdf"
},
isOfficeFile(url) {
return ["doc", "docx", "xls", "xlsx", "ppt", "pptx"].includes(this.getFileExt(url))
},
getOfficePreviewUrl(url) {
return `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(url)}`
},
previewFile(url) {
if (!url) return
if (this.isImageFile(url)) {
this.previewImageUrl = url
this.showImagePreview = true
return
}
if (this.isPdfFile(url)) {
window.open(url, "_blank")
return
}
if (this.isOfficeFile(url)) {
window.open(this.getOfficePreviewUrl(url), "_blank")
return
}
window.open(url, "_blank")
}
}
}
@@ -152,4 +193,11 @@ export default {
text-align: center;
}
}
.preview-image {
display: block;
max-width: 100%;
max-height: 75vh;
margin: 0 auto;
}
</style>
+518 -43
View File
@@ -6,14 +6,30 @@
<el-row :gutter="20">
<el-col :span="6">
<el-menu @select="menuSelect" :default-active="menuIndex" class="el-menu-vertical-demo">
<!-- <el-menu-item index="1">-->
<!-- <i class="el-icon-warning-outline"></i>-->
<!-- <span slot="title">询价单管理</span>-->
<!-- </el-menu-item>-->
<el-menu-item index="1">
<i class="el-icon-warning-outline"></i>
<span slot="title">询价单管理</span>
</el-menu-item>
<el-menu-item index="0">
<i class="el-icon-edit"></i>
<span slot="title">现货</span>
</el-menu-item>
<el-menu-item index="4">
<i class="el-icon-edit"></i>
<span slot="title">加工单列表</span>
</el-menu-item>
<el-menu-item index="2">
<i class="el-icon-attract"></i>
<span slot="title">旧货</span>
</el-menu-item>
<el-menu-item index="3">
<i class="el-icon-s-order"></i>
<span slot="title">自营报价单列表</span>
</el-menu-item>
<el-menu-item index="5">
<i class="el-icon-document"></i>
<span slot="title">金久信公正银联资料</span>
</el-menu-item>
</el-menu>
</el-col>
<el-col :span="18">
@@ -45,11 +61,28 @@
<!-- </view>-->
<!-- </div>-->
<!-- </el-card>-->
<el-card shadow="never" style="margin-top: 20px;">
<el-card shadow="never" v-if="['2'].includes(menuIndex)">
<el-tabs v-model="oldSignMethod" @tab-click="changeOldStatus">
<el-tab-pane :label="`全部`" name="all">
</el-tab-pane>
<el-tab-pane :label="`线上签约`" name="0"></el-tab-pane>
<el-tab-pane :label="`线下签约`" name="1"></el-tab-pane>
</el-tabs>
</el-card>
<el-card shadow="never" v-if="['3'].includes(menuIndex)">
<el-tabs v-model="selfStatus" @tab-click="getSelfSupportList(1)">
<el-tab-pane :label="`全部`" name="all">
</el-tab-pane>
<el-tab-pane :label="`未被选商`" name="0"></el-tab-pane>
<el-tab-pane :label="`已被选商`" name="1"></el-tab-pane>
</el-tabs>
</el-card>
<el-card shadow="never">
<template v-if="menuIndex === '0'">
<view class="transaction-list">
<view class="item" v-for="(item, index) in spotList" :key="index">
<view class="info">
<view class="info pointer"
@click="navTo(`/pages/spot/goods/detail?id=${item._id}`)">
<view class="title">
<view class="name">
<view class="fabu-status">
@@ -59,8 +92,7 @@
</view>
<view class="sjx"></view>
</view>
<span>{{ item.name }}</span>
<el-tag effect="plain" size="mini" class="el-tag">签单宝</el-tag>
<span class="item-title">{{ item.name }}</span>
</view>
</view>
<view class="caigou">
@@ -100,25 +132,30 @@
</view>
<view class="tool">
<view class="btn">
<el-button size="small" plain style="width: 160px;" v-if="item.status === 0"
@click.native="editEnquiry(item._id)">编辑询价详情
<!-- <el-button size="small" plain style="width: 160px;" v-if="item.status === 0"-->
<!-- @click.native="editEnquiry(item._id)">编辑询价详情-->
<!-- </el-button>-->
<el-button size="small" plain type="danger" style="width: 160px;"
@click.native="navTo(`/pages/spot/goods/detail?id=${item._id}`)">
查看详情
</el-button>
<el-button size="small" type="success" style="width: 160px;" v-else
<el-button size="small" type="success" style="width: 160px;"
v-if="item.status !== 0 && item.signMethod !== 1"
@click.native="navTo('/pages/contract/index')">去创建合同
</el-button>
</view>
<view class="btn">
<el-button size="small" type="danger" v-if="item.status === 0"
@click.native="showSpotModal(item)"
style="width: 160px;">查看收到的报价列表
style="width: 160px;">查看意向合作列表
</el-button>
<el-button size="small" type="success" plain style="width: 160px;" v-else
>查看交易方
</el-button>
</view>
<view class="btn">
<el-button size="small" type="text"
style="width: 160px;">共收到{{ item.quoteNum }}个报价
<el-button size="small" type="text" @click.native="showSpotModal(item)"
style="width: 160px;">共收到{{ item.quoteNum }}个意向
</el-button>
</view>
</view>
@@ -129,12 +166,16 @@
:page-size="pageSize" @current-change="handleCurrentChange">
</el-pagination>
</view>
<view class="w-100p flex justify-end text-main mt-20 "
@click="navTo('/pages/spot/goods/my')">
<text class="pointer">查看历史发布记录</text>
</view>
</view>
</template>
<template v-if="menuIndex === '1'">
<view class="transaction-list">
<view class="item" v-for="(item, index) in enquiryList" :key="index">
<view class="info">
<view class="info pointer" @click="navTo(`/pages/enquiry/detail?id=${item._id}`)">
<view class="title">
<view class="name">
<view class="fabu-status">
@@ -144,13 +185,11 @@
</view>
<view class="sjx"></view>
</view>
<span>{{
item.productList.map(row => `${row.goodsName}(${row.materialQuality})`).join("/")
}}</span>
<span class="item-title">{{ item.title }}</span>
<el-tag effect="plain" size="mini" class="el-tag">
{{ item.signMethod === 0 ? '平台交易' : '线下签单' }}
{{ item.signMethod === 0 ? '线上签约' : '线下签单' }}
</el-tag>
<view v-if="item.status === 0 && item.signMethod === 1"
<view v-if="item.status === 1 && item.signMethod === 1"
class="ml-20 flex justify-start items-center">
<switch-icon theme="outline" size="20" fill="#000000"
strokeLinecap="square"/>
@@ -169,7 +208,7 @@
<view class="infos">
<view class="name">采购量</view>
<view class="unit">{{
item.productList.map(row => row.procureNumber + row.procureUnit).join("/")
item.productNum
}}
</view>
</view>
@@ -192,30 +231,174 @@
<view class="icon">
<img src="/static/images/store/choose.png" alt=""
v-if="item.status === 1"/>
<img src="/static/images/store/unchoose.png" alt="" v-else/>
<img src="/static/images/store/unchoose.png" alt=""
v-if="item.status === 0"/>
</view>
</view>
</view>
<view class="tool">
<view class="btn">
<el-button size="small" plain style="width: 160px;" v-if="item.status === 0"
@click.native="editEnquiry(item._id)">编辑询价详情
<view class="btn">
<el-button size="small" type="success" style="width: 160px;"
v-if="item.status !== 0 && item.signMethod !== 1 && item.contract && item.contract.status === 1"
@click.native="navTo('/pages/contract/index?tab=1')">
签署合同
</el-button>
<el-button size="small" type="success" style="width: 160px;" v-else
@click.native="navTo('/pages/contract/index')">去创建合同
</view>
<view class="btn">
<el-button size="small" type="success" style="width: 160px;"
v-if="item.status !== 0 && item.signMethod !== 1 && item.contract && item.contract.status === 2"
@click.native="navTo('/pages/contract/index?tab=2')">
查看合同
</el-button>
</view>
<view class="btn">
<el-button size="small" type="success" style="width: 160px;"
v-if="item.status !== 0 && item.signMethod !== 1 && (!item.contract || item.contract.status === 0)"
@click.native="navTo('/pages/contract/index?tab=0')">
合同待创建
</el-button>
</view>
<el-button size="small" type="success" style="width: 160px;"
v-if="item.status === 2"
@click.native="navTo('/pages/order/order')">去订单
</el-button>
</view>
<view class="btn">
<!-- <el-button size="small" type="danger" v-if="item.status === 0"-->
<!-- @click.native="showEnquiryModal(item)"-->
<!-- style="width: 160px;">查看收到的报价列表-->
<!-- </el-button>-->
<el-button size="small" type="success" plain style="width: 160px;"
v-if="item.status === 1"
@click.native="showOtherUser(item)">查看交易方
</el-button>
</view>
<!-- <view class="btn">-->
<!-- <el-button size="small" type="text"-->
<!-- style="width: 160px;">共收到{{ item.quoteNum }}个报价-->
<!-- </el-button>-->
<!-- </view>-->
</view>
</view>
<view class="paginatio">
<el-pagination background layout="prev, pager, next" :total="total"
:page-size="pageSize" @current-change="handleCurrentChange">
</el-pagination>
</view>
</view>
</template>
<template v-if="menuIndex === '2'">
<view class="transaction-list">
<view class="item" v-for="(item, index) in oldList" :key="index">
<view class="info pointer">
<view class="title">
<view class="name">
<view class="fabu-status"
@click="navTo(`/pages/index/old/detail?id=${item._id}`)">
<view class="text">{{
item.status === 0 ? '发布中' : '已选商'
}}
</view>
<view class="sjx"></view>
</view>
<span class="item-title"
@click="navTo(`/pages/index/old/detail?id=${item._id}`)">{{
item.title
}}</span>
<template v-if="item.type !== 3">
<el-tag effect="plain" size="mini" class="el-tag">
{{ item.signMethod === 0 ? '线上签约' : '线下签单' }}
</el-tag>
<view v-if="item.status === 1 && item.signMethod === 1"
class="ml-20 flex justify-start items-center">
<switch-icon theme="outline" size="20" fill="#000000"
strokeLinecap="square"/>
<el-tag size="mini" type="warning" class="pointer"
@click.native="oldChangeToOnlineSign(item._id, index)">
切换至线上交易
</el-tag>
</view>
</template>
</view>
</view>
<view class="caigou">
<view class="item">
<view class="icon">
<i class="el-icon-shopping-bag-1"></i>
</view>
<view class="infos">
<view class="name">类型</view>
<view class="unit">{{
item.typeStr
}}
</view>
</view>
</view>
<view class="item" style="margin-left: 100px;">
<view class="icon">
<i class="el-icon-location-outline"></i>
</view>
<view class="infos">
<view class="name">交易地址</view>
<view class="unit"
v-if="item.addressRegion && item.addressRegion.province">
{{
item.addressRegion.province.name
}}{{
item.addressRegion.city.name
}}{{ item.addressRegion.area.name }}{{ item.addressDetail }}
</view>
</view>
</view>
</view>
<view class="sub-title">
<text>交易编号:{{ item._id }}</text>
<text>发布时间:{{ item._add_time_str }}</text>
</view>
<view class="status" v-if="item.type < 3">
<view class="icon">
<img src="/static/images/store/choose.png" alt=""
v-if="item.status === 1"/>
<img src="/static/images/store/unchoose.png" alt=""
v-if="item.status === 0"/>
</view>
</view>
</view>
<view class="tool" v-if="item.type < 3">
<view class="btn">
<el-button size="small" type="success" style="width: 160px;"
v-if="item.status !== 0 && item.signMethod !== 1 && item.contract && item.contract.status === 1"
@click.native="navTo('/pages/contract/index?tab=1')">
签署合同
</el-button>
</view>
<view class="btn">
<el-button size="small" type="success" style="width: 160px;"
v-if="item.status !== 0 && item.signMethod !== 1 && item.contract && item.contract.status === 2"
@click.native="navTo('/pages/contract/index?tab=2')">
查看合同
</el-button>
</view>
<view class="btn">
<el-button size="small" type="success" style="width: 160px;"
v-if="item.status !== 0 && item.signMethod !== 1 && (!item.contract || item.contract.status === 0)"
@click.native="navTo('/pages/contract/index?tab=0')">
合同待创建
</el-button>
</view>
<view class="btn">
<el-button size="small" type="danger" v-if="item.status === 0"
@click.native="showEnquiryModal(item)"
style="width: 160px;">查看收到的报价列表
@click.native="showOldModal(item)"
style="width: 160px;">查看意向合作列表
</el-button>
<el-button size="small" type="success" plain style="width: 160px;" v-else
>查看交易方
@click.native="showOtherUser(item)">查看交易方
</el-button>
</view>
<view class="btn">
<el-button size="small" type="text"
<el-button size="small" type="text" @click.native="showOldModal(item)"
style="width: 160px;">共收到{{ item.quoteNum }}个报价
</el-button>
</view>
@@ -229,6 +412,152 @@
</view>
</view>
</template>
<template v-if="menuIndex === '3'">
<view class="transaction-list">
<view class="item" v-for="(item, index) in selfSupportList.rows" :key="index">
<view class="info ">
<view class="title">
<view class="name">
<view class="fabu-status pointer">
<view class="text">{{
item.sheet.status === 0 ? '待报价' : (item.sheet.status === 1 ? '待选商' : '已选商')
}}
</view>
<view class="sjx pointer"></view>
</view>
</view>
</view>
<view class="caigou">
<view class="item">
<view class="icon">
<i class="el-icon-location-outline"></i>
</view>
<view class="infos">
<view class="name">{{ item.sheet.desc ? `产品描述:${item.sheet.desc}` : '自营询价' }}</view>
<view class="unit" v-if="item.sheet.province">{{
item.sheet.province.name
}}{{ item.sheet.city.name }}
</view>
</view>
</view>
</view>
<view class="sub-title">
<text>发布时间:{{ item.sheet._add_time_str }}</text>
</view>
<view class="status">
<view class="icon">
<img src="/static/images/store/choose.png" alt=""
v-if="item.sheet.status === 2 && item.status === 1"/>
<img src="/static/images/store/unchoose.png" alt=""
v-if="item.sheet.status === 1 && item.status === 0"/>
</view>
</view>
</view>
<view class="tool">
<view class="btn">
<el-button size="small" plain style="width: 160px;margin: 10px"
@click.native="showDetail(item)">查看详情
</el-button>
<el-button size="small" type="success" plain
style="width: 160px;margin: 10px"
v-if="item.sheet.status === 1"
@click.native="toSelfSupportQuote(item)">立即报价
</el-button>
<el-button size="small" type="success" plain
style="width: 160px;margin: 10px"
v-if="item.sheet.status === 2 && item.status === 1"
@click.native="showOtherUser(item)">查看交易方
</el-button>
</view>
</view>
</view>
<view class="paginatio">
<el-pagination background layout="prev, pager, next" :total="selfSupportList.total"
:page-size="pageSize" @current-change="handleCurrentChange">
</el-pagination>
</view>
</view>
</template>
<template v-if="menuIndex === '4'">
<view class="transaction-list">
<view class="item" v-for="(item, index) in processList" :key="index">
<view class="info ">
<view class="title">
<view class="name">
<view class="fabu-status pointer"
@click="navTo(`/pages/process/detail?id=${item._id}`)">
<view class="text">{{
item.status === 0 ? '发布中' : '已选商'
}}
</view>
<view class="sjx"></view>
</view>
<span class="item-title pointer"
@click="navTo(`/pages/process/detail?id=${item._id}`)">{{
item.title
}}</span>
<el-tag effect="plain" size="mini" class="el-tag">
{{ item.signMethod === 1 ? '线下签单' : '线上签约' }}
</el-tag>
</view>
</view>
<view class="caigou">
<view class="item">
<view class="icon">
<i class="el-icon-shopping-bag-1"></i>
</view>
<view class="infos">
<view class="name">加工量</view>
<view class="unit">{{ item.num }}</view>
</view>
</view>
</view>
<view class="sub-title">
<text>交易编号:{{ item.orderNo }}</text>
<text>发布时间:{{ item._add_time_str }}</text>
</view>
</view>
<view class="tool">
<view class="btn">
<el-button size="small" type="success" style="width: 160px;"
v-if="item.status !== 0 && item.signMethod !== 1 && item.contract && item.contract.status === 1"
@click.native="navTo('/pages/contract/index?tab=1')">
签署合同
</el-button>
</view>
<view class="btn">
<el-button size="small" type="success" style="width: 160px;"
v-if="item.status !== 0 && item.signMethod !== 1 && item.contract && item.contract.status === 2"
@click.native="navTo('/pages/contract/index?tab=2')">
查看合同
</el-button>
</view>
<view class="btn">
<el-button size="small" type="success" style="width: 160px;"
v-if="item.status !== 0 && item.signMethod !== 1 && (!item.contract || item.contract.status === 0)"
@click.native="navTo('/pages/contract/index?tab=0')">
合同待创建
</el-button>
</view>
<view class="btn">
<el-button size="small" type="success" plain style="width: 160px;"
@click.native="showOtherUser(item)"
>查看交易方
</el-button>
</view>
</view>
</view>
<view class="paginatio">
<el-pagination background layout="prev, pager, next" :total="total"
:page-size="pageSize" @current-change="handleCurrentChange">
</el-pagination>
</view>
</view>
</template>
<template v-if="menuIndex === '5'">
<notary-union-pay></notary-union-pay>
</template>
</el-card>
</el-col>
</el-row>
@@ -238,6 +567,10 @@
<enquiry-modal ref="enquiryModal"/>
<process-modal ref="processModal"/>
<spot-modal ref="spotModal"/>
<old-modal ref="oldModal"/>
<self-support-quote-modal ref="selfSupportQuoteModal"/>
<self-support-modal ref="selfSupportModal"/>
</view>
</template>
@@ -252,14 +585,22 @@ import {
import EnquiryModal from "./components/enquiryModal.vue";
import ProcessModal from "./components/processModal.vue";
import SpotModal from "./components/spotModal.vue";
import OldModal from "./components/oldModal.vue";
import SelfSupportModal from "./components/selfSupportModal.vue";
import selfSupportQuoteModal from "./components/selfSupportQuoteModal.vue";
import NotaryUnionPay from "../user/components/notary-union-pay.vue";
export default {
components: {
NotaryUnionPay,
selfSupportQuoteModal,
OldModal,
SpotModal,
ProcessModal,
EnquiryModal,
Agreement,
SwitchIcon
SwitchIcon,
SelfSupportModal,
},
data() {
return {
@@ -279,8 +620,7 @@ export default {
label: '自主交易'
}],
input3: '',
menuIndex: '0',
isSign: false,
menuIndex: '1',
formData: {
status: 0,
tradeMethod: null
@@ -289,19 +629,35 @@ export default {
pageSize: 10,
enquiryList: [],
spotList: [],
oldList: [],
selfSupportList: [],
total: 0,
notPickNum: 0,
pickedNum: 0,
noQuoteNum: 0,
allNum: 0,
processList: [],
oldSignMethod: 'all',
selfStatus: 'all',
}
},
onLoad(options) {
if (!vk.getVuex('$user.userInfo.mobile')) {
this.$confirm('请先绑定手机号', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.redirectTo(`/pages/auth/login/wechat?state=jjx_` + vk.getVuex('$user.userInfo.accountType'))
}).catch(() => {
vk.redirectTo(`/pages/auth/login/wechat?state=jjx_` + vk.getVuex('$user.userInfo.accountType'))
})
return
}
if (options.menuIndex) {
this.menuIndex = String(options.menuIndex)
}
if (this.menuIndex === '1') this.getEnquiryList()
else this.getSpotList()
this.handleCurrentChange(1)
},
methods: {
navTo(url) {
@@ -312,29 +668,31 @@ export default {
menuSelect(e) {
this.menuIndex = String(e)
this.formData.status = Number(e)
this.isSign = false
this.handleCurrentChange(1)
},
handleCurrentChange(page) {
if (this.menuIndex === '1') this.getEnquiryList(page)
else this.getSpotList(page)
},
changeStatus() {
if (this.menuIndex === '1') this.getEnquiryList(1)
else this.getSpotList(1)
else if (this.menuIndex === '0') this.getSpotList(page)
else if (this.menuIndex === '2') this.getOldList(page)
else if (this.menuIndex === '3') this.getSelfSupportList(page)
else if (this.menuIndex === '4') this.getProcessList(page)
else if (this.menuIndex === '5') return
},
getEnquiryList(pageIndex = 1) {
vk.callFunction({
url: 'client/enquiry/sheet/pub/getList',
url: 'client/enquiry/sheet/kh/getList',
title: '加载中...',
data: {
userId: vk.getVuex('$user.userInfo._id'),
pageIndex,
pageSize: this.pageSize,
status: this.activeName
status: this.activeName,
isSeller: true
},
success: (res) => {
this.enquiryList = res.rows.map(val => {
let str = ''
val.productNum = ''
if (val.productList !== undefined && val.productList.length > 0 && val.productList[0].addressRegion !== undefined && val.productList[0].addressRegion.length > 0) {
let provinceIndex = 0, cityIndex = 0, areaIndex = 0
this.provinceData.forEach((item, index) => {
@@ -357,17 +715,39 @@ export default {
})
// str += val.productList[0].addressDetail
}
const productNumList = []
val.productList.forEach((item, index) => {
if (item.procureNumber) productNumList.push(item.procureNumber + item.procureUnit)
})
val.productNum = productNumList.join('/')
val.fullAddress = str
return val
})
this.total = res.total
this.allNum = res.all
this.notPickNum = res.notPickNum
this.noQuoteNum = res.noQuoteNum
this.pickedNum = res.pickedNum
this.quoteNum = res.quoteNum
}
})
},
getProcessList(pageIndex = 1) {
vk.callFunction({
url: 'client/process/sheet/pub/getList',
title: '加载中...',
data: {
isUser: true,
otherUid: vk.getVuex('$user.userInfo._id'),
pageIndex,
pageSize: this.pageSize,
status: this.activeName
},
success: (res) => {
this.processList = res.rows
}
})
},
getSpotList(pageIndex = 1) {
vk.callFunction({
url: 'client/spot/goods/kh/getSelfOne',
@@ -384,12 +764,60 @@ export default {
}
})
},
getOldList(pageIndex = 1) {
vk.callFunction({
url: 'client/old/kh/getList',
data: {
userId: vk.getVuex('$user.userInfo._id'),
pageIndex,
pageSize: this.pageSize,
signMethod: this.oldSignMethod === 'all' ? null : this.oldSignMethod,
sellerOnly: true
},
success: (res) => {
this.oldList = res.rows.map(item => {
if (item.type === 0) item.typeStr = '拍卖'
else if (item.type === 1) item.typeStr = '采购'
else if (item.type === 2) {
item.typeStr = '租赁'
if (item.rentType === 0 ) item.typeStr += '-承租'
else item.typeStr += '-出租'
}
else if (item.type === 3) item.typeStr = '物资回收'
if (item.addressRegion && item.addressRegion.length > 0)
item.address = item?.addressRegion[0]?.name + item?.addressRegion[1]?.name + item?.addressRegion[2]?.name + item.addressDetail
return item
})
this.total = res.total
}
})
},
getSelfSupportList(pageIndex = 1) {
vk.callFunction({
url: 'client/selfSupport/kh/getQuoteList',
data: {
pageIndex,
pageSize: this.pageSize,
status: this.selfStatus === 'all' ? null : this.selfStatus
},
success: (res) => {
this.selfSupportList = res
this.total = res.total
}
})
},
toSelfSupportQuote(item) {
vk.navigateTo({url: `/pages/index/self-support/quote?id=${item.quoteId}`})
},
showEnquiryModal({status, quoteList}) {
this.$refs.enquiryModal.open(status, quoteList)
},
showSpotModal({status, cooperateList}) {
this.$refs.spotModal.open(status, cooperateList)
},
showOldModal({_id, status, quoteList, signMethod}) {
this.$refs.oldModal.open(_id, status, quoteList, signMethod)
},
editEnquiry(id) {
vk.navigateTo({
url: `/pages/enquiry/release?id=${id}`
@@ -403,7 +831,50 @@ export default {
}
})
this.enquiryList[index].signMethod = 0
this.$confirm('切换成功,是否去创建合同?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/contract/index'});
})
},
showOtherUser(item) {
if (item.otherUser) {
this.$confirm(`交易方联系方式:${item.otherUser.company.mobile ?? item.otherUser.person.mobile}`, '', {
cancelButtonText: '关闭',
showConfirmButton: false
})
} else {
this.$confirm(`交易方未留下联系方式`, '', {
cancelButtonText: '关闭',
showConfirmButton: false
})
}
},
oldChangeToOnlineSign(id, index) {
vk.callFunction({
url: 'client/old/kh/changeToOnlineSign',
data: {
id
}
})
this.oldList[index].signMethod = 0
this.$confirm('切换成功,是否去创建合同?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/contract/index'});
})
},
showDetail(info) {
info.sheet.quote = info
this.$refs.selfSupportModal.open(info.sheet)
},
changeOldStatus() {
this.getOldList(1)
},
}
}
</script>
@@ -443,6 +914,10 @@ export default {
line-height: 1.6em;
align-items: center;
.item-title {
width: 200px;
}
.fabu-status {
margin-right: 20px;
font-weight: normal;
+155
View File
@@ -0,0 +1,155 @@
<template>
<el-card>
<view class="flex justify-end items-center">
<el-button type="primary" @click="showAdd" v-if="!isAdd">新增收款账户</el-button>
</view>
<view class="mt-20" v-if="isAdd">
<el-form ref="form" :model="form" label-width="120px">
<el-form-item label="类型" required v-if="vk.getVuex('$user.userInfo.accountType') === 2">
<el-select v-model="form.type" placeholder="请选择账号类型">
<el-option label="对公账号" value="company"/>
<el-option label="个人账号" value="person"/>
</el-select>
</el-form-item>
<el-form-item label="开户行" required>
<el-input v-model="form.bankName" placeholder="请输入开户行"/>
</el-form-item>
<el-form-item label="账号名称" required>
<el-input v-model="form.accountName" placeholder="请输入账号名称"/>
</el-form-item>
<el-form-item label="账号" required>
<el-input v-model="form.account" placeholder="请输入账号"/>
</el-form-item>
<el-form-item label="默认账号">
<el-switch v-model="form.isDefault"/>
</el-form-item>
</el-form>
<view class="mt-30 flex justify-center items-center">
<el-button plain @click="isAdd = !isAdd">取消</el-button>
<el-button type="primary" @click="addContact">确定</el-button>
</view>
</view>
<view v-else>
<view class="py-20 border-bottom flex justify-between items-center" v-for="(item, index) in list"
:key="index">
<view class="flex flex-col justify-start items-start">
<view class="flex justify-start items-center">
<el-tag type="primary" size="small" class="mr-25" v-if="item.isDefault">默认</el-tag>
<el-tag type="success" size="small" class="mr-25">{{
item.type === 'company' ? '对公' : '个人'
}}
</el-tag>
<text class="font-bold text-40">{{ item.account }}</text>
</view>
<view class="my-20">{{ item.accountName }}</view>
<view class="my-20">{{ item.bankName }}</view>
</view>
<view class="flex flex-col justify-end">
<el-button type="primary" size="small" @click="edit(item)">编辑</el-button>
<view class="mt-20">
<el-button type="primary" size="small" @click="del(item._id)" plain>删除</el-button>
</view>
</view>
</view>
</view>
</el-card>
</template>
<script>
export default {
name: "account",
data() {
return {
isAdd: false,
form: {
_id: null,
bankName: '',
accountName: '',
account: '',
type: '',
isDefault: false,
},
list: []
}
},
methods: {
async addContact() {
if (!this.form.bankName) {
this.$message.error('请输入开户行')
return
}
if (!this.form.accountName) {
this.$message.error('请输入账号名称')
return
}
if (!this.form.account) {
this.$message.error('请输入账号')
return
}
if (!this.form.type && parseInt(vk.getVuex('$user.userInfo.accountType')) === 2) {
this.$message.error('请选择类型')
return
}
await vk.callFunction({
url: 'client/account/kh/action',
data: this.form
})
this.$message.success(this.form._id ? '修改成功' : '新增成功')
await this.getList()
this.isAdd = false
this.form = {
_id: null,
bankName: '',
accountName: '',
account: '',
type: '',
isDefault: false,
}
},
async getList() {
const {rows} = await vk.callFunction({
url: 'client/account/kh/getList',
})
this.list = rows
},
del(_id) {
this.$confirm('确认删除该账号吗?', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(async () => {
await vk.callFunction({
url: 'client/account/kh/delete',
data: {_id}
})
await this.getList()
})
},
edit(item) {
for (let key in this.form) this.form[key] = item[key]
this.isAdd = true
},
showAdd() {
const user = vk.getVuex('$user.userInfo')
if (vk.getVuex('$user.userInfo.accountType') === 2) {
this.form.account = user.company.companyAccount
this.form.bankName = user.company.companyBankName
this.form.accountName = user.company.companyName
}else {
this.form.account = user.person.personAccount
this.form.bankName = user.person.personBankName
this.form.accountName = user.person.accountName
console.log(user)
}
this.isAdd = true
}
},
mounted() {
if (parseInt(vk.getVuex('$user.userInfo.authStatus')) !== 1) {
this.$message.error('请先完成实名认证')
this.$emit('done', 'fadada')
}
this.getList()
}
}
</script>
+4 -3
View File
@@ -51,7 +51,7 @@
</div>
<div class="pay-price" v-if="billQRCode">
<uv-qrcode ref="qrcode" size="240px" :value="billQRCode"></uv-qrcode>
<div class="pay-desc">请打开手机微信,扫一扫完成支付</div>
<div class="pay-desc">微信、支付宝、云闪付扫码完成支付</div>
<el-button type="success" @click="onPayStatus">已完成支付</el-button>
</div>
<el-button v-else type="danger" @click="onPay">立即支付</el-button>
@@ -202,7 +202,8 @@ export default {
tid: '88880001',
instMid: 'QRPAYDEFAULT',
totalAmount: 1,
notifyUrl: 'https://static-mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5.next.bspapp.com/#/'
// notifyUrl: 'https://static-mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5.next.bspapp.com/#/'
notifyUrl: 'https://tcb-n44byxi8bmrfrki-d4bn1c4a206d.service.tcloudbase.com/pay_notify'
}
}
/**
@@ -214,7 +215,7 @@ export default {
if (result.errCode === 'SUCCESS') {
this.showQrcode = true
this.billQRCode = result.billQRCode
// this.$alert('', '请打开手机微信,扫一扫完成支付', {
// this.$alert('', '微信、支付宝、云闪付扫码完成支付', {
// confirmButtonText: '确定',
// callback: action => {
// this.$message({
+195 -31
View File
@@ -3,9 +3,22 @@
<div slot="header" class="clearfix">
<span>我的名片</span>
</div>
<p class="text-main" v-if="parseInt(vk.getVuex('$user.userInfo.authStatus')) !== 1">请先完成认证</p>
<template
v-else-if="parseInt(vk.getVuex('$user.userInfo.authStatus')) === 1 && vk.getVuex('$user.userInfo.businessCard')">
<div class="text-main flex justify-start items-center">
<info theme="outline" size="18" fill="#a92924" strokeLinecap="square"
style="height: 18px"/>
<span v-if="parseInt(vk.getVuex('$user.userInfo.businessCard.status')) === 0">名片审核中</span>
<span v-if="parseInt(vk.getVuex('$user.userInfo.businessCard.status')) === 2">名片审核失败: {{
vk.getVuex('$user.userInfo.businessCard.refuseReason')
}}</span>
<span v-if="parseInt(vk.getVuex('$user.userInfo.businessCard.status')) === 1">名片审核通过</span>
</div>
</template>
<!-- 表单开始 -->
<vk-data-form
v-if="parseInt(vk.getVuex('$user.userInfo.authStatus')) === 1"
ref="form1"
v-model="form1.data"
:rules="form1.props.rules"
@@ -18,26 +31,87 @@
:before-action="form1.props.beforeAction"
:show-cancel="false"
submit-text="保存名片"
@success="onFormSuccess"
:submit-disabled="!!vk.getVuex('$user.userInfo.businessCard') && parseInt(vk.getVuex('$user.userInfo.businessCard.status')) === 0"
>
<!-- v-slot:editor 中的 editor 对应 columns中的 key, form对应 form1.data keyName 对应 columns中的 key -->
<!-- <template v-slot:editor="{ form, keyName }">
<vk-data-input-editor v-model="form[keyName]" placeholder="开始输入" width="750px"></vk-data-input-editor>
</template> -->
<template v-slot:tips="{ form, keyName }">
<div class="tips">Logo图片标准尺寸:300*300</div>
</template>
<template v-slot:video="{ form, keyName }">
<vk-data-upload v-model="form1.data.video" list-type="text" :limit="1"
accept="video/*">
</vk-data-upload>
</template>
<template v-slot:album="{ form, keyName }">
<vk-data-upload v-model="form1.data.album" list-type="picture-card"
:limit="albumLimit"
accept=".jpg,.jpeg,.png">
</vk-data-upload>
</template>
<template v-slot:memberFeatureTips="{ form, keyName }">
<div class="member-feature-tips">
开通会员可开放更多功能和上传更多图片,如:位置地图、公司新闻、报价次数、报价优惠、购物优惠等(详见个人中心-平台权益公示或详询客服)
</div>
</template>
<template v-slot:productImageList="{ form, keyName }">
<vk-data-upload v-model="form1.data.productImageList" list-type="picture-card"
:limit="productImageLimit"
accept=".jpg,.jpeg,.png">
</vk-data-upload>
</template>
<template v-slot:exampleImageList="{ form, keyName }">
<vk-data-upload v-model="form1.data.exampleImageList" list-type="picture-card"
:limit="productImageLimit"
accept=".jpg,.jpeg,.png">
</vk-data-upload>
</template>
<template v-slot:map="{ form, keyName }">
<div class="mapDiv">
<tdt-map :center="center" :zoom="zoom" @click="mapClick">
<tdt-marker :position="[form1.data.longitude, form1.data.latitude]" :draggable="false"/>
</tdt-map>
</div>
</template>
<template v-slot:serviceTips="{ form, keyName }">
<div class="tips">如需求高标准要求用户,平台提供有偿专业美工设计和修改服务,可拨打客服电话:400-686-5559。</div>
</template>
</vk-data-form>
</el-card>
</template>
<script>
import {Info} from "@icon-park/vue";
import MapInit from '@/util/MapInit'
export default {
components: {Info},
data() {
return {
T: null,
tMap: null,
userInfo: {
accountType: 1,
userLevel: -1,
},
productImageLimit: 2,
albumLimit: 2,
dialogVisible: false,
center: [108.358150, 22.826820],
zoom: 12,
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
companyIntroduction: ''
companyIntroduction: '',
video: '',
longitude: 108.358150,
latitude: 22.826820,
album: [],
productImageList: [],
exampleImageList: [],
},
// 表单属性
props: {
@@ -52,7 +126,8 @@ export default {
key: "logo",
title: "Logo",
type: "image",
limit: 1
limit: 1,
tips: '标准尺寸:300*300',
},
{
key: "personalWechat",
@@ -64,14 +139,26 @@ export default {
key: "companyWechat",
title: "企业微信",
type: "image",
limit: 1
limit: 1,
showRule: (formData) => {
console.log('formData', this.userInfo)
return parseInt(this.userInfo.accountType) === 2
},
},
]
},
{
key: "tips",
title: "",
type: "html"
},
{
key: "position",
title: "职位",
type: "text"
type: "text",
showRule: (formData) => {
return parseInt(this.userInfo.accountType) !== 2
},
},
{
key: "companyMobile",
@@ -95,24 +182,63 @@ export default {
},
{
key: "email",
title: "邮箱",
title: "有效邮箱",
type: "text"
},
{
key: "website",
title: "网址",
type: "text"
type: "text",
showRule: (formData) => {
return parseInt(this.userInfo.accountType) === 2 && parseInt(this.userInfo.userLevel) > 2
},
{
key: "mainBusiness",
title: "主营业务",
type: "textarea"
},
{
key: "companyIntroduction",
title: "企业简介",
type: "editor"
},
{
key: "video",
title: "视频",
type: "html",
showRule: (formData) => {
return parseInt(this.userInfo.accountType) === 2 && parseInt(this.userInfo.userLevel) > 2
},
},
{
key: "album",
title: `首页大图`,
type: "html",
},
{
key: "memberFeatureTips",
title: "",
type: "html",
},
{
key: "productImageList",
title: `产品展示`,
type: "html",
},
{
key: "exampleImageList",
title: `案例展示`,
type: "html",
},
{
key: "map",
title: `地图定位`,
type: "html",
showRule: (formData) => {
return parseInt(this.userInfo.accountType) === 2 && parseInt(this.userInfo.userLevel) > 1
},
},
{
key: "serviceTips",
title: "",
type: "html"
},
],
// 表单验证规则
rules: {
@@ -126,21 +252,11 @@ export default {
message: "请上传个人微信",
trigger: ['blur', 'change']
}],
companyWechat: [{
required: true,
message: "请上传企业微信",
trigger: ['blur', 'change']
}],
personName: [{
required: true,
message: "姓名不能为空",
trigger: ['blur', 'change']
}],
position: [{
required: true,
message: "职位不能为空",
trigger: ['blur', 'change']
}],
address: [{
required: true,
message: "地区不能为空",
@@ -183,14 +299,19 @@ export default {
vk.callFunction({
url: 'client/user/kh/addAuth',
data: {
businessCard: formData
businessCard: {...formData, status: 0},
isBusinessCard: true
},
success: (data) => {
// 成功后的逻辑
this.$message({
type: 'success',
message: '保存成功'
message: '提交成功,新信息将在审核通过后显示',
duration: 5000
})
setTimeout(() => {
window.location.reload()
}, 1000)
}
});
return false;
@@ -202,6 +323,7 @@ export default {
},
created() {
this.getUserInfo()
},
methods: {
getUserInfo() {
@@ -210,15 +332,57 @@ export default {
if (data.userInfo.businessCard) {
this.form1.data = data.userInfo.businessCard
}
// 成功后的逻辑
console.log('用户信息: ', data);
for (let key in this.userInfo) this.userInfo[key] = data.userInfo[key]
if (!data.userInfo.businessCard) {
if (this.userInfo.company.mobile) this.form1.data.companyMobile = this.userInfo.company.mobile
if (this.userInfo.manager.mobile) this.form1.data.managerMobile = this.userInfo.manager.mobile
if (this.userInfo.company.email) this.form1.data.email = this.userInfo.company.email
} else {
if (data.userInfo.businessCard.album && !Array.isArray(data.userInfo.businessCard.album)) this.form1.data.album = [data.userInfo.businessCard.album]
}
if (!this.form1.data.longitude) this.form1.data.longitude = 108.358150
if (!this.form1.data.latitude) this.form1.data.latitude = 22.826820
if (this.userInfo.userLevel === 0) {
this.albumLimit = 1
this.productImageLimit = 2
} else if (this.userInfo.userLevel === 1) {
this.albumLimit = 2
this.productImageLimit = 4
} else if (this.userInfo.userLevel === 2) {
this.albumLimit = 2
this.productImageLimit = 12
} else if (this.userInfo.userLevel > 2) {
this.albumLimit = 4
if (this.userInfo.userLevel > 3) {
this.albumLimit = 6
}
this.productImageLimit = 30
}
}
});
},
mapClick({type, lnglat}) {
if (type === "click") {
this.form1.data.longitude = parseFloat(lnglat.lng);
this.form1.data.latitude = parseFloat(lnglat.lat);
this.$message.success("已选择");
console.log(this.form1.data.longitude, this.form1.data.latitude)
this.$forceUpdate()
}
}
}
}
</script>
<style>
<style scoped>
.mapDiv {
width: 100%;
height: 300px;
}
.member-feature-tips {
color: #a92924;
line-height: 1.8;
}
</style>
+134
View File
@@ -0,0 +1,134 @@
<template>
<el-card>
<view class="flex justify-end items-center">
<el-button type="primary" @click="isAdd = !isAdd" v-if="!isAdd">新增业务联系人</el-button>
</view>
<view class="mt-20" v-if="isAdd">
<el-form ref="form" :model="form" label-width="120px">
<el-form-item label="姓名" required>
<el-input v-model="form.name" placeholder="请输入姓名"/>
</el-form-item>
<el-form-item label="手机号" required>
<el-input v-model="form.phone" placeholder="请输入手机号"/>
</el-form-item>
<el-form-item label="邮箱" required>
<el-input v-model="form.email" placeholder="请输入邮箱"/>
</el-form-item>
<el-form-item label="职位" required>
<el-input v-model="form.position" placeholder="请输入职位"/>
</el-form-item>
<el-form-item label="身份证号" required>
<el-input v-model="form.idCard" placeholder="请输入身份证号"/>
</el-form-item>
</el-form>
<view class="mt-30 flex justify-center items-center">
<el-button plain @click="isAdd = !isAdd">取消</el-button>
<el-button type="primary" @click="addContact">确定</el-button>
</view>
</view>
<view v-else>
<view class="py-20 border-bottom flex justify-between items-center" v-for="(item, index) in list"
:key="index">
<view class="flex flex-col justify-start items-start">
<view>
<text class="font-bold text-40">{{ item.name }}</text>
<text class="ml-20 text-gray">({{ item.position }})</text>
</view>
<view class="my-20">手机号:{{ item.phone }}</view>
<view class="my-20">邮箱:{{ item.email }}</view>
<view class="my-20">身份证号:{{ item.idCard }}</view>
</view>
<view class="flex flex-col justify-end">
<el-button type="primary" size="small" @click="edit(item)">编辑</el-button>
<view class="mt-20">
<el-button type="primary" size="small" @click="del(item._id)" plain>删除</el-button>
</view>
</view>
</view>
</view>
</el-card>
</template>
<script>
export default {
name: "business-contact",
data() {
return {
isAdd: false,
form: {
_id: null,
phone: '',
name: '',
email: '',
position: '',
idCard: '',
},
list: []
}
},
methods: {
async addContact() {
if (!this.form.name) {
this.$message.error('请输入姓名')
return
}
if (!this.form.phone) {
this.$message.error('请输入手机号')
return
}
if (!this.form.email) {
this.$message.error('请输入邮箱')
return
}
if (!this.form.position) {
this.$message.error('请输入职位')
return
}
if (!this.form.idCard) {
this.$message.error('请输入身份证号')
return
}
await vk.callFunction({
url: 'client/businessContact/kh/action',
data: this.form
})
this.$message.success(this.form._id ? '修改成功' : '新增成功')
await this.getList()
this.isAdd = false
this.form = {
_id: null,
phone: '',
name: '',
email: '',
position: '',
}
},
async getList() {
const {rows} = await vk.callFunction({
url: 'client/businessContact/kh/getList',
})
this.list = rows
},
del(_id) {
this.$confirm('确认删除该业务联系人吗?', '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(async () => {
await vk.callFunction({
url: 'client/businessContact/kh/delete',
data: {_id}
})
await this.getList()
})
},
edit(item) {
for (let key in this.form) this.form[key] = item[key]
this.isAdd = true
}
},
mounted() {
this.getList()
}
}
</script>
+171 -82
View File
@@ -2,47 +2,47 @@
<el-card shadow="never">
<view class="welcome">
尊敬的平台商家您好,目前您是我们平台的
<text>{{ userLevelStr }} LV{{ userInfo.userGrade + 1 }}</text>
客户,可享受相应会员权益~
<text>{{ userLevelStr }}</text>
,可享受相应会员权益~
</view>
<view class="user-info">
<view class="left">
<view class="member-card">
<view class="card-name">
<text class="name">{{ userLevelStr }}</text>
<text class="level">LV{{ userInfo.userGrade + 1 }}</text>
<!-- <text class="level">LV{{ userInfo.userGrade + 1 }}</text>-->
<text class="grade">
当前等级
</text>
</view>
<view class="exp-time" v-if="userInfo.upgradeExpiredAt">
有效期至:{{ userInfo.upgradeExpiredAt }}
有效期至:{{ dayjs(userInfo.upgradeExpiredAt).format('YYYY-MM-DD HH:mm:ss') }}
</view>
<view class="progress-box">
<view class="left">
<view class="total-pay">当前交易额</view>
<view class="progress">
<view class="price">{{ userInfo.transactionAmount }}</view>
<view class="desc">还差40W升级LV2</view>
<!-- <view class="desc">还差40W升级LV2</view>-->
</view>
<view class="progress-line">
<el-progress :percentage="30" color="#919191" :stroke-width="8"
:show-text="false"></el-progress>
</view>
<view class="level">
<view class="min-level">L1</view>
<view class="max-level">L10</view>
<!-- <view class="level">-->
<!-- <view class="min-level">L1</view>-->
<!-- <view class="max-level">L10</view>-->
<!-- </view>-->
</view>
</view>
<view class="xufei-btn">
<el-image src="https://oss.wsdns.cn/20231205/aecd46b81f8b452c9294ae36ab8404f5.png"/>
<view class="xufei-btn" @click="showForm('grade')">
<el-image src="/static/images/aecd46b81f8b452c9294ae36ab8404f5.png"/>
</view>
</view>
</view>
</view>
<view class="right">
<view class="bzj-title">当前保证金
<text>{{ userInfo.paidEnsure }}</text>
<text>{{ userInfo.paidEnsure.toFixed(2) }}</text>
元
</view>
<view class="desc">
@@ -50,14 +50,15 @@
</view>
<view class="btn-box">
<el-button @click="showForm('grade')">升级会员</el-button>
<el-button @click="showForm('payment')">去缴纳保证金</el-button>
<el-button @click="showForm('added')">购买增值权益</el-button>
<!-- <el-button @click="showForm('payment')">去缴纳保证金</el-button>-->
<!-- <el-button @click="showForm('added')">购买增值权益</el-button>-->
</view>
</view>
</view>
<view class="equity" v-if="userInfo.userGrade > -1">
<el-image src="https://oss.wsdns.cn/20231205/5ba845c9570e4fba95516b68ae661056.png"/>
</view>
<!-- <view class="equity" v-if="userInfo.userLevel > -1">-->
<!-- <el-image-->
<!-- :src="userLevelList.find(item => parseInt(item.level) === parseInt(userInfo.userLevel)).upgradeDescImg"/>-->
<!-- </view>-->
<div class="grade-list">
<div class="item">
@@ -71,12 +72,12 @@
<div class="title">身份图标</div>
<div class="title" v-for="(item, index) in userLevelList" :key="index">
<el-image class="level"
:src="item.icon[0]"/>
:src="getIcon(item)"/>
</div>
</div>
</div>
<div class="item">
<div class="item-box">
<div class="item" v-if="parseInt(userInfo.authStatus) !== 1">
<div class="item-box" @click="toAuth">
<div class="title">认证缴费</div>
<div class="title red" v-for="(item, index) in userLevelList" :key="index">
去认证<i class="el-icon-arrow-right"></i>
@@ -91,12 +92,20 @@
<template v-if="parseInt(item.amount) === 0">
<div>企业平台认证</div>
<div>VIP认证方法</div>
<div class="red pointer" @click="showForm('fadada')">去升级<i class="el-icon-arrow-right"></i></div>
<div class="red pointer"
v-if="parseInt(userInfo.userLevel) < item.level"
@click="showForm('fadada')">去升级<i
class="el-icon-arrow-right"></i></div>
</template>
<template v-else>
<div>购买</div>
<div>{{ item.amount }}元/年</div>
<div class="red pointer" @click="showForm('grade')">去升级<i class="el-icon-arrow-right"></i></div>
<div v-if="item.ensureAmount && item.ensureAmount > 0">+交易保证金({{ item.ensureAmount }}元)</div>
<div class="red pointer" @click="showForm('grade', item.level)"
v-if="parseInt(userInfo.userLevel) <= item.level">{{
parseInt(userInfo.userLevel) === item.level ? '去续费' : '去升级'
}}<i
class="el-icon-arrow-right"></i></div>
</template>
</div>
</div>
@@ -104,36 +113,111 @@
</div>
<div class="item">
<div class="item-box">
<div class="title">询报价权益</div>
<div class="title" v-for="(item, index) in userLevelList" :key="index">{{
parseInt(item.offerOffRate) === 100 ? '-' : `${parseInt(item.offerOffRate) / 10}折`
}}
<div class="title">升级方式</div>
<div class="title" v-for="(item, index) in userLevelList" :key="index">
<div class="get-way">
<span>{{ formatUpgradeAmount(item.upgradeAmount) }}</span>
</div>
</div>
</div>
</div>
<div class="item">
<div class="item-box">
<div class="title">消息推送模板</div>
<div class="title" v-for="(item, index) in userLevelList" :key="index">{{ formatSwitch(item.showMsg) }}</div>
</div>
</div>
<div class="item">
<div class="item-box">
<div class="title">报价折扣</div>
<div class="title" v-for="(item, index) in userLevelList" :key="index">{{ formatOfferOffRate(item.offerOffRate) }}</div>
</div>
</div>
<div class="item">
<div class="item-box">
<div class="title">每月询价次数</div>
<div class="title" v-for="(item, index) in userLevelList" :key="index">{{ formatEnquiryNum(item.enquiryNum) }}</div>
</div>
</div>
<div class="item">
<div class="item-box">
<div class="title">增值服务</div>
<div class="title" v-for="(item, index) in userLevelList" :key="index">{{ formatDiscount(item.valueAddRate) }}</div>
</div>
</div>
<div class="item">
<div class="item-box">
<div class="title">广告位折扣</div>
<div class="title" v-for="(item, index) in userLevelList" :key="index">{{ formatDiscount(item.adRate) }}</div>
</div>
</div>
<div class="item">
<div class="item-box">
<div class="title">推荐升级</div>
<div class="title" v-for="(item, index) in userLevelList" :key="index">{{ formatRecommendUpgrade(item.recommendUpgrade) }}</div>
</div>
</div>
<div class="item">
<div class="item-box">
<div class="title">加工厂店铺</div>
<div class="title" v-for="(item, index) in userLevelList" :key="index">可授权</div>
</div>
</div>
<div class="item">
<div class="item-box">
<div class="title">加工厂图片数</div>
<div class="title" v-for="(item, index) in userLevelList" :key="index">{{ formatFactoryPicNum(item.factoryPicNum) }}</div>
</div>
</div>
<div class="item">
<div class="item-box">
<div class="title">邀请说明</div>
<div class="title" v-for="(item, index) in userLevelList" :key="index">
<div class="get-way">
<span>{{ item.upgradeDesc || '-' }}</span>
</div>
</div>
</div>
</div>
</div>
<u-gap height="80"></u-gap>
<div>
<el-select v-model="orderStatusFilter" placeholder="订单状态筛选" @change="getUserPayEnsureList(1)">
<el-option label="全部状态" :value="null"></el-option>
<el-option label="已支付" :value="4"></el-option>
<el-option label="退款审核中" :value="5"></el-option>
<el-option label="已退款" :value="6"></el-option>
</el-select>
</div>
<div class="grade-list">
<div class="item">
<div class="item-box" style="background-color: #f7f7f7">
<div class="title">时间</div>
<div class="title">详情</div>
<div class="title">金额</div>
<div class="title">订单状态</div>
<div class="title">会员权益</div>
</div>
</div>
<div class="item" v-for="(item, index) in userPayEnsureList" :key="index" @click="onChange(index)">
<div class="item-box">
<div class="title">{{ item._add_time_str }}</div>
<div class="title">缴纳保证金</div>
<div class="title">{{ item.type === 2 ? '缴纳保证金' : '会员升级' }}</div>
<div class="title">¥{{ item.amount }}</div>
<div class="title">
<span v-if="item.orderStatus === 0">待支付</span>
<span v-else-if="item.orderStatus === 5">退款审核中</span>
<span v-else-if="item.orderStatus === 6">已退款</span>
<span v-else>已支付</span>
</div>
<div class="title">-</div>
</div>
</div>
<view class="paginatio">
<el-pagination
@current-change="search"
@current-change="getUserPayEnsureList"
background
layout="prev, pager, next"
:page-size="pageSize"
@@ -170,57 +254,12 @@ export default {
showQrcode: false,
billQRCode: '',
gradeIndex: 0,
gradeList: [
{
id: 1,
grade: '身份图标',
code: '金久信认证(图)',
name: '供应商实力考查',
type: '元/次',
price: 150,
company: '金久信',
select: 1,
comments: '实现视频并记录存档,收集相关纸质文件'
},
{
id: 2,
grade: '认证缴费',
code: '黄金VIP(图)',
name: '供应商实力考查',
type: '元/次',
price: 150,
company: '金久信',
select: 0,
comments: '实现视频并记录存档,收集相关纸质文件'
},
{
id: 3,
grade: '获得身份方式',
code: '铂金VIP(图)',
name: '供应商实力考查',
type: '元/次',
price: 150,
company: '金久信',
select: 0,
comments: '实现视频并记录存档,收集相关纸质文件'
},
{
id: 4,
grade: '获得身份方式',
code: '钻石VIP',
name: '供应商实力考查',
type: '元/次',
price: 150,
company: '金久信',
select: 0,
comments: '实现视频并记录存档,收集相关纸质文件'
},
],
userLevelList: [],
userLevelStr: '普通用户',
userPayEnsureList: [],
pageSize: 10,
total: 0
total: 0,
orderStatusFilter: null
}
},
created() {
@@ -228,12 +267,53 @@ export default {
this.getUserPayEnsureList()
},
methods: {
dayjs,
getIcon(item) {
if (Array.isArray(item.icon)) return item.icon[0]
return item.icon || ''
},
formatSwitch(value) {
return parseInt(value) === 1 ? '支持' : '不支持'
},
formatOfferOffRate(value) {
const rate = parseInt(value)
if (rate === 0) return '不限次数,免费'
if (rate === 100) return '-'
return `${rate / 10}折`
},
formatDiscount(value) {
const rate = parseInt(value)
if (!rate || rate === 100) return '-'
return `${rate / 10}折`
},
formatEnquiryNum(value) {
const num = parseInt(value)
if (!num) return '-'
return `${num}次/月`
},
formatRecommendUpgrade(value) {
const num = parseInt(value)
if (!num) return '-'
return `推荐${num}位黄金会员`
},
formatFactoryPicNum(value) {
const num = parseInt(value)
if (!num) return '-'
return `${num}张`
},
formatUpgradeAmount(value) {
const amount = parseFloat(value)
if (!amount) return '-'
return `交易额每${amount / 10000}万升一级,共十级`
},
getUserPayEnsureList(pageIndex = 1) {
vk.callFunction({
url: 'client/order/kh/getList',
data: {
pageIndex,
pageSize: this.pageSize
pageSize: this.pageSize,
orderStatus: this.orderStatusFilter,
type: [2, 3]
},
success: (res) => {
this.total = res.total
@@ -245,6 +325,7 @@ export default {
vk.userCenter.getCurrentUserInfo({
success: (data) => {
this.userInfo = data.userInfo
console.log(this.userInfo.paidEnsure)
if (data.userInfo.userLevel > -1) {
this.userLevelStr = this.userLevelList.find(level => parseInt(level.level) === parseInt(data.userInfo.userLevel)).name
}
@@ -257,8 +338,8 @@ export default {
navTo(url) {
vk.navigateTo(url);
},
showForm(index) {
this.$emit('done', index);
showForm(index, extra) {
this.$emit('done', index, extra);
},
getUserLevelList() {
vk.callFunction({
@@ -272,6 +353,9 @@ export default {
this.getUserInfo()
}
});
},
toAuth() {
this.$emit('done', 'fadada')
}
}
}
@@ -294,6 +378,10 @@ export default {
.item-box {
display: flex;
:first-child {
width: 100px;
}
.title {
padding: 10px;
border-right: 1px solid #eee;
@@ -304,8 +392,8 @@ export default {
text-align: center;
.level {
width: 80px;
height: 80px;
width: 60px;
height: 60px;
}
}
@@ -505,6 +593,7 @@ export default {
width: 100px;
margin-left: 20px;
margin-top: 12px;
cursor: pointer;
}
}
}
@@ -579,8 +668,8 @@ export default {
}
.level {
width: 80px;
height: 80px;
width: 60px;
height: 60px;
}
}
+334
View File
@@ -0,0 +1,334 @@
<template>
<el-card shadow="never">
<p class="text-main font-bold mb-20">加工商状态: {{
(isNaN(factoryStatus) || factoryStatus === -1) ? '未提交审核' : (factoryStatus === 0 ? '审核中' : (factoryStatus === 1 ? '审核通过' : `审核不通过:${refuseReason}`))
}}</p>
<p class="text-main font-bold mb-20" v-if="factoryStatus === 0">
温馨提示:审核中不能修改内容,如有数据变更审核通过后再次修改提交。
</p>
<el-form ref="form" :model="form" label-width="140px">
<el-divider>
<span class="text-50 text-main font-bold">工厂信息</span>
</el-divider>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="成立年限" required>
<el-input v-model="form.year" placeholder="请输入成立年限" type="number"
:readonly="factoryStatus === 0">
<template #append>年</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="近2年产值" required>
<el-input v-model="form.yearsIncome" placeholder="请输入近2年产值" type="number"
:readonly="factoryStatus === 0">
<template #append>万元</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10" class="mt-20">
<el-col :span="12">
<el-form-item label="员工人数" required>
<el-input v-model="form.employeeNum" placeholder="请输入员工人数" type="number"
:readonly="factoryStatus === 0">
<template #append>人</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="流水线数量" required>
<el-input v-model="form.flowNum" placeholder="请输入流水线数量" type="number"
:readonly="factoryStatus === 0">
<template #append>条</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10" class="mt-20">
<el-col :span="12">
<el-form-item label="厂房归属" required>
<el-input v-model="form.blongTo" placeholder="请输入厂房归属" :readonly="factoryStatus === 0"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="厂房面积" required>
<el-input v-model="form.size" placeholder="请输入厂房面积" :readonly="factoryStatus === 0">
<template #append>平方米</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="所在地" required>
<el-cascader :options="options" :props="{label: 'name', value: 'code'}" v-model="addressRegion"
clearable :disabled="factoryStatus === 0"/>
</el-form-item>
<el-form-item label="主营类别" required>
<el-select multiple v-model="form.mainSpotCategory" style="width: 100%">
<el-option v-for="(item, index) in goodsCate" :key="index" :value="item.name">{{ item.name }}</el-option>
</el-select>
</el-form-item>
<el-form-item label="主营工艺和业务范围">
<el-input v-model="form.mainProcess" placeholder="请输入主营工艺和业务范围"
:readonly="factoryStatus === 0"/>
</el-form-item>
<el-form-item label="服务信息">
<el-input v-model="form.serviceInfo" placeholder="请输入服务信息" type="textarea"
:readonly="factoryStatus === 0"/>
</el-form-item>
<el-form-item label="视频">
<vk-data-upload v-model="form.video" list-type="text"
accept="video/*">
</vk-data-upload>
</el-form-item>
<el-divider>
<span class="text-50 text-main font-bold">设备信息</span>
</el-divider>
<el-row :gutter="10" class="p-20 bg-gray-light">
<el-col :span="3">
<p class="text-center">设备名称</p>
</el-col>
<el-col :span="3">
<p class="text-center">设备数量({{ deviceNum }}台)</p>
</el-col>
<el-col :span="3">
<p class="text-center">设备来源</p>
</el-col>
<el-col :span="3">
<p class="text-center">设备类型</p>
</el-col>
<el-col :span="3">
<p class="text-center">品牌</p>
</el-col>
<el-col :span="3">
<p class="text-center">型号</p>
</el-col>
<el-col :span="3">
<p class="text-center">投产年限</p>
</el-col>
<el-col :span="3">
<p class="text-center">特点描述</p>
</el-col>
</el-row>
<el-row :gutter="10" class="p-20 bg-gray-light pos-r" v-for="(item, index) in form.deviceList" :key="index">
<el-col :span="3">
<el-input v-model="form.deviceList[index].name" placeholder="设备名称"
:readonly="factoryStatus === 0"/>
</el-col>
<el-col :span="3">
<el-input v-model="form.deviceList[index].num" placeholder="设备数量" type="number"
:readonly="factoryStatus === 0"/>
</el-col>
<el-col :span="3">
<el-select v-model="form.deviceList[index].source" placeholder="请选择设备来源"
:disabled="factoryStatus === 0">
<el-option v-for="item in deviceSource" :key="item" :label="item" :value="item"/>
</el-select>
</el-col>
<el-col :span="3">
<el-select v-model="form.deviceList[index].type" placeholder="请选择设备类型"
:disabled="factoryStatus === 0">
<el-option v-for="item in deviceType" :key="item" :label="item" :value="item"/>
</el-select>
</el-col>
<el-col :span="3">
<el-input v-model="form.deviceList[index].brand" placeholder="品牌"
:readonly="factoryStatus === 0"/>
</el-col>
<el-col :span="3">
<el-input v-model="form.deviceList[index].model" placeholder="型号"
:readonly="factoryStatus === 0"/>
</el-col>
<el-col :span="3">
<el-input v-model="form.deviceList[index].year" placeholder="投产年限" type="number"
:readonly="factoryStatus === 0"/>
</el-col>
<el-col :span="3">
<el-input v-model="form.deviceList[index].desc" placeholder="特点描述"
:readonly="factoryStatus === 0"/>
</el-col>
<i class="el-icon-remove pointer text-main text-40 pos-a" style="right: -10px; top: 20px"
@click="remove(index)" v-if="factoryStatus !== 0"/>
</el-row>
<div class="mt-20 text-center">
<el-button type="text" @click.native="addDevice" v-if="factoryStatus !== 0">添加设备</el-button>
</div>
<el-divider>
<span class="text-50 text-main font-bold">工厂实景</span>
</el-divider>
<vk-data-upload v-model="form.album" :limit="userLevel.factoryPicNum"
:disabled="factoryStatus === 0"></vk-data-upload>
<div class="mt-20 text-center">
<el-button type="primary" @click.native="submit" v-if="factoryStatus !== 0">提交</el-button>
</div>
</el-form>
</el-card>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import citys from "@/uni_modules/vk-uview-ui/libs/address/citys.json";
export default {
name: "factory",
data() {
return {
form: {
year: null,
yearsIncome: null,
employeeNum: null,
flowNum: null,
blongTo: null,
size: null,
addressRegion: {
province: null,
city: null,
},
mainProcess: null,
serviceInfo: null,
video: '',
deviceList: [],
album: [],
mainSpotCategory: [],
},
options: [],
addressRegion: [],
deviceSource: ['国产', '进口'],
deviceType: ['生产设备', '维护设备'],
userLevel: {
factoryPicNum: 0
},
factoryStatus: parseInt(vk.getVuex('$user.userInfo.factoryStatus')),
refuseReason: '',
goodsCate: []
}
},
methods: {
addDevice() {
this.form.deviceList.push({
name: null,
num: null,
source: null,
type: null,
brand: null,
model: null,
year: null,
desc: null
})
},
getGoodsCate() {
vk.callFunction({
url: 'client/process/category/pub/getList',
success: (res) => {
this.goodsCate = res.data
}
});
},
remove(index) {
this.form.deviceList.splice(index, 1)
},
async getUserLevelInfo() {
const res = await vk.callFunction({
url: "client/userLevel/kh/getInfoByUser",
})
if (res) {
if (!res.data) {
this.$message({
type: 'error',
message: '请先完成认证'
})
setTimeout(() => {
this.$emit('done', 'fadada')
}, 1000)
return
}
this.userLevel.factoryPicNum = res.factoryPicNum
}
},
async submit() {
if (!this.form.year) return this.$message.error('请输入投产年限')
if (!this.form.yearsIncome) return this.$message.error('请输入年收入')
if (!this.form.employeeNum) return this.$message.error('请选输入员工人数')
if (!this.form.flowNum) return this.$message.error('请输入流水线数量')
if (!this.form.blongTo) return this.$message.error('请输入厂房归属')
if (!this.form.size) return this.$message.error('请输入厂房面积')
if (this.addressRegion.length === 0) return this.$message.error('请选择所在地')
if (this.form.deviceList.length === 0) return this.$message.error('请添加设备信息')
if (this.form.mainSpotCategory.length === 0) return this.$message.error('请选择主营类别')
// if (this.form.album.length === 0) return this.$message.error('请上传工厂实景图')
const province = provinces.find(item => item.code === this.addressRegion[0])
const city = province.children.find(item => item.code === this.addressRegion[1])
const addressRegion = {
province: {
code: province.code,
name: province.name,
},
city: {
code: city.code,
name: city.name,
}
}
await vk.callFunction({
url: "client/factory/kh/addUpdate",
data: {
year: this.form.year,
yearsIncome: this.form.yearsIncome,
employeeNum: this.form.employeeNum,
flowNum: this.form.flowNum,
blongTo: this.form.blongTo,
size: this.form.size,
addressRegion,
mainProcess: this.form.mainProcess,
serviceInfo: this.form.serviceInfo,
deviceList: this.form.deviceList,
album: this.form.album,
video: this.form.video,
mainSpotCategory: this.form.mainSpotCategory,
}
})
this.$message.success('提交成功')
this.factoryStatus = 0
},
async getInfo() {
const res = await vk.callFunction({
url: "client/factory/kh/getInfo",
})
if (res) {
for (let key in this.form) this.form[key] = res[key]
this.addressRegion = [res.addressRegion.province.code, res.addressRegion.city.code]
if (res.status === 2) this.refuseReason = res.refuseReason
}
}
},
mounted() {
this.options = provinces.map(item => {
item.children = [];
return item
})
this.options.forEach((province, index) => {
citys[index].forEach(city => {
this.options[index].children.push(city)
})
})
this.getGoodsCate()
this.getUserLevelInfo()
vk.userCenter.getCurrentUserInfo({
success: (data) => {
const factoryStatus = parseInt(data.userInfo.factoryStatus)
this.factoryStatus = (isNaN(factoryStatus) || factoryStatus === -1) ? -1 : factoryStatus
if (this.factoryStatus > -1) this.getInfo()
}
})
},
computed: {
deviceNum() {
let num = 0
this.form.deviceList.forEach(item => {
if (item.num && !isNaN(parseInt(item.num))) num += parseInt(item.num)
})
return num
}
}
}
</script>
+278 -68
View File
@@ -5,12 +5,56 @@
</div>
<div class="grade-list">
<div class="item pointer" v-for="(item,index) in gradeList" :key="index"
:class="gradeIndex === index ? 'active' : ''" @click="onChange(index)">
:class="[parseInt(gradeIndex) === index ? 'active' : '', item.disabled ? 'disabled' : '']"
@click="onChange(index)">
<div class="item-box">
<div class="title">{{ item.name }}</div>
<div class="title">
<div class="info">
<el-image v-if="getIcon(item)" class="level-icon" :src="getIcon(item)"></el-image>
<div class="name">{{ item.name }}</div>
</div>
<div class="detail">
<div class="price-line">
<span>{{ item.amount }}元/年</span>
<span v-if="parseFloat(item.ensureAmount) > 0">+交易保证金</span>
<span v-if="parseFloat(item.ensureAmount) > 0">+交易保证金({{ item.ensureAmount }}元)</span>
</div>
<div class="meta-list">
<div class="meta-item">
<span class="label">升级交易额</span>
<span class="value">{{ formatUpgradeAmount(item.upgradeAmount) }}</span>
</div>
<div class="meta-item">
<span class="label">消息推送模板</span>
<span class="value">{{ formatSwitch(item.showMsg) }}</span>
</div>
<div class="meta-item">
<span class="label">报价折扣</span>
<span class="value">{{ formatOfferOffRate(item.offerOffRate) }}</span>
</div>
<div class="meta-item">
<span class="label">每月询价次数</span>
<span class="value">{{ formatEnquiryNum(item.enquiryNum) }}</span>
</div>
<div class="meta-item">
<span class="label">增值服务折扣</span>
<span class="value">{{ formatDiscount(item.valueAddRate) }}</span>
</div>
<div class="meta-item">
<span class="label">广告位折扣</span>
<span class="value">{{ formatDiscount(item.adRate) }}</span>
</div>
<div class="meta-item">
<span class="label">推荐升级</span>
<span class="value">{{ formatRecommendUpgrade(item.recommendUpgrade) }}</span>
</div>
<div class="meta-item">
<span class="label">加工厂图片数</span>
<span class="value">{{ formatFactoryPicNum(item.factoryPicNum) }}</span>
</div>
</div>
<div class="desc-line" v-if="item.upgradeDesc">
<span class="label">邀请说明</span>
<span class="value">{{ item.upgradeDesc }}</span>
</div>
</div>
</div>
<div class="select">
@@ -19,11 +63,45 @@
</div>
</div>
</div>
<div class="item pointer"
:class="[gradeIndex === -2 ? 'active' : '']" @click="onChange(-2)">
<div class="item-box">
<div class="title">交易保证金缴纳</div>
<div class="title">
<el-select v-model="ensureAmount" size="small">
<el-option
v-for="item in ensureList"
:key="item.amount"
:label="`${item.amount.toFixed(2)}元`"
:value="item.amount">
</el-option>
</el-select>
</div>
</div>
<div class="select">
<div class="icon">
<i class="el-icon-check"></i>
</div>
</div>
</div>
<div class="flex justify-start items-center mt-20" v-if="gradeIndex === -999">
<div @click="ensureIndex = 0"
:style="{backgroundColor: ensureIndex === 0 ? '#a92924' : '', color: ensureIndex === 0 ? 'white' : ''}"
class="border rounded p-20">50000元保证金
</div>
<div @click="ensureIndex = 1"
:style="{backgroundColor: ensureIndex === 1 ? '#a92924' : '', color: ensureIndex === 1 ? 'white' : ''}"
class="border rounded p-20 mx-20">100000元保证金
</div>
<div @click="ensureIndex = 2"
:style="{backgroundColor: ensureIndex === 2 ? '#a92924' : '', color: ensureIndex === 2 ? 'white' : ''}"
class="border rounded p-20">200000元保证金
</div>
</div>
</div>
<div class="bzj-readme">
<div class="sub-title">保证金说明</div>
<div class="content">
保证金说明内容...
<div class="sub-title">保证金协议</div>
<div class="content" v-html="desc">
</div>
</div>
<div class="payment">
@@ -41,7 +119,7 @@
</div>
<div class="pay-price" v-if="billQRCode">
<uv-qrcode ref="qrcode" size="240px" :value="billQRCode"></uv-qrcode>
<div class="pay-desc">请打开手机微信,扫一扫完成支付</div>
<div class="pay-desc">微信、支付宝、云闪付扫码完成支付</div>
<el-button type="success" @click="onPayStatus">已完成支付</el-button>
</div>
<el-button v-else type="danger" @click="onPay">立即支付</el-button>
@@ -67,80 +145,135 @@ export default {
payment: ["银联支付"],
showQrcode: false,
billQRCode: '',
gradeIndex: 1,
gradeList: []
gradeIndex: null,
desc: '',
gradeList: [],
ensureList: [],
ensureAmount: null,
ensureIndex: 0
}
},
props: {
extra: {
type: Number,
default() {
return undefined
}
}
},
created() {
this.getUserLevelList()
this.getDesc()
this.getEnsureConfig()
},
methods: {
getIcon(item) {
if (Array.isArray(item.icon)) return item.icon[0]
return item.icon || ''
},
formatSwitch(value) {
return parseInt(value) === 1 ? '支持' : '不支持'
},
formatOfferOffRate(value) {
const rate = parseInt(value)
if (rate === 0) return '不限次数,免费'
if (rate === 100) return '-'
return `${rate / 10}折`
},
formatDiscount(value) {
const rate = parseInt(value)
if (!rate || rate === 100) return '-'
return `${rate / 10}折`
},
formatEnquiryNum(value) {
const num = parseInt(value)
if (!num) return '-'
return `${num}次/月`
},
formatRecommendUpgrade(value) {
const num = parseInt(value)
if (!num) return '-'
return `推荐${num}位黄金会员可升级`
},
formatFactoryPicNum(value) {
const num = parseInt(value)
if (!num) return '-'
return `${num}张`
},
formatUpgradeAmount(value) {
const amount = parseFloat(value)
if (!amount) return '-'
return `每${amount / 10000}万升一级,共十级`
},
getUserInfo() {
vk.userCenter.getCurrentUserInfo({
success: (data) => {
if (data.userInfo.businessCard) {
this.form1.data = data.userInfo.businessCard
this.gradeList.map(item => {
item.disabled = false
if (data.userInfo.userLevel && parseInt(data.userInfo.userLevel) > -1) {
item.disabled = parseInt(item.level) < parseInt(data.userInfo.userLevel)
}
return item
})
for (let i in this.gradeList) {
if (!this.gradeList[i].disabled) {
this.gradeIndex = i
break
}
}
console.log(this.extra)
if (this.extra) {
for (let i in this.gradeList) {
if (this.gradeList[i].level === this.extra) {
this.gradeIndex = i
break
}
}
}
// 成功后的逻辑
console.log('用户信息: ', data);
}
});
},
onChange(index) {
if (index === -2) this.gradeIndex = index
else {
if (this.gradeList[index].disabled) return
this.gradeIndex = index
}
},
async onPay() {
const res = await vk.callFunction({
let res
if (this.gradeIndex === -2) {
res = await vk.callFunction({
url: 'client/order/kh/add',
data: {
goods: {
name: '会员升级',
name: `交易保证金-${this.ensureAmount}元`,
amount: this.ensureAmount,
cover: null
},
type: 2,
goodsId: null,
num: 1,
}
})
} else {
res = await vk.callFunction({
url: 'client/order/kh/add',
data: {
goods: {
name: `会员升级-${this.gradeList[this.gradeIndex].name}`,
amount: this.amount,
cover: null
},
type: 3,
goodsId: parseInt(this.gradeList[this.gradeIndex].level),
ensureIndex: this.ensureIndex,
num: 1,
}
})
const requestTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss')
const timestamp = dayjs().format('YYYYMMDDHHmmss')
let data = {
queryUrl: 'https://test-api-open.chinaums.com/v1/netpay/bills/get-qrcode',
timestamp,
nonce: 'rp84ufhfn20yneo3tp',
content: {
billNo: res.data,
requestTimestamp,
mid: '898201612345678',
tid: '88880001',
instMid: 'QRPAYDEFAULT',
totalAmount: 1,
notifyUrl: 'https://static-mp-0737e52b-fffa-4223-bcdf-d4ad3d9968a5.next.bspapp.com/#/'
}
}
/**
* 调用函数
*/
sdk.exec(data).then(res => {
const h = this.$createElement;
const result = JSON.parse(res);
if (result.errCode === 'SUCCESS') {
this.showQrcode = true
this.billQRCode = result.billQRCode
// this.$alert('', '请打开手机微信,扫一扫完成支付', {
// confirmButtonText: '确定',
// callback: action => {
// this.$message({
// type: 'success',
// message: `已完成支付`
// });
// }
// });
}
})
vk.redirectTo({url: `/pages/index/shop/pay?id=${res.data}`})
},
getUserLevelList() {
vk.callFunction({
@@ -151,13 +284,33 @@ export default {
},
success: (data) => {
this.gradeList = data.rows.filter(item => parseFloat(item.amount) > 0)
this.getUserInfo()
}
});
}
},
async getDesc() {
const res = await vk.callFunction({
url: 'client/dict/pub/getDetail',
data: {
id: '880c33886636217300376edd5a56e1e6'
},
})
this.desc = res.content
},
async getEnsureConfig() {
const {rows} = await vk.callFunction({
url: 'client/ensureConfig/pub/getList',
})
this.ensureList = rows
this.ensureAmount = this.ensureList[0].amount
},
},
computed: {
amount() {
return parseFloat(this.gradeList[this.gradeIndex].amount) + parseFloat(this.gradeList[this.gradeIndex].ensureAmount)
if (this.gradeIndex === -2) return this.ensureAmount
else if (this.gradeIndex === 2) return parseFloat(this.gradeList[this.gradeIndex].amount) + [50000, 100000, 200000][this.ensureIndex]
else return parseFloat(this.gradeList[this.gradeIndex].amount) + parseFloat(this.gradeList[this.gradeIndex].ensureAmount)
}
},
}
@@ -177,12 +330,14 @@ export default {
.item {
position: relative;
border: 1px solid #eee;
margin-bottom: 12px;
.item-box {
display: flex;
align-items: stretch;
.title {
padding: 10px;
padding: 16px;
display: flex;
align-items: center;
flex: 1;
@@ -191,21 +346,72 @@ export default {
}
.info {
padding: 10px;
width: 180px;
min-width: 180px;
padding: 16px 12px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 230px;
border-right: 1px solid #eee;
text-align: center;
.price {
font-size: 28px;
.level-icon {
width: 56px;
height: 56px;
margin-bottom: 10px;
}
.desc {
color: #ccc;
.name {
font-size: 18px;
font-weight: bold;
}
}
.detail {
padding: 16px;
display: flex;
flex: 1;
flex-direction: column;
justify-content: center;
.price-line {
display: flex;
flex-wrap: wrap;
gap: 8px;
font-size: 16px;
font-weight: bold;
margin-bottom: 12px;
}
.meta-list {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 8px 20px;
}
.meta-item,
.desc-line {
display: flex;
align-items: flex-start;
line-height: 1.6;
.label {
color: #666;
min-width: 90px;
}
.value {
color: #333;
word-break: break-all;
}
}
.desc-line {
margin-top: 10px;
}
}
}
.select {
@@ -217,17 +423,16 @@ export default {
border: 2px solid #bf2b28 !important;
.item-box {
.title {
color: #bf2b28;
}
.info {
.price {
.name {
color: #bf2b28;
}
}
.desc {
color: #ccc;
.detail {
.price-line,
.value {
color: #bf2b28;
}
}
}
@@ -288,4 +493,9 @@ export default {
font-size: 16px;
line-height: 2em;
}
.disabled {
cursor: not-allowed;
background-color: #F0F0F0;
}
</style>
+2 -2
View File
@@ -77,13 +77,13 @@ export default {
},
{
key: "headPhotoPath",
title: "身份证正面",
title: "身份证头像面",
type: "image",
limit: 1
},
{
key: "backgroundIdCardPath",
title: "身份证反面",
title: "身份证国徽面",
type: "image",
limit: 1
},

Some files were not shown because too many files have changed in this diff Show More