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.

640 lines
22 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
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  4. <el-form-item :label="'项目编号'">
  5. <el-input v-model="searchData.projectId" style="width: 160px"></el-input>
  6. </el-form-item>
  7. <el-form-item label="物料编码">
  8. <el-input v-model="searchData.testPartNo" style="width: 160px"></el-input>
  9. </el-form-item>
  10. <el-form-item label=" ">
  11. <el-button @click="search()" type="primary" style="margin-left: 2px;margin-top:0px">查询</el-button>
  12. <download-excel
  13. :fields="fields()"
  14. :data="exportData"
  15. type="xls"
  16. :name="exportName"
  17. :header="exportHeader"
  18. :footer="exportFooter"
  19. :fetch="createExportData"
  20. :before-generate="startDownload"
  21. :before-finish="finishDownload"
  22. worksheet="导出信息"
  23. class="el-button el-button--primary el-button--medium">
  24. {{ '导出' }}
  25. </download-excel>
  26. </el-form-item>
  27. </el-form>
  28. <el-table
  29. :height="height"
  30. :data="dataList1"
  31. border
  32. ref="mainTable"
  33. @row-click="changeData"
  34. highlight-current-row
  35. v-loading="dataListLoading"
  36. style="width: 100%;">
  37. <el-table-column
  38. v-for="(item,index) in columnList1" :key="index"
  39. :sortable="item.columnSortable"
  40. :prop="item.columnProp"
  41. :header-align="item.headerAlign"
  42. :show-overflow-tooltip="item.showOverflowTooltip"
  43. :align="item.align"
  44. :fixed="item.fixed==''?false:item.fixed"
  45. :min-width="item.columnWidth"
  46. :label="item.columnLabel">
  47. <template slot-scope="scope">
  48. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  49. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  50. style="width: 100px; height: 80px"/></span>
  51. </template>
  52. </el-table-column>
  53. </el-table>
  54. <el-pagination
  55. @size-change="sizeChangeHandle"
  56. @current-change="currentChangeHandle"
  57. :current-page="pageIndex"
  58. :page-sizes="[20, 50, 100, 1000]"
  59. :page-size="pageSize"
  60. :total="totalPage"
  61. layout="total, sizes, prev, pager, next, jumper">
  62. </el-pagination>
  63. <el-tabs style="font-size: 12px;min-height: 330px" class="customer-tab" v-model="activeName" type="border-card" @tab-click="tabClick">
  64. <el-tab-pane label="项目信息" name="project">
  65. <el-form label-position="top" style="margin-top: 0px; margin-left: 0px;">
  66. <el-row :gutter="20">
  67. <el-col :span="5"><div class="grid-content bg-purple">
  68. <el-form-item :label="'项目号'">
  69. <el-input v-model="projectData.projectId" readonly ></el-input>
  70. </el-form-item>
  71. </div></el-col>
  72. <el-col :span="5"><div class="grid-content bg-purple">
  73. <el-form-item :label="'项目类型'">
  74. <el-input v-model="projectData.projectType" readonly ></el-input>
  75. </el-form-item>
  76. </div></el-col>
  77. <el-col :span="5"><div class="grid-content bg-purple">
  78. <el-form-item :label="'项目来源'">
  79. <el-input v-model="projectData.projectSourceDesc" readonly ></el-input>
  80. </el-form-item>
  81. </div></el-col>
  82. <el-col :span="5"><div class="grid-content bg-purple">
  83. <el-form-item :label="'优先级'">
  84. <el-input v-model="projectData.priorityDesc" readonly></el-input>
  85. </el-form-item>
  86. </div></el-col>
  87. <el-col :span="4"><div class="grid-content bg-purple">
  88. <el-form-item :label="'需求日期'">
  89. <el-input v-model="projectData.needDate" readonly ></el-input>
  90. </el-form-item>
  91. </div></el-col>
  92. </el-row>
  93. <el-row :gutter="20">
  94. <el-col :span="5"><div class="grid-content bg-purple">
  95. <el-form-item :label="'BU'">
  96. <el-input v-model="projectData.buDesc" readonly style="" ></el-input>
  97. </el-form-item>
  98. </div></el-col>
  99. <el-col :span="5"><div class="grid-content bg-purple">
  100. <el-form-item :label="'项目名称'">
  101. <el-input v-model="projectData.projectName" readonly style="" ></el-input>
  102. </el-form-item>
  103. </div></el-col>
  104. <el-col :span="14"><div class="grid-content bg-purple">
  105. <el-form-item :label="'项目描述'">
  106. <el-input v-model="projectData.projectDesc" readonly style="" ></el-input>
  107. </el-form-item>
  108. </div></el-col>
  109. </el-row>
  110. <el-row :gutter="20">
  111. <el-col :span="8"><div class="grid-content bg-purple">
  112. <el-form-item :label="'项目经理'">
  113. <el-input v-model="projectData.projectManagerName" readonly style="" ></el-input>
  114. </el-form-item>
  115. </div></el-col>
  116. <el-col :span="8"><div class="grid-content bg-purple">
  117. <el-form-item :label="'项目责任人'">
  118. <el-input v-model="projectData.projectOwnerName" readonly style="" ></el-input>
  119. </el-form-item>
  120. </div></el-col>
  121. <el-col :span="8"><div class="grid-content bg-purple">
  122. <el-form-item :label="'项目权限'">
  123. <el-input v-model="projectData.userRoleName" readonly style="" ></el-input>
  124. </el-form-item>
  125. </div></el-col>
  126. </el-row>
  127. <el-row :gutter="20">
  128. <el-col :span="24"><div class="grid-content bg-purple">
  129. <el-form-item :label="'客户应用/要求'">
  130. <el-input v-model="projectData.customerRemark" readonly style="" ></el-input>
  131. </el-form-item>
  132. </div></el-col>
  133. </el-row>
  134. <el-row :gutter="20">
  135. <el-col :span="24"><div class="grid-content bg-purple">
  136. <el-form-item :label="'其他特殊要求'">
  137. <el-input v-model="projectData.remark" readonly style="" ></el-input>
  138. </el-form-item>
  139. </div></el-col>
  140. </el-row>
  141. </el-form>
  142. </el-tab-pane>
  143. <el-tab-pane label="询价信息" name="projectQuotation">
  144. <projectQuotation ref="projectQuotation" ></projectQuotation>
  145. </el-tab-pane>
  146. <el-tab-pane label="报价信息" name="quotationHeader">
  147. <project-part-quote :part="currentRow"></project-part-quote>
  148. </el-tab-pane>
  149. <el-tab-pane label="打样信息" name="sample">
  150. <sample ref="sample" ></sample>
  151. </el-tab-pane>
  152. <el-tab-pane label="测试记录" name="test">
  153. <test ref="test" ></test>
  154. </el-tab-pane>
  155. <el-tab-pane label="刀模申请" name="purchase">
  156. </el-tab-pane>
  157. <el-tab-pane label="技术参数卡" name="technicalSpecification">
  158. <technicalSpecification ref="technicalSpecification" ></technicalSpecification>
  159. </el-tab-pane>
  160. </el-tabs>
  161. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  162. </div>
  163. </template>
  164. <script>
  165. import {projectInfoPartSearch,
  166. projectInfoSearch,
  167. } from "@/api/project/project.js"
  168. import Chooselist from '@/views/modules/common/Chooselist'
  169. import projectQuotation from "../projectInfo/com_project_puotation.vue";/*組件*/
  170. import technicalSpecification from "./com_projectPart_technicalSpecification";
  171. import sample from "../projectInfo/com_project_sample";
  172. import test from "../projectInfo/com_project_test";
  173. import quotationHeader from "../projectInfo/com_project_info_quotation";
  174. import ProjectPartQuote from "./projectPartQuote.vue";
  175. export default {
  176. components: {
  177. ProjectPartQuote,
  178. Chooselist,
  179. technicalSpecification,
  180. projectQuotation,
  181. sample,
  182. test,
  183. quotationHeader,
  184. },
  185. name: "searchProjectPart",
  186. data() {
  187. return{
  188. currentRow:{},
  189. activeName: 'project',
  190. tagNo:'',
  191. tagNo2:'',
  192. pageIndex: 1,
  193. pageSize: 100,
  194. totalPage: 0,
  195. height: 200,
  196. dataListLoading: false,
  197. // 导出 start
  198. exportData: [],
  199. exportName: "项目物料清单" + this.dayjs().format('YYYYMMDDHHmmss'),
  200. exportHeader: ["项目物料清单"],
  201. exportFooter: [],
  202. exportList:[],
  203. // 导出 start
  204. dataList1:[],
  205. columnList1:[
  206. {
  207. userId: this.$store.state.user.name,
  208. functionId: 101002002,
  209. serialNumber: '101002002Table1TestPartNo',
  210. tableId: "101002002Table1",
  211. tableName: "项目物料",
  212. columnProp: "testPartNo",
  213. headerAlign: "center",
  214. align: "center",
  215. columnLabel: "物料编码",
  216. columnHidden: false,
  217. columnImage: false,
  218. columnSortable: false,
  219. sortLv: 0,
  220. status: true,
  221. fixed: '',
  222. columnWidth: 100
  223. },{
  224. userId: this.$store.state.user.name,
  225. functionId: 101002002,
  226. serialNumber: '101002002Table1PartDesc',
  227. tableId: "101002002Table1",
  228. tableName: "项目物料",
  229. columnProp: "partDesc",
  230. headerAlign: "center",
  231. align: "left",
  232. columnLabel: "物料描述",
  233. columnHidden: false,
  234. columnImage: false,
  235. columnSortable: false,
  236. sortLv: 0,
  237. status: true,
  238. fixed: '',
  239. columnWidth: 200
  240. },{
  241. userId: this.$store.state.user.name,
  242. functionId: 101002002,
  243. serialNumber: '101002002Table1PartType',
  244. tableId: "101002002Table1",
  245. tableName: "项目物料",
  246. columnProp: "projectId",
  247. headerAlign: "center",
  248. align: "center",
  249. columnLabel: "项目",
  250. columnHidden: false,
  251. columnImage: false,
  252. columnSortable: false,
  253. sortLv: 0,
  254. status: true,
  255. fixed: '',
  256. columnWidth: 100
  257. },{
  258. userId: this.$store.state.user.name,
  259. functionId: 101002002,
  260. serialNumber: '101002002Table1PartType',
  261. tableId: "101002002Table1",
  262. tableName: "项目物料",
  263. columnProp: "partType",
  264. headerAlign: "center",
  265. align: "center",
  266. columnLabel: "产品大类编码",
  267. columnHidden: false,
  268. columnImage: false,
  269. columnSortable: false,
  270. sortLv: 0,
  271. status: true,
  272. fixed: '',
  273. columnWidth: 100
  274. },{
  275. userId: this.$store.state.user.name,
  276. functionId: 101002002,
  277. serialNumber: '101002002Table1PartTypeDesc',
  278. tableId: "101002002Table1",
  279. tableName: "项目物料",
  280. columnProp: "partTypeDesc",
  281. headerAlign: "center",
  282. align: "left",
  283. columnLabel: "产品大类名称",
  284. columnHidden: false,
  285. columnImage: false,
  286. columnSortable: false,
  287. sortLv: 0,
  288. status: true,
  289. fixed: '',
  290. columnWidth: 200
  291. },{
  292. userId: this.$store.state.user.name,
  293. functionId: 101002002,
  294. serialNumber: '101002002Table1CodeNo',
  295. tableId: "101002002Table1",
  296. tableName: "项目物料",
  297. columnProp: "codeNo",
  298. headerAlign: "center",
  299. align: "center",
  300. columnLabel: "属性模板编码",
  301. columnHidden: false,
  302. columnImage: false,
  303. columnSortable: false,
  304. sortLv: 0,
  305. status: true,
  306. fixed: '',
  307. columnWidth: 100
  308. },{
  309. userId: this.$store.state.user.name,
  310. functionId: 101002002,
  311. serialNumber: '101002002Table1CodeDesc',
  312. tableId: "101002002Table1",
  313. tableName: "项目物料",
  314. columnProp: "codeDesc",
  315. headerAlign: "center",
  316. align: "left",
  317. columnLabel: "属性模板名称",
  318. columnHidden: false,
  319. columnImage: false,
  320. columnSortable: false,
  321. sortLv: 0,
  322. status: true,
  323. fixed: '',
  324. columnWidth: 150
  325. },{
  326. userId: this.$store.state.user.name,
  327. functionId: 101002002,
  328. serialNumber: '101002002Table1Remark',
  329. tableId: "101002002Table1",
  330. tableName: "项目物料",
  331. columnProp: "remark",
  332. headerAlign: "center",
  333. align: "left",
  334. columnLabel: "备注",
  335. columnHidden: false,
  336. columnImage: false,
  337. columnSortable: false,
  338. sortLv: 0,
  339. status: true,
  340. fixed: '',
  341. columnWidth: 120
  342. },{
  343. userId: this.$store.state.user.name,
  344. functionId: 101002002,
  345. serialNumber: '101002002Table1CreateDate',
  346. tableId: "101002002Table1",
  347. tableName: "项目物料",
  348. columnProp: "createDate",
  349. headerAlign: "center",
  350. align: "left",
  351. columnLabel: "创建时间",
  352. columnHidden: false,
  353. columnImage: false,
  354. columnSortable: false,
  355. sortLv: 0,
  356. status: true,
  357. fixed: '',
  358. columnWidth: 120
  359. },{
  360. userId: this.$store.state.user.name,
  361. functionId: 101002002,
  362. serialNumber: '101002002Table1CreateBy',
  363. tableId: "101002002Table1",
  364. tableName: "项目物料",
  365. columnProp: "createBy",
  366. headerAlign: "center",
  367. align: "left",
  368. columnLabel: "创建人",
  369. columnHidden: false,
  370. columnImage: false,
  371. columnSortable: false,
  372. sortLv: 0,
  373. status: true,
  374. fixed: '',
  375. columnWidth: 80
  376. },{
  377. userId: this.$store.state.user.name,
  378. functionId: 101002002,
  379. serialNumber: '101002002Table1UpdateDate',
  380. tableId: "101002002Table1",
  381. tableName: "项目物料",
  382. columnProp: "updateDate",
  383. headerAlign: "center",
  384. align: "left",
  385. columnLabel: "上次修改日期",
  386. columnHidden: false,
  387. columnImage: false,
  388. columnSortable: false,
  389. sortLv: 0,
  390. status: true,
  391. fixed: '',
  392. columnWidth: 120
  393. },{
  394. userId: this.$store.state.user.name,
  395. functionId: 101002002,
  396. serialNumber: '101002002Table1UpdateBy',
  397. tableId: "101002002Table1",
  398. tableName: "项目物料",
  399. columnProp: "updateBy",
  400. headerAlign: "center",
  401. align: "left",
  402. columnLabel: "修改人",
  403. columnHidden: false,
  404. columnImage: false,
  405. columnSortable: false,
  406. sortLv: 0,
  407. status: true,
  408. fixed: '',
  409. columnWidth: 80
  410. },
  411. ],
  412. searchData:{
  413. page: 1,
  414. limit: 100,
  415. site:this.$store.state.user.site,
  416. projectId:'',
  417. testPartNo:'',
  418. userName:this.$store.state.user.name,
  419. },
  420. projectData: {
  421. id: 0,
  422. site:this.$store.state.user.site,
  423. projectLevel:'',
  424. projectId:'',
  425. projectTypeDb:'',
  426. projectType:'',
  427. customerName:'',
  428. customerId:'',
  429. projectName:'',
  430. projectDesc:'',
  431. needDate:'',
  432. priority:'',
  433. projectSource:'',
  434. priorityDesc:'',
  435. projectSourceDesc:'',
  436. projectManagerName:'',
  437. projectOwnerName:'',
  438. customerRemark:'',
  439. remark:'',
  440. userRoleName:'',
  441. buDesc:'',
  442. buNo:'',
  443. },
  444. }
  445. },
  446. mounted() {
  447. this.$nextTick(() => {
  448. this.height = window.innerHeight - 520;
  449. })
  450. },
  451. methods: {
  452. // 获取基础数据列表S
  453. getBaseList(val, type) {
  454. this.tagNo = val
  455. this.tagNo2 = type
  456. this.$nextTick(() => {
  457. let strVal = ''
  458. if (val === 1010) {
  459. if (type == 1) {
  460. strVal = this.searchData.projectType
  461. }
  462. }
  463. this.$refs.baseList.init(val, strVal)
  464. })
  465. },
  466. /* 列表方法的回调 */
  467. getBaseData(val) {
  468. if (this.tagNo === 1010) {
  469. if (this.tagNo2 == 1) {
  470. this.searchData.projectType = val.Base_desc
  471. }
  472. }
  473. },
  474. //导出excel
  475. async createExportData() {
  476. this.searchData.limit = -1
  477. this.searchData.page = 1
  478. await projectInfoSearch(this.searchData).then(({data}) => {
  479. this.exportList= data.page.list;
  480. })
  481. return this.exportList;
  482. },
  483. startDownload() {
  484. // this.exportData = this.dataList
  485. },
  486. finishDownload() {
  487. },
  488. fields() {
  489. let json = "{"
  490. this.columnList1.forEach((item, index) => {
  491. if (index == this.columnList1.length - 1) {
  492. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  493. } else {
  494. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  495. }
  496. })
  497. json += "}"
  498. let s = eval("(" + json + ")")
  499. return s
  500. },
  501. //导出excel
  502. async createExportData2() {
  503. return this.contactList;
  504. },
  505. startDownload2() {
  506. // this.exportData = this.dataList
  507. },
  508. finishDownload2() {
  509. },
  510. fields2() {
  511. let json = "{"
  512. this.columnList2.forEach((item, index) => {
  513. if (index == this.columnList2.length - 1) {
  514. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  515. } else {
  516. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  517. }
  518. })
  519. json += "}"
  520. let s = eval("(" + json + ")")
  521. return s
  522. },
  523. // 导出 end
  524. // 每页数
  525. sizeChangeHandle (val) {
  526. this.pageSize = val
  527. this.pageIndex = 1
  528. this.search()
  529. },
  530. // 当前页
  531. currentChangeHandle (val) {
  532. this.pageIndex = val
  533. this.search()
  534. },
  535. //单击切换订单
  536. changeData(row) {
  537. this.currentRow = JSON.parse(JSON.stringify(row));
  538. let inData= {
  539. site:row.site,
  540. projectId:row.projectId,
  541. page: 1,
  542. limit: 10,
  543. }
  544. projectInfoSearch(inData).then(({data}) => {
  545. if (data.code == 0) {
  546. if(data.page.list.length>0){
  547. this.projectData=data.page.list[0]
  548. }
  549. }
  550. this.dataListLoading = false
  551. })
  552. this.refreshCurrentTabTable()
  553. },
  554. search () {
  555. this.searchData.limit = this.pageSize
  556. this.searchData.page = this.pageIndex
  557. projectInfoPartSearch(this.searchData).then(({data}) => {
  558. if (data.code == 0) {
  559. this.dataList1 = data.page.list
  560. this.pageIndex = data.page.currPage
  561. this.pageSize = data.page.pageSize
  562. this.totalPage = data.page.totalCount
  563. if(this.dataList1.length>0){
  564. this.$refs.mainTable.setCurrentRow(this.dataList1[0]);
  565. this.changeData(this.dataList1[0])
  566. }
  567. }
  568. this.dataListLoading = false
  569. })
  570. },
  571. tabClick (tab, event) {
  572. // 刷新列表数据
  573. this.refreshCurrentTabTable()
  574. },
  575. // 刷新页签的table数据
  576. refreshCurrentTabTable () {
  577. if (this.activeName === 'technicalSpecification') {
  578. this.refreshTable('technicalSpecification');
  579. }
  580. if (this.activeName === 'projectQuotation') {
  581. this.refreshTable('projectQuotation');
  582. }
  583. if (this.activeName == 'quotationHeader') {
  584. this.refreshTable('quotationHeader');
  585. }
  586. if (this.activeName == 'sample') {
  587. this.refreshTable('sample');
  588. }
  589. if (this.activeName == 'test') {
  590. this.refreshTable('test');
  591. }
  592. },
  593. refreshTable(type){
  594. let inData={
  595. site: this.currentRow.site,
  596. testPartNo: this.currentRow.testPartNo,
  597. page: 1,
  598. limit: 1000
  599. }
  600. if(type==='technicalSpecification'){
  601. this.$refs.technicalSpecification.init(inData)
  602. }
  603. if(type==='projectQuotation'){
  604. this.$refs.projectQuotation.init(inData)
  605. }
  606. // if(type==='quotationHeader'){
  607. // this.$refs.quotationHeader.init(inData)
  608. // }
  609. if(type==='sample'){
  610. this.$refs.sample.init(inData)
  611. }
  612. if(type==='test'){
  613. this.$refs.test.init(inData)
  614. }
  615. },
  616. }
  617. }
  618. </script>
  619. <style scoped>
  620. </style>