{"remainingRequest":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Manage\\saftyTraining\\components\\CmgtSaftyTrainingRecordFormDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Manage\\saftyTraining\\components\\CmgtSaftyTrainingRecordFormDialog.vue","mtime":1686644562601},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport CmgtSaftyTrainingPlanApi from '@/views/Manage/saftyTraining/api/CmgtSaftyTrainingPlanApi'\r\nimport CmgtSaftyTrainingRecordApi from '@/views/Manage/saftyTraining/api/CmgtSaftyTrainingRecordApi'\r\nimport dictContracts from '@/components/dict/DictSelectUtils.js'\r\nimport CommonApi from '@/views/Manage/CommonApi.js'\r\nimport {mapState} from 'vuex'\r\n\r\nimport CmgtSaftyTrainingRecordDetailChildTable from './CmgtSaftyTrainingRecordDetailChildTable.vue'\r\n\r\nexport default {\r\n name: 'CmgtSaftyTrainingRecordFormDialog',\r\n props: {},\r\n components: {\r\n CmgtSaftyTrainingRecordDetailChildTable\r\n },\r\n data() {\r\n return {\r\n TrainingPlanData: [],\r\n title: '新增',\r\n CommonApi,\r\n showFormDia: false,\r\n loading: false,\r\n activeCollapseNames: ['1'],\r\n activeTabChildName: '0',\r\n\r\n trainingProjectIdSelectOptions: [],\r\n teacherSelectOptions: [],\r\n trainingPlanIdSelectOptions: [],\r\n traineeSelectOptions: [],\r\n traineeSelectLoading: false,\r\n params: {\r\n content: '',\r\n location: '',\r\n pplanId: '',\r\n summary: '',\r\n teacher: '',\r\n trainEndDate: '',\r\n trainStartDate: '',\r\n trainee: ''\r\n },\r\n rules: {\r\n location: [\r\n {required: true, message: '培训地点不能为空', trigger: 'blur'}\r\n ],\r\n pplanId: [\r\n {required: true, message: '教育培训项目不能为空', trigger: 'blur'}\r\n ],\r\n summary: [\r\n {required: true, message: '培训总结不能为空', trigger: 'blur'}\r\n ],\r\n teacher: [\r\n {required: true, message: '培训讲师不能为空', trigger: 'blur'}\r\n ],\r\n trainEndDate: [\r\n {required: true, message: '结束时间不能为空', trigger: 'blur'}\r\n ],\r\n trainStartDate: [\r\n {required: true, message: '开始时间不能为空', trigger: 'blur'}\r\n ],\r\n trainee: [\r\n {required: true, message: '培训对象不能为空', trigger: 'blur'}\r\n ],\r\n content: [\r\n {required: true, message: '培训课程内容不能为空', trigger: 'blur'}\r\n ]\r\n }\r\n }\r\n },\r\n computed: mapState({\r\n header: state => {\r\n return {\r\n Authorization: `Bearer ${state.login.currentUser.token}`\r\n }\r\n }\r\n }),\r\n created() {\r\n // CommonApi.loadSelectOptions(\r\n // {name: 'cmgtSaftySelectOptions.getCmgtSaftyTrainingProjects'},\r\n // res => {\r\n // this.trainingProjectIdSelectOptions = res\r\n // }\r\n // )\r\n // CommonApi.loadSelectOptions(\r\n // {name: 'cmgtSaftySelectOptions.getUsers'},\r\n // res => {\r\n // // console.log(res)\r\n // this.teacherSelectOptions = res\r\n // }\r\n // )\r\n // CommonApi.loadSelectOptions(\r\n // {name: 'cmgtSaftySelectOptions.getCmgtSaftyTrainingPlans'},\r\n // res => {\r\n // this.trainingPlanIdSelectOptions = res\r\n // }\r\n // )\r\n this.TrainingPlan()\r\n },\r\n methods: {\r\n handleSelectChange(val) {\r\n console.log(val)\r\n this.TrainingPlanData.map(item => {\r\n console.log(item)\r\n if (val == item.id) {\r\n this.params.content = item.content\r\n this.params.location = item.location\r\n this.params.trainEndDate = item.trainingEndDate\r\n this.params.trainStartDate = item.trainingStartDate\r\n this.params.trainee = item.participant\r\n }\r\n })\r\n },\r\n TrainingPlan() {\r\n CmgtSaftyTrainingPlanApi.loadCmgtSaftyTrainingPlan(\r\n {\r\n groupTree: {},\r\n pageBean: {\r\n page: 1,\r\n pageSize: 10,\r\n showTotal: true\r\n }\r\n },\r\n res => {\r\n console.log(res, 'res')\r\n this.TrainingPlanData = res.rows\r\n }\r\n )\r\n },\r\n\r\n traineeSelectRemoteMethod(query) {\r\n this.traineeSelectLoading = true\r\n CommonApi.loadSelectOptions(\r\n {name: 'cmgtSaftySelectOptions.getUsers', query: query},\r\n res => {\r\n this.traineeSelectLoading = false\r\n this.traineeSelectOptions = res\r\n }\r\n )\r\n },\r\n add() {\r\n this.title = '新增'\r\n this.resetForm()\r\n this.showFormDia = true\r\n },\r\n resetForm() {\r\n this.params = {\r\n content: '',\r\n location: '',\r\n pplanId: '',\r\n summary: '',\r\n teacher: '',\r\n trainEndDate: '',\r\n trainStartDate: '',\r\n trainee: ''\r\n }\r\n },\r\n handleClose() {\r\n this.resetForm()\r\n this.showFormDia = false\r\n },\r\n handleSave() {\r\n this.$refs.formInfo.validate(valid => {\r\n if (valid) {\r\n let method\r\n if (!this.params.id) {\r\n // 新增\r\n method = CmgtSaftyTrainingRecordApi.addCmgtSaftyTrainingRecord\r\n } else {\r\n // 修改\r\n method = CmgtSaftyTrainingRecordApi.editCmgtSaftyTrainingRecord\r\n }\r\n this.loading = true\r\n method(this.params, res => {\r\n this.loading = false\r\n if (res.state) {\r\n this.$notify({\r\n type: 'success',\r\n message: this.title + '成功',\r\n duration: 2000\r\n })\r\n //this.$emit('loadData')\r\n this.$parent.loadData()\r\n this.handleClose()\r\n } else {\r\n this.$message.warning(res.message)\r\n }\r\n })\r\n }\r\n })\r\n },\r\n Update(row) {\r\n CmgtSaftyTrainingRecordApi.cmgtWorkWarnSendDetailId(row.id, res => {\r\n this.params = res\r\n })\r\n this.title = '修改'\r\n this.showFormDia = true\r\n // this.params = row\r\n }\r\n }\r\n}\r\n",null]}