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.

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