Index.vue 7.6 KB

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