cronConclusion.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <div>
  3. <el-dialog width="800px" title="添加报告结果" :visible.sync="showDialog" :before-close="resetForm">
  4. <el-form :model="form" label-width="120px">
  5. <el-form-item label="报告结果">
  6. <el-checkbox-group v-model="form.cronIds">
  7. <el-checkbox v-for="item in conclusion" :key="item.value" :label="item.value">{{ item.label }}</el-checkbox>
  8. </el-checkbox-group>
  9. </el-form-item>
  10. <el-form-item label="结论论述" >
  11. <el-input v-model="form.cronDescription" type="textarea" placeholder="请输入结论论述"></el-input>
  12. </el-form-item>
  13. <el-form-item label="后续跟进事项">
  14. <span v-if="form.followUps"><span v-for="item in form.followUps" :key="item.name" style="margin-right:10px">{{ item.name}}</span></span>
  15. <span>
  16. <el-popover
  17. ref="popover"
  18. placement="bottom"
  19. @hide="hidePopover"
  20. trigger="click">
  21. <div>
  22. <addMatter :type="matterType" ref="addMatter"></addMatter>
  23. </div>
  24. <el-button slot="reference">添加后续事项</el-button>
  25. </el-popover>
  26. </span>
  27. </el-form-item>
  28. </el-form>
  29. <span slot="footer" class="dialog-footer">
  30. <el-button type="primary" @click="submitForm()" size="small" style="width:100px" :loading="btnLoading">保存</el-button>
  31. <el-button @click="resetForm()" size="small" style="width:100px">取消</el-button>
  32. </span>
  33. </el-dialog>
  34. </div>
  35. </template>
  36. <script>
  37. import addMatter from "../matter/addMatters.vue";
  38. export default {
  39. components:{
  40. addMatter,
  41. },
  42. data() {
  43. return {
  44. showDialog:false,
  45. form:{
  46. cronIds:[]
  47. },
  48. matterSign:false,
  49. matterType:null,
  50. btnLoading:false,
  51. conclusion:[],
  52. reportAsDicItem:{
  53. "0":"INVALID_ASSESS",
  54. "1":"THIRD_ASSESS",
  55. "2":"STABILITY_ASSESS",
  56. "3":"FTO_ASSESS",
  57. "4":"TORT_ASSESS",
  58. "5":"AVOID_ASSESS",
  59. "7":"REINVALID_ASSESS",
  60. },
  61. }
  62. },
  63. computed: {
  64. dictMessage() {
  65. return this.$store.state.dictMessage.dictMessage
  66. },
  67. },
  68. mounted() {
  69. },
  70. methods: {
  71. //打开弹窗
  72. open(row){
  73. this.matterType = 2
  74. this.form = {
  75. cronIds:[],
  76. ...row
  77. }
  78. this.conclusion = this.dictMessage[this.reportAsDicItem[row.reportType]]
  79. this.showDialog = true
  80. },
  81. //隐藏popover
  82. hidePopover(){
  83. var a = this.$refs.addMatter.emitData()
  84. if(a){
  85. this.$set(this.form,'followUps',a)
  86. }else{
  87. return false
  88. }
  89. },
  90. validMatter(){
  91. return this.$refs.addMatter.emitData()
  92. },
  93. //添加核心结论
  94. submitForm(){
  95. this.form.type = 2//项目类型(1专利数据库 2报告 3专利挖掘项目)
  96. // 判断文件是否都上传完毕
  97. var guids = this.$commonJS.checkUploadFile(this.form.systemFileList)
  98. if(!guids){
  99. return false
  100. }
  101. this.form.fileGuids = guids
  102. // this.$commonJS.allUploadFile(this.form)
  103. //判断报告是否是已完成的
  104. this.$refs.addMatter.submitForm1()
  105. this.form.status = 3
  106. // 事件及调查类型处理
  107. if (this.form.scenarioIds && this.form.scenarioIds.length > 0) {
  108. var scenarioIds = JSON.parse(JSON.stringify(this.form.scenarioIds))
  109. }
  110. if (this.form.eventId) {
  111. this.form.events = []
  112. this.form.scenarioIds = []
  113. this.form.matterIds.forEach(item => {
  114. this.form.events.push(
  115. {
  116. matterId: item,
  117. scenarioId: scenarioIds[0],
  118. eventId: this.form.eventId
  119. }
  120. )
  121. })
  122. }
  123. let formData = this.form
  124. this.$api.updateReportProject(formData).then(response=>{
  125. if(response.code == 200){
  126. this.$message.success('报告结果添加成功')
  127. this.resetForm()
  128. this.$emit('save',true)
  129. }
  130. }).catch(error=>{
  131. this.$message.error('报告结果添加失败')
  132. })
  133. },
  134. //关闭弹窗
  135. resetForm(){
  136. this.matterType=null
  137. this.showDialog = false
  138. },
  139. },
  140. }
  141. </script>