|  | @@ -17,22 +17,24 @@
 | 
	
		
			
				|  |  |                </el-form-item>
 | 
	
		
			
				|  |  |              </el-col>
 | 
	
		
			
				|  |  |              <el-col :span="12">
 | 
	
		
			
				|  |  | -              <el-form-item  prop="drillStartTime" label="培训开始时间">
 | 
	
		
			
				|  |  | -                <el-date-picker style="width: 100%;" required v-model="formData.drillStartTime" :picker-options="startDatepickerOptions"
 | 
	
		
			
				|  |  | -                                type="datetime" placeholder="选择日期"  @change="startDateChanged">
 | 
	
		
			
				|  |  | +              <el-form-item prop="drillStartTime" label="培训开始时间">
 | 
	
		
			
				|  |  | +                <el-date-picker style="width: 100%;" required v-model="formData.drillStartTime"
 | 
	
		
			
				|  |  | +                                :picker-options="startDatepickerOptions"
 | 
	
		
			
				|  |  | +                                type="datetime" placeholder="选择日期" @change="startDateChanged">
 | 
	
		
			
				|  |  |                  </el-date-picker>
 | 
	
		
			
				|  |  |                </el-form-item>
 | 
	
		
			
				|  |  |              </el-col>
 | 
	
		
			
				|  |  |              <el-col :span="12">
 | 
	
		
			
				|  |  |                <el-form-item prop="drillEndTime" label="培训结束时间">
 | 
	
		
			
				|  |  | -                <el-date-picker style="width: 100%;" required v-model="formData.drillEndTime" :picker-options="endDatepickerOptions" @change="endDateChanged"
 | 
	
		
			
				|  |  | +                <el-date-picker style="width: 100%;" required v-model="formData.drillEndTime"
 | 
	
		
			
				|  |  | +                                :picker-options="endDatepickerOptions" @change="endDateChanged"
 | 
	
		
			
				|  |  |                                  type="datetime" placeholder="选择日期">
 | 
	
		
			
				|  |  |                  </el-date-picker>
 | 
	
		
			
				|  |  |                </el-form-item>
 | 
	
		
			
				|  |  |              </el-col>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |              <el-col :span="12">
 | 
	
		
			
				|  |  | -              <el-form-item  prop="drillSite" label="演练地点">
 | 
	
		
			
				|  |  | +              <el-form-item prop="drillSite" label="演练地点">
 | 
	
		
			
				|  |  |                  <el-input style="width: 100%;" v-model="formData.drillSite" placeholder="请输入演练地点" :length="50"/>
 | 
	
		
			
				|  |  |                </el-form-item>
 | 
	
		
			
				|  |  |              </el-col>
 | 
	
	
		
			
				|  | @@ -91,20 +93,38 @@
 | 
	
		
			
				|  |  |                  </imgUpload>
 | 
	
		
			
				|  |  |                </el-form-item>
 | 
	
		
			
				|  |  |              </el-col>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            <el-col :span="24">
 | 
	
		
			
				|  |  | +              <el-form-item v-if="formData.status==2" prop="commentScore" label="评分">
 | 
	
		
			
				|  |  | +                <el-rate
 | 
	
		
			
				|  |  | +                  :max="10"
 | 
	
		
			
				|  |  | +                  v-model="formData.commentScore"
 | 
	
		
			
				|  |  | +                >
 | 
	
		
			
				|  |  | +                </el-rate>
 | 
	
		
			
				|  |  | +              </el-form-item>
 | 
	
		
			
				|  |  | +            </el-col>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            <el-col :span="24">
 | 
	
		
			
				|  |  | +              <el-form-item v-if="formData.status==2" prop="comment" label="评语">
 | 
	
		
			
				|  |  | +                <k-textarea v-model="formData.comment" placeholder="请输入评语" :length="200"/>
 | 
	
		
			
				|  |  | +              </el-form-item>
 | 
	
		
			
				|  |  | +            </el-col>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |            </el-row>
 | 
	
		
			
				|  |  |          </el-form>
 | 
	
		
			
				|  |  |        </div>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |        <div slot="footer" class="dialog-footer">
 | 
	
		
			
				|  |  |          <el-button @click="onHide">取消</el-button>
 | 
	
		
			
				|  |  | -        <el-button type="primary" @click="onSave">暂存</el-button>
 | 
	
		
			
				|  |  | -        <el-button type="primary" @click="onSubmit">提交</el-button>
 | 
	
		
			
				|  |  | +        <el-button v-if="formData.status!=2" type="primary" @click="onSave">暂存</el-button>
 | 
	
		
			
				|  |  | +        <el-button v-if="formData.status!=2" type="primary" @click="onSubmit">提交</el-button>
 | 
	
		
			
				|  |  | +        <el-button v-if="formData.status==2" type="primary" @click="onEvaluate">评价</el-button>
 | 
	
		
			
				|  |  |        </div>
 | 
	
		
			
				|  |  |      </DialogCom>
 | 
	
		
			
				|  |  |      <dialog-drill-dictionary-select
 | 
	
		
			
				|  |  |        ref="DialogDrillDictionarySelect"
 | 
	
		
			
				|  |  |        :defaultSelect=defaultSelect
 | 
	
		
			
				|  |  | -      @select="materialsSelect"
 | 
	
		
			
				|  |  | +      @select="drillDictionarySelect"
 | 
	
		
			
				|  |  |        :orgId="this.$store.getters.orgId"
 | 
	
		
			
				|  |  |      ></dialog-drill-dictionary-select>
 | 
	
		
			
				|  |  |    </div>
 | 
	
	
		
			
				|  | @@ -112,7 +132,7 @@
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  <script>
 | 
	
		
			
				|  |  |  import {mapState, mapMutations} from "vuex";
 | 
	
		
			
				|  |  | -import {getDrillTask, recordDrillTask} from "@/api/core/drill/drillTask";
 | 
	
		
			
				|  |  | +import {evaluateDrillTask, getDrillTask, recordDrillTask} from "@/api/core/drill/drillTask";
 | 
	
		
			
				|  |  |  import dayjs from "dayjs";
 | 
	
		
			
				|  |  |  import KTextarea from "@/components/common/textarea.vue";
 | 
	
		
			
				|  |  |  import KSelect from "@/components/common/userselect.vue";
 | 
	
	
		
			
				|  | @@ -121,7 +141,7 @@ import KFileUpload from "@/components/K-FileUpload/index.vue";
 | 
	
		
			
				|  |  |  import DialogDrillDictionarySelect from "@/views/core/drill/task/dialog.select.drillDictionary.vue";
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  | -  components: {KTextarea, KSelect, imgUpload,KFileUpload,DialogDrillDictionarySelect},
 | 
	
		
			
				|  |  | +  components: {KTextarea, KSelect, imgUpload, KFileUpload, DialogDrillDictionarySelect},
 | 
	
		
			
				|  |  |    dicts: ['core_drill_type'],
 | 
	
		
			
				|  |  |    data() {
 | 
	
		
			
				|  |  |      const params = this.$route.params;
 | 
	
	
		
			
				|  | @@ -216,7 +236,7 @@ export default {
 | 
	
		
			
				|  |  |            response.data.fileList = [];
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          this.formData = response.data;
 | 
	
		
			
				|  |  | -        this.formFileListDefualtValue=response.data.fileList;
 | 
	
		
			
				|  |  | +        this.formFileListDefualtValue = response.data.fileList;
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |        console.log("getDrillTask", this.formData);
 | 
	
		
			
				|  |  |      },
 | 
	
	
		
			
				|  | @@ -274,7 +294,7 @@ export default {
 | 
	
		
			
				|  |  |        this.isShow = false;
 | 
	
		
			
				|  |  |        this.formData = this.reset();
 | 
	
		
			
				|  |  |        this.$refs["uploadimage"].clearFiles();
 | 
	
		
			
				|  |  | -      this.formFileListDefualtValue=[];
 | 
	
		
			
				|  |  | +      this.formFileListDefualtValue = [];
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      async onSave() {
 | 
	
		
			
				|  |  |        if (!this.validatePerson()) {
 | 
	
	
		
			
				|  | @@ -318,11 +338,11 @@ export default {
 | 
	
		
			
				|  |  |          delete request.absenceList;
 | 
	
		
			
				|  |  |          delete request.absentList;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        if (request.drillStartTime){
 | 
	
		
			
				|  |  | +        if (request.drillStartTime) {
 | 
	
		
			
				|  |  |            request.drillStartTime = dayjs(request.drillStartTime).format("YYYY-MM-DD HH:mm:ss");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        if (request.drillEndTime){
 | 
	
		
			
				|  |  | +        if (request.drillEndTime) {
 | 
	
		
			
				|  |  |            request.drillEndTime = dayjs(request.drillEndTime).format("YYYY-MM-DD HH:mm:ss");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -333,6 +353,27 @@ export default {
 | 
	
		
			
				|  |  |          });
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    async onEvaluate() {
 | 
	
		
			
				|  |  | +      console.log("onEvaluate", this.formData)
 | 
	
		
			
				|  |  | +      if (!this.formData.commentScore) {
 | 
	
		
			
				|  |  | +        this.$message.error("请选择评分!");
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      if (!this.formData.comment) {
 | 
	
		
			
				|  |  | +        this.$message.error("请输入评语!");
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      let { commentScore,comment,id} = { ...this.formData};
 | 
	
		
			
				|  |  | +      let json={};
 | 
	
		
			
				|  |  | +      json.score = commentScore;
 | 
	
		
			
				|  |  | +      json.comment = comment;
 | 
	
		
			
				|  |  | +      json.taskId = id;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      evaluateDrillTask(json).then((v) => {
 | 
	
		
			
				|  |  | +        this.$emit("success", this.formData);
 | 
	
		
			
				|  |  | +        this.onHide();
 | 
	
		
			
				|  |  | +        this.$modal.msgSuccess("演练登记评价成功");
 | 
	
		
			
				|  |  | +      });
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      validatePerson() {
 | 
	
		
			
				|  |  |        for (let i = 0; i < this.formData.absenceList.length; i++) {
 | 
	
		
			
				|  |  |          let absence = this.formData.absenceList[i];
 | 
	
	
		
			
				|  | @@ -358,10 +399,10 @@ export default {
 | 
	
		
			
				|  |  |        return time.getTime() < new Date(startDate).getTime();
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      endDateChanged(time) {
 | 
	
		
			
				|  |  | -      console.log("startDateChanged",time,this.formData.drillStartTime ,this.formData.drillEndTime)
 | 
	
		
			
				|  |  | +      console.log("startDateChanged", time, this.formData.drillStartTime, this.formData.drillEndTime)
 | 
	
		
			
				|  |  |        if (dayjs(this.formData.drillStartTime).isAfter(dayjs(this.formData.drillEndTime))) {
 | 
	
		
			
				|  |  |          this.formData.drillStartTime = this.formData.drillEndTime;
 | 
	
		
			
				|  |  | -        console.log("trainingEndDateTime",this.formData.drillEndTime)
 | 
	
		
			
				|  |  | +        console.log("trainingEndDateTime", this.formData.drillEndTime)
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      startDateChanged(time) {
 | 
	
	
		
			
				|  | @@ -381,15 +422,14 @@ export default {
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      selectMaterials() {
 | 
	
		
			
				|  |  | -      this.$refs["DialogDrillDictionarySelect"].show();
 | 
	
		
			
				|  |  | +      console.log("selectMaterials", this.formData)
 | 
	
		
			
				|  |  | +      this.$refs["DialogDrillDictionarySelect"].show(this.formData.type);
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -    materialsSelect(){
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +    drillDictionarySelect(data) {
 | 
	
		
			
				|  |  | +      this.formData.presetCase = data[0].defaultCause;
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    mounted() {
 |