index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  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.currentPage = 1
  213. this.isLoadMore = false
  214. this.loadData()
  215. },
  216. alertBtn() {
  217. uni.navigateTo({
  218. url: '/pages/public/login'
  219. })
  220. },
  221. cancelClick() {
  222. this.isShowAlert = false
  223. },
  224. //加载商品 ,带下拉刷新和上滑加载
  225. async loadData(type, loading) {
  226. if(!this.hasLogin){
  227. this.isShowAlert = true;
  228. // ni.showModal({
  229. // title: '提示',
  230. // content: '您尚未登录,是否立即登录?',
  231. // showCancel: true,
  232. // confirmText: '登录',
  233. // success: (e) => {
  234. // if (e.confirm) {
  235. // uni.navigateTo({
  236. // url: '/pages/public/login'
  237. // })
  238. // }
  239. // },
  240. // fail: () => {},
  241. // complete: () => {}
  242. // })
  243. } else {
  244. const that = this
  245. uni.showLoading({
  246. title: '正在加载'
  247. })
  248. var param1 = ''
  249. this.$api.doRequest('get', '/paymentManagement/selectPaymentManagement', {
  250. pageSize: this.pageSize,
  251. currentPage: this.currentPage,
  252. searchKeyWord: this.searchKeyWord,
  253. searchType: this.searchType,
  254. managementType: 1,
  255. appFlag:1,
  256. customerPhone: this.userInfo.phone,
  257. // pcFlag:1
  258. // warehouseName:'',
  259. }).then(res => {
  260. uni.hideLoading()
  261. var data = res.data.data.records
  262. if (type == "add") {
  263. this.dataInfo = this.dataInfo.concat(data)
  264. this.isLoadMore = false
  265. } else {
  266. this.dataInfo = data
  267. }
  268. if (data.length == 0) {
  269. this.isContent = true
  270. this.isLoadMore = false
  271. this.loadStatus = 'nomore'
  272. }
  273. })
  274. .catch(res => {
  275. uni.hideLoading()
  276. if (res.errmsg) {
  277. uni.showToast({
  278. title: res.errmsg,
  279. icon: 'none',
  280. duration: 2000
  281. })
  282. } else {
  283. uni.showToast({
  284. title: "系统异常,请联系管理员",
  285. icon: 'none',
  286. duration: 2000
  287. })
  288. }
  289. });
  290. }
  291. },
  292. }
  293. }
  294. </script>
  295. <style scoped>
  296. .wrap {
  297. background: #fff;
  298. margin: 10px;
  299. border-radius: 10px;
  300. padding: 0 10px 10px;
  301. font-size: 12px;
  302. }
  303. .already {
  304. color: #22C572;
  305. }
  306. .not {
  307. color: #FE6430;
  308. }
  309. .purchaser {
  310. padding: 5px;
  311. background: #E9F8F0;
  312. color: #22C572;
  313. display: inline;
  314. border-radius: 3px;
  315. margin-right: 10px;
  316. }
  317. .seller {
  318. padding: 5px;
  319. background: #FEECE6;
  320. color: #FE6430;
  321. display: inline;
  322. border-radius: 3px;
  323. margin-right: 10px;
  324. }
  325. .button {
  326. display: inline-block;
  327. border: 1px solid #CDCDCD;
  328. padding: 6px 15px;
  329. border-radius: 15px;
  330. margin: 5px 3px;
  331. }
  332. .search-form {
  333. background: #F5F6F9;
  334. }
  335. .search-box {
  336. width: 100%;
  337. background-color: rgb(242, 242, 242);
  338. padding: 15upx 2.5%;
  339. display: flex;
  340. justify-content: space-between;
  341. }
  342. .search-box .mSearch-input-box {
  343. width: 100%;
  344. }
  345. .search-box .input-box {
  346. width: 85%;
  347. flex-shrink: 1;
  348. display: flex;
  349. justify-content: center;
  350. align-items: center;
  351. }
  352. .search-box .search-btn {
  353. width: 15%;
  354. margin: 0 0 0 2%;
  355. display: flex;
  356. justify-content: center;
  357. align-items: center;
  358. flex-shrink: 0;
  359. font-size: 28upx;
  360. color: #fff;
  361. background: linear-gradient(to right, #ff9801, #ff570a);
  362. border-radius: 60upx;
  363. }
  364. .search-box .input-box>input {
  365. width: 100%;
  366. height: 60upx;
  367. font-size: 32upx;
  368. border: 0;
  369. border-radius: 60upx;
  370. -webkit-appearance: none;
  371. -moz-appearance: none;
  372. appearance: none;
  373. padding: 0 3%;
  374. margin: 0;
  375. background-color: #ffffff;
  376. }
  377. .cuIcon {
  378. position: absolute;
  379. right: 80px;
  380. }
  381. .line {
  382. display: inline-block;
  383. padding: 5px;
  384. position: relative;
  385. font-size: 17px;
  386. }
  387. .line.active {
  388. font-size: 19px;
  389. font-weight: 900;
  390. }
  391. .line.active:after {
  392. content: '';
  393. display: block;
  394. position: absolute;
  395. width: 36rpx;
  396. height: 6rpx;
  397. left: 50%;
  398. transform: translateX(-50%);
  399. bottom: 0;
  400. background: #22C572;
  401. /* border-bottom: 1px solid #22C572; */
  402. }
  403. .popup {
  404. background: rgba(0, 0, 0, 0.8);
  405. position: fixed;
  406. top: 0;
  407. left: 0;
  408. width: 100%;
  409. height: 100%;
  410. }
  411. .imagewrap {
  412. position: absolute;
  413. top: 50%;
  414. transform: translateY(-50%) translateX(-50%);
  415. left: 50%;
  416. }
  417. .xiazai {
  418. position: absolute;
  419. bottom: 10px;
  420. left: 50%;
  421. transform: translateX(-50%);
  422. }
  423. .tl-show {
  424. overflow: hidden;
  425. position: fixed;
  426. height: 100%;
  427. width: 100%;
  428. }
  429. </style>