Files
jjx-web-sign-only/pages/store/store.vue
T
2023-12-07 15:32:59 +08:00

669 lines
17 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 class="">
<top-bar></top-bar>
<common-nav></common-nav>
<view class="w-1200">
<el-row :gutter="20">
<el-col :span="6">
<el-menu @select="menuSelect" :default-active="menuIndex" class="el-menu-vertical-demo">
<el-menu-item index="0">
<i class="el-icon-edit"></i>
<span slot="title">我卖出的</span>
</el-menu-item>
<el-menu-item index="1">
<i class="el-icon-warning-outline"></i>
<span slot="title">我购买的</span>
</el-menu-item>
<el-menu-item index="2">
<i class="el-icon-circle-check"></i>
<span slot="title">线下交易</span>
</el-menu-item>
</el-menu>
</el-col>
<el-col :span="18">
<el-card shadow="never">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="全部(4)" name="all">
</el-tab-pane>
<el-tab-pane label="待付款(2)" name="待付款"></el-tab-pane>
<el-tab-pane label="待发货(1)" name="待发货"></el-tab-pane>
<el-tab-pane label="待收货" name="待收货"></el-tab-pane>
<el-tab-pane label="待退款" name="待退款"></el-tab-pane>
<el-tab-pane label="已取消" name="已取消"></el-tab-pane>
<el-tab-pane label="已完成" name="已完成"></el-tab-pane>
</el-tabs>
<el-descriptions border size="small">
<el-descriptions-item label="订单编号"><input placeholder="请输入订单编号" /></el-descriptions-item>
<el-descriptions-item label="下单时间"><input placeholder="下单时间" /></el-descriptions-item>
<el-descriptions-item label="采购商品"><input placeholder="请输入采购商品" /></el-descriptions-item>
<el-descriptions-item label="交易方式">
<el-select v-model="value" size="small" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-descriptions-item>
<el-descriptions-item label="买家名称">
<input placeholder="请输入买家名称" />
</el-descriptions-item>
<el-descriptions-item label="发票管理">
<el-select size="small" v-model="value2" placeholder="请选择">
<el-option v-for="item in options2" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card shadow="never" style="margin-top: 20px;">
<template v-if="menuIndex == 0">
<view class="order-list">
<view class="item">
<view class="info">
<view class="title">直缝焊管 Q235B 20米 不限</view>
<view class="sub-title">
<text>订单编号:JJX008456456</text>
<text>创建时间:2023-05-13 10:30:55</text>
<text>卖家:广西某某有限责任公司</text>
</view>
<view class="action">
<view class="btn-buy">联系买家</view>
<el-divider direction="vertical"></el-divider>
<view class="btn-close">取消订单</view>
</view>
</view>
<view class="tool">
<view class="price">
<text class="red">¥22311</text>
<text>总金额</text>
</view>
<view class="status">
<view class="icon">
<img src="https://oss.wsdns.cn/20231207/010a7e26b1294284a63b890c46031225.png" alt="" />
</view>
</view>
</view>
</view>
<view class="item">
<view class="info">
<view class="title">直缝焊管 Q235B 20米 不限</view>
<view class="sub-title">
<text>订单编号:JJX008456456</text>
<text>创建时间:2023-05-13 10:30:55</text>
<text>卖家:广西某某有限责任公司</text>
</view>
<view class="action">
<view class="btn-buy">联系买家</view>
<el-divider direction="vertical"></el-divider>
<view class="btn-close">取消订单</view>
</view>
</view>
<view class="tool">
<view class="price">
<text class="red">¥22311</text>
<text>总金额</text>
</view>
<view class="status">
<view class="icon">
<img src="https://oss.wsdns.cn/20231207/010a7e26b1294284a63b890c46031225.png" alt="" />
</view>
</view>
</view>
</view>
<view class="item">
<view class="info">
<view class="title">直缝焊管 Q235B 20米 不限</view>
<view class="sub-title">
<text>订单编号:JJX008456456</text>
<text>创建时间:2023-05-13 10:30:55</text>
<text>卖家:广西某某有限责任公司</text>
</view>
<view class="action">
<view class="btn-buy">联系买家</view>
<el-divider direction="vertical"></el-divider>
<view class="btn-close">取消订单</view>
</view>
</view>
<view class="tool">
<view class="price">
<text class="red">¥22311</text>
<text>总金额</text>
</view>
<view class="status">
<view class="icon">
<img src="https://oss.wsdns.cn/20231207/010a7e26b1294284a63b890c46031225.png" alt="" />
</view>
</view>
</view>
</view>
<view class="paginatio">
<el-pagination
background
layout="prev, pager, next"
:total="1000">
</el-pagination>
</view>
</view>
</template>
<template v-if="menuIndex == 1">
我购买的订单列表
</template>
<template v-if="menuIndex == 2">
线下交易列表
</template>
</el-card>
</el-col>
</el-row>
</view>
<common-footer></common-footer>
<el-dialog :visible.sync="form1.props.show">
<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>
</el-dialog>
<!-- 上传合同弹窗 -->
</view>
</template>
<script>
import {
Agreement
} from "@icon-park/vue";
export default {
components: {
Agreement
},
data() {
return {
activeName: 'all',
value: '',
options: [{
value: '自主交易',
label: '自主交易'
}],
value2: '',
options2: [{
value: '未开发票',
label: '自主交易'
}],
pageIndex: 1,
menuIndex: '0',
isSign: false,
formData: {
status: 0,
tradeMethod: null
},
tableData: {},
// 表单相关开始-----------------------------------------------------------
form1: {
// 表单请求数据,此处可以设置默认值
data: {
contractId: '',
signEndDate: '',
title: '',
contractFile: '',
buyerSignKeyword: '',
sellerSignKeyword: '',
otherFile: '',
},
// 表单属性
props: {
// 表单请求地址
action: 'client/contract/kh/launch',
// 表单字段显示规则
columns: [{
key: "title",
title: "标题",
type: "text"
},
{
key: "signEndDate",
title: "签署截止日期",
type: "date",
pickerOptions: {
disabledDate: (date) => {
const now = new Date()
return now > date
}
}
},
{
key: "contractFile",
title: "签署文档",
type: "file",
limit: 1,
accept: ".pdf",
tips: "仅支持PDF文件",
},
{
key: "buyerSignKeyword",
title: "买家签章关键字",
type: "text",
tips: '关键字为文档中的文字内容(要能使用ctrl+f搜索到)。法大大按此关键字进行签章位置的定位,将电子章盖在这个关键字上面。凡出现关键字的地方均会盖上指定用户的电子章,建议关键字在合同中保持唯一。'
},
{
key: "sellerSignKeyword",
title: "卖家签章关键字",
type: "text",
tips: '关键字为文档中的文字内容(要能使用ctrl+f搜索到)。法大大按此关键字进行签章位置的定位,将电子章盖在这个关键字上面。凡出现关键字的地方均会盖上指定用户的电子章,建议关键字在合同中保持唯一。'
},
{
key: "otherFile",
title: "附件",
type: "file"
},
],
// 表单验证规则
rules: {
title: [{
required: true,
message: "标题不能为空",
trigger: "change"
}, ],
signEndDate: [{
required: true,
message: "签署截止日期不能为空",
trigger: "change"
}],
buyerSignKeyword: [{
required: true,
message: "买家签章关键字不能为空",
trigger: "change"
}],
sellerSignKeyword: [{
required: true,
message: "卖家签章关键字不能为空",
trigger: "change"
}],
contractFile: [{
required: true,
message: "签署文档不能为空",
trigger: "change"
}, ]
},
// add 代表添加 update 代表修改
formType: "",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false
}
},
form2: {
// 表单请求数据,此处可以设置默认值
data: {
contractId: '',
signEndDate: '',
title: '',
contractFile: '',
buyerSignKeyword: '',
sellerSignKeyword: '',
otherFile: '',
},
// 表单属性
props: {
// 表单请求地址
action: 'client/contract/kh/addSign',
// 表单字段显示规则
columns: [{
key: "title",
title: "标题",
type: "text"
},
{
key: "phone",
title: "对方手机号",
type: "text"
},
{
key: "userType",
title: "对方身份",
type: "select",
data: [{
value: 1,
label: "买家"
},
{
value: 2,
label: "卖家"
}
]
},
{
key: "signEndDate",
title: "签署截止日期",
type: "date",
pickerOptions: {
disabledDate: (date) => {
const now = new Date()
return now > date
}
}
},
{
key: "contractFile",
title: "签署文档",
type: "file",
limit: 1,
accept: ".pdf",
tips: "仅支持PDF文件",
},
{
key: "buyerSignKeyword",
title: "买家签章关键字",
type: "text",
tips: '关键字为文档中的文字内容(要能使用ctrl+f搜索到)。法大大按此关键字进行签章位置的定位,将电子章盖在这个关键字上面。凡出现关键字的地方均会盖上指定用户的电子章,建议关键字在合同中保持唯一。'
},
{
key: "sellerSignKeyword",
title: "卖家签章关键字",
type: "text",
tips: '关键字为文档中的文字内容(要能使用ctrl+f搜索到)。法大大按此关键字进行签章位置的定位,将电子章盖在这个关键字上面。凡出现关键字的地方均会盖上指定用户的电子章,建议关键字在合同中保持唯一。'
},
{
key: "otherFile",
title: "附件",
type: "file"
},
],
// 表单验证规则
rules: {
title: [{
required: true,
message: "标题不能为空",
trigger: "change"
}, ],
phone: [{
required: true,
message: "标题不能为空",
trigger: "change"
}, ],
signEndDate: [{
required: true,
message: "签署截止日期不能为空",
trigger: "change"
}],
buyerSignKeyword: [{
required: true,
message: "买家签章关键字不能为空",
trigger: "change"
}],
sellerSignKeyword: [{
required: true,
message: "卖家签章关键字不能为空",
trigger: "change"
}],
contractFile: [{
required: true,
message: "签署文档不能为空",
trigger: "change"
}, ]
},
// add 代表添加 update 代表修改
formType: "",
// 表单是否在请求中
loading: false,
// 是否显示表单1 的弹窗
show: false
}
},
// 表单相关结束-----------------------------------------------------------
}
},
onLoad(options) {
if (options.tab) {
if (options.tab === 'sign') {
this.isSign = true
} else {
this.menuIndex = String(options.tab)
this.formData.status = Number(options.tab)
this.isSign = false
this.query(1)
}
}
},
methods: {
menuSelect(e) {
this.menuIndex = String(e)
this.formData.status = Number(e)
this.isSign = false
this.query(1)
},
selectSign() {
this.isSign = true
this.menuIndex = ''
},
async query(pageIndex) {
this.tableData = await vk.callFunction({
url: 'client/contract/kh/getList',
title: '请求中...',
data: {
pageIndex,
pageSize: 10,
status: this.formData.status
},
});
},
/**
* 创建合同
* @param contract
*/
createContract(contract) {
this.form1.data.contractId = contract._id
this.form1.props.action = 'client/contract/kh/launch'
this.form1.props.show = true
},
async changeContract(contract) {
this.form1.data.contractId = contract._id
const res = await vk.callFunction({
url: 'client/contract/kh/getDetail',
title: '请求中...',
data: {
contractId: contract._id
},
});
this.form1.data.signEndDate = res.signEndDate
this.form1.data.title = res.docTitle
this.form1.data.contractFile = res.contractBase
this.form1.data.buyerSignKeyword = res.buyerSignKeyword
this.form1.data.sellerSignKeyword = res.sellerSignKeyword
this.form1.data.otherFile = res.otherFile
this.form1.props.show = true
},
onFormSuccess() {
this.form1.props.show = false
this.form1.data.contractId = null
this.formData.status = 1
this.menuIndex = '1'
this.isSign = false
this.$refs.form2.resetForm()
this.query(1)
},
/**
* 签署合同
* @param {Object} contract
*/
extSign(contract) {
vk.callFunction({
url: 'client/contract/kh/extSign',
title: '请求中...',
data: {
contractId: contract._id
},
success: (res) => {
window.open(res.data)
}
});
},
viewContract(contract) {
vk.callFunction({
url: 'client/contract/kh/viewContract',
title: '请求中...',
data: {
contractId: contract._id
},
success: (res) => {
window.open(res.data)
this.query(1)
}
});
}
}
}
</script>
<style scoped lang="scss">
.w-1200 {
width: 1200px;
margin: 20px auto;
}
.contract-list {
background-color: #FFFFFF;
padding: 10px 20px 20px;
}
.order-list{
display: flex;
flex-direction: column;
.item{
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #f3f3f3;
.info{
.title{
font-size: 16px;
font-weight: bold;
line-height: 2em;
}
.sub-title{
color: #999999;
}
.action{
padding: 10px 0;
display: flex;
flex-direction: row;
align-items: center;
.btn-buy,.btn-close{
color: #A92924;
}
}
}
.tool{
display: flex;
.price{
margin:0 20px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.red{
font-size: 16px;
color: #A92924;
font-weight: bold;
}
}
.status{
.icon{
margin:0 20px;
img{
width: 100px;
}
}
}
}
}
}
.paginatio {
margin: 20px auto;
display: flex;
justify-content: center;
}
.contract-box {
display: flex;
justify-content: space-between;
border-bottom: solid 1px #e8e8e8;
padding: 10rpx 0;
}
.contract-left {}
.contract-right {
text-align: right;
font-size: 13px;
}
.trade-method {
display: flex;
margin-bottom: 20px;
border-bottom: solid 2px #f4f4f4;
}
.trade-method-item {
cursor: pointer;
font-size: 18px;
margin-right: 15px;
height: 40px;
line-height: 40px;
}
.trade-method-item.active {
color: #A92924;
border-bottom: solid 2px #A92924;
}
.contract-left-top {
display: flex;
align-items: center;
}
.contract-product {
margin: 0 10px;
}
.contract-left-center {
height: 40px;
display: flex;
justify-content: flex-start;
align-items: flex-start;
color: #999999;
font-size: 12px;
flex-direction: column;
margin-top: 5px;
}
.contract-left-bottom {
display: flex;
}
.contract-status {
display: flex;
}
.contract-status-tag {
margin-left: 2px;
}
.sign {
padding: 20px 20px 20px 25px;
font-size: 14px;
.icon {
line-height: 18px;
}
}
</style>