This commit is contained in:
2026-10-08 18:14:56 +08:00
parent dec4ebc773
commit 9cc1ff546c
1081 changed files with 238349 additions and 52163 deletions
+97 -110
View File
@@ -1,6 +1,6 @@
<template>
<view class="border-bottom pt-20">
<el-form ref="form" :model="form1" label-width="80px" :rules="form1.props.rules">
<el-form ref="form" :model="form1" label-width="140px" :rules="form1.props.rules">
<view class="flex flex-wrap justify-start items-start">
<view class="w-25p">
<el-form-item label="商品名称">
@@ -15,49 +15,51 @@
</el-form-item>
</view>
<view class="w-25p" v-for="(item, index) in goodsAttributes" :key="index">
<el-form-item :label="item.label">
<el-select v-model="form1.data.model[item.label]" placeholder="请选择">
<el-option
v-for="(item, index) in item.values"
:key="index"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
<template v-if="goodsAttributes && goodsAttributes.length > 0">
<el-form-item :label="item.label" v-if="item.label">
<el-select v-model="form1.data.model[index].value" placeholder="请选择">
<el-option
v-for="(value, valueIndex) in item.values" :key="valueIndex" :label="value"
:value="value">
</el-option>
</el-select>
</el-form-item>
</template>
</view>
</view>
<el-row :gutter="10">
<el-col :span="10">
<el-form-item label="单件长度">
<el-input placeholder="请输入内容" v-model="form1.data.singleLength" class="input-with-select">
<el-select v-model="form1.data.singleLengthUnit" slot="append" placeholder="请选择">
<template v-if=" attributes.find(attr => attr.label === '单件长度')">
<el-option
v-for="(item, index) in attributes.find(attr => attr.label === '单件长度').options"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</template>
</el-select>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="材质">
<el-select v-model="form1.data.materialQuality" placeholder="请选择">
<template v-if=" attributes.find(attr => attr.label === '材质')">
<el-option
v-for="(item, index) in attributes.find(attr => attr.label === '材质').options"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</template>
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :span="10">-->
<!-- <el-form-item label="单件长度">-->
<!-- <el-input placeholder="请输入内容" v-model="form1.data.singleLength" class="input-with-select"-->
<!-- type="number">-->
<!-- <template slot="append">米</template>-->
<!--&lt;!&ndash; <el-select v-model="form1.data.singleLengthUnit" slot="append" placeholder="请选择">&ndash;&gt;-->
<!--&lt;!&ndash; <template v-if=" attributes.find(attr => attr.label === '单件长度')">&ndash;&gt;-->
<!--&lt;!&ndash; <el-option&ndash;&gt;-->
<!--&lt;!&ndash; v-for="(item, index) in attributes.find(attr => attr.label === '单件长度').options"&ndash;&gt;-->
<!--&lt;!&ndash; :key="index"&ndash;&gt;-->
<!--&lt;!&ndash; :label="item.label"&ndash;&gt;-->
<!--&lt;!&ndash; :value="item.value">&ndash;&gt;-->
<!--&lt;!&ndash; </el-option>&ndash;&gt;-->
<!--&lt;!&ndash; </template>&ndash;&gt;-->
<!--&lt;!&ndash; </el-select>&ndash;&gt;-->
<!-- </el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- <el-form-item label="尺寸">-->
<!-- <el-select v-model="form1.data.materialQuality" placeholder="请选择">-->
<!-- <template v-if=" attributes.find(attr => attr.label === '尺寸')">-->
<!-- <el-option-->
<!-- v-for="(item, index) in attributes.find(attr => attr.label === '尺寸').options"-->
<!-- :key="index"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </template>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="6">
<el-form-item label="交货服务">
<el-select v-model="form1.data.deliverService" placeholder="请选择">
@@ -72,24 +74,6 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-form-item label="采购数量">
<el-input v-model="form1.data.procureNumber" class="input-with-select">
<el-select v-model="form1.data.procureUnit" slot="append" placeholder="请选择">
<template v-if=" attributes.find(attr => attr.label === '单位')">
<el-option
v-for="(item, index) in attributes.find(attr => attr.label === '单位').options"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</template>
</el-select>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="计价形式">
<el-select v-model="form1.data.pricingForm" placeholder="请选择">
@@ -106,53 +90,38 @@
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="6">
<el-form-item label="交货时限">
<el-date-picker
v-model="form1.data.deliveryTime"
type="date"
placeholder="选择日期">
</el-date-picker>
<el-col :span="12">
<el-form-item label="采购数量">
<el-input v-model="form1.data.procureNumber" class="input-with-select" type="number">
<el-select v-model="form1.data.procureUnit" slot="append" placeholder="请选择">
<template v-if=" attributes.find(attr => attr.label === '单位')">
<el-option
v-for="(item, index) in attributes.find(attr => attr.label === '单位').options"
:key="index"
:label="item.label"
:value="item.value">
</el-option>
</template>
</el-select>
</el-input>
</el-form-item>
</el-col>
<el-col :span="18">
<el-form-item label="交货地点" class="ml-10">
<el-row :gutter="10">
<el-col :span="5">
<el-select v-model="provinceIndex" placeholder="省" @change="selectProvince">
<el-option v-for="(item, index) in provinceData" :key="index" :value="index"
:label="item.name"/>
<!-- <span slot="prefix">省</span>-->
</el-select>
</el-col>
<el-col :span="5">
<el-select v-model="cityIndex" placeholder="市" @change="selectCity">
<template v-if="provinceIndex !== null">
<el-option v-for="(item, index) in cityData[provinceIndex]" :key="index"
:value="index"
:label="item.name"/>
</template>
<!-- <span slot="prefix">市</span>-->
</el-select>
</el-col>
<el-col :span="5">
<el-select v-model="areaIndex" placeholder="区/县" @change="selectArea">
<template v-if="provinceIndex !== null && cityIndex !== null">
<el-option v-for="(item, index) in areaData[provinceIndex][cityIndex]"
:key="index" :value="index"
:label="item.name"/>
</template>
<!-- <span slot="prefix">区/县</span>-->
</el-select>
</el-col>
<el-col :span="8">
<el-input v-model="form1.data.addressDetail"
placeholder="详细地址或几公里范围内"></el-input>
</el-col>
</el-row>
<el-col :span="12">
<el-form-item label="装货、卸货费用承担">
<el-select v-model="form1.data.loadPaidBy" placeholder="请选择" style="width: 100%">
<template v-if="attributes.find(attr => attr.label === '装货、卸货费用承担')">
<el-option
v-for="(item, index) in attributes.find(attr => attr.label === '装货、卸货费用承担').options"
:key="index"
:label="item.label"
:value="item.label">
</el-option>
</template>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</view>
</template>
@@ -183,6 +152,11 @@ export default {
},
data() {
return {
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now();
},
},
provinceData: provinces,
cityData: citys,
areaData: areas,
@@ -211,6 +185,7 @@ export default {
deliverService: null,
standard: null,
pricingForm: null,
loadPaidBy: '供货方承担装车费用,采购方承担卸货费用',
deliveryTime: null,
len: null,
extraAttributes: {},
@@ -277,8 +252,6 @@ export default {
} else {
this.form1.props.columns[2].columns = []
}
}
},
{
@@ -499,6 +472,7 @@ export default {
getGoodsList() {
vk.callFunction({
url: 'client/enquiry/template/pub/getList',
pageSize: 500,
title: '请求中',
success: ({rows}) => {
this.goodsList = rows
@@ -506,10 +480,17 @@ export default {
})
},
selectGoods(val) {
this.form1.data.model = []
this.goodsList.forEach(({_id, name, extraAttributes}) => {
if (_id === val) {
this.form1.data.goodsName = name
this.goodsAttributes = extraAttributes
this.goodsAttributes.forEach(attr => {
if (attr.label) this.form1.data.model.push({
label: attr.label,
value: null
})
})
}
})
},
@@ -525,13 +506,19 @@ export default {
},
watch: {
"form1.data"(val) {
this.$emit('input', val)
console.log("this.$emit('input', val.data)");
"form1.data": {
immediate: true,
handler(val) {
this.$emit('input', val)
console.log("this.$emit('input', val.data)");
}
},
value(val) {
this.form1.data = val
console.log("this.form1.data = val", val);
value: {
immediate: true,
handler(val) {
this.form1.data = val
console.log("this.form1.data = val", val);
}
}
}
@@ -547,7 +534,7 @@ export default {
</style>
<style>
/deep/ .input-with-select .el-input-group__append {
::v-deep .input-with-select .el-input-group__append {
background-color: #fff !important;
width: 130px !important;
}
+875 -463
View File
File diff suppressed because it is too large Load Diff
+505 -493
View File
File diff suppressed because it is too large Load Diff
+219 -236
View File
@@ -1,42 +1,43 @@
<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="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 class="carousel">
<!-- <el-carousel height="170px">-->
<!-- <el-carousel-item v-for="item in 4" :key="item">-->
<!-- <image class="carousel-img"-->
<!-- src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"-->
<!-- mode="aspectFill"></image>-->
<!-- </el-carousel-item>-->
<!-- </el-carousel>-->
<common-swiper page="enquiry-mine" :height="200"/>
<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>
@@ -45,237 +46,219 @@ 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,
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.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'
})
}
data() {
return {
provinceData: provinces,
cityData: citys,
areaData: areas,
keyword: '',
// 表格相关开始 -----------------------------------------------------------
queryForm1: {
formData: {
userId: vk.getVuex('$user.userInfo._id')
},
},
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryList.forEach(item => {
arr.push(...item)
})
this.checkProvinceList.forEach(item => {
arr.push({
...item
columns: [
{key: "userId", title: "发布人ID", type: "text", width: 160, mode: "="},
]
},
table1: {
// 表格数据请求地址
action: "client/enquiry/sheet/kh/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('如果你要删除此条信息,之前其他客户填写的留言将无法查看', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.callFunction({
url: 'client/enquiry/sheet/kh/delete',
title: '请求中...',
data: {
_id: item._id
},
}).then(res => {
this.$refs.table1.refresh()
})
})
return arr
}
})
}
},
],
// 表格字段显示规则
columns: [
{
key: "enquiryNo",
title: "单号",
type: "text",
},
{
key: "title",
title: "品名/材质",
type: "text"
},
{
key: "productList",
title: "采购量",
type: "text",
formatter: (val, row, column, index) => {
if (row.fillType === 0) return val.map(item => (item.procureNumber ? item.procureNumber : '') + (item.procureUnit ? item.procureUnit : '')).join("/")
else return row.procureUnit ? `${row.procureNumber}${row.procureUnit}` : ''
}
},
{
key: "addressRegion",
title: "收货地",
type: "text",
formatter: (val, row, column, index) => {
let fullAddress = (val && val.province) ? `${val.province.name}${val.city.name}${val.area.name}` : ''
if (row.addressDetail) fullAddress += ` ${row.addressDetail}`
return fullAddress
}
},
{
key: "user",
title: "采购单位",
type: "text",
formatter: (val, row, column, index) => {
if (!val) return ''
if (val.accountType == 1) {
return val.person.personName
} else {
return val.company.companyName
}
}
},
{
key: "quoteNum",
title: "报价数",
type: "text",
formatter: (val, row, column, index) => {
return `${val}家已报价`
}
},
{
key: "_add_time_str",
title: "发布时间",
type: "time",
width: 160
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
},
methods: {
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
uni.navigateTo({
url: '/pages/enquiry/release'
})
}
},
},
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;
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
display: flex;
.el-tag {
margin-right: 10px;
}
.el-tag {
margin-right: 10px;
}
}
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
width: 1200px;
margin: 20px auto;
// display: flex;
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
</style>
+353 -166
View File
@@ -1,196 +1,383 @@
<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 style="display: inline-block;" url="/pages/enquiry/list">询价单</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item>填写报价信息</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="page-main">
<vk-data-form
ref="form1"
v-model="form1.data"
:action="form1.props.action"
:columns="form1.props.columns"
:rules="form1.props.rules"
:form-type="form1.props.formType"
:loading.sync="form1.props.loading"
:auto-close="true"
label-width="140px"
@success="onFormSuccess"
></vk-data-form>
</view>
<common-footer></common-footer>
<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/enquiry/list">询价单</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item>填写报价信息</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="page-main">
<quote-remain-num v-if="reloaded" :amount="sheet.quoteAmount" type="enquiry" :id="enquiryId"/>
<view class="item-wrap">
<view class="form-title-wrap">
<view class="goods-sheet-title">
<view class="form-title">
采购商信息
</view>
<text class="tip-text ml-10">(注册可查看信息)</text>
</view>
</view>
<view class="mt-15">项目名称:{{ sheet.projectName ? sheet.projectName : '' }}</view>
<view class="mt-15">项目地址:{{ sheet.fullAddress ? sheet.fullAddress : '' }}</view>
<template v-if="canViewBuyerInfo">
<view class="mt-15" v-if="sheet.companyName">公司信息:{{
sheet.companyName ? sheet.companyName : ''
}}
</view>
<view class="mt-15" v-if="sheet.companyMobile">公司联系方式:{{
sheet.companyMobile ? sheet.companyMobile : ''
}}
</view>
<view class="mt-15">授权业务咨询人:{{
sheet.businessName ? sheet.businessName : ''
}}
</view>
<view class="mt-15">业务咨询联系方式:{{
sheet.businessMobile ? sheet.businessMobile : ''
}}
</view>
</template>
<template v-else>
<view class="mt-15" v-if="sheet.companyName">公司信息:{{
sheet.companyName ? sheet.companyName.replace(/^(.)(.).*(.)(.)(.)(.)$/, "$1$2***$3$4$5$6") : ''
}}
</view>
<view class="mt-15" v-if="sheet.companyMobile">公司联系方式:{{
sheet.companyMobile ? sheet.companyMobile.replace(/^(.)(.)(.).*$/, "$1$2$3****") : ''
}}
</view>
<view class="mt-15">授权业务咨询人:{{
sheet.businessName ? sheet.businessName.replace(/^(.).*(.)$/, "$1***$2") : ''
}}
</view>
<view class="mt-15">业务咨询联系方式:{{
sheet.businessMobile ? sheet.businessMobile.replace(/^(.)(.)(.).*$/, "$1$2$3****") : ''
}}
</view>
</template>
</view>
<vk-data-form
ref="form1"
v-model="form1.data"
:action="form1.props.action"
:columns="form1.props.columns"
:rules="form1.props.rules"
:form-type="form1.props.formType"
:loading.sync="form1.props.loading"
:auto-close="false"
:need-alert="false"
:show-cancel="false"
label-width="160px"
@success="onFormSuccess"
@fail="onFormFail"
>
<template v-slot:totalPrice>
<el-input v-model="form1.data.totalPrice" placeholder="请输入货款总价"
@change="formatNumber"></el-input>
</template>
</vk-data-form>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
import dayjs from "dayjs";
export default {
data() {
return {
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
// radio: 1,
// checkbox : [1,2]
sheetId: null
},
// 表单属性
props: {
// 表单请求地址
action: "client/enquiry/quote/kh/addQuote",
// 表单字段显示规则
columns: [
{key: "totalPrice", title: "货款总价", type: "number"},
{key: "totalPriceStr", title: "人民币大写", type: "text"},
{key: "remark", title: "报价单详情", type: "editor"},
],
// 表单验证规则
rules: {
text: [
{required: true, message: "text不能为空", trigger: "change"},
]
},
// add 代表添加 update 代表修改
formType: "",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false
}
data() {
return {
userInfo: {
userLevel: 0
},
sheet: {
files: [],
multiFiles: [],
quoteList: [],
transportDocuments: [],
productList: [],
user: {},
fullAddress: ''
},
enquiryId: null,
reloaded: false,
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
// radio: 1,
// checkbox : [1,2]
sheetId: null,
totalPrice: null,
files: [],
},
// 表单属性
props: {
// 表单请求地址
action: "client/enquiry/quote/kh/addQuote",
// 表单字段显示规则
columns: [
{
key: "totalPrice",
title: "货款总价(人民币:元)",
type: "html"
},
// 表单相关结束-----------------------------------------------------------
};
},
onLoad(options = {}) {
console.log(options)
const {
enquiryId
} = options
if (!enquiryId) {
vk.navigateTo('/pages/process/sheet/list');
return
}
this.enquiryId = enquiryId
this.form1.data.sheetId = enquiryId
this.getEnquiryDetail()
},
computed: {
totalPriceStr() {
if (this.totalPrice == 0) {
return "零元"
}
return vk.myfn.convertCurrency(this.totalPrice / 100)
}
},
methods: {
onFormSuccess() {
vk.navigateBack()
},
// 提交报价单
async submit() {
const data = await vk.userCenter.getCurrentUserInfo();
const {userInfo} = data
if (userInfo.quoteTimes > 3) {
}
this.$confirm(`今日报价次数${userInfo.quoteTimes || 0}, 是否继续?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
center: true
}).then(res => {
vk.callFunction({
url: 'client/enquiry/quote/kh/addQuote',
title: '请求中...',
// data: {
// sheet: this.sheet,
// totalPrice: this.totalPrice
// },
success: (data) => {
this.$message({
message: "报价成功",
type: 'success'
})
}
});
})
},
/**
* 获取询价单详情
*/
getEnquiryDetail() {
vk.callFunction({
url: 'client/enquiry/sheet/pub/getDetail',
title: '请求中...',
data: {
_id: this.enquiryId
},
success: (res) => {
res.data.productList.forEach(item => {
item.unitPrice = 0
const keys = Object.keys(item.extraAttributes)
keys.forEach(citem => {
item.extraAttributes[citem] = JSON.parse(item.extraAttributes[
citem])
})
})
this.sheet = res.data
}
});
// {key: "totalPrice", title: "货款总价(人民币:元)", type: "number", precision: 2},
{
key: "files",
title: "附件",
type: "file",
accept: '.pdf',
tips: '仅支持纵向PDF文档,报价附件将生成标准合同附件,请认真审阅。'
},
{key: "remark", title: "报价单详情", type: "textarea"},
{key: "supplierExt", title: "供应商合同补充条款", type: "textarea", autosize: {minRows: 4, maxRows: 10},},
],
// 表单验证规则
rules: {
totalPrice: [
{required: true, message: "货款总价不能为空", trigger: "change,blur"},
],
files: [
{required: true, message: "附件不能为空", trigger: "change,blur"},
]
},
// add 代表添加 update 代表修改
formType: "",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false
}
},
// 表单相关结束-----------------------------------------------------------
};
},
onLoad(options = {}) {
const {
enquiryId
} = options
if (!enquiryId) {
vk.navigateTo('/pages/process/sheet/list');
return
}
this.enquiryId = enquiryId
this.form1.data.sheetId = enquiryId
this.userInfo = vk.getVuex('$user.userInfo') || {userLevel: 0}
this.getEnquiryDetail()
},
computed: {
isLoggedIn() {
return !!vk.getVuex('$user.userInfo._id')
},
canViewBuyerInfo() {
const remainQuoteNum = Number(this.userInfo && this.userInfo.remainQuoteNum) || 0
const quoteExpiredAt = this.userInfo && this.userInfo.quoteExpiredAt
const monthlyQuoteActive = !!(quoteExpiredAt && dayjs(quoteExpiredAt).isAfter(dayjs()))
return this.isLoggedIn && (
this.sheet.isMine ||
this.sheet.hasQuote ||
Number(this.userInfo.userLevel) > 0 ||
remainQuoteNum > 0 ||
monthlyQuoteActive
)
},
totalPriceStr() {
if (this.totalPrice == 0) {
return "零元"
}
return vk.myfn.convertCurrency(this.totalPrice / 100)
}
},
methods: {
dayjs,
normalizeSheet(data = {}) {
return {
files: [],
multiFiles: [],
quoteList: [],
transportDocuments: [],
productList: [],
user: {},
fullAddress: '',
...data,
files: Array.isArray(data.files) ? data.files : [],
multiFiles: Array.isArray(data.multiFiles) ? data.multiFiles : [],
quoteList: Array.isArray(data.quoteList) ? data.quoteList : [],
transportDocuments: Array.isArray(data.transportDocuments) ? data.transportDocuments : [],
productList: Array.isArray(data.productList) ? data.productList : [],
user: data.user || {},
}
},
onFormSuccess() {
vk.redirectTo({url: `/pages/enquiry/detail?id=${this.enquiryId}`})
},
onFormFail(data) {
if (data.data.code === 12) {
this.$confirm(data.data.msg, '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.redirectTo({url: `/pages/user/user?menu=grade`})
})
} else {
this.$confirm(data.data.msg, '提示', {
confirmButtonText: '确定',
showCancelButton: false,
type: 'warning'
}).then(() => {
vk.navigateBack()
})
}
},
// 提交报价单
async submit() {
const data = await vk.userCenter.getCurrentUserInfo();
const {userInfo} = data
if (userInfo.remainQuoteNum === 0 || !userInfo.remainQuoteNum) {
}
// this.$confirm(`今日报价次数${userInfo.quoteTimes || 0}, 是否继续?`, '提示', {
// confirmButtonText: '确定',
// cancelButtonText: '取消',
// type: 'warning',
// center: true
// }).then(res => {
//
// })
vk.callFunction({
url: 'client/enquiry/quote/kh/addQuote',
title: '请求中...',
// data: {
// sheet: this.sheet,
// totalPrice: this.totalPrice
// },
success: (data) => {
this.$message({
message: "报价成功",
type: 'success'
})
},
fail: err => {
console.log(err)
}
})
},
/**
* 获取询价单详情
*/
getEnquiryDetail() {
vk.callFunction({
url: 'client/enquiry/sheet/pub/getDetail',
title: '请求中...',
data: {
_id: this.enquiryId
},
success: (res) => {
this.sheet = this.normalizeSheet(res.data)
this.sheet.fullAddress = (this.sheet.addressRegion && this.sheet.addressRegion.province) ? `${this.sheet.addressRegion.province.name}${this.sheet.addressRegion.city.name}${this.sheet.addressRegion.area.name}` : ''
if (this.sheet.addressRegion && this.sheet.addressRegion.addressDetail) {
this.sheet.fullAddress += this.sheet.addressRegion.addressDetail
}
}
});
},
formatNumber(e) {
this.form1.data.totalPrice = parseFloat(this.form1.data.totalPrice).toFixed(2)
}
},
onShow() {
this.reloaded = false
setTimeout(() => {
this.reloaded = true
}, 500)
}
}
</script>
<style lang="scss" scoped>
.page-main {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
border-radius: 5px;
}
.description {
margin-bottom: 40px;
width: 800px;
margin-bottom: 40px;
width: 800px;
}
.quote {
.item-wrap {
margin: 24px 0;
.form-title-wrap {
display: flex;
align-items: center;
justify-content: space-between;
.goods-info-title {
display: flex;
align-items: center;
justify-content: flex-start;
}
.form-title {
padding-left: 10px;
color: #A92924;
font-size: 18px;
line-height: 18px;
border-left: 4px solid #A92924;
}
}
}
.tip-text {
color: #f56c6c;
}
.item-wrap + .el-form {
margin-top: 24px;
}
.quote {
display: flex;
align-items: center;
justify-content: space-between;
}
.quote-form {
width: 260px;
width: 260px;
}
.form-footer {
height: 40px;
line-height: 40px;
background: #fff;
padding-top: 0;
text-align: center;
display: block;
height: 40px;
line-height: 40px;
background: #fff;
padding-top: 0;
text-align: center;
display: block;
}
</style>
</style>
+184
View File
@@ -0,0 +1,184 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<!-- <view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
</el-breadcrumb>
</view> -->
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布询价单</el-button>
<!-- <el-button type="primary" round plain>我发布的询价单</el-button> -->
</el-row>
</view>
</view>
<!-- 商品列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns"
:pagination="true"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
keyword: '',
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: "client/enquiry/quote/kh/getList",
customRightBtns: [
{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/enquiry/detail?id=' + item.sheetId);
}
},
],
// 表格字段显示规则
columns: [
{
key: "sheet.title",
title: "供应标题",
type: "text",
},
{
key: "totalPrice",
title: "金额",
type: "text",
formatter: (val, row, column, index) => {
return `${val}元`
}
},
{
key: "status",
title: "状态",
type: "select",
data: [
{value: 0, label: '待选商'},
{value: 1, label: '已被选商'},
]
},
{
key: "remark",
title: "备注",
type: "text",
},
{
key: "_add_time_str",
title: "发布时间",
type: "time",
width: 160
},
],
// 多选框选中的值
multipleSelection: [],
// 当前高亮的记录
selectItem: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
},
methods: {
toRelease() {
if (!vk.getVuex('$user.userInfo.fadadaConfirm')) {
this.$confirm('您尚未认证, 是否前往个人中心认证?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo({url: '/pages/user/user?menu=fadada'});
})
} else if (vk.pubfn.isNull(vk.getVuex('$user.userInfo.businessCard'))) {
this.$confirm('您尚未认证和完善名片,是否前往个人中心?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vk.navigateTo('/pages/user/user?menu=fadada');
})
} else {
uni.navigateTo({
url: '/pages/enquiry/release'
})
}
},
}
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
.el-tag {
margin-right: 10px;
}
}
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
</style>
+1206 -890
View File
File diff suppressed because it is too large Load Diff