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.

1131 lines
37 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
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 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year 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-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 {searchProjectToolApplyHeader,
  277. searchProjectToolApplyDetail,
  278. comfirmProjectToolApply,
  279. cancelProjectToolApply,
  280. saveProjectHeaderMessage,
  281. } from "@/api/tool/toolApply.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: 'orderRef1',
  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: 'toolId',
  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: 'toolDesc',
  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: '106002Table2ApplyQty',
  547. tableId: '106002Table2',
  548. tableName: '工具申请明细',
  549. columnProp: 'applyQty',
  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: 60
  560. },
  561. {
  562. userId: this.$store.state.user.name,
  563. functionId: 106002,
  564. serialNumber: '106002Table2UnitCost',
  565. tableId: '106002Table2',
  566. tableName: '工具申请明细',
  567. columnProp: 'standardCost',
  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: '106002Table2Remark',
  583. tableId: '106002Table2',
  584. tableName: '工具申请明细',
  585. columnProp: 'remark',
  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: 200
  596. },
  597. {
  598. userId: this.$store.state.user.name,
  599. functionId: 106002,
  600. serialNumber: '106002Table2QuotationNo',
  601. tableId: '106002Table2',
  602. tableName: '工具申请明细',
  603. columnProp: 'orderRef2',
  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: 70
  614. }, {
  615. userId: this.$store.state.user.name,
  616. functionId: 106002,
  617. serialNumber: '106002Table2QuotationNo',
  618. tableId: '106002Table2',
  619. tableName: '工具申请明细',
  620. columnProp: 'orderRef3',
  621. headerAlign: 'center',
  622. align: 'center',
  623. columnLabel: '工艺路线版本',
  624. columnHidden: false,
  625. columnImage: false,
  626. columnSortable: false,
  627. sortLv: 0,
  628. status: true,
  629. fixed: '',
  630. columnWidth: 70
  631. },
  632. {
  633. userId: this.$store.state.user.name,
  634. functionId: 106002,
  635. serialNumber: '106002Table2QuotationNo',
  636. tableId: '106002Table2',
  637. tableName: '工具申请明细',
  638. columnProp: 'orderRef5',
  639. headerAlign: 'center',
  640. align: 'center',
  641. columnLabel: '替代编码',
  642. columnHidden: false,
  643. columnImage: false,
  644. columnSortable: false,
  645. sortLv: 0,
  646. status: true,
  647. fixed: '',
  648. columnWidth: 70
  649. },{
  650. userId: this.$store.state.user.name,
  651. functionId: 106002,
  652. serialNumber: '106002Table2QuotationNo',
  653. tableId: '106002Table2',
  654. tableName: '工具申请明细',
  655. columnProp: 'operationNo',
  656. headerAlign: 'center',
  657. align: 'center',
  658. columnLabel: '工序号',
  659. columnHidden: false,
  660. columnImage: false,
  661. columnSortable: false,
  662. sortLv: 0,
  663. status: true,
  664. fixed: '',
  665. columnWidth: 70
  666. },{
  667. userId: this.$store.state.user.name,
  668. functionId: 106002,
  669. serialNumber: '106002Table2QuotationNo',
  670. tableId: '106002Table2',
  671. tableName: '工具申请明细',
  672. columnProp: 'operationName',
  673. headerAlign: 'center',
  674. align: 'center',
  675. columnLabel: '工序',
  676. columnHidden: false,
  677. columnImage: false,
  678. columnSortable: false,
  679. sortLv: 0,
  680. status: true,
  681. fixed: '',
  682. columnWidth: 70
  683. },
  684. ],
  685. columnFileContentArray: [
  686. {
  687. columnProp: 'fileName',
  688. headeralign: 'left',
  689. align: 'left',
  690. columnLabel: '文件名称',
  691. columnHidden: false,
  692. columnImage: false,
  693. columnSortable: false,
  694. sortLv: 0,
  695. status: true,
  696. fixed: false
  697. // }, {
  698. // columnProp: 'createdBy',
  699. // headeralign: 'left',
  700. // align: 'left',
  701. // columnLabel: '上传人',
  702. // columnHidden: false,
  703. // columnImage: false,
  704. // columnSortable: true,
  705. // sortLv: 0,
  706. // status: true,
  707. // fixed: false
  708. }, {
  709. columnProp: 'createDate',
  710. headeralign: 'left',
  711. align: 'left',
  712. columnLabel: '上传时间',
  713. columnHidden: false,
  714. columnImage: false,
  715. columnSortable: true,
  716. sortLv: 0,
  717. status: true,
  718. fixed: false
  719. }, {
  720. columnProp: 'orderRef3',
  721. headeralign: 'left',
  722. align: 'left',
  723. columnLabel: '类型',
  724. columnHidden: false,
  725. columnImage: false,
  726. columnSortable: true,
  727. sortLv: 0,
  728. status: true,
  729. fixed: false
  730. },
  731. ],
  732. }
  733. },
  734. watch: {
  735. // columnList1: {
  736. // deep: true,
  737. // handler: function (newV, oldV) {
  738. // debugger
  739. //
  740. // }
  741. // }
  742. },
  743. mounted() {
  744. this.$nextTick(() => {
  745. this.height = window.innerHeight - 520;
  746. })
  747. },
  748. methods: {
  749. // 获取基础数据列表S
  750. getBaseList (val, type) {
  751. this.tagNo = val
  752. this.tagNo2 = type
  753. this.$nextTick(() => {
  754. let strVal = ''
  755. if (val === 1010) {
  756. if(type==1) {
  757. strVal = this.searchData.projectType
  758. }
  759. }
  760. this.$refs.baseList.init(val, strVal)
  761. })
  762. },
  763. /* 列表方法的回调 */
  764. getBaseData (val) {
  765. if (this.tagNo === 1010) {
  766. if(this.tagNo2==1) {
  767. this.searchData.projectType = val.Base_desc
  768. }
  769. }
  770. },
  771. //导出excel
  772. async createExportData() {
  773. this.searchData.limit = -1
  774. this.searchData.page = 1
  775. await searchToolApplyHeader(this.searchData).then(({data}) => {
  776. this.exportList= data.page.list;
  777. })
  778. return this.exportList;
  779. },
  780. startDownload() {
  781. // this.exportData = this.dataList
  782. },
  783. finishDownload() {
  784. },
  785. fields() {
  786. let json = "{"
  787. this.columnList1.forEach((item, index) => {
  788. if (index == this.columnList1.length - 1) {
  789. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  790. } else {
  791. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  792. }
  793. })
  794. json += "}"
  795. let s = eval("(" + json + ")")
  796. return s
  797. },
  798. //导出excel
  799. async createExportData2() {
  800. return this.contactList;
  801. },
  802. startDownload2() {
  803. // this.exportData = this.dataList
  804. },
  805. finishDownload2() {
  806. },
  807. fields2() {
  808. let json = "{"
  809. this.columnList2.forEach((item, index) => {
  810. if (index == this.columnList2.length - 1) {
  811. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  812. } else {
  813. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  814. }
  815. })
  816. json += "}"
  817. let s = eval("(" + json + ")")
  818. return s
  819. },
  820. // 导出 end
  821. // 获取数据列表
  822. search () {
  823. this.searchData.limit = this.pageSize
  824. this.searchData.page = this.pageIndex
  825. searchProjectToolApplyHeader(this.searchData).then(({data}) => {
  826. if (data.code == 0) {
  827. this.dataList1 = data.page.list
  828. this.pageIndex = data.page.currPage
  829. this.pageSize = data.page.pageSize
  830. this.totalPage = data.page.totalCount
  831. if(this.dataList1.length>0){
  832. this.$refs.mainTable.setCurrentRow(this.dataList1[0]);
  833. this.currentRow = JSON.parse( JSON.stringify(this.dataList1[0]));
  834. }else {
  835. this.currentRow ={}
  836. }
  837. this.refreshCurrentTabTable ()
  838. }
  839. this.dataListLoading = false
  840. })
  841. },
  842. //单击切换订单
  843. changeData(row) {
  844. this.currentRow = JSON.parse(JSON.stringify(row));
  845. this.currentRow2 = row;
  846. this.refreshCurrentTabTable ();
  847. },
  848. addUploadFileModal(){
  849. let currentData = {
  850. site: this.currentRow.site,
  851. createBy: this.$store.state.user.name,
  852. projectId: this.currentRow.applyNo,
  853. projectName: '',
  854. remark: '',
  855. };
  856. //打开组件 去做新增业务
  857. this.$nextTick(() => {
  858. this.$refs.projectUploadFile.init(currentData);
  859. })
  860. },
  861. deleteFile(row){
  862. this.$confirm('确定要删除此文件?', '提示', {
  863. confirmButtonText: '确定',
  864. cancelButtonText: '取消',
  865. type: 'warning'
  866. }).then(() => {
  867. deleteProjectFile(row).then(({data}) => {
  868. if (data && data.code == 0) {
  869. this.getFileContentData();
  870. this.$message({
  871. message: '操作成功',
  872. type: 'success',
  873. duration: 1500,
  874. onClose: () => {
  875. }
  876. })
  877. } else {
  878. this.$alert(data.msg, '错误', {
  879. confirmButtonText: '确定'
  880. })
  881. }
  882. })
  883. }).catch(() => {
  884. })
  885. },
  886. tabClick (tab, event) {
  887. // 刷新列表数据
  888. this.refreshCurrentTabTable()
  889. },
  890. // 刷新页签的table数据
  891. refreshCurrentTabTable () {
  892. if (this.activeName == 'detail') {
  893. this.searchToolApplyDetail();
  894. }
  895. if (this.activeName == 'down') {
  896. this.getFileContentData();
  897. }
  898. },
  899. searchToolApplyDetail(){
  900. searchProjectToolApplyDetail(this.currentRow).then(({data}) => {
  901. if (data.code == 0) {
  902. this.detailList = data.rows
  903. }
  904. })
  905. },
  906. comfirmApply(row){
  907. this.$confirm(`确定下达这个申请`, '提示', {
  908. confirmButtonText: '确定',
  909. cancelButtonText: '取消',
  910. type: 'warning'
  911. }).then(() => {
  912. comfirmProjectToolApply(row).then(({data}) => {
  913. if (data && data.code === 0) {
  914. row.statusCode='10'
  915. row.status='下达'
  916. this.$message({
  917. message: '操作成功',
  918. type: 'success',
  919. duration: 1500,
  920. onClose: () => {}
  921. })
  922. } else {
  923. this.$alert(data.msg, '错误', {
  924. confirmButtonText: '确定'
  925. })
  926. }
  927. })
  928. })
  929. },
  930. cancelApply(row){
  931. this.$confirm(`确定取消这个申请`, '提示', {
  932. confirmButtonText: '确定',
  933. cancelButtonText: '取消',
  934. type: 'warning'
  935. }).then(() => {
  936. cancelProjectToolApply(row).then(({data}) => {
  937. if (data && data.code === 0) {
  938. this.search();
  939. this.$message({
  940. message: '操作成功',
  941. type: 'success',
  942. duration: 1500,
  943. onClose: () => {
  944. }
  945. })
  946. } else {
  947. this.$alert(data.msg, '错误', {
  948. confirmButtonText: '确定'
  949. })
  950. }
  951. })
  952. })
  953. },
  954. //刷新派设备文档的列表
  955. getFileContentData() {
  956. let currentData = {orderRef2: this.currentRow.applyNo};
  957. getFileContentList(currentData).then(({data}) => {
  958. //区分请求成功和失败的状况
  959. if (data && data.code == 200) {
  960. this.fileContentList = data.rows;
  961. } else {
  962. this.fileContentList = [];
  963. }
  964. });
  965. },
  966. // 下载
  967. downloadFile(row){
  968. // let inData={
  969. // site:this.currentRow.site,
  970. // username:this.$store.state.user.name,
  971. // projectId:this.currentRow.projectId
  972. // }
  973. // getProjectUserRole(inData).then(({data}) => {
  974. // if(this.$store.state.user.name=='admin'||data.row.downFlag=='Y') {
  975. downLoadProjectFile(row)
  976. .then(({data}) => {
  977. // 不限制文件下载类型
  978. const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'})
  979. // 下载文件名称
  980. const fileName = row.fileName
  981. // a标签下载
  982. const linkNode = document.createElement('a')
  983. linkNode.download = fileName // a标签的download属性规定下载文件的名称
  984. linkNode.style.display = 'none'
  985. linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL
  986. console.log(linkNode)
  987. // if(val == 'Y'){
  988. // this.pdfVisible = true
  989. // this.pdfUrl = linkNode.href
  990. // }else {
  991. document.body.appendChild(linkNode)
  992. linkNode.click() // 模拟在按钮上的一次鼠标单击
  993. URL.revokeObjectURL(linkNode.href) // 释放URL 对象
  994. document.body.removeChild(linkNode)
  995. // }
  996. })
  997. // }else {
  998. // this.$alert('没有权限下载这个项目的文件!', '错误', {
  999. // confirmButtonText: '确定'
  1000. // })
  1001. // }
  1002. // })
  1003. },
  1004. // 每页数
  1005. sizeChangeHandle (val) {
  1006. this.pageSize = val
  1007. this.pageIndex = 1
  1008. this.search()
  1009. },
  1010. // 当前页
  1011. currentChangeHandle (val) {
  1012. this.pageIndex = val
  1013. this.search()
  1014. },
  1015. openMassageModel(){
  1016. if(Object.keys(this.currentRow).length === 0){
  1017. this.$alert('未选择记录!', '错误', {
  1018. confirmButtonText: '确定'
  1019. })
  1020. return false;
  1021. }
  1022. this.modelData={
  1023. site:this.currentRow.site,
  1024. applyNo:this.currentRow.applyNo,
  1025. prNo:this.currentRow.prNo,
  1026. remark1:this.currentRow.remark1,
  1027. poNo:this.currentRow.poNo,
  1028. supplierName:this.currentRow.supplierName,
  1029. allCost:this.currentRow.allCost,
  1030. remark2:this.currentRow.remark2,
  1031. }
  1032. this.modelFlag=true
  1033. },
  1034. saveHeaderMessage(){
  1035. this.$confirm('确定是否保存','提示',{
  1036. confirmButtonText:'确定',
  1037. cancelButtonText:'取消',
  1038. type:'warning'
  1039. }).then(()=>{
  1040. saveProjectHeaderMessage(this.modelData).then(({data}) => {
  1041. if (data && data.code == 0) {
  1042. this.modelFlag=false;
  1043. this.currentRow.prNo=this.modelData.prNo
  1044. this.currentRow.remark1=this.modelData.remark1
  1045. this.currentRow.poNo=this.modelData.poNo
  1046. this.currentRow.supplierName=this.modelData.supplierName
  1047. this.currentRow.allCost=this.modelData.allCost
  1048. this.currentRow.remark2=this.modelData.remark2
  1049. this.currentRow2.prNo=this.modelData.prNo
  1050. this.currentRow2.remark1=this.modelData.remark1
  1051. this.currentRow2.poNo=this.modelData.poNo
  1052. this.currentRow2.supplierName=this.modelData.supplierName
  1053. this.currentRow2.allCost=this.modelData.allCost
  1054. this.currentRow2.remark2=this.modelData.remark2
  1055. this.$message({
  1056. message: '操作成功',
  1057. type: 'success',
  1058. duration: 1500,
  1059. onClose: () => {
  1060. }
  1061. })
  1062. } else {
  1063. this.$alert(data.msg, '错误', {
  1064. confirmButtonText: '确定'
  1065. })
  1066. }
  1067. })
  1068. })
  1069. },
  1070. },
  1071. activated() {
  1072. },
  1073. }
  1074. </script>
  1075. <style >
  1076. .el-transfer-panel {
  1077. border: 2px solid #17b3a3;
  1078. border-radius: 4px;
  1079. overflow: hidden;
  1080. background: #fff;
  1081. display: inline-block;
  1082. vertical-align: middle;
  1083. width: 200px;
  1084. max-height: 100%;
  1085. -webkit-box-sizing: border-box;
  1086. box-sizing: border-box;
  1087. position: relative;
  1088. }
  1089. .el-transfer-panel .el-transfer-panel__header {
  1090. height: 40px;
  1091. line-height: 40px;
  1092. background: #17b3a3;
  1093. margin: 0;
  1094. padding-left: 15px;
  1095. border-bottom: 1px solid #17b3a3;
  1096. -webkit-box-sizing: border-box;
  1097. box-sizing: border-box;
  1098. color: #000;
  1099. }
  1100. .el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label {
  1101. font-size: 14px;
  1102. color: #303133;
  1103. font-weight: 400;
  1104. }
  1105. </style>