index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. <template>
  2. <view :class="show ? 'tl-show': ''">
  3. <view>
  4. <view style='background:#fff;display:flex;' class="cu-bar search">
  5. <view style='flex:6;' class="search-form round Medium">
  6. <text style='color: #ccc;text-indent:6px;' class="cuIcon-search"></text>
  7. <input type="text" maxlength="20" v-model="searchKeyWord" @confirm="doSearch()"
  8. placeholder="请输入买方名称或编号" confirm-type="search"></input>
  9. </view>
  10. <view @click='doSearch()' class="Regular" style="width:4%;flex:1;">搜索</view>
  11. <u-icon @click='emptysearch' class="cuIcon" v-if='searchKeyWord.length>0' size="34"
  12. name="close-circle-fill" color="#D6D9E0"></u-icon>
  13. <!-- <text @click='emptysearch' v-if='searchKeyWord.length>0' class='tip_text cuIcon-roundclosefill'></text> -->
  14. </view>
  15. <view style='background:#fff;padding:0 15px;border-radius:0rpx 0rpx 30rpx 30rpx;position:relative;' class="Semibold">
  16. <view @click='tabcarchange(0)' class='line' :class='TabCur==0?"active":""'>全部</view>
  17. <view @click='tabcarchange(5)' class='line' :class='TabCur==5?"active":""'>待付款</view>
  18. <view @click='tabcarchange(6)' class='line' :class='TabCur==6?"active":""'>已付款</view>
  19. <view style='position:absolute;right: 20px;font-weight:500;top:25%;' @click='dateshow=true'>{{datetext?datetext:'日期筛选'}}</view>
  20. </view>
  21. <u-picker :range="dateList" range-key="value" @confirm='dateCheck($event)' v-model="dateshow"
  22. mode="selector">
  23. </u-picker>
  24. </view>
  25. <view class='wrap' v-for='item in dataInfo'>
  26. <view style='margin:5px;padding:10px 0;border-bottom:1px solid #eee;'
  27. class="flex justify-between align-item-center">
  28. <view style='color:#878C9C;'>{{item.paymentNo}}</view>
  29. <view class='already' v-if='item.status=="部分付款"'>部分付款</view>
  30. <view class='already' v-else-if='item.status=="全部付款"'>全部付款</view>
  31. <view class='not' v-else>待付款</view>
  32. </view>
  33. <view style='line-height:30px;'>
  34. <view class='purchaser'>买方</view>
  35. <view style='font-size:14px;display:inline-block;'>{{item.compName}}</view>
  36. </view>
  37. <view style='line-height:30px;'>
  38. <view class='flex justify-between align-item-center'>
  39. <view>
  40. <view class='seller'>卖方</view>
  41. <view style='font-size:14px;display:inline-block;'>{{item.customerName}}</view>
  42. </view>
  43. <view>{{item.carNo}}</view>
  44. </view>
  45. </view>
  46. <view class='flex justify-between align-item-center'>
  47. <view style="color:#878C9C;padding:5px;">{{item.goodsName}}</view>
  48. <view>{{item.netWeight}}</view>
  49. </view>
  50. <view class='flex justify-between align-item-center'>
  51. <view style="color:#878C9C;padding:5px;">单价</view>
  52. <view>{{(item.tidalGrainPrice-item.unitDeduction).toFixed(3)}}</view>
  53. </view>
  54. <view class='flex justify-between align-item-center'>
  55. <view style="color:#878C9C;padding:5px;">应付</view>
  56. <view>{{item.amountIngPayable}}</view>
  57. </view>
  58. <view class='flex justify-between align-item-center'>
  59. <view style='color:#878C9C;padding:5px;'>已付</view>
  60. <view>{{item.amountEdPayable}}</view>
  61. </view>
  62. <view style='flex-direction:row-reverse;' class='flex'>
  63. <view v-show="item.pictureAddress" @click='showImage(item.pictureAddress)' class='button'>结算单</view>
  64. <view v-show="item.weighingPictureAddress" @click='showImage(item.weighingPictureAddress)'
  65. class='button'>检斤单</view>
  66. <view v-show="item.qualityInspectionPictureAddress"
  67. @click='showImage(item.qualityInspectionPictureAddress)' class='button'>质检单</view>
  68. </view>
  69. </view>
  70. <view v-show="isContent">
  71. <uni-load-more :status="loadStatus"></uni-load-more>
  72. </view>
  73. <view @click='closepop' class='popup' v-if='show'>
  74. <view class='imagewrap' style='text-align:center;'>
  75. <image :src="img" mode="aspectFit"></image>
  76. </view>
  77. <view @click='xiazai' class='xiazai'>
  78. <image style='width:24px;height:24px;' src="../../static/img/erp/xiazai@3x.png" mode=""></image>
  79. </view>
  80. </view>
  81. <u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
  82. :content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='提示'
  83. :showCancelButton='false' :content="content" @confirm="alertBtn" @cancel="cancelClick"></u-modal>
  84. </view>
  85. </template>
  86. <script>
  87. import {
  88. mapState
  89. } from 'vuex';
  90. export default {
  91. name: "business",
  92. data() {
  93. return {
  94. isShowAlert: false,
  95. content: '您尚未登录,是否立即登录?',
  96. TabCur: 0,
  97. pageSize: 10,
  98. currentPage: 1,
  99. isLoadMore: false,
  100. isContent: false,
  101. loadStatus: 'noMore',
  102. searchKeyWord: '',
  103. show: false,
  104. img: '',
  105. searchType: '',
  106. dataInfo: [],
  107. dateshow:false,
  108. dateList:[{value:'一个月'},{value:'三个月'},{value:'一年'}],
  109. datetext:'一个月'
  110. }
  111. },
  112. onShow() {},
  113. onLoad(options) {
  114. this.loadData();
  115. },
  116. computed: {
  117. ...mapState(['hasLogin', 'userInfo']),
  118. },
  119. // onPageScroll(e) {
  120. // this.scrollTop = e.scrollTop;
  121. // },
  122. //下拉刷新
  123. onPullDownRefresh() {
  124. this.currentPage = 1
  125. this.isLoadMore = false
  126. this.loadStatus = 'loading'
  127. this.loadData()
  128. setTimeout(function() {
  129. uni.stopPullDownRefresh();
  130. }, 1000);
  131. },
  132. onReachBottom() { //上拉触底函数
  133. if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
  134. this.isLoadMore = true
  135. this.currentPage += 1
  136. this.loadData("add")
  137. }
  138. },
  139. methods: {
  140. closepop() {
  141. this.show = false
  142. },
  143. dateCheck(e){
  144. this.datetext=this.dateList[e[0]].value
  145. this.loadData()
  146. },
  147. xiazai() {
  148. const that = this;
  149. uni.downloadFile({
  150. url: that.img,
  151. success: res => {
  152. if (res.statusCode === 200) {
  153. uni.saveImageToPhotosAlbum({
  154. filePath: res.tempFilePath,
  155. success: function() {
  156. this.tools.toast('保存成功');
  157. that.show = false
  158. },
  159. fail: function() {
  160. this.tools.toast('保存失败,请稍后重试');
  161. }
  162. });
  163. } else {
  164. this.tools.toast('下载失败');
  165. }
  166. }
  167. });
  168. },
  169. showImage(url) {
  170. var img = [];
  171. img.push(url)
  172. uni.previewImage({
  173. current: 0,
  174. urls: img
  175. });
  176. },
  177. tabcarchange(status) {
  178. this.TabCur = status
  179. if (status == 0) {
  180. this.searchType = ''
  181. } else {
  182. this.searchType = status
  183. }
  184. this.currentPage = 1
  185. this.loadData()
  186. },
  187. top() { //回到顶部
  188. uni.pageScrollTo({
  189. scrollTop: 0,
  190. duration: 300
  191. });
  192. },
  193. naviageToPage(page) {
  194. page = page + this.TabCur
  195. uni.navigateTo({
  196. url: page,
  197. fail() {
  198. uni.switchTab({
  199. url: page
  200. })
  201. }
  202. })
  203. },
  204. locationChange(e) {
  205. console.log(e)
  206. this.location = this.locationType[e[0]]
  207. this.receivePrivate = this.locationType[e[0]]
  208. this.currentPage = 1
  209. this.loadData()
  210. },
  211. tabSelect(e) {
  212. this.TabCur = e.currentTarget.dataset.id;
  213. this.category = this.TabCur
  214. this.currentPage = 1
  215. this.loadData()
  216. },
  217. emptysearch() {
  218. this.searchKeyWord = ''
  219. this.dataInfo = []
  220. this.loadData()
  221. },
  222. doSearch() {
  223. this.dataInfo = []
  224. this.currentPage = 1
  225. this.isLoadMore = false
  226. this.loadData()
  227. },
  228. alertBtn() {
  229. uni.navigateTo({
  230. url: '/pages/public/login'
  231. })
  232. },
  233. cancelClick() {
  234. this.isShowAlert = false
  235. },
  236. //加载商品 ,带下拉刷新和上滑加载
  237. async loadData(type, loading) {
  238. if(!this.hasLogin){
  239. this.isShowAlert = true;
  240. // ni.showModal({
  241. // title: '提示',
  242. // content: '您尚未登录,是否立即登录?',
  243. // showCancel: true,
  244. // confirmText: '登录',
  245. // success: (e) => {
  246. // if (e.confirm) {
  247. // uni.navigateTo({
  248. // url: '/pages/public/login'
  249. // })
  250. // }
  251. // },
  252. // fail: () => {},
  253. // complete: () => {}
  254. // })
  255. } else {
  256. const that = this
  257. uni.showLoading({
  258. title: '正在加载'
  259. })
  260. var param1 = ''
  261. this.$api.doRequest('get', '/paymentManagement/selectPaymentManagement', {
  262. pageSize: this.pageSize,
  263. currentPage: this.currentPage,
  264. searchKeyWord: this.searchKeyWord,
  265. searchType: this.searchType,
  266. managementType: 1,
  267. appFlag:1,
  268. customerPhone: this.userInfo.phone,
  269. dateFilter:this.datetext
  270. // pcFlag:1
  271. // warehouseName:'',
  272. }).then(res => {
  273. uni.hideLoading()
  274. var data = res.data.data.records
  275. if (type == "add") {
  276. this.dataInfo = this.dataInfo.concat(data)
  277. this.isLoadMore = false
  278. } else {
  279. this.dataInfo = data
  280. }
  281. if (data.length == 0) {
  282. this.isContent = true
  283. this.isLoadMore = false
  284. this.loadStatus = 'nomore'
  285. }
  286. })
  287. .catch(res => {
  288. uni.hideLoading()
  289. if (res.errmsg) {
  290. uni.showToast({
  291. title: res.errmsg,
  292. icon: 'none',
  293. duration: 2000
  294. })
  295. } else {
  296. uni.showToast({
  297. title: "系统异常,请联系管理员",
  298. icon: 'none',
  299. duration: 2000
  300. })
  301. }
  302. });
  303. }
  304. },
  305. }
  306. }
  307. </script>
  308. <style scoped>
  309. .wrap {
  310. background: #fff;
  311. margin: 10px;
  312. border-radius: 10px;
  313. padding: 0 10px 10px;
  314. font-size: 12px;
  315. }
  316. .already {
  317. color: #22C572;
  318. }
  319. .not {
  320. color: #FE6430;
  321. }
  322. .purchaser {
  323. padding: 5px;
  324. background: #E9F8F0;
  325. color: #22C572;
  326. display: inline;
  327. border-radius: 3px;
  328. margin-right: 10px;
  329. }
  330. .seller {
  331. padding: 5px;
  332. background: #FEECE6;
  333. color: #FE6430;
  334. display: inline;
  335. border-radius: 3px;
  336. margin-right: 10px;
  337. }
  338. .button {
  339. display: inline-block;
  340. border: 1px solid #CDCDCD;
  341. padding: 6px 15px;
  342. border-radius: 15px;
  343. margin: 5px 3px;
  344. }
  345. .search-form {
  346. background: #F5F6F9;
  347. }
  348. .search-box {
  349. width: 100%;
  350. background-color: rgb(242, 242, 242);
  351. padding: 15upx 2.5%;
  352. display: flex;
  353. justify-content: space-between;
  354. }
  355. .search-box .mSearch-input-box {
  356. width: 100%;
  357. }
  358. .search-box .input-box {
  359. width: 85%;
  360. flex-shrink: 1;
  361. display: flex;
  362. justify-content: center;
  363. align-items: center;
  364. }
  365. .search-box .search-btn {
  366. width: 15%;
  367. margin: 0 0 0 2%;
  368. display: flex;
  369. justify-content: center;
  370. align-items: center;
  371. flex-shrink: 0;
  372. font-size: 28upx;
  373. color: #fff;
  374. background: linear-gradient(to right, #ff9801, #ff570a);
  375. border-radius: 60upx;
  376. }
  377. .search-box .input-box>input {
  378. width: 100%;
  379. height: 60upx;
  380. font-size: 32upx;
  381. border: 0;
  382. border-radius: 60upx;
  383. -webkit-appearance: none;
  384. -moz-appearance: none;
  385. appearance: none;
  386. padding: 0 3%;
  387. margin: 0;
  388. background-color: #ffffff;
  389. }
  390. .cuIcon {
  391. position: absolute;
  392. right: 80px;
  393. }
  394. .line {
  395. display: inline-block;
  396. padding: 5px;
  397. position: relative;
  398. font-size: 17px;
  399. }
  400. .line.active {
  401. font-size: 19px;
  402. font-weight: 900;
  403. }
  404. .line.active:after {
  405. content: '';
  406. display: block;
  407. position: absolute;
  408. width: 36rpx;
  409. height: 6rpx;
  410. left: 50%;
  411. transform: translateX(-50%);
  412. bottom: 0;
  413. background: #22C572;
  414. /* border-bottom: 1px solid #22C572; */
  415. }
  416. .popup {
  417. background: rgba(0, 0, 0, 0.8);
  418. position: fixed;
  419. top: 0;
  420. left: 0;
  421. width: 100%;
  422. height: 100%;
  423. }
  424. .imagewrap {
  425. position: absolute;
  426. top: 50%;
  427. transform: translateY(-50%) translateX(-50%);
  428. left: 50%;
  429. }
  430. .xiazai {
  431. position: absolute;
  432. bottom: 10px;
  433. left: 50%;
  434. transform: translateX(-50%);
  435. }
  436. .tl-show {
  437. overflow: hidden;
  438. position: fixed;
  439. height: 100%;
  440. width: 100%;
  441. }
  442. </style>