Index.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <template>
  2. <view>
  3. <view class="box">
  4. <view class="top" style="margin-top: -1rpx;">
  5. <text class="title">灵活业务</text>
  6. </view>
  7. <view class="add" @click="addFn">+添加</view>
  8. </view>
  9. <!-- <u-sticky offset-top="0">
  10. <u-tabs :list="tabs" @change="change" :current="current" :is-scroll="false"></u-tabs>
  11. </u-sticky> -->
  12. <view class="card-box">
  13. <view class="card" v-for="(businessItem,index) in businessItemList" :key="index">
  14. <view class="t">
  15. <image class="icon" src="../../static/home-icon-01.png"></image>
  16. <text class="title">{{businessItem.customerName}}</text>
  17. </view>
  18. <view style="line-height: 60rpx;">
  19. <view class="title">录入时间:{{businessItem.createTime}}</view>
  20. <view class="title">订单号:{{businessItem.no}}</view>
  21. </view>
  22. <view class="c">
  23. <view class="item car-num-item">
  24. <text class="car-num">{{businessItem.carNo}}</text>
  25. </view>
  26. <view class="item">
  27. <text class="p1">车型:</text>
  28. <text class="p2">{{businessItem.cardSize}}(米)</text>
  29. </view>
  30. <view class="item">
  31. <text class="p1">载重:</text>
  32. <text class="p2">{{businessItem.netWeight}}(kg)</text>
  33. </view>
  34. <view class="item">
  35. <text class="p1">账单确认:</text>
  36. <text class="p2">
  37. <text v-if="businessItem.confirmInput==0">未确认</text>
  38. <text v-else>已确认</text>
  39. </text>
  40. </view>
  41. <view class="item">
  42. <text class="p1">支付状态:</text>
  43. <text class="p2">
  44. <text v-if="businessItem.payStatus==1">未支付</text>
  45. <!-- <text v-if="businessItem.payStatus==2">已支付(未确认)</text> -->
  46. <text v-if="businessItem.payStatus==3">已支付</text>
  47. </text>
  48. </view>
  49. </view>
  50. <view class="b">
  51. <view class="btn b3" v-if="customemrId=='1'&&businessItem.adminConfirmInput==0
  52. &&perList.indexOf('tb-flex-business-confirm')!=-1"
  53. @click="sureZdFn(businessItem)">
  54. 账单确认</view>
  55. <view class="btn b3" @click="toDetail(businessItem)">详情</view>
  56. <view class="btn b1" v-if="businessItem.adminConfirmInput==0&&perList.indexOf('tb-flex-business-edit')!==-1" @click="editFn(businessItem)">修改</view>
  57. <view class="btn b4" v-if="businessItem.adminConfirmInput==0
  58. &&perList.indexOf('tb-business-del')!==-1" @click="deleteFn(businessItem)">删除</view>
  59. </view>
  60. </view>
  61. </view>
  62. <noData v-if="businessItemList.length==0"></noData>
  63. <u-loadmore style="margin: 30rpx;" :status="status" />
  64. </view>
  65. </template>
  66. <script>
  67. export default {
  68. data() {
  69. return {
  70. p: {
  71. isCar: 1,
  72. adminConfirmInput: -1,
  73. pageNo: 1,
  74. pageSize: 3,
  75. dataCount: 0
  76. },
  77. customemrId: '1',
  78. fk: {
  79. ids: '',
  80. },
  81. rc: {
  82. id: '',
  83. inChannel: '',
  84. showTime: false,
  85. visible: false,
  86. realInTime: ''
  87. },
  88. current: 0,
  89. status: 'loadmore',
  90. page: 0,
  91. tabs: [{
  92. name: '进场',
  93. }, {
  94. name: '出场',
  95. }],
  96. businessItemList: [],
  97. perList: []
  98. }
  99. },
  100. onShow() {
  101. this.customemrId = uni.getStorageSync('customerId')
  102. this.getBusinessList();
  103. this.perList = uni.getStorageSync('perList')
  104. },
  105. mounted() {
  106. },
  107. onBackPress() {
  108. this.$common.to('/pages/index/index')
  109. return true;
  110. },
  111. methods: {
  112. addFn(){
  113. this.$common.to('/pages/onely-disinfect/disinfect-Index')
  114. },
  115. toDetail(data) {
  116. this.$common.to('/pages/onely-disinfect/type-business-info?id=' + data.id)
  117. },
  118. editFn(data) {
  119. this.$common.to('/pages/onely-disinfect/type-business-edit?id=' + data.id)
  120. },
  121. deleteFn(data) {
  122. let that = this;
  123. uni.showModal({
  124. title: "警告",
  125. content: "是否删除该业务?",
  126. success(res) {
  127. if (res.confirm) {
  128. that.$api.deleteBusiness({
  129. id: data.id
  130. }).then(resp => {
  131. that.$common.toast('已删除');
  132. that.getBusinessList();
  133. })
  134. }
  135. }
  136. })
  137. },
  138. sureZdFn(data) {
  139. this.$common.to('/pages/wx/payOrderTemp?id=' + data.id)
  140. },
  141. getBusinessList() {
  142. this.p.isCar=0;
  143. this.$api.getCarDisinFect(this.p).then(resp => {
  144. this.status = 'loadmore';
  145. this.p.pageNo = resp.pageNo;
  146. this.p.pageSize = resp.pageSize;
  147. this.p.dataCount = resp.dataCount;
  148. this.businessItemList = resp.data;
  149. })
  150. },
  151. //点击上方切换栏,根据点击项重新加载数据
  152. change(index) {
  153. this.current = index;
  154. if (index == 0) {
  155. //只加载进场订单
  156. }
  157. if (index == 1) {
  158. //只加载出场订单
  159. }
  160. },
  161. //点击按钮
  162. //------------------------------------------
  163. fkconfirm() {
  164. this.$api.adminConfirmPay(this.fk).then(resp => {
  165. this.$refs.fkpopup.close();
  166. this.getBusinessList();
  167. })
  168. },
  169. rcconfirm() {
  170. if (!this.rc.inChannel) {
  171. this.$common.toast('请填写入场通道');
  172. return false;
  173. }
  174. this.$api.adminConfirmIn(this.rc).then(resp => {
  175. this.$refs.rcpopup.close();
  176. this.getBusinessList();
  177. })
  178. },
  179. ccconfirm(index) {
  180. this.$refs.ccpopup.close()
  181. },
  182. zd() {
  183. this.$refs.zdpopup.open('center')
  184. },
  185. zdconfirm(index) {
  186. this.$refs.zdpopup.close()
  187. },
  188. //------------------------------------------
  189. //上拉加载更多,分页模拟数据
  190. onReachBottom() {
  191. if (parseInt(this.p.dataCount) > parseInt(this.p.pageSize) * parseInt(this.p.pageNo)) {
  192. this.status = 'loading';
  193. this.p.pageSize += 5;
  194. this.getBusinessList();
  195. } else {
  196. this.status = 'nomore';
  197. }
  198. }
  199. }
  200. }
  201. </script>
  202. <style lang="scss">
  203. .add {
  204. position: absolute;
  205. right: 40rpx;
  206. top: -60rpx;
  207. z-index: 999;
  208. border: 1rpx solid #359aff;
  209. border-radius: 8rpx;
  210. color: #c8e4ff;
  211. padding: 10rpx 20rpx;
  212. font-size: 28rpx;
  213. }
  214. .card-box {
  215. display: flex;
  216. width: 100%;
  217. flex-direction: column;
  218. .card {
  219. background-color: #fff;
  220. border-radius: 20rpx;
  221. margin: 20rpx 20rpx 0 20rpx;
  222. padding: 30rpx;
  223. box-sizing: border-box;
  224. display: flex;
  225. flex-direction: column;
  226. .t {
  227. width: 100%;
  228. display: flex;
  229. align-items: center;
  230. padding-bottom: 30rpx;
  231. border-bottom: 1rpx solid #f5f5f5;
  232. .icon {
  233. width: 40rpx;
  234. height: 40rpx;
  235. }
  236. .title {
  237. font-size: 30rpx;
  238. font-weight: bold;
  239. margin-left: 20rpx;
  240. }
  241. }
  242. .c {
  243. padding: 15rpx 0 30rpx 0;
  244. display: flex;
  245. flex-wrap: wrap;
  246. border-bottom: 1rpx solid #f5f5f5;
  247. .item {
  248. width: 50%;
  249. padding: 20rpx 0;
  250. .car-num {
  251. background-color: #edf6ff;
  252. color: #0080ff;
  253. font-size: 44rpx;
  254. padding: 15rpx 0;
  255. text-align: center;
  256. width: 100%;
  257. border-radius: 10rpx;
  258. font-weight: bold;
  259. letter-spacing: 20rpx;
  260. }
  261. .p1 {
  262. font-size: 28rpx;
  263. color: #999;
  264. }
  265. .p2 {
  266. font-size: 28rpx;
  267. color: #191919;
  268. font-weight: bold;
  269. margin-left: 20rpx;
  270. }
  271. }
  272. .car-num-item {
  273. width: 100%;
  274. display: flex;
  275. align-items: center;
  276. justify-content: center;
  277. }
  278. }
  279. .b {
  280. display: flex;
  281. width: 100%;
  282. align-items: center;
  283. justify-content: space-between;
  284. .btn {
  285. height: 70rpx;
  286. display: flex;
  287. align-items: center;
  288. justify-content: center;
  289. width: calc(50% - 15rpx);
  290. margin: 30rpx 0 0 0;
  291. border-radius: 10rpx;
  292. border-width: 1rpx;
  293. box-sizing: border-box;
  294. }
  295. .b1 {
  296. background-color: #0080ff;
  297. color: #fff;
  298. }
  299. .b2 {
  300. background-color: #f7f7f7;
  301. color: #191919;
  302. }
  303. .b3 {
  304. background-color: #fff;
  305. color: #0080ff;
  306. border: 1rpx solid #0080ff;
  307. }
  308. .b4 {
  309. background-color: #ff0000;
  310. color: #fff;
  311. }
  312. }
  313. }
  314. }
  315. @import '@/common/common.scss'
  316. </style>