index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <div id="index">
  3. <trial-detail
  4. :info="info"
  5. :nativeList="nativeList"
  6. @onsave="nativeClick"
  7. :display="display"
  8. :userInfos="userInfos"
  9. :userList="userList"
  10. :userListTotal="userListTotal"
  11. :adminList="adminList"
  12. :adminListTotal="adminListTotal"
  13. :alreadyList="alreadyList"
  14. :alreadyListTotal="alreadyListTotal"
  15. :notList="notList"
  16. :notListTotal="notListTotal"
  17. :JiaoyiList="JiaoyiList"
  18. :JiaoyiTotal="JiaoyiTotal"
  19. :alreadyTwoList="alreadyTwoList"
  20. :alreadyTwoListTotal="alreadyTwoListTotal"
  21. :notTwoList="notTwoList"
  22. :notTwoListTotal="notTwoListTotal"
  23. :JiaoyiTwoList="JiaoyiTwoList"
  24. :JiaoyiTwoListTotal="JiaoyiTwoListTotal"
  25. @deletes="deleteAlready"
  26. ></trial-detail>
  27. </div>
  28. </template>
  29. <script>
  30. import trialDetail from '@/components/trial/index.vue';
  31. import { createNamespacedHelpers, mapGetters } from 'vuex';
  32. const { mapActions: mapSite } = createNamespacedHelpers('site');
  33. const { mapActions: mapProduct } = createNamespacedHelpers('enterpriseproject');
  34. const { mapActions: mapMarketUser } = createNamespacedHelpers('market');
  35. export default {
  36. name: 'index',
  37. props: {},
  38. components: {
  39. trialDetail,
  40. },
  41. data: () => ({
  42. info: {},
  43. nativeList: [
  44. {
  45. name: '基本信息',
  46. },
  47. {
  48. name: '用户管理',
  49. },
  50. {
  51. name: '我的审核',
  52. },
  53. {
  54. name: '统计信息',
  55. },
  56. {
  57. name: '注销账号',
  58. },
  59. ],
  60. display: 'first',
  61. // 基本信息
  62. userInfos: {
  63. name: '外审管理员',
  64. cardnumber: '220182199603257019',
  65. addr: '吉林省长春市朝阳区力旺广场B座16楼1608',
  66. },
  67. userList: [
  68. {
  69. name: '测试人员',
  70. img_path: require('@/assets/getImage.jpg'),
  71. role: '外审管理员',
  72. is_qy: '法人',
  73. phone: '0431-123456',
  74. },
  75. {
  76. name: '三条数据',
  77. img_path: require('@/assets/getImage.jpg'),
  78. role: '外审管理员',
  79. is_qy: '法人',
  80. phone: '0431-123456',
  81. },
  82. ],
  83. userListTotal: 1,
  84. adminList: [
  85. {
  86. name: '测试人员',
  87. img_path: require('@/assets/getImage.jpg'),
  88. role: '外审管理员',
  89. is_qy: '法人',
  90. phone: '0431-123456',
  91. },
  92. {
  93. name: '三条数据',
  94. img_path: require('@/assets/getImage.jpg'),
  95. role: '外审管理员',
  96. is_qy: '法人',
  97. phone: '0431-123456',
  98. },
  99. ],
  100. adminListTotal: 1,
  101. alreadyList: [
  102. {
  103. image: require('@/assets/getImage.jpg'),
  104. name: '产品名称',
  105. totaltype: '服务',
  106. price: '1000',
  107. priceunit: '元/台',
  108. },
  109. ],
  110. alreadyListTotal: 1,
  111. notList: [
  112. {
  113. image: require('@/assets/getImage.jpg'),
  114. name: '产品名称',
  115. totaltype: '服务',
  116. price: '1000',
  117. priceunit: '元/台',
  118. },
  119. ],
  120. notListTotal: 1,
  121. JiaoyiList: [
  122. {
  123. image: require('@/assets/getImage.jpg'),
  124. name: '产品名称',
  125. totaltype: '服务',
  126. price: '1000',
  127. priceunit: '元/台',
  128. },
  129. ],
  130. JiaoyiTotal: 1,
  131. alreadyTwoList: [
  132. {
  133. image: require('@/assets/getImage.jpg'),
  134. name: '产品名称',
  135. totaltype: '服务',
  136. price: '1000',
  137. priceunit: '元/台',
  138. },
  139. ],
  140. alreadyTwoListTotal: 1,
  141. notTwoList: [
  142. {
  143. image: require('@/assets/getImage.jpg'),
  144. name: '产品名称',
  145. totaltype: '服务',
  146. price: '1000',
  147. priceunit: '元/台',
  148. },
  149. ],
  150. notTwoListTotal: 1,
  151. JiaoyiTwoList: [
  152. {
  153. image: require('@/assets/getImage.jpg'),
  154. name: '我的供给',
  155. totaltype: '服务',
  156. price: '1000',
  157. priceunit: '元/台',
  158. },
  159. ],
  160. JiaoyiTwoListTotal: 1,
  161. }),
  162. created() {
  163. this.searchSite();
  164. this.searchInfo();
  165. this.searchUser();
  166. },
  167. computed: {},
  168. methods: {
  169. ...mapSite(['showInfo']),
  170. ...mapProduct({ ProductQuery: 'query', ProductFetch: 'fetch', ProductDelete: 'delete' }),
  171. ...mapMarketUser({ userQuery: 'query', userFetch: 'fetch', userDelete: 'delete' }),
  172. // 查询站点信息
  173. async searchSite() {
  174. let res = await this.showInfo();
  175. let object = JSON.parse(JSON.stringify(res.data));
  176. if (object) {
  177. this.$set(this, `info`, res.data);
  178. } else {
  179. this.$message.error(res.errmsg ? res.errmsg : 'error');
  180. }
  181. },
  182. async nativeClick({ name }) {
  183. // console.log(name);
  184. if (name === '基本信息') {
  185. this.display = 'first';
  186. } else if (name === '用户管理') {
  187. this.display = 'second';
  188. } else if (name === '我的审核') {
  189. this.display = 'third';
  190. } else if (name === '统计信息') {
  191. this.display = 'fourth';
  192. } else {
  193. this.display = 'fivth';
  194. }
  195. },
  196. async searchInfo({ skip = 0, limit = 3, ...info } = {}) {
  197. const res = await this.ProductQuery({ skip, limit, ...info });
  198. this.$set(this, `alreadyList`, res.data);
  199. this.$set(this, `alreadyListTotal`, res.total);
  200. this.$set(this, `notList`, res.data);
  201. this.$set(this, `notListTotal`, res.total);
  202. this.$set(this, `JiaoyiList`, res.data);
  203. this.$set(this, `JiaoyiListTotal`, res.total);
  204. this.$set(this, `alreadyTwoList`, res.data);
  205. this.$set(this, `alreadyTwoListTotal`, res.total);
  206. this.$set(this, `notTwoList`, res.data);
  207. this.$set(this, `notTwoListTotal`, res.total);
  208. this.$set(this, `JiaoyiTwoList`, res.data);
  209. this.$set(this, `JiaoyiTwoListTotal`, res.total);
  210. },
  211. async deleteAlready({ item }) {
  212. console.log(item);
  213. console.log(item.id);
  214. this.$message('刪除成功');
  215. },
  216. async searchUser({ skip = 0, limit = 3, ...info } = {}) {
  217. const res = await this.userQuery({ skip, limit, ...info });
  218. console.log(res);
  219. this.$set(this, `userList`, res.data);
  220. this.$set(this, `userListTotal`, res.total);
  221. },
  222. },
  223. };
  224. </script>
  225. <style lang="less" scoped></style>