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.

395 lines
12 KiB

3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
1 year ago
3 years ago
3 years ago
3 years ago
3 years ago
1 year ago
3 years ago
3 years ago
3 years ago
1 year ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
1 year ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 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 === 'proofingNo'">
  40. <el-link 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. quotationInformationSearch, // 打样信息列表查询
  67. } from '@/api/quotation/quotationInformation.js'
  68. import Chooselist from '@/views/modules/common/Chooselist'
  69. import {proofingInformationSearch} from "../../../../api/proofing/proofingInformation";
  70. export default {
  71. components: {
  72. Chooselist
  73. },
  74. data() {
  75. return {
  76. dataList: [],
  77. searchData: {
  78. site: '',
  79. username: this.$store.state.user.name,
  80. projectId: '',
  81. page: 1,
  82. limit: 1000
  83. },
  84. visible:false,
  85. dataListLoading: false,
  86. currentRow:'',
  87. columnList: [
  88. {
  89. userId: this.$store.state.user.name,
  90. functionId: 103001,
  91. serialNumber: '103001Table1ProofingNo',
  92. tableId: '103001Table1',
  93. tableName: '打样信息表',
  94. columnProp: 'proofingNo',
  95. headerAlign: 'center',
  96. align: 'center',
  97. columnLabel: '打样单号',
  98. columnHidden: false,
  99. columnImage: false,
  100. columnSortable: false,
  101. sortLv: 0,
  102. status: true,
  103. fixed: '',
  104. columnWidth: 120
  105. },
  106. {
  107. userId: this.$store.state.user.name,
  108. functionId: 103001,
  109. serialNumber: '103001Table1TrackerName',
  110. tableId: '103001Table1',
  111. tableName: '打样信息表',
  112. columnProp: 'trackerName',
  113. headerAlign: 'center',
  114. align: 'center',
  115. columnLabel: 'CS',
  116. columnHidden: false,
  117. columnImage: false,
  118. columnSortable: false,
  119. sortLv: 0,
  120. status: true,
  121. fixed: '',
  122. columnWidth: 80
  123. },
  124. {
  125. userId: this.$store.state.user.name,
  126. functionId: 103001,
  127. serialNumber: '103001Table1EngineerName',
  128. tableId: '103001Table1',
  129. tableName: '打样信息表',
  130. columnProp: 'engineerName',
  131. headerAlign: 'center',
  132. align: 'center',
  133. columnLabel: 'NPI工程师',
  134. columnHidden: false,
  135. columnImage: false,
  136. columnSortable: false,
  137. sortLv: 0,
  138. status: true,
  139. fixed: '',
  140. columnWidth: 80
  141. },
  142. {
  143. userId: this.$store.state.user.name,
  144. functionId: 103001,
  145. serialNumber: '103001Table1ApproverName',
  146. tableId: '103001Table1',
  147. tableName: '打样信息表',
  148. columnProp: 'approverName',
  149. headerAlign: 'center',
  150. align: 'center',
  151. columnLabel: 'Approver',
  152. columnHidden: false,
  153. columnImage: false,
  154. columnSortable: false,
  155. sortLv: 0,
  156. status: true,
  157. fixed: '',
  158. columnWidth: 80
  159. },
  160. {
  161. userId: this.$store.state.user.name,
  162. functionId: 103001,
  163. serialNumber: '103001Table1TestPartNo',
  164. tableId: '103001Table1',
  165. tableName: '打样信息表',
  166. columnProp: 'testPartNo',
  167. headerAlign: 'center',
  168. align: 'center',
  169. columnLabel: '物料编码',
  170. columnHidden: false,
  171. columnImage: false,
  172. columnSortable: false,
  173. sortLv: 0,
  174. status: true,
  175. fixed: '',
  176. columnWidth: 150
  177. },
  178. {
  179. userId: this.$store.state.user.name,
  180. functionId: 103001,
  181. serialNumber: '103001Table1PartName',
  182. tableId: '103001Table1',
  183. tableName: '打样信息表',
  184. columnProp: 'partName',
  185. headerAlign: 'center',
  186. align: 'center',
  187. columnLabel: '物料名称',
  188. columnHidden: false,
  189. columnImage: false,
  190. columnSortable: false,
  191. sortLv: 0,
  192. status: true,
  193. fixed: '',
  194. columnWidth: 100
  195. },
  196. {
  197. userId: this.$store.state.user.name,
  198. functionId: 102001,
  199. serialNumber: '102001Table1FinalPartNo',
  200. tableId: '102001Table1',
  201. tableName: '询价信息表',
  202. columnProp: 'finalPartNo',
  203. headerAlign: 'center',
  204. align: 'left',
  205. columnLabel: 'IFS料号',
  206. columnHidden: false,
  207. columnImage: false,
  208. columnSortable: false,
  209. sortLv: 0,
  210. status: true,
  211. fixed: '',
  212. columnWidth: 80
  213. },
  214. {
  215. userId: this.$store.state.user.name,
  216. functionId: 102001,
  217. serialNumber: '102001Table1CustomerPartNo',
  218. tableId: '102001Table1',
  219. tableName: '询价信息表',
  220. columnProp: 'customerPartNo',
  221. headerAlign: 'center',
  222. align: 'left',
  223. columnLabel: '客户料号',
  224. columnHidden: false,
  225. columnImage: false,
  226. columnSortable: false,
  227. sortLv: 0,
  228. status: true,
  229. fixed: '',
  230. columnWidth: 80
  231. },
  232. {
  233. userId: this.$store.state.user.name,
  234. functionId: 103001,
  235. serialNumber: '103001Table1PriorityLevel',
  236. tableId: '103001Table1',
  237. tableName: '打样信息表',
  238. columnProp: 'priorityLevel',
  239. headerAlign: 'center',
  240. align: 'center',
  241. columnLabel: '优先等级',
  242. columnHidden: false,
  243. columnImage: false,
  244. columnSortable: false,
  245. sortLv: 0,
  246. status: true,
  247. fixed: '',
  248. columnWidth: 80
  249. },
  250. {
  251. userId: this.$store.state.user.name,
  252. functionId: 103001,
  253. serialNumber: '103001Table1ProofingNumber',
  254. tableId: '103001Table1',
  255. tableName: '打样信息表',
  256. columnProp: 'proofingNumber',
  257. headerAlign: 'center',
  258. align: 'center',
  259. columnLabel: '打样数量',
  260. columnHidden: false,
  261. columnImage: false,
  262. columnSortable: false,
  263. sortLv: 0,
  264. status: true,
  265. fixed: '',
  266. columnWidth: 80
  267. },
  268. {
  269. userId: this.$store.state.user.name,
  270. functionId: 103001,
  271. serialNumber: '103001Table1RequiredDeliveryDate',
  272. tableId: '103001Table1',
  273. tableName: '打样信息表',
  274. columnProp: 'requiredDeliveryDate',
  275. headerAlign: 'center',
  276. align: 'center',
  277. columnLabel: '要求交付日期',
  278. columnHidden: false,
  279. columnImage: false,
  280. columnSortable: false,
  281. sortLv: 0,
  282. status: true,
  283. fixed: '',
  284. columnWidth: 160
  285. },
  286. {
  287. userId: this.$store.state.user.name,
  288. functionId: 103001,
  289. serialNumber: '103001Table1ProofingStatus',
  290. tableId: '103001Table1',
  291. tableName: '打样信息表',
  292. columnProp: 'proofingStatus',
  293. headerAlign: 'center',
  294. align: 'center',
  295. columnLabel: '状态',
  296. columnHidden: false,
  297. columnImage: false,
  298. columnSortable: false,
  299. sortLv: 0,
  300. status: true,
  301. fixed: '',
  302. columnWidth: 80
  303. },
  304. ],
  305. // 导出 start
  306. exportData: [],
  307. exportName: '项目打样'+this.dayjs().format('YYYYMMDDHHmmss'),
  308. exportHeader: ["项目打样"],
  309. exportFooter: [],
  310. // 导出 end
  311. }
  312. },
  313. methods: {
  314. // 获取基础数据列表S
  315. getBaseList (val, type) {
  316. this.tagNo = val
  317. this.tagNo1 = type
  318. this.$nextTick(() => {
  319. let strVal = ''
  320. // if (val === 1013) {
  321. // if(type==1) {
  322. // strVal = this.dataForm.partType
  323. // }
  324. // }
  325. this.$refs.baseList.init(val, strVal)
  326. })
  327. },
  328. /* 列表方法的回调 */
  329. getBaseData (val) {
  330. // if (this.tagNo === 1013) {
  331. // if(this.tagNo1==1) {
  332. // this.dataForm.partType = val.Base_id
  333. // this.dataForm.partTypeDesc = val.Base_desc
  334. // }
  335. // }
  336. },
  337. //初始化组件的参数
  338. init(inData) {
  339. //初始化参数
  340. this.searchData = JSON.parse(JSON.stringify(inData));
  341. //刷新表格
  342. this.searchTable();
  343. },
  344. searchTable(){
  345. proofingInformationSearch(this.searchData).then(({data}) => {
  346. //区分请求成功和失败的状况
  347. if (data && data.code == 0) {
  348. this.dataList = data.page.list
  349. } else {
  350. this.dataList = [];
  351. }
  352. });
  353. },
  354. createExportData() {
  355. return this.dataList;
  356. },
  357. startDownload() {
  358. // this.exportData = this.dataList
  359. },
  360. finishDownload() {
  361. },
  362. fields() {
  363. let json = "{"
  364. this.columnList.forEach((item, index) => {
  365. if (index == this.columnList.length - 1) {
  366. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  367. } else {
  368. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  369. }
  370. })
  371. json += "}"
  372. let s = eval("(" + json + ")")
  373. return s
  374. },
  375. handleClick(row){
  376. if (this.$router.resolve(`/proofing-requestForProofing`).resolved.name === '404'){
  377. this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',});
  378. }else {
  379. this.$router.push({name:`proofing-requestForProofing`,params:{proofingNo:row.proofingNo},})
  380. }
  381. }
  382. },
  383. }
  384. </script>
  385. <style scoped>
  386. </style>