Index.vue 7.6 KB

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