MrShi
2024-03-05 6f1ad9bcb73a415f1d45f1adc6bdeb3e80ddf95f
company/src/components/enterprise/factoryChange.vue
@@ -77,7 +77,7 @@
                <el-table-column
                    prop="currentFee"
                    align="center"
                    label="产生费用(元)">
                    label="已产生费用(元)">
                </el-table-column>
                <el-table-column
                    prop="fee"
@@ -147,7 +147,7 @@
            <span v-if="item.ortherInfo">{{item.ortherInfo}}</span>
        </div>
        <!--    选择员工    -->
        <selectEmployees ref="selectEmployees" @result="getValue" />
        <selectEmployees ref="selectEmployees" @result="getValue1" />
        <!--    添加员工    -->
        <addEmployee ref="addEmployee" @result="getValue" />
        <!--    导入名单    -->
@@ -181,6 +181,7 @@
                    applyEndTime: '',
                    factory: []
                },
                newVersionSolutionId: '',
                pickerOptions: {},
                price: '',
                endTime: '',    //    实际保险生效止期
@@ -208,6 +209,7 @@
                this.form.addDetailList = []
                this.form.delDetailList = []
                this.list = []
                this.form.factory = []
                this.form.id = null
                this.item = null
                this.form.solutionId = ''
@@ -252,14 +254,16 @@
                    })
                getDetail(this.form.id)
                    .then(res => {
                        console.log(res)
                        this.list.push(res)
                        this.endTime = res.endTime
                        this.form.solutionId = res.solutionId
                        this.newVersionSolutionId = res.newVersionSolutionId
                        this.form.solutionsName = res.solutionsName
                        this.pickerOptions = {
                            disabledDate(time) {
                                // - 8.64e7
                                return time.getTime() > new Date(res.endTime).getTime() || time.getTime() < new Date().getTime()
                                return time.getTime() > new Date(res.endTime).getTime() || time.getTime() < new Date(res.lastChangeDate ? res.lastChangeDate : res.startTime).getTime()
                            }
                        };
                        this.changeSolution1(res.solutionId)
@@ -321,7 +325,11 @@
                    this.$message.warning('请先选择保险方案')
                    return
                }
                this.$refs.selectEmployees.open('选取员工', { arr: this.form.delDetailList, price: this.price, insuranceApplyId: this.form.id })
                if (!this.form.applyStartTime) {
                    this.$message.warning('请先选择批单生效起期')
                    return
                }
                this.$refs.selectEmployees.open('选取员工', { arr: this.form.delDetailList, price: this.price, insuranceApplyId: this.form.id, validTime: this.form.applyStartTime })
            },
            addUser() {
                if (!this.form.solutionId) {
@@ -376,7 +384,7 @@
                    this.$message.warning('请选择员工')
                    return
                }
                this.$refs.confirmJobType.open('确认工种', { solutionId: this.form.solutionId })
                this.$refs.confirmJobType.open('确认工种', { solutionId: this.newVersionSolutionId })
            },
            // 查询全部方案
            getCompany() {
@@ -412,6 +420,33 @@
            handleSelectionChange (e) {
                this.seleData = e.map(item => item.memberName)
            },
            // 选取员工
            getValue1 (list) {
                let arr = JSON.parse(JSON.stringify(list))
                arr.forEach(item => {
                    item.oldDuId = item.duId
                    item.oldDuName = item.duName
                    item.oldWorkTypeName = item.workTypeName
                    item.oldWorktypeId = item.worktypeId
                    item.duId = ''
                    item.duName = ''
                    item.workTypeName = ''
                    item.worktypeId = ''
                })
                for (let a = 0; a < arr.length; a++) {
                    for (let b = 0; b < this.form.factory.length; b++) {
                        if (arr[a].id === this.form.factory[b].id) {
                            this.$message.warning(`${arr[a].companyName}员工重复!`)
                            return
                        }
                    }
                }
                this.form.factory.push(...arr)
            },
            getValue(list) {
                let arr = JSON.parse(JSON.stringify(list))