index.vue 9.8 KB

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