nidapeng
2024-04-08 bd159ed37ae8ba5b1fa4af95cdb3b7981768dad9
company/src/components/enterprise/OperaInsuranceApplyWindow.vue
@@ -51,7 +51,7 @@
                <el-form-item label="投保年龄" v-if="item">
                    <span>{{item.minAge}} 至 {{item.maxAge}}</span>
                </el-form-item>
                <el-form-item label="费用" v-if="item">
                <el-form-item label="费用" v-if="item && item.type ==0">
                    <span>{{item.price}}元</span>
                    <span v-if="item.timeUnit === 0">/天</span>
                    <span v-if="item.timeUnit === 1">/半月</span>
@@ -197,7 +197,7 @@
    },
    methods: {
      successEvent() {
          let arr = JSON.parse(JSON.stringify(this.tableData))
      const arr = JSON.parse(JSON.stringify(this.tableData))
          arr.forEach(item => {
              item.idcardNo = item.idCard
          })
@@ -294,14 +294,12 @@
            columns.forEach((column, index) => {
                if (index === 0) {
                    sums[index] = '总价'
                    return
                } else if (index === 7) {
                    let total = 0
                    this.tableData.forEach(item => {
                        total += item.fee
                    })
                    sums[index] = total
                    return
                }
            })
            return sums
@@ -336,19 +334,21 @@
                    }
                    let price = 0
          if (this.item && this.item.type != 1) {
                    this.tableData.forEach(item => {
                        price = price + item.fee
                    })
          }
                    this.$refs.detailsPolicyholder.open('投保详情单', {
                        companyName: this.userInfo.company.name,
                        solutionName: this.item.name,
            solutionType: this.item.type,
                        applyStartTime: this.form.applyStartTime,
                        applyEndTime: this.form.applyEndTime,
                        insureNum: this.tableData.length,
                        totalPrice: price,
                        detailList: this.tableData
                    })
                }
            })
        },
@@ -367,30 +367,30 @@
            })
        },
        getDate(n) { // n为多少天,-代表往前,+代表往后
            let date1 = new Date(),
            time1 = date1.getFullYear() + "-" + (date1.getMonth() + 1) + "-" + date1.getDate();//time1表示当前时间
            let date2 = new Date(date1);
            date2.setDate(date1.getDate() + n);
            let time2 = date2.getFullYear() + "-" + ("0" + (date2.getMonth() + 1)).slice(-2) + "-" + ("0" + date2.getDate()).slice(-2);
      const date1 = new Date()
      const time1 = date1.getFullYear() + '-' + (date1.getMonth() + 1) + '-' + date1.getDate()// time1表示当前时间
      const date2 = new Date(date1)
      date2.setDate(date1.getDate() + n)
      const time2 = date2.getFullYear() + '-' + ('0' + (date2.getMonth() + 1)).slice(-2) + '-' + ('0' + date2.getDate()).slice(-2)
            return time2
        },
        updatePickerOptions() {
          var that = this;
      var that = this
            this.pickerOptions = {
                disabledDate(time) {
                    if (!that.item) return
                    if (that.item.validType === 1) {
                        // 次月
                        const currentDate = new Date();
                        currentDate.setMonth(currentDate.getMonth() + 1);
                        currentDate.setDate(1);
                        return time.getTime() <= new Date(currentDate.toLocaleString()).getTime() - 8.64e7;
            const currentDate = new Date()
            currentDate.setMonth(currentDate.getMonth() + 1)
            currentDate.setDate(1)
            return time.getTime() <= new Date(currentDate.toLocaleString()).getTime() - 8.64e7
                    } else if (that.item.validType === 0) {
                        // 多少日后生效
                        return time.getTime() <= new Date(that.getDate(that.item.validTypeNum - 1)).getTime();
            return time.getTime() <= new Date(that.getDate(that.item.validTypeNum - 1)).getTime()
                    }
                }
            };
      }
        },
        seleUser() {
            if (!this.form.solutionId) {
@@ -415,12 +415,12 @@
      },
      // 切换方案
      changeSolution(e) {
      this.form.applyEndTime = ''
      this.form.applyStartTime = ''
          if (!this.form.id) {
              this.tableData = []
          } else {
              this.price = ''
              this.form.applyEndTime = ''
              this.form.applyStartTime = ''
              this.tableData.forEach(item => {
                  item.fee = ''
                  item.duName = ''
@@ -433,6 +433,9 @@
              if (item.id === e) {
                  // this.price = item.price
                  this.item = item
          if(this.item && this.item.type==1){
            this.item.fee=0
          }
                  this.updatePickerOptions()
              }
          })
@@ -449,6 +452,9 @@
                        if (item.id === res.id) {
                            // this.price = item.price
                            this.item = item
              if(this.item && this.item.type==1){
                this.item.fee=0
              }
                            this.updatePickerOptions()
                        }
                    })
@@ -472,7 +478,7 @@
              })
          })
          this.seleData = []
          this.$refs.multipleTable.clearSelection();
      this.$refs.multipleTable.clearSelection()
      },
      // 选择员工
      sele() {
@@ -559,5 +565,8 @@
        width: 100%;
        font-size: 14px;
        color: black;
      span{
        display: block;
      }
    }
</style>