avoidDirection.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <div class="height_100">
  3. <el-container>
  4. <el-header>
  5. <div style="padding: 20px;">
  6. <p> 标的专利号:<el-link type="primary" @click="toPatentDetails(patentNo)">{{ patentNo }}</el-link> </p>
  7. </div>
  8. </el-header>
  9. <el-main style="padding:20px;height: calc(100% - 100px);">
  10. <!-- 拆分特征公用组件 -->
  11. <splitPage style="height: calc(100% - 103px);overflow: auto;" :tableData="tableData"
  12. :patentNo="patentNo" :projectId="projectId" :columnList="columnList" @splitSelect="splitSelect"
  13. @isSave="isSave"></splitPage>
  14. <!-- 回避设计总体方向 -->
  15. <div style="margin-top: 20px;">
  16. <p>回避设计总体方向:</p>
  17. <div>
  18. <myRichText v-model="wholeContent" placeholder="请输入回避设计总体方向(可粘贴图片)"></myRichText>
  19. </div>
  20. </div>
  21. </el-main>
  22. </el-container>
  23. </div>
  24. </template>
  25. <script>
  26. import { patentDetails } from '../../components/mixins/index2'
  27. import mixins from './mixins'
  28. import splitPage from '../../components/splitPage/splitPage.vue';
  29. export default {
  30. props: ['patentNo', 'projectId',],
  31. mixins:[patentDetails,mixins],
  32. components: {
  33. splitPage,
  34. },
  35. data() {
  36. return {
  37. };
  38. },
  39. watch: {
  40. },
  41. mounted() {
  42. },
  43. methods: {
  44. // 保存
  45. isSave(val) {
  46. // let params = this.handleData(val)
  47. let params = {
  48. projectId: this.projectId,
  49. wholeContent: this.wholeContent,
  50. avoidDesignDTOS: val,
  51. }
  52. this.$api.addAvoidDesign(params).then(res => {
  53. if (res.code == 200) {
  54. this.$message.success('保存成功')
  55. }
  56. })
  57. },
  58. // 处理需要保存的数据()
  59. handleData(tableData) {
  60. let keepArr = [
  61. {
  62. rightName: tableData[0].pRightName,
  63. signPatentNo: tableData[0].pSignPatentNo,
  64. patentNo: tableData[0].pPatentNo,
  65. content: tableData[0].pContent,
  66. contentOut: tableData[0].pContentOut,
  67. sort: tableData[0].pSort,
  68. type: tableData[0].pType,
  69. projectId: tableData[0].pReportId,
  70. features: [],
  71. }
  72. ]
  73. var j = 0
  74. for (let i = 0; i < tableData.length; i++) {
  75. if (keepArr.findIndex(item => { return item.rightName == tableData[i].pRightName }) < 0) {
  76. j += 1
  77. keepArr.push(
  78. {
  79. rightName: tableData[i].pRightName,
  80. signPatentNo: tableData[i].pSignPatentNo,
  81. patentNo: tableData[i].pPatentNo,
  82. content: tableData[i].pContent,
  83. contentOut: tableData[i].pContentOut,
  84. sort: tableData[i].pSort,
  85. type: tableData[i].pType,
  86. projectId: tableData[i].pReportId,
  87. features: [],
  88. }
  89. )
  90. }
  91. keepArr[j].features.push({
  92. content: tableData[i].content,
  93. direction: tableData[i].direction ? tableData[i].direction : '',
  94. projectId: tableData[i].projectId,
  95. explainText: tableData[i].explainText ? tableData[i].explainText : '',
  96. contentOut: tableData[i].contentOut ? tableData[i].contentOut : '',
  97. rightSort: tableData[i].rightSort,
  98. rightType: tableData[i].rightType,
  99. id: tableData[i].id,
  100. patentNo: tableData[i].patentNo,
  101. })
  102. }
  103. let keepStr = {
  104. projectId: this.projectId,
  105. avoidDesignDTOS: keepArr,
  106. wholeContent: this.wholeContent ? this.wholeContent : ''
  107. }
  108. return keepStr
  109. },
  110. // 改变拆分条件
  111. splitSelect(split) {
  112. this.getList(split,true)
  113. },
  114. // 获取拆分数据(弃用)
  115. getSplitList(val) {
  116. let params = {
  117. patentNo: this.patentNo,
  118. projectId: Number(this.projectId),
  119. ...val,//拆分条件
  120. }
  121. this.$api.spiltFeature(params).then(res => {
  122. if (res.code == 200) {
  123. // this.textarea.wholeDirection = res.data.wholeDirection
  124. if (res.data.data.length > 0) {
  125. var data = []
  126. res.data.data.forEach(RightVosItem => {
  127. if (RightVosItem.features.length > 0) {
  128. RightVosItem.features.forEach(FeaturesItem => {
  129. FeaturesItem.pRightName = RightVosItem.rightName
  130. FeaturesItem.pSignPatentNo = RightVosItem.signPatentNo
  131. FeaturesItem.pPatentNo = RightVosItem.patentNo
  132. FeaturesItem.pContentOut = RightVosItem.contentOut
  133. FeaturesItem.pContent = RightVosItem.content
  134. FeaturesItem.pProjectId = RightVosItem.projectId
  135. FeaturesItem.pType = RightVosItem.type
  136. FeaturesItem.pSort = RightVosItem.sort
  137. this.hasOwn(FeaturesItem)
  138. data.push(FeaturesItem)
  139. })
  140. }
  141. })
  142. this.tableData = data
  143. }
  144. }
  145. })
  146. },
  147. }
  148. }
  149. </script>
  150. <style lang="scss" scoped></style>