detail.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <ion-page>
  3. <ion-header class="header-theme2">
  4. <ion-toolbar>
  5. <ion-buttons slot="start">
  6. <ion-icon :icon="arrowBackOutline" @click="onBack"></ion-icon>
  7. </ion-buttons>
  8. <ion-title>
  9. 企业信息详情
  10. </ion-title>
  11. </ion-toolbar>
  12. </ion-header>
  13. <ion-content>
  14. <div class="bw-vue-form">
  15. <div class="form-detail">
  16. <ion-label>企业名称</ion-label>
  17. <ion-text>{{ dataModel.companyName }}</ion-text>
  18. </div>
  19. <div class="form-detail">
  20. <ion-label>统一信用代码</ion-label>
  21. <ion-text>{{ dataModel.companyCode }}</ion-text>
  22. </div>
  23. <div class="form-detail">
  24. <ion-label>企业地址</ion-label>
  25. <ion-text>{{ dataModel.companyAddress }}</ion-text>
  26. </div>
  27. <div class="form-detail">
  28. <ion-label>所属驿站</ion-label>
  29. <ion-text>{{ dataModel.siteName }}</ion-text>
  30. </div>
  31. <div class="form-detail">
  32. <ion-label>联系人</ion-label>
  33. <ion-text>{{ dataModel.userName }}</ion-text>
  34. </div>
  35. <div class="form-detail">
  36. <ion-label>联系电话</ion-label>
  37. <ion-text>{{ dataModel.userMobile }}</ion-text>
  38. </div>
  39. <div class="form-detail">
  40. <ion-label>企业简介</ion-label>
  41. <ion-text>{{ dataModel.companyDesc }}</ion-text>
  42. </div>
  43. </div>
  44. </ion-content>
  45. <ion-footer>
  46. </ion-footer>
  47. </ion-page>
  48. </template>
  49. <script lang="ts">
  50. import {defineComponent, ref, reactive, watch, toRefs} from "vue";
  51. import {getCompanyById} from "@/api/company";
  52. import {useRoute, useRouter} from "vue-router";
  53. import {onIonViewDidEnter} from "@ionic/vue";
  54. import {arrowBackOutline} from 'ionicons/icons';
  55. interface FormData{
  56. dataModel:any
  57. }
  58. export default defineComponent({
  59. name: 'CompanyDetail',
  60. setup() {
  61. const router = useRouter();
  62. const route = useRoute();
  63. const loading = ref<boolean>(false);
  64. const formData = reactive<FormData>({
  65. dataModel: {
  66. companyID:null,
  67. companyName:null
  68. }
  69. });
  70. const onBack=()=>{
  71. router.push({path:'./list',query:{reload:1}});
  72. };
  73. const onPathForward = (pathValue:string,statusValue:any)=>{
  74. router.push({path: pathValue, query: {reload:1,id:formData.dataModel.companyID,status:statusValue}});
  75. };
  76. const loadData = async (companyID:any)=>{
  77. loading.value = true;
  78. const reqData = await getCompanyById(companyID,"60ea0d5b-a75c-11ed-a6c5-7085c2a9999e");
  79. formData.dataModel = reqData;
  80. console.log("dataModel",formData.dataModel);
  81. loading.value = false;
  82. };
  83. const reload = (companyID:any) => {
  84. loadData(companyID);
  85. };
  86. watch(() => route.query, () => {
  87. if (route.query.reload) {
  88. reload(route.query.id);
  89. }
  90. });
  91. onIonViewDidEnter(() => {
  92. if (route.query.reload) {
  93. reload(route.query.id)
  94. }
  95. });
  96. return {
  97. ...toRefs(formData),
  98. arrowBackOutline,
  99. route,
  100. loading,
  101. onPathForward,
  102. onBack,
  103. loadData,
  104. router,
  105. }
  106. },
  107. mounted() {
  108. const companyID = this.route.query.id;
  109. this.loadData(companyID);
  110. }
  111. });
  112. </script>
  113. <style lang="less">
  114. ion-item {
  115. --border-width: 0;
  116. --border-style: none;
  117. ion-label, ion-input, ion-select, ion-datetime-button {
  118. font-size: 14px !important;
  119. }
  120. }
  121. .stepFlex {
  122. margin: 0;
  123. display: flex;
  124. width: 100%;
  125. .stepFlex-item {
  126. position: relative;
  127. flex: 1;
  128. text-align: center;
  129. margin-top: -10px;
  130. .stepFlex-item-label {
  131. padding-top: 60px;
  132. font-size: 14px;
  133. .stepFlex-item-label-title {
  134. margin-top: 30px;
  135. }
  136. .stepFlex-item-label-desc {
  137. margin-top: 5px;
  138. color: #b9b9bd;
  139. }
  140. }
  141. }
  142. .greenCircle {
  143. top: calc(50% - 15px);
  144. left: calc(50% - 4px);
  145. position: absolute;
  146. z-index: 2;
  147. width: 10px;
  148. height: 10px;
  149. border-radius: 50%;
  150. background-color: #31A2FE;
  151. }
  152. .now {
  153. top: calc(50% - 18px);
  154. left: calc(50% - 8px);
  155. position: absolute;
  156. z-index: 3;
  157. width: 16px;
  158. height: 16px;
  159. border-radius: 50%;
  160. background-color: #31A2FE;
  161. border: 4px solid #c5e8f9;
  162. }
  163. .grayCircle {
  164. top: calc(50% - 15px);
  165. left: calc(50% - 4px);
  166. position: absolute;
  167. z-index: 2;
  168. width: 10px;
  169. height: 10px;
  170. border-radius: 50%;
  171. background-color: #ccc;
  172. }
  173. .greenLine {
  174. width: 100%;
  175. top: calc(50% - 11px);
  176. left: calc(50% - 2px);
  177. height: 2px;
  178. background-color: #31A2FE;
  179. position: absolute;
  180. }
  181. .grayLine {
  182. height: 0;
  183. border: 1px dashed #ccc;
  184. width: 100%;
  185. top: calc(50% - 11px);
  186. left: calc(50% - 2px);
  187. position: absolute;
  188. }
  189. }
  190. </style>