index.vue 11 KB

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