From d2bc6e096f0806b78ea92d4b90a21d3627d406c7 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期五, 08 三月 2024 18:28:42 +0800
Subject: [PATCH] mrshi
---
company/src/components/enterprise/OperaInsuranceApplyWindow.vue | 109 +++++++++++++++++++++++++++++++++---------------------
1 files changed, 67 insertions(+), 42 deletions(-)
diff --git a/company/src/components/enterprise/OperaInsuranceApplyWindow.vue b/company/src/components/enterprise/OperaInsuranceApplyWindow.vue
index 9dbd1e4..b6ed940 100644
--- a/company/src/components/enterprise/OperaInsuranceApplyWindow.vue
+++ b/company/src/components/enterprise/OperaInsuranceApplyWindow.vue
@@ -138,6 +138,8 @@
<importEmployees ref="importEmployees" @result="getValue" />
<!-- 纭宸ョ -->
<confirmJobType ref="confirmJobType" @result="getUser" />
+ <!-- 鏌ョ湅璇﹀崟 -->
+ <detailsPolicyholder ref="detailsPolicyholder" @success="successEvent" />
</GlobalWindow>
</template>
@@ -148,12 +150,14 @@
import addEmployee from '@/components/enterprise/addEmployee'
import importEmployees from '@/components/enterprise/importEmployees'
import confirmJobType from '@/components/enterprise/confirmJobType'
+import detailsPolicyholder from '@/components/business/detailsPolicyholder'
import { all, getNewVersion } from '@/api/business/solutions'
+import { mapState } from 'vuex'
import { create, getCountCyclePriceVO, getDetail, findList, updateData } from '@/api/business/insuranceApply'
export default {
name: 'OperaInsuranceApplyWindow2',
extends: BaseOpera,
- components: { GlobalWindow, selectEmployees, addEmployee, importEmployees, confirmJobType },
+ components: { GlobalWindow, selectEmployees, addEmployee, importEmployees, confirmJobType, detailsPolicyholder },
data () {
return {
form: {
@@ -163,6 +167,7 @@
applyStartTime: '',
applyEndTime: ''
},
+ solutionName: '',
type: '',
pickerOptions: {}, // 瀛樻斁picker options鐨勫彉閲�
price: '',
@@ -187,7 +192,52 @@
'field.id': 'id'
})
},
+ computed: {
+ ...mapState(['userInfo'])
+ },
methods: {
+ successEvent() {
+ let arr = JSON.parse(JSON.stringify(this.tableData))
+ arr.forEach(item => {
+ item.idcardNo = item.idCard
+ })
+ this.isWorking = true
+ // if (!this.form.id) {
+ create({
+ applyDetailList: arr,
+ applyStartTime: this.form.applyStartTime,
+ applyEndTime: this.form.applyEndTime,
+ solutionId: this.form.solutionId
+ }).then(() => {
+ this.visible = false
+ this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
+ this.$emit('success')
+ })
+ .catch(e => {
+ this.$tip.apiFailed(e)
+ })
+ .finally(() => {
+ this.isWorking = false
+ })
+ // } else {
+ // updateData({
+ // id: this.form.id,
+ // applyDetailList: arr,
+ // applyStartTime: this.form.applyStartTime,
+ // applyEndTime: this.form.applyEndTime,
+ // solutionId: this.form.solutionId
+ // }).then(() => {
+ // this.visible = false
+ // this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
+ // this.$emit('success')
+ // }).catch(e => {
+ // this.$tip.apiFailed(e)
+ // })
+ // .finally(() => {
+ // this.isWorking = false
+ // })
+ // }
+ },
open (title, target) {
this.title = title
this.tableData = []
@@ -277,52 +327,27 @@
return
}
for (let i = 0; i < this.tableData.length; i++) {
- console.log(this.tableData[i].worktypeId, this.tableData[i].duId)
+ console.log(this.tableData[i].worktypeId)
+ console.log(this.tableData[i].duId)
if (!this.tableData[i].worktypeId || !this.tableData[i].duId) {
this.$message.warning('璇峰畬鍠勬淳閬e崟浣嶅拰宸ョ淇℃伅')
return
}
}
- let arr = JSON.parse(JSON.stringify(this.tableData))
- arr.forEach(item => {
- item.idcardNo = item.idCard
+
+ let price = 0
+ this.tableData.forEach(item => {
+ price = price + item.fee
})
- this.isWorking = true
- if (!this.form.id) {
- create({
- applyDetailList: arr,
- applyStartTime: this.form.applyStartTime,
- applyEndTime: this.form.applyEndTime,
- solutionId: this.form.solutionId
- }).then(() => {
- this.visible = false
- this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
- this.$emit('success')
- })
- .catch(e => {
- this.$tip.apiFailed(e)
- })
- .finally(() => {
- this.isWorking = false
- })
- } else {
- updateData({
- id: this.form.id,
- applyDetailList: arr,
- applyStartTime: this.form.applyStartTime,
- applyEndTime: this.form.applyEndTime,
- solutionId: this.form.solutionId
- }).then(() => {
- this.visible = false
- this.$tip.apiSuccess('鎿嶄綔鎴愬姛')
- this.$emit('success')
- }).catch(e => {
- this.$tip.apiFailed(e)
- })
- .finally(() => {
- this.isWorking = false
- })
- }
+ this.$refs.detailsPolicyholder.open('鎶曚繚璇︽儏鍗�', {
+ companyName: this.userInfo.company.name,
+ solutionName: this.item.name,
+ applyStartTime: this.form.applyStartTime,
+ applyEndTime: this.form.applyEndTime,
+ insureNum: this.tableData.length,
+ totalPrice: price,
+ detailList: this.tableData
+ })
}
})
@@ -386,7 +411,7 @@
this.$message.warning('璇峰厛閫夋嫨淇濋櫓鏂规')
return
}
- this.$refs.importEmployees.open('涓婁紶鍚嶅崟', { arr: this.tableData, price: this.price })
+ this.$refs.importEmployees.open('涓婁紶鍚嶅崟', { arr: this.tableData, solutionId: this.form.solutionId, type: 1, price: this.price })
},
// 鍒囨崲鏂规
changeSolution(e) {
--
Gitblit v1.9.3