suggestion_not_end.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <template>
  2. <view>
  3. <view class="wrapper" v-if="isShow">
  4. <view class="suggestHead">
  5. <text>建议号</text>
  6. <text class="suggestHeadDetail">{{suggestion.id}}</text>
  7. </view>
  8. <view class="suggestHead">
  9. <text>建议人UID</text>
  10. <text class="suggestHeadDetailID">{{suggestion.fromUid}}</text>
  11. </view>
  12. <view class="suggestHead">
  13. <text>处理人UID</text>
  14. <text class="suggestHeadDetailID">{{suggestion.processorUid}}</text>
  15. </view>
  16. <view class="suggestHead">
  17. <text>建议标题</text>
  18. <text class="suggestHeadDetail">{{suggestion.adviseTitle}}</text>
  19. </view>
  20. <view class="suggestHead">
  21. <text>建议内容</text>
  22. <text class="suggestHeadDetail">{{suggestion.adviseDetail}}</text>
  23. </view>
  24. <view class="suggestHead">
  25. <text>处理结果</text>
  26. <text class="suggestHeadDetail">{{suggestion.result}}</text>
  27. </view>
  28. <view class="suggestHead">
  29. <text>建议日期</text>
  30. <text class="suggestHeadDetail">{{suggestion.fistDatetime}}</text>
  31. </view>
  32. <view class="suggestHead">
  33. <text>结案日期</text>
  34. <text class="suggestHeadDetail">{{suggestion.closetime}}</text>
  35. </view>
  36. <view class="suggestHead">
  37. <text>状态</text>
  38. <text style="width: 50px;" class="handleStatusDetail">{{suggestion.status}}</text>
  39. </view>
  40. </view>
  41. <view class="requires2">
  42. <uni-row >
  43. <text>待结案条数:{{current}}</text>
  44. </uni-row>
  45. </view>
  46. <!-- 提交按钮 -->
  47. <view class="suggestBtn" v-if="isShow">
  48. <button class="cancelBtn" @click="toRefuse">开始结案</button>
  49. <modal v-if="areaShow" title="结案描述必填" confirm-text="提交" cancel-text="取消" @cancel="cancelAdd" @confirm="confirmAdd">
  50. <input type="text" v-model="areaTxt" placeholder="至少5个字" maxlength="50" />
  51. </modal>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. import { mapState } from 'vuex';
  57. export default {
  58. computed: {
  59. ...mapState('m_user', ['token', 'userinfo'])
  60. },
  61. data() {
  62. return {
  63. areaShow: false,
  64. areaTxt:'',
  65. suggestion: {},
  66. index: 0,
  67. current:0,
  68. datas: {},
  69. isShow: false,
  70. };
  71. },
  72. onLoad(){
  73. this.findAllNotEndAdviseList()
  74. },
  75. methods:{
  76. checkIsHaveNext(){
  77. this.current = this.current - 1
  78. this.index = this.index + 1
  79. if(this.current == 0){
  80. this.isShow = false
  81. }else{
  82. this.suggestion = this.datas.list[this.index]
  83. }
  84. },
  85. toRefuse(){
  86. this.areaShow = true
  87. },
  88. cancelAdd(){
  89. this.areaShow = false
  90. },
  91. confirmAdd(){
  92. this.areaShow = false
  93. var strRefuse = this.areaTxt.replace(/\ +/g,"")
  94. strRefuse = strRefuse.replace(/[\r\n]/g,"")
  95. if(strRefuse.length < 5){
  96. uni.$showMsg("有效字数少于5个,请增加!")
  97. }else{
  98. strRefuse = this.suggestion.result +',已处理' + this.userinfo.uid + strRefuse
  99. // 开始向后端提交数据
  100. this.submitToBack(this.suggestion.id,"已处理",strRefuse,this.userinfo.uid)
  101. this.checkIsHaveNext()
  102. }
  103. },
  104. async findAllNotEndAdviseList() {
  105. const { data: result } = await uni.$http.get('/education/my-suggestion/findAllNotEndAdviseList')
  106. // console.log(result)
  107. this.current = result.data.list.length
  108. if(this.current > 0){
  109. this.datas = result.data
  110. this.suggestion = this.datas.list[this.index ]
  111. this.isShow = true
  112. }
  113. //console.log(this.item)
  114. },
  115. async submitToBack(adviseid,status,text,procuid) {
  116. // 准备参数对象
  117. const query = {
  118. adviseid: adviseid,
  119. status: status,
  120. text: text,
  121. procuid: procuid,
  122. }
  123. const {
  124. data: result
  125. } = await uni.$http.get('/education/my-suggestion/updateAdviseInfo',query)
  126. //console.log(result)
  127. uni.$showMsg(result.message , 2000)
  128. },
  129. }
  130. }
  131. </script>
  132. <!-- 设置页面背景 -->
  133. <style lang="scss">
  134. page{
  135. height: 100%;
  136. // background-color: #FFF;
  137. }
  138. </style>
  139. <style lang="scss" scoped>
  140. // page {
  141. // height: 100%;
  142. // background-color: #FFF2CC;
  143. // }
  144. .wrapper {
  145. width: 93%;
  146. padding: 20rpx;
  147. margin-left: 10rpx;
  148. border-radius: 30rpx;
  149. background-color: #FFF;
  150. font-size: 30rpx;
  151. }
  152. /* 建议号、建议人、建议日期 */
  153. .suggestHead {
  154. display: flex;
  155. }
  156. .suggestHeadDetail,
  157. .suggestHeadDetailID {
  158. margin-left: 20rpx;
  159. font-weight: bold;
  160. }
  161. /* 建议人和处理人ID */
  162. .suggestHeadDetailID {
  163. color: #00B0F0;
  164. text-decoration: underline;
  165. }
  166. /* 建议标题 */
  167. .suggestTitle{
  168. // margin-top: 10rpx;
  169. display: flex;
  170. }
  171. /* 状态详情颜色 */
  172. .handleStatusDetail {
  173. font-weight: bold;
  174. color: red;
  175. margin-left: 20rpx;
  176. }
  177. .requires2 {
  178. background-color: #FFF;
  179. margin: 20rpx 20rpx;
  180. border-radius: 50rpx;
  181. font-size: 30rpx;
  182. padding: 20rpx 20rpx;
  183. //font-weight: bold;
  184. color: gray;
  185. display: flex;
  186. align-items: center;
  187. justify-content: center;
  188. }
  189. /* 下方按钮 */
  190. .suggestBtn{
  191. display: flex;
  192. padding: 60rpx;
  193. justify-content: space-around;
  194. }
  195. .cancelBtn{
  196. font-size: 30rpx;
  197. height: 85rpx;
  198. width: 200rpx;
  199. line-height: 85rpx;
  200. border-radius: 50rpx;
  201. text-align: center;
  202. color: white;
  203. margin-top: 5rpx;
  204. }
  205. .cancelBtn{
  206. background-color: #3ed598;
  207. }
  208. </style>