zenglf
2023-09-28 997835429a1d66643364091e8437ebbbeb8ff97a
src/views/mdc/base/modules/shift/ShiftInfoModel.vue
@@ -169,7 +169,11 @@
            // }
            //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
          }else{
            this.$message.warning(res.message)
            // this.$message.warning(res.message)
            this.$notification.warning({
              message:'消息',
              description:res.message
            });
          }
        }).finally(() => {
          this.loading = false
@@ -221,7 +225,6 @@
        const that = this
        // 触发表单验证
        this.form.validateFields((err, values) => {
          console.log(values);
          if (!err) {
            // debugger
            that.confirmLoading = true
@@ -229,13 +232,24 @@
            formData.isDaySpan = that.isDaySpan
            console.log(formData.isDaySpan);
            if(formData.isDaySpan == false){
              let startTime = moment(formData.startDate).format('HH:mm:ss');
              let endTime = moment(formData.endDate).format('HH:mm:ss');
              let startTimeOne = startTime.replace(/:/g,'');
              let endTimeOne = endTime.replace(/:/g,'');
              if(startTimeOne>endTimeOne){
                that.$message.warning("非跨天班次结束时间不能小于等于开始时间!")
                that.$message.success("保存失败")
              formData.startDate = moment(formData.startDate).format('HH:mm:ss');
              formData.endDate = moment(formData.endDate).format('HH:mm:ss');
              formData.sleepStartDate = moment(formData.sleepStartDate).format('HH:mm:ss');
              formData.sleepEndDate = moment(formData.sleepEndDate).format('HH:mm:ss');
              let startTimeOne = formData.startDate.replace(/:/g,'');
              let endTimeOne = formData.endDate.replace(/:/g,'');
              if(startTimeOne > endTimeOne){
                // that.$message.warning("非跨天班次结束时间不能小于等于开始时间!")
                that.$notification.warning({
                  message:'消息',
                  description:"非跨天班次结束时间不能小于等于开始时间!"
                });
                // that.$message.success("保存失败")
                that.$notification.error({
                  message:'消息',
                  description:"保存失败!"
                });
                that.confirmLoading = false
                that.close()
              }else{
                formData.shiftSubStatus = 1
@@ -249,10 +263,18 @@
                }
                obj.then((res) => {
                  if (res.success) {
                    that.$message.success("保存成功")
                    // that.$message.success("保存成功")
                    that.$notification.success({
                      message:'消息',
                      description:"保存成功"
                    });
                    that.$emit('ok', res.result)
                  } else {
                    that.$message.warning(res.message)
                    // that.$message.warning(res.message)
                    that.$notification.warning({
                      message:'消息',
                      description:res.message
                    });
                  }
                }).finally(() => {
                  that.confirmLoading = false
@@ -271,10 +293,18 @@
              }
              obj.then((res) => {
                if (res.success) {
                  that.$message.success("保存成功")
                  // that.$message.success
                  that.$notification.success({
                    message:'消息',
                    description:"保存成功"
                  });
                  that.$emit('ok', res.result)
                } else {
                  that.$message.warning(res.message)
                  // that.$message.warning(res.message)
                  that.$notification.warning({
                    message:'消息',
                    description:res.message
                  });
                }
              }).finally(() => {
                that.confirmLoading = false