1、新增旧货市场

2、新增用户等级
This commit is contained in:
2023-12-10 14:53:07 +08:00
parent a45d185c64
commit 17b2d8f117
112 changed files with 10795 additions and 6362 deletions
+13 -6
View File
@@ -51,7 +51,8 @@
</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.files[0])">
<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"/>
<view class="content">
<text class="title">{{ item.name }}</text>
@@ -108,12 +109,18 @@ export default {
})
this.list = rows
},
toMySchool(){
toMySchool() {
vk.navigateTo({
url: '/pages/user/school'
})
},
openDownload(url){
async openDownload(id, url) {
await vk.callFunction({
url: 'client/article/list/pub/addDownload',
data: {
id
}
})
window.open(url)
}
},
@@ -202,7 +209,7 @@ export default {
justify-content: flex-start;
flex-direction: column;
.title{
.title {
font-size: 20px;
}
@@ -219,11 +226,11 @@ export default {
border-right: 2px solid #bbb;
}
:first-child{
:first-child {
padding-left: 0;
}
:last-child{
:last-child {
border-right: none
}
}
+3 -2
View File
@@ -125,6 +125,9 @@
}
};
},
onLoad(option){
if (option.code) this.form1.inviteCode = option.code
},
methods: {
sendSmsCode() {
if (timer != null) {
@@ -156,8 +159,6 @@
});
},
handleSubmit() {
if (this.testForm()) {
const {
mobile, // 手机号
+5
View File
@@ -382,6 +382,11 @@ export default {
this.isSign = false
this.query(1)
}
}else {
this.menuIndex = '0'
this.formData.status = 0
this.isSign = false
this.query(1)
}
},
methods: {
-1
View File
@@ -509,7 +509,6 @@ export default {
this.goodsList.forEach(({_id, name, extraAttributes}) => {
if (_id === val) {
this.form1.data.goodsName = name
console.log(extraAttributes)
this.goodsAttributes = extraAttributes
}
})
+18 -1
View File
@@ -196,7 +196,8 @@
<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>
<el-button type="primary" v-if="sheet.status === 0" @click.native="confirm(item)">选择
</el-button>
</text>
</view>
</view>
@@ -406,6 +407,22 @@ export default {
this.sheet = {...res.data, ...{title: title.join()}}
}
});
},
confirm(item) {
vk.callFunction({
url: 'client/enquiry/quote/kh/confirmQuote',
title: '请求中...',
data: {
quoteId: item._id,
},
success: (data) => {
vk.navigateTo('/pages/contract/index');
this.$message({
type: 'success',
message: '报价确认成功'
})
}
});
}
}
}
+86 -19
View File
@@ -114,9 +114,44 @@
<!-- 商品列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns" :query-form-param="queryParam"
:pagination="true"></vk-data-table>
<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>
</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>
</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>
</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_str" label="发布时间"/>
<el-table-column align="center" label="操作">
<template v-slot="{ row }">
<el-button size="mini" type="primary" plain
@click.native="vk.navigateTo('/pages/enquiry/detail?id=' + row._id)">详情
</el-button>
</template>
</el-table-column>
</el-table>
<div class="mt-20 text-center">
<el-pagination @current-change="search" background layout="prev, pager, next"
:total="list.total" :page-size="pageSize"/>
</div>
</view>
<right-bar></right-bar>
@@ -147,6 +182,11 @@ export default {
checkCompanyList: [],
attributes: [],
keyword: '',
list: {
rows: [],
total: 0
},
pageSize: 20,
queryParam: {},
// 表格相关开始 -----------------------------------------------------------
table1: {
@@ -252,7 +292,7 @@ export default {
}
},
{
key: "_add_time",
key: "_add_time_srt",
title: "发布时间",
type: "time",
},
@@ -285,6 +325,7 @@ export default {
});
this.getAttributes()
this.getCompany()
this.search()
},
methods: {
selectCate(id) {
@@ -344,21 +385,47 @@ export default {
},
search(pageIndex) {
const categoryIds = []
this.checkCategoryList.forEach(item => {
// console.log(item)
// item.forEach(sitem => {
// categoryIds.push(sitem._id)
// })
categoryIds.push(item)
})
this.queryParam.formData = {
keyword: this.keyword,
companyList: this.checkCompanyList,
categoryIds
}
this.$refs.table1.search()
search(pageIndex = 1) {
vk.callFunction({
url: 'client/enquiry/sheet/pub/getList',
data: {
pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
companyList: this.checkCompanyList,
categoryIds: this.checkCategoryList
},
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
})
}
});
},
getAttributes() {
vk.callFunction({
+250 -234
View File
@@ -1,265 +1,281 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<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="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="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" :query-form-param="queryForm1"></vk-data-table>
</view>
<!-- 商品列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns"
:pagination="true" :query-form-param="queryForm1"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
provinces.unshift({
code: 9999,
name: '全国'
})
export default {
data() {
return {
keyword: '',
// 表格相关开始 -----------------------------------------------------------
queryForm1: {
formData: {
userId: vk.getVuex('$user.userInfo._id')
},
columns: [
{ key:"userId", title:"发布人ID", type:"text", width:160, mode:"=" },
]
},
table1: {
// 表格数据请求地址
action: "client/enquiry/sheet/pub/getList",
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/enquiry/detail?id=' + item._id);
}
},
{
title: '删除',
icon: 'el-icon-delete',
type: 'primary',
onClick: (item) => {
this.$confirm('').then(()=> {
}).then(() => {
vk.callFunction({
url: 'client/enquiry/sheet/kh/delete',
title: '请求中...',
data: {
_id: item._id
},
}).then(res => {
this.$refs.table1.refresh()
})
})
}
},
],
// 表格字段显示规则
columns: [
{
key: "productList",
title: "品名/材质",
type: "text",
width: 280,
formatter: (val, row, column, index) => {
return val.map(item=>item.name).join("/")
}
},
{
key: "productList",
title: "采购量",
type: "text",
width: 100,
formatter: (val, row, column, index) => {
return val.map(item=>item.procureNumber + item.procureUnit).join("/")
}
},
{
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",
width: 280,
formatter: (val, row, column, index) => {
if(val.accountType == 1) {
return val.person.personName
}else {
return val.company.companyName
}
}
},
// {
// key: "_add_time",
// title: "添加时间",
// type: "time",
// width: 160
// },
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
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";
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
export default {
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
keyword: '',
// 表格相关开始 -----------------------------------------------------------
queryForm1: {
formData: {
userId: vk.getVuex('$user.userInfo._id')
},
columns: [
{key: "userId", title: "发布人ID", type: "text", width: 160, mode: "="},
]
},
table1: {
// 表格数据请求地址
action: "client/enquiry/sheet/pub/getList",
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/enquiry/detail?id=' + item._id);
}
},
{
title: '删除',
icon: 'el-icon-delete',
type: 'primary',
onClick: (item) => {
this.$confirm('').then(() => {
},
methods: {
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.getCertUrl()
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('请完善名片信息', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card');
})
} else {
uni.navigateTo({
url: '/pages/enquiry/release'
})
}
}).then(() => {
vk.callFunction({
url: 'client/enquiry/sheet/kh/delete',
title: '请求中...',
data: {
_id: item._id
},
}).then(res => {
this.$refs.table1.refresh()
})
})
}
},
],
// 表格字段显示规则
columns: [
{
key: "productList",
title: "品名/材质",
type: "text",
width: 280,
formatter: (val, row, column, index) => {
return val.map(item => `${item.goodsName}(${item.materialQuality})`).join("/")
}
},
{
key: "productList",
title: "采购量",
type: "text",
width: 100,
formatter: (val, row, column, index) => {
return val.map(item => item.procureNumber + item.procureUnit).join("/")
}
},
{
key: "productList",
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 = ""
}
return fullAddress
}
},
{
key: "user",
title: "采购单位",
type: "text",
width: 280,
formatter: (val, row, column, index) => {
if (val.accountType == 1) {
return val.person.personName
} else {
return val.company.companyName
}
}
},
// {
// key: "_add_time_srt",
// title: "添加时间",
// type: "time",
// width: 160
// },
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
},
methods: {
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.getCertUrl()
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('请完善名片信息', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card');
})
} else {
uni.navigateTo({
url: '/pages/enquiry/release'
})
}
},
},
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryList.forEach(item => {
arr.push(...item)
})
},
},
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryList.forEach(item => {
arr.push(...item)
})
this.checkProvinceList.forEach(item => {
arr.push({
...item
})
})
return arr
}
this.checkProvinceList.forEach(item => {
arr.push({
...item
})
})
return arr
}
}
}
}
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
}
.carousel {
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
}
.carousel-img {
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
.tags {
display: flex;
.el-tag {
margin-right: 10px;
}
}
.el-tag {
margin-right: 10px;
}
}
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
}
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
</style>
+74 -44
View File
@@ -30,13 +30,13 @@
</view>
</view>
<!-- 手动填写 -->
<template v-if="form1.data.fillType == 0">
<template v-if="form1.data.fillType === 0">
<view class="form-title-wrap">
<view class="goods-info-title">
<view class="form-title">
商品信息
</view>
<text class="enquiry-no">询价单编号: {{ enquiryNo }}</text>
<text class="enquiry-no">询价单编号: {{ form1.data.enquiryNo }}</text>
</view>
<view class="sales-code flex justify-end items-center">
<text>金九信业务员编号:</text>
@@ -51,8 +51,32 @@
</view>
</template>
<!-- 批量上传 -->
<template v-else>
<view class="form-title-wrap mt-20">
<view class="goods-info-title mb-20">
<view class="form-title">
采购单或附件上传
</view>
</view>
<text class="ml-20 text-main text-28">上传自有采购单图片或文档,支持jpg/png/word/excel</text>
</view>
<vk-data-upload v-model="form1.data.multiFiles" accept="*"></vk-data-upload>
<view class="form-title-wrap mt-20">
<view class="goods-info-title">
<view class="form-title">
主要商品分类筛选
</view>
</view>
</view>
<view class="flex flex-wrap justify-start items-start my-20">
<text v-for="(item, index) in goodsList" :key="index" @click="changeMultiGoods(item)"
:class="[productIdList.includes(item._id) ? 'text-main' : '']"
class="mr-25 mb-20 pointer">{{ item.name }}
</text>
</view>
</template>
<view v-if="form1.data.fillType == 0" class="btn-add-outer">
<view v-if="form1.data.fillType === 0" class="btn-add-outer">
<el-button @click="addProduct" type="primary" size="small" plain icon="el-icon-plus"
class="empty-bg-plain-btn">添加商品
</el-button>
@@ -247,7 +271,7 @@
</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="0">平台交易</el-radio>
<el-radio v-model="form1.data.signMethod" :label="1">线下签约</el-radio>
</view>
<view v-if="form1.data.signMethod === 0">
@@ -340,11 +364,11 @@
<el-row :gutter="10" class="mb-20">
<el-col :span="12" class="flex justify-start items-center">
<text style="width: 160px">公司信息:</text>
<el-input v-model="company.companyName" placeholder="" disabled/>
<el-input v-model="company.companyName" placeholder=""/>
</el-col>
<el-col :span="12" class="flex justify-start items-center">
<text style="width: 160px">公司联系方式:</text>
<el-input v-model="company.legalMobile" disabled/>
<el-input v-model="company.legalMobile"/>
</el-col>
</el-row>
<el-row :gutter="10">
@@ -362,7 +386,7 @@
</el-form>
<view class="form-footer">
<el-button type="" @click="draft">保存草稿</el-button>
<el-button @click="draft">保存草稿</el-button>
<el-button type="primary" @click="submit">提交询价单</el-button>
</view>
<!-- <el-divider content-position="left">其他设置</el-divider> -->
@@ -386,6 +410,7 @@ export default {
components: {Gap, EnquiryTemplate},
data() {
return {
disabled: false,
provinceData: provinces,
cityData: citys,
areaData: areas,
@@ -395,19 +420,23 @@ export default {
},
enquiryNo: '',
// 表单相关开始-----------------------------------------------------------
productList: [{}],
productList: [],
productIdList: [],
baseAttributes: [],
categoryTreeData: [],
checkCategoryList: [],
projectProvinceIndex: null,
projectCityIndex: null,
projectAreaIndex: null,
goodsList: [],
form1: {
// 表单请求数据,此处可以设置默认值
data: {
fillType: 0,
enquiryNo: dayjs().format('YYYYMMDD') + (Math.ceil(Math.random() * 10000)).toString(),
// extraAttributes: {},
// attributes: {},
multiFiles: [],
invoice: false,
invoiceType: 0,
invoiceOther: '',
@@ -518,7 +547,6 @@ export default {
{value: 5, label: "其他付款方式"},
],
},
{
key: "", title: "", type: 'group', showLabel: false, justify: "start", columns: [
{
@@ -682,12 +710,11 @@ export default {
}
},
onLoad() {
this.enquiryNo = dayjs().format('YYYYMMDD') + (Math.ceil(Math.random() * 10000)).toString()
onLoad(option) {
const company = vk.getVuex('$user.userInfo.company')
this.company.companyName = company?.companyName
this.company.legalMobile = company?.legalMobile
this.getAttributes()
this.getGoodsList()
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
@@ -699,19 +726,30 @@ export default {
}
}
});
if (option.id) this.getInfo(option.id)
},
methods: {
getAttributes() {
// vk.callFunction({
// url: 'client/enquiry/attributes/pub/getList',
// title: '请求中...',
// data: {
// pageSize: 1000
// },
// success: (res) => {
// this.baseAttributes = res.rows
// }
// });
getInfo(_id){
vk.callFunction({
url: 'client/enquiry/sheet/pub/getDetail',
title: '请求中...',
data: {
_id
},
success: (res) => {
this.form1.data = res.data
this.productList = res.data.productList
}
})
},
getGoodsList() {
vk.callFunction({
url: 'client/enquiry/template/pub/getList',
title: '请求中',
success: ({rows}) => {
this.goodsList = rows
}
})
},
addProduct() {
this.productList.push({})
@@ -735,26 +773,12 @@ export default {
this.submitAll()
},
async submitAll() {
// 手动填写表单校验
// if (this.form1.data.fillType == 0) {
// const verifyTasks = []
// for (var i = 0; i < this.productList.length; i++) {
// const valid = new Promise((resolve, reject) => {
// console.log(this.$refs['product' + i]);
// console.log(this.$refs['product' + i][0].$refs);
// this.$refs['product' + i][0].$refs.form1.validate((valid) => {
// if (valid) {
// resolve(valid)
// } else {
// reject()
// }
// })
// })
// verifyTasks.push(valid)
// }
//
// await Promise.all(verifyTasks)
// }
if (this.form1.data.fillType === 1) {
this.productList = []
this.productIdList.forEach(goodsId => {
this.productList.push({goodsId})
})
}
this.form1.data.productList = this.productList
if (this.projectProvinceIndex !== null) {
this.form1.data.province = this.provinceData[this.projectProvinceIndex].code
@@ -765,6 +789,7 @@ export default {
}
}
}
this.disabled = true
// this.$refs.form1.submitForm()
vk.callFunction({
url: 'client/enquiry/sheet/kh/add',
@@ -775,11 +800,16 @@ export default {
message: "提交成功",
type: 'success'
})
this.disabled = false
vk.navigateBack()
}
})
},
changeMultiGoods(item) {
const index = this.productIdList.indexOf(item._id)
if (index === -1) this.productIdList.push(item._id)
else this.productIdList.splice(index, 1)
}
}
}
</script>
+1156 -1158
View File
File diff suppressed because it is too large Load Diff
+421
View File
@@ -0,0 +1,421 @@
<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/old">旧货交易</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item>旧货详情</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="page-main" v-if="sheet">
<view class="flex justify-between items-center">
<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>
<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">
{{
sheet.supplier.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>-->
</view>
<view class="item-wrap" v-if="sheet.files && sheet.files.length > 0">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
实物
</view>
</view>
</view>
<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"/>
</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.desc }}</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.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="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
交易说明
</view>
</view>
</view>
<view class="mt-15">付款方式:{{ sheet.payMethod }}</view>
<!-- <view class="mt-15">报价形式:{{ sheet.offerType === 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">违约责任:</view>
<view class="mt-15">
1.乙方所交产品品种、型号、规格、质量不符合规定的,如果甲方同意利用,应当按质论价;如果甲方不能利用的,应根据产品的具体情况,由乙方负责包换或包修,并承担修理、调换或退货而支付的实际费用;2.乙方不予供货违约责任为甲方的实际损失+违约金,如乙方材料符合订货标准,甲方不能退货和不收货,甲方无条件应按实际本合同订货数量支付100%货款,并支付乙方因此产生的实际费用。带有甲乙双方单位相关收货人和发货人签字的本合同的发货清单事项和内容均视为本合同的补充合同,与本合同有相同的法律效力,双方应共同遵照执行。
</view>
<view class="mt-15">解决纠纷的方法:</view>
<view class="mt-15">
1、凡因本合同引起的或与本合同有关的任何争议,均可友好协商或仲裁解决,协商或仲裁不成的,双方协商同意在合同签订地人民法院管辖地起诉,违约一方或对合同争议承担主要责任的一方,应承担对方因仲裁和起诉而产生的全部律师代理费、鉴定(检验)费、诉讼保全费、诉讼保险费、公告费、差旅费、执行费、误工費和获取证据产生费用等其他相关费用。2、双方本合同相关权利放弃均应有双方书面作出并加盖公章或授权委托人签字后生效。
</view>
<view class="mt-15">不可抗力:</view>
<view class="mt-15">
甲乙双方的任何一方由于不可抗力或突发公共事件的原因不能履行合同时,应及时向对方通报不能履行或不能完全履行的理由,以减轻可能给对方造成的损失,在取得有关机构证明以后,允许延期履行、部分履行或者不履行合同,并根据情况可部分或全部免予承担违约责任。
</view>
<view class="mt-15">其他:</view>
<view class="mt-15">
本合同的全部内容由双方平等共同协商一致,共同起草制定,非一方事先拟定,不属于格式条款。本合同自双方签字盖章后生效(包括电子签字、盖章),按本合同内容地址、联系方式寄送的一切文书、函件送达与否,均为视为送达有法律效力,通知途径和本合同内联系方式或地址送达文件双方均予以验证。
</view>
<view class="mt-15">采购方补充条款: 供货方逾期供货承担采购方一切损失</view>
<view class="mt-15"> 供应方补充条款:</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>-->
</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>-->
</view>
</template>
<script>
import {BuildingOne, IdCard} from "@icon-park/vue";
import dayjs from "dayjs";
import {WRITE_INVOICE_TIME, INVOICE_TYPE, PROCESS_PAY_METHOD} from '@/util'
export default {
components: {BuildingOne, IdCard},
data() {
return {
WRITE_INVOICE_TIME,
INVOICE_TYPE,
PROCESS_PAY_METHOD,
id: undefined,
showDialog: false,
productList: [],
sheetTitle: '',
sheet: {
user: {},
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
}
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 = {}) {
const {
id
} = options
if (!id) {
vk.navigateTo('/pages/enquiry/list');
return
}
this.id = id
this.getDetail()
},
methods: {
dayjs,
/**
* 获取询价单详情
*/
getDetail() {
vk.callFunction({
url: 'client/old/pub/getDetail',
title: '请求中...',
data: {
id: this.id
},
success: (res) => {
this.sheet = res
}
});
}
}
}
</script>
<style lang="scss" scoped>
@import "@/common/css/app.scss";
.page-main {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
border-radius: 5px;
}
.countdown {
padding: 2px 5px;
margin: 0 5px;
}
.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: $--color-primary;
font-size: 18px;
line-height: 18px;
border-left: 4px solid $--color-primary;
}
}
}
.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;
}
}
</style>
+35 -28
View File
@@ -88,50 +88,48 @@
<view class="goods-list">
<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"/>
<!-- <el-image src="https://oss.wsdns.cn/20231204/d35332fa6a3b4596b522edf9527ac612.png"-->
<!-- class="goods-img"/>-->
<view class="info">
<view class="goods-name">高强螺栓 2000套</view>
<view class="goods-name pointer" @click="navTo(`/pages/index/old/detail?id=${item._id}`)">{{ item.title }}</view>
<view class="field">
<view class="desc">
<view class="text">企 业</view>
<view>广西聚钱财实业有限公司</view>
<view>{{ item.buyer.companyName }}</view>
</view>
<view class="desc"></view>
<view class="desc">
<view class="text">所属分类</view>
<view>成品钢材</view>
<view>{{ item.category }}</view>
</view>
<view class="desc">
<view class="text">发布时间</view>
<view>2022-09-30</view>
<view>{{ item._add_time_str }}</view>
</view>
<view class="desc">
<view class="text">所在地区</view>
<view>广西壮族自治区-河池市</view>
<view>{{ item.addressStr }}</view>
</view>
<view class="desc">
<view class="text">有效日期</view>
<view>2022-09-30</view>
<view>{{ item.expiredTime }}</view>
</view>
</view>
</view>
</view>
<view class="buttons">
<button type="default" class="btn"
@click="vk.navigateTo('/pages/spot/goods/detail?id=' + item._id);" plain>查看电话
<button type="default" class="btn" plain @click="showCntract(item)">查看电话
</button>
<button type="default" class="btn green"
@click="vk.navigateTo('/pages/spot/goods/detail?id=' + item._id);" plain>添加微信
<button type="default" class="btn green" plain>添加微信
</button>
<button type="default" class="btn"
@click="vk.navigateTo('/pages/spot/goods/detail?id=' + item._id);" plain>向此卖家询价
<button type="default" class="btn" plain>向此卖家询价
</button>
</view>
</view>
<view class="paginatio">
<el-pagination @current-change="search" background layout="prev, pager, next" :total="goodsData.total">
<el-pagination @current-change="search" background layout="prev, pager, next" :total="goodsData.total"
:page-size="pageSize">
</el-pagination>
</view>
</view>
@@ -141,6 +139,7 @@
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
import dayjs from "dayjs";
export default {
data() {
@@ -156,9 +155,14 @@ export default {
total: 0,
rows: []
},
showAllProvince: false
showAllProvince: false,
type: 0,
pageSize: 20,
};
},
onLoad(option) {
if (option.type) this.type = option.type
},
onShow() {
this.search(1)
vk.callFunction({
@@ -177,6 +181,11 @@ export default {
});
},
methods: {
navTo(url) {
vk.navigateTo({
url
})
},
selectCate(id) {
const index = this.checkCategoryList.indexOf(id)
if (index === -1) this.checkCategoryList.push(id)
@@ -220,7 +229,7 @@ export default {
})
} else {
vk.navigateTo({
url: '/pages/spot/release/release'
url: '/pages/index/old/release'
})
}
},
@@ -248,30 +257,28 @@ export default {
})
} else {
vk.navigateTo({
url: '/pages/spot/goods/my'
url: '/pages/index/old/my'
})
}
},
search(pageIndex) {
vk.callFunction({
url: 'client/spot/goods/pub/getList',
url: 'client/old/pub/getList',
data: {
pageIndex: pageIndex,
pageSize: 20,
pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
type: this.type,
categoryIds: this.checkCategoryList,
provinceCodes: this.checkProvinceList
},
success: (data) => {
console.log('data: ', data);
data.rows.forEach(item => {
try {
item.addressStr = item.address.province.name + "-" + item.address.city
.name + "-" + item.address.area.name
} catch (err) {
item.addressStr = ""
}
data.rows.map(item => {
item.addressStr = item.addressRegion[0].name + "-" + item.addressRegion[1].name
item.expiredTime = dayjs(item.expiredTime).format('YYYY-MM-DD')
return item
})
this.goodsData = data
}
+231 -8
View File
@@ -1,13 +1,236 @@
<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" :query-form-param="queryForm1"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
name: "my",
data() {
return {}
},
methods: {}
}
</script>
export default {
data() {
return {
keyword: '',
// 表格相关开始 -----------------------------------------------------------
queryForm1: {
formData: {
userId: vk.getVuex('$user.userInfo._id')
},
columns: [
{ key:"userId", title:"发布人ID", type:"text", width:160, mode:"=" },
]
},
table1: {
// 表格数据请求地址
action: "client/old/kh/getList",
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/index/old/detail?id=' + item._id);
}
},
{
title: '删除',
icon: 'el-icon-delete',
type: 'primary',
onClick: (item) => {
this.$confirm('').then(()=> {
}).then(() => {
vk.callFunction({
url: 'client/old/kh/delete',
title: '请求中...',
data: {
id: item._id
},
}).then(res => {
this.$refs.table1.refresh()
})
})
}
},
],
// 表格字段显示规则
columns: [
{
key: "标题",
title: "title",
type: "text",
width: 280
},
{
key: "productList",
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("/")
} catch(err){
str = ""
}
return str
}
},
{
key: "supplier.companyName",
title: "供应商",
type: "text",
},
{
key: "_add_time_srt",
title: "添加时间",
type: "time",
width: 160
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
},
methods: {
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.getCertUrl()
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('请完善名片信息', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=business-card');
})
} else {
uni.navigateTo({
url: '/pages/index/old/release'
})
}
},
},
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>
+42 -71
View File
@@ -13,26 +13,27 @@
<view class="goods-options">
<el-row class="">
<el-button @click="navTo('/pages/index/old/release')" type="primary" round>发布旧货交易</el-button>
<el-button @click="toMy" type="primary" round plain class="empty-bg-plain-btn">我发布的信息
<el-button @click="navTo('/pages/index/old/my')" type="primary" round plain
class="empty-bg-plain-btn">我发布的信息
</el-button>
</el-row>
</view>
</view>
<view class="nav-tool">
<view class="btn">
<view class="btn pointer" @click="navTo('/pages/index/old/list/list')">
<image src="https://oss.wsdns.cn/20231204/bbd54039c69e4d0292c6889bce0ac088.png" mode="widthFix"/>
<text>拍卖信息</text>
</view>
<view class="btn">
<view class="btn pointer" @click="navTo('/pages/index/old/list/list?type=1')">
<image src="https://oss.wsdns.cn/20231204/bbd54039c69e4d0292c6889bce0ac088.png" mode="widthFix"/>
<text>采购信息</text>
</view>
<view class="btn">
<view class="btn pointer" @click="navTo('/pages/index/old/list/list?type=2')">
<image src="https://oss.wsdns.cn/20231204/bbd54039c69e4d0292c6889bce0ac088.png" mode="widthFix"/>
<text>租赁信息</text>
</view>
<view class="btn">
<view class="btn pointer" @click="navTo('/pages/index/old/list/list?type=3')">
<image src="https://oss.wsdns.cn/20231204/bbd54039c69e4d0292c6889bce0ac088.png" mode="widthFix"/>
<text>物资回收信息</text>
</view>
@@ -79,66 +80,20 @@
</view>
<view class="news-gg">
<el-row class="wrap" type="flex" :gutter="0" justify="space-between">
<el-col :span="12">
<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"
src="http://jyx.gxwebsoft.com/public/index/images/%E5%90%8E%E5%8F%B0%E4%B8%8A%E4%BC%A08.jpg"/>
<el-image class="image" fit="cover"
:src="noticeList[index].cover[0]"/>
</view>
<view class="list3">
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
</view>
</view>
</el-col>
<el-col :span="12">
<view class="item">
<view class="new-avatar">
<el-image class="image"
src="http://jyx.gxwebsoft.com/public/index/images/%E5%90%8E%E5%8F%B0%E4%B8%8A%E4%BC%A08.jpg"/>
</view>
<view class="list3">
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
</view>
</view>
</el-col>
<el-col :span="12">
<view class="item">
<view class="new-avatar">
<el-image class="image"
src="http://jyx.gxwebsoft.com/public/index/images/%E5%90%8E%E5%8F%B0%E4%B8%8A%E4%BC%A08.jpg"/>
</view>
<view class="list3">
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
</view>
</view>
</el-col>
<el-col :span="12">
<view class="item">
<view class="new-avatar">
<el-image class="image"
src="http://jyx.gxwebsoft.com/public/index/images/%E5%90%8E%E5%8F%B0%E4%B8%8A%E4%BC%A08.jpg"/>
</view>
<view class="list3">
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
</view>
<view class="text"><span>[南宁]</span> 标题标题标题标题标题标题标题标题标题标题...
<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>
</view>
</view>
</view>
</view>
@@ -158,10 +113,11 @@
</el-button>
</div>
<view class="list8">
<view class="article" v-for="(item, index) in dataList[0]" :key="index">
<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>
<text class="line-1">{{ item.title }}</text>
<text class="line-1 ">{{ item.title }}</text>
</view>
<view class="date-time">{{ item.addDate }}</view>
</view>
@@ -173,14 +129,15 @@
<div slot="header" class="clearfix">
<span class="title">最新采购信息</span>
<el-button style="float: right; padding: 3px 0" type="text"
@click="navTo('/pages/index/old/list/list')">查看更多
@click="navTo('/pages/index/old/list/list?type=1')">查看更多
</el-button>
</div>
<view class="list8">
<view class="article" v-for="(item, index) in dataList[1]" :key="index">
<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>
<text class="line-1">{{ item.title }}</text>
<text class="line-1 ">{{ item.title }}</text>
</view>
<view class="date-time">{{ item.addDate }}</view>
</view>
@@ -192,11 +149,12 @@
<div slot="header" class="clearfix">
<span class="title">最新租赁信息</span>
<el-button style="float: right; padding: 3px 0" type="text"
@click="navTo('/pages/index/old/list/list')">查看更多
@click="navTo('/pages/index/old/list/list?type=2')">查看更多
</el-button>
</div>
<view class="list8">
<view class="article" v-for="(item, index) in dataList[2]" :key="index">
<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>
<text class="line-1">{{ item.title }}</text>
@@ -211,11 +169,12 @@
<div slot="header" class="clearfix">
<span class="title">最新物资回收信息</span>
<el-button style="float: right; padding: 3px 0" type="text"
@click="navTo('/pages/index/old/list/list')">查看更多
@click="navTo('/pages/index/old/list/list?type=3')">查看更多
</el-button>
</div>
<view class="list8">
<view class="article" v-for="(item, index) in dataList[3]" :key="index">
<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>
<text class="line-1">{{ item.title }}</text>
@@ -300,7 +259,8 @@ export default {
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}
],
dataList: []
dataList: [],
noticeList: [],
};
},
onLoad(options) {
@@ -309,6 +269,7 @@ export default {
}
this.getCompanyList()
this.getDataList()
this.getNoticeList()
},
methods: {
navTo(url) {
@@ -322,6 +283,15 @@ 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',
@@ -342,6 +312,7 @@ export default {
return item
})
}
console.log(this.dataList)
}
}
}
+1 -1
View File
@@ -95,7 +95,7 @@
</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>
+212 -57
View File
@@ -8,60 +8,146 @@
<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">
<el-checkbox @change="changeCheck(index)">
<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="ml-35">
<text>业务编号:</text>
<text v-if="item.contentIndex !== null">{{
item.contents[item.contentIndex].code
}}
</text>
<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">
<text>业务编号:</text>
<text>{{ content.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"
:key="amountIndex"
:label="amount.title" :value="amountIndex"/>
</el-select>
<text class="ml-35" v-if="content.amountIndex !== null">
{{ content.amountList[content.amountIndex].amount }}元/次
</text>
</view>
</view>
<view class="flex justify-start items-center">
<text class="ml-35">服务服务项目:</text>
<el-select v-model="configList[index].contentIndex" clearable>
<el-option v-for="(content, contentIndex) in item.contents" :key="contentIndex"
:label="content.title" :value="contentIndex"/>
</el-select>
</view>
<text class="ml-35" v-if="item.contentIndex !== null">
{{ item.contents[item.contentIndex].amount }}元/次
</text>
</view>
<view>备注: {{ item.remark }}</view>
</view>
</el-checkbox>
<view>备注: {{ item.remark }}</view>
</view>
</view>
<el-form ref="form" :model="form" label-width="200px">
<view v-for="(item, index) in companyList" :key="index">
<view v-for="(item, companyIndex) in companyList" :key="companyIndex">
<el-form-item label="考察对象(个人/企业全称):" required>
<el-input v-model="companyList[index].name"/>
<el-input v-model="companyList[companyIndex].name"/>
</el-form-item>
<el-form-item label="考察对象(个人身份证/企业信用代码):">
<el-input v-model="companyList[index].code"/>
<el-input v-model="companyList[companyIndex].code"/>
</el-form-item>
<el-form-item label="考察对象(个人/单位)所在地:">
<el-input v-model="companyList[index].address"/>
<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>
<el-form-item label="接收文件电子邮箱:">
<el-input v-model="companyList[index].email"/>
<el-input v-model="companyList[companyIndex].email"/>
</el-form-item>
<el-form-item label="接收文件微信:">
<el-input v-model="companyList[index].wechat"/>
<el-input v-model="companyList[companyIndex].wechat"/>
</el-form-item>
<el-form-item label="接收文件寄件地址">
<el-input v-model="companyList[index].receiveAddress"/>
<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[index].requestName"/>
<el-input v-model="companyList[companyIndex].requestName"/>
</el-form-item>
<el-form-item label="联系人:">
<el-input v-model="companyList[index].contactName"/>
<el-input v-model="companyList[companyIndex].contactName"/>
</el-form-item>
<el-form-item label="联系方式:">
<el-input v-model="companyList[index].contact"/>
<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">
@@ -72,7 +158,7 @@
</el-button>
</view>
<view class="ml-20">
<el-button type="primary" plain @click.native="removeCompany(index)"
<el-button type="primary" plain @click.native="removeCompany(companyIndex)"
class="ml-20"
:disabled="companyList.length === 1">删除该对象
</el-button>
@@ -91,18 +177,21 @@
</view>
<view class="mt-40 flex justify-center items-center">
<el-button type="primary" @click="newOrder"
:disabled="contentList.length === 0 || companyList.length === 0 || !companyList[0].name">
:disabled="companyList.length === 0 || !companyList[0].name">
立即支付
</el-button>
</view>
</view>
</view>
<gap></gap>
<gap/>
<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 Gap from "../../../components/gap/gap.vue";
export default {
@@ -110,6 +199,9 @@ export default {
components: {Gap},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
list: [
{
image: '/static/images/selfSupport/swiper.jpg',
@@ -121,13 +213,27 @@ export default {
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: '',
@@ -144,45 +250,88 @@ export default {
})
if (rows) {
this.configList = rows.map(item => {
item.contentIndex = null
item.contents.map(content => {
content.checked = false
content.amountIndex = null
return content
})
return item
})
}
},
changeCheck(itemIndex) {
const index = this.contentList.indexOf(itemIndex)
if (index === -1) {
this.contentList.push(itemIndex)
} else {
this.contentList.splice(index, 1)
}
},
addCompany() {
this.companyList.push({
name: '',
code: '',
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])
},
removeCompany() {
removeCompany(index) {
this.companyList.splice(index, 1)
this.addressIndex.splice(index, 1)
this.receiveAddressIndex.splice(index, 1)
},
async newOrder(){
const {data} = await vk.callFunction({
url: 'client/order/kh/addFromList',
data: {
type: 1,
list: [
]
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({
message: '请至少选择一项服务',
type: 'error'
})
this.companyList.forEach((item, index) => {
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]],
}
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]],
}
})
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/addOrder',
data: {
type: 0,
amountList,
contentList: this.companyList
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
},
selectAmount(index, contentIndex, e) {
console.log(index, contentIndex, e)
}
},
onLoad() {
@@ -191,10 +340,16 @@ export default {
computed: {
amount() {
let tmpAmount = 0
this.configList.forEach((item, index) => {
if (this.contentList.indexOf(index) !== -1 && item.contentIndex !== null) {
tmpAmount += parseFloat(item.contents[item.contentIndex].amount)
}
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)
}
})
}
})
})
return tmpAmount
},
+224 -50
View File
@@ -8,71 +8,159 @@
<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">
<el-checkbox @change="changeCheck(index)">
<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="ml-35">
<text>业务编号:</text>
<text v-if="item.contentIndex !== null">{{
item.contents[item.contentIndex].code
}}
</text>
<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">
<text>业务编号:</text>
<text>{{ content.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"
:key="amountIndex"
:label="amount.title" :value="amountIndex"/>
</el-select>
<text class="ml-35" v-if="content.amountIndex !== null">
{{ content.amountList[content.amountIndex].amount }}元/次
</text>
</view>
</view>
<view class="flex justify-start items-center">
<text class="ml-35">服务服务项目:</text>
<el-select v-model="configList[index].contentIndex" clearable>
<el-option v-for="(content, contentIndex) in item.contents" :key="contentIndex"
:label="content.title" :value="contentIndex"/>
</el-select>
</view>
<text class="ml-35" v-if="item.contentIndex !== null">
{{ item.contents[item.contentIndex].amount }}元/次
</text>
</view>
<view>备注: {{ item.remark }}</view>
</view>
</el-checkbox>
<view>备注: {{ item.remark }}</view>
</view>
</view>
<el-form ref="form" :model="form" label-width="200px">
<view v-for="(item, index) in productList" :key="index">
<view v-for="(item, productIndex) in productList" :key="productIndex">
<el-form-item label="检测产品:" required>
<el-input v-model="productList[index].name"/>
<el-input v-model="productList[productIndex].name"/>
</el-form-item>
<el-form-item label="检测内容">
{{ contentNameList.join() }}
</el-form-item>
<el-form-item label="取样所在地">
<el-input v-model="productList[index].address"/>
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="addressIndex[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="addressIndex[productIndex][1]" placeholder="请选择市"
:disabled="addressIndex[productIndex].length === 0">
<template v-if="addressIndex[productIndex][0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[productIndex][0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[productIndex][2]" placeholder="请选择区"
:disabled="addressIndex[productIndex].length === 1">
<template
v-if="addressIndex[productIndex][0] !== null && addressIndex[productIndex][1] !== null">
<el-option
v-for="(item, index) in areaData[addressIndex[productIndex][0]][addressIndex[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].address" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="接收文件电子邮箱:">
<el-input v-model="productList[index].email"/>
<el-input v-model="productList[productIndex].email"/>
</el-form-item>
<el-form-item label="接收文件微信:">
<el-input v-model="productList[index].wechat"/>
<el-input v-model="productList[productIndex].wechat"/>
</el-form-item>
<el-form-item label="接收文件寄件地址">
<el-input v-model="productList[index].receiveAddress"/>
<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[index].requestName"/>
<el-input v-model="productList[productIndex].requestName"/>
</el-form-item>
<el-form-item label="联系人:">
<el-input v-model="productList[index].contactName"/>
<el-input v-model="productList[productIndex].contactName"/>
</el-form-item>
<el-form-item label="联系方式:">
<el-input v-model="productList[index].contact"/>
<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="addCompany">增加考察对象
<el-button type="primary" @click.native="addProduct">增加考察对象
</el-button>
</view>
<view class="ml-20">
<el-button type="primary" plain @click.native="removeCompany(index)"
<el-button type="primary" plain @click.native="removeProduct(productIndex)"
class="ml-20"
:disabled="productList.length === 1">删除该对象
</el-button>
@@ -90,20 +178,30 @@
<view class="ml-35">客服联系方式: 0771-3923001</view>
</view>
<view class="mt-40 flex justify-center items-center">
<el-button type="primary" :disabled="contentList.length === 0 || productList.length === 0 || !productList[0].name">立即支付
<el-button type="primary" @click.native="newOrder"
:disabled="productList.length === 0 || !productList[0].name">
立即支付
</el-button>
</view>
</view>
</view>
<gap/>
<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";
export default {
name: "productQuote",
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
list: [
{
image: '/static/images/selfSupport/swiper.jpg',
@@ -115,13 +213,27 @@ export default {
checkList: [],
contentList: [],
contentNameList: [],
addressIndex: [[null, null, null]],
addressDetail: '',
receiveAddressIndex: [[null, null, null]],
receiveAddressDetail: '',
productList: [
{
name: '',
code: '',
addressRegion: {
province: null,
city: null,
area: null,
},
address: '',
email: '',
wechat: '',
receiveAddressRegion: {
province: null,
city: null,
area: null,
},
receiveAddress: '',
requestName: '',
contactName: '',
@@ -138,35 +250,91 @@ export default {
})
if (rows) {
this.configList = rows.map(item => {
item.contentIndex = null
item.contents.map(content => {
content.checked = false
content.amountIndex = null
return content
})
return item
})
}
},
changeCheck(itemIndex) {
const index = this.contentList.indexOf(itemIndex)
if (index === -1) {
this.contentList.push(itemIndex)
} else {
this.contentList.splice(index, 1)
}
},
addCompany() {
addProduct() {
this.productList.push({
name: '',
code: '',
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])
},
removeCompany() {
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)
},
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({
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]],
}
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]],
}
})
const {data} = await vk.callFunction({
url: 'client/selfSupport/kh/addOrder',
data: {
type: 1,
amountList,
contentList: this.productList
}
})
vk.navigateTo({
url: `/pages/index/shop/pay?id=${data}`
})
},
},
onLoad() {
this.getConfigList()
@@ -174,10 +342,16 @@ export default {
computed: {
amount() {
let tmpAmount = 0
this.configList.forEach((item, index) => {
if (this.contentList.indexOf(index) !== -1 && item.contentIndex !== null) {
tmpAmount += parseFloat(item.contents[item.contentIndex].amount)
}
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)
}
})
}
})
})
return tmpAmount
},
+45 -38
View File
@@ -13,10 +13,14 @@
<view class="tool-bar">
<view class="search">
<text>交易区域:</text>
<el-cascader :options="options" :props="{label: 'name', value: 'code'}" v-model="address"/>
<el-cascader :options="options" :props="{label: 'name', value: 'code'}" v-model="address"
@change="getCompanyList" clearable/>
</view>
<view class="buy-btn">
<el-button type="primary" plain class="empty-bg-plain-btn" :disabled="address.length === 0">下单询价 ></el-button>
<el-button type="primary" plain class="empty-bg-plain-btn" :disabled="address.length === 0"
@click.native="dialogVisible = true">
下单询价>
</el-button>
</view>
</view>
<!-- 合作单位/联营单位-->
@@ -40,6 +44,15 @@
<gap height="50"/>
<right-bar></right-bar>
<common-footer></common-footer>
<el-dialog
title="下询价单"
:visible.sync="dialogVisible"
width="60%">
<vk-data-upload v-model="files" accept="*">
</vk-data-upload>
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="addFiles">确 定</el-button>
</el-dialog>
</view>
</template>
@@ -52,11 +65,14 @@ export default {
components: {UGap},
data() {
return {
dialogVisible: false,
address: [],
list: [{
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
files: [],
list: [
{
image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
},
{
image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
title: '身无彩凤双飞翼,心有灵犀一点通'
@@ -66,37 +82,7 @@ export default {
title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
}
],
options: [{
value: 'zhinan',
label: '广西',
children: [{
value: 'shejiyuanze',
label: '南宁市',
children: [{
value: 'yizhi',
label: '良庆区'
}, {
value: 'fankui',
label: 'XXX'
}, {
value: 'xiaolv',
label: 'XXX'
}, {
value: 'kekong',
label: 'XXX'
}]
}, {
value: 'daohang',
label: '北海市',
children: [{
value: 'cexiangdaohang',
label: 'XXX'
}, {
value: 'dingbudaohang',
label: 'XXX'
}]
}]
}],
options: [],
companyList: []
};
},
@@ -125,9 +111,26 @@ export default {
async getCompanyList() {
const {rows} = await vk.callFunction({
url: 'client/user/pub/getCompany',
data: {isCoop: 1}
data: {
isCoop: 1,
city: this.address.length > 0 ? [this.address[1]] : []
}
})
this.companyList = rows
},
async addFiles() {
await vk.callFunction({
url: 'client/selfSupport/kh/add',
data: {
files: this.files,
city: this.address.length > 0 ? this.address[1] : []
}
})
this.$message({
message: '下单成功',
type: 'success'
})
this.dialogVisible = false
}
}
}
@@ -151,6 +154,10 @@ export default {
text {
margin: 0 20px;
}
text:hover {
color: #F2CFCE;
}
}
.tool-bar {
+119 -5
View File
@@ -5,7 +5,7 @@
<category-bar></category-bar>
<view class="w-1200 m-a">
<view class="mt-20 bg-white rounded p-20">
<view class="flex justify-between">
<view class="flex justify-between pb-20 border-bottom">
<text class="font-bold text-40">
购物车(全部{{ list.length }})
</text>
@@ -15,6 +15,75 @@
<el-button type="primary" round>结算</el-button>
</view>
</view>
<view class="py-20">
<el-row :gutter="10">
<el-col :span="3">
<el-checkbox v-model="selectedAll" @change="doSelectAll">
<view class="text-35 font-bold">全选</view>
</el-checkbox>
</el-col>
<el-col :span="9">
<text class="text-35 font-bold w-">商品信息</text>
</el-col>
<el-col :span="3">
<text class="text-35 font-bold flex-1">单价</text>
</el-col>
<el-col :span="3">
<text class="text-35 font-bold flex-1">数量</text>
</el-col>
<el-col :span="3">
<text class="text-35 font-bold flex-1">金额</text>
</el-col>
<el-col :span="3">
<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 list" :key="index"
:class="[item.checked ? 'active' :'']">
<el-row :gutter="10">
<el-col :span="12">
<view class="flex justify-start items-start">
<el-checkbox v-model="list[index].checked" @change="changeCheck($event, item._id)">
</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 }}
</view>
</view>
</el-col>
<el-col :span="3">
<text class="text-35 font-bold flex-1">¥{{ item.goods.amount }}</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"/>
</text>
</el-col>
<el-col :span="3">
<text class="text-35 font-bold flex-1 text-main">¥{{
parseFloat(item.goods.amount) * item.num
}}
</text>
</el-col>
<el-col :span="3">
<el-button type="info" @click.native="remove(index)">移出购物车</el-button>
</el-col>
</el-row>
</view>
<view class="mt-20 flex justify-between items-center">
<el-button type="text">移出购物车</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="mx-15 font-bold text-40 text-main">¥{{ amount }}</text>
<el-button type="primary" round :disabled="selectedList.length === 0">结算</el-button>
</view>
</view>
</view>
</view>
<gap height="50"/>
@@ -29,7 +98,7 @@ export default {
return {
list: [],
selectedList: [],
selectedAll: false,
}
},
methods: {
@@ -37,16 +106,61 @@ export default {
const {rows} = await vk.callFunction({
url: "client/cart/kh/getList"
})
this.list = rows
this.list = rows.map(item => {
item.checked = false
return item
})
},
doSelectAll() {
this.list.forEach((item, index) => {
this.list[index].checked = this.selectedAll
})
},
changeNum(e) {
console.log(e)
},
changeCheck(e, id) {
const index = this.selectedList.indexOf(id)
if (index === -1) this.selectedList.push(id)
else this.selectedList.splice(index, 1)
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]
}
})
}
},
onShow() {
this.getList()
},
computed: {
amount() {
return 0
let tmpAmount = 0
this.list.forEach(item => {
console.log(item.checked)
if (item.checked) tmpAmount += parseFloat(item.goods.amount) * parseInt(item.num)
})
return tmpAmount
}
}
}
</script>
</script>
<style lang="scss" scoped>
.cover {
width: 80px;
height: 80px;
}
.active {
border: 1px solid #C23436;
border-radius: 10px;
background-color: #FFF9F6;
}
</style>
+70 -45
View File
@@ -12,14 +12,14 @@
<view class="my-20">
<text class="font-bold text-35">商品详情</text>
<view class="flex justify-start items-start my-20">
<text class="w-15p">封面</text>
<text class="w-15p" v-if="info.type === 0">封面</text>
<text class="w-40p">名称</text>
<text class="w-15p">数量</text>
<text class="w-15p">单价</text>
<text class="w-15p">小计</text>
</view>
<view class="flex justify-start items-start my-20" v-for="(item, index) in info.goods" :key="index">
<text class="w-15p">
<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>
@@ -29,50 +29,56 @@
</view>
</view>
</template>
<el-row :gutter="10" class="mb-20">
<el-col :span="4">
<el-input v-model="name" placeholder="请输入收件人姓名"/>
</el-col>
<el-col :span="4">
<el-input v-model="phone" placeholder="请输入收件人手机号"/>
</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-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="请选择市" :disabled="addressIndex.length === 0">
<template v-if="addressIndex[0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[0]]" :key="index"
<template v-if="info.type === 0">
<el-row :gutter="10" class="mb-20">
<el-col :span="4">
<el-input v-model="name" placeholder="请输入收件人姓名"/>
</el-col>
<el-col :span="4">
<el-input v-model="phone" placeholder="请输入收件人手机号"/>
</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-option v-for="(item, index) in provinceData" :key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[2]" placeholder="请选择区" :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]]" :key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="12">
<el-input v-model="addressDetail" placeholder="请输入详细地址"/>
</el-col>
</el-row>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[1]" placeholder="请选择市"
:disabled="addressIndex.length === 0">
<template v-if="addressIndex[0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[0]]" :key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[2]" placeholder="请选择区"
: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]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</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">订单金额:¥{{ info.amount }}</text>
<el-button type="primary" round :disabled="!phone || !name || addressIndex.length < 3" @click="onPay">
<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>
@@ -106,7 +112,9 @@ export default {
data() {
return {
id: null,
info: null,
info: {
type: null
},
provinceData: provinces,
cityData: citys,
areaData: areas,
@@ -128,7 +136,7 @@ export default {
})
if (this.info.orderStatus === 1) {
this.$message({
type:'success',
type: 'success',
message: '订单已支付成功'
})
setTimeout(() => {
@@ -138,7 +146,21 @@ export default {
}, 1000)
}
},
onPay() {
async onPay() {
if (this.info.type === 0) {
if (this.addressIndex.length > 2 && this.addressIndex[2] === null) {
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,
}
})
}
}
const requestTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss')
const timestamp = dayjs().format('YYYYMMDDHHmmss')
const goods = []
@@ -183,6 +205,9 @@ export default {
this.id = options.id
this.getInfo()
}
},
onUnload() {
if (this.checkPayInterval) clearInterval(this.checkPayInterval)
}
}
</script>
+40 -9
View File
@@ -8,7 +8,8 @@
<view class="tool-bar">
<view class="search">
<text>地区:</text>
<el-cascader :options="options" :props="{label: 'name', value: 'code'}" v-model="address"/>
<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"/>
@@ -16,8 +17,11 @@
</view>
<view class="tool-bar">
<view class="item">分类:</view>
<view class="item">全部</view>
<view class="item" v-for="(item, index) in categoryList" :key="index">{{ item.name }}</view>
<view class="item" @click="selectCate(null)">全部</view>
<view class="item" v-for="(item, index) in categoryList" :key="index"
@click="selectCate(item._id)"
:class="[categoryId === item._id? 'active' : '']">{{ item.name }}
</view>
</view>
</view>
@@ -42,7 +46,10 @@
<el-pagination
background
layout="prev, pager, next"
:total="1000">
:total="total"
:page-size="pageSize"
@click="getGoodsList"
>
</el-pagination>
</div>
</view>
@@ -79,7 +86,11 @@ export default {
}
],
options: [],
address: []
address: [],
pageIndex: 1,
pageSize: 20,
total: 0,
categoryId: null
};
},
onLoad(options) {
@@ -112,14 +123,24 @@ export default {
this.categoryList = res.rows
})
},
getGoodsList() {
getGoodsList(pageIndex = 1) {
vk.callFunction({
url: 'client/goods/list/pub/getList'
url: 'client/goods/list/pub/getList',
data: {
pageIndex,
pageSize: this.pageSize,
city: this.address.length > 1 ? this.address[1] : null,
parentId: this.categoryId
}
}).then(res => {
this.goodsList = res.rows
})
},
selectCate(cateId) {
if (this.categoryId === cateId) this.categoryId = null
else this.categoryId = cateId
this.getGoodsList()
}
}
}
</script>
@@ -146,7 +167,7 @@ export default {
.tool-bar {
display: flex;
justify-content: space-between;
justify-content: flex-start;
align-items: center;
padding: 20px;
font-size: 16px;
@@ -155,6 +176,16 @@ export default {
display: flex;
align-items: center;
}
.item {
margin-right: 10px;
cursor: pointer;
}
.item:hover, .active {
color: #bf2b28;
}
}
}
+40
View File
@@ -0,0 +1,40 @@
<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 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 v-html="info.content" class="mt-20"></view>
</view>
<gap height="50"/>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
name: "detail",
data() {
return {
info: {
name: '',
content: ''
}
}
},
onLoad(option) {
if (option.id) this.getInfo(option.id);
},
methods: {
async getInfo(id) {
this.info = await vk.callFunction({
url: `client/otherArticle/list/pub/getDetail`,
data: {id}
});
}
}
}
</script>
+13
View File
@@ -0,0 +1,13 @@
<template>
</template>
<script>
export default {
name: "list",
data() {
return {}
},
methods: {}
}
</script>
+40
View File
@@ -0,0 +1,40 @@
<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 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 v-html="info.content" class="mt-20"></view>
</view>
<gap height="50"/>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
name: "detail",
data() {
return {
info: {
name: '',
content: ''
}
}
},
onLoad(option) {
if (option.id) this.getInfo(option.id);
},
methods: {
async getInfo(id) {
this.info = await vk.callFunction({
url: `client/notice/list/pub/getDetail`,
data: {id}
});
}
}
}
</script>
+67 -153
View File
@@ -53,13 +53,13 @@
</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)"
<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._id)"
<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 }}
@@ -96,13 +96,38 @@
<!-- 商品列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns" :query-form-param="queryParam"
:pagination="true">
<template v-slot:action="{ row, column, index }">
<el-button size="mini" type="primary" plain @click.native="toDetail(row._id)">{{ vk.getVuex('$user.userInfo._id') === row.userId ? '查看' : '申请加工' }}</el-button>
</template>
</vk-data-table>
<el-table :data="list.rows" style="width: 100%">
<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="采购企业">
<template v-slot="{ row }">
<p>{{
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>{{ `${row.quoteNum}家已报价` }}</p>
</template>
</el-table-column>
<el-table-column align="center" prop="_add_time_srt" 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>
</template>
</el-table-column>
</el-table>
<div class="mt-20 text-center">
<el-pagination @current-change="search" background layout="prev, pager, next"
:total="list.total" :page-size="pageSize"/>
</div>
</view>
<right-bar></right-bar>
@@ -111,131 +136,26 @@
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
provinces.unshift({
code: 9999,
name: '全国'
})
export default {
data() {
return {
categoryTreeData: [],
provinceData: provinces,
checkProvinceList: [],
allChildCate: [],
companyList: [],
checkCompanyList: [],
clickedCateIndex: -1,
checkCategoryList: [],
checkCategoryNameList: [],
showAllCompany: false,
keyword: '',
queryParam: {},
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: (obj = {}) => {
let {data, success, fail, complete} = obj;
vk.callFunction({
url: `client/process/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: vk.getVuex('$user.userInfo._id') '申请加工',
// // icon: 'el-icon-search',
// type: 'primary',
// plain: true,
// onClick: ({_id}) => {
// this.toDetail(_id)
// // vk.navigateTo('/pages/process/detail?id=' + item._id);
// }
// },],
// 表格字段显示规则
columns: [
{
key: "title",
title: "标题",
type: "html",
formatter: (val, row, column, index) => {
return `<text class="text-main">${val}</text>`
}
},
{
key: "num",
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 = ""
// 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",
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",
title: "发布时间",
type: "time",
},
{
key: "action", title: "操作", type: "html"
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
list: {
rows: [],
total: 0
},
// 表格相关结束 -----------------------------------------------------------
pageSize: 20
};
},
onLoad() {
@@ -254,13 +174,20 @@ export default {
})
}
});
this.search()
this.getCompany()
},
methods: {
selectCate(id) {
const index = this.checkCategoryList.indexOf(id)
if (index === -1) this.checkCategoryList.push(id)
else this.checkCategoryList.splice(index, 1)
selectCate({_id, name}) {
const index = this.checkCategoryList.indexOf(_id)
console.log(_id, name, index)
if (index === -1) {
this.checkCategoryList.push(_id)
this.checkCategoryNameList.push(name)
} else {
this.checkCategoryList.splice(index, 1)
this.checkCategoryNameList.splice(index, 1)
}
this.search(1)
},
selectTexture(id) {
@@ -351,34 +278,21 @@ export default {
})
}
},
search(pageIndex) {
const categoryIds = []
this.checkCategoryList.forEach(item => {
item.forEach(sitem => {
categoryIds.push(sitem._id)
})
})
this.queryParam.formData = {
keyword: this.keyword,
companyList: this.checkCompanyList,
categoryIds
}
this.$refs.table1.search()
// 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
// }
// });
search(pageIndex = 1) {
vk.callFunction({
url: 'client/process/sheet/pub/getList',
data: {
pageIndex,
pageSize: this.pageSize,
keyword: this.keyword,
companyList: this.checkCompanyList,
categoryIds: this.checkCategoryList
},
success: (data) => {
this.list = data
console.log(this.list)
}
});
},
getCertUrl() {
vk.callFunction({
@@ -393,8 +307,8 @@ export default {
checkCategoryArr() {
let arr = []
this.checkCategoryList.forEach(item => {
arr.push(...item)
this.checkCategoryNameList.forEach(name => {
arr.push({name})
})
this.checkProvinceList.forEach(item => {
+1 -7
View File
@@ -40,17 +40,11 @@
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
provinces.unshift({
code: 9999,
name: '全国'
})
export default {
data() {
return {
categoryTreeData: [],
provinceData: provinces,
checkCategoryList: [],
checkProvinceList: [],
keyword: '',
@@ -136,7 +130,7 @@ export default {
//
// },
{
key: "_add_time",
key: "_add_time_srt",
title: "添加时间",
type: "time",
width: 160
+4 -1
View File
@@ -114,6 +114,8 @@
<view class="paginatio">
<el-pagination
:page-size="pageSize"
:current-page="goodsData.page"
@current-change="search"
background
layout="prev, pager, next"
@@ -131,6 +133,7 @@ import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
export default {
data() {
return {
pageSize: 20,
categoryTreeData: [],
allChildCate: [],
checkCategoryList: [],
@@ -236,7 +239,7 @@ export default {
url: 'client/spot/goods/pub/getList',
data: {
pageIndex: pageIndex,
pageSize: 20,
pageSize: this.pageSize,
keyword: this.keyword,
categoryIds: this.checkCategoryList,
provinceCodes: this.checkProvinceList
+7 -11
View File
@@ -30,11 +30,7 @@
</template>
<script>
import provinces from "@/uni_modules/vk-uview-ui/libs/address/provinces.json";
provinces.unshift({
code: 9999,
name: '全国'
})
export default {
data() {
return {
@@ -65,9 +61,11 @@
icon: 'el-icon-delete',
type: 'primary',
onClick: (item) => {
this.$confirm('').then(()=> {
}).then(() => {
this.$confirm('如果你要删除此条信息,之前其他客户填写的留言将无法查看', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.callFunction({
url: 'client/enquiry/sheet/kh/delete',
title: '请求中...',
@@ -78,8 +76,6 @@
this.$refs.table1.refresh()
})
})
}
},
],
@@ -105,7 +101,7 @@
},
{
key: "_add_time",
key: "_add_time_srt",
title: "发布时间",
type: "time",
width: 160
+678
View File
@@ -0,0 +1,678 @@
<template>
<view class="">
<top-bar></top-bar>
<common-nav></common-nav>
<view class="w-1200">
<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="0">
<i class="el-icon-edit"></i>
<span slot="title">加工单管理</span>
</el-menu-item>
</el-menu>
</el-col>
<el-col :span="18">
<el-card shadow="never">
<el-tabs v-model="activeName" @tab-click="changeStatus">
<el-tab-pane :label="`全部(${allNum})`" name="all">
</el-tab-pane>
<el-tab-pane :label="`待报价(${noQuoteNum})`" name="noQuote"></el-tab-pane>
<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;">
<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="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>
</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 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>
<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 === 1"/>
<img src="/static/images/store/unchoose.png" alt="" v-else/>
</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>
</view>
<view class="btn">
<el-button size="small" type="danger" v-if="item.status === 0"
@click.native="showProcessModal(item)"
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>
</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 === '1'">
<view class="transaction-list">
<view class="item" v-for="(item, index) in enquiryList" :key="index">
<view class="info">
<view class="title">
<view class="name">
<view class="fabu-status">
<view class="text">{{
item.status === 0 ? '发布中' : '已选商'
}}
</view>
<view class="sjx"></view>
</view>
<span>{{
item.productList.map(row => `${row.goodsName}(${row.materialQuality})`).join("/")
}}</span>
<el-tag effect="plain" size="mini" class="el-tag">
{{ item.signMethod === 0 ? '平台交易' : '线下签单' }}
</el-tag>
<view v-if="item.status === 0 && 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="enquiryChangeToOnlineSign(item._id, index)">
切换至线上交易
</el-tag>
</view>
</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.productList.map(row => row.procureNumber + row.procureUnit).join("/")
}}
</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">{{ item.fullAddress }}</view>
</view>
</view>
</view>
<view class="sub-title">
<text>交易编号:{{ item.enquiryNo }}</text>
<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 === 1"/>
<img src="/static/images/store/unchoose.png" alt="" v-else/>
</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>
</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-else
>查看交易方
</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>
</el-card>
</el-col>
</el-row>
</view>
<common-footer></common-footer>
<enquiry-modal ref="enquiryModal"/>
<process-modal ref="processModal"/>
</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 {
Agreement,
Switch as SwitchIcon
} from "@icon-park/vue";
import EnquiryModal from "./components/enquiryModal.vue";
import ProcessModal from "./components/processModal.vue";
export default {
components: {
ProcessModal,
EnquiryModal,
Agreement,
SwitchIcon
},
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
activeName: 'all',
value: '',
value1: '',
options: [{
value: '金久信自营',
label: '金久信自营'
}],
value2: '',
options2: [{
value: '未开发票',
label: '自主交易'
}],
input3: '',
menuIndex: '1',
isSign: false,
formData: {
status: 0,
tradeMethod: null
},
tableData: {},
pageSize: 10,
enquiryList: [],
processList: [],
total: 0,
notPickNum: 0,
pickedNum: 0,
noQuoteNum: 0,
allNum: 0,
}
},
onLoad(options) {
if (options.menuIndex) {
this.menuIndex = String(options.menuIndex)
}
if (this.menuIndex === '1') this.getEnquiryList()
else this.getProcessList()
},
methods: {
navTo(url) {
vk.navigateTo({
url
})
},
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)
},
changeStatus() {
if (this.menuIndex === '1') this.getEnquiryList(1)
else this.getProcessList(1)
},
getEnquiryList(pageIndex = 1) {
vk.callFunction({
url: 'client/enquiry/sheet/pub/getList',
data: {
userId: vk.getVuex('$user.userInfo._id'),
pageIndex,
pageSize: this.pageSize,
status: this.activeName
},
success: (res) => {
this.enquiryList = res.rows.map(val => {
let str = ''
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 (parseInt(val.productList[0].addressRegion[0]) === parseInt(item.code)) {
provinceIndex = index
str = item.name
}
})
this.cityData[provinceIndex].forEach((item, index) => {
if (parseInt(val.productList[0].addressRegion[1]) === parseInt(item.code)) {
cityIndex = index
str += `-${item.name}`
}
})
this.areaData[provinceIndex][cityIndex].forEach((item, index) => {
if (parseInt(val.productList[0].addressRegion[2]) === parseInt(item.code)) {
areaIndex = index
str += `-${item.name}`
}
})
// str += val.productList[0].addressDetail
}
val.fullAddress = str
return val
})
this.total = res.total
this.allNum = res.all
this.notPickNum = res.notPickNum
this.pickedNum = res.pickedNum
this.quoteNum = res.quoteNum
}
})
},
getProcessList(pageIndex = 1) {
vk.callFunction({
url: 'client/process/sheet/pub/getList',
data: {
userId: vk.getVuex('$user.userInfo._id'),
pageIndex,
pageSize: this.pageSize,
status: this.activeName
},
success: (res) => {
this.processList = res.rows
this.total = res.total
this.allNum = res.all
this.notPickNum = res.notPickNum
this.pickedNum = res.pickedNum
this.quoteNum = res.quoteNum
}
})
},
showEnquiryModal({status, quoteList}) {
this.$refs.enquiryModal.open(status, quoteList)
},
showProcessModal({status, quoteList}) {
this.$refs.processModal.open(status, quoteList)
},
editEnquiry(id) {
vk.navigateTo({
url: `/pages/enquiry/release?id=${id}`
})
},
enquiryChangeToOnlineSign(id, index) {
vk.callFunction({
url: ' client/enquiry/sheet/kh/changeToOnlineSign',
data: {
id
}
})
this.enquiryList[index].signMethod = 0
}
}
}
</script>
<style scoped lang="scss">
.w-1200 {
width: 1200px;
margin: 20px auto;
}
.contract-list {
background-color: #FFFFFF;
padding: 10px 20px 20px;
}
.transaction-list {
display: flex;
flex-direction: column;
.item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #f3f3f3;
.info {
position: relative;
border-right: 1px solid #f3f3f3;
flex: 1;
.name {
display: flex;
font-size: 16px;
font-weight: bold;
line-height: 1.6em;
align-items: center;
.fabu-status {
margin-right: 20px;
font-weight: normal;
display: flex;
.text {
padding: 0 10px 0 20px;
font-size: 13px;
color: #fff;
background-color: #A92924;
}
.sjx {
border: 12px solid;
border-color: #A92924 #ffffff #A92924 #A92924;
position: relative;
}
// .text{
// color: #fff;
// background-color: #A92924
// }
}
.buyer,
.seller {
font-size: 14px;
font-weight: normal;
display: flex;
margin: 0 30px;
}
.el-tag {
margin-left: 10px;
}
}
.caigou {
display: flex;
align-items: center;
.item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 0;
border: none;
.icon {
display: flex;
justify-content: center;
align-items: center;
margin: 10px;
background-color: #f3f3f3;
padding: 10px;
border-radius: 100px;
.el-icon-shopping-bag-1,
.el-icon-location-outline {
font-size: 30px;
}
}
.infos {
display: flex;
flex-direction: column;
.unit {
color: #A92924
}
}
}
}
.sub-title {
color: #999999;
text {
margin-right: 60px;
}
}
.action {
padding: 10px 0;
display: flex;
flex-direction: row;
align-items: center;
.btn-buy,
.btn-close {
color: #A92924;
}
}
.status {
position: absolute;
top: 0;
right: 0;
.icon {
margin: 0 20px;
img {
width: 80px;
}
}
}
}
.tool {
display: flex;
width: 200px;
align-items: center;
justify-content: space-around;
flex-direction: column;
.btn {
margin: 5px 0;
}
.price {
margin: 0 20px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.red {
font-size: 16px;
color: #A92924;
font-weight: bold;
}
}
}
}
}
.paginatio {
margin: 20px auto;
display: flex;
justify-content: center;
}
.contract-box {
display: flex;
justify-content: space-between;
border-bottom: solid 1px #e8e8e8;
padding: 10rpx 0;
}
.contract-left {
}
.contract-right {
text-align: right;
font-size: 13px;
}
.trade-method {
display: flex;
margin-bottom: 20px;
border-bottom: solid 2px #f4f4f4;
}
.trade-method-item {
cursor: pointer;
font-size: 18px;
margin-right: 15px;
height: 40px;
line-height: 40px;
}
.trade-method-item.active {
color: #A92924;
border-bottom: solid 2px #A92924;
}
.contract-left-top {
display: flex;
align-items: center;
}
.contract-product {
margin: 0 10px;
}
.contract-left-center {
height: 40px;
display: flex;
justify-content: flex-start;
align-items: flex-start;
color: #999999;
font-size: 12px;
flex-direction: column;
margin-top: 5px;
}
.contract-left-bottom {
display: flex;
}
.contract-status {
display: flex;
}
.contract-status-tag {
margin-left: 2px;
}
.sign {
padding: 20px 20px 20px 25px;
font-size: 14px;
.icon {
line-height: 18px;
}
}
.search {
display: flex;
.p {
margin-right: 10px;
}
}
.el-select .el-input {
width: 130px;
}
.input-with-select .el-input-group__prepend {
background-color: #fff;
}
</style>
+111
View File
@@ -0,0 +1,111 @@
<template>
<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">
<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 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="status === 0" @click.native="confirm(item)">选择</el-button>
</text>
</view>
</view>
</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";
export default {
name: "enquiryModal",
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
id: null,
dialogVisible: false,
quoteList: [],
status: 0
}
},
methods: {
open(status, quoteList) {
this.quoteList = quoteList
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
toRelease() {
uni.navigateTo({
url: '/pages/enquiry/release'
})
},
confirm(item) {
vk.callFunction({
url: 'client/enquiry/quote/kh/confirmQuote',
title: '请求中...',
data: {
quoteId: item._id,
},
success: (data) => {
this.dialogVisible = false
this.$message({
type: 'success',
message: '报价确认成功'
})
}
});
}
}
}
</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;
}
}
</style>
+120
View File
@@ -0,0 +1,120 @@
<template>
<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" >
<view class="request-header">
<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">{{
item.user.accountType === 1 ? item.user.person.personName : item.user.company.companyName
}}
</text>
<text class="flex-1">{{ item.totalPrice }}元</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>
</text>
</view>
</view>
</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";
export default {
name: "processModal",
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
id: null,
dialogVisible: false,
quoteList: [],
status: 0
}
},
methods: {
open(status, quoteList) {
console.log(status, quoteList)
this.quoteList = quoteList
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
toQuote() {
vk.navigateTo(`/pages/process/quote?sheetId=${this.id}`)
},
createContract({totalPrice, uid, _id}) {
vk.callFunction({
url: 'client/contract/kh/add',
data: {
type: 'process',
productTitle: this.info.title,
transactionId: vk.pubfn.createOrderNo("P", 20),
sheetId: this.id,
quoteId: _id,
buyer: vk.getVuex('$user.userInfo._id'),
seller: uid,
amount: totalPrice,
partyCount: 2,
signCount: 0,
}
}).then((res) => {
this.$message({
message: '选择成功',
type: 'success'
})
setTimeout(() => {
vk.navigateTo('/pages/contract/index')
}, 1500)
})
}
}
}
</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;
}
}
</style>
+155
View File
@@ -0,0 +1,155 @@
<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="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>
</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._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>
<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>
</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";
export default {
name: "spotModal",
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
id: null,
dialogVisible: false,
cooperateList: [],
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,
}
},
methods: {
open(status, cooperateList) {
this.cooperateList = cooperateList
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
toQuote() {
vk.navigateTo(`/pages/process/quote?sheetId=${this.id}`)
},
createContract({totalPrice, uid, _id}) {
vk.callFunction({
url: 'client/contract/kh/add',
data: {
type: 'process',
productTitle: this.info.title,
transactionId: vk.pubfn.createOrderNo("P", 20),
sheetId: this.id,
quoteId: _id,
buyer: vk.getVuex('$user.userInfo._id'),
seller: uid,
amount: totalPrice,
partyCount: 2,
signCount: 0,
}
}).then((res) => {
this.$message({
message: '选择成功',
type: 'success'
})
setTimeout(() => {
vk.navigateTo('/pages/contract/index')
}, 1500)
})
},
doShowInfo(info) {
this.info = info
this.showInfo = true
}
}
}
</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;
}
}
</style>
+620 -760
View File
File diff suppressed because it is too large Load Diff
+215 -210
View File
@@ -1,218 +1,223 @@
<template>
<el-card>
<div slot="header" class="clearfix">
<span>我的名片</span>
</div>
<!-- 表单开始 -->
<vk-data-form
ref="form1"
v-model="form1.data"
:rules="form1.props.rules"
:action="form1.props.action"
:form-type="form1.props.formType"
:columns='form1.props.columns'
:loading.sync="form1.props.loading"
label-width="140px"
input-width="400px"
:before-action="form1.props.beforeAction"
:show-cancel="false"
submit-text="保存名片"
@success="onFormSuccess"
>
<!-- 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> -->
</vk-data-form>
</el-card>
<el-card>
<div slot="header" class="clearfix">
<span>我的名片</span>
</div>
<!-- 表单开始 -->
<vk-data-form
ref="form1"
v-model="form1.data"
:rules="form1.props.rules"
:action="form1.props.action"
:form-type="form1.props.formType"
:columns='form1.props.columns'
:loading.sync="form1.props.loading"
label-width="140px"
input-width="400px"
:before-action="form1.props.beforeAction"
:show-cancel="false"
submit-text="保存名片"
@success="onFormSuccess"
>
<!-- 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> -->
</vk-data-form>
</el-card>
</template>
<script>
export default {
data() {
return {
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
companyIntroduction: ''
},
// 表单属性
props: {
// 表单请求地址
action: "no",
// 表单字段显示规则
columns: [
{
key: "logo",
title: "Logo",
type: "image",
limit: 1
},
{
key: "position",
title: "职位",
type: "text"
},
{
key: "phone",
title: "联系电话",
type: "text"
export default {
data() {
return {
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
companyIntroduction: ''
},
// 表单属性
props: {
// 表单请求地址
action: "no",
// 表单字段显示规则
columns: [
{
type: 'group',
columns: [
{
key: "logo",
title: "Logo",
type: "image",
limit: 1
},
{
key: "personalWechat",
title: "个人微信",
type: "image",
limit: 1
},
{
key: "companyWechat",
title: "企业微信",
type: "image",
limit: 1
},
]
},
{
key: "position",
title: "职位",
type: "text"
},
{
key: "companyMobile",
title: "公司电话",
type: "text"
},
{
key: "managerMobile",
title: "负责人电话",
type: "text"
},
{
key: "address",
title: "地区",
type: "address"
},
{
key: "addressDetail",
title: "详细地址",
type: "text"
},
{
key: "email",
title: "邮箱",
type: "text"
},
{
key: "website",
title: "网址",
type: "text"
},
{
key: "mainBusiness",
title: "主营业务",
type: "textarea"
},
{
key: "companyIntroduction",
title: "企业简介",
type: "editor"
},
],
// 表单验证规则
rules: {
logo: [{
required: true,
message: "请上传Logo",
trigger: ['blur', 'change']
}],
personalWechat: [{
required: true,
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: "地区不能为空",
trigger: ['blur', 'change']
}],
addressDetail: [{
required: true,
message: "详细地址不能为空",
trigger: ['blur', 'change']
}],
email: [{
required: true,
message: "邮箱不能为空",
trigger: ['blur', 'change']
}],
// website: [{
// required: true,
// message: "logo不能为空",
// trigger: ['blur', 'change']
// }],
mainBusiness: [{
required: true,
message: "主营业务不能为空",
trigger: ['blur', 'change']
}],
mainSpotCategoryIds: [{
required: true,
message: "主营商品不能为空",
trigger: ['blur', 'change']
}],
},
// add 代表添加 update 代表修改
formType: "update",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false,
beforeAction: (formData) => {
vk.callFunction({
url: 'client/user/kh/addAuth',
data: {
businessCard: formData
},
{
key: "mobile",
title: "联系电话",
type: "text"
},
{
key: "address",
title: "地区",
type: "address"
},
{
key: "addressDetail",
title: "详细地址",
type: "text"
},
{
key: "email",
title: "邮箱",
type: "text"
},
{
key: "website",
title: "网址",
type: "text"
},
{
key: "mainBusiness",
title: "主营业务",
type: "textarea"
},
{
key: "mainSpotCategoryIds",
title: "主营商品",
type: "checkbox",
action: "client/spot/category/pub/getList",
actionData: {
whereJson: {
level: 2
}
},
props: {
list: "data",
value: "_id",
label: "name"
}
},
{
key: "companyIntroduction",
title: "企业简介",
type: "editor"
},
],
// 表单验证规则
rules: {
logo: [{
required: true,
message: "Logo不能为空",
trigger: ['blur', 'change']
}],
personName: [{
required: true,
message: "姓名不能为空",
trigger: ['blur', 'change']
}],
position: [{
required: true,
message: "职位不能为空",
trigger: ['blur', 'change']
}],
address: [{
required: true,
message: "地区不能为空",
trigger: ['blur', 'change']
}],
addressDetail: [{
required: true,
message: "详细地址不能为空",
trigger: ['blur', 'change']
}],
email: [{
required: true,
message: "邮箱不能为空",
trigger: ['blur', 'change']
}],
// website: [{
// required: true,
// message: "logo不能为空",
// trigger: ['blur', 'change']
// }],
mainBusiness: [{
required: true,
message: "主营业务不能为空",
trigger: ['blur', 'change']
}],
mainSpotCategoryIds: [{
required: true,
message: "主营商品不能为空",
trigger: ['blur', 'change']
}],
companyIntroduction: [{
required: true,
message: "企业简介不能为空",
trigger: ['blur', 'change']
}],
},
// add 代表添加 update 代表修改
formType: "update",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false,
beforeAction: (formData) => {
vk.callFunction({
url: 'client/user/kh/addAuth',
data: {
businessCard: formData
},
success: (data) => {
// 成功后的逻辑
this.$message({
type: 'success',
message: '保存成功'
})
}
});
return false;
},
}
},
// 表单相关结束-----------------------------------------------------------
}
},
created() {
this.getUserInfo()
},
methods: {
getUserInfo() {
vk.userCenter.getCurrentUserInfo({
success: (data) => {
if(data.userInfo.businessCard) {
this.form1.data = data.userInfo.businessCard
}
// 成功后的逻辑
console.log('用户信息: ', data);
}
});
},
}
}
success: (data) => {
// 成功后的逻辑
this.$message({
type: 'success',
message: '保存成功'
})
}
});
return false;
},
}
},
// 表单相关结束-----------------------------------------------------------
}
},
created() {
this.getUserInfo()
},
methods: {
getUserInfo() {
vk.userCenter.getCurrentUserInfo({
success: (data) => {
if (data.userInfo.businessCard) {
this.form1.data = data.userInfo.businessCard
}
// 成功后的逻辑
console.log('用户信息: ', data);
}
});
},
}
}
</script>
<style>
+76 -175
View File
@@ -2,27 +2,27 @@
<el-card shadow="never">
<view class="welcome">
尊敬的平台商家您好,目前您是我们平台的
<text>黄金VIP LV1</text>
<text>{{ userLevelStr }} LV{{ userInfo.userGrade + 1 }}</text>
客户,可享受相应会员权益~
</view>
<view class="user-info">
<view class="left">
<view class="member-card">
<view class="card-name">
<text class="name">黄金VIP</text>
<text class="level">LV1</text>
<text class="name">{{ userLevelStr }}</text>
<text class="level">LV{{ userInfo.userGrade + 1 }}</text>
<text class="grade">
当前等级
</text>
</view>
<view class="exp-time">
有效期至:2023-09-18
<view class="exp-time" v-if="userInfo.upgradeExpiredAt">
有效期至:{{ userInfo.upgradeExpiredAt }}
</view>
<view class="progress-box">
<view class="left">
<view class="total-pay">当前交易额</view>
<view class="progress">
<view class="price">60W</view>
<view class="price">{{ userInfo.transactionAmount }}</view>
<view class="desc">还差40W升级LV2</view>
</view>
<view class="progress-line">
@@ -55,136 +55,60 @@
</view>
</view>
</view>
<view class="equity">
<view class="equity" v-if="userInfo.userGrade > -1">
<el-image src="https://oss.wsdns.cn/20231205/5ba845c9570e4fba95516b68ae661056.png"/>
<!-- <i class="el-icon-minus"></i>-->
<!-- <text>可享受一下权益</text>-->
<!-- <i class="el-icon-minus"></i>-->
</view>
<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">黄金VIP</div>
<div class="title">铂金VIP</div>
<div class="title">钻石VIP</div>
<div class="title">实力厂家</div>
<div class="title">实力商家</div>
<div class="title">实力加工厂</div>
<div class="title" v-for="(item, index) in userLevelList" :key="index">{{ item.name }}</div>
</div>
</div>
<div class="item">
<div class="item-box">
<div class="title">身份图标</div>
<div class="title">
<div class="title" v-for="(item, index) in userLevelList" :key="index">
<el-image class="level"
src="https://oss.wsdns.cn/20231205/cb35648023de4c40a0790c275962222f.png"></el-image>
</div>
<div class="title">
<el-image class="level"
src="https://oss.wsdns.cn/20231205/9816e24079d349068f52ba45c2786fb5.png"></el-image>
</div>
<div class="title">
<el-image class="level"
src="https://oss.wsdns.cn/20231205/11f497e8c11d45bb97b1939ac8ed68a1.png"></el-image>
</div>
<div class="title">
<el-image class="level"
src="https://oss.wsdns.cn/20231205/45ae2b50ca044f208edf2f411ed72da1.png"></el-image>
</div>
<div class="title">
<el-image class="level"
src="https://oss.wsdns.cn/20231205/10ae319c1bb045d3b871046c85f97432.png"></el-image>
</div>
<div class="title">
<el-image class="level"
src="https://oss.wsdns.cn/20231205/cea0d711c9004c57b14aec491e48c3ff.png"></el-image>
</div>
<div class="title">
<el-image class="level"
src="https://oss.wsdns.cn/20231205/a7445b2a6c224aee9115317f29867851.png"></el-image>
:src="item.icon[0]"/>
</div>
</div>
</div>
<div class="item">
<div class="item-box">
<div class="title">认证缴费</div>
<div class="title red">去认证<i class="el-icon-arrow-right"></i></div>
<div class="title red">去认证<i class="el-icon-arrow-right"></i></div>
<div class="title red">去认证<i class="el-icon-arrow-right"></i></div>
<div class="title red">去认证<i class="el-icon-arrow-right"></i></div>
<div class="title red">去认证<i class="el-icon-arrow-right"></i></div>
<div class="title red">去认证<i class="el-icon-arrow-right"></i></div>
<div class="title red">去认证<i class="el-icon-arrow-right"></i></div>
<div class="title red" v-for="(item, index) in userLevelList" :key="index">
去认证<i class="el-icon-arrow-right"></i>
</div>
</div>
</div>
<div class="item">
<div class="item-box">
<div class="title">获得身份方式</div>
<div class="title">
<div class="title" v-for="(item, index) in userLevelList" :key="index">
<div class="get-way">
<div>企业平台认证</div>
<div>VIP认证方法</div>
<div class="red">去升级<i class="el-icon-arrow-right"></i></div>
<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>
</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>
</template>
</div>
</div>
<div class="title">
<div class="get-way">
<div>购买</div>
<div>999元/年</div>
<div class="red">去升级<i class="el-icon-arrow-right"></i></div>
</div>
</div>
<div class="title">
<div class="get-way">
<div>购买</div>
<div>1999元/年</div>
<div class="red">去升级<i class="el-icon-arrow-right"></i></div>
</div>
</div>
<div class="title">
<div class="get-way">
<div>购买</div>
<div>5999元/年</div>
<div class="red">去升级<i class="el-icon-arrow-right"></i></div>
</div>
</div>
<div class="title">
<div class="get-way">
<div>购买+交易保证金</div>
<div>5999+20000</div>
<div class="red">去升级<i class="el-icon-arrow-right"></i></div>
</div>
</div>
<div class="title">
<div class="get-way">
<div>购买+交易保证金</div>
<div>5999+20000</div>
<div class="red">去升级<i class="el-icon-arrow-right"></i></div>
</div>
</div>
<div class="title">
<div class="get-way">
<div>购买+交易保证金</div>
<div>5999+20000</div>
<div class="red">去升级<i class="el-icon-arrow-right"></i></div>
</div>
</div>
</div>
</div>
<div class="item">
<div class="item-box">
<div class="title">询报价权益</div>
<div class="title">-</div>
<div class="title">-</div>
<div class="title">-</div>
<div class="title">-</div>
<div class="title">-</div>
<div class="title">-</div>
<div class="title">-</div>
<div class="title" v-for="(item, index) in userLevelList" :key="index">{{
parseInt(item.offerOffRate) === 100 ? '-' : `${parseInt(item.offerOffRate) / 10}折`
}}
</div>
</div>
</div>
</div>
@@ -199,12 +123,12 @@
<div class="title">会员权益</div>
</div>
</div>
<div class="item" v-for="(item, index) in gradeList" :key="index" @click="onChange(index)">
<div class="item" v-for="(item, index) in userPayEnsureList" :key="index" @click="onChange(index)">
<div class="item-box">
<div class="title">2023-01-01</div>
<div class="title">{{ item._add_time_str }}</div>
<div class="title">缴纳保证金</div>
<div class="title">¥20000</div>
<div class="title">钻石VIP LV1</div>
<div class="title">¥{{ item.amount }}</div>
<div class="title">-</div>
</div>
</div>
<view class="paginatio">
@@ -212,7 +136,8 @@
@current-change="search"
background
layout="prev, pager, next"
:total="10">
:page-size="pageSize"
:total="total">
</el-pagination>
</view>
</div>
@@ -290,93 +215,64 @@ export default {
select: 0,
comments: '实现视频并记录存档,收集相关纸质文件'
},
]
],
userLevelList: [],
userLevelStr: '普通用户',
userPayEnsureList: [],
pageSize: 10,
total: 0
}
},
created() {
this.getUserLevelList()
this.getUserPayEnsureList()
},
methods: {
getUserPayEnsureList(pageIndex = 1) {
vk.callFunction({
url: 'client/order/kh/getList',
data: {
pageIndex,
pageSize: this.pageSize
},
success: (res) => {
this.total = res.total
this.userPayEnsureList = res.rows
}
});
},
getUserInfo() {
vk.userCenter.getCurrentUserInfo({
success: (data) => {
if (data.userInfo.businessCard) {
this.form1.data = data.userInfo.businessCard
}
this.userInfo = data.userInfo
// 成功后的逻辑
console.log('用户信息: ', data);
if (data.userInfo.userLevel > -1) {
this.userLevelStr = this.userLevelList.find(level => parseInt(level.level) === parseInt(data.userInfo.userLevel)).name
}
}
});
},
onChange(money) {
this.money = money
},
onPay() {
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: {
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: `已完成支付`
// });
// }
// });
}
})
},
navTo(url) {
vk.navigateTo(url);
},
showForm(index) {
this.$emit('done', index);
},
search(pageIndex) {
// vk.callFunction({
// url: 'client/spot/goods/pub/getList',
// data: {
// pageIndex: pageIndex,
// pageSize: 20,
// keyword: this.keyword,
// categoryIds: this.checkCategoryList,
// provinceCodes: this.checkProvinceList
// },
// success: (data) => {
// console.log('data: ', data);
// data.rows.forEach(item => {
// try {
// item.addressStr = item.address.province.name + "-" + item.address.city.name + "-" + item.address.area.name
// } catch (err) {
// item.addressStr = ""
// }
// })
// this.goodsData = data
// }
// });
},
getUserLevelList() {
vk.callFunction({
url: 'client/userLevel/pub/getList',
data: {
pageIndex: 1,
pageSize: 200
},
success: (data) => {
this.userLevelList = data.rows
this.getUserInfo()
}
});
}
}
}
</script>
@@ -681,6 +577,11 @@ export default {
font-size: 13px;
line-height: 2em;
}
.level {
width: 80px;
height: 80px;
}
}
.info {
+259 -272
View File
@@ -1,304 +1,291 @@
<template>
<el-card>
<div slot="header" class="clearfix">
<span>会员等级</span>
</div>
<div class="grade-list">
<div class="item" v-for="(item,index) in gradeList" :key="index" :class="gradeIndex === index ? 'active' : ''" @click="onChange(index)">
<div class="item-box">
<div class="title">{{ item.name }}</div>
<div class="title">{{ item.price }}</div>
</div>
<div class="select">
<div class="icon">
<i class="el-icon-check"></i>
</div>
</div>
</div>
</div>
<div class="bzj-readme">
<div class="sub-title">保证金说明</div>
<div class="content">
保证金说明内容...
</div>
</div>
<div class="payment">
<div class="sub-title">支付方式</div>
<div class="content">
<el-radio-group v-model="paymentIndex" class="ml-4">
<el-radio v-for="(item,index) in payment" :key="index" :label="index"
size="large">{{ item }}</el-radio>
</el-radio-group>
</div>
</div>
<div class="pay-price">
<div class="sub-title">支付金额:¥{{ money }}元</div>
</div>
<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>
<el-button v-else type="danger" @click="onPay">立即支付</el-button>
</el-card>
<el-card>
<div slot="header" class="clearfix">
<span>会员等级</span>
</div>
<div class="grade-list">
<div class="item pointer" v-for="(item,index) in gradeList" :key="index"
:class="gradeIndex === index ? 'active' : ''" @click="onChange(index)">
<div class="item-box">
<div class="title">{{ item.name }}</div>
<div class="title">
<span>{{ item.amount }}元/年</span>
<span v-if="parseFloat(item.ensureAmount) > 0">+交易保证金</span>
</div>
</div>
<div class="select">
<div class="icon">
<i class="el-icon-check"></i>
</div>
</div>
</div>
</div>
<div class="bzj-readme">
<div class="sub-title">保证金说明</div>
<div class="content">
保证金说明内容...
</div>
</div>
<div class="payment">
<div class="sub-title">支付方式</div>
<div class="content">
<el-radio-group v-model="paymentIndex" class="ml-4">
<el-radio v-for="(item,index) in payment" :key="index" :label="index"
size="large">{{ item }}
</el-radio>
</el-radio-group>
</div>
</div>
<div class="pay-price">
<div class="sub-title">支付金额:¥{{ amount }}元</div>
</div>
<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>
<el-button v-else type="danger" @click="onPay">立即支付</el-button>
</el-card>
</template>
<script>
import UQRCode from 'uqrcodejs';
const OpenSdk = require('../lib/base').default;
// const OpenSdk = require('ums-sdk-nodejs').default;
import UQRCode from 'uqrcodejs';
import dayjs from "dayjs";
const sdk = new OpenSdk({
appId: '10037e6f6823b20801682b6a5e5a0006',
appKey: '1c4e3b16066244ae9b236a09e5b312e8'
})
export default {
components: {},
data() {
return {
paymentIndex: 0,
payment: ["银联支付"],
money: 5000,
showQrcode: false,
billQRCode: '',
gradeIndex: 1,
gradeList: [
{
id: 1,
name: '黄金VIP',
price: '699元/年'
},
{
id: 2,
name: '铂金VIP',
price: '1999元/年'
},
{
id: 3,
name: '钻石VIP',
price: '2999元/年'
},
{
id: 4,
name: '实力厂家',
price: '20000元/年+交易保证金'
},
{
id: 5,
name: '实力加工厂',
price: '20000元/年+交易保证金'
},
{
id: 6,
name: '实力采购商',
price: '20000元/年+交易保证金'
}
]
}
},
created() {},
methods: {
getUserInfo() {
vk.userCenter.getCurrentUserInfo({
success: (data) => {
if (data.userInfo.businessCard) {
this.form1.data = data.userInfo.businessCard
}
// 成功后的逻辑
console.log('用户信息: ', data);
}
});
const OpenSdk = require('../lib/base').default;
// const OpenSdk = require('ums-sdk-nodejs').default;
},
onChange(index) {
this.gradeIndex = index
},
onPay() {
const date = new Date()
const requestTimestamp = this.dateFormat('YYYY-mm-dd HH:MM:SS', date)
const timestamp = this.dateFormat('YYYYmmddHHMMSS', date)
console.log(timestamp)
console.log(requestTimestamp)
let data = {
queryUrl: 'https://test-api-open.chinaums.com/v1/netpay/bills/get-qrcode',
timestamp,
nonce: 'rp84ufhfn20yneo3tp',
content: {
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: `已完成支付`
// });
// }
// });
}
})
},
dateFormat(fmt, date) {
const opt = {
"Y+": date.getFullYear().toString(), // 年
"m+": (date.getMonth() + 1).toString(), // 月
"d+": date.getDate().toString(), // 日
"H+": date.getHours().toString(), // 时
"M+": date.getMinutes().toString(), // 分
"S+": date.getSeconds().toString() // 秒
// 有其他格式化字符需求可以继续添加,必须转化成字符串
};
let ret
for (let k in opt) {
ret = new RegExp("(" + k + ")").exec(fmt)
if (ret) {
fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
};
};
return fmt
}
}
}
const sdk = new OpenSdk({
appId: '10037e6f6823b20801682b6a5e5a0006',
appKey: '1c4e3b16066244ae9b236a09e5b312e8'
})
export default {
components: {},
data() {
return {
paymentIndex: 0,
payment: ["银联支付"],
showQrcode: false,
billQRCode: '',
gradeIndex: 1,
gradeList: []
}
},
created() {
this.getUserLevelList()
},
methods: {
getUserInfo() {
vk.userCenter.getCurrentUserInfo({
success: (data) => {
if (data.userInfo.businessCard) {
this.form1.data = data.userInfo.businessCard
}
// 成功后的逻辑
console.log('用户信息: ', data);
}
});
},
onChange(index) {
this.gradeIndex = index
},
async onPay() {
const res = await vk.callFunction({
url: 'client/order/kh/add',
data: {
goods: {
name: '会员升级',
amount: this.amount,
cover: null
},
type: 3,
goodsId: parseInt(this.gradeList[this.gradeIndex].level),
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: `已完成支付`
// });
// }
// });
}
})
},
getUserLevelList() {
vk.callFunction({
url: 'client/userLevel/pub/getList',
data: {
pageIndex: 1,
pageSize: 200
},
success: (data) => {
this.gradeList = data.rows.filter(item => parseFloat(item.amount) > 0)
}
});
}
},
computed: {
amount() {
return parseFloat(this.gradeList[this.gradeIndex].amount) + parseFloat(this.gradeList[this.gradeIndex].ensureAmount)
}
},
}
</script>
<style lang="scss" scoped>
.clearfix {
font-weight: bold;
font-size: 18px;
}
.clearfix {
font-weight: bold;
font-size: 18px;
}
.grade-list {
display: flex;
.grade-list {
display: flex;
flex-direction: column;
justify-content: space-between;
justify-content: space-between;
.item {
position: relative;
border: 1px solid #eee;
.item {
position: relative;
border: 1px solid #eee;
.item-box {
display: flex;
.item-box {
display: flex;
.title {
padding: 10px;
display: flex;
align-items: center;
flex: 1;
justify-content: center;
text-align: center;
}
.title {
padding: 10px;
display: flex;
align-items: center;
flex: 1;
justify-content: center;
text-align: center;
}
.info {
padding: 10px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 230px;
.info {
padding: 10px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 230px;
.price {
font-size: 28px;
}
.price {
font-size: 28px;
}
.desc {
color: #ccc;
}
}
}
.desc {
color: #ccc;
}
}
}
.select {
display: none;
}
}
.select {
display: none;
}
}
.active {
border: 2px solid #bf2b28 !important;
.active {
border: 2px solid #bf2b28 !important;
.item-box {
.title {
color: #bf2b28;
}
.item-box {
.title {
color: #bf2b28;
}
.info {
.price {
color: #bf2b28;
}
.info {
.price {
color: #bf2b28;
}
.desc {
color: #ccc;
}
}
}
.desc {
color: #ccc;
}
}
}
.select {
position: absolute;
right: 0;
bottom: 0;
border-top: 20px solid transparent;
border-right: 20px solid #bf2b28;
border-left: 20px solid transparent;
border-bottom: 20px solid #bf2b28;
display: flex;
.select {
position: absolute;
right: 0;
bottom: 0;
border-top: 20px solid transparent;
border-right: 20px solid #bf2b28;
border-left: 20px solid transparent;
border-bottom: 20px solid #bf2b28;
display: flex;
.icon {
position: relative;
.icon {
position: relative;
.el-icon-check {
position: absolute;
left: 0;
top: 0;
color: #fff;
}
}
}
}
}
.el-icon-check {
position: absolute;
left: 0;
top: 0;
color: #fff;
}
}
}
}
}
.box-card {
margin-top: 20px;
border: none;
}
.box-card {
margin-top: 20px;
border: none;
}
.sub-title {
color: #bf2b28;
font-size: 18px;
font-weight: bold;
border-left: 5px solid #bf2b28;
padding-left: 10px;
height: 20px;
line-height: 20px;
margin: 20px auto;
}
.sub-title {
color: #bf2b28;
font-size: 18px;
font-weight: bold;
border-left: 5px solid #bf2b28;
padding-left: 10px;
height: 20px;
line-height: 20px;
margin: 20px auto;
}
.bzj-readme {
margin-top: 20px;
}
.bzj-readme {
margin-top: 20px;
}
.payment {
margin-top: 20px;
}
.payment {
margin-top: 20px;
}
.pay-price {
margin-top: 20px;
}
.pay-price {
margin-top: 20px;
}
.pay-desc {
font-size: 16px;
line-height: 2em;
}
.pay-desc {
font-size: 16px;
line-height: 2em;
}
</style>
+146 -247
View File
@@ -1,263 +1,162 @@
<template>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>您有<em style="color: #bf2b28;padding: 0 3px;font-weight: 500">{{ num }}</em>条未读消息</span>
<el-button style="float: right; padding: 3px 0; color: #666" type="text" @click="onSetting"><i class="el-icon-setting"></i> 消息推送设置</el-button>
</div>
<!-- 消息列表 -->
<div class="notice-list">
<div class="item" v-for="(item,index) in noticeList" :key="index">
<div class="title-box">
<div class="title-box">
<el-badge is-dot class="badge" v-if="item.status === 0"></el-badge>
<div class="title">{{ item.title }}</div>
<div class="time">{{ item.time }}</div>
</div>
<div class="right">
<div class="btn" @click="onStatus(index)">
<i class="el-icon-sunset"></i>标记为已读
</div>
<div class="btn" @click="onDelete(index)">
<i class="el-icon-delete"></i>删除
</div>
</div>
</div>
<div class="desc">
{{ item.comments }}
</div>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>您有<em style="color: #bf2b28;padding: 0 3px;font-weight: 500">{{ unreadNum }}</em>条未读消息</span>
<el-button style="float: right; padding: 3px 0; color: #666" type="text" @click="onSetting"
v-if="parseInt(vk.getVuex('$user.userInfo.userLevel')) > 0"><i
class="el-icon-setting"></i> 消息推送设置
</el-button>
</div>
<!-- 消息列表 -->
<div class="notice-list">
<div class="item" v-for="(item,index) in noticeList" :key="index">
<div class="title-box">
<div class="title-box pointer" @click="toDetail(item, index)">
<el-badge is-dot class="badge" v-if="!item.hasRead"></el-badge>
<div class="title">{{ item.title }}</div>
<div class="time">{{ item._add_time_str }}</div>
</div>
<div class="right">
<div class="btn" @click="setRead(index)" v-if="!item.hasRead">
<i class="el-icon-sunset"></i>标记为已读
</div>
<div class="btn" @click="del(index)">
<i class="el-icon-delete"></i>删除
</div>
</div>
</div>
<div class="desc">
{{ item.content }}
</div>
</div>
<div class="text-center mt-20">
<el-pagination @current-change="getList" background layout="prev, pager, next"
:total="total"></el-pagination>
</div>
</div>
</div>
<!-- 添加或编辑的弹窗结束 -->
</el-card>
<!-- 添加或编辑的弹窗结束 -->
</el-card>
</template>
<script>
let that;
const originalForms = {sort: 0, enable: true}
// import { VueCropper } from 'vue-cropper'
export default {
components: {
// VueCropper
},
data() {
return {
num: 1,
noticeList: [
{
id: 1,
title: '恭喜!您已注册成功!',
comments: '尊敬的用户,恭喜您已成功注册金久信钢铁交易平台,感谢您的支持!',
time: '2023-05-18 10:15:00',
status: 0
}
],
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: "client/seal/kh/getList",
// 表格字段显示规则
columns: [
{
key: "imageUrl",
title: "印章",
type: "image",
width: 280,
},
{
key: "remark",
title: "备注",
type: "text",
},
{
key: "_add_time",
title: "添加时间",
type: "time",
width: 160
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: ""
},
// 表格相关结束 -----------------------------------------------------------
// 表单相关开始 -----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
enable: true
},
// 表单属性
props: {
// 表单请求地址
action: "",
// 表单字段显示规则
columns: [
{
key:"imageUrl", title:"印章图片", type:"image",
limit: 1,
tips: '图片格式:PNG,需设置为透明底;图片尺寸:企业章 166x166 像素,个人章 134x60 像素,印章紧密贴紧四周,尽量避免留白;',
watch: (data) => {
const { value, formData, column, index, option, $set } = data
if(!value) {
this.form1.data.imageBase64 = ""
}else {
vk.showLoading('正在上传')
vk.myfn.urlTobase64(value).then(res => {
this.form1.data.imageBase64 = res
vk.hideLoading();
})
}
}
},
{
key:"remark", title:"备注", type:"text"
},
{ key: "enable", title: "启用", type: "switch", activeValue: true, inactiveValue: false, width: 100 },
],
// 表单验证规则
rules: {
imageUrl: [
{ required:true, message:'印章不能为空', trigger:'blur' },
{ required:true, message:'印章不能为空', trigger:'blur' },
],
label:[
{ required:true, message:'属性名称不能为空', trigger:'blur' },
],
values:[
{ required:true, message:'可选值不能为空', trigger:'blur' },
],
},
// add 代表添加 update 代表修改
formType: "",
// 是否显示表单的弹窗
show: false,
beforeAction:(formData)=>{
// 可在此处修改 formData 后返回 formData,若在此处return false,则表单不触发提交请求。
return formData;
},
}
},
// 其他弹窗表单
// 表单相关结束 -----------------------------------------------------------
}
},
created() {
that = this
},
methods: {
addBtn() {
that.resetForm();
that.form1.props.action = 'client/seal/kh/add';
that.form1.props.formType = 'add';
that.form1.props.title = '添加';
that.form1.props.show = true;
},
// 显示修改页面
updateBtn({
item
}) {
that.form1.props.action = 'client/seal/kh/update';
that.form1.props.formType = 'update';
that.form1.props.title = '编辑';
that.form1.props.show = true;
that.form1.data = item;
},
closeForm() {
this.form1.props.show = false
this.form1.data = {
sort: 0,
enable: true
}
},
// 删除按钮
deleteBtn({
item,
deleteFn
}) {
deleteFn({
action: "client/seal/kh/delete",
data: {
_id: item._id
},
});
},
// 表单重置
resetForm() {
vk.pubfn.resetForm(originalForms, that);
},
// 搜索
search() {
that.$refs.table1.search();
},
// 刷新
refresh() {
that.$refs.table1.refresh();
},
onStatus(index){
this.noticeList[index].status = 1;
},
onDelete(index){
this.noticeList.splice(index,1)
},
onSetting(){
this.$emit('done','setting')
}
}
}
let that;
export default {
data() {
return {
unreadNum: 0,
noticeList: [],
pageSize: 20,
total: 0
}
},
created() {
this.getList()
},
methods: {
async getList(pageIndex = 1) {
const {rows} = await vk.callFunction({
url: 'client/message/kh/getList',
data: {
pageIndex,
pageSize: this.pageSize,
}
})
this.unreadNum = 0
this.noticeList = rows
this.noticeList.forEach(item => {
if (!item.hasRead) this.unreadNum++
})
},
async setRead(index) {
this.noticeList[index].hasRead = true
await vk.callFunction({
url: 'client/message/kh/setRead',
data: {
id: this.noticeList[index]._id
}
})
},
async del(index) {
await vk.callFunction({
url: 'client/message/kh/delete',
data: {
id: this.noticeList[index]._id
}
})
this.$message({
type: 'success',
message: '删除成功'
})
await this.getList()
},
onSetting() {
this.$emit('done', 'setting')
},
toDetail(item, index) {
this.setRead(index)
let url = null
if (item.type === 'old') url = `/pages/index/old/detail?id=${item.pk}`
else if (item.type === 'enquiry') url = `/pages/enquiry/detail?id=${item.pk}`
else if (item.type === 'process') url = `/pages/process/detail?id=${item.pk}`
if (url) vk.navigateTo({url})
}
}
}
</script>
<style lang="less">
.el-icon-setting{
padding: 0 5px;
.el-icon-setting {
padding: 0 5px;
}
.notice-list{
.item{
display: flex;
flex-direction: column;
.title-box{
display: flex;
align-items: center;
justify-content: space-between;
.title{
font-size: 14px;
}
.time{
margin-left: 10px;
color: #999999;
}
.badge{
.notice-list {
.item {
display: flex;
flex-direction: column;
margin-right: 10px;
}
}
.desc{
color: #999999;
line-height: 2em;
}
.right{
display: flex;
.btn{
color: #bf2b28;
cursor: pointer;
i{
padding: 0 5px;
margin-left: 10px;
.title-box {
display: flex;
align-items: center;
justify-content: space-between;
.title {
font-size: 14px;
}
.time {
margin-left: 10px;
color: #999999;
}
.badge {
display: flex;
flex-direction: column;
margin-right: 10px;
}
}
.desc {
color: #999999;
line-height: 2em;
}
.right {
display: flex;
.btn {
color: #bf2b28;
cursor: pointer;
i {
padding: 0 5px;
margin-left: 10px;
}
}
.active {
}
}
}
.active{
}
}
}
}
</style>
+289 -272
View File
@@ -1,303 +1,320 @@
<template>
<el-card>
<div slot="header" class="clearfix">
<span>交易保证金缴纳</span>
</div>
<div class="bzj-price">
<div class="item" :class="money === 5000 ? 'active' : ''" @click="onChange(5000)">
<div class="item-box">
<div class="title">保证金</div>
<div class="info">
<text class="price">¥5000</text>
<text class="desc">文字信息后台编辑</text>
</div>
</div>
<div class="select">
<div class="icon">
<i class="el-icon-check"></i>
</div>
</div>
</div>
<div class="item" :class="money === 10000 ? 'active' : ''" @click="onChange(10000)">
<div class="item-box">
<div class="title">保证金</div>
<div class="info">
<text class="price">¥10000</text>
<text class="desc">文字信息后台编辑</text>
</div>
</div>
<div class="select">
<div class="icon">
<i class="el-icon-check"></i>
</div>
</div>
</div>
<div class="item" :class="money === 20000 ? 'active' : ''" @click="onChange(20000)">
<div class="item-box">
<div class="title">保证金</div>
<div class="info">
<text class="price">¥20000</text>
<text class="desc">文字信息后台编辑</text>
</div>
</div>
<div class="select">
<div class="icon">
<i class="el-icon-check"></i>
</div>
</div>
</div>
</div>
<div class="bzj-readme">
<div class="sub-title">保证金说明</div>
<div class="content">
保证金说明内容...
</div>
</div>
<div class="payment">
<div class="sub-title">支付方式</div>
<div class="content">
<el-radio-group v-model="paymentIndex" class="ml-4">
<el-radio v-for="(item,index) in payment" :key="index" :label="index"
size="large">{{ item }}</el-radio>
</el-radio-group>
</div>
</div>
<div class="pay-price">
<div class="sub-title">支付金额:¥{{ money }}元</div>
</div>
<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>
<el-button v-else type="danger" @click="onPay">立即支付</el-button>
</el-card>
<el-card>
<div slot="header" class="clearfix">
<span>交易保证金缴纳</span>
</div>
<div class="bzj-price">
<div class="item" :class="money === 5000 ? 'active' : ''" @click="onChange(5000)">
<div class="item-box">
<div class="title">保证金</div>
<div class="info">
<text class="price">¥5000</text>
<text class="desc">文字信息后台编辑</text>
</div>
</div>
<div class="select">
<div class="icon">
<i class="el-icon-check"></i>
</div>
</div>
</div>
<div class="item" :class="money === 10000 ? 'active' : ''" @click="onChange(10000)">
<div class="item-box">
<div class="title">保证金</div>
<div class="info">
<text class="price">¥10000</text>
<text class="desc">文字信息后台编辑</text>
</div>
</div>
<div class="select">
<div class="icon">
<i class="el-icon-check"></i>
</div>
</div>
</div>
<div class="item" :class="money === 20000 ? 'active' : ''" @click="onChange(20000)">
<div class="item-box">
<div class="title">保证金</div>
<div class="info">
<text class="price">¥20000</text>
<text class="desc">文字信息后台编辑</text>
</div>
</div>
<div class="select">
<div class="icon">
<i class="el-icon-check"></i>
</div>
</div>
</div>
</div>
<div class="bzj-readme">
<div class="sub-title">保证金说明</div>
<div class="content">
保证金说明内容...
</div>
</div>
<div class="payment">
<div class="sub-title">支付方式</div>
<div class="content">
<el-radio-group v-model="paymentIndex" class="ml-4">
<el-radio v-for="(item,index) in payment" :key="index" :label="index"
size="large">{{ item }}
</el-radio>
</el-radio-group>
</div>
</div>
<div class="pay-price">
<div class="sub-title">支付金额:¥{{ money }}元</div>
</div>
<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>
<el-button v-else type="danger" @click="onPay">立即支付</el-button>
</el-card>
</template>
<script>
import UQRCode from 'uqrcodejs';
const OpenSdk = require('../lib/base').default;
// const OpenSdk = require('ums-sdk-nodejs').default;
import UQRCode from 'uqrcodejs';
import dayjs from "dayjs";
const sdk = new OpenSdk({
appId: '10037e6f6823b20801682b6a5e5a0006',
appKey: '1c4e3b16066244ae9b236a09e5b312e8'
})
export default {
components: {},
data() {
return {
paymentIndex: 0,
payment: ["银联支付"],
money: 5000,
showQrcode: false,
billQRCode: ''
}
},
created() {},
methods: {
getUserInfo() {
vk.userCenter.getCurrentUserInfo({
success: (data) => {
if (data.userInfo.businessCard) {
this.form1.data = data.userInfo.businessCard
}
// 成功后的逻辑
console.log('用户信息: ', data);
}
});
const OpenSdk = require('../lib/base').default;
// const OpenSdk = require('ums-sdk-nodejs').default;
},
onChange(money) {
this.money = money
},
onPay() {
const date = new Date()
const requestTimestamp = this.dateFormat('YYYY-mm-dd HH:MM:SS', date)
const timestamp = this.dateFormat('YYYYmmddHHMMSS', date)
console.log(timestamp)
console.log(requestTimestamp)
let data = {
queryUrl: 'https://test-api-open.chinaums.com/v1/netpay/bills/get-qrcode',
timestamp,
nonce: 'rp84ufhfn20yneo3tp',
content: {
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: `已完成支付`
// });
// }
// });
}
})
},
dateFormat(fmt, date) {
const opt = {
"Y+": date.getFullYear().toString(), // 年
"m+": (date.getMonth() + 1).toString(), // 月
"d+": date.getDate().toString(), // 日
"H+": date.getHours().toString(), // 时
"M+": date.getMinutes().toString(), // 分
"S+": date.getSeconds().toString() // 秒
// 有其他格式化字符需求可以继续添加,必须转化成字符串
};
let ret
for (let k in opt) {
ret = new RegExp("(" + k + ")").exec(fmt)
if (ret) {
fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
};
};
return fmt
}
}
}
const sdk = new OpenSdk({
appId: '10037e6f6823b20801682b6a5e5a0006',
appKey: '1c4e3b16066244ae9b236a09e5b312e8'
})
export default {
components: {},
data() {
return {
paymentIndex: 0,
payment: ["银联支付"],
money: 5000,
showQrcode: false,
billQRCode: ''
}
},
created() {
},
methods: {
getUserInfo() {
vk.userCenter.getCurrentUserInfo({
success: (data) => {
if (data.userInfo.businessCard) {
this.form1.data = data.userInfo.businessCard
}
// 成功后的逻辑
console.log('用户信息: ', data);
}
});
},
onChange(money) {
this.money = money
},
async onPay() {
const res = await vk.callFunction({
url: 'client/order/kh/add',
data:{
goods: {
name: '缴纳保证金',
amount: this.money,
cover: null
},
type: 2,
goodsId: null,
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: `已完成支付`
// });
// }
// });
}
})
},
dateFormat(fmt, date) {
const opt = {
"Y+": date.getFullYear().toString(), // 年
"m+": (date.getMonth() + 1).toString(), // 月
"d+": date.getDate().toString(), // 日
"H+": date.getHours().toString(), // 时
"M+": date.getMinutes().toString(), // 分
"S+": date.getSeconds().toString() // 秒
// 有其他格式化字符需求可以继续添加,必须转化成字符串
};
let ret
for (let k in opt) {
ret = new RegExp("(" + k + ")").exec(fmt)
if (ret) {
fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
}
;
}
;
return fmt
}
}
}
</script>
<style lang="scss" scoped>
.clearfix {
font-weight: bold;
font-size: 18px;
}
.clearfix {
font-weight: bold;
font-size: 18px;
}
.bzj-price {
display: flex;
justify-content: space-between;
.bzj-price {
display: flex;
justify-content: space-between;
.item {
position: relative;
border: 1px solid #eee;
.item {
position: relative;
border: 1px solid #eee;
.item-box {
display: flex;
.item-box {
display: flex;
.title {
padding: 10px;
border-right: 1px solid #eee;
display: flex;
align-items: center;
width: 40px;
justify-content: center;
text-align: center;
}
.title {
padding: 10px;
border-right: 1px solid #eee;
display: flex;
align-items: center;
width: 40px;
justify-content: center;
text-align: center;
}
.info {
padding: 10px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 230px;
.info {
padding: 10px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 230px;
.price {
font-size: 28px;
}
.price {
font-size: 28px;
}
.desc {
color: #ccc;
}
}
}
.desc {
color: #ccc;
}
}
}
.select {
display: none;
}
}
.select {
display: none;
}
}
.active {
border: 2px solid #bf2b28 !important;
.active {
border: 2px solid #bf2b28 !important;
.item-box {
.title {
border-right: 2px solid #bf2b28 !important;
color: #bf2b28;
}
.item-box {
.title {
border-right: 2px solid #bf2b28 !important;
color: #bf2b28;
}
.info {
.price {
color: #bf2b28;
}
.info {
.price {
color: #bf2b28;
}
.desc {
color: #ccc;
}
}
}
.desc {
color: #ccc;
}
}
}
.select {
position: absolute;
right: 0;
bottom: 0;
border-top: 20px solid transparent;
border-right: 20px solid #bf2b28;
border-left: 20px solid transparent;
border-bottom: 20px solid #bf2b28;
display: flex;
.select {
position: absolute;
right: 0;
bottom: 0;
border-top: 20px solid transparent;
border-right: 20px solid #bf2b28;
border-left: 20px solid transparent;
border-bottom: 20px solid #bf2b28;
display: flex;
.icon {
position: relative;
.icon {
position: relative;
.el-icon-check {
position: absolute;
left: 0;
top: 0;
color: #fff;
}
}
}
}
}
.el-icon-check {
position: absolute;
left: 0;
top: 0;
color: #fff;
}
}
}
}
}
.box-card {
margin-top: 20px;
border: none;
}
.box-card {
margin-top: 20px;
border: none;
}
.sub-title {
color: #bf2b28;
font-size: 18px;
font-weight: bold;
border-left: 5px solid #bf2b28;
padding-left: 10px;
height: 20px;
line-height: 20px;
margin: 20px auto;
}
.sub-title {
color: #bf2b28;
font-size: 18px;
font-weight: bold;
border-left: 5px solid #bf2b28;
padding-left: 10px;
height: 20px;
line-height: 20px;
margin: 20px auto;
}
.bzj-readme {
margin-top: 20px;
}
.bzj-readme {
margin-top: 20px;
}
.payment {
margin-top: 20px;
}
.payment {
margin-top: 20px;
}
.pay-price {
margin-top: 20px;
}
.pay-price {
margin-top: 20px;
}
.pay-desc {
font-size: 16px;
line-height: 2em;
}
.pay-desc {
font-size: 16px;
line-height: 2em;
}
</style>
+406 -124
View File
@@ -7,68 +7,285 @@
<id-card theme="outline" size="24" fill="#a92924" strokeLinecap="square" style="height: 24px"/>
<span class="text-40" v-if="vk.getVuex('$user.userInfo.accountType') === 1">个人认证</span>
<span class="text-40" v-if="vk.getVuex('$user.userInfo.accountType') === 2">企业认证</span>
<div class="ml-20 flex justify-start items-center" v-if="!form1.data.fadadaConfirm">
<div class="ml-20 flex justify-start items-center" v-if="!userInfo.fadadaConfirm">
<info theme="outline" size="18" fill="#a92924" strokeLinecap="square"
style="height: 18px"/>
<template v-if="form1.data.authStatus === null || form1.data.authStatus === -1">
<template v-if="userInfo.authStatus === null || userInfo.authStatus === -1">
<span
v-if="vk.getVuex('$user.userInfo.accountType') === 1">您还未提交您的个人资料</span>
<span
v-if="vk.getVuex('$user.userInfo.accountType') === 2">您还未提交您的企业资料</span>
</template>
<template v-else-if="form1.data.authStatus === 0">
<template v-else-if="userInfo.authStatus === 0">
<span>审核中</span>
</template>
<template v-else-if="form1.data.authStatus === 2">
<span>审核不通过:{{ form1.data.refuseReason }}</span>
<template v-else-if="userInfo.authStatus === 1">
<span>审核通过</span>
</template>
<template v-else-if="userInfo.authStatus === 2">
<span>审核不通过:{{ userInfo.refuseReason }}</span>
</template>
</div>
<span class="ml-20" v-else>认证成功</span>
</div>
<el-button type="primary" plain class="empty-bg-plain-btn" size="small" @click.native="makeCard">
制作我的名片
</el-button>
</div>
</div>
<vk-data-form ref="form1" v-model="form1.data" :action="form1.props.action" :columns="form1.props.columns"
:footer-show="false"
:before-action="form1.props.beforeAction" :rules="form1.props.rules"
:form-type="form1.props.formType"
:loading.sync="form1.props.loading" :auto-close="true" label-width="140px"
@success="onFormSuccess1">
<template v-slot:toFadada="{form, keyName}">
<el-button @click="getCertUrl" type="primary" size="small">去认证</el-button>
<el-button @click="getCertRes" type="primary" size="small">获取认证结果</el-button>
</template>
<template v-slot:accountAuth="{form, keyName}">
<div>
<p>请用个人账户向以下账户转账0.10元。请备注:账号认证,平台将7个工作日内退回原账户。</p>
<el-form ref="form" :model="form" label-width="120px">
<el-form-item label="认证方式">
<el-radio-group v-model="form.authType" :disabled="[0].includes(userInfo.authStatus)">
<el-radio :label="1">法大大接口认证</el-radio>
<el-radio :label="2">金九信平台审核</el-radio>
</el-radio-group>
</el-form-item>
<template v-if="form.authType === 2 || (userInfo.hasOwnProperty('fadadaConfirm') && userInfo.fadadaConfirm)">
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="企业名称">
<el-input v-model="userInfo.company.companyName" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="信用代码" required>
<el-input v-model="form.company.organization"
:disabled="[0, 1].includes(userInfo.authStatus)"/>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="公司所在地" required>
<el-row :gutter="10" class="border-bottom pb-20">
<el-col :span="4">
<el-select v-model="addressIndex[0]" placeholder="请选择省"
:disabled="[0, 1].includes(userInfo.authStatus)">
<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="请选择市"
:disabled="addressIndex.length === 0 || [0, 1].includes(userInfo.authStatus)">
<template v-if="addressIndex[0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[0]]" :key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[2]" placeholder="请选择区"
:disabled="addressIndex.length === 1 || [0, 1].includes(userInfo.authStatus)">
<template v-if="addressIndex[0] !== null && addressIndex[1] !== null">
<el-option v-for="(item, index) in areaData[addressIndex[0]][addressIndex[1]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="11">
<el-input v-model="form.company.addressDetail" placeholder="请输入详细地址"
:disabled="[0, 1].includes(userInfo.authStatus)"/>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="联系方式" required>
<el-input v-model="form.company.mobile" :disabled="[0, 1].includes(userInfo.authStatus)"/>
</el-form-item>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="有效通信地址">
<el-input v-model="form.company.mailAddress"
:disabled="[0, 1].includes(userInfo.authStatus)"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="有效邮箱地址">
<el-input v-model="form.company.contactEmail"
:disabled="[0, 1].includes(userInfo.authStatus)"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="对公账号" required>
<el-input v-model="form.company.companyAccount"
:disabled="[0, 1].includes(userInfo.authStatus)"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="开户行" required>
<el-input v-model="form.company.companyBankName"
:disabled="[0, 1].includes(userInfo.authStatus)"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="个人账号">
<el-input v-model="form.company.personAccount"
:disabled="[0, 1].includes(userInfo.authStatus)"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="个人开户行">
<el-input v-model="form.company.personBankName"
:disabled="[0, 1].includes(userInfo.authStatus)"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="个人账户名">
<el-input v-model="form.company.accountName"
:disabled="[0, 1].includes(userInfo.authStatus)"/>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="经营类目" required>
<el-input v-model="form.company.businessType" :disabled="[0, 1].includes(userInfo.authStatus)"/>
</el-form-item>
<el-form-item label="主营商品" required>
<el-checkbox-group v-model="form.company.mainSpotCategoryIds"
:disabled="[0, 1].includes(userInfo.authStatus)">
<el-checkbox v-for="(item, index) in goodsCate" :key="index" :label="item._id">
{{ item.name }}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="上传营业执照" required>
<view class="flex justify-start items-center">
<vk-data-upload :limit="1" v-model="form.company.organizationPath"
:disabled="[0, 1].includes(userInfo.authStatus)"></vk-data-upload>
<text class="text-main ml-20">请您上传盖章的扫描件或者复印件</text>
</view>
</el-form-item>
<el-form-item label="上传开票资料" required>
<view class="flex justify-start items-center">
<vk-data-upload :limit="1" v-model="form.company.invoiceInfo"
:disabled="[0, 1].includes(userInfo.authStatus)"></vk-data-upload>
<text class="text-main ml-20">加盖公章</text>
<view class="ml-35">
<el-radio-group v-model="form.company.taxType"
:disabled="[0, 1].includes(userInfo.authStatus)">
<el-radio label="一般纳税人">一般纳税人</el-radio>
<el-radio label="小规模纳税人">小规模纳税人</el-radio>
<el-radio label="其他">其他</el-radio>
</el-radio-group>
</view>
</view>
</el-form-item>
<el-form-item label="纳税人资格">
<view class="flex justify-start items-center">
<vk-data-upload :limit="1" v-model="form.company.taxImage"
:disabled="[0, 1].includes(userInfo.authStatus)"></vk-data-upload>
<text class="text-main ml-20">加盖公章</text>
</view>
</el-form-item>
<el-form-item label="平台交易账号认证" required>
<div>
<span>户名:金久信</span>
<span class="ml-35">开户行:中国广发银行南宁支行</span>
<span class="ml-35">账号:6222XXXXX</span>
<p>请用个人账户向以下账户转账0.10元。请备注:账号认证,平台将7个工作日内退回原账户。</p>
<div>
<span>户名:金久信</span>
<span class="ml-35">开户行:中国广发银行南宁支行</span>
<span class="ml-35">账号:6222XXXXX</span>
</div>
</div>
</div>
</template>
<template v-slot:manageList="{form, keyName}">
</el-form-item>
<div class="flex justify-start items-center">
<id-card theme="outline" size="24" fill="#a92924" strokeLinecap="square" style="height: 24px"/>
<span class="text-40 mr-35">企业授权人信息</span>
<el-button type="primary" size="small" @click.native="addManage"
v-if="manageList.length === 0 && (JSON.stringify(form.manager) === '{}' || !form.manager)">
添加授权人
</el-button>
</div>
<el-form-item label="代理人类型" required>
<el-radio-group v-model="form.manager.type" :disabled="[0, 1].includes(userInfo.authStatus)">
<el-radio :label="1">法人</el-radio>
<el-radio :label="2">代理人</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="代理人姓名" required>
<el-input v-model="form.manager.personName" :disabled="[0, 1].includes(userInfo.authStatus)"/>
</el-form-item>
<el-form-item label="证件类型" required>
<el-radio-group v-model="form.manager.certType"
:disabled="[0, 1].includes(userInfo.authStatus)">
<el-radio :label="0">身份证</el-radio>
<el-radio :label="1">护照</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="代理人证件号" required>
<el-input v-model="form.manager.idCard" :disabled="[0, 1].includes(userInfo.authStatus)"/>
</el-form-item>
<el-form-item label="代理人电话" required>
<el-input v-model="form.manager.mobile" :disabled="[0, 1].includes(userInfo.authStatus)"/>
</el-form-item>
<el-form-item label="身份证正面" required>
<vk-data-upload :limit="1" v-model="form.manager.headPhotoPath"
:disabled="[0, 1].includes(userInfo.authStatus)"></vk-data-upload>
</el-form-item>
<el-form-item label="身份证反面" required>
<vk-data-upload :limit="1" v-model="form.manager.backgroundIdCardPath"
:disabled="[0, 1].includes(userInfo.authStatus)"></vk-data-upload>
</el-form-item>
<el-button type="primary" @click.native="submitAuth"
v-if="form.authType === 2 && (userInfo.authStatus === null || [-1, 2].includes(userInfo.authStatus))">
{{
vk.getVuex('$user.userInfo.accountType') === 2 ? '提交企业认证' : '提交个人认证'
}}
</el-button>
</template>
</vk-data-form>
<view v-for="(item, index) in manageList" :key="index">
<manage-list v-model="manageList[index]"/>
</view>
<el-button type="primary" @click.native="allSubmit"
v-if="form1.data.authType === 2 && (form1.data.authStatus === null || [-1, 2].includes(form1.data.authStatus))">
{{
vk.getVuex('$user.userInfo.accountType') === 2 ? '提交企业认证' : '提交个人认证'
}}
</el-button>
<template v-else>
<el-button @click="getCertUrl" type="primary" size="small">去认证</el-button>
<el-button @click="getCertRes" type="primary" size="small">获取认证结果</el-button>
</template>
</el-form>
<!-- <vk-data-form ref="form1" v-model="form1.data" :action="form1.props.action" :columns="form1.props.columns"-->
<!-- :footer-show="false"-->
<!-- :before-action="form1.props.beforeAction" :rules="form1.props.rules"-->
<!-- :form-type="form1.props.formType"-->
<!-- :loading.sync="form1.props.loading" :auto-close="true" label-width="140px"-->
<!-- @success="onFormSuccess1">-->
<!-- <template v-slot:toFadada="{form, keyName}">-->
<!-- <el-button @click="getCertUrl" type="primary" size="small">去认证</el-button>-->
<!-- <el-button @click="getCertRes" type="primary" size="small">获取认证结果</el-button>-->
<!-- </template>-->
<!-- <template v-slot:company.organizationPath="{form, keyName}">-->
<!-- <vk-data-upload v-model="form1.data.organizationPath" limit="1"></vk-data-upload>-->
<!-- <text class="text-main">请您上传盖章的扫描件或者复印件</text>-->
<!-- </template>-->
<!-- <template v-slot:accountAuth="{form, keyName}">-->
<!-- <div>-->
<!-- <p>请用个人账户向以下账户转账0.10元。请备注:账号认证,平台将7个工作日内退回原账户。</p>-->
<!-- <div>-->
<!-- <span>户名:金久信</span>-->
<!-- <span class="ml-35">开户行:中国广发银行南宁支行</span>-->
<!-- <span class="ml-35">账号:6222XXXXX</span>-->
<!-- </div>-->
<!-- </div>-->
<!-- </template>-->
<!-- <template v-slot:manageList="{form, keyName}">-->
<!-- <div class="flex justify-start items-center">-->
<!-- <id-card theme="outline" size="24" fill="#a92924" strokeLinecap="square" style="height: 24px"/>-->
<!-- <span class="text-40 mr-35">企业授权人信息</span>-->
<!-- <el-button type="primary" size="small" @click.native="addManage"-->
<!-- v-if="manageList.length === 0 && (JSON.stringify(form.manager) === '{}' || !form.manager)">-->
<!-- 添加授权人-->
<!-- </el-button>-->
<!-- </div>-->
<!-- </template>-->
<!-- </vk-data-form>-->
<!-- <view v-for="(item, index) in manageList" :key="index">-->
<!-- <manage-list v-model="manageList[index]"/>-->
<!-- </view>-->
<!-- <el-button type="primary" @click.native="allSubmit"-->
<!-- v-if="form1.data.authType === 2 && (form1.data.authStatus === null || [-1, 2].includes(form1.data.authStatus))">-->
<!-- {{-->
<!-- vk.getVuex('$user.userInfo.accountType') === 2 ? '提交企业认证' : '提交个人认证'-->
<!-- }}-->
<!-- </el-button>-->
</el-card>
</view>
</template>
@@ -76,6 +293,10 @@
<script>
import {IdCard, Info} from '@icon-park/vue'
import ManageList from "./manageList.vue";
import form from "@icon-park/vue/lib/icons/Form";
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";
var _ = require('lodash');
export default {
@@ -83,7 +304,44 @@ export default {
data() {
// 页面数据变量
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
addressIndex: [null, null, null],
manageList: [],
goodsCate: [],
form: {
authType: null,
company: {
organization: '',
addressRegion: {},
addressDetail: '',
mobile: '',
mailAddress: '',
contactEmail: '',
companyAccount: '',
companyBankName: '',
personAccount: '',
personBankName: '',
accountName: '',
businessType: '',
invoiceInfo: '',
taxType: '',
taxImage: '',
mainSpotCategoryIds: [],
},
manager: {
type: null,
personName: '',
certType: '',
idCard: '',
mobile: '',
headPhotoPath: '',
backgroundIdCardPath: '',
},
},
userInfo: {},
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
@@ -95,6 +353,7 @@ export default {
authType: 1,
authStatus: null,
refuseReason: '',
organizationPath: '',
},
// 表单属性
props: {
@@ -188,7 +447,7 @@ export default {
{
key: "address", title: "", type: "group", justify: "start",
columns: [
{key: "addressRegion", title: "公司所在地", type: "address",},
{key: "addressRegion", title: "公司所在地", type: "address"},
{
key: "addressDetail",
title: "详细地址",
@@ -250,11 +509,16 @@ export default {
},
]
},
{key: "accountName", title: "户名", type: "text", placeholder: "请输入户名",},
{
key: "accountName",
title: "个人账户名",
type: "text",
placeholder: "请输入个人账户名",
},
{
key: "", title: "", type: "group", justify: "start",
columns: [
{key: "organizationPath", title: "上传营业执照", type: "image", limit: 1},
{key: "organizationPath", title: "上传营业执照", type: "html"},
{key: "businessType", title: "经营类目", type: "text"},
]
},
@@ -319,68 +583,51 @@ export default {
]
},
// {
// key: "bankCardNo",
// title: "银行卡号",
// type: "text",
// disabled: true,
// // tips: `请用个人账户向以下账户转账0.10元。请备注:账号认证,平台将7个工作日内退回原账户。\r\n,
// // 户名:金久信开户行:中国广发银行南宁支行账号:622252 20151145678XX'`
// },
// {
// key: "mailAddress",
// title: "有效通讯地址",
// type: "text"
// },
// {
// key: "contactQq",
// title: "QQ号码",
// type: "text",
// },
// {
// key: "contactEmail",
// title: "邮箱",
// type: "text",
// },
// {
// key: "",
// title: "",
// type: "group",
// justify: "start",
// columns: [{
// key: "contactWechatImage",
// title: "微信二维码",
// type: "image",
// limit: 1
// },
// {
// key: "contactWechat",
// title: "微信号",
// type: "text",
// },
// ]
// },
// {
// key: "bank_name",
// title: "开户行",
// type: "text",
// },
// {
// key: "bank_account_name",
// title: "户名",
// type: "text",
// },
],
// 表单验证规则
rules: {
mailAddress: [{
required: true,
message: "通讯地址不能为空",
trigger: ['blur', 'change']
}],
'company.organization': [
{
required: true,
message: "统一社会信用代码不能为空",
trigger: ['blur', 'change']
}
],
'company.address.addressRegion': [
{
required: true,
message: "公司所在地不能为空",
trigger: ['blur', 'change']
}
],
'company.mobile': [
{
required: true,
message: "公司联系方式不能为空",
trigger: ['blur', 'change']
}
],
'company.companyAccount': [
{
required: true,
message: "公司对公账号不能为空",
trigger: ['blur', 'change']
}
],
'company.companyBankName': [
{
required: true,
message: "公司对公账号开户行不能为空",
trigger: ['blur', 'change']
}
],
mailAddress: [
{
required: true,
message: "通讯地址不能为空",
trigger: ['blur', 'change']
}
],
contactQq: [{
required: true,
message: "QQ号码不能为空",
@@ -396,15 +643,17 @@ export default {
message: "微信二维码不能为空",
trigger: ['blur', 'change']
}],
contactEmail: [{
required: true,
message: "邮箱不能为空",
trigger: ['blur', 'change']
}, {
validator: vk.pubfn.validator("email"),
message: '邮箱格式错误',
trigger: 'blur'
}],
contactEmail: [
{
required: true,
message: "邮箱不能为空",
trigger: ['blur', 'change']
}, {
validator: vk.pubfn.validator("email"),
message: '邮箱格式错误',
trigger: 'blur'
}
],
},
// add 代表添加 update 代表修改
@@ -413,20 +662,6 @@ export default {
loading: false,
// 是否显示表单1 的弹窗
show: false,
// beforeAction: (formData) => {
// // const newFormData = _.pick(formData, ['contactWechat', 'contactEmail',
// // 'contactWechatImage', 'contactQq', 'mailAddress'
// // ])
// // vk.userCenter.updateUser({
// // data: {...formData, ...{manager: this.manageList[0]}},
// // success: (data) => {
// // // 成功后的逻辑
// //
// // }
// // });
// // return false;
//
// },
}
},
// 表单相关结束-----------------------------------------------------------
@@ -434,13 +669,25 @@ export default {
};
},
created() {
this.getUserInfo()
this.getGoodsCate()
},
methods: {
getUserInfo() {
vk.userCenter.getCurrentUserInfo({
success: (data) => {
this.userInfo = data.userInfo
for (let key in this.form) this.form[key] = data.userInfo[key]
if (JSON.stringify(data.userInfo.addressRegion) !== "{}") {
this.addressIndex[0] = this.provinceData.findIndex(item => item.code === data.userInfo.addressRegion.province.code)
if (this.addressIndex[0] !== -1) {
this.addressIndex[1] = this.cityData[this.addressIndex[0]].findIndex(item => item.code === data.userInfo.addressRegion.city.code)
if (this.addressIndex[1] !== -1) {
this.addressIndex[2] = this.areaData[this.addressIndex[0]][this.addressIndex[1]].findIndex(item => item.code === data.userInfo.addressRegion.area.code)
console.log(this.addressIndex[2], this.areaData[this.addressIndex[0]][this.addressIndex[1]], data.userInfo.addressRegion.area.code)
}
}
}
this.form1.data = _.pick(data.userInfo, [
'fadadaConfirm', 'person', 'company', 'manager', 'contactWechat',
'contactEmail', 'contactWechatImage', 'contactQq', 'mailAddress',
@@ -460,6 +707,17 @@ export default {
}
});
},
getGoodsCate() {
vk.callFunction({
url: 'client/spot/category/pub/getList',
data: {
level: 2
},
success: (res) => {
this.goodsCate = res.data
}
});
},
onFormSuccess1() {
window.location.reload()
},
@@ -480,6 +738,30 @@ export default {
this.form1.data.manager = this.manageList[0]
this.$refs.form1.submitForm()
},
async submitAuth() {
if (this.addressIndex[2] === null || !this.form.company.addressDetail) return this.$message({
type: 'error',
message: '请完善公司所在地'
})
if (this.form.company.mainSpotCategoryIds.length === 0) return this.$message({
type: 'error',
message: '请选择主营商品'
})
this.form.company.addressRegion.province = this.provinceData[this.addressIndex[0]]
this.form.company.addressRegion.city = this.cityData[this.addressIndex[0]][this.addressIndex[1]]
this.form.company.addressRegion.area = this.areaData[this.addressIndex[0]][this.addressIndex[1]][this.addressIndex[2]]
await vk.callFunction({
url: 'client/user/kh/addAuth',
data: {...this.form, ...{authStatus: 0}},
})
this.$message({
type: 'success',
message: '提交成功'
})
setTimeout(() => {
window.location.reload()
}, 1500)
},
makeCard() {
this.$emit('makeCard')
},
+1 -1
View File
@@ -64,7 +64,7 @@
type: "text",
},
{
key: "_add_time",
key: "_add_time_srt",
title: "添加时间",
type: "time",
width: 160
+204 -153
View File
@@ -1,169 +1,220 @@
<template>
<el-card class="box-card">
<div slot="header" class="clearfix" style="text-align: center">
<span style="font-size: 20px;line-height: 2em;">消息推送设置</span>
<div style="color: #999999">我们将针对您的选择,为您精准推送询价信息</div>
</div>
<el-row class="setting-list" :gutter="50">
<el-col span="12" v-for="(item,index) in settingList" :key="index">
<div class="item">
<div class="title">
<el-badge is-dot class="badge"></el-badge>
{{ item.title }}
</div>
<div class="btn">
<el-switch
v-model="item.status">
</el-switch>
</div>
</div>
</el-col>
</el-row>
<el-divider></el-divider>
<div class="form">
<div class="form-title">
* 请选择产品:
<el-card class="box-card">
<div slot="header" class="clearfix" style="text-align: center">
<span style="font-size: 20px;line-height: 2em;">消息推送设置</span>
<div style="color: #999999">我们将针对您的选择,为您精准推送询价信息</div>
</div>
<el-form ref="form" :model="form" label-position="left" label-width="120px">
<el-form-item label="螺纹钢、高线">
<el-checkbox-group v-model="group1" size="small">
<el-checkbox label="螺纹钢" border></el-checkbox>
<el-checkbox label="盘螺" border></el-checkbox>
<el-checkbox label="盘圆" border></el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="钢材">
<el-checkbox-group v-model="group1" size="small">
<el-checkbox label="螺纹钢" border></el-checkbox>
<el-checkbox label="盘螺" border></el-checkbox>
<el-checkbox label="盘圆" border></el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="钢版">
<el-checkbox-group v-model="group1" size="small">
<el-checkbox label="螺纹钢" border></el-checkbox>
<el-checkbox label="盘螺" border></el-checkbox>
<el-checkbox label="盘圆" border></el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="型材">
<el-checkbox-group v-model="group1" size="small">
<el-checkbox label="螺纹钢" border></el-checkbox>
<el-checkbox label="盘螺" border></el-checkbox>
<el-checkbox label="盘圆" border></el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="配件、耗材">
<el-checkbox-group v-model="group1" size="small">
<el-checkbox label="螺纹钢" border></el-checkbox>
<el-checkbox label="盘螺" border></el-checkbox>
<el-checkbox label="盘圆" border></el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="二手钢材、设备">
<el-checkbox-group v-model="group1" size="small">
<el-checkbox label="螺纹钢" border></el-checkbox>
<el-checkbox label="盘螺" border></el-checkbox>
<el-checkbox label="盘圆" border></el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-form>
</div>
<el-divider></el-divider>
<div class="form">
<div class="form-title">
* 请选择服务地区:
<el-row class="setting-list" :gutter="50">
<el-col :span="12" v-for="(item,index) in settingList" :key="index">
<div class="item">
<div class="title">
<el-badge is-dot class="badge"></el-badge>
{{ item.title }}
</div>
<div class="btn">
<el-switch
v-model="item.status">
</el-switch>
</div>
</div>
</el-col>
</el-row>
<el-divider></el-divider>
<div class="form">
<div class="form-title">
* 请选择产品:
</div>
<el-form ref="form" :model="form" label-position="left" label-width="120px">
<el-form-item :label="item.name" v-for="(item, index) in productList" :key="index">
<el-checkbox-group v-model="productList[index].idList" size="small">
<el-checkbox v-for="(productItem, productIndex) in item.children" :key="productIndex"
:label="productItem._id" border
:checked="productList[index].idList.includes(item._id)">
{{ item.name }}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-form>
</div>
<el-form ref="form" :model="form" label-position="left" label-width="120px">
广西-南宁
</el-form>
</div>
<el-divider></el-divider>
<el-button type="danger" round>保存设置</el-button>
</el-card>
<el-divider></el-divider>
<div class="form">
<div class="form-title">
* 请选择服务地区:
</div>
<el-row :gutter="10">
<el-col :span="4">
<el-select v-model="addressIndex[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[1]" placeholder="请选择市"
:disabled="addressIndex.length === 0">
<template v-if="addressIndex[0] !== null">
<el-option v-for="(item, index) in cityData[addressIndex[0]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
<el-col :span="4">
<el-select v-model="addressIndex[2]" placeholder="请选择区"
: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]]"
:key="index"
:label="item.name"
:value="index">
</el-option>
</template>
</el-select>
</el-col>
</el-row>
</div>
<el-divider></el-divider>
<el-button type="danger" round @click.native="save">保存设置</el-button>
</el-card>
</template>
<script>
let that;
const originalForms = {sort: 0, enable: true}
// import { VueCropper } from 'vue-cropper'
export default {
components: {
// VueCropper
},
data() {
return {
settingList: [
{
id: 1,
title: '金融服务',
status: true
},
{
id: 2,
title: '金融服务',
status: true
},
{
id: 3,
title: '找合作信息推送服务',
status: true
},
{
id: 4,
title: '找加工信息推送服务',
status: false
},
{
id: 5,
title: '旧货信息交易推送服务',
status: true
},
{
id: 6,
title: '询价单和选项推送服务',
status: false
}
],
form: {},
group1: []
}
},
created() {
that = this
},
methods: {
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() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
addressIndex: [null, null, null],
settingList: {
article: {
title: '行情信息推送服务',
status: false
},
process: {
title: '找加工信息推送服务',
status: false
},
old: {
title: '旧货交易信息推送服务',
status: false
},
enquiry: {
title: '询价单和选项推送服务',
status: false
},
},
form: {},
group1: [],
productList: [],
addressRegion: {}
}
},
async created() {
await this.getCate()
await this.getConfig()
},
methods: {
async getConfig() {
const res = await vk.callFunction({
url: 'client/message/config/kh/getConfig'
})
for (let key in this.settingList) this.settingList[key].status = res[key]
this.productList.forEach((item, index) => {
item.children.forEach(productItem => {
if (res.productList.includes(productItem._id)) {
this.productList[index].idList.push(productItem._id)
}
})
})
if (res.addressRegion.province) {
this.addressIndex[0] = this.provinceData.findIndex(item => item.code === res.addressRegion.province.code)
if (this.addressIndex[0] !== -1) {
this.addressIndex[1] = this.cityData[this.addressIndex[0]].findIndex(item => item.code === res.addressRegion.city.code)
if (this.addressIndex[1] !== -1) {
this.addressIndex[2] = this.areaData[this.addressIndex[0]][this.addressIndex[1]].findIndex(item => item.code === res.addressRegion.area.code)
}
}
}
},
async getCate() {
const {rows} = await vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
});
this.productList = rows.map(item => {
item.idList = []
return item
})
},
async save() {
let productList = []
this.productList.forEach(item => {
productList = [...productList, ...item.idList]
})
await vk.callFunction({
url: 'client/message/config/kh/update',
data: {
article: this.settingList.article.status,
process: this.settingList.process.status,
old: this.settingList.old.status,
enquiry: this.settingList.enquiry.status,
productList,
addressRegion: {
province: this.provinceData[this.addressIndex[0]],
city: this.cityData[this.addressIndex[0]][this.addressIndex[1]],
area: this.areaData[this.addressIndex[0]][this.addressIndex[1]][this.addressIndex[2]],
}
}
})
this.$message({
type: 'success',
message: '保存成功'
})
}
}
}
</script>
<style lang="less">
.setting-list{
.item{
display: flex;
flex-direction: row;
justify-content: space-between;
margin: 5px auto;
.title{
display: flex;
align-items: center;
.badge{
.setting-list {
.item {
display: flex;
align-items: center;
padding: 0 5px;
}
flex-direction: row;
justify-content: space-between;
margin: 5px auto;
.title {
display: flex;
align-items: center;
.badge {
display: flex;
align-items: center;
padding: 0 5px;
}
}
}
}
}
.form-title{
color: #bf2b28;
font-size: 16px;
font-weight: 500;
line-height: 2em;
margin-bottom: 10px;
.form-title {
color: #bf2b28;
font-size: 16px;
font-weight: 500;
line-height: 2em;
margin-bottom: 10px;
}
.form{
padding: 10px;
.form {
padding: 10px;
}
</style>
+246 -178
View File
@@ -1,189 +1,257 @@
<template>
<view class="yaoqing">
<view class="title">邀请新用户免费兑换会员</view>
<view class="p2">
<view class="item">
<view class="text">共邀请<text class="red">7</text>人</view>
<view class="btn">邀请列表</view>
</view>
<view class="item">
<view class="text">我的邀请码</view>
<text class="red">12456</text>
</view>
</view>
<view class="p3">
<view class="item" v-for="item in huiyuan">
<view class="t">{{item.title}}</view>
<view class="b">{{item.subtitle}}</view>
</view>
</view>
<view class="p4">
<view class="wrapper">
<view class="bg" :style="`width: ${p}%;`"></view>
</view>
<view class="tip" :style="`left: ${p}%;`">已邀请7人</view>
</view>
<view class="btns">
<view class="btn">复制邀请码</view>
<view class="btn red" @click="openDuihuan">兑换会员</view>
</view>
<el-dialog
title="请选择要兑换的会员"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose">
<view class="p3">
<view class="item" v-for="(item,index) in huiyuan" :key="index" :class="index == current ? 'active' : ''" @click="onSelect(index)">
<view class="t">{{item.title}}</view>
<view class="b">{{item.subtitle}}</view>
</view>
</view>
<span slot="footer" class="dialog-footer">
<view class="yaoqing">
<view class="title">邀请新用户免费兑换会员</view>
<view class="p2">
<view class="item">
<view class="text">共邀请
<text class="red">{{ user.inviteNum }}</text>
人
</view>
<view class="btn">邀请列表</view>
</view>
<view class="item">
<view class="text">我的邀请码</view>
<text class="red">{{ user.my_invite_code }}</text>
</view>
</view>
<view class="p3">
<view v-for="(item, index) in userLevelList" :key="index">
<view class="item" v-if="item.recommendUpgrade && parseInt(item.recommendUpgrade) > 0">
<view class="t">{{ item.name }}</view>
<view class="b">{{ item.upgradeDesc }}</view>
</view>
</view>
</view>
<view class="p4">
<view class="wrapper">
<view class="bg" :style="`width: ${progress}%;`"></view>
</view>
<view class="tip" :style="`left: ${progress}%;`">已邀请{{ user.inviteNum }}人</view>
</view>
<view class="btns">
<view class="btn pointer" @click="copy">复制邀请码</view>
<view class="btn red pointer" @click="openDuihuan">兑换会员</view>
</view>
<el-dialog
title="请选择要兑换的会员"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose">
<view class="p3">
<view v-for="(item, index) in userLevelList" :key="index">
<view class="item pointer"
v-if="item.recommendUpgrade && parseInt(item.recommendUpgrade) > 0"
:class="index == current ? 'active' : ''" @click="onSelect(item, index)">
<view class="t">{{ item.name }}</view>
<view class="b">{{ item.upgradeDesc }}</view>
</view>
</view>
</view>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false">确定兑换</el-button>
<el-button type="primary" @click="exchangeUpgrade">确定兑换</el-button>
</span>
</el-dialog>
</view>
</el-dialog>
</view>
</template>
<script>
export default {
data() {
return {
huiyuan:[
{title:'黄金vip LV1',subtitle:'邀请4人可兑换'},
{title:'铂金vip LV1',subtitle:'邀请6人可兑换'},
{title:'钻石vip LV1',subtitle:'邀请9人可兑换'},
],
p:45,
current: 0,
dialogVisible: false
}
},
methods: {
openDuihuan(){
this.dialogVisible = true
},
handleClose(){
this.dialogVisible = false
},
onSelect(index){
this.current = index
}
}
}
export default {
data() {
return {
progress: 0,
current: 0,
dialogVisible: false,
user: this.vk.getVuex('$user.userInfo'),
userLevelList: [],
maxUpgradeNum: 100
}
},
methods: {
openDuihuan() {
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
},
onSelect(item, index) {
if (parseInt(this.user.inviteNum) >= item.recommendUpgrade && item.level > parseInt(this.user.userLevel)) this.current = index
},
copy() {
const url = window.location.origin + `/#/pages/auth/register/register?code=${this.user.my_invite_code}`
document.oncopy = function (e) {
e.clipboardData.setData('text', url);
e.preventDefault();
document.oncopy = null;
}
document.execCommand('Copy');
this.$message({
type: 'success',
message: '邀请码已复制'
})
},
getUserLevelList() {
vk.callFunction({
url: 'client/userLevel/pub/getList',
data: {
pageIndex: 1,
pageSize: 200
},
success: (data) => {
this.userLevelList = data.rows
this.userLevelList.forEach(item => {
if (item.recommendUpgrade && parseInt(item.recommendUpgrade) > 0)
this.maxUpgradeNum = Math.max(this.maxUpgradeNum, item.recommendUpgrade)
})
this.progress = parseInt(this.vk.getVuex('$user.userInfo').inviteNum) / this.maxUpgradeNum * 100
}
});
},
async exchangeUpgrade(){
await vk.callFunction({
url: 'client/user/kh/exchangeUpgrade',
data: {
id: this.userLevelList[this.current]._id
}
});
this.$message({
type:'success',
message: '兑换成功'
})
this.dialogVisible = false
}
},
mounted() {
this.getUserLevelList()
}
}
</script>
<style scoped lang="scss">
.yaoqing{
padding: 100upx;
background-color: #fff;
.title{
font-size: 50upx;
color: #A92924;
}
.p2{
margin-top: 80upx;
display: flex;
align-items: center;
.item{
display: flex;align-items: center;
font-size: 30upx;
margin-right: 100upx;
text.red{
color: #A92924;
}
.btn{
margin-left:10upx;
padding: 4upx 10upx;
border-radius: 10upx;
color: #fff;
background-color: #ff8100;
font-size: 24upx;
.yaoqing {
padding: 100upx;
background-color: #fff;
}
}
}
.p3{
margin-top: 80upx;
display: flex;
justify-content: space-around;
.item{
width: 250upx;
height: 180upx;
border-radius: 10upx;
box-shadow: 1px 1px 5px 1px #A92924;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 24upx;
color: #A92924;
.t{
font-size: 30upx;
}
}
.active{
background-color: #A92924;
color: #ffffff;
}
}
.p4{
margin-top: 80upx;
position: relative;
width: 100%;
.wrapper{
position: relative;
height: 30upx;
border-radius: 15upx;
overflow: hidden;
background-color: #ddd;
}
.bg{
position: absolute;
// width: 50%;
height: 100%;
background-color: #A92924;
}
.tip{
position: absolute;
// left: 45%;
top: -15upx;
transform: translateX(-5%);
padding: 0 20upx;
height: 60upx;
line-height: 60upx;
border-radius: 30upx;
background-color: #A92924;
color: #fff;
font-size: 26upx;
}
}
.btns{
margin-top: 80upx;
display: flex;
.btn{
width: 360upx;
height: 80upx;
display: flex;
justify-content: center;
align-items: center;
font-size: 30upx;
border: 1px solid #A92924;
}
.btn.red{
margin-left: 200upx;
color: #fff;
background-color: #A92924;
}
}
}
.dialog-select{
.item{
}
}
.title {
font-size: 50upx;
color: #A92924;
}
.p2 {
margin-top: 80upx;
display: flex;
align-items: center;
.item {
display: flex;
align-items: center;
font-size: 30upx;
margin-right: 100upx;
text.red {
color: #A92924;
}
.btn {
margin-left: 10upx;
padding: 4upx 10upx;
border-radius: 10upx;
color: #fff;
background-color: #ff8100;
font-size: 24upx;
}
}
}
.p3 {
margin-top: 80upx;
display: flex;
justify-content: space-around;
.item {
width: 250upx;
height: 180upx;
border-radius: 10upx;
box-shadow: 1px 1px 5px 1px #A92924;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 24upx;
color: #A92924;
.t {
font-size: 30upx;
}
}
.active {
background-color: #A92924;
color: #ffffff;
}
}
.p4 {
margin-top: 80upx;
position: relative;
width: 100%;
.wrapper {
position: relative;
height: 30upx;
border-radius: 15upx;
overflow: hidden;
background-color: #ddd;
}
.bg {
position: absolute;
// width: 50%;
height: 100%;
background-color: #A92924;
}
.tip {
position: absolute;
// left: 45%;
top: -15upx;
transform: translateX(-5%);
padding: 0 20upx;
height: 60upx;
line-height: 60upx;
border-radius: 30upx;
background-color: #A92924;
color: #fff;
font-size: 26upx;
}
}
.btns {
margin-top: 80upx;
display: flex;
.btn {
width: 360upx;
height: 80upx;
display: flex;
justify-content: center;
align-items: center;
font-size: 30upx;
border: 1px solid #A92924;
}
.btn.red {
margin-left: 200upx;
color: #fff;
background-color: #A92924;
}
}
}
.dialog-select {
.item {
}
}
</style>
+52 -12
View File
@@ -7,15 +7,15 @@
<view class="flex-col flex-col justify-center items-center bg-white text-40 left-wrap pointer">
<view class="flex justify-center items-center" :class="[activeIndex === 0 ? 'active' : '' ]"
@click="changeActive(0)">
<text class="ml-20">询价管理</text>
<text>询价管理</text>
</view>
<view class="flex justify-center items-center" :class="[activeIndex === 1 ? 'active' : '' ]"
@click="changeActive(1)">
<text class="ml-20">订单管理</text>
<text>订单管理</text>
</view>
<view class="flex justify-center items-center" :class="[activeIndex === 2 ? 'active' : '' ]"
@click="changeActive(2)">
<text class="ml-20">合同管理</text>
<text>合同管理</text>
</view>
</view>
<view class="w-1200 m-a bg-white p-40">
@@ -29,13 +29,14 @@
<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"/>
<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>
<text class="ml-20">小计: ¥{{ item.num * item.goodsPrice }}</text>
</view>
</view>
</template>
@@ -51,7 +52,21 @@
</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="total">
</el-pagination>
</view>
</view>
</view>
<gap height="50"/>
@@ -61,12 +76,21 @@
</template>
<script>
import pay from "../index/shop/pay.vue";
export default {
name: "order",
computed: {
pay() {
return pay
}
},
data() {
return {
tableData: [],
activeIndex: 0
activeIndex: 0,
pageSize: 20,
total: 0,
}
},
methods: {
@@ -82,11 +106,27 @@ export default {
})
}
},
async getOrderList() {
async getOrderList(pageIndex = 1) {
const {rows} = await vk.callFunction({
url: 'client/order/kh/getList'
url: 'client/order/kh/getList',
data: {
pageIndex,
pageSize: this.pageSize,
}
})
this.tableData = rows
console.log(this.tableData)
},
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}`
})
}
},
onLoad(options) {
@@ -107,8 +147,8 @@ export default {
.left-wrap {
position: absolute;
width: 240px;
left: -300px;
width: 220px;
left: -240px;
top: 0;
view {
@@ -122,7 +162,7 @@ export default {
}
}
.goods-cover{
.goods-cover {
width: 80px;
height: 80px;
}
+1 -2
View File
@@ -1,8 +1,7 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<common-nav></common-nav>
<view class="w-1200">
<el-row :gutter="20">
+21 -7
View File
@@ -17,7 +17,8 @@
<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="getCompany()" clearable placeholder="输入关键字搜索" v-model="keyword">
<el-input @keyup.enter.native="getCompany()" clearable placeholder="输入关键字搜索"
v-model="keyword">
<i slot="prefix" class="el-input__icon el-icon-getCompany"></i>
<el-button @click="getCompany()" type="primary" slot="append" style="border-radius: 0">搜索
</el-button>
@@ -90,7 +91,8 @@
<gap height="40" v-else/>
</view>
<view class="flex justify-start items-center">
<image :src="item.businessCard.logo" class="logo" v-if="item.businessCard" mode="aspectFill"/>
<image :src="item.businessCard.logo" class="logo" v-if="item.businessCard"
mode="aspectFill"/>
<image v-else src="/static/images/no-logo.jpg" class="logo" mode="aspectFill"/>
<view class="ml-35 flex flex-col justify-start items-start">
<text>{{ item.name }}</text>
@@ -98,7 +100,10 @@
<view class="flex justify-start items-center">
<i class="el-icon-user"/>
<text class="ml-10" v-if="item.manager">{{ item.manager.personName }}</text>
<text class="ml-20 text-28" v-if="item.businessCard">{{ item.businessCard.position }}</text>
<text class="ml-20 text-28" v-if="item.businessCard">{{
item.businessCard.position
}}
</text>
</view>
</view>
</view>
@@ -106,21 +111,30 @@
<i class="el-icon-map-location mr-15"/>
<view class="flex-col justify-start items-center">
<text>地址:</text>
<text v-if="item.manager">{{ item.manager.address }}</text>
<text
v-if="item.company && item.company.addressRegion && item.company.addressRegion.province && item.company.addressRegion.city && item.company.addressRegion.area">
{{
item.company.addressRegion.province.name
}}{{ item.company.addressRegion.city.name }}{{
item.company.addressRegion.area.name
}}{{
item.company.addressDetail
}}
</text>
</view>
</view>
<view class="flex justify-start items-center mt-20">
<i class="el-icon-phone mr-15"/>
<view class="flex-col justify-start items-center">
<text>电话:</text>
<text v-if="item.businessCard">{{ item.businessCard.phone }}</text>
<text v-if="item.businessCard">{{ item.company.companyMobile }}</text>
</view>
</view>
<view class="flex justify-start items-center mt-20">
<i class="el-icon-mobile mr-15"/>
<view class="flex-col justify-start items-center">
<text>手机:</text>
<text v-if="item.businessCard">{{ item.businessCard.mobile }}</text>
<text v-if="item.businessCard">{{ item.businessCard.managerMobile }}</text>
</view>
</view>
<view class="flex justify-start items-center mt-20">
@@ -223,7 +237,7 @@ export default {
}
});
},
showInfo(id){
showInfo(id) {
vk.navigateTo({
url: `/pages/yellowPage/info?id=${id}`
})