business-my.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. <template>
  2. <view class="content">
  3. <view class="title">
  4. <view class="item" :class="active_item == 0?'active':''" @click="click_btn(0)">全部</view>
  5. <view class="item" :class="active_item == 1?'active':''" @click="click_btn(1)">待审核</view>
  6. <view class="item" :class="active_item == 2?'active':''" @click="click_btn(2)">已通过</view>
  7. <view class="item" :class="active_item == 3?'active':''" @click="click_btn(3)">被驳回</view>
  8. </view>
  9. <view class="list">
  10. <view class="item" v-for="(item,index) in list" :key="index" v-if="active_item == 0" :style="item.state == 3?'border-top-color: red;':''">
  11. <view class="top">
  12. <view class="user">
  13. <view class="img" v-if="item.staff_avatar">
  14. <image :src="item.staff_avatar" mode="aspectFill"></image>
  15. </view>
  16. <view class="info">
  17. <view class="text">{{item.section}}{{item.staff}}</view>
  18. <view class="text">编号:#{{item.id}} {{item.created_at}}</view>
  19. </view>
  20. </view>
  21. <view class="state" v-if="item.state == 1">{{item.status}}</view>
  22. <view class="state" v-if="item.state == 2">{{item.status}}</view>
  23. <view class="state" v-if="item.state == 3" style="color: red;">{{item.status}}</view>
  24. </view>
  25. <view class="inner">
  26. <view class="class_name">{{item.classify}} : </view>
  27. <view class="name">{{item.title}}</view>
  28. <view class="tip">{{item.introduce}}</view>
  29. </view>
  30. <view class="bottom">
  31. <view class="btn" style="background-color: #FDDD9B; margin-right: 10px;" v-if="item.state == 1" @click="del_btn(item.id,item.title)">撤回</view>
  32. <view class="btn" @click="go_chakan(item.id,item.title)">查看</view>
  33. </view>
  34. </view>
  35. <view class="item" v-for="(item,index) in list" :key="index" v-if="active_item == 1 && item.state == 1">
  36. <view class="top">
  37. <view class="user">
  38. <!-- <view class="img">
  39. <image :src="item.staff_avatar" mode="aspectFill"></image>
  40. </view> -->
  41. <view class="info">
  42. <view class="text">{{item.section}}{{item.staff}}</view>
  43. <view class="text">编号:#{{item.id}} {{item.created_at}}</view>
  44. </view>
  45. </view>
  46. <view class="state" v-if="item.state == 1">{{item.status}}</view>
  47. </view>
  48. <view class="inner">
  49. <view class="class_name">{{item.classify}} : </view>
  50. <view class="name">{{item.title}}</view>
  51. <view class="tip">{{item.introduce}}</view>
  52. </view>
  53. <view class="bottom">
  54. <view class="btn" style="background-color: #FDDD9B; margin-right: 10px;" v-if="item.state == 1" @click="del_btn(item.id,item.title)">撤回</view>
  55. <view class="btn" @click="go_chakan(item.id,item.title)">查看</view>
  56. </view>
  57. </view>
  58. <view class="item" v-for="(item,index) in list" :key="index" v-if="active_item == 2 && item.state == 2">
  59. <view class="top">
  60. <view class="user">
  61. <!-- <view class="img">
  62. <image :src="item.staff_avatar" mode="aspectFill"></image>
  63. </view> -->
  64. <view class="info">
  65. <view class="text">{{item.section}}{{item.staff}}</view>
  66. <view class="text">编号:#{{item.id}} {{item.created_at}}</view>
  67. </view>
  68. </view>
  69. <view class="state" v-if="item.state == 2">{{item.status}}</view>
  70. </view>
  71. <view class="inner">
  72. <view class="class_name">{{item.classify}} : </view>
  73. <view class="name">{{item.title}}</view>
  74. <view class="tip">{{item.introduce}}</view>
  75. </view>
  76. <view class="bottom">
  77. <view class="btn" @click="go_chakan(item.id,item.title)">查看</view>
  78. </view>
  79. </view>
  80. <view class="item" v-for="(item,index) in list" :key="index" v-if="active_item == 3 && item.state == 3" style="border-top-color: red;">
  81. <view class="top">
  82. <view class="user">
  83. <!-- <view class="img">
  84. <image :src="item.staff_avatar" mode="aspectFill"></image>
  85. </view> -->
  86. <view class="info">
  87. <view class="text">{{item.section}}{{item.staff}}</view>
  88. <view class="text">编号:#{{item.id}} {{item.created_at}}</view>
  89. </view>
  90. </view>
  91. <view class="state" v-if="item.state == 3" style="color: red;">{{item.status}}</view>
  92. </view>
  93. <view class="inner">
  94. <view class="class_name">{{item.classify}} : </view>
  95. <view class="name">{{item.title}}</view>
  96. <view class="tip">{{item.introduce}}</view>
  97. </view>
  98. <view class="bottom">
  99. <view class="btn" @click="go_chakan(item.id,item.title)">查看</view>
  100. </view>
  101. </view>
  102. </view>
  103. </view>
  104. </template>
  105. <script>
  106. export default {
  107. data() {
  108. return {
  109. active_item:0,
  110. list:[],
  111. page:1,
  112. page_size:10,
  113. state:0
  114. };
  115. },
  116. onLoad() {
  117. this.get_worksheet_apply_listmei()
  118. },
  119. onReachBottom(){
  120. console.log("++")
  121. this.page++
  122. this.get_worksheet_apply_listmei()
  123. },
  124. methods:{
  125. // 切换列表
  126. click_btn(item){
  127. this.active_item = item
  128. this.state = item
  129. this.page = 1
  130. this.list = []
  131. // 刷新数据
  132. this.get_worksheet_apply_listmei()
  133. },
  134. go_chakan(id,title){
  135. console.log(id,title)
  136. uni.navigateTo({
  137. url:"chakan/chakan?id=" + id + "&title=" + title
  138. })
  139. },
  140. get_worksheet_apply_listmei(){
  141. uni.showLoading()
  142. this.$api.worksheet_apply_listmei({
  143. page:this.page,
  144. size:this.page_size,
  145. state:this.state,
  146. }).then((res)=>{
  147. // console.log(res.data.data)
  148. if(this.page == 1 && res.data.data == 0){
  149. this.list = []
  150. }else{
  151. this.list = this.list.concat(res.data.data)
  152. }
  153. uni.hideLoading()
  154. })
  155. },
  156. // 撤回
  157. del_btn(id,title){
  158. console.log(id,title)
  159. uni.showModal({
  160. title: '撤回提醒',
  161. content: '是否撤回' + title + '?',
  162. success: (res) => {
  163. if (res.confirm) {
  164. // console.log('用户点击确定');
  165. this.$api.worksheet_orderdel({
  166. id:id
  167. }).then((res)=>{
  168. // console.log(res)
  169. this.get_worksheet_apply_listmei()
  170. })
  171. } else if (res.cancel) {
  172. console.log('用户点击取消');
  173. }
  174. }
  175. });
  176. }
  177. }
  178. }
  179. </script>
  180. <style lang="scss">
  181. .content{
  182. width: 749rpx;
  183. }
  184. .title{
  185. height: 43px;
  186. display: flex;
  187. border-bottom: 1px solid #E4E4E4;
  188. .item{
  189. width: 249rpx;
  190. line-height: 43px;
  191. text-align: center;
  192. font-size: 16px;
  193. color: #BDC3C7;
  194. }
  195. .active{
  196. border-bottom: 2px solid #16A085;
  197. color: #16A085;
  198. }
  199. }
  200. .list{
  201. box-sizing: border-box;
  202. padding: 24rpx;
  203. .item{
  204. width: 700rpx;
  205. border-radius: 6px;
  206. border: 1px solid #EDEFF9;
  207. border-top: 2px solid #00D983;
  208. box-sizing: border-box;
  209. padding: 10px 25rpx;
  210. margin-bottom: 15px;
  211. .top{
  212. display: flex;
  213. justify-content: space-between;
  214. .user{
  215. display: flex;
  216. .img{
  217. width: 60px;
  218. height: 60px;
  219. border-radius: 50%;
  220. overflow: hidden;
  221. image{
  222. width: 60px;
  223. height: 60px;
  224. }
  225. }
  226. .info{
  227. margin-left: 10rpx;
  228. height: 60px;
  229. .text{
  230. line-height: 25px;
  231. font-size: 12px;
  232. }
  233. }
  234. }
  235. .state{
  236. width: 150rpx;
  237. text-align: right;
  238. line-height: 25px;
  239. font-size: 12px;
  240. color: #2ECC71;
  241. }
  242. }
  243. .inner{
  244. margin: 10px auto;
  245. width: 650rpx;
  246. border: 1px solid #EDEFF9;
  247. border-radius: 6px;
  248. box-sizing: border-box;
  249. padding: 10px;
  250. font-size: 12px;
  251. .class_name{
  252. line-height: 20px;
  253. color: #3498DB;
  254. }
  255. .name{
  256. line-height: 20px;
  257. }
  258. .tip{
  259. line-height: 20px;
  260. text-indent: 2em;
  261. }
  262. }
  263. .bottom{
  264. text-align: right;
  265. .btn{
  266. display: inline-block;
  267. width: 80px;
  268. text-align: center;
  269. line-height: 30px;
  270. font-size: 12px;
  271. color: #FFFFFF;
  272. background-color: #3498DB;
  273. }
  274. }
  275. }
  276. }
  277. </style>