business-item.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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. form: {},
  81. items:[],
  82. }
  83. },
  84. onLoad(options) {
  85. this.form.id = options.id;
  86. },
  87. onShow() {
  88. this.customerId = uni.getStorageSync('customerId')
  89. this.getBusinessById();
  90. },
  91. onBackPress() {
  92. this.$common.to('/pages/index/index')
  93. return true;
  94. },
  95. methods: {
  96. getBusinessById() {
  97. this.$api.getBusinessById({
  98. id: this.form.id
  99. }).then(resp => {
  100. let data=resp.data;
  101. this.items = resp.data.items.filter(obj=>obj.businessType!==0);
  102. })
  103. },
  104. pickFn(id) {
  105. let that = this;
  106. uni.showModal({
  107. title: '提示',
  108. content: '是否确认该业务项?',
  109. success(resp) {
  110. if (resp.confirm) {
  111. that.surePick(id);
  112. }
  113. }
  114. })
  115. },
  116. surePick(id) {
  117. this.$api.confirmBusinessItem({id: id}).then(resp => {
  118. if (resp.code == 200) {
  119. this.$common.toast('已确认');
  120. this.getBusinessById();
  121. }
  122. })
  123. }
  124. }
  125. }
  126. </script>
  127. <style lang="scss">
  128. .card-box {
  129. display: flex;
  130. width: 100%;
  131. flex-direction: column;
  132. .card {
  133. background-color: #fff;
  134. border-radius: 20rpx;
  135. margin: 20rpx 20rpx 0 20rpx;
  136. padding: 30rpx;
  137. box-sizing: border-box;
  138. display: flex;
  139. flex-direction: column;
  140. .t {
  141. width: 100%;
  142. display: flex;
  143. align-items: center;
  144. padding-bottom: 30rpx;
  145. border-bottom: 1rpx solid #f5f5f5;
  146. .icon {
  147. width: 40rpx;
  148. height: 40rpx;
  149. }
  150. .title {
  151. font-size: 35rpx;
  152. font-weight: bold;
  153. margin-left: 20rpx;
  154. }
  155. }
  156. .c {
  157. padding: 15rpx 0 30rpx 0;
  158. display: flex;
  159. flex-wrap: wrap;
  160. border-bottom: 1rpx solid #f5f5f5;
  161. .item {
  162. padding: 20rpx 0;
  163. .car-num {
  164. background-color: #edf6ff;
  165. color: #0080ff;
  166. font-size: 38rpx;
  167. padding: 15rpx 0;
  168. text-align: center;
  169. width: 100%;
  170. border-radius: 10rpx;
  171. font-weight: bold;
  172. }
  173. .p1 {
  174. font-size: 28rpx;
  175. color: #999;
  176. }
  177. .p2 {
  178. font-size: 28rpx;
  179. color: #191919;
  180. font-weight: bold;
  181. margin-left: 20rpx;
  182. }
  183. }
  184. .car-num-item {
  185. width: 100%;
  186. display: flex;
  187. align-items: center;
  188. justify-content: center;
  189. }
  190. }
  191. .b {
  192. display: flex;
  193. width: 100%;
  194. align-items: center;
  195. justify-content: space-between;
  196. .btn {
  197. height: 70rpx;
  198. display: flex;
  199. align-items: center;
  200. justify-content: center;
  201. width: calc(100% - 15rpx);
  202. margin: 30rpx 0 0 0;
  203. border-radius: 10rpx;
  204. border-width: 1rpx;
  205. box-sizing: border-box;
  206. }
  207. .b1 {
  208. background-color: #0080ff;
  209. color: #fff;
  210. }
  211. .b2 {
  212. background-color: #f7f7f7;
  213. color: #191919;
  214. }
  215. .b3 {
  216. background-color: #fff;
  217. color: #0080ff;
  218. border: 1rpx solid #0080ff;
  219. }
  220. .b4 {
  221. background-color: #ff0000;
  222. color: #fff;
  223. }
  224. }
  225. }
  226. }
  227. @import '@/common/common.scss'
  228. </style>