{"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":1688109363933},{"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//\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\nimport fileUpload from '@/components/fileUpload/index'\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 fileUpload\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 fileList: []\r\n },\r\n rules: {\r\n location: [\r\n {\r\n required: true,\r\n message: '培训地点不能为空',\r\n trigger: 'blur'\r\n }\r\n ],\r\n pplanId: [\r\n {\r\n required: true,\r\n message: '教育培训项目不能为空',\r\n trigger: 'blur'\r\n }\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 {\r\n required: true,\r\n message: '结束时间不能为空',\r\n trigger: 'blur'\r\n }\r\n ],\r\n trainStartDate: [\r\n {\r\n required: true,\r\n message: '开始时间不能为空',\r\n trigger: 'blur'\r\n }\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 attachmentHandleFileDelete(f) {\r\n this.params.fileList = this.params.fileList.filter(item => {\r\n return item.id !== f.id\r\n })\r\n },\r\n attachmentUploadSuccess(res, file, fileList) {\r\n if (res.success) {\r\n this.params.fileList.push({\r\n name: res.fileName,\r\n id: res.fileId,\r\n url: this.previewUrl + res.fileId,\r\n extensionName: file.name.substring(\r\n file.name.lastIndexOf('.') + 1\r\n )\r\n })\r\n } else {\r\n this.$message.error('上传文件失败!')\r\n }\r\n },\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 fileList: []\r\n }\r\n },\r\n handleClose() {\r\n this.resetForm()\r\n this.$refs.formInfo.resetFields()\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 =\r\n CmgtSaftyTrainingRecordApi.addCmgtSaftyTrainingRecord\r\n } else {\r\n // 修改\r\n method =\r\n 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 this.params.fileList = this.params.fileList\r\n ? this.params.fileList\r\n : []\r\n this.params.fileList.forEach(it => {\r\n it.name = it.fileName + '.' + it.extensionName\r\n it.url = this.previewUrl + it.id\r\n })\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]}