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.

1088 lines
35 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
  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.applyId" style="width: 160px"></el-input>
  6. </el-form-item>
  7. <el-form-item label="申请日期">
  8. <el-date-picker
  9. value-format="yyyy-MM-dd"
  10. style="width: 100%"
  11. v-model="searchData.startDate"
  12. type="date"
  13. placeholder="开始日期">
  14. </el-date-picker>
  15. </el-form-item>
  16. <el-form-item label="到">
  17. <el-date-picker
  18. value-format="yyyy-MM-dd"
  19. style="width: 100%"
  20. v-model="searchData.endDate"
  21. type="date"
  22. placeholder="结束日期">
  23. </el-date-picker>
  24. </el-form-item>
  25. <el-form-item label=" ">
  26. <el-button @click="search()" type="primary" style="margin-left: 2px;margin-top:0px">查询</el-button>
  27. <!-- <el-button @click="addOrUpdateHandle('save')" type="primary" style="margin-left: 2px;margin-top: 0px">新增</el-button>-->
  28. <download-excel
  29. :fields="fields()"
  30. :data="exportData"
  31. type="xls"
  32. :name="exportName"
  33. :header="exportHeader"
  34. :footer="exportFooter"
  35. :fetch="createExportData"
  36. :before-generate="startDownload"
  37. :before-finish="finishDownload"
  38. worksheet="导出信息"
  39. class="el-button el-button--primary el-button--medium">
  40. {{ '导出' }}
  41. </download-excel>
  42. </el-form-item>
  43. </el-form>
  44. <el-table
  45. :height="height"
  46. :data="dataList1"
  47. border
  48. ref="mainTable"
  49. @row-click="changeData"
  50. highlight-current-row
  51. v-loading="dataListLoading"
  52. style="width: 100%;">
  53. <el-table-column
  54. header-align="center"
  55. align="center"
  56. width="150"
  57. fixed="right"
  58. label="操作">
  59. <template slot-scope="scope">
  60. <a type="text" size="small" v-if="scope.row.statusCode==='05'" @click="comfirmApply(scope.row)">下达</a>
  61. <a type="text" size="small" v-if="scope.row.statusCode==='05'" @click="cancelApply(scope.row)">取消申请</a>
  62. </template>
  63. </el-table-column>
  64. <el-table-column
  65. v-for="(item,index) in columnList1" :key="index"
  66. :sortable="item.columnSortable"
  67. :prop="item.columnProp"
  68. :header-align="item.headerAlign"
  69. :show-overflow-tooltip="item.showOverflowTooltip"
  70. :align="item.align"
  71. :fixed="item.fixed==''?false:item.fixed"
  72. :min-width="item.columnWidth"
  73. :label="item.columnLabel">
  74. <template slot-scope="scope">
  75. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  76. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  77. style="width: 100px; height: 80px"/></span>
  78. </template>
  79. </el-table-column>
  80. </el-table>
  81. <el-pagination
  82. @size-change="sizeChangeHandle"
  83. @current-change="currentChangeHandle"
  84. :current-page="pageIndex"
  85. :page-sizes="[20, 50, 100, 1000]"
  86. :page-size="pageSize"
  87. :total="totalPage"
  88. layout="total, sizes, prev, pager, next, jumper">
  89. </el-pagination>
  90. <el-tabs style="font-size: 12px;min-height: 330px" class="customer-tab" v-model="activeName" type="border-card" @tab-click="tabClick">
  91. <el-tab-pane label="工具明细" name="detail">
  92. <el-table
  93. :data="detailList"
  94. height="240"
  95. border
  96. v-loading="dataListLoading"
  97. style="width: 100%; ">
  98. <el-table-column
  99. v-for="(item,index) in columnList2" :key="index"
  100. :sortable="item.columnSortable"
  101. :prop="item.columnProp"
  102. :header-align="item.headerAlign"
  103. :show-overflow-tooltip="item.showOverflowTooltip"
  104. :align="item.align"
  105. :fixed="item.fixed==''?false:item.fixed"
  106. :min-width="item.columnWidth"
  107. :label="item.columnLabel">
  108. <template slot-scope="scope">
  109. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  110. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  111. style="width: 100px; height: 80px"/></span>
  112. </template>
  113. </el-table-column>
  114. <!-- <el-table-column-->
  115. <!-- fixed="right"-->
  116. <!-- header-align="center"-->
  117. <!-- align="center"-->
  118. <!-- width="100"-->
  119. <!-- label="操作">-->
  120. <!-- <template slot-scope="scope">-->
  121. <!-- &lt;!&ndash; <a :href="'http://192.168.1.130:80/file/'+scope.row.url" :download="scope.row.fileName">下载</a>&ndash;&gt;-->
  122. <!-- <a @click="downloadFile(scope.row)" >下载</a>-->
  123. <!-- <a type="text" size="small" @click="deleteFile(scope.row)">删除</a>-->
  124. <!-- </template>-->
  125. <!-- </el-table-column>-->
  126. </el-table>
  127. </el-tab-pane>
  128. <el-tab-pane label="文档管理" name="down">
  129. <!--文件上传-->
  130. <el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
  131. <el-form :inline="true" label-position="top" style="margin-top: 0px">
  132. <el-button type="primary" @click="addUploadFileModal()">上传文件</el-button>
  133. </el-form>
  134. </el-form>
  135. <el-table
  136. :data="fileContentList"
  137. height="240"
  138. border
  139. v-loading="dataListLoading"
  140. style="width: 100%; ">
  141. <el-table-column
  142. v-for="(item,index) in columnFileContentArray" :key="index"
  143. :sortable="item.columnSortable"
  144. :prop="item.columnProp"
  145. :header-align="item.headerAlign"
  146. :show-overflow-tooltip="item.showOverflowTooltip"
  147. :align="item.align"
  148. :fixed="item.fixed==''?false:item.fixed"
  149. :min-width="item.columnWidth"
  150. :label="item.columnLabel">
  151. <template slot-scope="scope">
  152. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  153. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  154. style="width: 100px; height: 80px"/></span>
  155. </template>
  156. </el-table-column>
  157. <el-table-column
  158. fixed="right"
  159. header-align="center"
  160. align="center"
  161. width="100"
  162. label="操作">
  163. <template slot-scope="scope">
  164. <!-- <a :href="'http://192.168.1.130:80/file/'+scope.row.url" :download="scope.row.fileName">下载</a>-->
  165. <a @click="downloadFile(scope.row)" >下载</a>
  166. <a type="text" size="small" @click="deleteFile(scope.row)">删除</a>
  167. </template>
  168. </el-table-column>
  169. </el-table>
  170. </el-tab-pane>
  171. <el-tab-pane label="审批信息" name="tab3"></el-tab-pane>
  172. <el-tab-pane label="处理信息" name="tab4">
  173. <el-form :inline="true" label-position="top" style="margin-top: 0px">
  174. <el-button type="primary" :disabled="!(currentRow.statusCode==='50'||currentRow.statusCode==='60')" @click="openMassageModel()">申请信息录入</el-button>
  175. </el-form>
  176. <el-form label-position="top" :model="currentRow" >
  177. <el-row :gutter="15">
  178. <el-col :span="6">
  179. <el-form-item label="IFS PR编号" >
  180. <el-input v-model="currentRow.prNo" readonly></el-input>
  181. </el-form-item>
  182. </el-col>
  183. <el-col :span="18">
  184. <el-form-item label="备注" >
  185. <el-input v-model="currentRow.remark1" readonly></el-input>
  186. </el-form-item>
  187. </el-col>
  188. </el-row>
  189. <el-row :gutter="15" style="margin-top: 20px">
  190. <el-col :span="6">
  191. <el-form-item label="采购订单号" >
  192. <el-input v-model="currentRow.poNo" readonly ></el-input>
  193. </el-form-item>
  194. </el-col>
  195. <el-col :span="6">
  196. <el-form-item label="厂商名称" >
  197. <el-input v-model="currentRow.supplierName" readonly></el-input>
  198. </el-form-item>
  199. </el-col>
  200. <el-col :span="6">
  201. <el-form-item label="总成本(元)" >
  202. <el-input v-model="currentRow.allCost" readonly></el-input>
  203. </el-form-item>
  204. </el-col>
  205. </el-row>
  206. <el-row :gutter="15" style="margin-top: 0px">
  207. <el-col :span="24">
  208. <el-form-item label="备注" >
  209. <el-input v-model="currentRow.remark2" readonly></el-input>
  210. </el-form-item>
  211. </el-col>
  212. </el-row>
  213. </el-form>
  214. </el-tab-pane>
  215. </el-tabs>
  216. <el-dialog
  217. width="800px" v-drag
  218. :title="'处理信息'"
  219. :close-on-click-modal="false"
  220. :visible.sync="modelFlag">
  221. <el-form label-position="top" >
  222. <el-row :gutter="15" v-if="this.currentRow.statusCode==='50'">
  223. <el-col :span="6">
  224. <el-form-item label="IFS PR编号" >
  225. <el-input v-model="modelData.prNo" readonly></el-input>
  226. </el-form-item>
  227. </el-col>
  228. <el-col :span="18">
  229. <el-form-item label="备注" >
  230. <el-input v-model="modelData.remark1" readonly></el-input>
  231. </el-form-item>
  232. </el-col>
  233. </el-row>
  234. <el-row :gutter="15" style="margin-top: 20px" v-if="this.currentRow.statusCode==='60'">
  235. <el-col :span="6">
  236. <el-form-item label="采购订单号" >
  237. <el-input v-model="modelData.poNo" readonly ></el-input>
  238. </el-form-item>
  239. </el-col>
  240. <el-col :span="6">
  241. <el-form-item label="厂商名称" >
  242. <el-input v-model="modelData.supplierName" readonly></el-input>
  243. </el-form-item>
  244. </el-col>
  245. <el-col :span="6">
  246. <el-form-item label="总成本(元)" >
  247. <el-input v-model="modelData.allCost" type="number" readonly></el-input>
  248. </el-form-item>
  249. </el-col>
  250. </el-row>
  251. <el-row :gutter="15" style="margin-top: 0px">
  252. <el-col :span="24">
  253. <el-form-item label="备注" >
  254. <el-input v-model="modelData.remark2" readonly></el-input>
  255. </el-form-item>
  256. </el-col>
  257. </el-row>
  258. </el-form>
  259. <span slot="footer" class="dialog-footer">
  260. <el-button type="primary" @click="saveHeaderMessage()">{{'保存'}}</el-button>
  261. <el-button type="primary" @click="modelFlag = false">{{'取消'}}</el-button>
  262. </span>
  263. </el-dialog>
  264. <!-- 上传文件的modal -->
  265. <projectUploadFile ref="projectUploadFile" @refreshPageTables="getFileContentData()" v-drag></projectUploadFile>
  266. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  267. </div>
  268. </template>
  269. <script>
  270. import {
  271. customerInformationSearch, // 客户信息列表查询`
  272. } from '@/api/customer/customerInformation.js'
  273. import projectUploadFile from "./com_tool_upload_file";/*上传文件的組件*/
  274. import Chooselist from '@/views/modules/common/Chooselist'
  275. import {searchToolApplyHeader,
  276. searchToolApplyDetail,
  277. comfirmToolApply,
  278. cancelToolApply,
  279. saveHeaderMessage,
  280. } from "@/api/project/toolingInfo.js"
  281. import {
  282. deleteProjectFile,
  283. getFileContentList,
  284. downLoadProjectFile,
  285. getProjectUserRole,
  286. } from "@/api/project/project.js"
  287. /*組件*/
  288. export default {
  289. components: {
  290. Chooselist,
  291. projectUploadFile,
  292. },
  293. name: "null",
  294. data() {
  295. return {
  296. fileContentList: [],
  297. activeName: 'detail',
  298. searchData:{
  299. page: 1,
  300. limit: 100,
  301. site:this.$store.state.user.site,
  302. applyId:'',
  303. startDate:'',
  304. endDate:'',
  305. },
  306. modelData:{
  307. site:'',
  308. applyNo:'',
  309. prNo:'',
  310. remark1:'',
  311. poNo:'',
  312. supplierName:'',
  313. allCost:'',
  314. remark2:'',
  315. },
  316. modelFlag:false,
  317. currentRow:{},
  318. height: 200,
  319. dataList1:[],
  320. detailList:[],
  321. dataListLoading: false,
  322. // 导出 start
  323. exportData: [],
  324. exportName: "项目清单" + this.dayjs().format('YYYYMMDDHHmmss'),
  325. exportHeader: ["项目清单"],
  326. exportFooter: [],
  327. exportList:[],
  328. // 导出 start
  329. exportData2: [],
  330. exportName2: "项目客户联系人" + this.dayjs().format('YYYYMMDDHHmmss'),
  331. exportHeader2: ["项目客户联系人"],
  332. exportFooter2: [],
  333. exportList2:[],
  334. tagNo:'',
  335. tagNo2:'',
  336. pageIndex: 1,
  337. pageSize: 100,
  338. totalPage: 0,
  339. // 导出 end
  340. columnList1: [
  341. {
  342. userId: this.$store.state.user.name,
  343. functionId: 106002,
  344. serialNumber: '106002Table1Site',
  345. tableId: "106002Table1",
  346. tableName: "刀具申请主表",
  347. columnProp: "site",
  348. headerAlign: "center",
  349. align: "left",
  350. columnLabel: "工厂编码",
  351. columnHidden: false,
  352. columnImage: false,
  353. columnSortable: false,
  354. sortLv: 0,
  355. status: true,
  356. fixed: '',
  357. columnWidth: 70
  358. },
  359. {
  360. userId: this.$store.state.user.name,
  361. functionId: 106002,
  362. serialNumber: '106002Table1ApplyNo',
  363. tableId: "106002Table1",
  364. tableName: "刀具申请主表",
  365. columnProp: "applyNo",
  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. {
  378. userId: this.$store.state.user.name,
  379. functionId: 106002,
  380. serialNumber: '106002Table1ApplyBy',
  381. tableId: "106002Table1",
  382. tableName: "刀具申请主表",
  383. columnProp: "applyBy",
  384. headerAlign: "center",
  385. align: "left",
  386. columnLabel: "申请人",
  387. columnHidden: false,
  388. columnImage: false,
  389. columnSortable: false,
  390. sortLv: 0,
  391. status: true,
  392. fixed: '',
  393. columnWidth: 60
  394. },
  395. {
  396. userId: this.$store.state.user.name,
  397. functionId: 106002,
  398. serialNumber: '106002Table1Status',
  399. tableId: "106002Table1",
  400. tableName: "刀具申请主表",
  401. columnProp: "status",
  402. headerAlign: "center",
  403. align: "left",
  404. columnLabel: "状态",
  405. columnHidden: false,
  406. columnImage: false,
  407. columnSortable: false,
  408. sortLv: 0,
  409. status: true,
  410. fixed: '',
  411. columnWidth: 60
  412. },
  413. {
  414. userId: this.$store.state.user.name,
  415. functionId: 106002,
  416. serialNumber: '106002Table1ApplyDate',
  417. tableId: "106002Table1",
  418. tableName: "刀具申请主表",
  419. columnProp: "applyDate",
  420. headerAlign: "center",
  421. align: "left",
  422. columnLabel: "申请日期",
  423. columnHidden: false,
  424. columnImage: false,
  425. columnSortable: false,
  426. sortLv: 0,
  427. status: true,
  428. fixed: '',
  429. columnWidth: 80
  430. },
  431. {
  432. userId: this.$store.state.user.name,
  433. functionId: 106002,
  434. serialNumber: '106002Table1ApplyReason',
  435. tableId: "106002Table1",
  436. tableName: "刀具申请主表",
  437. columnProp: "applyReason",
  438. headerAlign: "center",
  439. align: "left",
  440. columnLabel: "申请原因",
  441. columnHidden: false,
  442. columnImage: false,
  443. columnSortable: false,
  444. sortLv: 0,
  445. status: true,
  446. fixed: '',
  447. columnWidth: 150
  448. },
  449. {
  450. userId: this.$store.state.user.name,
  451. functionId: 106002,
  452. serialNumber: '106002Table1Remark',
  453. tableId: "106002Table1",
  454. tableName: "刀具申请主表",
  455. columnProp: "remark",
  456. headerAlign: "center",
  457. align: "left",
  458. columnLabel: "申请备注",
  459. columnHidden: false,
  460. columnImage: false,
  461. columnSortable: false,
  462. sortLv: 0,
  463. status: true,
  464. fixed: '',
  465. columnWidth: 200
  466. },
  467. ],
  468. columnList2: [
  469. {
  470. userId: this.$store.state.user.name,
  471. functionId: 106002,
  472. serialNumber: '106002Table2SeqNo',
  473. tableId: '106002Table2',
  474. tableName: '工具申请明细',
  475. columnProp: 'seqNo',
  476. headerAlign: 'center',
  477. align: 'center',
  478. columnLabel: '序号',
  479. columnHidden: false,
  480. columnImage: false,
  481. columnSortable: false,
  482. sortLv: 0,
  483. status: true,
  484. fixed: '',
  485. columnWidth: 40
  486. },
  487. {
  488. userId: this.$store.state.user.name,
  489. functionId: 106002,
  490. serialNumber: '106002Table2QuotationNo',
  491. tableId: '106002Table2',
  492. tableName: '工具申请明细',
  493. columnProp: 'quotationNo',
  494. headerAlign: 'center',
  495. align: 'center',
  496. columnLabel: '所属报价单',
  497. columnHidden: false,
  498. columnImage: false,
  499. columnSortable: false,
  500. sortLv: 0,
  501. status: true,
  502. fixed: '',
  503. columnWidth: 70
  504. },
  505. {
  506. userId: this.$store.state.user.name,
  507. functionId: 106002,
  508. serialNumber: '106002Table2ToolNo',
  509. tableId: '106002Table2',
  510. tableName: '工具申请明细',
  511. columnProp: 'toolNo',
  512. headerAlign: 'center',
  513. align: 'center',
  514. columnLabel: '工具编码',
  515. columnHidden: false,
  516. columnImage: false,
  517. columnSortable: false,
  518. sortLv: 0,
  519. status: true,
  520. fixed: '',
  521. columnWidth: 70
  522. },
  523. {
  524. userId: this.$store.state.user.name,
  525. functionId: 106002,
  526. serialNumber: '106002Table2ToolDescription',
  527. tableId: '106002Table2',
  528. tableName: '工具申请明细',
  529. columnProp: 'toolDescription',
  530. headerAlign: 'center',
  531. align: 'center',
  532. columnLabel: '工具描述',
  533. columnHidden: false,
  534. columnImage: false,
  535. columnSortable: false,
  536. sortLv: 0,
  537. status: true,
  538. fixed: '',
  539. columnWidth: 120
  540. },
  541. {
  542. userId: this.$store.state.user.name,
  543. functionId: 106002,
  544. serialNumber: '106002Table2ToolSpec',
  545. tableId: '106002Table2',
  546. tableName: '工具申请明细',
  547. columnProp: 'toolSpec',
  548. headerAlign: 'center',
  549. align: 'center',
  550. columnLabel: '工具规格',
  551. columnHidden: false,
  552. columnImage: false,
  553. columnSortable: false,
  554. sortLv: 0,
  555. status: true,
  556. fixed: '',
  557. columnWidth: 120
  558. },
  559. {
  560. userId: this.$store.state.user.name,
  561. functionId: 106002,
  562. serialNumber: '106002Table2ApplyQty',
  563. tableId: '106002Table2',
  564. tableName: '工具申请明细',
  565. columnProp: 'applyQty',
  566. headerAlign: 'center',
  567. align: 'center',
  568. columnLabel: '申请数量',
  569. columnHidden: false,
  570. columnImage: false,
  571. columnSortable: false,
  572. sortLv: 0,
  573. status: true,
  574. fixed: '',
  575. columnWidth: 60
  576. },
  577. {
  578. userId: this.$store.state.user.name,
  579. functionId: 106002,
  580. serialNumber: '106002Table2ExpectedServiceLife',
  581. tableId: '106002Table2',
  582. tableName: '工具申请明细',
  583. columnProp: 'expectedServiceLife',
  584. headerAlign: 'center',
  585. align: 'center',
  586. columnLabel: '预计寿命',
  587. columnHidden: false,
  588. columnImage: false,
  589. columnSortable: false,
  590. sortLv: 0,
  591. status: true,
  592. fixed: '',
  593. columnWidth: 50
  594. },
  595. {
  596. userId: this.$store.state.user.name,
  597. functionId: 106002,
  598. serialNumber: '106002Table2UnitCost',
  599. tableId: '106002Table2',
  600. tableName: '工具申请明细',
  601. columnProp: 'unitCost',
  602. headerAlign: 'center',
  603. align: 'center',
  604. columnLabel: '单位成本',
  605. columnHidden: false,
  606. columnImage: false,
  607. columnSortable: false,
  608. sortLv: 0,
  609. status: true,
  610. fixed: '',
  611. columnWidth: 60
  612. },
  613. {
  614. userId: this.$store.state.user.name,
  615. functionId: 106002,
  616. serialNumber: '106002Table2quotationUnitCost',
  617. tableId: '106002Table2',
  618. tableName: '工具申请明细',
  619. columnProp: 'quotationUnitCost',
  620. headerAlign: 'center',
  621. align: 'center',
  622. columnLabel: '单位报价成本',
  623. columnHidden: false,
  624. columnImage: false,
  625. columnSortable: false,
  626. sortLv: 0,
  627. status: true,
  628. fixed: '',
  629. columnWidth: 60
  630. },
  631. {
  632. userId: this.$store.state.user.name,
  633. functionId: 106002,
  634. serialNumber: '106002Table2Remark',
  635. tableId: '106002Table2',
  636. tableName: '工具申请明细',
  637. columnProp: 'remark',
  638. headerAlign: 'center',
  639. align: 'center',
  640. columnLabel: '备注',
  641. columnHidden: false,
  642. columnImage: false,
  643. columnSortable: false,
  644. sortLv: 0,
  645. status: true,
  646. fixed: '',
  647. columnWidth: 200
  648. },
  649. ],
  650. columnFileContentArray: [
  651. {
  652. columnProp: 'fileName',
  653. headeralign: 'left',
  654. align: 'left',
  655. columnLabel: '文件名称',
  656. columnHidden: false,
  657. columnImage: false,
  658. columnSortable: false,
  659. sortLv: 0,
  660. status: true,
  661. fixed: false
  662. // }, {
  663. // columnProp: 'createdBy',
  664. // headeralign: 'left',
  665. // align: 'left',
  666. // columnLabel: '上传人',
  667. // columnHidden: false,
  668. // columnImage: false,
  669. // columnSortable: true,
  670. // sortLv: 0,
  671. // status: true,
  672. // fixed: false
  673. }, {
  674. columnProp: 'createDate',
  675. headeralign: 'left',
  676. align: 'left',
  677. columnLabel: '上传时间',
  678. columnHidden: false,
  679. columnImage: false,
  680. columnSortable: true,
  681. sortLv: 0,
  682. status: true,
  683. fixed: false
  684. }, {
  685. columnProp: 'orderRef3',
  686. headeralign: 'left',
  687. align: 'left',
  688. columnLabel: '类型',
  689. columnHidden: false,
  690. columnImage: false,
  691. columnSortable: true,
  692. sortLv: 0,
  693. status: true,
  694. fixed: false
  695. },
  696. ],
  697. }
  698. },
  699. watch: {
  700. // columnList1: {
  701. // deep: true,
  702. // handler: function (newV, oldV) {
  703. // debugger
  704. //
  705. // }
  706. // }
  707. },
  708. mounted() {
  709. this.$nextTick(() => {
  710. this.height = window.innerHeight - 520;
  711. })
  712. },
  713. methods: {
  714. // 获取基础数据列表S
  715. getBaseList (val, type) {
  716. this.tagNo = val
  717. this.tagNo2 = type
  718. this.$nextTick(() => {
  719. let strVal = ''
  720. if (val === 1010) {
  721. if(type==1) {
  722. strVal = this.searchData.projectType
  723. }
  724. }
  725. this.$refs.baseList.init(val, strVal)
  726. })
  727. },
  728. /* 列表方法的回调 */
  729. getBaseData (val) {
  730. if (this.tagNo === 1010) {
  731. if(this.tagNo2==1) {
  732. this.searchData.projectType = val.Base_desc
  733. }
  734. }
  735. },
  736. //导出excel
  737. async createExportData() {
  738. this.searchData.limit = -1
  739. this.searchData.page = 1
  740. await searchToolApplyHeader(this.searchData).then(({data}) => {
  741. this.exportList= data.page.list;
  742. })
  743. return this.exportList;
  744. },
  745. startDownload() {
  746. // this.exportData = this.dataList
  747. },
  748. finishDownload() {
  749. },
  750. fields() {
  751. let json = "{"
  752. this.columnList1.forEach((item, index) => {
  753. if (index == this.columnList1.length - 1) {
  754. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  755. } else {
  756. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  757. }
  758. })
  759. json += "}"
  760. let s = eval("(" + json + ")")
  761. return s
  762. },
  763. //导出excel
  764. async createExportData2() {
  765. return this.contactList;
  766. },
  767. startDownload2() {
  768. // this.exportData = this.dataList
  769. },
  770. finishDownload2() {
  771. },
  772. fields2() {
  773. let json = "{"
  774. this.columnList2.forEach((item, index) => {
  775. if (index == this.columnList2.length - 1) {
  776. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  777. } else {
  778. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  779. }
  780. })
  781. json += "}"
  782. let s = eval("(" + json + ")")
  783. return s
  784. },
  785. // 导出 end
  786. // 获取数据列表
  787. search () {
  788. this.searchData.limit = this.pageSize
  789. this.searchData.page = this.pageIndex
  790. searchToolApplyHeader(this.searchData).then(({data}) => {
  791. if (data.code == 0) {
  792. this.dataList1 = data.page.list
  793. this.pageIndex = data.page.currPage
  794. this.pageSize = data.page.pageSize
  795. this.totalPage = data.page.totalCount
  796. if(this.dataList1.length>0){
  797. this.$refs.mainTable.setCurrentRow(this.dataList1[0]);
  798. this.currentRow = JSON.parse( JSON.stringify(this.dataList1[0]));
  799. }else {
  800. this.currentRow ={}
  801. }
  802. this.refreshCurrentTabTable ()
  803. }
  804. this.dataListLoading = false
  805. })
  806. },
  807. //单击切换订单
  808. changeData(row) {
  809. this.currentRow = JSON.parse(JSON.stringify(row));
  810. this.refreshCurrentTabTable ();
  811. },
  812. addUploadFileModal(){
  813. let currentData = {
  814. site: this.currentRow.site,
  815. createBy: this.$store.state.user.name,
  816. projectId: this.currentRow.applyNo,
  817. projectName: '',
  818. remark: '',
  819. };
  820. //打开组件 去做新增业务
  821. this.$nextTick(() => {
  822. this.$refs.projectUploadFile.init(currentData);
  823. })
  824. },
  825. deleteFile(row){
  826. this.$confirm('确定要删除此文件?', '提示', {
  827. confirmButtonText: '确定',
  828. cancelButtonText: '取消',
  829. type: 'warning'
  830. }).then(() => {
  831. deleteProjectFile(row).then(({data}) => {
  832. if (data && data.code == 0) {
  833. this.getFileContentData();
  834. this.$message({
  835. message: '操作成功',
  836. type: 'success',
  837. duration: 1500,
  838. onClose: () => {
  839. }
  840. })
  841. } else {
  842. this.$alert(data.msg, '错误', {
  843. confirmButtonText: '确定'
  844. })
  845. }
  846. })
  847. }).catch(() => {
  848. })
  849. },
  850. tabClick (tab, event) {
  851. // 刷新列表数据
  852. this.refreshCurrentTabTable()
  853. },
  854. // 刷新页签的table数据
  855. refreshCurrentTabTable () {
  856. if (this.activeName == 'detail') {
  857. this.searchToolApplyDetail();
  858. }
  859. if (this.activeName == 'down') {
  860. this.getFileContentData();
  861. }
  862. },
  863. searchToolApplyDetail(){
  864. searchToolApplyDetail(this.currentRow).then(({data}) => {
  865. if (data.code == 0) {
  866. this.detailList = data.rows
  867. }
  868. })
  869. },
  870. comfirmApply(row){
  871. this.$confirm(`确定下达这个申请`, '提示', {
  872. confirmButtonText: '确定',
  873. cancelButtonText: '取消',
  874. type: 'warning'
  875. }).then(() => {
  876. comfirmToolApply(row).then(({data}) => {
  877. if (data && data.code === 0) {
  878. this. search ();
  879. this.$message({
  880. message: '操作成功',
  881. type: 'success',
  882. duration: 1500,
  883. onClose: () => {}
  884. })
  885. } else {
  886. this.$alert(data.msg, '错误', {
  887. confirmButtonText: '确定'
  888. })
  889. }
  890. })
  891. })
  892. },
  893. cancelApply(row){
  894. this.$confirm(`确定取消这个申请`, '提示', {
  895. confirmButtonText: '确定',
  896. cancelButtonText: '取消',
  897. type: 'warning'
  898. }).then(() => {
  899. cancelToolApply(row).then(({data}) => {
  900. if (data && data.code === 0) {
  901. this.search();
  902. this.$message({
  903. message: '操作成功',
  904. type: 'success',
  905. duration: 1500,
  906. onClose: () => {
  907. }
  908. })
  909. } else {
  910. this.$alert(data.msg, '错误', {
  911. confirmButtonText: '确定'
  912. })
  913. }
  914. })
  915. })
  916. },
  917. //刷新派设备文档的列表
  918. getFileContentData() {
  919. let currentData = {orderRef2: this.currentRow.applyNo};
  920. getFileContentList(currentData).then(({data}) => {
  921. //区分请求成功和失败的状况
  922. if (data && data.code == 200) {
  923. this.fileContentList = data.rows;
  924. } else {
  925. this.fileContentList = [];
  926. }
  927. });
  928. },
  929. // 下载
  930. downloadFile(row){
  931. // let inData={
  932. // site:this.currentRow.site,
  933. // username:this.$store.state.user.name,
  934. // projectId:this.currentRow.projectId
  935. // }
  936. // getProjectUserRole(inData).then(({data}) => {
  937. // if(this.$store.state.user.name=='admin'||data.row.downFlag=='Y') {
  938. downLoadProjectFile(row)
  939. .then(({data}) => {
  940. // 不限制文件下载类型
  941. const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'})
  942. // 下载文件名称
  943. const fileName = row.fileName
  944. // a标签下载
  945. const linkNode = document.createElement('a')
  946. linkNode.download = fileName // a标签的download属性规定下载文件的名称
  947. linkNode.style.display = 'none'
  948. linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL
  949. console.log(linkNode)
  950. // if(val == 'Y'){
  951. // this.pdfVisible = true
  952. // this.pdfUrl = linkNode.href
  953. // }else {
  954. document.body.appendChild(linkNode)
  955. linkNode.click() // 模拟在按钮上的一次鼠标单击
  956. URL.revokeObjectURL(linkNode.href) // 释放URL 对象
  957. document.body.removeChild(linkNode)
  958. // }
  959. })
  960. // }else {
  961. // this.$alert('没有权限下载这个项目的文件!', '错误', {
  962. // confirmButtonText: '确定'
  963. // })
  964. // }
  965. // })
  966. },
  967. // 每页数
  968. sizeChangeHandle (val) {
  969. this.pageSize = val
  970. this.pageIndex = 1
  971. this.search()
  972. },
  973. // 当前页
  974. currentChangeHandle (val) {
  975. this.pageIndex = val
  976. this.search()
  977. },
  978. openMassageModel(){
  979. if(Object.keys(this.currentRow).length === 0){
  980. this.$alert('未选择记录!', '错误', {
  981. confirmButtonText: '确定'
  982. })
  983. return false;
  984. }
  985. this.modalData={
  986. site:this.currentRow.site,
  987. applyNo:this.currentRow.applyNo,
  988. prNo:this.currentRow.prNo,
  989. remark1:this.currentRow.remark1,
  990. poNo:this.currentRow.poNo,
  991. supplierName:this.currentRow.supplierName,
  992. allCost:this.currentRow.allCost,
  993. remark2:this.currentRow.remark2,
  994. }
  995. this.modelFlag=true
  996. },
  997. saveHeaderMessage(){
  998. this.$confirm('确定是否保存','提示',{
  999. confirmButtonText:'确定',
  1000. cancelButtonText:'取消',
  1001. type:'warning'
  1002. }).then(()=>{
  1003. saveHeaderMessage(this.modalData).then(({data}) => {
  1004. if (data && data.code == 0) {
  1005. this.modelFlag=false;
  1006. this.currentRow.prNo=this.modalData.prNo
  1007. this.currentRow.remark1=this.modalData.remark1
  1008. this.currentRow.poNo=this.modalData.poNo
  1009. this.currentRow.supplierName=this.modalData.supplierName
  1010. this.currentRow.allCost=this.modalData.allCost
  1011. this.currentRow.remark2=this.modalData.remark2
  1012. this.$message({
  1013. message: '操作成功',
  1014. type: 'success',
  1015. duration: 1500,
  1016. onClose: () => {
  1017. }
  1018. })
  1019. } else {
  1020. this.$alert(data.msg, '错误', {
  1021. confirmButtonText: '确定'
  1022. })
  1023. }
  1024. })
  1025. })
  1026. },
  1027. },
  1028. activated() {
  1029. },
  1030. }
  1031. </script>
  1032. <style >
  1033. .el-transfer-panel {
  1034. border: 2px solid #17b3a3;
  1035. border-radius: 4px;
  1036. overflow: hidden;
  1037. background: #fff;
  1038. display: inline-block;
  1039. vertical-align: middle;
  1040. width: 200px;
  1041. max-height: 100%;
  1042. -webkit-box-sizing: border-box;
  1043. box-sizing: border-box;
  1044. position: relative;
  1045. }
  1046. .el-transfer-panel .el-transfer-panel__header {
  1047. height: 40px;
  1048. line-height: 40px;
  1049. background: #17b3a3;
  1050. margin: 0;
  1051. padding-left: 15px;
  1052. border-bottom: 1px solid #17b3a3;
  1053. -webkit-box-sizing: border-box;
  1054. box-sizing: border-box;
  1055. color: #000;
  1056. }
  1057. .el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label {
  1058. font-size: 14px;
  1059. color: #303133;
  1060. font-weight: 400;
  1061. }
  1062. </style>