detail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. <template>
  2. <My-shade />
  3. <view>
  4. <view class="step" :style="{
  5. width: steps.length < 5 ? '230rpx' : '690rpx',
  6. }">
  7. <view class="step-item" :class="item.title == 1 ? 'arrows' : ''" v-for="item in steps" :key="item.title">
  8. <block v-if="item.title != '1'">
  9. <view class="circle" :style="{ borderColor: item.bgColor }">
  10. <view class="icon" :style="{ background: item.bgColor }">
  11. <view class="iconfont" :class="item.iconfont" />
  12. <view v-if="['已完结', '无需服务'].includes(item.title)" class="ywj" />
  13. </view>
  14. </view>
  15. <view class="title">
  16. {{ item.title }}
  17. </view>
  18. </block>
  19. <view class="item" v-else>
  20. <view class="line" />
  21. <view class="iconfont icon-a-wodetiaozhuan" />
  22. </view>
  23. </view>
  24. </view>
  25. <view class="main">
  26. <view class="billno" style="margin-bottom: -24rpx;">
  27. 预约单号:{{ detail.billno }}
  28. </view>
  29. <view class="row">
  30. <view class="label col-center">预约类型</view>
  31. <view class="servicetype"
  32. :style="{ 'background': { '安装': '#70B603', '维修': '#D9001B', '清洁': '#3874F6', '清洗': '#3874F6' }[detail.servicetype] || '#999999' }">
  33. {{ detail.servicetype || '--' }}</view>
  34. </view>
  35. <view class="row">
  36. <view class="label">产品品类</view>
  37. <view class="value">{{ detail.class1 || '--' }}</view>
  38. </view>
  39. <view class="row" v-if="detail.servicetype == '维修'">
  40. <view class="label">故障类型</view>
  41. <view class="value">{{ detail.class2 || '--' }}</view>
  42. </view>
  43. <up-transition :show="transition">
  44. <view class="row">
  45. <view class="label">服务地址</view>
  46. <view class="value">{{ detail.province + detail.city + detail.county + detail.address || '--' }}
  47. </view>
  48. </view>
  49. <view class="row" style="align-items: center;">
  50. <view class="label justify">联系人</view>
  51. <view class="value phonenumber">{{ detail.scenecontact || '--' }}
  52. <block v-if="detail.scenecontactphonenumber">
  53. <text style="margin: 0 20rpx 0 10rpx;">
  54. {{ detail.scenecontactphonenumber }}
  55. </text>
  56. <My-button :customStyle="{
  57. width: '142rpx',
  58. height: '48rpx',
  59. 'background-color': '#FFFFFF',
  60. 'color': '#3874F6',
  61. borderRadius: '10rpx'
  62. }" :frontIconStyle="{
  63. marginRight: '6rpx',
  64. }" frontIcon="icon-bodadianhua1" text="电话" :phonenumber="detail.scenecontactphonenumber" />
  65. </block>
  66. </view>
  67. </view>
  68. <view class="row">
  69. <view class="label">服务需求</view>
  70. <view class="value">{{ detail.remarks || '--' }}</view>
  71. </view>
  72. <view class="transition">
  73. <up-divider />
  74. <view class="row" v-if="detail.enterprisename">
  75. <view class="label justify">销售商</view>
  76. <view class="value">{{ detail.enterprisename || '--' }}</view>
  77. </view>
  78. <view class="row">
  79. <view class="label">产品信息</view>
  80. <view class="value">
  81. <view class="col-center" style="display: block;">
  82. <view class="value">{{ detail.itemname }}</view>
  83. <view class="value" style="margin-top: 8px;">{{ detail.model }}</view>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="row" v-if="detail.sku">
  88. <view class="label justify">序列号</view>
  89. <view class="value">{{ detail.sku || '--' }}</view>
  90. </view>
  91. <view class="row" v-if="detail.name || detail.phonenumber" style="align-items: center;">
  92. <view class="label justify">客户信息</view>
  93. <view class="value phonenumber">{{ detail.name || '' }}
  94. <block v-if="detail.phonenumber">
  95. <text style="margin: 0 20rpx 0 10rpx;">
  96. {{ detail.phonenumber }}
  97. </text>
  98. <My-button :customStyle="{
  99. width: '142rpx',
  100. height: '48rpx',
  101. 'background-color': '#FFFFFF',
  102. 'color': '#3874F6',
  103. borderRadius: '10rpx'
  104. }" frontIcon="icon-bodadianhua1" text="电话" :phonenumber="detail.phonenumber" />
  105. </block>
  106. </view>
  107. </view>
  108. <view class="row" v-if="detail.servicetype !== '安装' && detail.cardno">
  109. <view class="label">保修信息</view>
  110. <view class="value">
  111. <text :style="{ color: detail.inqualityguaranteeperiod ? '#70B603' : '#D9001B' }"
  112. style="margin-right: 0rpx;">
  113. {{ detail.inqualityguaranteeperiod ? '在保' : '已过保' }}
  114. </text>
  115. {{ detail.cardno || '' }}
  116. <view v-if="detail.cardno && detail.cardbegdate" style="margin-top: 20rpx;">
  117. {{ detail.cardbegdate || '' }} - {{ detail.cardenddate || '' }}
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. </up-transition>
  123. <block v-if="detail.serviceenterprisename">
  124. <up-divider />
  125. <view class="row">
  126. <view class="label">服务地址</view>
  127. <view class="value">{{ detail.serviceenterprisename || '--' }}
  128. </view>
  129. </view>
  130. <view class="row" style="align-items: center;">
  131. <view class="label justify">联系人</view>
  132. <view class="value phonenumber">
  133. <block v-if="detail.scenecontactphonenumber">
  134. <text style="margin: 0 20rpx 0 10rpx;">
  135. {{ detail.servicephonenumber }}
  136. </text>
  137. <My-button :customStyle="{
  138. width: '142rpx',
  139. height: '48rpx',
  140. 'background-color': '#FFFFFF',
  141. 'color': '#3874F6',
  142. borderRadius: '10rpx'
  143. }" :frontIconStyle="{
  144. marginRight: '6rpx',
  145. }" frontIcon="icon-bodadianhua1" text="电话" :phonenumber="detail.servicephonenumber" />
  146. </block>
  147. </view>
  148. </view>
  149. </block>
  150. <view class="row" v-if="detail.refusereason">
  151. <view class="label">受理说明</view>
  152. <view class="value">{{ detail.refusereason || '--' }}
  153. </view>
  154. </view>
  155. <view style="height: 40rpx;" />
  156. <view class="changeTransition" hover-class="navigator-hover" @click="transition = !transition">
  157. 详细信息
  158. <view class="iconfont icon-dianjizhankai" :class="transition ? 'shrink' : ''" />
  159. </view>
  160. </view>
  161. </view>
  162. <up-transition :show="detail.nodes.length != 0">
  163. <view class="main" style="padding: 30rpx;">
  164. <nodes ref="Nodes" :nodes="detail.nodes" />
  165. </view>
  166. </up-transition>
  167. <view style="height: 50px;" />
  168. </template>
  169. <script setup>
  170. import { ref, reactive, getCurrentInstance } from 'vue';
  171. const { $Http } = getCurrentInstance().proxy;
  172. import { onLoad, onShow, onUnload } from '@dcloudio/uni-app';
  173. import nodes from './modules/nodes.vue';
  174. const transition = ref(true);
  175. const Nodes = ref(null);
  176. const steps = ref([]);
  177. let sa_serviceorderid = 0;
  178. onLoad((options) => {
  179. sa_serviceorderid = options.id;
  180. getDetail()
  181. });
  182. const time = ref(new Date().getTime());
  183. let detail = reactive({
  184. servicetype: "",
  185. nodes: [],
  186. });
  187. function getDetail() {
  188. $Http.basic({ "id": "20230206091603", "content": { "nocache": true, sa_serviceorderid } }).then(res => {
  189. console.log("服务申请单详情", res)
  190. if (res.code !== 1) return uni.showToast({ title: res.msg, icon: 'none' });
  191. time.value = new Date().getTime()
  192. res.data.nodes = [];
  193. const now = new Date();
  194. now.setHours(0, 0, 0, 0); // Ignore time part for comparison
  195. res.data.inqualityguaranteeperiod = res.data.cardbegdate && res.data.cardenddate
  196. ? (new Date(res.data.cardbegdate) <= now && now <= new Date(res.data.cardenddate) ? 1 : 0)
  197. : 0;
  198. Object.assign(detail, res.data);
  199. if (res.data.status == '拒绝受理') {
  200. steps.value = [{ title: '已申请', value: '待分配', iconfont: 'icon-yishouli', bgColor: "#3874F6" },
  201. { title: '1' },
  202. { title: '无需服务', value: '拒绝受理', iconfont: 'icon-yiwancheng', bgColor: "#3874F6" }]
  203. } else {
  204. steps.value = [{ title: '已申请', value: '待分配', iconfont: 'icon-yishouli' },
  205. { title: '1' },
  206. { title: '已分配', value: '待受理', iconfont: 'icon-yipaigong' },
  207. { title: '1' },
  208. { title: '已受理', value: '待服务', iconfont: 'icon-yiyuyue' },
  209. { title: '1' },
  210. { title: '服务中', value: '服务中', iconfont: 'icon-yidadao' },
  211. { title: '1' },
  212. { title: '已完结', value: '已完结', iconfont: 'icon-yiwancheng' }]
  213. let status = res.data.status;
  214. if (status === '新建') status = '待分配'
  215. let index = steps.value.findIndex(item => item.value === status);
  216. steps.value = steps.value.map((v, i) => {
  217. if (i == index) {
  218. v.bgColor = "#3874F6"
  219. } else {
  220. v.bgColor = i < index ? "#96B4FA" : "#999999"
  221. }
  222. return v
  223. })
  224. $Http.basic({ "id": 20230207154203, "content": { "sa_serviceorderid": sa_serviceorderid, pageSize: 1 } }).then(res => {
  225. console.log("服务申请单工单列表", res)
  226. if (res.code !== 1) return uni.showToast({ title: res.msg, icon: 'none' });
  227. if (res.data.length) getWorkorderDetail(res.data[0].sa_workorderid)
  228. })
  229. }
  230. })
  231. }
  232. function getWorkorderDetail(sa_workorderid) {
  233. $Http.basic({ "id": "20230208140103", "content": { "nocache": true, sa_workorderid } }).then(res => {
  234. console.log("工单详情", res)
  235. if (res.code !== 1) return uni.showToast({ title: res.msg, icon: 'none' });
  236. time.value = new Date().getTime()
  237. Object.assign(detail, res.data);
  238. })
  239. }
  240. defineExpose({ detail })
  241. </script>
  242. <style lang="scss" scoped>
  243. .step {
  244. display: flex;
  245. width: 690rpx;
  246. margin: 13px 30rpx 20px 30rpx;
  247. box-sizing: border-box;
  248. &-item {
  249. position: relative;
  250. height: 78px;
  251. .circle {
  252. position: relative;
  253. display: flex;
  254. align-items: center;
  255. justify-content: center;
  256. width: 44px;
  257. height: 44px;
  258. border-radius: 50%;
  259. border: 1px solid;
  260. .icon {
  261. display: flex;
  262. align-items: center;
  263. justify-content: center;
  264. width: 36px;
  265. height: 36px;
  266. border-radius: 50%;
  267. color: #FFFFFF;
  268. }
  269. .ywj {
  270. position: absolute;
  271. width: 20px;
  272. height: 20px;
  273. border: 1px solid #F7F7FF;
  274. border-radius: 50%;
  275. top: 50%;
  276. left: 50%;
  277. transform: translate(-50%, -50%);
  278. }
  279. }
  280. .title {
  281. position: absolute;
  282. font-family: Microsoft YaHei, Microsoft YaHei;
  283. font-weight: bold;
  284. color: #333333;
  285. bottom: 0;
  286. white-space: nowrap;
  287. left: 50%;
  288. transform: translateX(-50%);
  289. }
  290. }
  291. .arrows {
  292. flex: 1;
  293. .item {
  294. width: 100%;
  295. display: flex;
  296. align-items: center;
  297. justify-content: center;
  298. height: 44px;
  299. color: #3874F6;
  300. .line {
  301. width: 70%;
  302. height: 2px;
  303. background: #3874F6;
  304. margin: 0 10rpx;
  305. }
  306. .iconfont {
  307. position: relative;
  308. left: -14rpx;
  309. font-size: 24rpx;
  310. font-weight: bold;
  311. color: #3874F6;
  312. }
  313. }
  314. }
  315. }
  316. .main {
  317. position: relative;
  318. width: 690rpx;
  319. background: #FFFFFF;
  320. box-shadow: 0rpx 4rpx 16rpx 2rpx rgba(150, 157, 165, 0.16);
  321. border-radius: 10rpx;
  322. box-sizing: border-box;
  323. padding: 40rpx;
  324. margin: 40rpx auto 0;
  325. overflow: hidden;
  326. .changeTransition {
  327. display: flex;
  328. align-items: center;
  329. justify-content: center;
  330. color: #3874F6;
  331. font-size: 28rpx;
  332. position: absolute;
  333. bottom: 0;
  334. left: 0;
  335. width: 100%;
  336. height: 60rpx;
  337. background: #EDF4FF;
  338. .icon-dianjizhankai {
  339. font-size: 20rpx;
  340. margin-left: 16rpx;
  341. transform: rotate(-90deg);
  342. transition: transform 0.3s ease;
  343. }
  344. .shrink {
  345. transform: rotate(90deg);
  346. }
  347. }
  348. .row {
  349. display: flex;
  350. font-size: 28rpx;
  351. font-family: Microsoft YaHei, Microsoft YaHei;
  352. line-height: 32rpx;
  353. margin-top: 20rpx;
  354. .label {
  355. position: relative;
  356. width: 115rpx;
  357. color: #999999;
  358. box-sizing: border-box;
  359. flex-shrink: 0;
  360. margin-right: 30rpx;
  361. }
  362. .label::after {
  363. position: absolute;
  364. top: 0;
  365. right: -12rpx;
  366. content: ':';
  367. }
  368. .value {
  369. color: #333333;
  370. }
  371. .phonenumber {
  372. width: 100%;
  373. display: flex;
  374. align-items: center;
  375. }
  376. .servicetype {
  377. border-radius: 8rpx;
  378. padding: 8rpx 16rpx;
  379. font-weight: bold;
  380. color: #fff;
  381. }
  382. }
  383. .col-center {
  384. display: flex;
  385. align-items: center;
  386. }
  387. .col-center::after {
  388. top: 50% !important;
  389. transform: translateY(-50%);
  390. }
  391. .justify {
  392. text-align: justify;
  393. text-align-last: justify;
  394. }
  395. .billno {
  396. position: relative;
  397. width: 400rpx;
  398. top: -40rpx;
  399. left: -40rpx;
  400. background: #3874F6;
  401. border-radius: 0 0rpx 24rpx 0rpx;
  402. padding: 10rpx 52rpx 10rpx 20rpx;
  403. font-family: Microsoft YaHei, Microsoft YaHei;
  404. font-size: 26rpx;
  405. color: #FFFFFF;
  406. }
  407. }
  408. .but-box {
  409. display: flex;
  410. align-items: center;
  411. justify-content: space-around;
  412. margin-top: 40rpx;
  413. .but-box-item {
  414. width: 45%;
  415. }
  416. }
  417. </style>