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.

1099 lines
35 KiB

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