index.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  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("add")
  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, 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. if(type == "add"){
  235. this.dataInfo = this.dataInfo.concat(data)
  236. }
  237. else{
  238. this.dataInfo = data
  239. }
  240. if(data.length==0){
  241. this.isContent=true
  242. }
  243. })
  244. .catch(res => {
  245. uni.hideLoading()
  246. if (res.errmsg) {
  247. uni.showToast({
  248. title: res.errmsg,
  249. icon: 'none',
  250. duration: 2000
  251. })
  252. } else {
  253. uni.showToast({
  254. title: "系统异常,请联系管理员",
  255. icon: 'none',
  256. duration: 2000
  257. })
  258. }
  259. });
  260. }
  261. },
  262. }
  263. }
  264. </script>
  265. <style scoped>
  266. .wrap{
  267. background:#fff;
  268. margin:10px;
  269. border-radius:10px;
  270. padding:0 10px 10px;
  271. font-size:12px;
  272. }
  273. .already{
  274. color:#22C572;
  275. }
  276. .not{
  277. color:#FE6430;
  278. }
  279. .purchaser{
  280. padding:5px;background:#E9F8F0;color:#22C572;
  281. display:inline;
  282. border-radius:3px;
  283. margin-right:10px;
  284. }
  285. .seller{
  286. padding:5px;background:#FEECE6;color:#FE6430;
  287. display:inline;
  288. border-radius:3px;
  289. margin-right:10px;
  290. }
  291. .button{
  292. display:inline-block;
  293. border:1px solid #CDCDCD;
  294. padding:6px 15px;
  295. border-radius:15px;
  296. margin:5px 3px;
  297. }
  298. .search-form {
  299. background: #F5F6F9;
  300. }
  301. .search-box {
  302. width: 100%;
  303. background-color: rgb(242, 242, 242);
  304. padding: 15upx 2.5%;
  305. display: flex;
  306. justify-content: space-between;
  307. }
  308. .search-box .mSearch-input-box {
  309. width: 100%;
  310. }
  311. .search-box .input-box {
  312. width: 85%;
  313. flex-shrink: 1;
  314. display: flex;
  315. justify-content: center;
  316. align-items: center;
  317. }
  318. .search-box .search-btn {
  319. width: 15%;
  320. margin: 0 0 0 2%;
  321. display: flex;
  322. justify-content: center;
  323. align-items: center;
  324. flex-shrink: 0;
  325. font-size: 28upx;
  326. color: #fff;
  327. background: linear-gradient(to right, #ff9801, #ff570a);
  328. border-radius: 60upx;
  329. }
  330. .search-box .input-box>input {
  331. width: 100%;
  332. height: 60upx;
  333. font-size: 32upx;
  334. border: 0;
  335. border-radius: 60upx;
  336. -webkit-appearance: none;
  337. -moz-appearance: none;
  338. appearance: none;
  339. padding: 0 3%;
  340. margin: 0;
  341. background-color: #ffffff;
  342. }
  343. .cuIcon {
  344. position: absolute;
  345. right: 80px;
  346. }
  347. .line {
  348. display: inline-block;
  349. padding: 5px;
  350. position: relative;
  351. font-size: 17px;
  352. }
  353. .line.active {
  354. font-size: 19px;
  355. font-weight: 900;
  356. }
  357. .line.active:after {
  358. content: '';
  359. display: block;
  360. position: absolute;
  361. width: 36rpx;
  362. height: 6rpx;
  363. left: 50%;
  364. transform: translateX(-50%);
  365. bottom: 0;
  366. background: #22C572;
  367. /* border-bottom: 1px solid #22C572; */
  368. }
  369. .popup{
  370. background:rgba(0, 0, 0, 0.8);
  371. position:fixed;top:0;left:0;width:100%;height:100%;
  372. }
  373. .imagewrap{
  374. position:absolute;
  375. top:50%;
  376. transform: translateY(-50%) translateX(-50%);
  377. left:50%;
  378. }
  379. .xiazai{
  380. position: absolute;
  381. bottom:10px;
  382. left:50%;
  383. transform: translateX(-50%);
  384. }
  385. .tl-show{
  386. overflow: hidden;
  387. position:fixed;
  388. height: 100%;
  389. width: 100%;
  390. }
  391. </style>