This commit is contained in:
2023-11-23 22:29:13 +08:00
parent 715859c63f
commit 882419768f
39 changed files with 2190 additions and 199 deletions
+22
View File
@@ -0,0 +1,22 @@
<template>
<view>
<top-bar></top-bar>
<common-header></common-header>
<category-bar></category-bar>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
};
}
}
</script>
<style lang="scss">
</style>
+340
View File
@@ -0,0 +1,340 @@
<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="http://jyx.gxwebsoft.com/uploads/20210506/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="filter-outer">
<el-form @submit.native.prevent label-width="80px">
<el-form-item label="关键词">
<el-input @keyup.enter.native="query(1)" clearable placeholder="输入关键字搜索" v-model="keyword">
<el-button @click="query(1)" type="primary" slot="append" icon="el-icon-search"></el-button>
</el-input>
</el-form-item>
<el-form-item label="分类">
<el-tabs>
<el-tab-pane v-for="(item, index) in categoryTreeData" :label="item.name" :key="item._id">
<el-checkbox-group v-model="checkCategoryList[index]">
<el-checkbox v-for="(citem, cindex) in item.children" :label="citem"
:key="cindex">{{citem.name}}</el-checkbox>
</el-checkbox-group>
</el-tab-pane>
</el-tabs>
</el-form-item>
<el-form-item label="城市">
<el-checkbox-group v-model="checkProvinceList">
<!-- <el-checkbox :label="{code:0,name: '全国'}">全国</el-checkbox> -->
<el-checkbox :checked="cindex == 0" v-for="(citem, cindex) in provinceData" :label="citem"
:key="cindex">{{citem.name}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="已选">
<view class="tags">
<el-tag v-for="(item, index) in checkCategoryArr" :key="index">{{item.name}}</el-tag>
</view>
</el-form-item>
</el-form>
</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,
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: "productList",
title: "品名/材质",
type: "text",
width: 280,
formatter: (val, row, column, index) => {
return val.map(item=>item.name).join("/")
}
},
{
key: "productList",
title: "采购量",
type: "text",
width: 280,
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: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
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>
+306
View File
@@ -0,0 +1,306 @@
<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="http://jyx.gxwebsoft.com/uploads/20210506/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,
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: "productList",
title: "品名/材质",
type: "text",
width: 280,
formatter: (val, row, column, index) => {
return val.map(item=>item.name).join("/")
}
},
{
key: "productList",
title: "采购量",
type: "text",
width: 280,
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: "",
},
// 表格相关结束 -----------------------------------------------------------
};
},
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>
+36
View File
@@ -0,0 +1,36 @@
<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>
<view style="display: inline-block;" @click="vk.navigateTo('/pages/process/list');">加工单</view>
</el-breadcrumb-item>
<el-breadcrumb-item>填写报价信息</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="form-footer">
<el-button type="primary" @click="submit">提交报价单</el-button>
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
data() {
return {
};
}
}
</script>
<style lang="scss">
</style>
+272
View File
@@ -0,0 +1,272 @@
<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/enquiry/list">加工单</navigator>
</el-breadcrumb-item>
<el-breadcrumb-item>发布加工单</el-breadcrumb-item>
</el-breadcrumb>
</view>
<view class="form-view">
<view class="m-20">
<view class="title-main">请填写加工单</view>
<view class="title-sub">加工单信息越完整,加工商报价越精准</view>
</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"
:before-action="form1.props.beforeAction" label-width="140px" cancel-text="保存草稿" submit-text="提交加工单"
@success="onFormSuccess" :footer-show="false">
</vk-data-form>
<view class="form-footer">
<el-button type="" @click="draft">保存草稿</el-button>
<el-button type="primary" @click="submit">提交加工单</el-button>
</view>
<!-- <el-divider content-position="left">其他设置</el-divider> -->
</view>
<common-footer></common-footer>
</view>
</template>
<script>
export default {
components: {},
data() {
return {
// 表单相关开始-----------------------------------------------------------
productList: [{}],
baseAttributes: [],
form1: {
// 表单请求数据,此处可以设置默认值
data: {
// extraAttributes: {},
// attributes: {},
invoice: false
},
// 表单属性
props: {
// 表单请求地址
action: "client/process/sheet/kh/add",
// 表单字段显示规则
columns: [
{key: "", title: "加工信息", type: "bar-title"},
{key: "title", title: "标题", type: "text",},
{
key: "address",
title: "交货地点",
type: "object",
// justify: "start",
showLabel: false,
columns: [
{key: "region", title: "交货地点", type: "address",},
{key: "detail", title: "详细交货地址", type: "textarea",},
],
},
{key: "files", title: "附件", type: "file",tips: '上传自有加工单图片或文档,支持jpg/png/word/excel'},
{key: "", title: "采购商其他要求", type: "bar-title"},
{key: "remark", title: "其他要求", type: "textarea",},
{key: "", title: "发票要求", type: "bar-title"},
{key: "invoice", title: "发票要求", type: "radio",
data: [
{ value: true, label: "含税" },
{ value: false, label: "不含税" }
],
},
{key: "writeInvoiceTime",
title: "开票时间",
type: "radio",
data: [
{ value: '付款当月(限20号之前付款,20号之后付款次月开票)', label: "付款当月(限20号之前付款,20号之后付款次月开票)" },
{ value: '付款后次月', label: "付款后次月" },
{ value: '付款前', label: "付款前" },
],
showRule: 'invoice == true'
},
{key: "nvoiceType",
title: "发票种类",
type: "radio",
data: [
{ value: '增值税专用发票13%', label: "增值税专用发票13%" },
{ value: '增值税普通发票', label: "增值税普通发票" },
{ value: '普通发票', label: "普通发票" },
],
showRule: 'invoice == true'
},
{key: "", title: "运输要求", type: "bar-title"},
{key: "transportDocuments",
title: "随货资料",
type: "checkbox",
data: [
{ value: '合格证', label: "合格证" },
{ value: '检测报告', label: "检测报告" },
{ value: '销售清单', label: "销售清单" },
{ value: '磅重', label: "磅重" },
],
},
{key: "otherTransportDocuments", title: "其他资料", type: "text"},
{key: "transportLimit",
title: "运输限制",
type: "text",
},
{key: "", title: "交易说明", type: "bar-title", component: 'custom-form-section'},
{key: "tradeMethod",
title: "交易模式",
type: "radio",
data: [
{ value: 1, label: "自主交易" },
{ value: 0, label: "金久信公证" },
],
},
// {key: "", title: "交易说明", type: "bar-title"},
{
key: "payMethod",
title: "付款方式",
type: "radio",
data: [
{ value: 1, label: "预付x%货到付全款" },
{ value: 2, label: "货到验收后付款" },
{ value: 3, label: "提货付全款" },
{ value: 4, label: "信誉采购" },
{ value: 5, label: "其他付款方式" },
],
},
{
key: "",title: "",type: 'group',showLabel: false, justify: "start",columns:[
{key: "advancePayRate", title: "预付百分比", type: "percentage",showRule: "payMethod==1"},
{key: "otherPayMethod", title: "其他付款方式", type: "text",showRule: "payMethod==5"},
{key: "reputationPayDay", title: "货到签单后账期天数", type: "number",showRule: "payMethod==4",rightText: '天'},
]
},
{key: "answerTime", title: "报价时限", type: "date",dateType: "datetime"},
{key: "earnestMoney", title: "保证金要求", type: "text"},
{key: "", title: "合同要求", type: "bar-title"},
{key: 'signMethod', title: '签约方式', type: 'radio', data: [
{ value: 0, label: "法大大" },
{ value: 1, label: "线下签约" },
]},
{key: 'contractType', title: '合同选择', type: 'radio',showRule: 'signMethod==0', data: [
{ value: 0, label: "标准合同模板" },
{ value: 1, label: "自定义合同" },
]},
{key: "breachLiability", title: "违约责任", type: "textarea", readonly: true, showRule: 'signMethod==0&&contractType==0'},
{key: "solveDispute", title: "解决纠纷的方法", type: "textarea", readonly: true, showRule: 'signMethod==0&&contractType==0'},
{key: "forceMajeure", title: "不可抗力", type: "textarea", readonly: true, showRule: 'signMethod==0&&contractType==0'},
{key: "contracOther", title: "其他", type: "textarea", readonly: true, showRule: 'signMethod==0&&contractType==0'},
{key: "buyerSupplement", title: "采购方补充条款", type: "textarea", readonly: true, showRule: 'signMethod==0&&contractType==0'},
{key: "sellerSupplement", title: "供应方补充条款", type: "textarea", showRule: 'signMethod==0&&contractType==0'},
// {key: "", title: "采购商信息", type: "bar-title"},
{
key: "files",
title: "附件文档",
type: "file",
buttonText: "点击上传",
limit: 9,
accept: ".jpg,.png,.xlsx,.doc,.docx",
tips: '上传自有采购单图片或文档,支持jpg/png/word/excel'
},
],
// 表单验证规则
rules: {
title:[
{ required:true, message:'标题不能为空', trigger: ["change","blur"] }
],
invoice:[
{ required:true, message:'发票要求不能为空', trigger: ["change","blur"] }
],
writeInvoiceTime:[
{ required:true, message:'开票时间不能为空', trigger: ["change","blur"] }
],
nvoiceType:[
{ required:true, message:'发票类型不能为空', trigger: ["change","blur"] }
],
},
// add 代表添加 update 代表修改
formType: "add",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false,
beforeAction: (formData)=> {
formData.productList = JSON.parse(JSON.stringify(this.productList))
return formData
}
}
},
// 表单相关结束-----------------------------------------------------------
};
},
onLoad() {
},
methods: {
onFormSuccess() {
vk.navigateTo('/pages/process/list');
},
// 提交并发布
submit() {
this.form1.data.isShow = 1
this.submitAll()
},
// 提交并保存草稿
draft() {
this.form1.data.isShow = 0
this.submitAll()
},
async submitAll() {
this.$refs.form1.submitForm()
}
}
}
</script>
<style lang="scss">
.form-view {
width: 1200px;
margin: 0 auto;
background-color: #FFFFFF;
padding: 20rpx;
}
.m-20 {
margin: 20px;
}
.title-main{
font-size: 18px;
font-weight: bold;
text-align: center;
}
.title-sub{
font-size: 14px;
text-align: center;
}
.btn-add-outer{
padding-left: 140px;
margin: 0 0 20px 0;
}
.form-footer {
height: 40px;
line-height: 40px;
background: #fff;
padding-top: 0;
text-align: center;
display: block;
}
</style>