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.

797 lines
27 KiB

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
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
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
  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.cdoeNo" style="width: 130px"></el-input>
  6. </el-form-item>
  7. <el-form-item >
  8. <span slot="label" style="" @click="getBaseList(105,1)"><a herf="#">测试料号</a></span>
  9. <el-input v-model="searchData.testPartNo" style="width: 120px"></el-input>
  10. </el-form-item>
  11. <el-form-item :label="'状态'">
  12. <el-input v-model="searchData.projectOwnerName" style="width: 130px"></el-input>
  13. </el-form-item>
  14. <el-form-item label=" ">
  15. <el-button @click="search()" type="primary" style="margin-left: 2px;margin-top:0px">查询</el-button>
  16. <el-button @click="addOrUpdateHandle()" type="primary" style="margin-left: 2px;margin-top: 0px">新增</el-button>
  17. <download-excel
  18. :fields="fields()"
  19. :data="exportData"
  20. type="xls"
  21. :name="exportName"
  22. :header="exportHeader"
  23. :footer="exportFooter"
  24. :fetch="createExportData"
  25. :before-generate="startDownload"
  26. :before-finish="finishDownload"
  27. worksheet="导出信息"
  28. class="el-button el-button--primary el-button--medium">
  29. {{ '导出' }}
  30. </download-excel>
  31. </el-form-item>
  32. </el-form>
  33. <el-table
  34. :data="dataList1"
  35. :height="height"
  36. border
  37. ref="mainTable"
  38. @row-click="changeData"
  39. highlight-current-row
  40. v-loading="dataListLoading"
  41. style="width: 100%; ">
  42. <el-table-column
  43. v-for="(item,index) in columnList1" :key="index"
  44. :sortable="item.columnSortable"
  45. :prop="item.columnProp"
  46. :header-align="item.headerAlign"
  47. :show-overflow-tooltip="item.showOverflowTooltip"
  48. :align="item.align"
  49. :fixed="item.fixed==''?false:item.fixed"
  50. :min-width="item.columnWidth"
  51. :label="item.columnLabel">
  52. <template slot-scope="scope">
  53. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  54. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  55. </template>
  56. </el-table-column>
  57. <el-table-column
  58. header-align="center"
  59. align="center"
  60. width="150"
  61. fixed="right"
  62. label="操作">
  63. <template slot-scope="scope">
  64. <a type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</a>
  65. <a type="text" size="small" @click="deleteData(scope.row)">删除</a>
  66. </template>
  67. </el-table-column>
  68. </el-table>
  69. <el-pagination
  70. @size-change="sizeChangeHandle"
  71. @current-change="currentChangeHandle"
  72. :current-page="pageIndex"
  73. :page-sizes="[20, 50, 100, 1000]"
  74. :page-size="pageSize"
  75. :total="totalPage"
  76. layout="total, sizes, prev, pager, next, jumper">
  77. </el-pagination>
  78. <el-tabs style="font-size: 12px;min-height: 330px" class="customer-tab" v-model="activeName" type="border-card" @tab-click="refreshCurrentTabTable">
  79. <el-tab-pane label="基本信息" name="info">
  80. <el-form :inline="true" label-position="top" label-width="100px" >
  81. <el-form-item :label="'物料编码'">
  82. <el-input v-model="infoData.testPartNo" readonly style="width: 200px" ></el-input>
  83. </el-form-item>
  84. <el-form-item :label="'物料类型'">
  85. <el-input v-model="infoData.partTypeDesc" readonly style="width: 174px" ></el-input>
  86. </el-form-item>
  87. <el-form-item :label="'版本号'">
  88. <el-input v-model="infoData.revNo" readonly style="width: 200px" ></el-input>
  89. </el-form-item>
  90. <el-form-item :label="'打样单号'">
  91. <el-input v-model="infoData.proofingNo" readonly style="width: 150px" ></el-input>
  92. </el-form-item>
  93. <el-form-item :label="'项目号'">
  94. <el-input v-model="infoData.projectId" readonly style="width: 150px" ></el-input>
  95. </el-form-item>
  96. </el-form>
  97. <el-form :inline="true" label-position="top" label-width="100px" >
  98. <el-form-item :label="'ECN变更'">
  99. <el-input v-model="infoData.ecnFlag" readonly style="width: 130px" ></el-input>
  100. </el-form-item>
  101. <el-form-item :label="'ECN单据号'">
  102. <el-input v-model="infoData.ecnNo" readonly style="width: 206px" ></el-input>
  103. </el-form-item>
  104. <el-form-item :label="'ECN文档链接'">
  105. <el-input v-model="infoData.ecnAddress" readonly style="width: 564px" ></el-input>
  106. </el-form-item>
  107. </el-form>
  108. <el-form :inline="true" label-position="top" label-width="100px" >
  109. <el-form-item :label="'报价员'">
  110. <el-input v-model="infoData.quotationOfficer" readonly style="width: 300px" ></el-input>
  111. </el-form-item>
  112. <el-form-item :label="'工程师'">
  113. <el-input v-model="infoData.engineer" readonly style="width: 300px" ></el-input>
  114. </el-form-item>
  115. <el-form-item :label="'技术员'">
  116. <el-input v-model="infoData.technician" readonly style="width: 300px" ></el-input>
  117. </el-form-item>
  118. </el-form>
  119. <el-form :inline="true" label-position="top" label-width="100px" style="height: 70px">
  120. <el-form-item :label="'备注信息'">
  121. <el-input
  122. type="textarea"
  123. v-model="infoData.remark "
  124. :rows="3"
  125. resize='none'
  126. maxlength="120"
  127. show-word-limit
  128. readonly
  129. style="width: 926px;height: 60px">
  130. </el-input>
  131. </el-form-item>
  132. </el-form>
  133. </el-tab-pane>
  134. <el-tab-pane label="客户信息" name="customerInfo">
  135. <el-form :inline="true" label-position="top" label-width="100px" >
  136. <el-form-item :label="'客户代码'">
  137. <el-input v-model="infoData.testPartNo" readonly style="width: 150px" ></el-input>
  138. </el-form-item>
  139. <el-form-item :label="'客户简称'">
  140. <el-input v-model="infoData.partTypeDesc" readonly style="width: 150px" ></el-input>
  141. </el-form-item>
  142. <el-form-item :label="'客户描述'">
  143. <el-input v-model="infoData.revNo" readonly style="width: 600px" ></el-input>
  144. </el-form-item>
  145. </el-form>
  146. <el-form :inline="true" label-position="top" label-width="100px" >
  147. <el-form-item :label="'终端客户'">
  148. <el-input v-model="infoData.proofingNo" readonly style="width: 150px" ></el-input>
  149. </el-form-item>
  150. <el-form-item :label="'直接客户'">
  151. <el-input v-model="infoData.projectId" readonly style="width: 150px" ></el-input>
  152. </el-form-item>
  153. <el-form-item :label="'客户版本'">
  154. <el-input v-model="infoData.projectId" readonly style="width: 150px" ></el-input>
  155. </el-form-item>
  156. <el-form-item :label="'需要的认证'">
  157. <el-input v-model="infoData.projectId" readonly style="width: 150px" ></el-input>
  158. </el-form-item>
  159. </el-form>
  160. <el-form :inline="true" label-position="top" label-width="100px" style="height: 70px">
  161. <el-form-item :label="'客户要求'">
  162. <el-input
  163. type="textarea"
  164. v-model="infoData.remark "
  165. :rows="3"
  166. resize='none'
  167. maxlength="120"
  168. show-word-limit
  169. readonly
  170. style="width: 926px;height: 60px">
  171. </el-input>
  172. </el-form-item>
  173. </el-form>
  174. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 15px">
  175. <el-form-item :label="'客户图纸'">
  176. <el-input v-model="infoData.quotationOfficer" readonly style="width: 926px" ></el-input>
  177. </el-form-item>
  178. </el-form>
  179. <el-form :inline="true" label-position="top" label-width="100px" >
  180. <el-form-item :label="'客户图纸变更说明'">
  181. <el-input v-model="infoData.quotationOfficer" readonly style="width: 926px" ></el-input>
  182. </el-form-item>
  183. </el-form>
  184. <el-form :inline="true" label-position="top" label-width="100px" style="height: 70px">
  185. <el-form-item :label="'转量产附档说明'">
  186. <el-input
  187. type="textarea"
  188. v-model="infoData.remark "
  189. :rows="3"
  190. resize='none'
  191. maxlength="120"
  192. show-word-limit
  193. readonly
  194. style="width: 926px;height: 60px">
  195. </el-input>
  196. </el-form-item>
  197. </el-form>
  198. <el-form :inline="true" label-position="top" label-width="100px" style="height: 70px;margin-top: 15px">
  199. <el-form-item :label="'其他特殊要求'">
  200. <el-input
  201. type="textarea"
  202. v-model="infoData.remark "
  203. :rows="3"
  204. resize='none'
  205. maxlength="120"
  206. show-word-limit
  207. readonly
  208. style="width: 926px;height: 60px">
  209. </el-input>
  210. </el-form-item>
  211. </el-form>
  212. <el-form :inline="true" label-position="top" label-width="100px" style="height: 70px;margin-top: 15px">
  213. <el-form-item :label="'备注信息'">
  214. <el-input
  215. type="textarea"
  216. v-model="infoData.remark "
  217. :rows="3"
  218. resize='none'
  219. maxlength="120"
  220. show-word-limit
  221. readonly
  222. style="width: 926px;height: 60px">
  223. </el-input>
  224. </el-form-item>
  225. </el-form>
  226. </el-tab-pane>
  227. </el-tabs>
  228. <el-dialog
  229. width="600px"
  230. :title="!dataForm.id ? '添加' :'编辑'"
  231. :close-on-click-modal="false"
  232. :visible.sync="visible">
  233. <el-form :inline="true" label-position="top" label-width="100px" :rules="dataRole">
  234. <el-form-item :label="'项目料号'">
  235. <el-input v-model="dataForm.testPartNo" style="width: 130px" disabled></el-input>
  236. </el-form-item>
  237. <el-form-item prop="partTypeDesc" :rules="dataRole.partTypeDesc">
  238. <span slot="label" style="" @click="getBaseList(1013,1)"><a herf="#">物料类型</a></span>
  239. <el-input v-model="dataForm.partTypeDesc" style="width: 130px" readonly @focus="getBaseList(1013,1)" ></el-input>
  240. </el-form-item>
  241. </el-form>
  242. <el-form :inline="true" label-position="top" label-width="100px" :rules="dataRole">
  243. <el-form-item :label="'物料名称'" prop="partName" :rules="dataRole.partName">
  244. <el-input v-model="dataForm.partName" style="width: 562px" ></el-input>
  245. </el-form-item>
  246. </el-form>
  247. <el-form :inline="true" label-position="top" label-width="100px" >
  248. <el-form-item :label="'物料描述'">
  249. <el-input v-model="dataForm.partDesc" style="width: 562px" ></el-input>
  250. </el-form-item>
  251. </el-form>
  252. <el-form :inline="true" label-position="top" label-width="100px" >
  253. <el-form-item :label="'物料描述'">
  254. <el-input v-model="dataForm.partSpec" style="width: 562px" ></el-input>
  255. </el-form-item>
  256. </el-form>
  257. <el-form :inline="true" label-position="top" label-width="100px" >
  258. <el-form-item :label="'物料图号'">
  259. <el-input v-model="dataForm.materialNumber" style="width: 562px" ></el-input>
  260. </el-form-item>
  261. </el-form>
  262. <el-form :inline="true" label-position="top" label-width="100px" >
  263. <el-form-item :label="'备注'">
  264. <el-input v-model="dataForm.remark" style="width: 562px" ></el-input>
  265. </el-form-item>
  266. </el-form>
  267. <span slot="footer" class="dialog-footer">
  268. <el-button type="primary" @click="saveData()">{{'确定'}}</el-button>
  269. <el-button type="primary" @click="visible = false">{{'关闭'}}</el-button>
  270. </span>
  271. </el-dialog>
  272. <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="search" v-drag></add-or-update>
  273. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  274. </div>
  275. </template>
  276. <script>
  277. import {
  278. technicalSpecificationListSearch,
  279. } from "@/api/sampleManagement/technicalSpecificationList.js"
  280. import Chooselist from '@/views/modules/common/Chooselist'
  281. import AddOrUpdate from './com_technical-add-or-update'
  282. export default {
  283. components: {
  284. Chooselist,
  285. AddOrUpdate,
  286. },
  287. data() {
  288. return {
  289. activeName:'info',
  290. addOrUpdateVisible:false,
  291. height:200,
  292. dataList1: [],
  293. searchData: {
  294. page: 1,
  295. limit: 100,
  296. site: this.$store.state.user.site,
  297. username: this.$store.state.user.name,
  298. testPartNo: '',
  299. cdoeNo: '',
  300. },
  301. pageIndex: 1,
  302. pageSize: 100,
  303. totalPage: 0,
  304. visible:false,
  305. dataListLoading: false,
  306. currentRow:'',
  307. columnList1:[
  308. {
  309. userId: this.$store.state.user.name,
  310. functionId: 103002,
  311. serialNumber: '103002Table1CodeNo',
  312. tableId: "103002Table1",
  313. tableName: "技术参数卡列表",
  314. columnProp: "codeNo",
  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: 80
  325. },{
  326. userId: this.$store.state.user.name,
  327. functionId: 103002,
  328. serialNumber: '103002Table1Status',
  329. tableId: "103002Table1",
  330. tableName: "技术参数卡列表",
  331. columnProp: "statusDesc",
  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: 50
  342. },{
  343. userId: this.$store.state.user.name,
  344. functionId: 103002,
  345. serialNumber: '103002Table1FinalPartNo',
  346. tableId: "103002Table1",
  347. tableName: "技术参数卡列表",
  348. columnProp: "finalPartNo",
  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: 80
  359. },{
  360. userId: this.$store.state.user.name,
  361. functionId: 103002,
  362. serialNumber: '103002Table1TestPartNo',
  363. tableId: "103002Table1",
  364. tableName: "技术参数卡列表",
  365. columnProp: "testPartNo",
  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: 103002,
  379. serialNumber: '103002Table1PartName',
  380. tableId: "103002Table1",
  381. tableName: "技术参数卡列表",
  382. columnProp: "partDesc",
  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: 103002,
  396. serialNumber: '103002Table1RevNo',
  397. tableId: "103002Table1",
  398. tableName: "技术参数卡列表",
  399. columnProp: "revNo",
  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: 50
  410. },{
  411. userId: this.$store.state.user.name,
  412. functionId: 103002,
  413. serialNumber: '103002Table1ECNFlag',
  414. tableId: "103002Table1",
  415. tableName: "技术参数卡列表",
  416. columnProp: "ecnFlag",
  417. headerAlign: "center",
  418. align: "left",
  419. columnLabel: "ECN变更",
  420. columnHidden: false,
  421. columnImage: false,
  422. columnSortable: false,
  423. sortLv: 0,
  424. status: true,
  425. fixed: '',
  426. columnWidth: 50
  427. },{
  428. userId: this.$store.state.user.name,
  429. functionId: 103002,
  430. serialNumber: '103002Table1EcnNo',
  431. tableId: "103002Table1",
  432. tableName: "技术参数卡列表",
  433. columnProp: "ecnNo",
  434. headerAlign: "center",
  435. align: "left",
  436. columnLabel: "ECN单据号",
  437. columnHidden: false,
  438. columnImage: false,
  439. columnSortable: false,
  440. sortLv: 0,
  441. status: true,
  442. fixed: '',
  443. columnWidth: 80
  444. },{
  445. userId: this.$store.state.user.name,
  446. functionId: 103002,
  447. serialNumber: '103002Table1ProofingNo',
  448. tableId: "103002Table1",
  449. tableName: "技术参数卡列表",
  450. columnProp: "proofingNo",
  451. headerAlign: "center",
  452. align: "left",
  453. columnLabel: "打样申请单号",
  454. columnHidden: false,
  455. columnImage: false,
  456. columnSortable: false,
  457. sortLv: 0,
  458. status: true,
  459. fixed: '',
  460. columnWidth: 80
  461. },{
  462. userId: this.$store.state.user.name,
  463. functionId: 103002,
  464. serialNumber: '103002Table1CreateDate',
  465. tableId: "103002Table1",
  466. tableName: "技术参数卡列表",
  467. columnProp: "createDate",
  468. headerAlign: "center",
  469. align: "left",
  470. columnLabel: "创建时间",
  471. columnHidden: false,
  472. columnImage: false,
  473. columnSortable: false,
  474. sortLv: 0,
  475. status: true,
  476. fixed: '',
  477. columnWidth: 120
  478. },{
  479. userId: this.$store.state.user.name,
  480. functionId: 103002,
  481. serialNumber: '103002Table1CreateBy',
  482. tableId: "103002Table1",
  483. tableName: "技术参数卡列表",
  484. columnProp: "createBy",
  485. headerAlign: "center",
  486. align: "left",
  487. columnLabel: "创建人",
  488. columnHidden: false,
  489. columnImage: false,
  490. columnSortable: false,
  491. sortLv: 0,
  492. status: true,
  493. fixed: '',
  494. columnWidth: 80
  495. },{
  496. userId: this.$store.state.user.name,
  497. functionId: 103002,
  498. serialNumber: '103002Table1UpdateDate',
  499. tableId: "103002Table1",
  500. tableName: "技术参数卡列表",
  501. columnProp: "updateDate",
  502. headerAlign: "center",
  503. align: "left",
  504. columnLabel: "上次修改日期",
  505. columnHidden: false,
  506. columnImage: false,
  507. columnSortable: false,
  508. sortLv: 0,
  509. status: true,
  510. fixed: '',
  511. columnWidth: 120
  512. },{
  513. userId: this.$store.state.user.name,
  514. functionId: 103002,
  515. serialNumber: '103002Table1UpdateBy',
  516. tableId: "103002Table1",
  517. tableName: "技术参数卡列表",
  518. columnProp: "updateBy",
  519. headerAlign: "center",
  520. align: "left",
  521. columnLabel: "修改人",
  522. columnHidden: false,
  523. columnImage: false,
  524. columnSortable: false,
  525. sortLv: 0,
  526. status: true,
  527. fixed: '',
  528. columnWidth: 80
  529. },{
  530. userId: this.$store.state.user.name,
  531. functionId: 103002,
  532. serialNumber: '103002Table1ecnAddress',
  533. tableId: "103002Table1",
  534. tableName: "技术参数卡列表",
  535. columnProp: "ecnAddress",
  536. headerAlign: "center",
  537. align: "left",
  538. columnLabel: "ECN文档链接",
  539. columnHidden: false,
  540. columnImage: false,
  541. columnSortable: false,
  542. sortLv: 0,
  543. status: true,
  544. fixed: '',
  545. columnWidth: 200
  546. },
  547. ],
  548. dataForm:{
  549. id:'',
  550. site: '',
  551. projectId: '',
  552. testPartNo:'',
  553. partType:'',
  554. partTypeDesc:'',
  555. partName:'',
  556. partDesc:'',
  557. partSpec:'',
  558. remark:'',
  559. materialNumber:'',
  560. username:'',
  561. },
  562. infoData:{
  563. testPartNo:'',
  564. partTypeDesc:'',
  565. revNo:'',
  566. proofingNo:'',
  567. projectId:'',
  568. ecnFlag:'',
  569. ecnNo:'',
  570. ecnAddress:'',
  571. quotationOfficer:'',
  572. engineer:'',
  573. technician:'',
  574. remark:'',
  575. },
  576. dataRole: {
  577. partTypeDesc: [
  578. {
  579. required: true,
  580. message: ' ',
  581. trigger: 'change'
  582. }
  583. ],
  584. partName: [
  585. {
  586. required: true,
  587. message: ' ',
  588. trigger: 'change'
  589. }
  590. ],
  591. },
  592. // 导出 start
  593. exportData: [],
  594. exportName: '技术参数卡清单'+this.dayjs().format('YYYYMMDDHHmmss'),
  595. exportHeader: ["技术参数卡清单"],
  596. exportFooter: [],
  597. // 导出 end
  598. }
  599. },
  600. mounted() {
  601. this.$nextTick(() => {
  602. this.height = window.innerHeight - 520;
  603. })
  604. },
  605. methods: {
  606. // 每页数
  607. sizeChangeHandle (val) {
  608. this.pageSize = val
  609. this.pageIndex = 1
  610. this.search()
  611. },
  612. // 当前页
  613. currentChangeHandle (val) {
  614. this.pageIndex = val
  615. this.search()
  616. },
  617. search(){
  618. this.searchData.limit = this.pageSize
  619. this.searchData.page = this.pageIndex
  620. technicalSpecificationListSearch(this.searchData).then(({data}) => {
  621. if (data.code == 0) {
  622. this.dataList1 = data.page.list
  623. this.pageIndex = data.page.currPage
  624. this.pageSize = data.page.pageSize
  625. this.totalPage = data.page.totalCount
  626. if(this.dataList1.length>0){
  627. this.$refs.mainTable.setCurrentRow(this.dataList1[0]);
  628. this.changeData(this.dataList1[0])
  629. }
  630. }
  631. this.dataListLoading = false
  632. })
  633. },
  634. changeData(row) {
  635. this.currentRow = JSON.parse(JSON.stringify(row));
  636. this.infoData=row;
  637. this.refreshCurrentTabTable ();
  638. },
  639. // 获取基础数据列表S
  640. getBaseList (val, type) {
  641. this.tagNo = val
  642. this.tagNo1 = type
  643. this.$nextTick(() => {
  644. let strVal = ''
  645. if (val === 1013) {
  646. if(type==1) {
  647. strVal = this.dataForm.partType
  648. }
  649. }
  650. if (val === 105) {
  651. if(type==1) {
  652. strVal = this.searchData.testPartNo
  653. }
  654. }
  655. this.$refs.baseList.init(val, strVal)
  656. })
  657. },
  658. refreshCurrentTabTable () {
  659. },
  660. /* 列表方法的回调 */
  661. getBaseData (val) {
  662. if (this.tagNo === 1013) {
  663. if(this.tagNo1==1) {
  664. this.dataForm.partType = val.Base_id
  665. this.dataForm.partTypeDesc = val.Base_desc
  666. }
  667. }
  668. if (this.tagNo === 105) {
  669. if(this.tagNo1==1) {
  670. this.searchData.testPartNo = val.Test_part_no
  671. }
  672. }
  673. },
  674. // 新增 / 修改
  675. addOrUpdateHandle (id) {
  676. this.addOrUpdateVisible = true
  677. this.$nextTick(() => {
  678. this.$refs.addOrUpdate.init(id)
  679. })
  680. },
  681. addModal(){
  682. if(this.searchData.projectId==""||this.searchData.projectId==null){
  683. this.$alert('请选择项目!', '错误', {
  684. confirmButtonText: '确定'
  685. })
  686. return false;
  687. }
  688. this.dataForm={
  689. id:0,
  690. site: this.searchData.site,
  691. projectId: this.searchData.projectId,
  692. testPartNo:'',
  693. partType:'',
  694. partTypeDesc:'',
  695. partName:'',
  696. partDesc:'',
  697. partSpec:'',
  698. remark:'',
  699. materialNumber:'',
  700. username:this.$store.state.user.name,
  701. }
  702. this.visible=true;
  703. },
  704. updateModel(row){
  705. this.dataForm={
  706. id:row.id,
  707. site: row.site,
  708. projectId: row.projectId,
  709. testPartNo:row.testPartNo,
  710. partType:row.partType,
  711. partTypeDesc:row.partTypeDesc,
  712. partName:row.partName,
  713. partDesc:row.partDesc,
  714. partSpec:row.partSpec,
  715. remark:row.remark,
  716. materialNumber:row.materialNumber,
  717. username:this.$store.state.user.name,
  718. }
  719. this.visible=true;
  720. },
  721. saveData(){
  722. if(this.dataForm.partType==''||this.dataForm.partType==null){
  723. this.$alert('请选择物料类别!', '错误', {
  724. confirmButtonText: '确定'
  725. })
  726. return false;
  727. }
  728. if(this.dataForm.partName==''||this.dataForm.partName==null){
  729. this.$alert('请输入物料名称!', '错误', {
  730. confirmButtonText: '确定'
  731. })
  732. return false;
  733. }
  734. saveProjectPart(this.dataForm).then(({data}) => {
  735. if (data && data.code === 0) {
  736. this.$message.success( '操作成功')
  737. this.visible = false
  738. this.searchTable();
  739. } else {
  740. this.$message.error(data.msg)
  741. }
  742. })
  743. },
  744. deleteData(){
  745. this.$confirm('确定要删除这条数据?', '提示', {
  746. confirmButtonText: '确定',
  747. cancelButtonText: '取消',
  748. type: 'warning'
  749. }).then(() => {
  750. deleteProjectPartWithId(this.dataForm).then(({data}) => {
  751. if (data && data.code === 0) {
  752. this.$message.success( '操作成功')
  753. this.searchTable();
  754. } else {
  755. this.$message.error(data.msg)
  756. }
  757. })
  758. }).catch(() => {
  759. })
  760. },
  761. //导出excel
  762. createExportData() {
  763. return this.dataList;
  764. },
  765. startDownload() {
  766. // this.exportData = this.dataList
  767. },
  768. finishDownload() {
  769. },
  770. fields() {
  771. let json = "{"
  772. this.columnList1.forEach((item, index) => {
  773. if (index == this.columnList1.length - 1) {
  774. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  775. } else {
  776. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  777. }
  778. })
  779. json += "}"
  780. let s = eval("(" + json + ")")
  781. return s
  782. },
  783. },
  784. }
  785. </script>
  786. <style scoped>
  787. </style>