index.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <template>
  2. <view class="archive">
  3. <u-navbar ref="uNavbar" :border-bottom="false" :back-icon-color="setNav.backColor" :is-back="setNav.isdisPlayNavTitle" :title-size="setNav.size" :title-bold="setNav.bold" :title="setNav.navTitle" :title-color="setNav.color" :background="setNav"></u-navbar>
  4. <view class="topNav" :style="{top: topNav + 'px'}">
  5. <view class="item">
  6. <view class="text" :class="{active: active == 0}" @click="setNavs(0)">发文</view>
  7. </view>
  8. <view class="item">
  9. <view class="text" :class="{active: active == 1}" @click="setNavs(1)">收文</view>
  10. </view>
  11. </view>
  12. <view class="searchBox">
  13. <view class="inputBox">
  14. <u-input class="input" v-model="searchVal" type="text" height="70" placeholder="请输入标题" placeholderStyle="{'color:#AAAAAA'}" />
  15. <view class="btn" @click="search">查询</view>
  16. </view>
  17. <view class="timeBox" @click="showTime = true">
  18. <image class="r" src="/static/img/icon_xzrq.png" mode=""></image>
  19. <view class="text">{{message_time || '选择日期'}}</view>
  20. <image class="d" src="/static/img/icon_xzrq_xl.png" mode=""></image>
  21. </view>
  22. </view>
  23. <view class="contentMain" v-if="list.length">
  24. <view
  25. v-for="(item, index) in list"
  26. :key="item.id"
  27. class="u-swipe-action "
  28. >
  29. <view class="item">
  30. <view class="title">{{item.message_title}}</view>
  31. <view class="userInfo">
  32. <view class="user">
  33. <view class="name">拟稿人:{{item.send_user_name}}</view>
  34. <view class="name">发文日期:{{item.message_time}}</view>
  35. <view class="name">流程结束日期:{{item.finish_time}}</view>
  36. </view>
  37. <view class="status">{{item.status}}</view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="no-data" v-else>暂无数据</view>
  43. <u-picker mode="time" v-model="showTime" :params="params" @confirm="getTime"></u-picker>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. data() {
  49. return {
  50. setNav:{
  51. backgroundColor:'#fff', //背景色
  52. color:'#333', //字体颜色
  53. bold: true,
  54. size: '36',
  55. backColor: '#333',
  56. isdisPlayNavTitle: true, //是否显示返回按钮
  57. navTitle:'已归档' //导航标题
  58. },
  59. showTime: false,
  60. searchVal: '',
  61. topNav: 0,
  62. list: [],
  63. disabled: false,
  64. btnWidth: 180,
  65. show: false,
  66. userInfo: {},
  67. pageNo: 1,
  68. active: 0,
  69. message_time: '',
  70. options: [
  71. {
  72. text: '归档',
  73. style: {
  74. backgroundColor: '#00B034'
  75. }
  76. }
  77. ],
  78. params: {
  79. year: true,
  80. month: true,
  81. day: true
  82. },
  83. total: 0
  84. }
  85. },
  86. onReachBottom() {
  87. if (this.list.length >= this.total) {
  88. return
  89. }
  90. this.pageNo += 1
  91. this.getQueryList()
  92. },
  93. onLoad() {
  94. this.userInfo = JSON.parse(uni.getStorageSync('userInfo') || '{}');
  95. this.getQueryList()
  96. setTimeout(() => {
  97. this.topNav = (this.$refs.uNavbar.navbarHeight) + (this.$refs.uNavbar.statusBarHeight)
  98. }, 10)
  99. },
  100. methods:{
  101. search () {
  102. this.pageNo = 1
  103. this.getQueryList()
  104. },
  105. async getQueryList() {
  106. let res = await this.$u.post(`boman-web-core/p/cs/queryList`, {
  107. "table": "boman_message",
  108. "pageNo": this.pageNo,
  109. "isUi": false,
  110. "pageSize": 10,
  111. "orderBy": "create_time desc",
  112. "fixedData": {
  113. "condition": {
  114. "place_on_file": 2,
  115. "send_user_id": this.userInfo.id,
  116. "message_title": this.searchVal,
  117. "create_time": this.message_time,
  118. "is_del":"N"
  119. }
  120. }
  121. })
  122. if (res.data && res.data.rows) {
  123. res.data.rows = res.data.rows.map(item => {
  124. return Object.assign({}, item, {
  125. show: false
  126. })
  127. })
  128. if (this.pageNo == 1) {
  129. this.list = res.data.rows
  130. } else {
  131. this.list = this.list.concat(res.data.rows)
  132. }
  133. }
  134. },
  135. getTime(e) {
  136. // console.log(e);
  137. this.message_time = `${e.year}-${e.month}-${e.day}`
  138. this.pageNo = 1
  139. this.getQueryList()
  140. },
  141. async click(index, index1) {
  142. let res = await this.$u.get('boman-web-core/p/cs/objectSave', {
  143. "table": "boman_message",
  144. "objId": this.data[index].id,
  145. "fixedData": {
  146. "place_on_file": "2"
  147. }
  148. })
  149. if (res.code == 200) {
  150. uni.showToast({
  151. title: res.msg
  152. })
  153. this.pageNo = 1
  154. this.getQueryList()
  155. } else {
  156. uni.showToast({
  157. title: res.msg,
  158. icon: 'none'
  159. })
  160. }
  161. },
  162. // 如果打开一个的时候,不需要关闭其他,则无需实现本方法
  163. open(index) {
  164. // 先将正在被操作的swipeAction标记为打开状态,否则由于props的特性限制,
  165. // 原本为'false',再次设置为'false'会无效
  166. this.list[index].show = true;
  167. this.list.map((val, idx) => {
  168. if(index != idx) this.list[idx].show = false;
  169. })
  170. },
  171. setNavs (active) {
  172. this.active = active
  173. this.pageNo = 1
  174. if (active == 0) {
  175. this.getQueryList()
  176. } else {
  177. this.list = []
  178. }
  179. }
  180. }
  181. }
  182. </script>
  183. <style>
  184. page{
  185. background: #FFFFFF;
  186. }
  187. </style>
  188. <style lang="scss" scoped>
  189. .topNav{
  190. display: flex;
  191. align-items: center;
  192. background: #FFFFFF;
  193. height: 90rpx;
  194. box-shadow: 0px 14rpx 10rpx 0px rgba(218, 218, 218, 0.35);
  195. position: sticky;
  196. width: 100%;
  197. left: 0;
  198. z-index: 9;
  199. .item{
  200. flex: 1;
  201. display: flex;
  202. align-items: center;
  203. justify-content: center;
  204. .text{
  205. font-size: 26rpx;
  206. color: #191919;
  207. font-weight: 600;
  208. }
  209. .active{
  210. position: relative;
  211. &::after{
  212. content: '';
  213. position: absolute;
  214. width: 28rpx;
  215. height: 6rpx;
  216. background: #009FE8;
  217. border-radius: 6rpx;
  218. bottom: -14rpx;
  219. left: 50%;
  220. transform: translate(-50%,0);
  221. }
  222. }
  223. }
  224. }
  225. .searchBox{
  226. padding: 30rpx;
  227. .inputBox{
  228. display: flex;
  229. align-items: center;
  230. .input{
  231. flex: 1;
  232. width: 100%;
  233. margin-right: 30rpx;
  234. background: #EDEDED;
  235. border-radius: 40rpx;
  236. padding: 0 30rpx !important;
  237. }
  238. .btn{
  239. background: #009FE8;
  240. color: #FFFFFF;
  241. font-size: 26rpx;
  242. height: 60rpx;
  243. line-height: 60rpx;
  244. padding: 0 30rpx;
  245. text-align: center;
  246. border-radius: 40rpx;
  247. }
  248. }
  249. }
  250. .timeBox{
  251. padding: 30rpx 0 20rpx 0;
  252. display: flex;
  253. align-items: center;
  254. .r{
  255. width: 30rpx;
  256. height: 33rpx;
  257. }
  258. .text{
  259. font-size: 26rpx;
  260. color: #343434;
  261. margin: 0 14rpx;
  262. }
  263. .d{
  264. width: 20rpx;
  265. height: 20rpx;
  266. }
  267. }
  268. .contentMain{
  269. .item{
  270. .title{
  271. font-size: 28rpx;
  272. font-weight: 700;
  273. color: #343434;
  274. padding: 30rpx 30rpx 0 30rpx;
  275. white-space: break-word;
  276. word-break:break-all;
  277. }
  278. .userInfo{
  279. display: flex;
  280. align-items: flex-end;
  281. border-bottom: solid 1rpx #DADADA;
  282. padding: 30rpx;
  283. .user{
  284. flex: 1;
  285. color: #666;
  286. font-size: 24rpx;
  287. .name{
  288. margin-bottom: 10rpx;
  289. }
  290. }
  291. .status{
  292. color: #AAAAAA;
  293. font-size: 26rpx;
  294. margin-bottom: 4rpx;
  295. }
  296. }
  297. }
  298. }
  299. </style>