index.vue 10 KB

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