serviceOrderDetail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. <template>
  2. <view class="container">
  3. <!-- 内容区域 -->
  4. <scroll-view class="content" scroll-y>
  5. <view class="detail-section">
  6. <!-- 服务单标题和已确认标识 -->
  7. <view class="order-header">
  8. <view class="order-title-text">服务单</view>
  9. <image class="w144 h144" v-if="orderDetail.status === 1" src="@/static/image/img_confirmed.png" mode=""></image>
  10. </view>
  11. <!-- 服务内容 -->
  12. <view class="service-content">
  13. <view class="content-title">尊敬的用户: 本次劳务内容:</view>
  14. <!-- 服务表格 -->
  15. <view class="service-table">
  16. <view class="table-header">
  17. <view class="table-cell">具体实施项目</view>
  18. <view class="table-cell">单场金额</view>
  19. <view class="table-cell">完成时间</view>
  20. <view class="table-cell">单位</view>
  21. <view class="table-cell">数量</view>
  22. <view class="table-cell">总金额</view>
  23. </view>
  24. <view class="table-row" v-for="(item, index) in orderDetail.serviceItems" :key="index">
  25. <view class="table-cell">{{ item.projectName }}</view>
  26. <view class="table-cell">{{ item.singleAmount }}</view>
  27. <view class="table-cell">{{ item.completeTime }}</view>
  28. <view class="table-cell">{{ item.unit }}</view>
  29. <view class="table-cell">{{ item.quantity }}</view>
  30. <view class="table-cell">{{ item.totalAmount }}</view>
  31. </view>
  32. </view>
  33. </view>
  34. <!-- 协议内容 -->
  35. <view class="agreement-content">
  36. <view class="agreement-text">
  37. 甲乙双方已签订《服务协议》,乙方实际向甲方提供上述服务,现双方确认该工作已全部完成。乙方确认该笔收入为自己的合理劳动所得,并同意依法纳税,乙方提供银行卡、身份证信息给甲方用于报税,甲方承诺为乙方个人信息保密。
  38. </view>
  39. <view class="payment-info">
  40. <view class="payment-text">
  41. 我司将向您支付人民币[{{ orderDetail.totalAmount || '1534' }}]元(大写:{{ orderDetail.amountInWords || '壹仟伍佰叁拾肆元整' }})作为此次劳务报酬(该服务报酬为我司代扣代缴相关税款后的金额),款项将汇入如下账户:
  42. </view>
  43. <view class="account-info">
  44. <view class="account-item">
  45. <text class="account-label">姓名:</text>
  46. <text class="account-value">{{ orderDetail.accountName || '王小明' }}</text>
  47. </view>
  48. <view class="account-item">
  49. <text class="account-label">开户行:</text>
  50. <text class="account-value">{{ orderDetail.bankName || '中国农业银行' }}</text>
  51. </view>
  52. <view class="account-item">
  53. <text class="account-label">账号:</text>
  54. <text class="account-value">{{ orderDetail.accountNumber || '6524012536580258' }}</text>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </scroll-view>
  61. <view class="confirm-box">
  62. <!-- 确认选项(仅待确认状态显示) -->
  63. <view class="confirm-options" v-if="orderDetail.status === 0">
  64. <view class="option-item">
  65. <checkbox-group @change="onOptionChange">
  66. <label class="option-label">
  67. <checkbox value="promise" :checked="confirmOptions.promise" color="#388BFF" />
  68. <text class="option-text">承诺上述服务已真实发生;</text>
  69. </label>
  70. </checkbox-group>
  71. </view>
  72. <view class="option-item">
  73. <checkbox-group @change="onOptionChange">
  74. <label class="option-label">
  75. <checkbox value="lecture" :checked="confirmOptions.lecture" color="#388BFF" />
  76. <text class="option-text">【适用于提供讲课服务的情形】在提供本次服务之前,已充分悉知和了解讲课内容的材料。</text>
  77. </label>
  78. </checkbox-group>
  79. </view>
  80. </view>
  81. <!-- 底部按钮(仅待确认状态显示) -->
  82. <view class="bottom-bar" v-if="orderDetail.status === 0">
  83. <view class="btn btn-cancel" @click="goBack">返回</view>
  84. <view class="btn btn-confirm" @click="handleConfirm">确认</view>
  85. </view>
  86. </view>
  87. </view>
  88. </template>
  89. <script>
  90. import { getServiceOrderDetail, confirmServiceOrder } from '@/api-js/serviceOrder'
  91. export default {
  92. data() {
  93. return {
  94. orderId: '',
  95. orderDetail: {
  96. status: 0,
  97. totalAmount: '1534',
  98. amountInWords: '壹仟伍佰叁拾肆元整',
  99. accountName: '王小明',
  100. bankName: '中国农业银行',
  101. accountNumber: '6524012536580258',
  102. serviceItems: []
  103. },
  104. confirmOptions: {
  105. promise: false,
  106. lecture: false
  107. },
  108. }
  109. },
  110. onLoad(options) {
  111. if (options.id) {
  112. this.orderId = options.id
  113. }
  114. if (options.status) {
  115. this.orderDetail.status = parseInt(options.status)
  116. }
  117. this.loadOrderDetail()
  118. },
  119. methods: {
  120. async loadOrderDetail() {
  121. try {
  122. uni.showLoading({ title: '加载中...' })
  123. // const res = await getServiceOrderDetail({ id: this.orderId })
  124. uni.hideLoading()
  125. // if (res.code === 200 && res.data) {
  126. // this.orderDetail = { ...this.orderDetail, ...res.data }
  127. // } else {
  128. // 使用示例数据
  129. this.orderDetail.serviceItems = [
  130. { projectName: '病例征集', singleAmount: '111.00', completeTime: '2023年9月12日', unit: '个', quantity: 1, totalAmount: '111.00' },
  131. { projectName: '病例征集', singleAmount: '100.00', completeTime: '2023年9月12日', unit: '个', quantity: 1, totalAmount: '100.00' },
  132. { projectName: '病例征集', singleAmount: '100.00', completeTime: '2023年9月12日', unit: '个', quantity: 1, totalAmount: '100.00' },
  133. { projectName: '病例征集', singleAmount: '1200.00', completeTime: '2023年9月12日', unit: '个', quantity: 1, totalAmount: '1200.00' },
  134. { projectName: '病例征集', singleAmount: '23.00', completeTime: '2023年9月12日', unit: '个', quantity: 1, totalAmount: '23.00' }
  135. ]
  136. // }
  137. } catch (e) {
  138. uni.hideLoading()
  139. console.error('加载服务单详情失败', e)
  140. // 使用示例数据
  141. this.orderDetail.serviceItems = [
  142. { projectName: '病例征集', singleAmount: '111.00', completeTime: '2023年9月12日', unit: '个', quantity: 1, totalAmount: '111.00' },
  143. { projectName: '病例征集', singleAmount: '100.00', completeTime: '2023年9月12日', unit: '个', quantity: 1, totalAmount: '100.00' },
  144. { projectName: '病例征集', singleAmount: '100.00', completeTime: '2023年9月12日', unit: '个', quantity: 1, totalAmount: '100.00' },
  145. { projectName: '病例征集', singleAmount: '1200.00', completeTime: '2023年9月12日', unit: '个', quantity: 1, totalAmount: '1200.00' },
  146. { projectName: '病例征集', singleAmount: '23.00', completeTime: '2023年9月12日', unit: '个', quantity: 1, totalAmount: '23.00' }
  147. ]
  148. }
  149. },
  150. onOptionChange(e) {
  151. const values = e.detail.value
  152. this.confirmOptions.promise = values.includes('promise')
  153. this.confirmOptions.lecture = values.includes('lecture')
  154. },
  155. goBack() {
  156. uni.navigateBack()
  157. },
  158. async handleConfirm() {
  159. if (!this.confirmOptions.promise) {
  160. uni.showToast({
  161. icon: 'none',
  162. title: '请确认上述服务已真实发生'
  163. })
  164. return
  165. }
  166. try {
  167. uni.showLoading({ title: '确认中...' })
  168. // const res = await confirmServiceOrder({
  169. // id: this.orderId,
  170. // confirmOptions: this.confirmOptions
  171. // })
  172. uni.hideLoading()
  173. if (res.code === 200) {
  174. uni.showToast({
  175. icon: 'success',
  176. title: '确认成功'
  177. })
  178. setTimeout(() => {
  179. uni.navigateBack()
  180. }, 1500)
  181. } else {
  182. uni.showToast({
  183. icon: 'none',
  184. title: res.msg || '确认失败'
  185. })
  186. }
  187. } catch (e) {
  188. uni.hideLoading()
  189. uni.showToast({
  190. icon: 'none',
  191. title: '确认失败'
  192. })
  193. }
  194. }
  195. }
  196. }
  197. </script>
  198. <style lang="scss" scoped>
  199. .container {
  200. min-height: 100vh;
  201. background: #fff;
  202. display: flex;
  203. flex-direction: column;
  204. }
  205. .navbar {
  206. display: flex;
  207. align-items: center;
  208. justify-content: space-between;
  209. padding: 20rpx 24rpx;
  210. background: #fff;
  211. border-bottom: 1rpx solid #f0f0f0;
  212. .nav-left {
  213. width: 60rpx;
  214. .back-icon {
  215. font-size: 36rpx;
  216. color: #333;
  217. font-weight: bold;
  218. }
  219. }
  220. .nav-title {
  221. flex: 1;
  222. text-align: center;
  223. font-size: 36rpx;
  224. font-weight: bold;
  225. color: #333;
  226. }
  227. .nav-right {
  228. display: flex;
  229. align-items: center;
  230. gap: 24rpx;
  231. width: 60rpx;
  232. justify-content: flex-end;
  233. .more-icon {
  234. font-size: 32rpx;
  235. color: #333;
  236. }
  237. .eye-icon {
  238. font-size: 32rpx;
  239. color: #333;
  240. }
  241. }
  242. }
  243. .content {
  244. flex: 1;
  245. padding-bottom: 400rpx;
  246. }
  247. .detail-section {
  248. background: #fff;
  249. // margin: 24rpx;
  250. // border-radius: 16rpx;
  251. padding: 32rpx;
  252. }
  253. .order-header {
  254. position: relative;
  255. text-align: center;
  256. margin-bottom: 32rpx;
  257. image{
  258. position: absolute;
  259. right: 0;
  260. top: 0;
  261. }
  262. .order-title-text {
  263. font-size: 36rpx;
  264. font-weight: bold;
  265. color: #333;
  266. }
  267. .confirmed-stamp {
  268. position: absolute;
  269. right: 0;
  270. top: 50%;
  271. transform: translateY(-50%) rotate(-15deg);
  272. width: 120rpx;
  273. height: 120rpx;
  274. border: 4rpx solid rgba(0, 0, 0, 0.1);
  275. border-radius: 50%;
  276. display: flex;
  277. align-items: center;
  278. justify-content: center;
  279. font-size: 24rpx;
  280. color: rgba(0, 0, 0, 0.4);
  281. background: rgba(255, 255, 255, 0.8);
  282. }
  283. }
  284. .service-content {
  285. margin-bottom: 32rpx;
  286. .content-title {
  287. font-size: 28rpx;
  288. color: #333;
  289. margin-bottom: 24rpx;
  290. }
  291. .service-table {
  292. border: 1rpx solid #EBEDF0;
  293. border-radius: 8rpx;
  294. overflow: hidden;
  295. overflow-x: auto;
  296. .table-header,
  297. .table-row {
  298. display: flex;
  299. min-width: 1000rpx;
  300. .table-cell {
  301. flex: 1;
  302. min-width: 140rpx;
  303. padding: 16rpx 8rpx;
  304. font-size: 22rpx;
  305. text-align: center;
  306. border-right: 1rpx solid #EBEDF0;
  307. word-break: break-all;
  308. &:first-child {
  309. min-width: 200rpx;
  310. }
  311. &:last-child {
  312. border-right: none;
  313. }
  314. }
  315. }
  316. .table-header {
  317. background: #f5f5f5;
  318. .table-cell {
  319. font-weight: 500;
  320. color: #333;
  321. }
  322. }
  323. .table-row {
  324. border-top: 1rpx solid #EBEDF0;
  325. .table-cell {
  326. color: #666;
  327. }
  328. }
  329. }
  330. }
  331. .agreement-content {
  332. .agreement-text,
  333. .payment-text {
  334. font-size: 26rpx;
  335. color: #666;
  336. line-height: 1.8;
  337. margin-bottom: 24rpx;
  338. }
  339. .account-info {
  340. margin-top: 24rpx;
  341. .account-item {
  342. margin-bottom: 16rpx;
  343. font-size: 26rpx;
  344. .account-label {
  345. color: #666;
  346. }
  347. .account-value {
  348. color: #333;
  349. margin-left: 8rpx;
  350. }
  351. }
  352. }
  353. }
  354. .confirm-box{
  355. position: fixed;
  356. bottom: 0;
  357. left: 0;
  358. right: 0;
  359. background: #fff;
  360. // padding: 24rpx;
  361. border-top: 1rpx solid #f0f0f0;
  362. z-index: 100;
  363. box-shadow: 0rpx -4rpx 16rpx 0rpx rgba(0,0,0,0.04);
  364. }
  365. .confirm-options {
  366. background: #fff;
  367. border-radius: 16rpx;
  368. padding: 32rpx;
  369. .option-item {
  370. margin-bottom: 24rpx;
  371. &:last-child {
  372. margin-bottom: 0;
  373. }
  374. .option-label {
  375. display: flex;
  376. align-items: flex-start;
  377. .option-text {
  378. flex: 1;
  379. margin-left: 8rpx;
  380. font-size: 26rpx;
  381. color: #333;
  382. line-height: 1.8;
  383. }
  384. }
  385. }
  386. }
  387. .bottom-bar {
  388. padding:24rpx 32rpx;
  389. display: flex;
  390. gap: 24rpx;
  391. margin-bottom: 40rpx;
  392. .btn {
  393. flex: 1;
  394. height: 88rpx;
  395. display: flex;
  396. align-items: center;
  397. justify-content: center;
  398. border-radius: 44rpx;
  399. font-size: 32rpx;
  400. font-weight: 500;
  401. &.btn-cancel {
  402. background: #fff;
  403. border: 2rpx solid #388BFF;
  404. color: #388BFF;
  405. }
  406. &.btn-confirm {
  407. background: #388BFF;
  408. color: #fff;
  409. }
  410. }
  411. }
  412. </style>