Index.vue 8.4 KB

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