index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <script setup>
  2. import { closeToast, showLoadingToast, showToast } from 'vant'
  3. import Pdfh5 from 'pdfh5'
  4. import { userInfo } from "~/store/user";
  5. const { user_id } = userInfo;
  6. const { currentRoute } = useRouter()
  7. const route = currentRoute.value
  8. const gw_id = route.query.gw_id
  9. const detailData = ref({})
  10. const shjl = ref([])
  11. let pdfHeight = $ref('')
  12. function getData() {
  13. showLoadingToast({
  14. message: '加载中...',
  15. forbidClick: true,
  16. })
  17. request({
  18. url: '/jdbg/gwgl_gw/detail',
  19. data: {
  20. gw_id,
  21. },
  22. }).then((res) => {
  23. closeToast()
  24. detailData.value = res.data.one_info
  25. shjl.value = res.data.one_info.shjl
  26. const appendUrl = res.data.one_info.gw_content.split('|')[0]
  27. const curFileShowUrl = window.globalVariables.api
  28. + appendUrl.replace(/\.\w+$/, '.pdf')
  29. const pdfh5 = new Pdfh5('#pdfContent', {
  30. pdfurl: curFileShowUrl,
  31. scrollEnable: false,
  32. zoomEnable: false,
  33. })
  34. pdfh5.on('complete', (status, msg) => {
  35. const height = document.getElementsByClassName("pageContainer")[0].style['min-height'];
  36. const num = document.getElementsByClassName("pageContainer").length
  37. pdfHeight = parseFloat(height) * num + 50
  38. });
  39. })
  40. }
  41. getData()
  42. const auditchecked = ref('')
  43. const auditDialogShow = ref(false)
  44. const sh_reason = ref('')
  45. function clickAudit(item) {
  46. let ShPerson = item.sh_user_id;
  47. let localPerson = user_id;
  48. if (ShPerson !== localPerson) {
  49. showToast('请审核自己的项目')
  50. return
  51. }
  52. auditchecked.value = ''
  53. sh_reason.value = ''
  54. auditDialogShow.value = true
  55. }
  56. function beforeCloseDialog(action) {
  57. if (action == 'confirm') {
  58. if (auditchecked.value == '') {
  59. showToast('请选择审核结果')
  60. return false
  61. }
  62. else if (sh_reason.value == '') {
  63. showToast('请填写意见')
  64. return false
  65. }
  66. else {
  67. dialogSubmit()
  68. return true
  69. }
  70. }
  71. else {
  72. return true
  73. }
  74. }
  75. function dialogSubmit() {
  76. const transObj = {
  77. gw_id,
  78. sh_status: auditchecked.value, // 待审核 1通过 2驳回
  79. sh_reason: sh_reason.value, // 处理意见
  80. }
  81. showLoadingToast({
  82. message: '提交中...',
  83. forbidClick: true,
  84. })
  85. request({
  86. url: '/jdbg/gwgl_gw/check',
  87. data: transObj,
  88. }).then((res) => {
  89. closeToast()
  90. if (res.code == 1) {
  91. showToast(res.msg)
  92. getData()
  93. }
  94. })
  95. }
  96. </script>
  97. <template>
  98. <div>
  99. <div class="tableContainer">
  100. <div class="topPart">
  101. <table class="Tb" width="100%" cellspacing="0" cellpadding="0">
  102. <tr>
  103. <td class="titleOpt">
  104. 类型:
  105. </td>
  106. <td>{{ detailData.lb_name }}</td>
  107. </tr>
  108. <tr>
  109. <td class="titleOpt">
  110. 标题:
  111. </td>
  112. <td>{{ detailData.gw_title }}</td>
  113. </tr>
  114. <tr>
  115. <td class="titleOpt">
  116. 发文字号:
  117. </td>
  118. <td>{{ detailData.gw_zh }}</td>
  119. </tr>
  120. <tr>
  121. <td class="titleOpt">
  122. 发起人:
  123. </td>
  124. <td>{{ detailData.gw_fqr_name }}</td>
  125. </tr>
  126. <tr>
  127. <td class="titleOpt">
  128. 发起科室:
  129. </td>
  130. <td>{{ detailData.gw_fqks_name }}</td>
  131. </tr>
  132. <tr>
  133. <td class="titleOpt">
  134. 发起时间:
  135. </td>
  136. <td>{{ detailData.create_dateline }}</td>
  137. </tr>
  138. <tr>
  139. <td class="titleOpt">
  140. 当前步骤:
  141. </td>
  142. <td>{{ detailData.gw_bz }}</td>
  143. </tr>
  144. <tr>
  145. <td class="titleOpt">
  146. 当前审核人:
  147. </td>
  148. <td>{{ detailData.gw_shr }}</td>
  149. </tr>
  150. <tr>
  151. <td class="titleOpt">
  152. 审核状态:
  153. </td>
  154. <td>
  155. <div class="specialTd">
  156. {{ detailData.gw_status_option_n }}
  157. </div>
  158. </td>
  159. </tr>
  160. <tbody v-for="(item, index) in shjl" :key="index" class="bg-hex-fffff9 border_bottom">
  161. <tr>
  162. <td class="titleOpt">
  163. 步骤名称:
  164. </td>
  165. <td>
  166. <div class="specialTd">
  167. {{ item.sh_dept_name }}
  168. </div>
  169. </td>
  170. </tr>
  171. <tr>
  172. <td class="titleOpt">
  173. 审核人:
  174. </td>
  175. <td>
  176. <div class="specialTd">
  177. {{ item.sh_user_name }}
  178. </div>
  179. </td>
  180. </tr>
  181. <tr>
  182. <td class="titleOpt">
  183. 操作:
  184. </td>
  185. <td>
  186. <div v-if="item.sh_status == 2">
  187. 通过
  188. </div>
  189. <div v-else-if="item.sh_status == 1" style="padding-top: 5px;padding-bottom: 5px;line-height: 100%;">
  190. <van-button class="rightButton" type="primary" @click.stop="clickAudit(item)">
  191. 审核
  192. </van-button>
  193. </div>
  194. <div v-else>
  195. 不通过
  196. </div>
  197. </td>
  198. </tr>
  199. <tr>
  200. <td class="titleOpt">
  201. 处理意见:
  202. </td>
  203. <td>
  204. <div class="specialTd">
  205. {{ item.sh_reason }}
  206. </div>
  207. </td>
  208. </tr>
  209. </tbody>
  210. </table>
  211. </div>
  212. </div>
  213. <div id="pdfContent" :style="{ height: pdfHeight + 'px' }" />
  214. <van-dialog v-model:show="auditDialogShow" title="审核" confirm-button-text="提交" show-cancel-button
  215. :before-close="beforeCloseDialog">
  216. <div class="dialogDiv">
  217. <van-radio-group v-model="auditchecked">
  218. <van-cell-group inset>
  219. <van-cell title="通过" clickable @click="auditchecked = '2'">
  220. <template #right-icon>
  221. <van-radio name="2" />
  222. </template>
  223. </van-cell>
  224. <van-cell title="不通过" clickable @click="auditchecked = '3'">
  225. <template #right-icon>
  226. <van-radio name="3" />
  227. </template>
  228. </van-cell>
  229. </van-cell-group>
  230. </van-radio-group>
  231. <van-field v-model="sh_reason" rows="3" autosize type="textarea" placeholder="填写意见" />
  232. </div>
  233. </van-dialog>
  234. </div>
  235. </template>
  236. <style lang="scss" scoped>
  237. .rightButton {
  238. height: 30px;
  239. width: 75px;
  240. }
  241. :deep(.specialTd table tbody tr td) {
  242. border: 1px #CCCCCC solid !important;
  243. }
  244. </style>