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.

437 lines
14 KiB

3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 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. <!-- <el-button type="primary" @click="addModal()">新增</el-button>-->
  6. <download-excel
  7. :fields="fields()"
  8. :data="exportData"
  9. type="xls"
  10. :name="exportName"
  11. :header="exportHeader"
  12. :footer="exportFooter"
  13. :fetch="createExportData"
  14. :before-generate="startDownload"
  15. :before-finish="finishDownload"
  16. worksheet="导出信息"
  17. class="el-button el-button--primary el-button--medium">
  18. {{ '导出' }}
  19. </download-excel>
  20. </el-form>
  21. </el-form>
  22. <el-table
  23. :data="dataList"
  24. height="240"
  25. border
  26. v-loading="dataListLoading"
  27. style="width: 100%; ">
  28. <el-table-column
  29. v-for="(item,index) in columnList" :key="index"
  30. :sortable="item.columnSortable"
  31. :prop="item.columnProp"
  32. :header-align="item.headerAlign"
  33. :show-overflow-tooltip="item.showOverflowTooltip"
  34. :align="item.align"
  35. :fixed="item.fixed==''?false:item.fixed"
  36. :min-width="item.columnWidth"
  37. :label="item.columnLabel">
  38. <template slot-scope="scope">
  39. <div v-if="item.columnProp === 'codeNo'">
  40. <el-link style="cursor:pointer;" v-if="!item.columnHidden" @click="handleClick(scope.row)"> {{ scope.row[item.columnProp] }}</el-link>
  41. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  42. </div>
  43. <div v-else>
  44. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  45. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  46. </div>
  47. </template>
  48. </el-table-column>
  49. <!-- <el-table-column-->
  50. <!-- header-align="center"-->
  51. <!-- align="center"-->
  52. <!-- width="150"-->
  53. <!-- fixed="right"-->
  54. <!-- label="操作">-->
  55. <!-- <template slot-scope="scope">-->
  56. <!-- <a type="text" size="small" @click="updateModel(scope.row)">修改</a>-->
  57. <!-- <a type="text" size="small" @click="deleteData(scope.row)">删除</a>-->
  58. <!-- </template>-->
  59. <!-- </el-table-column>-->
  60. </el-table>
  61. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  62. </div>
  63. </template>
  64. <script>
  65. import {
  66. technicalSpecificationListSearch, // 测试信息列表查询
  67. } from "@/api/sampleManagement/technicalSpecificationList.js"
  68. import Chooselist from '@/views/modules/common/Chooselist'
  69. export default {
  70. components: {
  71. Chooselist
  72. },
  73. data() {
  74. return {
  75. dataList: [],
  76. searchData: {
  77. site: '',
  78. username: this.$store.state.user.name,
  79. projectId: '',
  80. page: 1,
  81. limit: 1000
  82. },
  83. visible:false,
  84. dataListLoading: false,
  85. currentRow:'',
  86. columnList:[
  87. {
  88. userId: this.$store.state.user.name,
  89. functionId: 101002001,
  90. serialNumber: '101002001Table9CodeNo',
  91. tableId: "101002001Table9",
  92. tableName: "技术参数卡列表",
  93. columnProp: "codeNo",
  94. headerAlign: "center",
  95. align: "left",
  96. columnLabel: "参数卡编码",
  97. columnHidden: false,
  98. columnImage: false,
  99. columnSortable: false,
  100. sortLv: 0,
  101. status: true,
  102. fixed: '',
  103. columnWidth: 80
  104. },{
  105. userId: this.$store.state.user.name,
  106. functionId: 101002001,
  107. serialNumber: '101002001Table9Status',
  108. tableId: "101002001Table9",
  109. tableName: "技术参数卡列表",
  110. columnProp: "statusDesc",
  111. headerAlign: "center",
  112. align: "left",
  113. columnLabel: "状态",
  114. columnHidden: false,
  115. columnImage: false,
  116. columnSortable: false,
  117. sortLv: 0,
  118. status: true,
  119. fixed: '',
  120. columnWidth: 50
  121. },{
  122. userId: this.$store.state.user.name,
  123. functionId: 101002001,
  124. serialNumber: '101002001Table9TestPartNo',
  125. tableId: "101002001Table9",
  126. tableName: "技术参数卡列表",
  127. columnProp: "testPartNo",
  128. headerAlign: "center",
  129. align: "left",
  130. columnLabel: "项目料号",
  131. columnHidden: false,
  132. columnImage: false,
  133. columnSortable: false,
  134. sortLv: 0,
  135. status: true,
  136. fixed: '',
  137. columnWidth: 80
  138. },{
  139. userId: this.$store.state.user.name,
  140. functionId: 101002001,
  141. serialNumber: '101002001Table9PartName',
  142. tableId: "101002001Table9",
  143. tableName: "技术参数卡列表",
  144. columnProp: "partDesc",
  145. headerAlign: "center",
  146. align: "left",
  147. columnLabel: "物料名称",
  148. columnHidden: false,
  149. columnImage: false,
  150. columnSortable: false,
  151. sortLv: 0,
  152. status: true,
  153. fixed: '',
  154. columnWidth: 120
  155. },
  156. {
  157. userId: this.$store.state.user.name,
  158. functionId: 102001,
  159. serialNumber: '102001Table1FinalPartNo',
  160. tableId: '102001Table1',
  161. tableName: '询价信息表',
  162. columnProp: 'finalPartNo',
  163. headerAlign: 'center',
  164. align: 'left',
  165. columnLabel: 'IFS料号',
  166. columnHidden: false,
  167. columnImage: false,
  168. columnSortable: false,
  169. sortLv: 0,
  170. status: true,
  171. fixed: '',
  172. columnWidth: 80
  173. },
  174. {
  175. userId: this.$store.state.user.name,
  176. functionId: 102001,
  177. serialNumber: '102001Table1CustomerPartNo',
  178. tableId: '102001Table1',
  179. tableName: '询价信息表',
  180. columnProp: 'customerPartNo',
  181. headerAlign: 'center',
  182. align: 'left',
  183. columnLabel: '客户料号',
  184. columnHidden: false,
  185. columnImage: false,
  186. columnSortable: false,
  187. sortLv: 0,
  188. status: true,
  189. fixed: '',
  190. columnWidth: 80
  191. },
  192. {
  193. userId: this.$store.state.user.name,
  194. functionId: 101002001,
  195. serialNumber: '101002001Table9RevNo',
  196. tableId: "101002001Table9",
  197. tableName: "技术参数卡列表",
  198. columnProp: "revNo",
  199. headerAlign: "center",
  200. align: "left",
  201. columnLabel: "版本号",
  202. columnHidden: false,
  203. columnImage: false,
  204. columnSortable: false,
  205. sortLv: 0,
  206. status: true,
  207. fixed: '',
  208. columnWidth: 50
  209. },{
  210. userId: this.$store.state.user.name,
  211. functionId: 101002001,
  212. serialNumber: '101002001Table9ECNFlag',
  213. tableId: "101002001Table9",
  214. tableName: "技术参数卡列表",
  215. columnProp: "ecnFlag",
  216. headerAlign: "center",
  217. align: "left",
  218. columnLabel: "ECN变更",
  219. columnHidden: false,
  220. columnImage: false,
  221. columnSortable: false,
  222. sortLv: 0,
  223. status: true,
  224. fixed: '',
  225. columnWidth: 50
  226. },{
  227. userId: this.$store.state.user.name,
  228. functionId: 101002001,
  229. serialNumber: '101002001Table9EcnNo',
  230. tableId: "101002001Table9",
  231. tableName: "技术参数卡列表",
  232. columnProp: "ecnNo",
  233. headerAlign: "center",
  234. align: "left",
  235. columnLabel: "ECN单据号",
  236. columnHidden: false,
  237. columnImage: false,
  238. columnSortable: false,
  239. sortLv: 0,
  240. status: true,
  241. fixed: '',
  242. columnWidth: 80
  243. },{
  244. userId: this.$store.state.user.name,
  245. functionId: 101002001,
  246. serialNumber: '101002001Table9ProofingNo',
  247. tableId: "101002001Table9",
  248. tableName: "技术参数卡列表",
  249. columnProp: "proofingNo",
  250. headerAlign: "center",
  251. align: "left",
  252. columnLabel: "打样申请单号",
  253. columnHidden: false,
  254. columnImage: false,
  255. columnSortable: false,
  256. sortLv: 0,
  257. status: true,
  258. fixed: '',
  259. columnWidth: 80
  260. },{
  261. userId: this.$store.state.user.name,
  262. functionId: 101002001,
  263. serialNumber: '101002001Table9CreateDate',
  264. tableId: "101002001Table9",
  265. tableName: "技术参数卡列表",
  266. columnProp: "createDate",
  267. headerAlign: "center",
  268. align: "left",
  269. columnLabel: "创建时间",
  270. columnHidden: false,
  271. columnImage: false,
  272. columnSortable: false,
  273. sortLv: 0,
  274. status: true,
  275. fixed: '',
  276. columnWidth: 120
  277. },{
  278. userId: this.$store.state.user.name,
  279. functionId: 101002001,
  280. serialNumber: '101002001Table9CreateBy',
  281. tableId: "101002001Table9",
  282. tableName: "技术参数卡列表",
  283. columnProp: "createBy",
  284. headerAlign: "center",
  285. align: "left",
  286. columnLabel: "创建人",
  287. columnHidden: false,
  288. columnImage: false,
  289. columnSortable: false,
  290. sortLv: 0,
  291. status: true,
  292. fixed: '',
  293. columnWidth: 80
  294. },{
  295. userId: this.$store.state.user.name,
  296. functionId: 101002001,
  297. serialNumber: '101002001Table9UpdateDate',
  298. tableId: "101002001Table9",
  299. tableName: "技术参数卡列表",
  300. columnProp: "updateDate",
  301. headerAlign: "center",
  302. align: "left",
  303. columnLabel: "上次修改日期",
  304. columnHidden: false,
  305. columnImage: false,
  306. columnSortable: false,
  307. sortLv: 0,
  308. status: true,
  309. fixed: '',
  310. columnWidth: 120
  311. },{
  312. userId: this.$store.state.user.name,
  313. functionId: 101002001,
  314. serialNumber: '101002001Table9UpdateBy',
  315. tableId: "101002001Table9",
  316. tableName: "技术参数卡列表",
  317. columnProp: "updateBy",
  318. headerAlign: "center",
  319. align: "left",
  320. columnLabel: "修改人",
  321. columnHidden: false,
  322. columnImage: false,
  323. columnSortable: false,
  324. sortLv: 0,
  325. status: true,
  326. fixed: '',
  327. columnWidth: 80
  328. },{
  329. userId: this.$store.state.user.name,
  330. functionId: 101002001,
  331. serialNumber: '101002001Table9ecnAddress',
  332. tableId: "101002001Table9",
  333. tableName: "技术参数卡列表",
  334. columnProp: "ecnAddress",
  335. headerAlign: "center",
  336. align: "left",
  337. columnLabel: "ECN文档链接",
  338. columnHidden: false,
  339. columnImage: false,
  340. columnSortable: false,
  341. sortLv: 0,
  342. status: true,
  343. fixed: '',
  344. columnWidth: 200
  345. },
  346. ],
  347. // 导出 start
  348. exportData: [],
  349. exportName: '技术参数卡'+this.dayjs().format('YYYYMMDDHHmmss'),
  350. exportHeader: ["技术参数卡"],
  351. exportFooter: [],
  352. // 导出 end
  353. }
  354. },
  355. methods: {
  356. // 获取基础数据列表S
  357. getBaseList (val, type) {
  358. this.tagNo = val
  359. this.tagNo1 = type
  360. this.$nextTick(() => {
  361. let strVal = ''
  362. // if (val === 1013) {
  363. // if(type==1) {
  364. // strVal = this.dataForm.partType
  365. // }
  366. // }
  367. this.$refs.baseList.init(val, strVal)
  368. })
  369. },
  370. /* 列表方法的回调 */
  371. getBaseData (val) {
  372. // if (this.tagNo === 1013) {
  373. // if(this.tagNo1==1) {
  374. // this.dataForm.partType = val.Base_id
  375. // this.dataForm.partTypeDesc = val.Base_desc
  376. // }
  377. // }
  378. },
  379. //初始化组件的参数
  380. init(inData) {
  381. //初始化参数
  382. this.searchData = JSON.parse(JSON.stringify(inData));
  383. //刷新表格
  384. this.searchTable();
  385. },
  386. searchTable(){
  387. technicalSpecificationListSearch(this.searchData).then(({data}) => {
  388. //区分请求成功和失败的状况
  389. if (data && data.code == 0) {
  390. this.dataList = data.page.list
  391. } else {
  392. this.dataList = [];
  393. }
  394. });
  395. },
  396. createExportData() {
  397. return this.dataList;
  398. },
  399. startDownload() {
  400. // this.exportData = this.dataList
  401. },
  402. finishDownload() {
  403. },
  404. fields() {
  405. let json = "{"
  406. this.columnList.forEach((item, index) => {
  407. if (index == this.columnList.length - 1) {
  408. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  409. } else {
  410. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  411. }
  412. })
  413. json += "}"
  414. let s = eval("(" + json + ")")
  415. return s
  416. },
  417. handleClick(row){
  418. if (this.$router.resolve(`/sampleManagement-technicalSpecificationList`).resolved.name === '404'){
  419. this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',});
  420. }else {
  421. this.$router.push({name:`sampleManagement-technicalSpecificationList`,params:{codeNo:row.codeNo?row.codeNo:' '},})
  422. }
  423. }
  424. },
  425. }
  426. </script>
  427. <style scoped>
  428. </style>