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.

400 lines
12 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years 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. <!-- <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. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  40. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  41. style="width: 100px; height: 80px"/></span>
  42. </template>
  43. </el-table-column>
  44. <!-- <el-table-column-->
  45. <!-- header-align="center"-->
  46. <!-- align="center"-->
  47. <!-- width="150"-->
  48. <!-- fixed="right"-->
  49. <!-- label="操作">-->
  50. <!-- <template slot-scope="scope">-->
  51. <!-- <a type="text" size="small" @click="updateModel(scope.row)">修改</a>-->
  52. <!-- <a type="text" size="small" @click="deleteData(scope.row)">删除</a>-->
  53. <!-- </template>-->
  54. <!-- </el-table-column>-->
  55. </el-table>
  56. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  57. </div>
  58. </template>
  59. <script>
  60. import {
  61. quotationInformationSearch, // 打样信息列表查询
  62. } from '@/api/quotation/quotationInformation.js'
  63. import Chooselist from '@/views/modules/common/Chooselist'
  64. export default {
  65. components: {
  66. Chooselist
  67. },
  68. data() {
  69. return {
  70. dataList: [],
  71. searchData: {
  72. site: '',
  73. username: this.$store.state.user.name,
  74. projectId: '',
  75. page: 1,
  76. limit: 1000
  77. },
  78. visible:false,
  79. dataListLoading: false,
  80. currentRow:'',
  81. columnList: [
  82. {
  83. userId: this.$store.state.user.name,
  84. functionId: 101002001,
  85. serialNumber: '101002001Table6SampleNo',
  86. tableId: '101002001Table6',
  87. tableName: '打样信息表',
  88. columnProp: 'sampleNo',
  89. headerAlign: 'center',
  90. align: 'center',
  91. columnLabel: '申请单号',
  92. columnHidden: false,
  93. columnImage: false,
  94. columnSortable: false,
  95. sortLv: 0,
  96. status: true,
  97. fixed: '',
  98. columnWidth: 120
  99. },
  100. {
  101. userId: this.$store.state.user.name,
  102. functionId: 101002001,
  103. serialNumber: '101002001Table6CustomerNo',
  104. tableId: '101002001Table6',
  105. tableName: '打样信息表',
  106. columnProp: 'customerNo',
  107. headerAlign: 'center',
  108. align: 'center',
  109. columnLabel: '客户编码',
  110. columnHidden: false,
  111. columnImage: false,
  112. columnSortable: false,
  113. sortLv: 0,
  114. status: true,
  115. fixed: '',
  116. columnWidth: 100
  117. },
  118. {
  119. userId: this.$store.state.user.name,
  120. functionId: 101002001,
  121. serialNumber: '101002001Table6CustomerDesc',
  122. tableId: '101002001Table6',
  123. tableName: '打样信息表',
  124. columnProp: 'customerDesc',
  125. headerAlign: 'center',
  126. align: 'center',
  127. columnLabel: '客户名称',
  128. columnHidden: false,
  129. columnImage: false,
  130. columnSortable: false,
  131. sortLv: 0,
  132. status: true,
  133. fixed: '',
  134. columnWidth: 120
  135. },
  136. {
  137. userId: this.$store.state.user.name,
  138. functionId: 101002001,
  139. serialNumber: '101002001Table6TrackerName',
  140. tableId: '101002001Table6',
  141. tableName: '打样信息表',
  142. columnProp: 'trackerName',
  143. headerAlign: 'center',
  144. align: 'center',
  145. columnLabel: '跟单员',
  146. columnHidden: false,
  147. columnImage: false,
  148. columnSortable: false,
  149. sortLv: 0,
  150. status: true,
  151. fixed: '',
  152. columnWidth: 80
  153. },
  154. {
  155. userId: this.$store.state.user.name,
  156. functionId: 101002001,
  157. serialNumber: '101002001Table6QuoterName',
  158. tableId: '101002001Table6',
  159. tableName: '打样信息表',
  160. columnProp: 'quoterName',
  161. headerAlign: 'center',
  162. align: 'center',
  163. columnLabel: '打样专员',
  164. columnHidden: false,
  165. columnImage: false,
  166. columnSortable: false,
  167. sortLv: 0,
  168. status: true,
  169. fixed: '',
  170. columnWidth: 80
  171. },
  172. {
  173. userId: this.$store.state.user.name,
  174. functionId: 101002001,
  175. serialNumber: '101002001Table6TestPartNo',
  176. tableId: '101002001Table6',
  177. tableName: '打样信息表',
  178. columnProp: 'testPartNo',
  179. headerAlign: 'center',
  180. align: 'center',
  181. columnLabel: '产品编码',
  182. columnHidden: false,
  183. columnImage: false,
  184. columnSortable: false,
  185. sortLv: 0,
  186. status: true,
  187. fixed: '',
  188. columnWidth: 100
  189. },
  190. {
  191. userId: this.$store.state.user.name,
  192. functionId: 101002001,
  193. serialNumber: '101002001Table6PriorityLevel',
  194. tableId: '101002001Table6',
  195. tableName: '打样信息表',
  196. columnProp: 'priorityLevel',
  197. headerAlign: 'center',
  198. align: 'center',
  199. columnLabel: '优先等级',
  200. columnHidden: false,
  201. columnImage: false,
  202. columnSortable: false,
  203. sortLv: 0,
  204. status: true,
  205. fixed: '',
  206. columnWidth: 80
  207. },
  208. {
  209. userId: this.$store.state.user.name,
  210. functionId: 101002001,
  211. serialNumber: '101002001Table6RequiredCompletionDate',
  212. tableId: '101002001Table6',
  213. tableName: '打样信息表',
  214. columnProp: 'requiredCompletionDate',
  215. headerAlign: 'center',
  216. align: 'center',
  217. columnLabel: '要求完成日期',
  218. columnHidden: false,
  219. columnImage: false,
  220. columnSortable: false,
  221. sortLv: 0,
  222. status: true,
  223. fixed: '',
  224. columnWidth: 160
  225. },
  226. {
  227. userId: this.$store.state.user.name,
  228. functionId: 101002001,
  229. serialNumber: '101002001Table6sampleStatus',
  230. tableId: '101002001Table6',
  231. tableName: '打样信息表',
  232. columnProp: 'sampleStatus',
  233. headerAlign: 'center',
  234. align: 'center',
  235. columnLabel: '状态',
  236. columnHidden: false,
  237. columnImage: false,
  238. columnSortable: false,
  239. sortLv: 0,
  240. status: true,
  241. fixed: '',
  242. columnWidth: 80
  243. },
  244. {
  245. userId: this.$store.state.user.name,
  246. functionId: 101002001,
  247. serialNumber: '101002001Table6CreateDate',
  248. tableId: '101002001Table6',
  249. tableName: '打样信息表',
  250. columnProp: 'createDate',
  251. headerAlign: 'center',
  252. align: 'center',
  253. columnLabel: '创建时间',
  254. columnHidden: false,
  255. columnImage: false,
  256. columnSortable: false,
  257. sortLv: 0,
  258. status: true,
  259. fixed: '',
  260. columnWidth: 160
  261. },
  262. {
  263. userId: this.$store.state.user.name,
  264. functionId: 101002001,
  265. serialNumber: '101002001Table6CreateBy',
  266. tableId: '101002001Table6',
  267. tableName: '打样信息表',
  268. columnProp: 'createBy',
  269. headerAlign: 'center',
  270. align: 'center',
  271. columnLabel: '创建人',
  272. columnHidden: false,
  273. columnImage: false,
  274. columnSortable: false,
  275. sortLv: 0,
  276. status: true,
  277. fixed: '',
  278. columnWidth: 80
  279. },
  280. {
  281. userId: this.$store.state.user.name,
  282. functionId: 101002001,
  283. serialNumber: '101002001Table6UpdateDate',
  284. tableId: '101002001Table6',
  285. tableName: '打样信息表',
  286. columnProp: 'updateDate',
  287. headerAlign: 'center',
  288. align: 'center',
  289. columnLabel: '更新时间',
  290. columnHidden: false,
  291. columnImage: false,
  292. columnSortable: false,
  293. sortLv: 0,
  294. status: true,
  295. fixed: '',
  296. columnWidth: 160
  297. },
  298. {
  299. userId: this.$store.state.user.name,
  300. functionId: 101002001,
  301. serialNumber: '101002001Table6UpdateBy',
  302. tableId: '101002001Table6',
  303. tableName: '打样信息表',
  304. columnProp: 'updateBy',
  305. headerAlign: 'center',
  306. align: 'center',
  307. columnLabel: '更新人',
  308. columnHidden: false,
  309. columnImage: false,
  310. columnSortable: false,
  311. sortLv: 0,
  312. status: true,
  313. fixed: '',
  314. columnWidth: 80
  315. }
  316. ],
  317. // 导出 start
  318. exportData: [],
  319. exportName: '项目打样'+this.dayjs().format('YYYYMMDDHHmmss'),
  320. exportHeader: ["项目打样"],
  321. exportFooter: [],
  322. // 导出 end
  323. }
  324. },
  325. methods: {
  326. // 获取基础数据列表S
  327. getBaseList (val, type) {
  328. this.tagNo = val
  329. this.tagNo1 = type
  330. this.$nextTick(() => {
  331. let strVal = ''
  332. // if (val === 1013) {
  333. // if(type==1) {
  334. // strVal = this.dataForm.partType
  335. // }
  336. // }
  337. this.$refs.baseList.init(val, strVal)
  338. })
  339. },
  340. /* 列表方法的回调 */
  341. getBaseData (val) {
  342. // if (this.tagNo === 1013) {
  343. // if(this.tagNo1==1) {
  344. // this.dataForm.partType = val.Base_id
  345. // this.dataForm.partTypeDesc = val.Base_desc
  346. // }
  347. // }
  348. },
  349. //初始化组件的参数
  350. init(inData) {
  351. //初始化参数
  352. this.searchData = JSON.parse(JSON.stringify(inData));
  353. //刷新表格
  354. // this.searchTable();
  355. },
  356. searchTable(){
  357. quotationInformationSearch(this.searchData).then(({data}) => {
  358. //区分请求成功和失败的状况
  359. if (data && data.code == 0) {
  360. this.dataList = data.page.list
  361. } else {
  362. this.dataList = [];
  363. }
  364. });
  365. },
  366. createExportData() {
  367. return this.dataList;
  368. },
  369. startDownload() {
  370. // this.exportData = this.dataList
  371. },
  372. finishDownload() {
  373. },
  374. fields() {
  375. let json = "{"
  376. this.columnList.forEach((item, index) => {
  377. if (index == this.columnList.length - 1) {
  378. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  379. } else {
  380. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  381. }
  382. })
  383. json += "}"
  384. let s = eval("(" + json + ")")
  385. return s
  386. },
  387. },
  388. }
  389. </script>
  390. <style scoped>
  391. </style>