index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <div>
  3. <basicDetails
  4. ref="details"
  5. :mainAreaData="mainAreaData"
  6. :turnPageId="20240902102903"
  7. idname="sa_endcustserviceorderid"
  8. :titleText="mainData.billno"
  9. :tabs="isShowSn?['服务商品','工单']:['工单']"
  10. @pageChange="pageChange">
  11. <div slot="customOperation">
  12. <transferService v-if="tool.checkAuth($route.name,'transferService') && mainData.status == '待处理'" btnTitle="转服务申请单" class="inline-16" message="确定将预约单转服务申请单吗" @onSuccess="queryMainData($route.query.id)" :data="mainData"></transferService>
  13. </div>
  14. <div slot="slot0" >
  15. <tableTemplate v-if="isShowSn" :param="SNParam" height="calc(100vh - 380px)" :tablecols="SNTablecols" @listData="listData"></tableTemplate>
  16. <tableTemplate v-else :param="workParam" height="calc(100vh - 380px)" :tablecols="workTablecols">
  17. <template v-slot:detail="scope">
  18. <el-button type="text" size="mini" class="inline-16" @click="goDetail(scope.data)">详 情</el-button>
  19. </template>
  20. </tableTemplate>
  21. </div>
  22. <div slot="slot1" >
  23. <tableTemplate :param="workParam" height="calc(100vh - 380px)" :tablecols="workTablecols">
  24. <template v-slot:detail="scope">
  25. <el-button type="text" size="mini" class="inline-16" @click="goDetail(scope.data)">详 情</el-button>
  26. </template>
  27. </tableTemplate>
  28. </div>
  29. </basicDetails>
  30. </div>
  31. </template>
  32. <script>
  33. import tableTemplate from "@/WebsiteManagement/serviceAppointMag/compents/tableTemplate";
  34. import transferService from "../modules/transferService";
  35. export default {
  36. name: "index",
  37. components:{tableTemplate,transferService},
  38. data(){
  39. return {
  40. mainAreaData:{},
  41. mainData:{},
  42. isShowSn:true,
  43. SNParam:{
  44. "id": "20240902134203",
  45. "content": {
  46. "siteid":JSON.parse(sessionStorage.getItem('active_account')).siteid,
  47. "sa_endcustserviceorderid":this.$route.query.id,
  48. "pageNumber":1,
  49. "pageSize":50,
  50. "where":{
  51. "condition":""
  52. }
  53. }
  54. },
  55. SNTablecols:this.tool.tabelCol(this.$route.name)['SNCodeTable'].tablecols,
  56. workParam:{
  57. "id": "20240902102803",
  58. "content": {
  59. "siteid":JSON.parse(sessionStorage.getItem('active_account')).siteid,
  60. "sa_endcustserviceorderid":this.$route.query.id,
  61. "pageNumber":1,
  62. "pageSize":50,
  63. "where":{
  64. "condition":""
  65. }
  66. }
  67. },
  68. workTablecols:this.tool.tabelCol(this.$route.name)['WorkBillTable'].tablecols,
  69. }
  70. },
  71. methods:{
  72. async queryMainData(id){
  73. const res = await this.$api.requested({
  74. "id": "20240902102703",
  75. "content": {
  76. "siteid":"HY",
  77. "sa_endcustserviceorderid":id
  78. }
  79. })
  80. this.mainData = Object.assign({},this.mainData,res.data)
  81. this.changeDataStructure()
  82. },
  83. changeDataStructure () {
  84. let that = this
  85. this.mainAreaData = [
  86. {
  87. label:'企业名称',
  88. value: this.mainData.enterprisename
  89. },
  90. {
  91. label:'联系人',
  92. value: this.mainData.name
  93. },
  94. {
  95. label:'联系电话',
  96. value: this.mainData.phonenumber
  97. },
  98. {
  99. label:'省市县',
  100. value: this.mainData.province + '-' + this.mainData.county + '-' + this.mainData.city
  101. },
  102. {
  103. label:'详细地址',
  104. value: this.mainData.address
  105. },
  106. {
  107. label:'提交人手机号',
  108. value: this.mainData.scenecontactphonenumber
  109. },
  110. {
  111. label:'状态',
  112. value: this.mainData.status,
  113. style:function () {
  114. let style = {}
  115. switch (that.mainData.status) {
  116. case '待处理':
  117. style = {color:'#d90a0a'}
  118. break;
  119. case '已确认':
  120. style = {color:'#79da56'}
  121. break;
  122. case '服务中':
  123. style = {color:'#1376e7'}
  124. break;
  125. default:
  126. style = {color:'#151515'}
  127. break;
  128. }
  129. return style
  130. }
  131. },
  132. {
  133. label:'服务类型',
  134. value: this.mainData.servicetype
  135. },
  136. {
  137. label:'应用系统',
  138. value: this.mainData.class1
  139. },
  140. {
  141. label:'客诉大类',
  142. value: this.mainData.class2
  143. },
  144. {
  145. label:'问题描述',
  146. value: this.mainData.remarks
  147. }
  148. ]
  149. },
  150. // 监听切换数据,上一页,下一页
  151. pageChange (id,rowindex) {
  152. this.flag = 0
  153. this.$router.replace({path:'/serviceAppointMagDetail',query:{id:id,rowindex:rowindex,portrait:''}})
  154. this.queryMainData(id)
  155. },
  156. /*工单跳转*/
  157. goDetail (scope) {
  158. let route = this.$route
  159. if (route.path !== '/workorderDetail') {
  160. this.oldRoute = {path:route.path,query:route.query}
  161. this.$store.dispatch('setHistoryRouter',this.oldRoute)
  162. }
  163. this.$router.replace({path:'/workorderDetail',query:{id:scope.data.sa_workorderid,rowindex:scope.data.rowindex}})
  164. },
  165. listData(data){
  166. data.length > 0?this.isShowSn = true:this.isShowSn = false
  167. }
  168. },
  169. mounted() {
  170. this.queryMainData(this.$route.query.id)
  171. },
  172. created() {
  173. this.SNTablecols = this.tool.tabelCol(this.$route.name)['accountMoneyDetailTable'].tablecols
  174. }
  175. }
  176. </script>
  177. <style scoped>
  178. </style>