detail.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <!--
  2. * @Author: PoJun
  3. * @Date: 2024-01-03 16:13:54
  4. * @LastEditors: PoJun
  5. * @LastEditTime: 2024-05-08 20:37:11
  6. * @Message: Nothing
  7. -->
  8. <template>
  9. <view class="flow-detail">
  10. <uv-skeletons
  11. :loading="skeletonLoading"
  12. :skeleton="[
  13. {
  14. type: 'line',
  15. num: 10,
  16. gap: '0',
  17. style: 'height: 32px;marginTop:36rpx',
  18. },
  19. ]"
  20. >
  21. <kirin-form :list="list" labelWidth="80"></kirin-form>
  22. <view class="uv-m-t-30" v-if="tabType == 'todo'">
  23. <uv-row gutter="15">
  24. <uv-col span="6">
  25. <uv-button type="primary" :plain="true" text="拒绝" @click="refuse"></uv-button>
  26. </uv-col>
  27. <uv-col span="6">
  28. <uv-button type="primary" text="同意" @click="agree"></uv-button>
  29. </uv-col>
  30. </uv-row>
  31. </view>
  32. </uv-skeletons>
  33. </view>
  34. </template>
  35. <script>
  36. import { getAffairSelfInfo, refuseAffairs, agreeAffairs } from "@/config/http.js";
  37. import formBasicMixin from "@/utils/form-basic-mixin.js";
  38. import { authenticationFormList } from "../setting/constant";
  39. export default {
  40. mixins: [formBasicMixin],
  41. data() {
  42. return {
  43. list: [],
  44. tabType: "todo",
  45. id: "",
  46. skeletonLoading: true,
  47. detailItem: null,
  48. authenticationFormList,
  49. };
  50. },
  51. methods: {
  52. async initPage(id) {
  53. const data = await getAffairSelfInfo(id);
  54. this.detailItem = data;
  55. const type = data.type;
  56. if (type == "UserJoinOrg") {
  57. this.list = [
  58. {
  59. type: "textarea",
  60. label: "标题",
  61. code: "title",
  62. sv: data.title,
  63. rv: data.title,
  64. canShow: true,
  65. labelWidth: 80,
  66. },
  67. {
  68. type: "input",
  69. label: "审核类型",
  70. code: "type",
  71. sv: "人员加入组织",
  72. rv: "人员加入组织",
  73. canShow: true,
  74. labelWidth: 80,
  75. },
  76. {
  77. type: "input",
  78. label: "名称",
  79. code: "name",
  80. sv: data?.data.name,
  81. rv: data?.data.name,
  82. canShow: true,
  83. labelWidth: 80,
  84. },
  85. {
  86. type: "input",
  87. label: "联系方式",
  88. code: "phone",
  89. sv: data?.data.phone,
  90. rv: data?.data.phone,
  91. canShow: true,
  92. labelWidth: 80,
  93. },
  94. ];
  95. } else {
  96. this.list = authenticationFormList.map(item => {
  97. item.sv = item.rv = data?.data[item.code];
  98. item.canEdit = false;
  99. return item;
  100. });
  101. this.list.unshift(
  102. {
  103. type: "textarea",
  104. label: "标题",
  105. code: "title",
  106. sv: data.title,
  107. rv: data.title,
  108. canShow: true,
  109. labelWidth: 80,
  110. },
  111. {
  112. type: "input",
  113. label: "审核类型",
  114. code: "type",
  115. sv: "申请加入供应商",
  116. rv: "申请加入供应商",
  117. canShow: true,
  118. labelWidth: 80,
  119. }
  120. );
  121. }
  122. if (data.result != undefined && data.result != null) {
  123. this.list.push({
  124. type: "input",
  125. label: "审核结果",
  126. code: "result",
  127. sv: data.result == 1 ? "已通过" : "已拒绝",
  128. rv: data.result == 1 ? "已通过" : "已拒绝",
  129. canShow: true,
  130. labelWidth: 80,
  131. });
  132. }
  133. uni.$uv.sleep(200).then(() => {
  134. this.skeletonLoading = false;
  135. });
  136. },
  137. async refuse() {
  138. uni.showLoading({ mask: true });
  139. await refuseAffairs(this.id);
  140. this.doback();
  141. },
  142. async agree() {
  143. uni.showLoading({ mask: true });
  144. await agreeAffairs(this.id, this.detailItem.data);
  145. this.doback();
  146. },
  147. doback() {
  148. try {
  149. uni.$uv.route({ type: "back" });
  150. uni.$emit("refreshFlowList");
  151. } finally {
  152. uni.hideLoading();
  153. }
  154. },
  155. },
  156. async onLoad(e) {
  157. await this.initDictList("supplierType");
  158. this.tabType = e?.tabType;
  159. this.id = e?.id;
  160. this.initPage(e.id);
  161. },
  162. };
  163. </script>
  164. <style lang="scss">
  165. .flow-detail {
  166. padding: 0 25rpx;
  167. }
  168. </style>