ManageContent.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <div class="manage_content">
  3. <div class="content_row" style="margin-bottom: 32px">
  4. <ContentPanel
  5. :savedData="savedData"
  6. :issue-type="QuestionStatus.toAuth"
  7. :title="'审核'"
  8. text-to-show="请及时关注【待审核/超期未审核/长期未审核】的问题单!"
  9. :save-update="saveUpdate"
  10. />
  11. <ContentPanel
  12. :savedData="savedData"
  13. :issue-type="QuestionStatus.todo"
  14. :title="'整改'"
  15. text-to-show="请及时关注【待整改/超期未整改/长期未整改】的问题单!"
  16. :save-update="saveUpdate"
  17. />
  18. </div>
  19. <div class="content_row">
  20. <ContentPanel
  21. :savedData="savedData"
  22. :issue-type="QuestionStatus.toReview"
  23. :title="'复核'"
  24. text-to-show="请及时关注【待复核/超期未复核改/长期未复核】的问题单!"
  25. :save-update="saveUpdate"
  26. />
  27. <ContentPanel
  28. :savedData="savedData"
  29. :issue-type="QuestionStatus.finishe"
  30. :title="'完结'"
  31. text-to-show="请该违规问题已整改结束!"
  32. :save-update="saveUpdate"
  33. />
  34. </div>
  35. </div>
  36. </template>
  37. <script lang="ts" setup>
  38. import { ref, onMounted } from 'vue';
  39. import { ElMessage } from 'element-plus';
  40. import { getIssueProcessMessage, updateIssueProcessMessage } from '@/api/message/question-notifications';
  41. import { QuestionStatus, PushTypeStatus, issueDetilasType, issueProcessType, panelDetails } from '../type';
  42. import ContentPanel from './contentPanel.vue';
  43. //根据流程的issuePhase值与pushType值去匹配id
  44. const idMatch = (issuePhase: number, pushType: number) => {
  45. let id = 0;
  46. savedData.value.forEach((item) => {
  47. if (item.issuePhase === issuePhase) {
  48. item.issueProcessMessageList.forEach((subItem) => {
  49. if (subItem.pushType === pushType) {
  50. id = subItem.id;
  51. }
  52. });
  53. }
  54. });
  55. return id;
  56. };
  57. const saveUpdate = (obj: panelDetails, panelChosen: number) => {
  58. let dataUpdate = {
  59. issuePhase: panelChosen,
  60. issueProcessMessageList: <issueProcessType[]>[],
  61. };
  62. dataUpdate.issueProcessMessageList.push({
  63. id: idMatch(panelChosen, PushTypeStatus.atonce),
  64. isEnabled: obj.atProcessing === true ? 1 : 0,
  65. pushType: PushTypeStatus.atonce,
  66. });
  67. //完结状态下面的没有
  68. if (panelChosen != QuestionStatus.finishe) {
  69. //如果为开启,那超时时长也不用传了
  70. if (obj.atExpiry === false) {
  71. dataUpdate.issueProcessMessageList.push({
  72. id: idMatch(panelChosen, PushTypeStatus.expire),
  73. isEnabled: 0,
  74. pushType: PushTypeStatus.expire,
  75. });
  76. } else {
  77. dataUpdate.issueProcessMessageList.push({
  78. id: idMatch(panelChosen, PushTypeStatus.expire),
  79. isEnabled: 1,
  80. overtime: obj.expiryTime!,
  81. pushType: PushTypeStatus.expire,
  82. });
  83. }
  84. //这边同理
  85. if (obj.atLongTimeExpiry === false) {
  86. dataUpdate.issueProcessMessageList.push({
  87. id: idMatch(panelChosen, PushTypeStatus.longtime),
  88. isEnabled: 0,
  89. pushType: PushTypeStatus.longtime,
  90. });
  91. } else {
  92. dataUpdate.issueProcessMessageList.push({
  93. id: idMatch(panelChosen, PushTypeStatus.longtime),
  94. isEnabled: 1,
  95. overtime: obj.longTimeValue!,
  96. pushType: PushTypeStatus.longtime,
  97. //只传obj.copyTo中的id
  98. ccRecipients: obj.copyTo!.map((user) => ({
  99. id: user.id,
  100. realname: user.realname,
  101. staffNo: user.staffNo,
  102. })),
  103. });
  104. }
  105. }
  106. updateIssueProcessMessage(dataUpdate)
  107. .then(() => {
  108. ElMessage({
  109. message: '保存成功',
  110. type: 'success',
  111. plain: true,
  112. });
  113. getProcessDetails();
  114. })
  115. .catch((error) => {
  116. console.error(error);
  117. });
  118. };
  119. const savedData = ref(<issueDetilasType[]>[]);
  120. const getProcessDetails = () => {
  121. // savedData.value = [];
  122. getIssueProcessMessage().then((res) => {
  123. savedData.value = res;
  124. });
  125. };
  126. onMounted(() => {
  127. getProcessDetails();
  128. });
  129. </script>
  130. <style lang="scss" scoped>
  131. .manage_content {
  132. width: 100%;
  133. // height: 300px;
  134. // overflow-x: scroll;
  135. // background-color: yellowgreen;
  136. }
  137. .content_row {
  138. width: 1140px;
  139. display: flex;
  140. flex-direction: row;
  141. // background-color: gray;
  142. }
  143. .content_panel {
  144. width: 530px;
  145. height: 326px;
  146. // background-color: pink;
  147. border-radius: 8px;
  148. border: 1px solid #e4e7ed;
  149. .panel_top {
  150. width: 100%;
  151. height: 50px;
  152. display: flex;
  153. flex-direction: row;
  154. background-color: #fafafa;
  155. border-radius: 8px;
  156. padding: 13px 16px 0px 16px;
  157. .top_content {
  158. // width: 100%;
  159. height: 24px;
  160. display: flex;
  161. flex-direction: row;
  162. .circle {
  163. width: 24px;
  164. height: 24px;
  165. border-radius: 12px;
  166. background: #1890ff;
  167. font-weight: 600;
  168. font-size: 14px;
  169. color: #ffffff;
  170. line-height: 24px;
  171. text-align: center;
  172. }
  173. .title_name {
  174. height: 24px;
  175. margin-left: 8px;
  176. font-weight: 600;
  177. font-size: 16px;
  178. color: rgba(0, 0, 0, 0.88);
  179. line-height: 24px;
  180. text-align: left;
  181. }
  182. .title_explain {
  183. height: 14px;
  184. margin-left: 8px;
  185. margin-top: 6px;
  186. font-weight: 400;
  187. font-size: 10px;
  188. color: #999999;
  189. line-height: 14px;
  190. text-align: left;
  191. }
  192. }
  193. }
  194. .subtitle {
  195. height: 17px;
  196. margin-left: 30px;
  197. margin-top: 17px;
  198. font-weight: 600;
  199. font-size: 12px;
  200. color: #303133;
  201. line-height: 17px;
  202. text-align: left;
  203. display: flex;
  204. flex-direction: row;
  205. }
  206. .subtitle_explain_disable {
  207. height: 21px;
  208. margin-left: 30px;
  209. // margin-top: 4px;
  210. // margin-top: 3px;
  211. font-weight: 400;
  212. font-size: 10px;
  213. color: #a8abb2;
  214. line-height: 21px;
  215. text-align: left;
  216. display: flex;
  217. flex-direction: row;
  218. }
  219. .editable {
  220. color: #303133 !important;
  221. }
  222. }
  223. </style>