Files
jjx-web/pages/enquiry/release.vue
T
2023-11-17 13:50:18 +08:00

253 lines
7.5 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<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>
<view v-for="(item, index) in productList" :key="index">
<enquiry-template :ref="'product' + index" v-model="productList[index]" :base-attributes="baseAttributes" :productIndex="index"></enquiry-template>
</view>
<view class="btn-add-outer">
<el-button @click="addProduct" type="primary" size="small">添加商品</el-button>
<el-button @click="removeProduct" type="warning" size="small">删除商品</el-button>
</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="" >保存草稿</el-button>
<el-button type="primary" @click="submit">提交询价单</el-button>
</view>
<!-- <el-divider content-position="left">其他设置</el-divider> -->
</view>
</view>
</template>
<script>
import EnquiryTemplate from './components/template.vue'
export default {
components: {EnquiryTemplate},
data() {
return {
// 表单相关开始-----------------------------------------------------------
productList: [{}],
baseAttributes: [],
form1: {
// 表单请求数据,此处可以设置默认值
data: {
// extraAttributes: {},
// attributes: {},
invoice: false
},
// 表单属性
props: {
// 表单请求地址
action: "client/enquiry/sheet/kh/add",
// 表单字段显示规则
columns: [
{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: "files",
title: "附件文档",
type: "file",
buttonText: "点击上传",
limit: 9,
accept: ".jpg,.png,.xlsx,.doc,.docx",
tips: '上传自有采购单图片或文档,支持jpg/png/word/excel'
},
],
// 表单验证规则
rules: {
// name:[
// { required:true, message:'商品不能为空', trigger: ["change","blur"] }
// ],
},
// add 代表添加 update 代表修改
formType: "add",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false,
beforeAction: (formData)=> {
// console.log('formData: ',JSON.parse(JSON.stringify(formData)));
// console.log('product: ',JSON.parse(JSON.stringify(this.productList)));
formData.productList = JSON.parse(JSON.stringify(this.productList))
return formData
}
}
},
// 表单相关结束-----------------------------------------------------------
};
},
onLoad() {
this.getAttributes()
},
methods: {
getAttributes() {
// vk.callFunction({
// url: 'client/enquiry/attributes/pub/getList',
// title: '请求中...',
// data: {
// pageSize: 1000
// },
// success: (res) => {
// this.baseAttributes = res.rows
// }
// });
},
addProduct() {
this.productList.push({})
},
onFormSuccess() {
vk.navigateTo('/pages/enquiry/list');
},
submit() {
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>