{"remainingRequest":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\reform-fvue\\src\\views\\ReformPilotManage\\components\\FormResultsDialog.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\reform-fvue\\src\\views\\ReformPilotManage\\components\\FormResultsDialog.vue","mtime":1700643444999},{"path":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\reform-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\reform-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\r\nimport moment from 'moment'\r\nimport sat from '@/api/satisfaction/satisfaction'\r\nimport filePreview from '@/components/FilePreview/filePreview.vue'\r\nimport UploadFile from '@/components/uploadFile/index.vue'\r\n// import FileList from '@/components/uploadFile/newFileList.vue'\r\nimport FileList from '@/components/uploadFile/FileList.vue'\r\nconst portal = window.context.portal\r\nimport utils from '@/utils.js'\r\nexport default {\r\n name: 'FormResultsDialog',\r\n components: {\r\n filePreview,\r\n UploadFile,\r\n FileList\r\n },\r\n data() {\r\n return {\r\n dialogFormVisible: false,\r\n formLabelWidth: '120px',\r\n resultForm: {\r\n resultName: '',\r\n resultForm: '',\r\n\r\n resultDate: '',\r\n ids: [],\r\n solveProblem: '',\r\n actualEffect: '',\r\n id: ''\r\n },\r\n fileList: [],\r\n disabled: false,\r\n imgLoading: false,\r\n resultRule: {\r\n resultForm: [\r\n { required: true, message: '请选择成果形式', trigger: 'change' }\r\n ],\r\n resultDate: [\r\n {\r\n required: true,\r\n message: '请选择成果形成日期',\r\n trigger: 'change'\r\n }\r\n ],\r\n resultName: [\r\n { required: true, message: '请输入成果名称', trigger: 'blur' }\r\n ],\r\n classified: [\r\n { required: true, message: '请选择文件是否涉密', trigger: 'change' }\r\n ]\r\n },\r\n dialogImageUrl: '',\r\n dialogVisible: false,\r\n isEdit: false,\r\n // 文件是否涉密\r\n cipher: false,\r\n classified: 0,\r\n reslultIds: [],\r\n removeIds: [],\r\n isRequest: true\r\n }\r\n },\r\n methods: {\r\n getDictName(code, value) {\r\n return utils.getDictName(code, value)\r\n },\r\n // 打开弹窗\r\n open(item) {\r\n console.log(item)\r\n this.dialogFormVisible = true\r\n this.resultForm = item\r\n this.fileList = item.fileList || []\r\n this.classified = item.classified\r\n },\r\n // 关闭弹窗\r\n closeResultForm() {\r\n this.dialogFormVisible = false\r\n this.fileList = []\r\n this.removeIds = []\r\n this.$refs.result.resetFields()\r\n this.classified = 0\r\n },\r\n openUploade() {\r\n this.$refs.uploadFile.open('PilotResult')\r\n },\r\n setFileList(file) {\r\n this.fileList.push(file)\r\n this.classified = 0\r\n },\r\n beforeRemove(file, fileList) {\r\n let name = file.name\r\n ? file.name\r\n : file.fileName + '.' + file.extensionName\r\n this.$confirm(`确定删除 ${name}?`, this.$t('common.tips'), {\r\n confirmButtonText: this.$t('common.confirm'),\r\n cancelButtonText: this.$t('common.cancel'),\r\n type: 'warning'\r\n }).then(() => {\r\n let id = file.fileId\r\n ? file.fileId\r\n : file.id\r\n ? file.id\r\n : file.response.fileId\r\n sat.deleteFileById(id, res => {\r\n if (res.state) {\r\n this.$message.success('附件删除成功')\r\n let arr = this.fileList.filter(item => {\r\n let fileId = item.id || item.response.fileId\r\n if (fileId !== id) {\r\n return item\r\n }\r\n })\r\n if (arr.length == 0) {\r\n this.classified = 0\r\n }\r\n this.fileList = arr\r\n } else {\r\n this.$message.error('附件删除失败')\r\n }\r\n })\r\n })\r\n },\r\n handlePreview(file) {\r\n let id = file.fileId\r\n ? file.fileId\r\n : file.id\r\n ? file.id\r\n : file.response.fileId\r\n this.dialogImageUrl = this.previewUrl + id\r\n\r\n let type = file.fileType || (file.extensionName\r\n ? file.extensionName\r\n : file.name.split('.')[1])\r\n this.$refs.filePreview.previewUrl = this.previewUrl + id\r\n this.$refs.filePreview.open(type)\r\n },\r\n // 文件下载\r\n handleDownloadFile(file) {\r\n let id = file.fileId\r\n ? file.fileId\r\n : file.id\r\n ? file.id\r\n : file.response.fileId\r\n window.open(portal + `/file/v1/downloadFile?fileId=${id}`, '_self')\r\n },\r\n changeFileList(arr) {\r\n this.fileList = arr\r\n },\r\n idExist(id) {\r\n if (!this.reslultIds.includes(id)) {\r\n // this.isRequest = false\r\n this.removeIds.push(id)\r\n }\r\n // else {\r\n // this.isRequest = true\r\n // }\r\n },\r\n // 保存数据\r\n setAipher(val) {\r\n this.cipher = val\r\n this.classified = 1\r\n this.saveResultData()\r\n },\r\n saveResultData() {\r\n let data = JSON.parse(JSON.stringify(this.resultForm))\r\n this.$refs.result.validate(valid => {\r\n let falg =\r\n (valid && this.classified) || (valid && this.fileList.length != 0)\r\n if (falg) {\r\n data.classified = this.classified\r\n data.fileList = this.fileList\r\n // data.ids = this.fileList.map(item => item.id || item.response.fileId)\r\n data.resultDate = moment(this.resultForm.resultDate).format(\r\n 'YYYY-MM-DD'\r\n )\r\n this.$emit('pushResult', data, this.removeIds)\r\n this.closeResultForm()\r\n this.cipher = false\r\n } else {\r\n if (!valid) {\r\n this.$confirm('请填写完整信息。', '提示', {\r\n cancelButtonText: '关闭',\r\n showConfirmButton: false,\r\n type: 'error'\r\n })\r\n } else if (this.classified != 1 && this.fileList.length == 0) {\r\n this.$confirm('请上传佐证材料后保存。', '提示', {\r\n confirmButtonText: '立即上传',\r\n cancelButtonText: '关闭',\r\n type: 'error'\r\n }).then(() => {\r\n this.openUploade()\r\n })\r\n }\r\n }\r\n })\r\n }\r\n // 查看详情\r\n }\r\n}\r\n",null]}