diff --git a/pages/index/self-support/companyQuote.vue b/pages/index/self-support/companyQuote.vue index 6b02b6b..1344085 100644 --- a/pages/index/self-support/companyQuote.vue +++ b/pages/index/self-support/companyQuote.vue @@ -7,11 +7,11 @@ + class="server-item my-20 flex flex-col justify-start items-start"> - 服务内容:{{ item.name }} + {{ item.name }} 业务编号: {{ @@ -19,21 +19,27 @@ }} - + 服务服务项目: - + {{ item.contents[item.contentIndex].amount }}元/次 - + + + 元/次 + - 备注: {{ item.remark }} + 备注: {{ item.remark }} + + 请您要选择的产品 + @@ -203,4 +209,43 @@ export default { } } } - \ No newline at end of file + + + + \ No newline at end of file diff --git a/pages/index/self-support/productQuote.vue b/pages/index/self-support/productQuote.vue index 1470de6..823b346 100644 --- a/pages/index/self-support/productQuote.vue +++ b/pages/index/self-support/productQuote.vue @@ -1,189 +1,233 @@ \ No newline at end of file + 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 + } + } + } + + + \ No newline at end of file