staff.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. <template>
  2. <view class="staff">
  3. <view class="search">
  4. <input class="uni-input" v-model="keyword" placeholder="请输入" />
  5. <view class="btn" @click="searchHistory()">搜索</view>
  6. </view>
  7. <scroll-view scroll-y="true" class="main" @scrolltolower="more()">
  8. <view class="list" v-for="(v,i) in aList" :key="i">
  9. <view class="li">
  10. <view class="left">
  11. 产品名称
  12. </view>
  13. <view class="right">
  14. {{v.name}}
  15. </view>
  16. </view>
  17. <view class="li">
  18. <view class="left">
  19. 瓶码
  20. </view>
  21. <view class="right">
  22. {{v.bottleId}}
  23. </view>
  24. </view>
  25. <view class="li">
  26. <view class="left">
  27. 箱码
  28. </view>
  29. <view class="right">
  30. {{v.boxId}}
  31. </view>
  32. </view>
  33. <view class="li">
  34. <view class="left">
  35. 配送单
  36. </view>
  37. <view class="right">
  38. {{v.sendId}}
  39. </view>
  40. </view>
  41. <view class="li">
  42. <view class="left">
  43. 配送日期
  44. </view>
  45. <view class="right">
  46. {{getTime(v.sendTime)}}
  47. </view>
  48. </view>
  49. <view class="li">
  50. <view class="left">
  51. 经销商
  52. </view>
  53. <view class="right">
  54. {{v.agencyName}}
  55. </view>
  56. </view>
  57. <view class="li">
  58. <view class="left">
  59. 经销商所在地
  60. </view>
  61. <view class="right">
  62. {{v.agencyRegion}}
  63. </view>
  64. </view>
  65. <view class="li">
  66. <view class="left">
  67. 上报地点
  68. </view>
  69. <view class="right">
  70. {{v.region}}
  71. </view>
  72. </view>
  73. <view class="li">
  74. <view class="left">
  75. 窜货说明
  76. </view>
  77. <view class="right">
  78. {{v.remark}}
  79. </view>
  80. </view>
  81. <view class="li">
  82. <view class="left">
  83. 上报时间
  84. </view>
  85. <view class="right">
  86. {{getTime(v.submitTime)}}
  87. </view>
  88. </view>
  89. <view class="li">
  90. <view class="left">
  91. 上报人
  92. </view>
  93. <view class="right button" @click="getPerson(v.submit)">
  94. {{v.submit}}
  95. </view>
  96. </view>
  97. </view>
  98. <uni-load-more :status="status" :content-text="contentText" />
  99. </scroll-view>
  100. <view class="sum">
  101. 总计: {{sum}}个上报记录
  102. </view>
  103. <uni-popup ref="popup" background-color="#fff">
  104. <view class="popup-content" type="center">
  105. <view class="th">
  106. 上报人信息
  107. </view>
  108. <view class="td">
  109. <view class="">
  110. 姓名
  111. </view>
  112. <view class="right">
  113. {{Person.name}}
  114. </view>
  115. </view>
  116. <view class="td">
  117. <view class="">
  118. 性别
  119. </view>
  120. <view class="right">
  121. {{Person.sex}}
  122. </view>
  123. </view>
  124. <view class="td">
  125. <view class="">
  126. 所属公司
  127. </view>
  128. <view class="right">
  129. {{Person.factory}}
  130. </view>
  131. </view>
  132. <view class="td">
  133. <view class="">
  134. 所属部门
  135. </view>
  136. <view class="right">
  137. {{Person.department}}
  138. </view>
  139. </view>
  140. <view class="td">
  141. <view class="">
  142. 职务
  143. </view>
  144. <view class="right">
  145. {{Person.duties}}
  146. </view>
  147. </view>
  148. <view class="td">
  149. <view class="">
  150. 岗位
  151. </view>
  152. <view class="right">
  153. {{Person.duties}}
  154. </view>
  155. </view>
  156. <view class="td">
  157. <view class="">
  158. 账号类型
  159. </view>
  160. <view class="right">
  161. {{Person.post}}
  162. </view>
  163. </view>
  164. <view class="td">
  165. <view class="">
  166. 手机号
  167. </view>
  168. <view class="right">
  169. {{Person.phone}}
  170. </view>
  171. </view>
  172. </view>
  173. </uni-popup>
  174. </view>
  175. </template>
  176. <script>
  177. import {
  178. search,
  179. checkBy
  180. } from '../../api/fleeing.js'
  181. import {
  182. mapState
  183. } from 'vuex'
  184. export default {
  185. props: ['date'],
  186. data() {
  187. return {
  188. keyword: '',
  189. aList: [], //展示的数据
  190. sum: '',
  191. Person: '',
  192. contentText: {
  193. contentdown: '上拉加载更多',
  194. contentrefresh: '加载中',
  195. contentnomore: '没有更多'
  196. },
  197. pages: 1,
  198. status: 'more',
  199. };
  200. },
  201. watch: {
  202. date(v1, v2) {
  203. this.getData()
  204. }
  205. },
  206. computed: {
  207. ...mapState({
  208. submit: store => store.user.name
  209. })
  210. },
  211. mounted() {
  212. this.getData()
  213. },
  214. methods: {
  215. async getData() {
  216. uni.showLoading({
  217. title: '加载中'
  218. });
  219. let res = await search({
  220. conditions: this.keyword,
  221. submit: this.submit || '',
  222. submitTime: this.date,
  223. type: 1,
  224. num: 10,
  225. page: this.pages,
  226. accessToken: uni.getStorageSync('tokenInfo'),
  227. account: uni.getStorageSync('account')
  228. })
  229. uni.hideLoading();
  230. this.aList = [...this.aList, ...res.data.list]
  231. if (res.data.count === this.aList.length) {
  232. this.status = 'noMore'
  233. }
  234. this.sum = res.data.count
  235. },
  236. //人员信息
  237. async getPerson(data) {
  238. const res = await checkBy({
  239. submit: data
  240. })
  241. console.log(res);
  242. this.Person = res.data.data
  243. this.$refs.popup.open()
  244. },
  245. // 获取时间
  246. getTime(time = new Date()) {
  247. let date = new Date(time);
  248. let year = date.getFullYear();
  249. let month = date.getMonth() + 1;
  250. let day = date.getDate();
  251. month >= 1 && month <= 9 ? (month = "0" + month) : "";
  252. day >= 0 && day <= 9 ? (day = "0" + day) : "";
  253. let timer = year + '年' + month + '月' + day + '日';
  254. return timer;
  255. },
  256. // 搜索
  257. searchHistory() {
  258. this.getData()
  259. },
  260. // 上拉加载更多
  261. more() {
  262. if (this.status != 'noMore') {
  263. this.status = 'loading'
  264. this.pages++;
  265. this.getData()
  266. }
  267. }
  268. }
  269. }
  270. </script>
  271. <style lang="scss">
  272. .staff {
  273. height: 100%;
  274. display: flex;
  275. flex-direction: column;
  276. justify-content: space-between;
  277. .search {
  278. height: 80rpx;
  279. display: flex;
  280. padding: 10rpx;
  281. border-bottom: 1rpx solid #dfdfdf;
  282. .uni-input {
  283. flex: 1;
  284. height: 100%;
  285. padding-left: 20rpx;
  286. }
  287. .btn {
  288. width: 20%;
  289. height: 100%;
  290. line-height: 80rpx;
  291. text-align: center;
  292. font-size: 30rpx;
  293. background-color: #f4f4f4;
  294. }
  295. }
  296. .main {
  297. height: calc(100% - 210rpx);
  298. padding: 0 20rpx;
  299. box-sizing: border-box;
  300. .wu {
  301. text-align: center;
  302. margin-top: 30rpx;
  303. }
  304. .list {
  305. border-bottom: 10rpx solid #dfdfdf;
  306. .li {
  307. display: flex;
  308. border-bottom: 1rpx solid #c5c5c5;
  309. padding: 20rpx 0;
  310. &:last-child {
  311. border-bottom: 0;
  312. }
  313. .left {
  314. width: 180rpx;
  315. }
  316. .right {
  317. flex: 1;
  318. color: #707070;
  319. text-align: right;
  320. }
  321. .button {
  322. color: #61aae0;
  323. }
  324. }
  325. }
  326. }
  327. .sum {
  328. height: 120rpx;
  329. line-height: 120rpx;
  330. text-align: center;
  331. color: #e40315;
  332. border-top: 10rpx solid #dfdfdf;
  333. }
  334. .popup-content {
  335. width: 600rpx;
  336. border-radius: 14rpx;
  337. padding-bottom: 100rpx;
  338. .th {
  339. height: 60rpx;
  340. line-height: 60rpx;
  341. text-align: center;
  342. background-color: #eaeaeb;
  343. }
  344. .td {
  345. padding: 15rpx;
  346. border-top: 1rpx solid #e3e3e3;
  347. display: flex;
  348. justify-content: space-between;
  349. }
  350. }
  351. }
  352. </style>