1、新增旧货市场
2、新增用户等级
This commit is contained in:
@@ -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
|
||||
}
|
||||
})
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user