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
+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