Files
jjx-web/pages/process/my.vue
T
b2894lxlx 16ebffc27e 1、新增黄页
2、新增学堂
3、其他调整、修改
2023-12-04 01:32:33 +08:00

299 lines
8.9 KiB
Vue

<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<!-- <view class="page-nav">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
<el-breadcrumb-item><navigator url="/pages/spot/goods/goods">现货市场</navigator></el-breadcrumb-item>
</el-breadcrumb>
</view> -->
<view class="carousel">
<el-carousel height="170px">
<el-carousel-item v-for="item in 4" :key="item">
<image class="carousel-img"
src="/static/images/600fc93e6b85324b3ea1373ee264290d.jpg"
mode="aspectFill"></image>
</el-carousel-item>
</el-carousel>
<view class="goods-options">
<el-row class="">
<el-button @click="toRelease" type="primary" round>发布加工单</el-button>
<!-- <el-button @click="toMyEnquiry" type="primary" round plain>我发布的加工单</el-button>-->
</el-row>
</view>
</view>
<!-- 加工单列表 -->
<view class="sheet-list">
<vk-data-table ref="table1" :action="table1.action" :columns="table1.columns"
:customRightBtns="table1.customRightBtns"
:pagination="true"></vk-data-table>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
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: '',
// 表格相关开始 -----------------------------------------------------------
table1: {
// 表格数据请求地址
action: (obj = {}) => {
let {data, success, fail, complete} = obj;
vk.callFunction({
url: `client/process/sheet/pub/getList`,
data: {
...data, ...{
userId: vk.getVuex('$user.userInfo._id')
}
},
success: (res) => {
if (typeof success === "function") {
success({
rows: res.rows, // 列表数据
total: res.total, // 总记录数
});
}
},
fail: (err => {
}),
complete: (res) => {
if (typeof complete === "function") complete(res);
}
})
},
customRightBtns: [{
title: '详情',
icon: 'el-icon-search',
type: 'primary',
onClick: (item) => {
vk.navigateTo('/pages/process/detail?id=' + item._id);
}
},],
// 表格字段显示规则
columns: [
{
key: "title",
title: "标题",
type: "text",
},
{
key: "num",
title: "加工量",
type: "text"
},
{
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: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
onLoad() {
// this.search(1)
vk.callFunction({
url: 'client/spot/category/pub/getTree',
title: '请求中...',
data: {},
success: (data) => {
this.categoryTreeData = data.rows
for (var i = 0; i < data.rows.length; i++) {
this.checkCategoryList.push([])
}
}
});
},
methods: {
toMyEnquiry() {
vk.navigateTo({
url: '/pages/enquiry/my'
})
},
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 {
vk.navigateTo({
url: '/pages/process/release'
})
}
},
search(pageIndex) {
const categoryIds = []
this.checkCategoryList.forEach(item => {
item.forEach(sitem => {
categoryIds.push(sitem._id)
})
})
let provinceCodes = this.checkProvinceList.map(item => item.code)
if (provinceCodes.includes(9999)) {
provinceCodes = []
}
vk.callFunction({
url: 'client/process/sheet/pub/getList',
data: {
pageIndex: pageIndex,
pageSize: 20,
keyword: this.keyword,
},
success: (data) => {
console.log('data: ', data);
this.goodsData = data
}
});
},
},
computed: {
checkCategoryArr() {
let arr = []
this.checkCategoryList.forEach(item => {
arr.push(...item)
})
this.checkProvinceList.forEach(item => {
arr.push({
...item
})
})
return arr
}
}
}
</script>
<style lang="scss" scoped>
.carousel {
width: 1200px;
margin: 20px auto;
}
.carousel-img {
width: 100%;
height: 100%;
}
.goods-options {
background-color: #FFFFFF;
padding: 20px;
}
.filter-outer {
width: 1200px;
margin: 20px auto;
background-color: #FFFFFF;
padding: 20px;
}
.tags {
display: flex;
.el-tag {
margin-right: 10px;
}
}
.sheet-list {
width: 1200px;
margin: 20px auto;
// display: flex;
}
.paginatio {
float: none;
width: 1200px;
margin: 20px auto;
display: flex;
justify-content: center;
}
</style>