index.vue 11 KB

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