toExamine.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. <template>
  2. <!-- 笔记审核 -->
  3. <view class="container to-examine" v-if="detailDataForm.HasPermission == 1">
  4. <view class="content-item">
  5. <view class="author-name">
  6. <view class="img-box">
  7. <image :src="detailDataForm.HeadImg" @click="goDetailPages"></image>
  8. </view>
  9. <text style="margin-left: 10rpx">{{ detailDataForm.NickName }}</text>
  10. </view>
  11. <view class="type-time">
  12. <view class="type"> {{ detailDataForm.Type == 1 ? "笔 记" : "观 点" }} </view>
  13. <view class="time">{{ detailDataForm.PublishTime }}</view>
  14. </view>
  15. <view class="title-item global_title"> {{ detailDataForm.Title }}</view>
  16. <view class="text-conten">
  17. <mp-html :content="detailDataForm.Content" />
  18. </view>
  19. <block v-if="detailDataForm.Docs && detailDataForm.Docs.length > 0">
  20. <view @click="goFilePages(item)" class="file-item text_oneLine" v-for="(item, index) in detailDataForm.Docs" :key="index"> <image :src="item.DocIcon"></image> {{ item.DocName }} </view>
  21. </block>
  22. <view class="image-conten">
  23. <image v-for="key in dataProcessing(detailDataForm.ImgUrl)" :key="key" :src="key" @click="previewImageMediahandler(key)"></image>
  24. </view>
  25. <view class="lable-conten">
  26. <view class="item" v-for="key in dataProcessing(detailDataForm.Tags)" :key="key">{{ key }}</view>
  27. </view>
  28. <block v-if="detailDataForm.IsShowExamine">
  29. <image v-if="detailDataForm.ExamineStatus == 3" class="label-image" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/pass_through.png"></image>
  30. <image v-if="detailDataForm.ExamineStatus == 4" class="label-image" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/overrule_icon.png"></image>
  31. </block>
  32. </view>
  33. <view class="bottom-btn" v-if="detailDataForm.ExamineStatus == 2 && isShow">
  34. <view @click="rejectTextShow = true">驳回</view>
  35. <view @click="passRhrouhg">通过</view>
  36. </view>
  37. <u-modal
  38. v-model="rejectTextShow"
  39. :show-title="false"
  40. show-cancel-button
  41. confirm-text="确定"
  42. cancel-text="取消"
  43. :content-style="{ fontSize: '32rpx' }"
  44. :cancel-style="{ borderRight: '1rpx solid #EBEBEB' }"
  45. :confirm-style="{ fontWeight: '700' }"
  46. @confirm="confirmModal"
  47. @cancel="cancelModal"
  48. >
  49. <view class="slot-content slot-content-text">
  50. <text class="add-lable-txt">驳回理由</text>
  51. <input v-model="rejectText" placeholder="请输入驳回理由" />
  52. </view>
  53. </u-modal>
  54. <Loading />
  55. </view>
  56. <view class="nodata" v-else>
  57. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
  58. <text>报告加急审核中,请耐心等待~</text>
  59. </view>
  60. </template>
  61. <script>
  62. import { purchaserApi } from "@/config/api";
  63. export default {
  64. data() {
  65. return {
  66. rejectTextShow: false,
  67. rejectText: "",
  68. detailDataForm: "",
  69. detailId: 0,
  70. isShow: false,
  71. };
  72. },
  73. methods: {
  74. previewImageMediahandler(key) {
  75. uni.previewImage({
  76. urls: [key], //查看图片的数组
  77. });
  78. },
  79. passRhrouhg() {
  80. uni.showModal({
  81. title: "提醒",
  82. content: "确定通过此内容在小程序展示吗?",
  83. confirmColor: "#376cbb",
  84. cancelColor: "#606266",
  85. success: async (res) => {
  86. if (res.confirm) {
  87. const res = await purchaserApi.yanxuanSpecialEnable({
  88. Id: this.detailId,
  89. Status: 1, //1通过2驳回
  90. });
  91. if (res.Ret === 200) {
  92. this.$util.toast("审核通过");
  93. uni.navigateBack({
  94. fail() {
  95. uni.navigateTo({
  96. url: "/pages-purchaser/specialColumn/specialColumn",
  97. });
  98. },
  99. });
  100. }
  101. }
  102. },
  103. });
  104. },
  105. // 数据处理
  106. dataProcessing(item) {
  107. return item ? item.split(",") : [];
  108. },
  109. // 弹框关闭事件
  110. cancelModal() {
  111. this.rejectTextShow = false;
  112. this.rejectText = "";
  113. },
  114. // 弹框确定事件
  115. async confirmModal() {
  116. const res = await purchaserApi.yanxuanSpecialEnable({
  117. Id: this.detailId,
  118. Status: 2, //1通过2驳回
  119. Reason: this.rejectText,
  120. });
  121. if (res.Ret === 200) {
  122. this.cancelModal();
  123. uni.navigateBack({
  124. fail() {
  125. uni.navigateTo({
  126. url: "/pages-purchaser/specialColumn/specialColumn",
  127. });
  128. },
  129. });
  130. }
  131. },
  132. // 获取专栏详情
  133. async getDetaliData() {
  134. const res = await purchaserApi.yanxuanSpecialDetail({
  135. Id: this.detailId,
  136. IsSendWx: 1,
  137. });
  138. if (res.Ret === 200) {
  139. this.detailDataForm = res.Data;
  140. }
  141. },
  142. // 去往预览文件
  143. goFilePages(item) {
  144. wx.downloadFile({
  145. // 示例 url,并非真实存在
  146. url: item.DocUrl,
  147. success: function (res) {
  148. const filePath = res.tempFilePath;
  149. wx.openDocument({
  150. filePath: filePath,
  151. success: function (res) {
  152. console.log("打开文档成功");
  153. },
  154. });
  155. },
  156. });
  157. },
  158. goDetailPages() {
  159. uni.navigateTo({ url: "/pages-purchaser/columnDetail/columnDetail?id=" + this.detailDataForm.UserId });
  160. },
  161. },
  162. onLoad(options) {
  163. this.detailId = Number(options.id) || 0;
  164. this.isShow = options.isMessage == "模板" ? true : false;
  165. this.detailId > 0 && this.getDetaliData();
  166. },
  167. };
  168. </script>
  169. <style lang="scss" scope>
  170. .to-examine {
  171. padding: 30rpx;
  172. background: $uni-bg-color;
  173. .content-item {
  174. position: relative;
  175. padding: 40rpx;
  176. background-color: #fff;
  177. border-radius: 16rpx;
  178. .type-time {
  179. display: flex;
  180. align-items: center;
  181. justify-content: space-between;
  182. color: #666666;
  183. .type {
  184. width: 110rpx;
  185. height: 42rpx;
  186. line-height: 42rpx;
  187. text-align: center;
  188. border-radius: 38rpx;
  189. color: #928563;
  190. background-color: #fff6de;
  191. font-weight: 500;
  192. }
  193. }
  194. .title-item {
  195. margin: 10rpx 0 20rpx;
  196. line-height: 46rpx;
  197. }
  198. .text-conten {
  199. font-size: 32rpx;
  200. line-height: 44rpx;
  201. }
  202. .file-item {
  203. width: 100%;
  204. height: 42rpx;
  205. margin: 20rpx 0;
  206. display: flex;
  207. align-items: center;
  208. background-color: #f8f8fa;
  209. color: #376cbb;
  210. image {
  211. margin-right: 15rpx;
  212. width: 27rpx;
  213. height: 27rpx;
  214. }
  215. }
  216. .image-conten {
  217. display: flex;
  218. flex-wrap: wrap;
  219. image {
  220. width: 144rpx;
  221. height: 144rpx;
  222. margin-right: 20rpx;
  223. }
  224. }
  225. .lable-conten {
  226. display: flex;
  227. flex-wrap: wrap;
  228. margin: 20rpx 0;
  229. font-size: 24rpx;
  230. .item {
  231. display: flex;
  232. align-items: center;
  233. height: 34rpx;
  234. border-radius: 44rpx;
  235. padding: 0 35rpx;
  236. background-color: #f0f1f3;
  237. margin: 0 20rpx 20rpx 0;
  238. }
  239. }
  240. .collect-conten {
  241. display: flex;
  242. justify-content: flex-end;
  243. align-items: center;
  244. color: #666666;
  245. image {
  246. width: 27rpx;
  247. height: 26rpx;
  248. margin-right: 8rpx;
  249. }
  250. }
  251. .author-name {
  252. display: flex;
  253. align-items: center;
  254. margin-bottom: 50rpx;
  255. .img-box {
  256. width: 48rpx;
  257. height: 48rpx;
  258. overflow: hidden;
  259. font-size: 28rpx;
  260. color: #333;
  261. image {
  262. width: 100%;
  263. height: 100%;
  264. }
  265. }
  266. }
  267. }
  268. .bottom-btn {
  269. position: fixed;
  270. bottom: 0;
  271. left: 0;
  272. width: 100%;
  273. background-color: #fff;
  274. padding: 48rpx 25rpx;
  275. padding-bottom: constant(safe-area-inset-bottom);
  276. padding-bottom: env(safe-area-inset-bottom);
  277. display: flex;
  278. view {
  279. width: 345rpx;
  280. height: 84rpx;
  281. display: flex;
  282. align-items: center;
  283. justify-content: center;
  284. border-radius: 9rpx;
  285. background-color: #2ba471;
  286. color: #fff;
  287. font-weight: 600;
  288. }
  289. view:nth-child(1) {
  290. background-color: #d54941;
  291. margin-right: 12rpx;
  292. }
  293. }
  294. .add-lable-txt {
  295. color: #000;
  296. font-size: 36rpx;
  297. flex-wrap: 600;
  298. margin-bottom: 30rpx;
  299. width: 100%;
  300. text-align: center;
  301. }
  302. .slot-content-text {
  303. text-align: left;
  304. input {
  305. height: 96rpx;
  306. background-color: #f8f8fa;
  307. }
  308. }
  309. .label-image {
  310. position: absolute;
  311. top: 0;
  312. right: 0;
  313. z-index: 9;
  314. width: 222rpx;
  315. height: 222rpx;
  316. }
  317. }
  318. </style>