InfoListItemDetail.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <template>
  2. <div class="record_detail">
  3. <div class="title">
  4. <p class="data_detail">数据详情</p>
  5. </div>
  6. <div class="content">
  7. <div class="content_datail" v-if="status">
  8. <div class="detail">
  9. <span>资料名称:</span>
  10. <span>{{ detailData[nowIndex].informationName }}</span>
  11. </div>
  12. <div class="detail">
  13. <span>上传时间:</span>
  14. <span>{{ detailData[nowIndex].fileUploadDate }}</span>
  15. </div>
  16. <!-- <div class="multiDetail">
  17. <div class="firstColumn">
  18. <span>车系:</span>
  19. <span>{{
  20. detailData[nowIndex].spread
  21. }}</span>
  22. </div>
  23. <div class="secondColumn">
  24. <span>车型:</span>
  25. <span>
  26. {{ detailData[nowIndex].spread }}
  27. </span>
  28. </div>
  29. </div> -->
  30. <div class="multiDetail">
  31. <div class="firstColumn">
  32. <span>素材时间:</span>
  33. <span>{{ detailData[nowIndex].filePulishTime }}</span>
  34. </div>
  35. <div class="secondColumn">
  36. <span>经销商范围:</span>
  37. <span>
  38. {{ detailData[nowIndex].accountScope === 1 ? "共通" : "部分" }}
  39. </span>
  40. </div>
  41. </div>
  42. <div class="detail">
  43. <span>资料描述:</span>
  44. <span>{{ detailData[nowIndex].fileDiscription }}</span>
  45. </div>
  46. <div class="filesStyle multiDetail">
  47. <span>附件:</span>
  48. <div class="filesName">
  49. <p
  50. v-for="(item, index) in fileData"
  51. :key="index"
  52. @click="downloadFile(index)"
  53. >
  54. {{ item.fileName || "附件附件" }}
  55. </p>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </template>
  62. <script>
  63. export default {
  64. props: {
  65. /* detailData: {
  66. type: Array,
  67. default: () => {
  68. return [];
  69. },
  70. }, */
  71. /* fileData: {
  72. type: Array,
  73. default: () => {
  74. return [];
  75. },
  76. }, */
  77. /* nowIndex: {
  78. type: Number,
  79. default: -1,
  80. }, */
  81. },
  82. components: {},
  83. data() {
  84. return {
  85. status: false,
  86. dataObj: {},
  87. onlineUrl: "http://8.136.230.133:8080",
  88. informationId: this.$route.query.informationId || "",
  89. nowIndex: this.$route.query.nowIndex || "",
  90. rows: this.$route.query.Rows || 20,
  91. page: this.$route.query.Page || 1,
  92. agentId: (this.$route.query && this.$route.query.agentId) || "",
  93. detailData: [
  94. {
  95. accountScope: '',
  96. agentId: "",
  97. asc: '',
  98. download: "",
  99. downloadCount: null,
  100. fileDiscription: "",
  101. filePulishTime: "",
  102. fileUploadCreator: "",
  103. fileUploadDate: "",
  104. fileUploadDateLt: null,
  105. id: "",
  106. informationName: "1234",
  107. report: "",
  108. reportId: "",
  109. totalCount: null,
  110. },
  111. ],
  112. fileData: [],
  113. };
  114. },
  115. computed: {},
  116. methods: {
  117. // 下载附件
  118. downloadFile: function (index) {
  119. let config =
  120. "informationId=" +
  121. this.fileData[index].informationId +
  122. "&" +
  123. "fileId=" +
  124. this.fileData[index].id;
  125. let url = this.onlineUrl + "/dealerDownload?" + config;
  126. console.log("下载附件:", config, url);
  127. window.open(url);
  128. },
  129. //查看详情
  130. showDetail: function () {
  131. //获取附件数据
  132. this.$http({
  133. url: "/selectInformationFileList",
  134. method: "post",
  135. data: {
  136. informationId: this.informationId,
  137. },
  138. })
  139. .then((res) => {
  140. if (res.data.code === 200) {
  141. this.fileData = res.data.data;
  142. }
  143. })
  144. .catch((err) => {
  145. console.log(err);
  146. });
  147. },
  148. //分页 获取资料列表
  149. getDataListPage: function () {
  150. this.$http({
  151. url: "/firmsUploadListByAgent",
  152. method: "post",
  153. data: {
  154. agentId: this.agentId,
  155. Page: this.page,
  156. Rows: this.rows,
  157. },
  158. })
  159. .then((res) => {
  160. if (res.data.code === 200) {
  161. this.detailData = res.data.data;
  162. console.log(this.detailData);
  163. this.showDetail();
  164. this.status = true;
  165. }
  166. })
  167. .catch((err) => {
  168. console.log(err);
  169. });
  170. },
  171. },
  172. mounted() {
  173. this.getDataListPage();
  174. console.log(this.detailData);
  175. },
  176. };
  177. </script>
  178. <style scoped lang="less">
  179. .record_detail {
  180. .title {
  181. border: 1px solid #ccc;
  182. border-bottom: 0px;
  183. .data_detail {
  184. padding-left: 22px;
  185. font-size: 14px;
  186. font-weight: bolder;
  187. height: 46.8px;
  188. display: flex;
  189. align-items: center;
  190. }
  191. }
  192. .content {
  193. display: flex;
  194. border: 1px solid #ccc;
  195. padding: 20px;
  196. .content_datail {
  197. width: 100%;
  198. padding: 20px 50px 0;
  199. .detail {
  200. width: 100%;
  201. height: 50px;
  202. display: flex;
  203. align-items: center;
  204. }
  205. }
  206. }
  207. }
  208. .multiDetail {
  209. width: 100%;
  210. height: 50px;
  211. display: flex;
  212. align-items: center;
  213. }
  214. .firstColumn,
  215. .secondColumn {
  216. display: flex;
  217. align-items: center;
  218. }
  219. .firstColumn span:nth-child(1) {
  220. /* width: 80px; */
  221. display: block;
  222. margin-right: 16px;
  223. }
  224. .secondColumn span:nth-child(1) {
  225. /* width: 80px; */
  226. display: block;
  227. margin-left: 40px;
  228. margin-right: 16px;
  229. }
  230. .detail span:nth-child(1) {
  231. /* width: 80px; */
  232. margin-right: 16px;
  233. }
  234. .filesStyle span:nth-child(1) {
  235. /* width: 80px; */
  236. margin-right: 16px;
  237. }
  238. .filesStyle {
  239. margin-right: 16px;
  240. }
  241. .filesName p {
  242. color: #4b8ec7;
  243. margin: 4px;
  244. }
  245. </style>