toExamine.vue 9.5 KB

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