350 lines
10 KiB
Vue
350 lines
10 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 style="display: inline-block;" url="/pages/enquiry/list">询价单</navigator>
|
|
</el-breadcrumb-item>
|
|
<el-breadcrumb-item>询价单详情</el-breadcrumb-item>
|
|
</el-breadcrumb>
|
|
</view>
|
|
|
|
<view class="page-main">
|
|
<el-descriptions class="description" title="采购商信息" :column="3" size="medium" direction="vertical" border>
|
|
<template slot="title">
|
|
采购商信息 (已有{{sheet.answerCount || 0}}家报价)
|
|
</template>
|
|
<template slot="extra">
|
|
<span style="padding-right: 20px;">距离报价结束还剩<span
|
|
style="color: red;">{{vk.pubfn.dateDiff2(sheet.answerTime)}}</span></span>
|
|
<el-button type="primary" size="small" @click="toQuote">我要报价</el-button>
|
|
</template>
|
|
<el-descriptions-item label="采购商">
|
|
<template v-if="sheet.user.accountType == 1">{{sheet.user.person.personName}}</template>
|
|
<template v-if="sheet.user.accountType == 2">{{sheet.user.company.companyName}}</template>
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="联系方式">
|
|
<template v-if="sheet.user.accountType == 1">{{sheet.user.person.mobile}}</template>
|
|
<template v-if="sheet.user.accountType == 2">{{sheet.user.company.companyName}}</template>
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="发布时间">
|
|
{{sheet._add_time_str}}
|
|
</el-descriptions-item>
|
|
</el-descriptions>
|
|
|
|
<!-- 产品列表 -->
|
|
<el-descriptions v-for="(item,index) in productList" class="description" :title="'采购商品' + (index + 1)"
|
|
:column="3" size="medium" border :key="index">
|
|
<el-descriptions-item label="商品">
|
|
{{item.name}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item v-for="(attr, aindex) in item.extraAttributes" :label="attr.keyName"
|
|
:key="aindex">
|
|
{{attr.keyValue}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="品牌厂家">
|
|
{{item.brand}}
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="材质">
|
|
{{item.materialQuality}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="单件长度">
|
|
{{item.singleLength}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="产品标准">
|
|
{{item.productStandard}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="计价形式">
|
|
{{item.pricingForm}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="加工标准">
|
|
{{item.processStandard}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="交货服务">
|
|
{{item.deliveryService}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="交货时限">
|
|
{{item.deliveryTime}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="采购数量">
|
|
{{item.procureNumber}}{{item.procureUnit}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="交货地点">
|
|
<template
|
|
v-if="item.address && item.address.region">{{item.address.region.province.name + "-" + item.address.region.city.name + "-" + item.address.region.area.name}}</template>
|
|
</el-descriptions-item>
|
|
</el-descriptions>
|
|
|
|
<el-descriptions class="description" title="采购商其他要求" :column="3" size="medium" direction="vertical" border>
|
|
<el-descriptions-item label="其他要求">
|
|
{{sheet.remark || '无'}}
|
|
</el-descriptions-item>
|
|
</el-descriptions>
|
|
|
|
<el-descriptions class="description" title="发票要求" :column="3" size="medium" border direction="vertical">
|
|
<el-descriptions-item label="是否含税">
|
|
{{sheet.invoice? '含税': '不含税'}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item v-if="sheet.invoice" label="发票种类">
|
|
{{sheet.nvoiceType}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item v-if="sheet.invoice" label="开票时间">
|
|
{{sheet.writeInvoiceTime}}
|
|
</el-descriptions-item>
|
|
</el-descriptions>
|
|
|
|
<el-descriptions class="description" title="运输要求" :column="3" size="medium" border direction="vertical">
|
|
<el-descriptions-item label="随货资料">
|
|
{{sheet.transportDocuments.join("、")}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="其他资料">
|
|
{{sheet.otherTransportDocuments}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="运输限制">
|
|
{{sheet.transportLimit}}
|
|
</el-descriptions-item>
|
|
</el-descriptions>
|
|
|
|
<el-descriptions class="description" title="交易模式" :column="3" size="medium" border>
|
|
<el-descriptions-item label="交易模式">
|
|
<template v-if="sheet.tradeMethod == 1">自主交易</template>
|
|
<template v-else-if="sheet.tradeMethod == 0">金久信公正</template>
|
|
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="付款方式">
|
|
<template v-if="sheet.payMethod == 1">预付{{sheet.advancePayRate}}%货到付全款</template>
|
|
<template v-else-if="sheet.payMethod == 2">货到验收后付款</template>
|
|
<template v-else-if="sheet.payMethod == 3">提货付全款</template>
|
|
<template v-else-if="sheet.payMethod == 4">信誉采购</template>
|
|
<template v-else-if="sheet.payMethod == 5">{{item.otherPayMethod}}</template>
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="报价时限">
|
|
|
|
{{vk.pubfn.timeFormat(sheet.answerTime,"yyyy-MM-dd hh:mm:ss")}}
|
|
</el-descriptions-item>
|
|
<el-descriptions-item label="保证金要求">
|
|
{{sheet.earnestMoney}}
|
|
</el-descriptions-item>
|
|
</el-descriptions>
|
|
|
|
|
|
<!-- 报价列表 -->
|
|
<vk-data-table :data="sheet.quoteList" :columns="table1.columns" title="adasda "
|
|
:customRightBtns="table1.customRightBtns"></vk-data-table>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
enquiryId: undefined,
|
|
productList: [],
|
|
sheetTitle: '',
|
|
sheet: {
|
|
user: {},
|
|
productList: [],
|
|
transportDocuments: []
|
|
},
|
|
table1: {
|
|
// 表格数据
|
|
data: [],
|
|
// 表格字段显示规则
|
|
columns: [{
|
|
key: "subjectName",
|
|
title: "供应商",
|
|
type: "text",
|
|
width: 300,
|
|
formatter: (val, row, column, index) => {
|
|
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId) {
|
|
return val
|
|
}
|
|
if (row.accountType == 1) {
|
|
return vk.pubfn.hidden(val, 1, 1);
|
|
} else {
|
|
return vk.pubfn.hidden(val, 2, 4);
|
|
}
|
|
}
|
|
|
|
},
|
|
{
|
|
key: "_add_time_str",
|
|
title: "报价时间",
|
|
type: "text",
|
|
width: 200
|
|
},
|
|
{
|
|
key: "subjectMobile",
|
|
title: "联系方式",
|
|
type: "text",
|
|
width: 120,
|
|
formatter: (val, row, column, index) => {
|
|
let str = val
|
|
if (row.managerMobile) {
|
|
str = row.managerMobile
|
|
}
|
|
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId) {
|
|
return str
|
|
}
|
|
return vk.pubfn.hidden(str, 3, 4);
|
|
}
|
|
},
|
|
{
|
|
key: "totalPrice",
|
|
title: "报价",
|
|
type: "textarea",
|
|
width: 130,
|
|
formatter: (val, row, column, index) => {
|
|
let str = val
|
|
if (row.managerMobile) {
|
|
str = row.managerMobile
|
|
}
|
|
if (vk.getVuex('$user.userInfo._id') == this.sheet.userId) {
|
|
return val
|
|
}
|
|
return "******";
|
|
}
|
|
},
|
|
|
|
|
|
],
|
|
customRightBtns: [
|
|
{
|
|
title: '合同',
|
|
type: 'primary',
|
|
icon: 'el-icon-search',
|
|
show: (row) => {
|
|
return vk.getVuex('$user.userInfo._id') == this.sheet.userId && row.status == 1
|
|
},
|
|
onClick: (item) => {
|
|
vk.navigateTo('/pages/contract/index');
|
|
},
|
|
},
|
|
|
|
{
|
|
title: '选择',
|
|
type: 'primary',
|
|
icon: 'el-icon-search',
|
|
show: (row) => {
|
|
return vk.getVuex('$user.userInfo._id') == this.sheet.userId && row.status == 0
|
|
},
|
|
onClick: (item) => {
|
|
vk.callFunction({
|
|
url: 'client/enquiry/quote/kh/confirmQuote',
|
|
title: '请求中...',
|
|
data: {
|
|
quoteId: item._id
|
|
},
|
|
success: (data) => {
|
|
vk.navigateTo('/pages/contract/index');
|
|
}
|
|
});
|
|
},
|
|
},
|
|
{
|
|
title: '查看报价详情',
|
|
type: 'primary',
|
|
icon: 'el-icon-search',
|
|
disabled: (item) => {
|
|
return vk.getVuex('$user.userInfo._id') != this.sheet.userId
|
|
},
|
|
onClick: (item) => {
|
|
vk.toast(`${item._id}-按钮1`);
|
|
}
|
|
},
|
|
]
|
|
},
|
|
};
|
|
},
|
|
onLoad(options = {}) {
|
|
const {
|
|
id
|
|
} = options
|
|
if (!id) {
|
|
vk.navigateTo('/pages/enquiry/list');
|
|
return
|
|
}
|
|
|
|
this.enquiryId = id
|
|
|
|
this.getEnquiryDetail()
|
|
},
|
|
methods: {
|
|
/**
|
|
* 打开报价窗口
|
|
*/
|
|
toQuote() {
|
|
// 获取用户信息
|
|
vk.userCenter.getCurrentUserInfo({
|
|
success: (data) => {
|
|
const {
|
|
userInfo
|
|
} = data
|
|
if (userInfo.quoteTimes > 3) {
|
|
|
|
}
|
|
|
|
this.$confirm(`今日报价次数${userInfo.quoteTimes || 0}, 是否继续?`, '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning',
|
|
center: true
|
|
}).then(res => {
|
|
vk.navigateTo('/pages/enquiry/quote?enquiryId=' + this.enquiryId);
|
|
})
|
|
|
|
}
|
|
});
|
|
},
|
|
/**
|
|
* 获取询价单详情
|
|
*/
|
|
getEnquiryDetail() {
|
|
vk.callFunction({
|
|
url: 'client/enquiry/sheet/pub/getDetail',
|
|
title: '请求中...',
|
|
data: {
|
|
_id: this.enquiryId
|
|
},
|
|
success: (res) => {
|
|
const {
|
|
productList
|
|
} = res.data
|
|
productList.forEach(item => {
|
|
const keys = Object.keys(item.extraAttributes)
|
|
keys.forEach(citem => {
|
|
item.extraAttributes[citem] = JSON.parse(item.extraAttributes[
|
|
citem])
|
|
})
|
|
})
|
|
this.productList = productList
|
|
|
|
delete res.data.productList
|
|
|
|
this.sheet = res.data
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.page-main {
|
|
width: 1200px;
|
|
margin: 20px auto;
|
|
background-color: #FFFFFF;
|
|
padding: 20px;
|
|
}
|
|
|
|
.description {
|
|
margin-bottom: 40px;
|
|
}
|
|
</style> |