chakan.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <template>
  2. <view>
  3. <view class="content">
  4. <view class="section">
  5. <view class="title">申请人</view>
  6. <view class="inner">
  7. <view class="user">
  8. <!-- <view class="img">
  9. <view class="avatar" :style="{backgroundColor:bgColor[1]}">{{detail.staff.split('').pop()}}</view>
  10. </view> -->
  11. <view class="info">
  12. <view class="name">{{detail.staff}}</view>
  13. <view class="section">{{detail.staff_section}}</view>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="section">
  19. <view class="title">申请时间</view>
  20. <view class="inner">{{detail.created_at}}</view>
  21. </view>
  22. <view class="section">
  23. <view class="title">业务分类</view>
  24. <view class="inner">{{detail.classify}}</view>
  25. </view>
  26. <view class="section">
  27. <view class="title">业务名称</view>
  28. <view class="inner">{{detail.title}}</view>
  29. </view>
  30. <view class="section">
  31. <view class="title">业务介绍</view>
  32. <view class="inner">{{detail.introduce}}</view>
  33. </view>
  34. <view class="section" v-if="detail.filelist">
  35. <view class="title">需审核文件</view>
  36. <view class="inner">
  37. <view class="file_list">
  38. <view class="item" v-for="(item,index) in detail.filelist" :key="index"
  39. @click="open_file(item.path)">
  40. <view class="left">
  41. <view class="icon"></view>
  42. <view class="info">
  43. <view class="name">{{item.fileName}}</view>
  44. <!-- <view class="size">{{item.fileSize}}KB</view> -->
  45. </view>
  46. </view>
  47. <view class="right">
  48. <uni-icons type="arrowright"></uni-icons>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="section" v-if="detail.$photos">
  55. <view class="title">需审核图片</view>
  56. <view class="inner">
  57. <view class="img_list">
  58. <view class="item" v-for="(item,index) in detail.$photos" :key="index">
  59. <image :src="item.path" @click="open_img(item.path)"></image>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="section">
  65. <view class="title">审批流程</view>
  66. <view class="inner">
  67. <view class="shenpi_list">
  68. <view class="item" v-for="(item,index) in detail.approval_list" :key="index">
  69. <view class="name">{{item.title}}</view>
  70. <view class="list">
  71. <view class="box" v-for="(item_2,index_2) in item.member" :key="index_2">
  72. <view class="label">{{item_2.title}}:{{item_2.name}}</view>
  73. <view v-if="!item_2.state" style="color: #F0AD4E;">待审核。</view>
  74. <view class="label" v-if="item_2.state == 2 && item_2.remark == ''" style="color: #E94C3D;">驳回。</view>
  75. <view class="label" v-if="item_2.state == 0 && item_2.remark == ''" style="color: #E94C3D;">驳回。</view>
  76. <view class="label" v-if="item_2.state == 1 && item_2.remark == ''" style="color: #17A086;">通过。</view>
  77. <view class="remark" v-if="item_2.state == 1" style="color: #17A086;">{{item_2.remark}}</view>
  78. <view class="remark" v-if="item_2.state == 2 || item_2.state == 0 || item_2.state == 3" style="color: #E94C3D;">{{item_2.remark}}</view>
  79. <view v-if="item_2.state == 1">
  80. <image :src="item_2.base_img" style="width: 300rpx; height: 90rpx;"></image>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. </template>
  91. <script>
  92. export default {
  93. data() {
  94. return {
  95. // 业务id
  96. id: 0,
  97. // 业务详情
  98. detail: {},
  99. // 审核留言
  100. remark_text: "",
  101. // 头像随即色
  102. bgColor: []
  103. };
  104. },
  105. onLoad(option) {
  106. // console.log(option.id)
  107. // 设置业务id
  108. this.id = option.id
  109. // 设置标题
  110. uni.setNavigationBarTitle({
  111. title: option.title
  112. })
  113. // 获取业务详情
  114. this.get_worksheet_checkmei(option.id)
  115. },
  116. methods: {
  117. // 获取业务详情
  118. get_worksheet_checkmei(id) {
  119. // 业务详情接口
  120. this.$api.worksheet_checkmei({
  121. id: id
  122. }).then((res) => {
  123. console.log(res.data.data)
  124. for (let i = 0; i < 2; i++) {
  125. // 获取随机色
  126. let r = parseInt(Math.random() * 256)
  127. let g = parseInt(Math.random() * 256)
  128. let b = parseInt(Math.random() * 256)
  129. // ES6 字符串拼接
  130. // this.bgColor = `rgba(${r},${g},${b},0.3)`
  131. let color = "rgba(" + r + "," + g + "," + b + "," + 0.3 + ")"
  132. // console.log(color)
  133. this.bgColor.push(color)
  134. }
  135. this.detail = res.data.data
  136. })
  137. },
  138. // 审核事件
  139. btn_shenhe(type) {
  140. // 提交审核接口
  141. this.$api.worksheet_checkmei_tijiao({
  142. id: this.id,
  143. allow: type,
  144. remark: this.remark_text
  145. }).then((res) => {
  146. console.log(res.data)
  147. // 审核过
  148. if (res.data.code == 1) {
  149. uni.showToast({
  150. icon: "none",
  151. title: res.data.message
  152. })
  153. } else {
  154. uni.switchTab({
  155. url: "../../../tabbar/my/my"
  156. })
  157. }
  158. })
  159. },
  160. // 预览文件
  161. open_file(path) {
  162. uni.downloadFile({
  163. url: path,
  164. success: function (res) {
  165. var filePath = res.tempFilePath;
  166. uni.openDocument({
  167. filePath: filePath,
  168. success: function (res) {
  169. console.log('打开文档成功');
  170. }
  171. });
  172. }
  173. });
  174. },
  175. // 预览图片
  176. open_img(path){
  177. const urls = [];
  178. urls.push(path)
  179. // console.log(urls[0])
  180. uni.previewImage({
  181. urls: urls,
  182. });
  183. }
  184. }
  185. }
  186. </script>
  187. <style lang="scss">
  188. page {
  189. margin-bottom: 40px;
  190. background-color: #F3F3F3;
  191. width: 749rpx;
  192. box-sizing: border-box;
  193. padding: 24rpx;
  194. }
  195. .content {
  196. width: 700rpx;
  197. min-height: 90vh;
  198. background-color: #FFFFFF;
  199. border-radius: 4px;
  200. box-sizing: border-box;
  201. padding: 25rpx;
  202. }
  203. .section {
  204. .title {
  205. padding-left: 8px;
  206. border-left: 2px solid #009FE8;
  207. font-weight: 700;
  208. }
  209. .inner {
  210. padding: 10px;
  211. .user {
  212. display: flex;
  213. align-items: center;
  214. .img {
  215. width: 66px;
  216. height: 66px;
  217. border-radius: 50%;
  218. overflow: hidden;
  219. image {
  220. width: 66px;
  221. height: 66px;
  222. }
  223. .avatar {
  224. width: 66px;
  225. height: 66px;
  226. text-align: center;
  227. line-height: 66px;
  228. color: #FFFFFF;
  229. font-size: 28px;
  230. }
  231. }
  232. .info {
  233. // margin-left: 12px;
  234. .name {
  235. font-size: 19px;
  236. font-family: PingFangSC-Medium, PingFang SC;
  237. font-weight: 500;
  238. color: #232627;
  239. line-height: 26px;
  240. }
  241. .section {
  242. margin-top: 4px;
  243. font-size: 14px;
  244. font-family: PingFangSC-Medium, PingFang SC;
  245. font-weight: 500;
  246. color: #232627;
  247. line-height: 19px;
  248. }
  249. }
  250. }
  251. .file_list {
  252. .item {
  253. height: 49px;
  254. display: flex;
  255. justify-content: space-between;
  256. align-items: center;
  257. border-bottom: 1px solid #ECF0F1;
  258. padding: 8px 0;
  259. .left {
  260. display: flex;
  261. align-items: center;
  262. .icon {}
  263. .info {
  264. height: 49px;
  265. display: flex;
  266. flex-flow: column;
  267. justify-content: space-around;
  268. .name {
  269. font-size: 16px;
  270. font-family: MicrosoftYaHei;
  271. color: #2C3E50;
  272. }
  273. .size {
  274. font-size: 13px;
  275. font-family: MicrosoftYaHei;
  276. color: #BDC3C7;
  277. }
  278. }
  279. }
  280. .right {}
  281. }
  282. }
  283. .img_list {
  284. overflow: hidden;
  285. .item {
  286. float: left;
  287. width: 284rpx;
  288. height: 260rpx;
  289. margin-right: 40rpx;
  290. margin-bottom: 40rpx;
  291. image {
  292. width: 284rpx;
  293. height: 260rpx;
  294. }
  295. }
  296. .item:nth-child(2n) {
  297. margin-right: 0;
  298. }
  299. }
  300. .shenpi_list {
  301. width: 612rpx;
  302. .item {
  303. display: flex;
  304. .name {
  305. width: 200rpx;
  306. color: #009FE8;
  307. }
  308. .list {
  309. width: 412rpx;
  310. .box {
  311. margin-bottom: 8px;
  312. .label {}
  313. .remark {}
  314. }
  315. }
  316. }
  317. }
  318. .remark_text {
  319. border: 1px solid #BDC3C7;
  320. }
  321. }
  322. }
  323. .bottom {
  324. margin-top: 20px;
  325. display: flex;
  326. justify-content: space-around;
  327. .btn {
  328. padding: 8px 40px;
  329. color: #FFFFFF;
  330. border-radius: 60px;
  331. }
  332. }
  333. </style>