index.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <script setup>
  2. import { closeToast, showConfirmDialog, showLoadingToast, showToast } from 'vant'
  3. import { userInfo } from '~/store/user'
  4. const { user_id } = userInfo
  5. const { currentRoute } = useRouter()
  6. const route = currentRoute.value
  7. const xm_id = route.query.xm_id
  8. const detailData = ref({})
  9. showLoadingToast({
  10. message: '加载中...',
  11. forbidClick: true,
  12. })
  13. let finishTime = $ref('')
  14. function initData() {
  15. request({
  16. url: '/jdbg/sbcg_cgxm/detail',
  17. data: {
  18. xm_id,
  19. },
  20. }).then((res) => {
  21. closeToast()
  22. detailData.value = res.data.one_info;
  23. finishTime = res.data.one_info.shjl[res.data.one_info.shjl.length - 1].modify_dateline
  24. })
  25. }
  26. initData();
  27. // 处理树结构数据
  28. function dealData(item) {
  29. item.forEach(element => {
  30. if (element.children && element.children.length > 0) {
  31. dealData(element.children)
  32. } else if (element.tag === 'org') {
  33. element.disabled = true;
  34. }
  35. });
  36. }
  37. //组织机构数树形
  38. let treeData = $ref([]);
  39. function getOrgTree() {
  40. let transObj = {
  41. show_all: 1
  42. }
  43. request({
  44. url: '/user/org/org_member_tree',
  45. data: transObj
  46. }).then(res => {
  47. if (res.code == "1") {
  48. treeData = res.data.one_info;
  49. dealData(treeData);
  50. }
  51. })
  52. }
  53. const fieldNames = {
  54. text: 'label',
  55. value: 'tree_id',
  56. children: 'children',
  57. };
  58. // 分配人员
  59. let allotShow = $ref(false);
  60. let id = $ref('');//项目id
  61. function handleAllot() {
  62. getOrgTree()
  63. allotShow = true;
  64. id = xm_id;
  65. }
  66. const onFinish = ({ selectedOptions }) => {
  67. let fp_user = selectedOptions[selectedOptions.length - 1].tree_id;
  68. let fp_name = selectedOptions[selectedOptions.length - 1].label;
  69. showConfirmDialog({
  70. message:
  71. `确定将此任务分配给${fp_name}?`,
  72. })
  73. .then(() => {
  74. request({
  75. url: '/jdbg/sbcg_cgxm/edit',
  76. data: {
  77. xm_id: id,
  78. jdbg_sbcg_cgxm: {
  79. xm_fp_user: fp_user,
  80. },
  81. },
  82. }).then(res => {
  83. if (res.code == '1') {
  84. allotShow = false;
  85. initData();
  86. showToast(res.msg);
  87. }
  88. })
  89. })
  90. .catch(() => {
  91. // on cancel
  92. });
  93. };
  94. // #region 已分配详情
  95. let allocatedShow = $ref(false);
  96. function handleAllocated() {
  97. allocatedShow = true;
  98. }
  99. // #endregion
  100. </script>
  101. <template>
  102. <div>
  103. <div class="tableContainer">
  104. <div id="printBox" class="relative min-h-40 text-black text-14px">
  105. <div class="title px-10px leading-30px text-gray-600">
  106. <p> 申报日期: {{ detailData.create_dateline }}</p>
  107. <p>审核通过日期: {{ finishTime }}</p>
  108. </div>
  109. <h3 class="font-bold text-center my-15px text-18px">教育局采购项目申报表</h3>
  110. <table cellspacing="0" align="center" valign="middle" class="fileShow Tb">
  111. <tr>
  112. <td class="titleOpt">申报科室</td>
  113. <td class="w-1/3">{{ detailData.department_name }}</td>
  114. <td>申请人</td>
  115. <td>{{ detailData.xm_user_name }}</td>
  116. </tr>
  117. <tr>
  118. <td class="titleOpt">项目名称</td>
  119. <td colspan="3">{{ detailData.xm_name }}</td>
  120. </tr>
  121. <tr style="height: 50px">
  122. <td class="titleOpt">采购的主要理由及依据</td>
  123. <td colspan="3">{{ detailData.xm_lyyj }}</td>
  124. </tr>
  125. <tr>
  126. <td class="titleOpt">采购类型</td>
  127. <td>{{ detailData.lb_name }}</td>
  128. <td>采购金额</td>
  129. <td>{{ detailData.xm_price }}元</td>
  130. </tr>
  131. <tr style="min-height: 80px">
  132. <td class="titleOpt">项目清单</td>
  133. <td colspan="3" class="text-left">
  134. <div class="xmqd" v-html="detailData.xm_qd"></div>
  135. </td>
  136. </tr>
  137. <tr v-for="sp in detailData.shjl" :key="sp.sh_id" style="height: 50px">
  138. <td class="py-5 titleOpt">
  139. <div>
  140. {{ sp.sh_dept_name }}
  141. </div>
  142. <div>{{ sp.position }}审批</div>
  143. </td>
  144. <td colspan="3">
  145. 同意&emsp;&emsp;{{ sp.sh_user_name }}&emsp;&emsp;
  146. {{ sp.modify_dateline.split(" ")[0] }}
  147. </td>
  148. </tr>
  149. </table>
  150. <!-- <img class="pa z-100 top-14 right-8 w-42mm h-42mm" src="@/assets/images/officialSeal.png" alt="" /> -->
  151. <div v-if="detailData.xm_fp_user == '0'" class="flex justify-between items-center my-5px">
  152. <p>任务分配: 未分配</p>
  153. <van-button v-if="detailData.create_user_id === user_id" class="w-60px" type="primary" size="small"
  154. @click="handleAllot">分配</van-button>
  155. </div>
  156. <div class="flex items-center justify-between my-5px" v-else>
  157. <div class="flex items-center">
  158. <span class="mr-10px">任务分配: 已分配</span>
  159. <div class="mr-10px">
  160. <span>{{ detailData.xm_fp_user_name }}</span>
  161. </div>
  162. {{ detailData.xm_is_wc_option_k === "2" ? "未完成" : "已完成" }}
  163. </div>
  164. <van-button class="w-60px bg-hex-BDBDBD border-hex-BDBDBD audited float-right" type="primary"
  165. size="small" @click="allocatedShow = true">已分配</van-button>
  166. </div>
  167. </div>
  168. </div>
  169. <!-- 分配级联 -->
  170. <van-popup v-model:show="allotShow" round position="bottom">
  171. <van-cascader v-model="cascaderValue" title="请选择分配人员" :options="treeData" @close="allotShow = false"
  172. @finish="onFinish" :field-names="fieldNames" />
  173. </van-popup>
  174. <!-- 已分配详情 -->
  175. <van-dialog v-model:show="allocatedShow" title="分配详情" :show-cancel-button="false" class="">
  176. <div class="w-4/5 center text-18px text-gray-600 leading-loose">
  177. <p v-if="detailData.xm_fp_user_name">{{ detailData?.xm_fp_user_name }} <span class="ml-5px">{{
  178. detailData.modify_dateline
  179. }}</span></p>
  180. <p>状态: <span class="ml-10px">{{ detailData.xm_is_wc == '1' ? '完成' : '未完成' }}</span> </p>
  181. </div>
  182. </van-dialog>
  183. </div>
  184. </template>
  185. <style lang="scss" scoped>
  186. @import "~/styles/table.scss";
  187. .titleOpt {
  188. width: 25%;
  189. }
  190. .border_bottom {
  191. border-bottom: 2px solid #666;
  192. border-top: 2px solid #666;
  193. }
  194. .center {
  195. margin: 10px auto;
  196. }
  197. .text-red {
  198. color: red;
  199. }
  200. :deep(.specialTd table tbody tr td) {
  201. border: 1px #CCCCCC solid !important;
  202. }
  203. ::v-deep .fileShow table {
  204. border: 1px #000 solid;
  205. tbody {
  206. tr {
  207. td {
  208. border: 1px #000 solid;
  209. line-height: 30px;
  210. }
  211. }
  212. }
  213. }
  214. .text-left {
  215. padding: 0 !important;
  216. }
  217. ::v-deep .xmqd {
  218. width: 100% !important;
  219. table {
  220. width: 100% !important;
  221. margin-left: 0 !important;
  222. // table-layout: fixed !important;
  223. td {
  224. width: none !important;
  225. padding: 5px 1px !important;
  226. word-break: break-all;
  227. word-wrap: wrap;
  228. white-space: normal;
  229. p {
  230. text-align: center !important;
  231. }
  232. }
  233. }
  234. img {
  235. width: 100% !important;
  236. margin-top: 20px;
  237. }
  238. }
  239. ::v-deep .MsoNormalTable {
  240. width: 100% !important;
  241. }
  242. </style>