src/views/mdc/base/modules/deviceCalendar/DeviceCalendarModel.vue
@@ -8,7 +8,7 @@
            <a-col :span="24">
              <a-form-item label="设备组" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
                <a-input-search :readOnly="true" v-decorator="['equipmentId', validatorRules.equipmentId]"
                                @search="deviceSearch" enter-button/>
                                @search="deviceSearch" enter-button placeholder="请选择设备"/>
              </a-form-item>
            </a-col>
          </a-row>
@@ -44,6 +44,7 @@
        </a-form>
      </a-spin>
      <device-calend-list-model ref="deviceRepairListModel" @sendSelectionRows="getDeviceRows"></device-calend-list-model>
      <select-device-modal ref="selectDeviceModal" @selectFinished="selectOK" :title="'选择设备'"/>
    </a-modal>
  </div>
</template>
@@ -62,10 +63,11 @@
  } from '@/api/api'
  import Calendar from 'vue-calendar-component';
  import SelectDeviceModal from '../../../../system/modules/SelectDeviceModal'
  export default {
    name: 'ShiftInfoModel',
    components: {DeviceCalendListModel,Calendar},
    components: { SelectDeviceModal, DeviceCalendListModel,Calendar},
    props: {},
    data() {
      return {
@@ -115,11 +117,18 @@
        },
        confirmLoading: false,        form: this.$form.createForm(this),
        validatorRules: {
          // shiftId:{
          //   rules: [{
          //     required: true, message: '请选择班制!',
          //   }],
          // },
          equipmentId:{
            rules:[
              {
                required:true,message:'请选择设备组!'
              }
            ]
          },
          shiftId:{
            rules: [{
              required: true, message: '请选择班制!',
            }],
          }
        },
        url: {
          add: '/mdc/mdcDeviceCalendar/add',
@@ -232,9 +241,10 @@
        this.value = value;
      },
      deviceSearch() {
        this.$refs.deviceRepairListModel.openPage()
        this.$refs.deviceRepairListModel.title = '选择设备'
        this.$refs.deviceRepairListModel.disableSubmit = false
        this.$refs.selectDeviceModal.visible = true
        this.$refs.selectDeviceModal.selectedRowKeys = []
        this.$refs.selectDeviceModal.selectedRows = []
        this.$refs.selectDeviceModal.checkedKeys = this.form.getFieldValue('equipmentId') ? this.form.getFieldValue('equipmentId').split(',') : []
      },
      getDeviceRows(val) {
        console.log("========",val);
@@ -300,27 +310,34 @@
          if (!err) {
            that.confirmLoading = true
            let formData = Object.assign(this.model, values)
            formData.dateList = this.sendDte
            postAction(this.url.settingCalendar, formData).then((res) => {
              if (res.success) {
                // that.$message.success(res.message)
                that.$notification.success({
                  message:'消息',
                  description:res.message
                });
                that.$emit('ok', res.result)
              } else {
                // that.$message.warning(res.message)
                that.$notification.warning({
                  message:'消息',
                  description:res.message
                });
              }
            }).finally(() => {
            if(formData.dateList&&formData.dateList.length>0){
              postAction(this.url.settingCalendar, formData).then((res) => {
                if (res.success) {
                  // that.$message.success(res.message)
                  that.$notification.success({
                    message:'消息',
                    description:res.message
                  });
                  that.$emit('ok', res.result)
                } else {
                  // that.$message.warning(res.message)
                  that.$notification.warning({
                    message:'消息',
                    description:res.message
                  });
                }
              }).finally(() => {
                that.confirmLoading = false
                that.close()
              })
            }else{
              that.confirmLoading = false
              that.close()
            })
              that.$notification.warning({
                message:'消息',
                description:'请选择生效时间!'
              });
            }
          }
        })
      },
@@ -328,6 +345,21 @@
        this.close()
      },
      /**
       * 选择已有设备后点击确定时触发
       * @param data 已选择的设备
       */
      selectOK(data) {
        // let params = {}
        // params.equipmentIdList = []
        // for (var a = 0; a < data.length; a++) {
        //   params.equipmentIdList.push(data[a])
        // }
        console.log('data=', data)
        this.form.setFieldsValue({
          equipmentId: data.join(',')
        })
      }
    }
  }
</script>
@@ -418,9 +450,11 @@
    color: #000000;
  }
  /deep/ .mainBox .wh_content_all .wh_content_item .wh_isMark {
    color: #1890ff;
    border:1px solid  #1890ff;
    border-radius: 50%;
    /*color: #1890ff;*/
    /*border:1px solid  #1890ff;*/
    /*border-radius: 50%;*/
    color: #ffffff;
    background-color: blue;
  }
  /deep/ .mainBox .wh_content_all .wh_content_item .wh_isToday {
    /*background: #33ad53;*/
@@ -431,60 +465,6 @@
</style>
<!--<style lang="scss">-->
  <!--.mark1 {-->
    <!--color: white !important;-->
    <!--background: #1890ff !important;-->
    <!--border-radius: 50%;-->
  <!--}-->
  <!--.mainBox {-->
    <!--.wh_content_all { /*主体*/-->
      <!--background-color: #ffffff;-->
      <!--border: 1px silver solid;-->
      <!--border-radius: 5px;-->
      <!--.wh_jiantou1{/*左箭头*/-->
        <!--border-top: 2px solid #000000;-->
        <!--border-left: 2px solid #000000;-->
      <!--}-->
      <!--.wh_jiantou2{/*右箭头*/-->
        <!--border-top: 2px solid #000000;-->
        <!--border-right: 2px solid #000000;-->
      <!--}-->
      <!--.wh_top_changge li { /*当前年月标题*/-->
        <!--color: black;-->
      <!--}-->
      <!--.wh_content_item {-->
        <!--margin-top: 5px;-->
        <!--.wh_top_tag{/*星期标题*/-->
          <!--color: #000000;-->
        <!--}-->
        <!--.wh_item_date {/*当前月*/-->
          <!--color: #000000;-->
        <!--}-->
        <!--.wh_item_date:hover { //悬浮-->
          <!--color: #1890ff;-->
          <!--background: #ffffff;-->
          <!--border-radius: 50%;-->
        <!--}-->
        <!--.wh_other_dayhide { /*上月和下月时间*/-->
          <!--color: #bfbfbf;-->
        <!--}-->
        <!--.wh_chose_day { //选中-->
          <!--background: #ffffff;-->
          <!--color: #000000;-->
        <!--}-->
        <!--.wh_isToday { /*当前天*/-->
          <!--/*background: #33ad53;*/-->
          <!--background: #ff4d4d;-->
          <!--color: #ffffff;-->
        <!--}-->
      <!--}-->
    <!--}-->
  <!--}-->
<!--</style>-->