plm前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

299 lines
8.7 KiB

  1. <template>
  2. <div class="mode-config">
  3. <el-row>
  4. <el-col>
  5. <el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
  6. <el-form :inline="true" label-position="top" style="margin-top: 0px">
  7. <download-excel
  8. :fields="fields2()"
  9. :data="exportData2"
  10. type="xls"
  11. :name="exportName2"
  12. :header="exportHeader2"
  13. :footer="exportFooter2"
  14. :fetch="createExportData2"
  15. worksheet="导出信息"
  16. class="el-button el-button--primary el-button--medium">
  17. {{ '导出' }}
  18. </download-excel>
  19. </el-form>
  20. </el-form>
  21. </el-col>
  22. </el-row>
  23. <el-table
  24. :data="dataList"
  25. :height="height"
  26. border
  27. v-loading="dataListLoading"
  28. style="width: 100%;margin-top: 10px ">
  29. <el-table-column
  30. v-for="(item,index) in columnList2" :key="index"
  31. :sortable="item.columnSortable"
  32. :prop="item.columnProp"
  33. :header-align="item.headerAlign"
  34. :show-overflow-tooltip="item.showOverflowTooltip"
  35. :align="item.align"
  36. :fixed="item.fixed==''?false:item.fixed"
  37. :min-width="item.columnWidth"
  38. :label="item.columnLabel">
  39. <template slot-scope="scope">
  40. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  41. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  42. style="width: 100px; height: 80px"/></span>
  43. </template>
  44. </el-table-column>
  45. </el-table>
  46. </div>
  47. </template>
  48. <script>
  49. import {
  50. getCustomerContactData,
  51. } from "@/api/project/project.js"
  52. export default {
  53. name: "customerContact",
  54. props: {
  55. height: {
  56. type: Number,
  57. default: 300
  58. },
  59. dataList:{
  60. type: Array,
  61. default: () => []
  62. }
  63. },
  64. data(){
  65. return{
  66. quotationData: {},
  67. exportData2: [],
  68. exportName2: "项目客户联系人" + this.dayjs().format('YYYYMMDDHHmmss'),
  69. exportHeader2: ["项目客户联系人"],
  70. exportFooter2: [],
  71. exportList2:[],
  72. dataListLoading: false,
  73. columnList2: [
  74. {
  75. userId: this.$store.state.user.name,
  76. functionId: 102003,
  77. serialNumber: '102003Table99ContactName',
  78. tableId: '102003Table99',
  79. tableName: '项目联系人表',
  80. columnProp: 'contactName',
  81. headerAlign: 'center',
  82. align: 'center',
  83. columnLabel: '联系人',
  84. columnHidden: false,
  85. columnImage: false,
  86. columnSortable: false,
  87. sortLv: 0,
  88. status: true,
  89. fixed: '',
  90. columnWidth: 80
  91. },
  92. {
  93. userId: this.$store.state.user.name,
  94. functionId: 102003,
  95. serialNumber: '102003Table99ContactPhoneNumber1',
  96. tableId: '102003Table99',
  97. tableName: '项目联系人表',
  98. columnProp: 'contactPhoneNumber1',
  99. headerAlign: 'center',
  100. align: 'center',
  101. columnLabel: '联系电话',
  102. columnHidden: false,
  103. columnImage: false,
  104. columnSortable: false,
  105. sortLv: 0,
  106. status: true,
  107. fixed: '',
  108. columnWidth: 80
  109. },
  110. {
  111. userId: this.$store.state.user.name,
  112. functionId: 102003,
  113. serialNumber: '102003Table99ContactLandlineNumber',
  114. tableId: '102003Table99',
  115. tableName: '项目联系人表',
  116. columnProp: 'contactLandlineNumber',
  117. headerAlign: 'center',
  118. align: 'center',
  119. columnLabel: '座机',
  120. columnHidden: false,
  121. columnImage: false,
  122. columnSortable: false,
  123. sortLv: 0,
  124. status: true,
  125. fixed: '',
  126. columnWidth: 80
  127. },
  128. {
  129. userId: this.$store.state.user.name,
  130. functionId: 102003,
  131. serialNumber: '102003Table99Position',
  132. tableId: '102003Table99',
  133. tableName: '项目联系人表',
  134. columnProp: 'position',
  135. headerAlign: 'center',
  136. align: 'center',
  137. columnLabel: '公司职务',
  138. columnHidden: false,
  139. columnImage: false,
  140. columnSortable: false,
  141. sortLv: 0,
  142. status: true,
  143. fixed: '',
  144. columnWidth: 80
  145. },
  146. {
  147. userId: this.$store.state.user.name,
  148. functionId: 102003,
  149. serialNumber: '102003Table99Mailbox',
  150. tableId: '102003Table99',
  151. tableName: '项目联系人表',
  152. columnProp: 'mailbox',
  153. headerAlign: 'center',
  154. align: 'center',
  155. columnLabel: '邮箱',
  156. columnHidden: false,
  157. columnImage: false,
  158. columnSortable: false,
  159. sortLv: 0,
  160. status: true,
  161. fixed: '',
  162. columnWidth: 80
  163. },
  164. {
  165. userId: this.$store.state.user.name,
  166. functionId: 102003,
  167. serialNumber: '102003Table99PrimaryContact',
  168. tableId: '102003Table99',
  169. tableName: '项目联系人表',
  170. columnProp: 'primaryContact',
  171. headerAlign: 'center',
  172. align: 'center',
  173. columnLabel: '默认联系人',
  174. columnHidden: false,
  175. columnImage: false,
  176. columnSortable: false,
  177. sortLv: 0,
  178. status: true,
  179. fixed: '',
  180. columnWidth: 40
  181. },
  182. {
  183. userId: this.$store.state.user.name,
  184. functionId: 102003,
  185. serialNumber: '102003Table99ContactStatus',
  186. tableId: '102003Table99',
  187. tableName: '项目联系人表',
  188. columnProp: 'contactStatus',
  189. headerAlign: 'center',
  190. align: 'center',
  191. columnLabel: '状态',
  192. columnHidden: false,
  193. columnImage: false,
  194. columnSortable: false,
  195. sortLv: 0,
  196. status: true,
  197. fixed: '',
  198. columnWidth: 40
  199. },
  200. {
  201. userId: this.$store.state.user.name,
  202. functionId: 102003,
  203. serialNumber: '102003Table99CreateDate',
  204. tableId: '102003Table99',
  205. tableName: '项目联系人表',
  206. columnProp: 'createDate',
  207. headerAlign: 'center',
  208. align: 'center',
  209. columnLabel: '创建时间',
  210. columnHidden: false,
  211. columnImage: false,
  212. columnSortable: false,
  213. sortLv: 0,
  214. status: true,
  215. fixed: '',
  216. columnWidth: 120
  217. },
  218. {
  219. userId: this.$store.state.user.name,
  220. functionId: 102003,
  221. serialNumber: '102003Table99CreateBy',
  222. tableId: '102003Table99',
  223. tableName: '项目联系人表',
  224. columnProp: 'createBy',
  225. headerAlign: 'center',
  226. align: 'center',
  227. columnLabel: '创建人',
  228. columnHidden: false,
  229. columnImage: false,
  230. columnSortable: false,
  231. sortLv: 0,
  232. status: true,
  233. fixed: '',
  234. columnWidth: 80
  235. },
  236. {
  237. userId: this.$store.state.user.name,
  238. functionId: 102003,
  239. serialNumber: '102003Table99UpdateDate',
  240. tableId: '102003Table99',
  241. tableName: '项目联系人表',
  242. columnProp: 'updateDate',
  243. headerAlign: 'center',
  244. align: 'center',
  245. columnLabel: '更新时间',
  246. columnHidden: false,
  247. columnImage: false,
  248. columnSortable: false,
  249. sortLv: 0,
  250. status: true,
  251. fixed: '',
  252. columnWidth: 120
  253. },
  254. {
  255. userId: this.$store.state.user.name,
  256. functionId: 102003,
  257. serialNumber: '102003Table99UpdateBy',
  258. tableId: '102003Table99',
  259. tableName: '项目联系人表',
  260. columnProp: 'updateBy',
  261. headerAlign: 'center',
  262. align: 'center',
  263. columnLabel: '更新人',
  264. columnHidden: false,
  265. columnImage: false,
  266. columnSortable: false,
  267. sortLv: 0,
  268. status: true,
  269. fixed: '',
  270. columnWidth: 80
  271. }
  272. ],
  273. }
  274. },
  275. methods:{
  276. //导出excel
  277. async createExportData2() {
  278. return this.dataList;
  279. },
  280. fields2() {
  281. let json = "{"
  282. this.columnList2.forEach((item, index) => {
  283. if (index == this.columnList2.length - 1) {
  284. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  285. } else {
  286. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  287. }
  288. })
  289. json += "}"
  290. let s = eval("(" + json + ")")
  291. return s
  292. },
  293. },
  294. }
  295. </script>
  296. <style scoped>
  297. </style>