|
@@ -160,13 +160,13 @@
|
|
<pc-switch v-model="freight_switch"></pc-switch>
|
|
<pc-switch v-model="freight_switch"></pc-switch>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <el-button
|
|
|
|
- size="medium"
|
|
|
|
- class="button-black"
|
|
|
|
- @click="openMailDialog">
|
|
|
|
- Enquiry
|
|
|
|
- </el-button>
|
|
|
|
</section> -->
|
|
</section> -->
|
|
|
|
+ <el-button
|
|
|
|
+ size="medium"
|
|
|
|
+ class="button-black"
|
|
|
|
+ @click="openMailDialog">
|
|
|
|
+ Enquiry
|
|
|
|
+ </el-button>
|
|
<!-- <section>
|
|
<!-- <section>
|
|
<unit-table
|
|
<unit-table
|
|
:tableData="unitData"
|
|
:tableData="unitData"
|
|
@@ -210,7 +210,7 @@
|
|
<no-ssr>
|
|
<no-ssr>
|
|
<div v-if="quoteLoadState == 1">
|
|
<div v-if="quoteLoadState == 1">
|
|
<!-- Enquiry按钮 -->
|
|
<!-- Enquiry按钮 -->
|
|
- <!-- <form-dialog
|
|
|
|
|
|
+ <form-dialog
|
|
:emailForm="enquiryForm"
|
|
:emailForm="enquiryForm"
|
|
:enquiryConfig="enquiryConfig"
|
|
:enquiryConfig="enquiryConfig"
|
|
:visible.sync="enquiryFormVisible"
|
|
:visible.sync="enquiryFormVisible"
|
|
@@ -218,7 +218,7 @@
|
|
:rules="rules"
|
|
:rules="rules"
|
|
:labelWidth="
|
|
:labelWidth="
|
|
enquiryConfig[3].selectlist?.length ? 140 : 82
|
|
enquiryConfig[3].selectlist?.length ? 140 : 82
|
|
- "></form-dialog> -->
|
|
|
|
|
|
+ "></form-dialog>
|
|
<mail-table
|
|
<mail-table
|
|
ref="mailtable"
|
|
ref="mailtable"
|
|
:mailData="mailData"
|
|
:mailData="mailData"
|
|
@@ -841,27 +841,32 @@ export default {
|
|
dividePrice(a) {
|
|
dividePrice(a) {
|
|
return npDivide(+a, 100)
|
|
return npDivide(+a, 100)
|
|
},
|
|
},
|
|
- // openMailDialog() {
|
|
|
|
- // if (this.$utils.checkLogin()) {
|
|
|
|
- // this.getUserInfo()
|
|
|
|
- // const { contacts, email, phone, crm_users_id:crmUsersId } = this.userInfo
|
|
|
|
- // this.enquiryForm.Name = contacts
|
|
|
|
- // this.enquiryForm.Email = email
|
|
|
|
- // this.enquiryForm.Phone = phone
|
|
|
|
- // if (crmUsersId?.length) {
|
|
|
|
- // this.enquiryConfig[3].selectlist = crmUsersId
|
|
|
|
- // if (crmUsersId?.length === 1) {
|
|
|
|
- // this.enquiryForm['Customer manager'] = crmUsersId[0].name
|
|
|
|
- // }
|
|
|
|
- // } else {
|
|
|
|
- // this.enquiryConfig[3].isShow = false
|
|
|
|
- // this.$delete(this.enquiryForm, 'Customer manager')
|
|
|
|
- // }
|
|
|
|
- // this.enquiryFormVisible = true
|
|
|
|
- // } else {
|
|
|
|
- // this.openDialog()
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
|
|
+ openMailDialog() {
|
|
|
|
+ if (this.$utils.checkLogin()) {
|
|
|
|
+ this.getUserInfo()
|
|
|
|
+ const {
|
|
|
|
+ contacts,
|
|
|
|
+ email,
|
|
|
|
+ phone,
|
|
|
|
+ crm_users_id: crmUsersId,
|
|
|
|
+ } = this.userInfo
|
|
|
|
+ this.enquiryForm.Name = contacts
|
|
|
|
+ this.enquiryForm.Email = email
|
|
|
|
+ this.enquiryForm.Phone = phone
|
|
|
|
+ if (crmUsersId?.length) {
|
|
|
|
+ this.enquiryConfig[3].selectlist = crmUsersId
|
|
|
|
+ if (crmUsersId?.length === 1) {
|
|
|
|
+ this.enquiryForm['Customer manager'] = crmUsersId[0].name
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.enquiryConfig[3].isShow = false
|
|
|
|
+ this.$delete(this.enquiryForm, 'Customer manager')
|
|
|
|
+ }
|
|
|
|
+ this.enquiryFormVisible = true
|
|
|
|
+ } else {
|
|
|
|
+ this.openDialog()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
getMailData() {
|
|
getMailData() {
|
|
this.mailData.Url = window.location.href
|
|
this.mailData.Url = window.location.href
|
|
const { Name, Email, Phone, Comments } = this.enquiryForm
|
|
const { Name, Email, Phone, Comments } = this.enquiryForm
|
|
@@ -877,57 +882,57 @@ export default {
|
|
this.mailData['Quote time'] = this.$utils.formatTime(new Date())
|
|
this.mailData['Quote time'] = this.$utils.formatTime(new Date())
|
|
},
|
|
},
|
|
// 发送价格邮件 Enquiry按钮
|
|
// 发送价格邮件 Enquiry按钮
|
|
- // async sendPriceMail() {
|
|
|
|
- // await this.getMailData()
|
|
|
|
- // await this.getCustomerQuoteData()
|
|
|
|
- // const {
|
|
|
|
- // Name,
|
|
|
|
- // Email,
|
|
|
|
- // Phone,
|
|
|
|
- // Comments,
|
|
|
|
- // 'Customer manager': customerManager,
|
|
|
|
- // } = this.enquiryForm
|
|
|
|
- // this.$axios
|
|
|
|
- // .post('/uk-api/quote/sendenquiry', {
|
|
|
|
- // content: this.$refs.mailtable.$el.innerHTML,
|
|
|
|
- // name: Name,
|
|
|
|
- // email: Email,
|
|
|
|
- // phone: Phone,
|
|
|
|
- // customer_manager: customerManager || '',
|
|
|
|
- // url: this.mailData.Url,
|
|
|
|
- // product_code: this.pageData.product_code,
|
|
|
|
- // comments: Comments,
|
|
|
|
- // member_id: this.userInfo.id,
|
|
|
|
- // })
|
|
|
|
- // .then(res => {
|
|
|
|
- // this.setLoading(false)
|
|
|
|
- // this.enquiryFormVisible = false
|
|
|
|
- // this.$confirm('Enquiry Sent', {
|
|
|
|
- // confirmButtonText: 'OK',
|
|
|
|
- // showCancelButton: false,
|
|
|
|
- // type: 'success',
|
|
|
|
- // center: true,
|
|
|
|
- // showClose: false,
|
|
|
|
- // confirmButtonClass: 'com-btnblack',
|
|
|
|
- // }).then(() => {})
|
|
|
|
- // })
|
|
|
|
- // .catch(() => {
|
|
|
|
- // this.setLoading(false)
|
|
|
|
- // })
|
|
|
|
- // },
|
|
|
|
- // getCustomerQuoteData() {
|
|
|
|
- // const { name, selectAdditionRow } = this.comCurWeekPrice
|
|
|
|
- // this.specificationsObj.time = name
|
|
|
|
- // this.specificationsObj.model = this.comBasePrice.model
|
|
|
|
- // this.specificationsObj.decoration = this.comCurBasePrice.name
|
|
|
|
- // if (selectAdditionRow.length) {
|
|
|
|
- // this.specificationsObj.addonArr = selectAdditionRow.map(
|
|
|
|
- // item => item.name
|
|
|
|
- // )
|
|
|
|
- // } else {
|
|
|
|
- // this.specificationsObj.addonArr = null
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
|
|
+ async sendPriceMail() {
|
|
|
|
+ await this.getMailData()
|
|
|
|
+ await this.getCustomerQuoteData()
|
|
|
|
+ const {
|
|
|
|
+ Name,
|
|
|
|
+ Email,
|
|
|
|
+ Phone,
|
|
|
|
+ Comments,
|
|
|
|
+ 'Customer manager': customerManager,
|
|
|
|
+ } = this.enquiryForm
|
|
|
|
+ this.$axios
|
|
|
|
+ .post('/uk-api/quote/sendenquiry', {
|
|
|
|
+ content: this.$refs.mailtable.$el.innerHTML,
|
|
|
|
+ name: Name,
|
|
|
|
+ email: Email,
|
|
|
|
+ phone: Phone,
|
|
|
|
+ customer_manager: customerManager || '',
|
|
|
|
+ url: this.mailData.Url,
|
|
|
|
+ product_code: this.pageData.product_code,
|
|
|
|
+ comments: Comments,
|
|
|
|
+ member_id: this.userInfo.id,
|
|
|
|
+ })
|
|
|
|
+ .then(res => {
|
|
|
|
+ this.setLoading(false)
|
|
|
|
+ this.enquiryFormVisible = false
|
|
|
|
+ this.$confirm('Enquiry Sent', {
|
|
|
|
+ confirmButtonText: 'OK',
|
|
|
|
+ showCancelButton: false,
|
|
|
|
+ type: 'success',
|
|
|
|
+ center: true,
|
|
|
|
+ showClose: false,
|
|
|
|
+ confirmButtonClass: 'com-btnblack',
|
|
|
|
+ }).then(() => {})
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ this.setLoading(false)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ getCustomerQuoteData() {
|
|
|
|
+ const { name, selectAdditionRow } = this.comCurWeekPrice
|
|
|
|
+ this.specificationsObj.time = name
|
|
|
|
+ this.specificationsObj.model = this.comBasePrice.model
|
|
|
|
+ this.specificationsObj.decoration = this.comCurBasePrice.name
|
|
|
|
+ if (selectAdditionRow.length) {
|
|
|
|
+ this.specificationsObj.addonArr = selectAdditionRow.map(
|
|
|
|
+ item => item.name
|
|
|
|
+ )
|
|
|
|
+ } else {
|
|
|
|
+ this.specificationsObj.addonArr = null
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// openDownloadDialog(type) {
|
|
// openDownloadDialog(type) {
|
|
// this.getCustomerQuoteData()
|
|
// this.getCustomerQuoteData()
|
|
// type
|
|
// type
|