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.

366 lines
11 KiB

2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
  4. <el-form :inline="true" label-position="top" style="margin-top: 0px">
  5. <download-excel
  6. :fields="fields()"
  7. :data="exportData"
  8. type="xls"
  9. :name="exportName"
  10. :header="exportHeader"
  11. :footer="exportFooter"
  12. :fetch="createExportData"
  13. :before-generate="startDownload"
  14. :before-finish="finishDownload"
  15. worksheet="导出信息"
  16. class="el-button el-button--primary el-button--medium">
  17. {{ '导出' }}
  18. </download-excel>
  19. </el-form>
  20. </el-form>
  21. <el-table
  22. :data="dataList"
  23. height="240"
  24. border
  25. v-loading="dataListLoading"
  26. style="width: 100%; ">
  27. <el-table-column
  28. v-for="(item,index) in columnList" :key="index"
  29. :sortable="item.columnSortable"
  30. :prop="item.columnProp"
  31. :header-align="item.headerAlign"
  32. :show-overflow-tooltip="item.showOverflowTooltip"
  33. :align="item.align"
  34. :fixed="item.fixed==''?false:item.fixed"
  35. :min-width="item.columnWidth"
  36. :label="item.columnLabel">
  37. <template slot-scope="scope">
  38. <div v-if="item.columnProp === 'testNo'">
  39. <el-link v-if="!item.columnHidden" @click="handleClick(scope.row)">{{ scope.row[item.columnProp] }}</el-link>
  40. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  41. </div>
  42. <div v-else>
  43. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  44. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  45. </div>
  46. </template>
  47. </el-table-column>
  48. </el-table>
  49. </div>
  50. </template>
  51. <script>
  52. import {
  53. quotationInformationSearch, // 测试信息列表查询
  54. } from '@/api/quotation/quotationInformation.js'
  55. import {testInformationList} from "../../../../api/test/testInformation";
  56. export default {
  57. data() {
  58. return {
  59. dataList: [],
  60. searchData: {
  61. site: '',
  62. username: this.$store.state.user.name,
  63. projectId: '',
  64. page: 1,
  65. limit: 1000
  66. },
  67. visible: false,
  68. dataListLoading: false,
  69. currentRow: '',
  70. columnList: [
  71. {
  72. userId: this.$store.state.user.name,
  73. functionId: 103001,
  74. serialNumber: '103001Table1TestNo',
  75. tableId: '103001Table1',
  76. tableName: '测试信息表',
  77. columnProp: 'testNo',
  78. headerAlign: 'center',
  79. align: 'center',
  80. columnLabel: '测试单号',
  81. columnHidden: false,
  82. columnImage: false,
  83. columnSortable: false,
  84. sortLv: 0,
  85. status: true,
  86. fixed: '',
  87. columnWidth: 120
  88. },
  89. {
  90. userId: this.$store.state.user.name,
  91. functionId: 103001,
  92. serialNumber: '103001Table1TrackerName',
  93. tableId: '103001Table1',
  94. tableName: '测试信息表',
  95. columnProp: 'trackerName',
  96. headerAlign: 'center',
  97. align: 'center',
  98. columnLabel: 'Artwork',
  99. columnHidden: false,
  100. columnImage: false,
  101. columnSortable: false,
  102. sortLv: 0,
  103. status: true,
  104. fixed: '',
  105. columnWidth: 80
  106. },
  107. {
  108. userId: this.$store.state.user.name,
  109. functionId: 103001,
  110. serialNumber: '103001Table1EngineerName',
  111. tableId: '103001Table1',
  112. tableName: '测试信息表',
  113. columnProp: 'engineerName',
  114. headerAlign: 'center',
  115. align: 'center',
  116. columnLabel: ' TP工程师',
  117. columnHidden: false,
  118. columnImage: false,
  119. columnSortable: false,
  120. sortLv: 0,
  121. status: true,
  122. fixed: '',
  123. columnWidth: 80
  124. },
  125. {
  126. userId: this.$store.state.user.name,
  127. functionId: 103001,
  128. serialNumber: '103001Table1TestPartNo',
  129. tableId: '103001Table1',
  130. tableName: '测试信息表',
  131. columnProp: 'plmPartNo',
  132. headerAlign: 'center',
  133. align: 'left',
  134. columnLabel: 'PLM物料编码',
  135. columnHidden: false,
  136. columnImage: false,
  137. columnSortable: false,
  138. sortLv: 0,
  139. status: true,
  140. fixed: '',
  141. columnWidth: 150
  142. },
  143. {
  144. userId: this.$store.state.user.name,
  145. functionId: 102001,
  146. serialNumber: '102001Table1FinalPartNo',
  147. tableId: '102001Table1',
  148. tableName: '询价信息表',
  149. columnProp: 'finalPartNo',
  150. headerAlign: 'center',
  151. align: 'left',
  152. columnLabel: 'IFS物料编码',
  153. columnHidden: false,
  154. columnImage: false,
  155. columnSortable: false,
  156. sortLv: 0,
  157. status: true,
  158. fixed: '',
  159. columnWidth: 80
  160. },
  161. {
  162. userId: this.$store.state.user.name,
  163. functionId: 103001,
  164. serialNumber: '103001Table1PartName',
  165. tableId: '103001Table1',
  166. tableName: '测试信息表',
  167. columnProp: 'partName',
  168. headerAlign: 'center',
  169. align: 'center',
  170. columnLabel: '物料名称',
  171. columnHidden: false,
  172. columnImage: false,
  173. columnSortable: false,
  174. sortLv: 0,
  175. status: true,
  176. fixed: '',
  177. columnWidth: 100
  178. },
  179. {
  180. userId: this.$store.state.user.name,
  181. functionId: 102001,
  182. serialNumber: '102001Table1CustomerPartNo',
  183. tableId: '102001Table1',
  184. tableName: '询价信息表',
  185. columnProp: 'customerPartNo',
  186. headerAlign: 'center',
  187. align: 'left',
  188. columnLabel: '客户料号',
  189. columnHidden: false,
  190. columnImage: false,
  191. columnSortable: false,
  192. sortLv: 0,
  193. status: true,
  194. fixed: '',
  195. columnWidth: 80
  196. },
  197. {
  198. userId: this.$store.state.user.name,
  199. functionId: 103001,
  200. serialNumber: '103001Table1PriorityLevel',
  201. tableId: '103001Table1',
  202. tableName: '测试信息表',
  203. columnProp: 'priorityLevel',
  204. headerAlign: 'center',
  205. align: 'center',
  206. columnLabel: '优先等级',
  207. columnHidden: false,
  208. columnImage: false,
  209. columnSortable: false,
  210. sortLv: 0,
  211. status: true,
  212. fixed: '',
  213. columnWidth: 80
  214. },
  215. {
  216. userId: this.$store.state.user.name,
  217. functionId: 103001,
  218. serialNumber: '103001Table1TestNumber',
  219. tableId: '103001Table1',
  220. tableName: '测试信息表',
  221. columnProp: 'testNumber',
  222. headerAlign: 'center',
  223. align: 'center',
  224. columnLabel: '测试数量',
  225. columnHidden: false,
  226. columnImage: false,
  227. columnSortable: false,
  228. sortLv: 0,
  229. status: true,
  230. fixed: '',
  231. columnWidth: 80
  232. },
  233. {
  234. userId: this.$store.state.user.name,
  235. functionId: 103001,
  236. serialNumber: '103001Table1RequiredDeliveryDate',
  237. tableId: '103001Table1',
  238. tableName: '测试信息表',
  239. columnProp: 'requiredDeliveryDate',
  240. headerAlign: 'center',
  241. align: 'center',
  242. columnLabel: '要求交付日期',
  243. columnHidden: false,
  244. columnImage: false,
  245. columnSortable: false,
  246. sortLv: 0,
  247. status: true,
  248. fixed: '',
  249. columnWidth: 160
  250. },
  251. {
  252. userId: this.$store.state.user.name,
  253. functionId: 103001,
  254. serialNumber: '103001Table1TestStatus',
  255. tableId: '103001Table1',
  256. tableName: '测试信息表',
  257. columnProp: 'testStatus',
  258. headerAlign: 'center',
  259. align: 'center',
  260. columnLabel: '状态',
  261. columnHidden: false,
  262. columnImage: false,
  263. columnSortable: false,
  264. sortLv: 0,
  265. status: true,
  266. fixed: '',
  267. columnWidth: 80
  268. },
  269. {
  270. userId: this.$store.state.user.name,
  271. functionId: 103001,
  272. serialNumber: '103001Table1NodeName',
  273. tableId: '103001Table1',
  274. tableName: '测试信息表',
  275. columnProp: 'nodeName',
  276. headerAlign: 'center',
  277. align: 'center',
  278. columnLabel: '节点名称',
  279. columnHidden: false,
  280. columnImage: false,
  281. columnSortable: false,
  282. sortLv: 0,
  283. status: true,
  284. fixed: '',
  285. columnWidth: 80
  286. },
  287. {
  288. userId: this.$store.state.user.name,
  289. functionId: 103001,
  290. serialNumber: '103001Table1NodeCreateBy',
  291. tableId: '103001Table1',
  292. tableName: '测试信息表',
  293. columnProp: 'nodeCreateBy',
  294. headerAlign: 'center',
  295. align: 'center',
  296. columnLabel: '节点审批人',
  297. columnHidden: false,
  298. columnImage: false,
  299. columnSortable: false,
  300. sortLv: 0,
  301. status: true,
  302. fixed: '',
  303. columnWidth: 80
  304. },
  305. ],
  306. // 导出 start
  307. exportData: [],
  308. exportName: '项目测试' + this.dayjs().format('YYYYMMDDHHmmss'),
  309. exportHeader: ["项目测试"],
  310. exportFooter: [],
  311. // 导出 end
  312. }
  313. },
  314. methods: {
  315. //初始化组件的参数
  316. init(inData) {
  317. //初始化参数
  318. this.searchData = JSON.parse(JSON.stringify(inData));
  319. //刷新表格
  320. this.searchTable();
  321. },
  322. searchTable() {
  323. testInformationList(this.searchData).then(({data}) => {
  324. //区分请求成功和失败的状况
  325. if (data && data.code === 0) {
  326. this.dataList = data.rows
  327. } else {
  328. this.dataList = [];
  329. }
  330. });
  331. },
  332. createExportData() {
  333. return this.dataList;
  334. },
  335. startDownload() {
  336. },
  337. finishDownload() {
  338. },
  339. fields() {
  340. let json = "{"
  341. this.columnList.forEach((item, index) => {
  342. if (index == this.columnList.length - 1) {
  343. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  344. } else {
  345. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  346. }
  347. })
  348. json += "}"
  349. let s = eval("(" + json + ")")
  350. return s
  351. },
  352. handleClick(row){
  353. if (this.$router.resolve(`/test-requestForTest`).resolved.name === '404'){
  354. this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',});
  355. }else {
  356. this.$router.push({name:`test-requestForTest`,params:{testNo:row.testNo},})
  357. }
  358. }
  359. },
  360. }
  361. </script>
  362. <style scoped>
  363. </style>