aa1df73a53
2、调整自营 3、新增购物车(未完善)
189 lines
8.1 KiB
Vue
189 lines
8.1 KiB
Vue
<template>
|
|
<view>
|
|
<top-bar></top-bar>
|
|
<common-header></common-header>
|
|
<category-bar></category-bar>
|
|
<view class="w-1200 m-a">
|
|
<u-swiper :list="list" :height="380" borderRadius="0"></u-swiper>
|
|
<view class="bg-white p-40">
|
|
<view v-for="(item, index) in configList" :key="index"
|
|
class="my-20 flex flex-col justify-start items-start">
|
|
<el-checkbox @change="changeCheck(index)">
|
|
<view class="flex flex-col justify-start items-start">
|
|
<view class="flex justify-start items-center text-35 mb-20">
|
|
<text>服务内容:{{ item.name }}</text>
|
|
<view class="ml-35">
|
|
<text>业务编号:</text>
|
|
<text v-if="item.contentIndex !== null">{{
|
|
item.contents[item.contentIndex].code
|
|
}}
|
|
</text>
|
|
</view>
|
|
<view class="flex justify-start items-center">
|
|
<text class="ml-35">服务服务项目:</text>
|
|
<el-select v-model="configList[index].contentIndex" clearable>
|
|
<el-option v-for="(content, contentIndex) in item.contents" :key="contentIndex"
|
|
:label="content.title" :value="contentIndex"/>
|
|
</el-select>
|
|
</view>
|
|
<text class="ml-35" v-if="item.contentIndex !== null">
|
|
{{ item.contents[item.contentIndex].amount }}元/次
|
|
</text>
|
|
</view>
|
|
<view>备注: {{ item.remark }}</view>
|
|
</view>
|
|
</el-checkbox>
|
|
</view>
|
|
<el-form ref="form" :model="form" label-width="200px">
|
|
<view v-for="(item, index) in productList" :key="index">
|
|
<el-form-item label="检测产品:" required>
|
|
<el-input v-model="productList[index].name"/>
|
|
</el-form-item>
|
|
<el-form-item label="检测内容">
|
|
{{ contentNameList.join() }}
|
|
</el-form-item>
|
|
<el-form-item label="取样所在地">
|
|
<el-input v-model="productList[index].address"/>
|
|
</el-form-item>
|
|
<el-form-item label="接收文件电子邮箱:">
|
|
<el-input v-model="productList[index].email"/>
|
|
</el-form-item>
|
|
<el-form-item label="接收文件微信:">
|
|
<el-input v-model="productList[index].wechat"/>
|
|
</el-form-item>
|
|
<el-form-item label="接收文件寄件地址">
|
|
<el-input v-model="productList[index].receiveAddress"/>
|
|
</el-form-item>
|
|
<el-form-item label="申请人:">
|
|
<el-input v-model="productList[index].requestName"/>
|
|
</el-form-item>
|
|
<el-form-item label="联系人:">
|
|
<el-input v-model="productList[index].contactName"/>
|
|
</el-form-item>
|
|
<el-form-item label="联系方式:">
|
|
<el-input v-model="productList[index].contact"/>
|
|
</el-form-item>
|
|
<el-form-item label="本次服务费用小计:">
|
|
<view class="flex justify-between items-start mb-20 w-100p">
|
|
<view class="flex justify-start items-center">
|
|
<el-input v-model="amount" disabled/>
|
|
<view class="ml-20">
|
|
<el-button type="primary" @click.native="addCompany">增加考察对象
|
|
</el-button>
|
|
</view>
|
|
<view class="ml-20">
|
|
<el-button type="primary" plain @click.native="removeCompany(index)"
|
|
class="ml-20"
|
|
:disabled="productList.length === 1">删除该对象
|
|
</el-button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</el-form-item>
|
|
</view>
|
|
</el-form>
|
|
<view class="mt-40 flex justify-center items-center">
|
|
<view class="flex justify-center items-center">
|
|
<text>总价:</text>
|
|
<text class="text-main font-bold text-35">{{ totalAmount }}元</text>
|
|
</view>
|
|
<view class="ml-35">客服联系方式: 0771-3923001</view>
|
|
</view>
|
|
<view class="mt-40 flex justify-center items-center">
|
|
<el-button type="primary" :disabled="contentList.length === 0 || productList.length === 0 || !productList[0].name">立即支付
|
|
</el-button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<common-footer></common-footer>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: "productQuote",
|
|
data() {
|
|
return {
|
|
list: [
|
|
{
|
|
image: '/static/images/selfSupport/swiper.jpg',
|
|
title: '昨夜星辰昨夜风,画楼西畔桂堂东'
|
|
},
|
|
],
|
|
form: {},
|
|
configList: [],
|
|
checkList: [],
|
|
contentList: [],
|
|
contentNameList: [],
|
|
productList: [
|
|
{
|
|
name: '',
|
|
code: '',
|
|
address: '',
|
|
email: '',
|
|
wechat: '',
|
|
receiveAddress: '',
|
|
requestName: '',
|
|
contactName: '',
|
|
contact: '',
|
|
}
|
|
],
|
|
}
|
|
},
|
|
methods: {
|
|
async getConfigList() {
|
|
const {rows} = await vk.callFunction({
|
|
url: 'client/coop/config/pub/getList',
|
|
data: {type: 1}
|
|
})
|
|
if (rows) {
|
|
this.configList = rows.map(item => {
|
|
item.contentIndex = null
|
|
return item
|
|
})
|
|
}
|
|
},
|
|
changeCheck(itemIndex) {
|
|
const index = this.contentList.indexOf(itemIndex)
|
|
if (index === -1) {
|
|
this.contentList.push(itemIndex)
|
|
} else {
|
|
this.contentList.splice(index, 1)
|
|
}
|
|
},
|
|
addCompany() {
|
|
this.productList.push({
|
|
name: '',
|
|
code: '',
|
|
address: '',
|
|
email: '',
|
|
wechat: '',
|
|
receiveAddress: '',
|
|
requestName: '',
|
|
contactName: '',
|
|
contact: '',
|
|
})
|
|
},
|
|
removeCompany() {
|
|
this.productList.splice(index, 1)
|
|
}
|
|
},
|
|
onLoad() {
|
|
this.getConfigList()
|
|
},
|
|
computed: {
|
|
amount() {
|
|
let tmpAmount = 0
|
|
this.configList.forEach((item, index) => {
|
|
if (this.contentList.indexOf(index) !== -1 && item.contentIndex !== null) {
|
|
tmpAmount += parseFloat(item.contents[item.contentIndex].amount)
|
|
}
|
|
})
|
|
return tmpAmount
|
|
},
|
|
totalAmount() {
|
|
return this.amount * this.productList.length
|
|
}
|
|
}
|
|
}
|
|
</script> |