detail.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  1. <div id="app" v-cloak>
  2. <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  3. <div slot="header">
  4. <span>{{ custom_text }}管理/{{ custom_text }}详情</span>
  5. </div>
  6. <!-- 技师数据概况 -->
  7. <el-card style="margin-top: 10px" shadow="never">
  8. <div slot="header">
  9. 数据概况
  10. </div>
  11. <el-row :gutter="10" style="margin-top: 20px; text-align: center" v-loading="statisticsLoading">
  12. <el-col :span="12">
  13. <div>
  14. <strong>{{statistics.total_order}}</strong>
  15. </div>
  16. <div style="margin-top: 20px">
  17. <strong>累计接单</strong>
  18. </div>
  19. </el-col>
  20. <!-- <el-col :span="6">-->
  21. <!-- <div>-->
  22. <!-- <strong>{{statistics.total_commission}}</strong>-->
  23. <!-- </div>-->
  24. <!-- <div style="margin-top: 20px">-->
  25. <!-- <strong>累计收益</strong>-->
  26. <!-- </div>-->
  27. <!-- </el-col>-->
  28. <el-col :span="12">
  29. <div>
  30. <strong>{{statistics.month_order}}</strong>
  31. </div>
  32. <div style="margin-top: 20px">
  33. <strong>本月接单</strong>
  34. </div>
  35. </el-col>
  36. <!-- <el-col :span="8">-->
  37. <!-- <div>-->
  38. <!-- <strong>{{statistics.month_commission}}</strong>-->
  39. <!-- </div>-->
  40. <!-- <div style="margin-top: 20px">-->
  41. <!-- <strong>本月收益</strong>-->
  42. <!-- </div>-->
  43. <!-- </el-col>-->
  44. </el-row>
  45. </el-card>
  46. <!-- 技师详情 -->
  47. <el-card style="margin-top: 20px" shadow="never">
  48. <el-tabs v-model="activeName" @tab-click="handleClick">
  49. <el-tab-pane label="基本信息" name="first">
  50. <el-form v-loading="loading">
  51. <el-row :gutter="20">
  52. <el-col :span="12">
  53. <el-form-item label="门店接单状态">
  54. <el-switch
  55. @change="onChangeStatus"
  56. v-model="data.store_status"
  57. :active-value="'1'"
  58. :inactive-value="'0'"
  59. >
  60. </el-switch>
  61. </el-form-item>
  62. <el-form-item label="姓名">
  63. {{data.name}}
  64. </el-form-item>
  65. <el-form-item label="手机号码">
  66. {{data.mobile}}
  67. </el-form-item>
  68. <el-form-item label="性别">
  69. <el-tag size="mini" :type="gender[data.gender].type">{{gender[data.gender].title}}</el-tag>
  70. </el-form-item>
  71. <el-form-item label="年龄">
  72. {{data.age}}
  73. </el-form-item>
  74. <el-form-item label="服务地址">
  75. {{data.address}}
  76. </el-form-item>
  77. <el-form-item :label="custom_text + '等级'">
  78. {{data.level ? data.level.name : '默认等级'}}
  79. </el-form-item>
  80. </el-col>
  81. <el-col :span="12">
  82. <el-form-item label="证件号码">
  83. {{data.idcard}}
  84. </el-form-item>
  85. <el-form-item label="证件图片">
  86. <el-image
  87. v-for="(img, index) in data.idcard_images"
  88. :key="index"
  89. style="width: 50px; height: 50px; margin-left: 5px"
  90. :src="img"
  91. :preview-src-list="data.idcard_images">
  92. </el-image>
  93. </el-form-item>
  94. <el-form-item label="资格证书">
  95. <el-image
  96. v-for="(img, index) in data.qualification_certificate"
  97. :key="index"
  98. style="width: 50px; height: 50px; margin-left: 5px"
  99. :src="img"
  100. :preview-src-list="data.qualification_certificate">
  101. </el-image>
  102. </el-form-item>
  103. <el-form-item label="绑定门店">
  104. {{data.settle.store.store_name}}
  105. </el-form-item>
  106. <el-form-item label="创建时间">
  107. {{data.settle.updated_at|dateTimeFormat('Y-m-d H:i:s')}}
  108. </el-form-item>
  109. </el-col>
  110. </el-row>
  111. </el-form>
  112. </el-tab-pane>
  113. <el-tab-pane label="关联商品" name="second">
  114. <el-table :data="goods_list" style="width: 100%">
  115. <el-table-column prop="id" label="商品ID" ></el-table-column>
  116. <el-table-column prop="goods_name" label="商品">
  117. <template slot-scope="scope">
  118. <div flex="cross:center">
  119. <div style="margin-right: 10px;">
  120. <el-image style="width: 50px; height: 50px;border-radius: 5px;" :src="scope.row.cover_pic"></el-image>
  121. </div>
  122. <el-tooltip class="item" effect="dark" content="商品名称" placement="top">
  123. <span>{{scope.row.goods_name}}</span>
  124. </el-tooltip>
  125. </div>
  126. </template>
  127. </el-table-column>
  128. <el-table-column prop="price" label="售价"></el-table-column>
  129. <el-table-column prop="cate_name" label="分类" ></el-table-column>
  130. <el-table-column prop="created_at" label="创建时间">
  131. <template slot-scope="scope">
  132. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  133. </template>
  134. </el-table-column>
  135. </el-table>
  136. <el-pagination
  137. v-if="paginationAdd"
  138. style="display: inline-block;"
  139. background
  140. :page-size="paginationAdd.pageSize"
  141. @current-change="getAssociationAddList"
  142. layout="prev, pager, next"
  143. :total="paginationAdd.total_count">
  144. </el-pagination>
  145. </el-tab-pane>
  146. </el-tabs>
  147. </el-card>
  148. <!-- 技师评价 -->
  149. <el-card style="margin-top: 20px" shadow="never">
  150. <div slot="header">
  151. <span>服务评价</span><span style="margin-left: 10px; font-size: 12px; color: #999">综合评分:{{data.store_service_rating}}</span>
  152. </div>
  153. <div v-loading="commentLoading">
  154. <el-row :gutter="20">
  155. <el-col :span="8" v-for="(item, index) in commentList" :key="index" style="padding-bottom: 20px">
  156. <el-card shadow="hover">
  157. <template #header>
  158. <div class="table-info-img-text">
  159. <el-image class="table-info-img" :src="item.orderDetail.pic_url">
  160. <div slot="error" class="image-slot">
  161. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  162. </div>
  163. </el-image>
  164. <div class="table-info-text" style="width: 100%;">
  165. <div class="view-text" style="color:#999;">{{item.orderDetail.goods_name}}
  166. <span style="float: right">×{{item.orderDetail.num}}</span>
  167. </div>
  168. <div style="font-size: 12px;color:#999;">{{item.orderDetail.goods_attr_name ? item.orderDetail.goods_attr_name : '--'}}</div>
  169. </div>
  170. </div>
  171. </template>
  172. <template>
  173. <el-row>
  174. <el-col :span="12">
  175. <span style="float: left">
  176. {{item.user.nickname ? item.user.nickname : item.user.mobile}}
  177. </span>
  178. <span style="float: left">
  179. <el-rate
  180. :value="item.staff_score"
  181. disabled
  182. text-color="#ff9900">
  183. </el-rate>
  184. </span>
  185. </el-col>
  186. <el-col :span="12">
  187. <div style="color: #999; text-align: right">{{item.created_at}}</div>
  188. </el-col>
  189. </el-row>
  190. <div style="color: #999; margin-top: 10px">
  191. <com-ellipsis :line="1" :text="item.comment.content ? item.comment.content : '无评价内容'"></com-ellipsis>
  192. </div>
  193. <div style="margin-top: 10px; height: 20px; width: 100%; overflow: hidden;">
  194. <el-tag style="margin-right: 10px" size="mini" type="info" v-for="(tag, tIndex) in item.tags" :key="tIndex">{{tag}}</el-tag>
  195. </div>
  196. </template>
  197. </el-card>
  198. </el-col>
  199. </el-row>
  200. <div style="text-align: center">
  201. <el-button size="small" @click="getCommentList" type="primary" icon="el-icon-arrow-down"
  202. :loading="commentLoading" :disabled="commentLoading || commentBtnDisabled">查看更多</el-button>
  203. </div>
  204. </div>
  205. </el-card>
  206. <div style="padding: 10px"></div>
  207. </el-card>
  208. </div>
  209. <script>
  210. const app = new Vue({
  211. el: '#app',
  212. data: {
  213. list: [],
  214. loading: false,
  215. btnLoading: false,
  216. activeName: '-1',
  217. pagination: null,
  218. page_size: 10,
  219. currentItem: null,
  220. statisticsLoading: false,
  221. commentLoading: false,
  222. commentBtnDisabled: false,
  223. id: '',
  224. data: {
  225. service_rating: 5.0,
  226. gender: 0,
  227. settle: {
  228. store: {}
  229. }
  230. },
  231. gender: [
  232. {
  233. title: '保密',
  234. type: 'primary'
  235. },
  236. {
  237. title: '男',
  238. type: 'success'
  239. },
  240. {
  241. title: '女',
  242. type: 'danger'
  243. }
  244. ],
  245. statistics: {
  246. total_order: 0,
  247. total_commission: 0,
  248. month_order: 0,
  249. month_commission: 0,
  250. },
  251. commentList: [],
  252. page: 0,
  253. custom_text: '',
  254. activeName:'first',
  255. goods_list:[],
  256. paginationAdd:null,
  257. goodsPage:1,
  258. },
  259. computed: {
  260. },
  261. mounted() {
  262. this.id = getQuery('id');
  263. this.loadData();
  264. this.getStatistics()
  265. this.getCommentList()
  266. },
  267. methods: {
  268. getStatistics() {
  269. this.statisticsLoading = true
  270. request({
  271. params: {
  272. r: 'store/client/reserve-staff/statistics',
  273. id: this.id
  274. },
  275. method: 'get',
  276. }).then(e => {
  277. this.statisticsLoading = false;
  278. if (e.data.code == 0) {
  279. this.statistics = e.data.data
  280. } else {
  281. this.$message.error(e.data.msg);
  282. }
  283. }).catch(e => {
  284. this.statisticsLoading = false;
  285. });
  286. },
  287. loadData() {
  288. this.loading = true;
  289. let params = {
  290. r: 'store/client/reserve-staff/detail',
  291. id: this.id
  292. };
  293. params = Object.assign(params, this.searchInfo);
  294. request({
  295. params: params,
  296. method: 'get',
  297. }).then(e => {
  298. this.loading = false;
  299. if (e.data.code == 0) {
  300. this.data = e.data.data
  301. this.custom_text = e.data.data.custom_text
  302. } else {
  303. this.$message.error(e.data.msg);
  304. }
  305. }).catch(e => {
  306. this.loading = false;
  307. });
  308. },
  309. getCommentList() {
  310. this.commentLoading = true
  311. this.page += 1;
  312. request({
  313. params: {
  314. r: 'store/client/reserve-order-comment/index',
  315. id: this.id,
  316. limit: 12,
  317. page: this.page
  318. },
  319. method: 'get',
  320. }).then(e => {
  321. this.commentLoading = false;
  322. if (e.data.code == 0) {
  323. if (e.data.data.list.length < 12) this.commentBtnDisabled = true;
  324. this.commentList = this.commentList.concat(e.data.data.list)
  325. this.pagination = e.data.data.pagination;
  326. this.page_size = e.data.data.page_size;
  327. // this.data.service_rating = e.data.data.service_rating
  328. } else {
  329. this.$message.error(e.data.msg);
  330. }
  331. }).catch(e => {
  332. this.commentLoading = false;
  333. });
  334. },
  335. pageChange(page) {
  336. this.search.page = page;
  337. this.loadData();
  338. },
  339. onChangeStatus() {
  340. this.btnLoading = false;
  341. request({
  342. params: {
  343. r: 'store/client/reserve-staff/set-status'
  344. },
  345. method: 'post',
  346. data: {
  347. id: this.id,
  348. }
  349. }).then(e => {
  350. this.btnLoading = false;
  351. if (e.data.code == 0) {
  352. this.$message.success(e.data.msg);
  353. } else {
  354. this.$message.error(e.data.msg);
  355. }
  356. }).catch(e => {
  357. this.btnLoading = false;
  358. });
  359. },
  360. getGoodsList() {
  361. let params = {
  362. r: 'store/client/reserve-staff/get-association-store-goods-page',
  363. user_id:this.id,
  364. page:this.goodsPage
  365. };
  366. request({
  367. params: params,
  368. method: 'get',
  369. }).then(e => {
  370. if (e.data.code == 0) {
  371. this.goods_list = e.data.data.list;
  372. this.paginationAdd = e.data.data.pagination;
  373. this.paginationAdd.pageSize = e.data.data.page_size;
  374. this.paginationAdd.total_count = this.pagination.totalCount;
  375. } else {
  376. this.$message.error(e.data.msg);
  377. }
  378. }).catch(e => {
  379. });
  380. },
  381. handleClick(tab, event) {
  382. if(tab.name=='second'){
  383. this.getGoodsList();
  384. }
  385. },
  386. getAssociationAddList(page){
  387. this.goodsPage = page;
  388. this.getGoodsList();
  389. },
  390. }
  391. });
  392. </script>
  393. <style>
  394. .el-tabs__header {
  395. font-size: 16px;
  396. }
  397. .table-body {
  398. padding: 20px;
  399. background-color: #fff;
  400. }
  401. .table-body .el-button {
  402. padding: 0 !important;
  403. border: 0;
  404. margin: 0 5px;
  405. }
  406. .input-item {
  407. width: 250px;
  408. margin: 0 0 20px;
  409. display: inline-block;
  410. }
  411. /*.input-item .el-input__inner {*/
  412. /* border-right: 0;*/
  413. /*}*/
  414. .input-item .el-input__inner:hover {
  415. border: 1px solid #dcdfe6;
  416. /*border-right: 0;*/
  417. outline: 0;
  418. }
  419. .input-item .el-input__inner:focus {
  420. border: 1px solid #dcdfe6;
  421. /*border-right: 0;*/
  422. outline: 0;
  423. }
  424. .input-item .el-input-group__append {
  425. background-color: #fff;
  426. border-left: 0;
  427. width: 10%;
  428. padding: 0;
  429. }
  430. .input-item .el-input-group__append .el-button {
  431. padding: 0;
  432. }
  433. .input-item .el-input-group__append .el-button {
  434. margin: 0;
  435. }
  436. .batch {
  437. margin: 0 0 20px;
  438. display: inline-block;
  439. }
  440. .batch .el-button {
  441. padding: 9px 15px !important;
  442. }
  443. .el-table th>.cell{
  444. color: #333;
  445. font-weight: bold;
  446. font-size: 14px;
  447. }
  448. .el-table__footer-wrapper, .el-table__header-wrapper{
  449. border-bottom: 1.4px solid #D6D6D6;
  450. }
  451. .el-table th>.cell {
  452. color: #333;
  453. font-weight: bold;
  454. font-size: 14px;
  455. }
  456. .table1 .el-table__footer-wrapper,
  457. .table1 .el-table__header-wrapper {
  458. border-bottom: 1.4px solid #D6D6D6;
  459. }
  460. .user_img{
  461. position: relative;
  462. margin-right: 8px;
  463. /* height: 50px;
  464. width: 50px; */
  465. }
  466. .default-avatar{
  467. width: 50px;
  468. height: 50px;
  469. border-radius: 50%;
  470. margin-right: 8px;
  471. }
  472. .uer-nickname {
  473. flex: 1;
  474. }
  475. </style>