MrShi
2024-03-05 84b74d64ecc519882b89278f1011f7ac7525d190
company/src/components/enterprise/additionSubtractionApplication.vue
@@ -171,6 +171,8 @@
        <importEmployees ref="importEmployees" @result="getValue" />
        <!--    确认工种    -->
        <confirmJobType ref="confirmJobType" @result="getUser" />
        <!--    详情    -->
        <ApplyChangeDetails1 ref="ApplyChangeDetails1" @success="success" />
    </GlobalWindow>
</template>
@@ -181,14 +183,16 @@
    import addEmployee from '@/components/enterprise/addEmployee'
    import importEmployees from '@/components/enterprise/importEmployees'
    import confirmJobType from '@/components/enterprise/confirmJobType'
    import ApplyChangeDetails1 from '@/components/business/ApplyChangeDetails1'
    import { all } from '@/api/business/solutions'
    import { getDetail } from '@/api/business/insuranceApply'
    import { create, getChangeCountCyclePriceVO } from '@/api/business/applyChange'
    import { getDate, compareDates, getTomorrow } from '@/utils/util'
    import { mapState } from 'vuex'
    export default {
        name: 'additionSubtractionApplication',
        extends: BaseOpera,
        components: { GlobalWindow, selectEmployees, addEmployee, importEmployees, confirmJobType },
        components: { GlobalWindow, selectEmployees, addEmployee, importEmployees, confirmJobType, ApplyChangeDetails1 },
        data () {
            return {
                form: {
@@ -215,6 +219,9 @@
                },
                list: []
            }
        },
        computed: {
            ...mapState(['userInfo'])
        },
        created () {
            this.config({
@@ -356,6 +363,34 @@
                    })
                }
            },
            success() {
                this.form.addDetailList.forEach(item => {
                    item.idcardNo = item.idCard
                })
                this.form.delDetailList.forEach(item => {
                    item.idcardNo = item.idCard
                })
                // let arr = JSON.parse(JSON.stringify(this.form.addDetailList))
                // arr.forEach(item => {
                //     item.idcardNo = item.idCard
                // })
                this.isWorking = true
                create({
                    applyId: this.form.id,
                    addDetailList: this.form.addDetailList,
                    delDetailList: this.form.delDetailList,
                    validTime: this.form.applyStartTime,
                    type: 0
                }).then(() => {
                    this.visible = false
                    this.$tip.apiSuccess('操作成功')
                    this.$emit('success')
                }).catch(e => {
                    this.$tip.apiFailed(e)
                }).finally(() => {
                    this.isWorking = false
                })
            },
            confirm() {
                this.$refs.form.validate((valid) => {
                    if (valid) {
@@ -375,32 +410,44 @@
                                return
                            }
                        }
                        this.form.addDetailList.forEach(item => {
                            item.idcardNo = item.idCard
                        this.$refs.ApplyChangeDetails1.open('加减保详单', this.form.addDetailList, this.form.delDetailList, {
                            companyName: this.userInfo.company.name,
                            solutionsName: this.form.solutionsName,
                            code: this.list[0].code,
                            startTime: this.list[0].startTime,
                            endTime: this.list[0].endTime,
                            applyStartTime: this.form.applyStartTime
                        })
                        this.form.delDetailList.forEach(item => {
                            item.idcardNo = item.idCard
                        })
                        // let arr = JSON.parse(JSON.stringify(this.form.addDetailList))
                        // arr.forEach(item => {
                        // return
                        // this.form.addDetailList.forEach(item => {
                        //     item.idcardNo = item.idCard
                        // })
                        this.isWorking = true
                        create({
                            applyId: this.form.id,
                            addDetailList: this.form.addDetailList,
                            delDetailList: this.form.delDetailList,
                            validTime: this.form.applyStartTime,
                            type: 0
                        }).then(() => {
                            this.visible = false
                            this.$tip.apiSuccess('操作成功')
                            this.$emit('success')
                        }).catch(e => {
                            this.$tip.apiFailed(e)
                        }).finally(() => {
                            this.isWorking = false
                        })
                        // this.form.delDetailList.forEach(item => {
                        //     item.idcardNo = item.idCard
                        // })
                        // // let arr = JSON.parse(JSON.stringify(this.form.addDetailList))
                        // // arr.forEach(item => {
                        // //     item.idcardNo = item.idCard
                        // // })
                        // this.isWorking = true
                        // create({
                        //     applyId: this.form.id,
                        //     addDetailList: this.form.addDetailList,
                        //     delDetailList: this.form.delDetailList,
                        //     validTime: this.form.applyStartTime,
                        //     type: 0
                        // }).then(() => {
                        //     this.visible = false
                        //     this.$tip.apiSuccess('操作成功')
                        //     this.$emit('success')
                        // }).catch(e => {
                        //     this.$tip.apiFailed(e)
                        // }).finally(() => {
                        //     this.isWorking = false
                        // })
                    }
                })
            },