business-item.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. <template>
  2. <view>
  3. <view class="box">
  4. <view class="top">
  5. <text class="title">业务详情</text>
  6. </view>
  7. </view>
  8. <view class="card-box">
  9. <view class="card" v-for="(businessItem,index) in items" :key="businessItem.id">
  10. <view class="t">
  11. <image class="icon" src="../../static/home-icon-01.png"></image>
  12. <text class="title">{{businessItem.itemTypeName}}</text>
  13. </view>
  14. <view class="c">
  15. <view class="item car-num-item">
  16. <text class="car-num">{{businessItem.itemName}}</text>
  17. </view>
  18. </view>
  19. <view class="c">
  20. <view class="item">
  21. <text class="p1">录入时间:</text>
  22. <text class="p2">{{businessItem.createTime}}</text>
  23. </view>
  24. </view>
  25. <view class="c">
  26. <view class="item">
  27. <text class="p1">状态:</text>
  28. <text class="p2">
  29. <text v-if="businessItem.pick==1">已接单</text>
  30. <text v-else>未接单</text>
  31. </text>
  32. </view>
  33. </view>
  34. <view class="c">
  35. <view class="item" v-if="businessItem.pickTime">
  36. <text class="p1">接单时间:</text>
  37. <text class="p2">
  38. <text>{{businessItem.pickTime}}</text>
  39. </text>
  40. </view>
  41. </view>
  42. <view class="c">
  43. <view class="item" v-if="businessItem.pickCustomerName">
  44. <text class="p1">接单企业:</text>
  45. <text class="p2">
  46. <text>{{businessItem.pickCustomerName}}</text>
  47. </text>
  48. </view>
  49. </view>
  50. <view class="c" v-if="businessItem.pick==1">
  51. <view class="item">
  52. <text class="p1">确认状态:</text>
  53. <text class="p2">
  54. <text v-if="businessItem.confirm==1">已确认</text>
  55. <text v-else>未确认</text>
  56. </text>
  57. </view>
  58. </view>
  59. <view class="c" v-if="businessItem.confirm==1">
  60. <view class="item">
  61. <text class="p1">确认时间:</text>
  62. <text class="p2">
  63. <text>{{businessItem.confirmTime}}</text>
  64. </text>
  65. </view>
  66. </view>
  67. <view class="b" v-if="customerId!='1'&&businessItem.pick==1&&businessItem.confirm!=1">
  68. <view class="btn b3" @click="pickFn(businessItem.id)">
  69. 确认</view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. export default {
  77. data() {
  78. return {
  79. customerId: '',
  80. openid: '',
  81. form: {},
  82. items: [],
  83. }
  84. },
  85. onLoad(options) {
  86. this.form.id = options.id;
  87. this.openid = options.openid;
  88. this.checkLogin();
  89. },
  90. onShow() {
  91. this.customerId = uni.getStorageSync('customerId')
  92. this.getBusinessById();
  93. },
  94. onBackPress() {
  95. this.$common.to('/pages/index/index')
  96. return true;
  97. },
  98. methods: {
  99. checkLogin() {
  100. let token = uni.getStorageSync('token');
  101. if (this.openid && !token) {
  102. this.$api.doLoginByOpenid({
  103. openid: this.openid
  104. }).then(resp => {
  105. let data = resp.data;
  106. if (data.tokenInfo) {
  107. uni.setStorageSync('token', data.tokenInfo.tokenValue);
  108. uni.setStorageSync('customerId', data.admin.customerId)
  109. uni.setStorageSync('info', data.admin)
  110. uni.setStorageSync('perList', data.per_list)
  111. } else {
  112. this.$common.toast(resp.msg);
  113. }
  114. })
  115. }
  116. },
  117. getBusinessById() {
  118. this.$api.getBusinessById({
  119. id: this.form.id
  120. }).then(resp => {
  121. let data = resp.data;
  122. this.items = resp.data.items.filter(obj => obj.businessType !== 0);
  123. })
  124. },
  125. pickFn(id) {
  126. let that = this;
  127. uni.showModal({
  128. title: '提示',
  129. content: '是否确认该业务项?',
  130. success(resp) {
  131. if (resp.confirm) {
  132. that.surePick(id);
  133. }
  134. }
  135. })
  136. },
  137. surePick(id) {
  138. this.$api.confirmBusinessItem({
  139. id: id
  140. }).then(resp => {
  141. if (resp.code == 200) {
  142. this.$common.toast('已确认');
  143. this.getBusinessById();
  144. }
  145. })
  146. }
  147. }
  148. }
  149. </script>
  150. <style lang="scss">
  151. .card-box {
  152. display: flex;
  153. width: 100%;
  154. flex-direction: column;
  155. .card {
  156. background-color: #fff;
  157. border-radius: 20rpx;
  158. margin: 20rpx 20rpx 0 20rpx;
  159. padding: 30rpx;
  160. box-sizing: border-box;
  161. display: flex;
  162. flex-direction: column;
  163. .t {
  164. width: 100%;
  165. display: flex;
  166. align-items: center;
  167. padding-bottom: 30rpx;
  168. border-bottom: 1rpx solid #f5f5f5;
  169. .icon {
  170. width: 40rpx;
  171. height: 40rpx;
  172. }
  173. .title {
  174. font-size: 35rpx;
  175. font-weight: bold;
  176. margin-left: 20rpx;
  177. }
  178. }
  179. .c {
  180. padding: 15rpx 0 30rpx 0;
  181. display: flex;
  182. flex-wrap: wrap;
  183. border-bottom: 1rpx solid #f5f5f5;
  184. .item {
  185. padding: 20rpx 0;
  186. .car-num {
  187. background-color: #edf6ff;
  188. color: #0080ff;
  189. font-size: 38rpx;
  190. padding: 15rpx 0;
  191. text-align: center;
  192. width: 100%;
  193. border-radius: 10rpx;
  194. font-weight: bold;
  195. }
  196. .p1 {
  197. font-size: 28rpx;
  198. color: #999;
  199. }
  200. .p2 {
  201. font-size: 28rpx;
  202. color: #191919;
  203. font-weight: bold;
  204. margin-left: 20rpx;
  205. }
  206. }
  207. .car-num-item {
  208. width: 100%;
  209. display: flex;
  210. align-items: center;
  211. justify-content: center;
  212. }
  213. }
  214. .b {
  215. display: flex;
  216. width: 100%;
  217. align-items: center;
  218. justify-content: space-between;
  219. .btn {
  220. height: 70rpx;
  221. display: flex;
  222. align-items: center;
  223. justify-content: center;
  224. width: calc(100% - 15rpx);
  225. margin: 30rpx 0 0 0;
  226. border-radius: 10rpx;
  227. border-width: 1rpx;
  228. box-sizing: border-box;
  229. }
  230. .b1 {
  231. background-color: #0080ff;
  232. color: #fff;
  233. }
  234. .b2 {
  235. background-color: #f7f7f7;
  236. color: #191919;
  237. }
  238. .b3 {
  239. background-color: #fff;
  240. color: #0080ff;
  241. border: 1rpx solid #0080ff;
  242. }
  243. .b4 {
  244. background-color: #ff0000;
  245. color: #fff;
  246. }
  247. }
  248. }
  249. }
  250. @import '@/common/common.scss'
  251. </style>