index.vue 6.8 KB

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