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.

2089 lines
74 KiB

  1. <template>
  2. <div>
  3. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
  4. <el-form-item :label="'BU'">
  5. <el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 130px">
  6. <el-option
  7. v-for = "i in userBuList"
  8. :key = "i.buNo"
  9. :label = "i.buDesc"
  10. :value = "i.buDesc">
  11. </el-option>
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item :label="'项目编码'">
  15. <el-input v-model="searchData.projectNo" style="width: 120px"></el-input>
  16. </el-form-item>
  17. <el-form-item :label="'项目名称'">
  18. <el-input v-model="searchData.projectDesc" style="width: 120px"></el-input>
  19. </el-form-item>
  20. <el-form-item :label="'项目料号'">
  21. <el-input v-model="searchData.testPartNo" style="width: 120px"></el-input>
  22. </el-form-item>
  23. <el-form-item :label="'料号描述'">
  24. <el-input v-model="searchData.partDesc" style="width: 120px"></el-input>
  25. </el-form-item>
  26. <el-form-item :label="'客户编码'">
  27. <el-input v-model="searchData.customerNo" style="width: 120px"></el-input>
  28. </el-form-item>
  29. <el-form-item :label="'客户名称'">
  30. <el-input v-model="searchData.customerDesc" style="width: 120px"></el-input>
  31. </el-form-item>
  32. <el-form-item :label="'项目分类'">
  33. <el-select v-model="searchData.projectCategory" placeholder="请选择" clearable style="width: 130px">
  34. <el-option
  35. v-for = "i in projectCategoryList"
  36. :key = "i.projectCategory"
  37. :label = "i.projectCategory"
  38. :value = "i.projectCategory">
  39. </el-option>
  40. </el-select>
  41. </el-form-item>
  42. <el-form-item :label="'项目状态'">
  43. <el-select v-model="searchData.status" placeholder="请选择" clearable style="width: 130px">
  44. <el-option
  45. v-for = "i in statusList"
  46. :key = "i.status"
  47. :label = "i.status"
  48. :value = "i.status">
  49. </el-option>
  50. </el-select>
  51. </el-form-item>
  52. <el-form-item :label="'PM/Sales'">
  53. <el-select v-model="searchData.projectManager" placeholder="请选择" clearable style="width: 130px">
  54. <el-option
  55. v-for = "i in projectManagersList"
  56. :key = "i.projectManagerId"
  57. :label = "i.projectManagerName"
  58. :value = "i.projectManager">
  59. </el-option>
  60. </el-select>
  61. </el-form-item>
  62. <el-form-item :label="'PjM'">
  63. <el-select v-model="searchData.projectOwner" placeholder="请选择" clearable style="width: 130px">
  64. <el-option
  65. v-for = "i in projectOwnersList"
  66. :key = "i.projectOwnerId"
  67. :label = "i.projectOwnerName"
  68. :value = "i.projectOwner">
  69. </el-option>
  70. </el-select>
  71. </el-form-item>
  72. <el-form-item :label="'Engineer'">
  73. <el-select v-model="searchData.engineer" placeholder="请选择" clearable style="width: 130px">
  74. <el-option
  75. v-for = "i in engineersList"
  76. :key = "i.engineerId"
  77. :label = "i.engineerName"
  78. :value = "i.engineer">
  79. </el-option>
  80. </el-select>
  81. </el-form-item>
  82. <el-form-item :label="'是否确认'">
  83. <el-select filterable v-model="searchData.confirmFlag" style="width: 130px">
  84. <el-option label="全部" value=""></el-option>
  85. <el-option label="是" value="Y"></el-option>
  86. <el-option label="否" value="N"></el-option>
  87. </el-select>
  88. </el-form-item>
  89. <el-form-item :label="'立项日期:'">
  90. <el-date-picker
  91. style="width: 120px"
  92. v-model="searchData.startDate"
  93. type="date"
  94. value-format="yyyy-MM-dd"
  95. placeholder="选择日期">
  96. </el-date-picker>
  97. -
  98. <el-date-picker
  99. style="width: 120px"
  100. v-model="searchData.endDate"
  101. type="date"
  102. value-format="yyyy-MM-dd"
  103. placeholder="选择日期">
  104. </el-date-picker>
  105. </el-form-item>
  106. <!-- <el-form-item :label="'在用'">-->
  107. <!-- <el-select filterable v-model="searchData.active" style="width: 130px">-->
  108. <!-- <el-option label="全部" value=""></el-option>-->
  109. <!-- <el-option label="是" value="Y"></el-option>-->
  110. <!-- <el-option label="否" value="N"></el-option>-->
  111. <!-- </el-select>-->
  112. <!-- </el-form-item>-->
  113. <el-form-item :label="' '">
  114. <el-button @click="getDataList()">查询</el-button>
  115. <download-excel
  116. v-if="this.$route.query.flag !== '2' && this.$route.query.flag !== '1'"
  117. :fields="fields()"
  118. :data="exportData"
  119. type="xls"
  120. :name="exportName"
  121. :header="exportHeader"
  122. :footer="exportFooter"
  123. :fetch="createExportData"
  124. :before-generate="startDownload"
  125. :before-finish="finishDownload"
  126. worksheet="导出信息"
  127. class="el-button el-button--primary el-button--medium">
  128. {{ "导出" }}
  129. </download-excel>
  130. </el-form-item>
  131. </el-form>
  132. <el-table :data="dataList"
  133. border
  134. :height="height"
  135. style="width: 100%;margin-top: 0px;">
  136. <el-table-column
  137. v-for="(item,index) in columnProjectList" :key="index"
  138. :sortable="item.columnSortable"
  139. :prop="item.columnProp"
  140. :header-align="item.headerAlign"
  141. :show-overflow-tooltip="item.showOverflowTooltip"
  142. :align="item.align"
  143. :fixed="item.fixed==''?false:item.fixed"
  144. :min-width="item.columnWidth"
  145. :label="item.columnLabel">
  146. <template slot-scope="scope">
  147. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  148. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  149. style="width: 100px; height: 80px"/></span>
  150. </template>
  151. </el-table-column>
  152. <!-- <el-table-column header-align="center" align="center" width="70" prop="userDisplay" label="指定确认人"></el-table-column>-->
  153. <!-- <el-table-column header-align="center" align="center" :formatter="formatDate" prop="wantedConfirmDate" label="要求确认日期"></el-table-column>-->
  154. <!-- <el-table-column header-align="center" align="center" prop="confirmFlag" label="是否确认"></el-table-column>-->
  155. <!-- <el-table-column header-align="center" align="center" prop="confirmedBy" label="实际确认人"></el-table-column>-->
  156. <!-- <el-table-column header-align="center" align="center" prop="remark" label="备注"></el-table-column>-->
  157. <!-- <el-table-column header-align="center" align="center" prop="confirmedDate" label="实际确认时间"></el-table-column>-->
  158. <!-- <el-table-column header-align="center" align="center" prop="createDate" label="推送时间"></el-table-column>-->
  159. <!-- <el-table-column header-align="center" align="center" prop="createBy" label="推送人"></el-table-column>-->
  160. <el-table-column
  161. header-align="center"
  162. align="center"
  163. width="90"
  164. fixed="left"
  165. label="操作">
  166. <template slot-scope="scope">
  167. <a type="text" size="small" @click="toMes(scope.row)">项目信息</a>
  168. <a v-if="scope.row.confirmFlag === 'N'" type="text" size="small" @click="confirmDocument(scope.row)">确认</a>
  169. </template>
  170. </el-table-column>
  171. </el-table>
  172. <el-pagination
  173. @size-change="sizeChangeHandle"
  174. @current-change="currentChangeHandle"
  175. :current-page="pageIndex"
  176. :page-sizes="[20, 50, 100, 200, 500]"
  177. :page-size="pageSize"
  178. :total="totalPage"
  179. layout="total, sizes, prev, pager, next, jumper">
  180. </el-pagination>
  181. <el-dialog title="确认" @close="closeUploadFileVisible" :visible.sync="confirmVisible" width="579px" style="margin-top: 0vh;height: 100%;" :close-on-click-modal="false">
  182. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  183. <el-form-item label="项目编码" prop="projectNo" class="red-label">
  184. <el-input v-model="modalData.projectNo" readonly style="width: 110px;" class="red-text"></el-input>
  185. </el-form-item>
  186. <el-form-item label="项目名称" prop="projectDesc" >
  187. <el-input v-model="modalData.projectDesc" readonly style="width: 170px;" class="red-text"></el-input>
  188. </el-form-item>
  189. <el-form-item label="BU" prop="bu">
  190. <el-input v-model="modalData.bu" readonly style="width: 110px;" class="red-text"></el-input>
  191. </el-form-item>
  192. <el-form-item label="项目分类" prop="cProjectTypeDb">
  193. <el-input v-model="modalData.cProjectTypeDb" readonly style="width: 110px;" class="red-text"></el-input>
  194. </el-form-item>
  195. </el-form>
  196. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  197. <el-form-item label="指定确认人" prop="userDisplay">
  198. <el-input v-model="confirmData.userDisplay" readonly style="width: 110px;"></el-input>
  199. </el-form-item>
  200. <el-form-item label="要求确认日期" prop="wantedConfirmDate">
  201. <el-input v-model="confirmData.wantedConfirmDate" readonly style="width: 170px;" class="red-text"></el-input>
  202. </el-form-item>
  203. </el-form>
  204. <el-form :inline="true" label-position="top" :model="confirmData" style="margin-left: 7px;margin-top: -5px;">
  205. <el-form-item label="备注" prop="remark">
  206. <el-input v-model="confirmData.remark" style="width: 541px" type="textarea" :rows="1"></el-input>
  207. </el-form-item>
  208. </el-form>
  209. <el-form :inline="true" label-position="top" :model="confirmData" style="margin-left: 7px;margin-top: -15px;">
  210. <el-form-item label=" ">
  211. <a href="javascript:void(0);" @click="triggerUpload" type="text" size="small">点击选择文件</a>
  212. <tr></tr>
  213. <el-input v-model="this.fileName" readonly placeholder="文件名称" style="width: 541px"></el-input>
  214. <el-upload class="custom-upload" :file-list="fileList"
  215. action="javascript:void(0);" ref="uploadFile"
  216. :on-change="onChange" :on-close="closeFileUpdate"
  217. multiple :auto-upload="false"
  218. style="text-align: left;margin-top: 0px;margin-left: 6px;display: none;">
  219. </el-upload>
  220. </el-form-item>
  221. </el-form>
  222. <el-table
  223. :height="height - 200"
  224. :data="projectConfirmatorFileList"
  225. border
  226. style="width: 100%;margin-top: 17px;margin-left: 0px;">
  227. <el-table-column
  228. prop="fileName"
  229. header-align="center"
  230. align="center"
  231. min-width="120"
  232. label="文件名">
  233. </el-table-column>
  234. <el-table-column
  235. prop="createDate"
  236. header-align="center"
  237. align="center"
  238. min-width="80"
  239. label="上传时间">
  240. </el-table-column>
  241. <el-table-column
  242. prop="createdBy"
  243. header-align="center"
  244. align="center"
  245. min-width="60"
  246. label="上传人">
  247. </el-table-column>
  248. </el-table>
  249. <div slot="footer" class="dialog-footer" style="margin-top: 0px">
  250. <el-button type="primary" @click="saveUploadFile()">确定</el-button>
  251. <el-button @click="closeUploadFileVisible()">关闭</el-button>
  252. </div>
  253. </el-dialog>
  254. <el-dialog title="查看附件" @close="closeViewDocumentFileVisible" :visible.sync="viewDocumentFileVisible" width="520px" style="margin-top: 0vh" :close-on-click-modal="false">
  255. <el-table
  256. :height="height + 200"
  257. :data="projectConfirmatorFileList"
  258. border
  259. style="width: 100%;margin-top: 0px;margin-left: 0px;">
  260. <el-table-column
  261. prop="fileName"
  262. header-align="center"
  263. align="center"
  264. min-width="120"
  265. label="文件名">
  266. </el-table-column>
  267. <el-table-column
  268. prop="createDate"
  269. header-align="center"
  270. align="center"
  271. min-width="80"
  272. label="上传时间">
  273. </el-table-column>
  274. <el-table-column
  275. prop="createdBy"
  276. header-align="center"
  277. align="center"
  278. min-width="50"
  279. label="上传人">
  280. </el-table-column>
  281. <el-table-column
  282. header-align="center"
  283. align="center"
  284. width="100"
  285. label="操作">
  286. <template slot-scope="scope">
  287. <a type="text" size="small" @click="viewFile(scope.row)">查看</a>
  288. <a type="text" size="small" @click="downloadFile(scope.row)">下载</a>
  289. <a type="text" size="small" @click="deleteFile(scope.row)">删除</a>
  290. </template>
  291. </el-table-column>
  292. </el-table>
  293. <div slot="footer" class="dialog-footer" style="margin-top: 0px">
  294. <el-button @click="closeViewDocumentFileVisible()">关闭</el-button>
  295. </div>
  296. </el-dialog>
  297. </div>
  298. </template>
  299. <script>
  300. import {
  301. searchProjectUploadsDocumentList,
  302. searchProjectOverUploadsDocumentList,
  303. searchConfirmProgressList,
  304. searchOverConfirmProgressList,
  305. searchAllConfirmProgressList,
  306. queryOverConfirmProgressList,
  307. queryConfirmProgressList, queryAllConfirmProgressList
  308. } from "../../../api/eam/eamProofing";
  309. import {
  310. deleteProjectFile,
  311. searchConfirmProgressPusherList,
  312. searchProjectConfirmatorFileList, updateProjectDocumentConfirm, uploadProjectFile
  313. } from "../../../api/eam/eamProject";
  314. import {downLoadObjectFile} from "../../../api/eam/eam_object_list";
  315. import {getSiteAndBuByUserName} from "../../../api/qc/qc";
  316. import {removeUserFavorite, saveUserFavorite, userFavoriteList} from "../../../api/userFavorite";
  317. import {getTableDefaultListLanguage, getTableUserListLanguage} from "../../../api/table";
  318. import moment from "moment/moment";
  319. import {EventBus} from "../../../main";
  320. export default {
  321. computed: {
  322. projectOwnersList() {
  323. return this.allPersonnelInfoList.filter(item => item.projectOwnerId !== undefined);
  324. },
  325. projectManagersList() {
  326. return this.allPersonnelInfoList.filter(item => item.projectManagerId !== undefined);
  327. },
  328. engineersList() {
  329. return this.allPersonnelInfoList.filter(item => item.engineerId !== undefined);
  330. }
  331. },
  332. data() {
  333. return {
  334. // 导出
  335. exportData: [],
  336. exportName: '待文档确认' + this.dayjs().format('YYYYMMDDHHmmss'),
  337. exportHeader: ['待文档确认'],
  338. exportFooter: [],
  339. dataList: [],
  340. confirmProgressList: [],
  341. projectConfirmatorFileList: [],
  342. fileList: [],
  343. height: 200,
  344. pageIndex: 1,
  345. pageSize: 20,
  346. totalPage: 0,
  347. fileName:'',
  348. dataListLoading: false,
  349. viewDocumentFileVisible: false,
  350. confirmVisible: false,
  351. selectTypeFlag: [],
  352. searchData: {
  353. site: this.$store.state.user.site,
  354. userId: this.$store.state.user.id,
  355. projectId: '',
  356. projectNo: '',
  357. projectDesc: '',
  358. projectPartId: '',
  359. testPartNo: '',
  360. partDesc: '',
  361. customerNo: '',
  362. customerDesc: '',
  363. buDesc: '',
  364. projectCategory: '',
  365. status: '',
  366. startDate:'',
  367. endDate:'',
  368. projectCreationDate: new Date(),
  369. projectCloseDate:'',
  370. needDate:'',
  371. projectManager:'',
  372. projectOwner:'',
  373. engineer:'',
  374. confirmFlag:'N',
  375. page: 1,
  376. limit: 10,
  377. },
  378. modalData:{
  379. flag:'',
  380. id:'',
  381. bu: '',
  382. buNo: '',
  383. site: this.$store.state.user.site,
  384. projectId: '',
  385. oriProjectId: '',
  386. projectDesc:'',
  387. projectCloseDate:'',
  388. proofingNo:'',
  389. needDate:'',
  390. customerNo:'',
  391. finalCustomerId:'',
  392. customerDesc:'',
  393. projectCategory:'',
  394. testPartNo:'',
  395. partDesc:'',
  396. priority:'',
  397. projectManager:'',
  398. projectManagerName:'',
  399. projectOwner:'',
  400. projectOwnerName:'',
  401. cProjectRegion:'',
  402. cProjectBuildDate:'',
  403. cQualityEngineer1:'',
  404. cQualityEngineer1Name:'',
  405. cQualityEngineer2:'',
  406. cQualityEngineer2Name:'',
  407. cQualityEngineer3:'',
  408. cQualityEngineer3Name:'',
  409. cQualityEngineer4:'',
  410. cQualityEngineer4Name:'',
  411. cQualityEngineer5:'',
  412. cQualityEngineer5Name:'',
  413. cQualityEngineer6:'',
  414. cQualityEngineer6Name:'',
  415. cManufactureEngineer:'',
  416. cManufactureEngineerName:'',
  417. engineer:'',
  418. engineerName:'',
  419. docEngineer:'',
  420. docEngineerName:'',
  421. //projectCreationDate为当前服务器的时间
  422. projectCreationDate: new Date(),
  423. finalPartNo:'',
  424. finalPartDesc:'',
  425. wantedConfirmDate: new Date(),
  426. // active:'',
  427. createBy: this.$store.state.user.name,
  428. updateBy: this.$store.state.user.name,
  429. },
  430. confirmData:{
  431. site: '',
  432. projectId: '',
  433. orderRef1: '',
  434. orderRef2: '',
  435. documentId: '',
  436. documentType: '',
  437. itemNo: '',
  438. userid: '',
  439. wantedConfirmDate: '',
  440. confirmFlag: '',
  441. confirmedBy: '',
  442. remark: '',
  443. confirmedDate: '',
  444. createDate: '',
  445. createBy: '',
  446. page: 1,
  447. limit: 1000
  448. },
  449. columnProjectList: [
  450. {
  451. userId: this.$store.state.user.name,
  452. functionId: 401007,
  453. serialNumber: '401007Table1BuDesc',
  454. tableId: "401007Table1",
  455. tableName: "项目信息待文档确认表",
  456. columnProp: 'buDesc',
  457. headerAlign: "center",
  458. align: "center",
  459. columnLabel: 'BU',
  460. columnHidden: false,
  461. columnImage: false,
  462. columnSortable: false,
  463. sortLv: 0,
  464. status: true,
  465. fixed: '',
  466. columnWidth: 100,
  467. },
  468. {
  469. userId: this.$store.state.user.name,
  470. functionId: 401007,
  471. serialNumber: '401007Table1ProjectId',
  472. tableId: "401007Table1",
  473. tableName: "项目信息待文档确认表",
  474. columnProp: 'projectNo',
  475. headerAlign: "center",
  476. align: "center",
  477. columnLabel: '项目编码',
  478. columnHidden: false,
  479. columnImage: false,
  480. columnSortable: false,
  481. sortLv: 0,
  482. status: true,
  483. fixed: '',
  484. columnWidth: 100,
  485. },
  486. {
  487. userId: this.$store.state.user.name,
  488. functionId: 401007,
  489. serialNumber: '401007Table1ProjectDesc',
  490. tableId: "401007Table1",
  491. tableName: "项目信息待文档确认表",
  492. columnProp: 'projectDesc',
  493. headerAlign: "center",
  494. align: "center",
  495. columnLabel: '项目名称',
  496. columnHidden: false,
  497. columnImage: false,
  498. columnSortable: false,
  499. sortLv: 0,
  500. status: true,
  501. fixed: '',
  502. columnWidth: 100,
  503. },
  504. {
  505. userId: this.$store.state.user.name,
  506. functionId: 401007,
  507. serialNumber: '401007Table1TestPartNo',
  508. tableId: "401007Table1",
  509. tableName: "项目信息待文档确认表",
  510. columnProp: 'testPartNo',
  511. headerAlign: "center",
  512. align: "center",
  513. columnLabel: '项目料号',
  514. columnHidden: false,
  515. columnImage: false,
  516. columnSortable: false,
  517. sortLv: 0,
  518. status: true,
  519. fixed: '',
  520. columnWidth: 100,
  521. },
  522. {
  523. userId: this.$store.state.user.name,
  524. functionId: 401007,
  525. serialNumber: '401007Table1PartDesc',
  526. tableId: "401007Table1",
  527. tableName: "项目信息待文档确认表",
  528. columnProp: 'partDesc',
  529. headerAlign: "center",
  530. align: "center",
  531. columnLabel: '料号描述',
  532. columnHidden: false,
  533. columnImage: false,
  534. columnSortable: false,
  535. sortLv: 0,
  536. status: true,
  537. fixed: '',
  538. columnWidth: 100,
  539. },
  540. {
  541. userId: this.$store.state.user.name,
  542. functionId: 401007,
  543. serialNumber: '401007Table1customerNo',
  544. tableId: "401007Table1",
  545. tableName: "项目信息待文档确认表",
  546. columnProp: "customerNo",
  547. headerAlign: "center",
  548. align: "left",
  549. columnLabel: "客户编码",
  550. columnHidden: false,
  551. columnImage: false,
  552. columnSortable: false,
  553. sortLv: 0,
  554. status: true,
  555. fixed: '',
  556. columnWidth: 100
  557. },
  558. {
  559. userId: this.$store.state.user.name,
  560. functionId: 401007,
  561. serialNumber: '401007Table1customerDesc',
  562. tableId: "401007Table1",
  563. tableName: "项目信息待文档确认表",
  564. columnProp: "customerDesc",
  565. headerAlign: "center",
  566. align: "left",
  567. columnLabel: "客户名称",
  568. columnHidden: false,
  569. columnImage: false,
  570. columnSortable: false,
  571. sortLv: 0,
  572. status: true,
  573. fixed: '',
  574. columnWidth: 150
  575. },
  576. {
  577. userId: this.$store.state.user.name,
  578. functionId: 401007,
  579. serialNumber: '401007Table1BuildDate',
  580. tableId: "401007Table1",
  581. tableName: "项目信息待文档确认表",
  582. columnProp: "buildDate",
  583. headerAlign: "center",
  584. align: "center",
  585. columnLabel: "立项日期",
  586. columnHidden: false,
  587. columnImage: false,
  588. columnSortable: false,
  589. sortLv: 0,
  590. status: true,
  591. fixed: '',
  592. columnWidth: 120
  593. },
  594. {
  595. userId: this.$store.state.user.name,
  596. functionId: 401007,
  597. serialNumber: '401007Table1ProjectCategory',
  598. tableId: "401007Table1",
  599. tableName: "项目信息待文档确认表",
  600. columnProp: 'projectCategory',
  601. headerAlign: "center",
  602. align: "left",
  603. columnLabel: '项目分类',
  604. columnHidden: false,
  605. columnImage: false,
  606. columnSortable: false,
  607. sortLv: 0,
  608. status: true,
  609. fixed: '',
  610. columnWidth: 120,
  611. },
  612. {
  613. userId: this.$store.state.user.name,
  614. functionId: 401007,
  615. serialNumber: '401007Table1Priority',
  616. tableId: "401007Table1",
  617. tableName: "项目信息待文档确认表",
  618. columnProp: 'priority',
  619. headerAlign: "center",
  620. align: "left",
  621. columnLabel: '优先级',
  622. columnHidden: false,
  623. columnImage: false,
  624. columnSortable: false,
  625. sortLv: 0,
  626. status: true,
  627. fixed: '',
  628. columnWidth: 80,
  629. },
  630. {
  631. userId: this.$store.state.user.name,
  632. functionId: 401007,
  633. serialNumber: '401007Table1CProjectRegion',
  634. tableId: "401007Table1",
  635. tableName: "项目信息待文档确认表",
  636. columnProp: 'cProjectRegion',
  637. headerAlign: "center",
  638. align: "left",
  639. columnLabel: '区域',
  640. columnHidden: false,
  641. columnImage: false,
  642. columnSortable: false,
  643. sortLv: 0,
  644. status: true,
  645. fixed: '',
  646. columnWidth: 120,
  647. },
  648. {
  649. userId: this.$store.state.user.name,
  650. functionId: 401007,
  651. serialNumber: '401007Table1ProjectManager',
  652. tableId: "401007Table1",
  653. tableName: "项目信息待文档确认表",
  654. columnProp: 'projectManagerName',
  655. headerAlign: "center",
  656. align: "left",
  657. columnLabel: 'PM/Sales',
  658. columnHidden: false,
  659. columnImage: false,
  660. columnSortable: false,
  661. sortLv: 0,
  662. status: true,
  663. fixed: '',
  664. columnWidth: 120,
  665. },
  666. {
  667. userId: this.$store.state.user.name,
  668. functionId: 401007,
  669. serialNumber: '401007Table1ProjectOwner',
  670. tableId: "401007Table1",
  671. tableName: "项目信息待文档确认表",
  672. columnProp: 'projectOwnerName',
  673. headerAlign: "center",
  674. align: "left",
  675. columnLabel: 'PjM',
  676. columnHidden: false,
  677. columnImage: false,
  678. columnSortable: false,
  679. sortLv: 0,
  680. status: true,
  681. fixed: '',
  682. columnWidth: 120,
  683. },
  684. {
  685. userId: this.$store.state.user.name,
  686. functionId: 401007,
  687. serialNumber: '401007Table1Engineer',
  688. tableId: "401007Table1",
  689. tableName: "项目信息待文档确认表",
  690. columnProp: 'engineerName',
  691. headerAlign: "center",
  692. align: "left",
  693. columnLabel: 'Engineer',
  694. columnHidden: false,
  695. columnImage: false,
  696. columnSortable: false,
  697. sortLv: 0,
  698. status: true,
  699. fixed: '',
  700. columnWidth: 120,
  701. },
  702. {
  703. userId: this.$store.state.user.name,
  704. functionId: 401007,
  705. serialNumber: '401007Table1CQualityEngineer1',
  706. tableId: "401007Table1",
  707. tableName: "项目信息待文档确认表",
  708. columnProp: 'cQualityEngineer1Name',
  709. headerAlign: "center",
  710. align: "left",
  711. columnLabel: 'IPQC-Lam/Pri/Etch/Slit',
  712. columnHidden: false,
  713. columnImage: false,
  714. columnSortable: false,
  715. sortLv: 0,
  716. status: true,
  717. fixed: '',
  718. columnWidth: 120,
  719. },
  720. {
  721. userId: this.$store.state.user.name,
  722. functionId: 401007,
  723. serialNumber: '401007Table1CQualityEngineer2',
  724. tableId: "401007Table1",
  725. tableName: "项目信息待文档确认表",
  726. columnProp: 'cQualityEngineer2Name',
  727. headerAlign: "center",
  728. align: "left",
  729. columnLabel: 'IPQC-Converting',
  730. columnHidden: false,
  731. columnImage: false,
  732. columnSortable: false,
  733. sortLv: 0,
  734. status: true,
  735. fixed: '',
  736. columnWidth: 120,
  737. },
  738. {
  739. userId: this.$store.state.user.name,
  740. functionId: 401007,
  741. serialNumber: '401007Table1CQualityEngineer3',
  742. tableId: "401007Table1",
  743. tableName: "项目信息待文档确认表",
  744. columnProp: 'cQualityEngineer3Name',
  745. headerAlign: "center",
  746. align: "left",
  747. columnLabel: 'FQC1',
  748. columnHidden: false,
  749. columnImage: false,
  750. columnSortable: false,
  751. sortLv: 0,
  752. status: true,
  753. fixed: '',
  754. columnWidth: 120,
  755. },
  756. {
  757. userId: this.$store.state.user.name,
  758. functionId: 401007,
  759. serialNumber: '401007Table1CQualityEngineer5',
  760. tableId: "401007Table1",
  761. tableName: "项目信息待文档确认表",
  762. columnProp: 'cQualityEngineer5Name',
  763. headerAlign: "center",
  764. align: "left",
  765. columnLabel: 'FQC2',
  766. columnHidden: false,
  767. columnImage: false,
  768. columnSortable: false,
  769. sortLv: 0,
  770. status: true,
  771. fixed: '',
  772. columnWidth: 120,
  773. },
  774. {
  775. userId: this.$store.state.user.name,
  776. functionId: 401007,
  777. serialNumber: '401007Table1CQualityEngineer6',
  778. tableId: "401007Table1",
  779. tableName: "项目信息待文档确认表",
  780. columnProp: 'cQualityEngineer6Name',
  781. headerAlign: "center",
  782. align: "left",
  783. columnLabel: 'IQC',
  784. columnHidden: false,
  785. columnImage: false,
  786. columnSortable: false,
  787. sortLv: 0,
  788. status: true,
  789. fixed: '',
  790. columnWidth: 120,
  791. },
  792. {
  793. userId: this.$store.state.user.name,
  794. functionId: 401007,
  795. serialNumber: '401007Table1CQualityEngineer6',
  796. tableId: "401007Table1",
  797. tableName: "项目信息待文档确认表",
  798. columnProp: 'cQualityEngineer6Name',
  799. headerAlign: "center",
  800. align: "left",
  801. columnLabel: 'IQC',
  802. columnHidden: false,
  803. columnImage: false,
  804. columnSortable: false,
  805. sortLv: 0,
  806. status: true,
  807. fixed: '',
  808. columnWidth: 120,
  809. },
  810. {
  811. userId: this.$store.state.user.name,
  812. functionId: 401007,
  813. serialNumber: '401007Table1CManufactureEngineer',
  814. tableId: "401007Table1",
  815. tableName: "项目信息待文档确认表",
  816. columnProp: 'cManufactureEngineerName',
  817. headerAlign: "center",
  818. align: "left",
  819. columnLabel: 'MFG',
  820. columnHidden: false,
  821. columnImage: false,
  822. columnSortable: false,
  823. sortLv: 0,
  824. status: true,
  825. fixed: '',
  826. columnWidth: 120,
  827. },
  828. {
  829. userId: this.$store.state.user.name,
  830. functionId: 401007,
  831. serialNumber: '401007Table1CQualityEngineer4',
  832. tableId: "401007Table1",
  833. tableName: "项目信息待文档确认表",
  834. columnProp: 'cQualityEngineer4Name',
  835. headerAlign: "center",
  836. align: "left",
  837. columnLabel: 'SQE',
  838. columnHidden: false,
  839. columnImage: false,
  840. columnSortable: false,
  841. sortLv: 0,
  842. status: true,
  843. fixed: '',
  844. columnWidth: 120,
  845. },
  846. {
  847. userId: this.$store.state.user.name,
  848. functionId: 401007,
  849. serialNumber: '401007Table1DocEngineer',
  850. tableId: "401007Table1",
  851. tableName: "项目信息待上传文件表",
  852. columnProp: 'docEngineerName',
  853. headerAlign: "center",
  854. align: "left",
  855. columnLabel: '文档工程师',
  856. columnHidden: false,
  857. columnImage: false,
  858. columnSortable: false,
  859. sortLv: 0,
  860. status: true,
  861. fixed: '',
  862. columnWidth: 120,
  863. },
  864. {
  865. userId: this.$store.state.user.name,
  866. functionId: 401007,
  867. serialNumber: '401007Table1Status',
  868. tableId: "401007Table1",
  869. tableName: "项目信息待文档确认表",
  870. columnProp: 'status',
  871. headerAlign: "center",
  872. align: "left",
  873. columnLabel: '项目状态' ,
  874. columnHidden: false,
  875. columnImage: false,
  876. columnSortable: false,
  877. sortLv: 0,
  878. status: true,
  879. fixed: '',
  880. columnWidth: 100,
  881. },
  882. {
  883. userId: this.$store.state.user.name,
  884. functionId: 401007,
  885. serialNumber: '401007Table1NeedDate',
  886. tableId: "401007Table1",
  887. tableName: "项目信息待文档确认表",
  888. columnProp: 'needDate',
  889. headerAlign: "center",
  890. align: "center",
  891. columnLabel: '预计完成日期',
  892. columnHidden: false,
  893. columnImage: false,
  894. columnSortable: false,
  895. sortLv: 0,
  896. status: true,
  897. fixed: '',
  898. columnWidth: 120,
  899. },
  900. {
  901. userId: this.$store.state.user.name,
  902. functionId: 401007,
  903. serialNumber: '401007Table1CloseDate',
  904. tableId: "401007Table1",
  905. tableName: "项目信息待文档确认表",
  906. columnProp: 'closeDate',
  907. headerAlign: "center",
  908. align: "center",
  909. columnLabel: '转量产日期',
  910. columnHidden: false,
  911. columnImage: false,
  912. columnSortable: false,
  913. sortLv: 0,
  914. status: true,
  915. fixed: '',
  916. columnWidth: 120,
  917. },
  918. {
  919. userId: this.$store.state.user.name,
  920. functionId: 401007,
  921. serialNumber: '401007Table1FinalPartNo',
  922. tableId: "401007Table1",
  923. tableName: "项目信息待文档确认表",
  924. columnProp: 'finalPartNo',
  925. headerAlign: "center",
  926. align: "left",
  927. columnLabel: 'ERP正式料号',
  928. columnHidden: false,
  929. columnImage: false,
  930. columnSortable: false,
  931. sortLv: 0,
  932. status: true,
  933. fixed: '',
  934. columnWidth: 120,
  935. },
  936. {
  937. userId: this.$store.state.user.name,
  938. functionId: 401007,
  939. serialNumber: '401007Table1UserDisplay',
  940. tableId: "401007Table1",
  941. tableName: "项目信息待文档确认表",
  942. columnProp: 'userDisplay',
  943. headerAlign: "center",
  944. align: "center",
  945. columnLabel: '指定确认人',
  946. columnHidden: false,
  947. columnImage: false,
  948. columnSortable: false,
  949. sortLv: 0,
  950. status: true,
  951. fixed: '',
  952. columnWidth: 70,
  953. },
  954. {
  955. userId: this.$store.state.user.name,
  956. functionId: 401007,
  957. serialNumber: '401007Table1WantedConfirmDate',
  958. tableId: "401007Table1",
  959. tableName: "项目信息待文档确认表",
  960. columnProp: 'wantedConfirmDate',
  961. headerAlign: "center",
  962. align: "center",
  963. columnLabel: '要求确认日期',
  964. columnHidden: false,
  965. columnImage: false,
  966. columnSortable: false,
  967. sortLv: 0,
  968. status: true,
  969. fixed: '',
  970. columnWidth: 120,
  971. },
  972. {
  973. userId: this.$store.state.user.name,
  974. functionId: 401007,
  975. serialNumber: '401007Table1ConfirmFlag',
  976. tableId: "401007Table1",
  977. tableName: "项目信息待文档确认表",
  978. columnProp: 'confirmFlag',
  979. headerAlign: "center",
  980. align: "center",
  981. columnLabel: '是否确认',
  982. columnHidden: false,
  983. columnImage: false,
  984. columnSortable: false,
  985. sortLv: 0,
  986. status: true,
  987. fixed: '',
  988. columnWidth: 70,
  989. },
  990. {
  991. userId: this.$store.state.user.name,
  992. functionId: 401007,
  993. serialNumber: '401007Table1ConfirmedBy',
  994. tableId: "401007Table1",
  995. tableName: "项目信息待文档确认表",
  996. columnProp: 'confirmedBy',
  997. headerAlign: "center",
  998. align: "center",
  999. columnLabel: '实际确认人',
  1000. columnHidden: false,
  1001. columnImage: false,
  1002. columnSortable: false,
  1003. sortLv: 0,
  1004. status: true,
  1005. fixed: '',
  1006. columnWidth: 70,
  1007. },
  1008. {
  1009. userId: this.$store.state.user.name,
  1010. functionId: 401007,
  1011. serialNumber: '401007Table1Remark',
  1012. tableId: "401007Table1",
  1013. tableName: "项目信息待文档确认表",
  1014. columnProp: 'remark',
  1015. headerAlign: "center",
  1016. align: "center",
  1017. columnLabel: '备注',
  1018. columnHidden: false,
  1019. columnImage: false,
  1020. columnSortable: false,
  1021. sortLv: 0,
  1022. status: true,
  1023. fixed: '',
  1024. columnWidth: 120,
  1025. },
  1026. {
  1027. userId: this.$store.state.user.name,
  1028. functionId: 401007,
  1029. serialNumber: '401007Table1ConfirmedDate',
  1030. tableId: "401007Table1",
  1031. tableName: "项目信息待文档确认表",
  1032. columnProp: 'confirmedDate',
  1033. headerAlign: "center",
  1034. align: "center",
  1035. columnLabel: '实际确认时间',
  1036. columnHidden: false,
  1037. columnImage: false,
  1038. columnSortable: false,
  1039. sortLv: 0,
  1040. status: true,
  1041. fixed: '',
  1042. columnWidth: 140,
  1043. },
  1044. {
  1045. userId: this.$store.state.user.name,
  1046. functionId: 401007,
  1047. serialNumber: '401007Table1CreateDate',
  1048. tableId: "401007Table1",
  1049. tableName: "项目信息待文档确认表",
  1050. columnProp: 'createDate',
  1051. headerAlign: "center",
  1052. align: "center",
  1053. columnLabel: '推送时间',
  1054. columnHidden: false,
  1055. columnImage: false,
  1056. columnSortable: false,
  1057. sortLv: 0,
  1058. status: true,
  1059. fixed: '',
  1060. columnWidth: 140,
  1061. },
  1062. {
  1063. userId: this.$store.state.user.name,
  1064. functionId: 401007,
  1065. serialNumber: '401007Table1CreateBy',
  1066. tableId: "401007Table1",
  1067. tableName: "项目信息待文档确认表",
  1068. columnProp: 'createBy',
  1069. headerAlign: "center",
  1070. align: "center",
  1071. columnLabel: '推送人',
  1072. columnHidden: false,
  1073. columnImage: false,
  1074. columnSortable: false,
  1075. sortLv: 0,
  1076. status: true,
  1077. fixed: '',
  1078. columnWidth: 70,
  1079. },
  1080. ],
  1081. userBuList: [],
  1082. projectCategoryList: [
  1083. {
  1084. projectCategory: 'Low Risk',
  1085. },
  1086. {
  1087. projectCategory: 'High Risk',
  1088. },
  1089. {
  1090. projectCategory: 'Sustaining',
  1091. }
  1092. ],
  1093. statusList: [
  1094. {
  1095. status: '草稿',
  1096. },
  1097. {
  1098. status: '进行中',
  1099. },
  1100. {
  1101. status: '已量产',
  1102. },
  1103. {
  1104. status: '正式量产',
  1105. }
  1106. ],
  1107. allPersonnelInfoList: [],
  1108. };
  1109. },
  1110. created() {
  1111. // 获取用户的 site 和 bu
  1112. this.getSiteAndBuByUserName()
  1113. // 校验用户是否收藏
  1114. this.favoriteIsOk()
  1115. // 动态列
  1116. this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  1117. this.getDataList()
  1118. },
  1119. activated() {
  1120. if (this.$route.query.flag) {
  1121. this.getDataList()
  1122. }
  1123. this.$store.commit("sift/commitSearchFunction",this.queryConfirmProgressList)
  1124. },
  1125. mounted () {
  1126. this.$nextTick(() => {
  1127. this.height = window.innerHeight - 200
  1128. })
  1129. EventBus.$on('updateAgencyMatterForConfirm', () => {
  1130. this.getDataList();
  1131. });
  1132. },
  1133. methods: {
  1134. // 获取用户的bu
  1135. getSiteAndBuByUserName () {
  1136. let tempData = {
  1137. username: this.$store.state.user.name,
  1138. }
  1139. getSiteAndBuByUserName(tempData).then(({data}) => {
  1140. if (data.code === 0) {
  1141. this.userBuList = data.rows
  1142. }
  1143. })
  1144. },
  1145. //导出excel
  1146. async createExportData () {
  1147. this.searchData.limit = -1
  1148. this.searchData.page = 1
  1149. await searchAllConfirmProgressList(this.searchData).then(({data}) => {
  1150. this.exportList = data.page.list
  1151. this.exportList.forEach((item) => {
  1152. item.projectManagerName = item.projectManager.split('-')[1];
  1153. item.projectOwnerName = item.projectOwner.split('-')[1];
  1154. item.engineerName = item.engineer.split('-')[1];
  1155. item.cQualityEngineer1Name = item.cQualityEngineer1.split('-')[1];
  1156. item.cQualityEngineer2Name = item.cQualityEngineer2.split('-')[1];
  1157. item.cQualityEngineer3Name = item.cQualityEngineer3.split('-')[1];
  1158. item.cManufactureEngineerName = item.cManufactureEngineer.split('-')[1];
  1159. if (item.cQualityEngineer4 !== null && item.cQualityEngineer4 !== ''){
  1160. item.cQualityEngineer4Name = item.cQualityEngineer4.split('-')[1];
  1161. }
  1162. if (item.cQualityEngineer5 !== null && item.cQualityEngineer5 !== ''){
  1163. item.cQualityEngineer5Name = item.cQualityEngineer5.split('-')[1];
  1164. }
  1165. if (item.cQualityEngineer6 !== null && item.cQualityEngineer6 !== ''){
  1166. item.cQualityEngineer6Name = item.cQualityEngineer6.split('-')[1];
  1167. }
  1168. if (item.docEngineer !== null && item.docEngineer !== ''){
  1169. item.docEngineerName = item.docEngineer.split('-')[1];
  1170. }
  1171. });
  1172. for (let i = 0; i < this.exportList.length; i++) {
  1173. if (this.exportList[i].responsibleDepartment === 'R001') {
  1174. this.exportList[i].projectLeader = this.exportList[i].projectManager.split("-")[1];
  1175. } else if (this.exportList[i].responsibleDepartment === 'R002') {
  1176. this.exportList[i].projectLeader = this.exportList[i].projectOwner.split("-")[1];
  1177. } else if (this.exportList[i].responsibleDepartment === 'R004') {
  1178. this.exportList[i].projectLeader = this.exportList[i].engineer.split("-")[1];
  1179. } else if (this.exportList[i].responsibleDepartment === 'R005') {
  1180. this.exportList[i].projectLeader = this.exportList[i].cQualityEngineer1.split("-")[1];
  1181. } else if (this.exportList[i].responsibleDepartment === 'R007') {
  1182. this.exportList[i].projectLeader = this.exportList[i].cQualityEngineer2.split("-")[1];
  1183. } else if (this.exportList[i].responsibleDepartment === 'R008') {
  1184. this.exportList[i].projectLeader = this.exportList[i].cQualityEngineer3.split("-")[1];
  1185. } else if (this.exportList[i].responsibleDepartment === 'R009') {
  1186. this.exportList[i].projectLeader = this.exportList[i].cManufactureEngineer.split("-")[1];
  1187. } else if (this.exportList[i].responsibleDepartment === 'R011') {
  1188. if (this.exportList[i].cQualityEngineer4 !== null && this.exportList[i].cQualityEngineer4 !== '') {
  1189. this.exportList[i].projectLeader = this.exportList[i].cQualityEngineer4.split("-")[1];
  1190. }
  1191. } else if (this.exportList[i].responsibleDepartment === 'R012') {
  1192. if (this.exportList[i].docEngineer !== null && this.exportList[i].docEngineer !== '') {
  1193. this.exportList[i].projectLeader = this.exportList[i].docEngineer.split("-")[1];
  1194. }
  1195. } else if (this.exportList[i].responsibleDepartment === 'R013') {
  1196. if (this.exportList[i].cQualityEngineer5 !== null && this.exportList[i].cQualityEngineer5 !== '') {
  1197. this.exportList[i].projectLeader = this.exportList[i].cQualityEngineer5.split("-")[1];
  1198. }
  1199. } else if (this.exportList[i].responsibleDepartment === 'R014') {
  1200. if (this.exportList[i].cQualityEngineer6 !== null && this.exportList[i].cQualityEngineer6 !== '') {
  1201. this.exportList[i].projectLeader = this.exportList[i].cQualityEngineer6.split("-")[1];
  1202. }
  1203. }
  1204. }
  1205. })
  1206. return this.exportList
  1207. },
  1208. startDownload () {},
  1209. finishDownload () {},
  1210. fields () {
  1211. let json = "{"
  1212. this.columnProjectList.forEach((item, index) => {
  1213. if (index == this.columnProjectList.length - 1) {
  1214. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1215. } else {
  1216. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1217. }
  1218. })
  1219. json += "}"
  1220. let s = eval("(" + json + ")")
  1221. return s
  1222. },
  1223. // 获取数据列表
  1224. getDataList (params) {
  1225. this.selectTypeFlag = params
  1226. this.searchData.limit = this.pageSize
  1227. this.searchData.page = this.pageIndex
  1228. if (this.$route.query.flag === '4') {
  1229. searchOverConfirmProgressList(this.searchData).then(({data}) => {
  1230. if (data.code === 0) {
  1231. this.dataList = data.page.list
  1232. this.allPersonnelInfoList = data.list
  1233. this.pageIndex = data.page.currPage
  1234. this.pageSize = data.page.pageSize
  1235. this.totalPage = data.page.totalCount
  1236. this.dataList.forEach((item) => {
  1237. item.projectManagerName = item.projectManager.split('-')[1]
  1238. item.projectOwnerName = item.projectOwner.split('-')[1]
  1239. item.engineerName = item.engineer.split('-')[1]
  1240. item.cQualityEngineer1Name = item.cQualityEngineer1.split('-')[1]
  1241. item.cQualityEngineer2Name = item.cQualityEngineer2.split('-')[1]
  1242. item.cQualityEngineer3Name = item.cQualityEngineer3.split('-')[1]
  1243. item.cManufactureEngineerName = item.cManufactureEngineer.split('-')[1]
  1244. if (item.docEngineer === null || item.docEngineer === ''){
  1245. item.docEngineerName = ''
  1246. } else {
  1247. item.docEngineerName = item.docEngineer.split('-')[1]
  1248. }
  1249. if (item.cQualityEngineer4 === null || item.cQualityEngineer4 === ''){
  1250. item.cQualityEngineer4Name = ''
  1251. } else {
  1252. item.cQualityEngineer4Name = item.cQualityEngineer4.split('-')[1]
  1253. }
  1254. if (item.cQualityEngineer5 === null || item.cQualityEngineer5 === ''){
  1255. item.cQualityEngineer5Name = ''
  1256. } else {
  1257. item.cQualityEngineer5Name = item.cQualityEngineer5.split('-')[1]
  1258. }
  1259. if (item.cQualityEngineer6 === null || item.cQualityEngineer6 === ''){
  1260. item.cQualityEngineer6Name = ''
  1261. } else {
  1262. item.cQualityEngineer6Name = item.cQualityEngineer6.split('-')[1]
  1263. }
  1264. })
  1265. }
  1266. // 获取全部人员信息用于下拉框
  1267. this.getAllPersonnelList()
  1268. })
  1269. } else if (this.$route.query.flag === '3') {
  1270. searchConfirmProgressList(this.searchData).then(({data}) => {
  1271. if (data.code === 0) {
  1272. this.dataList = data.page.list
  1273. this.allPersonnelInfoList = data.list
  1274. this.pageIndex = data.page.currPage
  1275. this.pageSize = data.page.pageSize
  1276. this.totalPage = data.page.totalCount
  1277. this.dataList.forEach((item) => {
  1278. item.projectManagerName = item.projectManager.split('-')[1]
  1279. item.projectOwnerName = item.projectOwner.split('-')[1]
  1280. item.engineerName = item.engineer.split('-')[1]
  1281. item.cQualityEngineer1Name = item.cQualityEngineer1.split('-')[1]
  1282. item.cQualityEngineer2Name = item.cQualityEngineer2.split('-')[1]
  1283. item.cQualityEngineer3Name = item.cQualityEngineer3.split('-')[1]
  1284. item.cManufactureEngineerName = item.cManufactureEngineer.split('-')[1]
  1285. if (item.docEngineer === null || item.docEngineer === ''){
  1286. item.docEngineerName = ''
  1287. } else {
  1288. item.docEngineerName = item.docEngineer.split('-')[1]
  1289. }
  1290. if (item.cQualityEngineer4 === null || item.cQualityEngineer4 === ''){
  1291. item.cQualityEngineer4Name = ''
  1292. } else {
  1293. item.cQualityEngineer4Name = item.cQualityEngineer4.split('-')[1]
  1294. }
  1295. if (item.cQualityEngineer5 === null || item.cQualityEngineer5 === ''){
  1296. item.cQualityEngineer5Name = ''
  1297. } else {
  1298. item.cQualityEngineer5Name = item.cQualityEngineer5.split('-')[1]
  1299. }
  1300. if (item.cQualityEngineer6 === null || item.cQualityEngineer6 === ''){
  1301. item.cQualityEngineer6Name = ''
  1302. } else {
  1303. item.cQualityEngineer6Name = item.cQualityEngineer6.split('-')[1]
  1304. }
  1305. })
  1306. }
  1307. // 获取全部人员信息用于下拉框
  1308. this.getAllPersonnelList()
  1309. })
  1310. }else {
  1311. searchAllConfirmProgressList(this.searchData).then(({data}) => {
  1312. if (data.code === 0) {
  1313. let pjmList = []
  1314. // 遍历data.page.list
  1315. data.list.forEach((item) => {
  1316. if (!pjmList.includes(item.projectOwner.split('-')[0])) {
  1317. pjmList.push(item.projectOwner.split('-')[0])
  1318. }
  1319. })
  1320. if (pjmList.includes(this.$store.state.user.name)) {
  1321. this.dataList = data.page.list
  1322. this.allPersonnelInfoList = data.list
  1323. this.pageIndex = data.page.currPage
  1324. this.pageSize = data.page.pageSize
  1325. this.totalPage = data.page.totalCount
  1326. this.dataList.forEach((item) => {
  1327. item.projectManagerName = item.projectManager.split('-')[1]
  1328. item.projectOwnerName = item.projectOwner.split('-')[1]
  1329. item.engineerName = item.engineer.split('-')[1]
  1330. item.cQualityEngineer1Name = item.cQualityEngineer1.split('-')[1]
  1331. item.cQualityEngineer2Name = item.cQualityEngineer2.split('-')[1]
  1332. item.cQualityEngineer3Name = item.cQualityEngineer3.split('-')[1]
  1333. item.cManufactureEngineerName = item.cManufactureEngineer.split('-')[1]
  1334. if (item.docEngineer === null || item.docEngineer === ''){
  1335. item.docEngineerName = ''
  1336. } else {
  1337. item.docEngineerName = item.docEngineer.split('-')[1]
  1338. }
  1339. if (item.cQualityEngineer4 === null || item.cQualityEngineer4 === ''){
  1340. item.cQualityEngineer4Name = ''
  1341. } else {
  1342. item.cQualityEngineer4Name = item.cQualityEngineer4.split('-')[1]
  1343. }
  1344. if (item.cQualityEngineer5 === null || item.cQualityEngineer5 === ''){
  1345. item.cQualityEngineer5Name = ''
  1346. } else {
  1347. item.cQualityEngineer5Name = item.cQualityEngineer5.split('-')[1]
  1348. }
  1349. if (item.cQualityEngineer6 === null || item.cQualityEngineer6 === ''){
  1350. item.cQualityEngineer6Name = ''
  1351. } else {
  1352. item.cQualityEngineer6Name = item.cQualityEngineer6.split('-')[1]
  1353. }
  1354. })
  1355. }
  1356. } else {
  1357. this.$route.query.flag = '3'
  1358. }
  1359. // 获取全部人员信息用于下拉框
  1360. this.getAllPersonnelList()
  1361. })
  1362. }
  1363. },
  1364. queryConfirmProgressList (params) {
  1365. this.selectTypeFlag = params
  1366. this.searchData.limit = this.pageSize
  1367. this.searchData.page = this.pageIndex
  1368. if (params !== null && params !== undefined) {
  1369. params.limit = this.pageSize
  1370. params.page = this.pageIndex
  1371. params.site = this.$store.state.user.site
  1372. params.userName = this.$store.state.user.name
  1373. } else {
  1374. params = this.searchData
  1375. }
  1376. if (this.$route.query.flag === '4') {
  1377. queryOverConfirmProgressList(params).then(({data}) => {
  1378. if (data.code === 0) {
  1379. this.dataList = data.page.list
  1380. this.allPersonnelInfoList = data.list
  1381. this.pageIndex = data.page.currPage
  1382. this.pageSize = data.page.pageSize
  1383. this.totalPage = data.page.totalCount
  1384. this.dataList.forEach((item) => {
  1385. item.projectManagerName = item.projectManager.split('-')[1]
  1386. item.projectOwnerName = item.projectOwner.split('-')[1]
  1387. item.engineerName = item.engineer.split('-')[1]
  1388. item.cQualityEngineer1Name = item.cQualityEngineer1.split('-')[1]
  1389. item.cQualityEngineer2Name = item.cQualityEngineer2.split('-')[1]
  1390. item.cQualityEngineer3Name = item.cQualityEngineer3.split('-')[1]
  1391. item.cManufactureEngineerName = item.cManufactureEngineer.split('-')[1]
  1392. if (item.docEngineer === null || item.docEngineer === ''){
  1393. item.docEngineerName = ''
  1394. } else {
  1395. item.docEngineerName = item.docEngineer.split('-')[1]
  1396. }
  1397. if (item.cQualityEngineer4 === null || item.cQualityEngineer4 === ''){
  1398. item.cQualityEngineer4Name = ''
  1399. } else {
  1400. item.cQualityEngineer4Name = item.cQualityEngineer4.split('-')[1]
  1401. }
  1402. if (item.cQualityEngineer5 === null || item.cQualityEngineer5 === ''){
  1403. item.cQualityEngineer5Name = ''
  1404. } else {
  1405. item.cQualityEngineer5Name = item.cQualityEngineer5.split('-')[1]
  1406. }
  1407. if (item.cQualityEngineer6 === null || item.cQualityEngineer6 === ''){
  1408. item.cQualityEngineer6Name = ''
  1409. } else {
  1410. item.cQualityEngineer6Name = item.cQualityEngineer6.split('-')[1]
  1411. }
  1412. })
  1413. }
  1414. // 获取全部人员信息用于下拉框
  1415. this.getAllPersonnelList()
  1416. })
  1417. } else if (this.$route.query.flag === '3') {
  1418. queryConfirmProgressList(params).then(({data}) => {
  1419. if (data.code === 0) {
  1420. this.dataList = data.page.list
  1421. this.allPersonnelInfoList = data.list
  1422. this.pageIndex = data.page.currPage
  1423. this.pageSize = data.page.pageSize
  1424. this.totalPage = data.page.totalCount
  1425. this.dataList.forEach((item) => {
  1426. item.projectManagerName = item.projectManager.split('-')[1]
  1427. item.projectOwnerName = item.projectOwner.split('-')[1]
  1428. item.engineerName = item.engineer.split('-')[1]
  1429. item.cQualityEngineer1Name = item.cQualityEngineer1.split('-')[1]
  1430. item.cQualityEngineer2Name = item.cQualityEngineer2.split('-')[1]
  1431. item.cQualityEngineer3Name = item.cQualityEngineer3.split('-')[1]
  1432. item.cManufactureEngineerName = item.cManufactureEngineer.split('-')[1]
  1433. if (item.docEngineer === null || item.docEngineer === ''){
  1434. item.docEngineerName = ''
  1435. } else {
  1436. item.docEngineerName = item.docEngineer.split('-')[1]
  1437. }
  1438. if (item.cQualityEngineer4 === null || item.cQualityEngineer4 === ''){
  1439. item.cQualityEngineer4Name = ''
  1440. } else {
  1441. item.cQualityEngineer4Name = item.cQualityEngineer4.split('-')[1]
  1442. }
  1443. if (item.cQualityEngineer5 === null || item.cQualityEngineer5 === ''){
  1444. item.cQualityEngineer5Name = ''
  1445. } else {
  1446. item.cQualityEngineer5Name = item.cQualityEngineer5.split('-')[1]
  1447. }
  1448. if (item.cQualityEngineer6 === null || item.cQualityEngineer6 === ''){
  1449. item.cQualityEngineer6Name = ''
  1450. } else {
  1451. item.cQualityEngineer6Name = item.cQualityEngineer6.split('-')[1]
  1452. }
  1453. })
  1454. }
  1455. // 获取全部人员信息用于下拉框
  1456. this.getAllPersonnelList()
  1457. })
  1458. }else {
  1459. queryAllConfirmProgressList(params).then(({data}) => {
  1460. if (data.code === 0) {
  1461. // let pjmList = []
  1462. // 遍历data.page.list
  1463. // data.list.forEach((item) => {
  1464. // if (item.projectOwner !== null && item.projectOwner !== ''){
  1465. // if (!pjmList.includes(item.projectOwner.split('-')[0])) {
  1466. // pjmList.push(item.projectOwner.split('-')[0])
  1467. // }
  1468. // }
  1469. // })
  1470. // if (pjmList.includes(this.$store.state.user.name)) {
  1471. this.dataList = data.page.list
  1472. this.pageIndex = data.page.currPage
  1473. this.pageSize = data.page.pageSize
  1474. this.totalPage = data.page.totalCount
  1475. this.dataList.forEach((item) => {
  1476. item.projectManagerName = item.projectManager.split('-')[1]
  1477. item.projectOwnerName = item.projectOwner.split('-')[1]
  1478. item.engineerName = item.engineer.split('-')[1]
  1479. item.cQualityEngineer1Name = item.cQualityEngineer1.split('-')[1]
  1480. item.cQualityEngineer2Name = item.cQualityEngineer2.split('-')[1]
  1481. item.cQualityEngineer3Name = item.cQualityEngineer3.split('-')[1]
  1482. item.cManufactureEngineerName = item.cManufactureEngineer.split('-')[1]
  1483. if (item.docEngineer === null || item.docEngineer === ''){
  1484. item.docEngineerName = ''
  1485. } else {
  1486. item.docEngineerName = item.docEngineer.split('-')[1]
  1487. }
  1488. if (item.cQualityEngineer4 === null || item.cQualityEngineer4 === ''){
  1489. item.cQualityEngineer4Name = ''
  1490. } else {
  1491. item.cQualityEngineer4Name = item.cQualityEngineer4.split('-')[1]
  1492. }
  1493. if (item.cQualityEngineer5 === null || item.cQualityEngineer5 === ''){
  1494. item.cQualityEngineer5Name = ''
  1495. } else {
  1496. item.cQualityEngineer5Name = item.cQualityEngineer5.split('-')[1]
  1497. }
  1498. if (item.cQualityEngineer6 === null || item.cQualityEngineer6 === ''){
  1499. item.cQualityEngineer6Name = ''
  1500. } else {
  1501. item.cQualityEngineer6Name = item.cQualityEngineer6.split('-')[1]
  1502. }
  1503. })
  1504. // }
  1505. } else {
  1506. this.$route.query.flag = '3'
  1507. }
  1508. // 获取全部人员信息用于下拉框
  1509. this.getAllPersonnelList()
  1510. })
  1511. }
  1512. },
  1513. // 获取全部人员信息用于下拉框
  1514. getAllPersonnelList() {
  1515. let allPersonnelInfoDataList = JSON.parse(JSON.stringify(this.allPersonnelInfoList))
  1516. // 找出所有的同时过滤出唯一的 project owners, managers, and engineers
  1517. const allPersonnelList = [];
  1518. const projectOwnersMap = new Map();
  1519. const projectManagersMap = new Map();
  1520. const engineersMap = new Map();
  1521. allPersonnelInfoDataList.forEach((item) => {
  1522. // Handle project owners
  1523. if (!projectOwnersMap.has(item.projectOwner)) {
  1524. const projectOwnerId = projectOwnersMap.size + 1; // Incrementing by +1
  1525. projectOwnersMap.set(item.projectOwner, {
  1526. projectOwnerId,
  1527. projectOwner: item.projectOwner,
  1528. projectOwnerName: item.projectOwner.split('-')[1]
  1529. });
  1530. allPersonnelList.push(projectOwnersMap.get(item.projectOwner));
  1531. }
  1532. // Handle project managers
  1533. if (!projectManagersMap.has(item.projectManager)) {
  1534. const projectManagerId = projectManagersMap.size + 1;
  1535. projectManagersMap.set(item.projectManager, {
  1536. projectManagerId,
  1537. projectManager: item.projectManager,
  1538. projectManagerName: item.projectManager.split('-')[1]
  1539. });
  1540. allPersonnelList.push(projectManagersMap.get(item.projectManager));
  1541. }
  1542. // Handle engineers
  1543. if (!engineersMap.has(item.engineer)) {
  1544. const engineerId = engineersMap.size + 1;
  1545. engineersMap.set(item.engineer, {
  1546. engineerId,
  1547. engineer: item.engineer,
  1548. engineerName: item.engineer.split('-')[1]
  1549. });
  1550. allPersonnelList.push(engineersMap.get(item.engineer));
  1551. }
  1552. });
  1553. this.allPersonnelInfoList = allPersonnelList;
  1554. },
  1555. toMes (row) {
  1556. this.$router.push({ path: 'eam-eamProjectPartInfo', query: { projectNo: row.projectNo, testPartNo: row.testPartNo }})
  1557. },
  1558. // 每页数
  1559. sizeChangeHandle (val) {
  1560. this.pageSize = val
  1561. this.pageIndex = 1
  1562. if (this.selectTypeFlag !== null && this.selectTypeFlag !== undefined) {
  1563. this.queryConfirmProgressList(this.selectTypeFlag)
  1564. } else {
  1565. this.getDataList()
  1566. }
  1567. },
  1568. // 当前页
  1569. currentChangeHandle (val) {
  1570. this.pageIndex = val
  1571. if (this.selectTypeFlag !== null && this.selectTypeFlag !== undefined) {
  1572. this.queryConfirmProgressList(this.selectTypeFlag)
  1573. } else {
  1574. this.getDataList()
  1575. }
  1576. },
  1577. viewDocumentFile(row) {
  1578. this.confirmData = {
  1579. site: row.site,
  1580. documentType: row.documentType,
  1581. orderRef1: row.orderRef1,
  1582. orderRef2: row.orderRef2,
  1583. itemNo: row.itemNo,
  1584. userid: row.userid,
  1585. username: row.username,
  1586. userDisplay: row.userDisplay,
  1587. wantedConfirmDate: row.wantedConfirmDate,
  1588. confirmFlag: row.confirmFlag,
  1589. confirmedDate: new Date(),
  1590. createBy: row.createBy,
  1591. createDate: row.createDate,
  1592. confirmedBy: this.$store.state.user.userDisplay,
  1593. documentId: row.documentId,
  1594. remark: row.remark
  1595. }
  1596. let inData = {
  1597. orderRef1: row.site,
  1598. orderRef2: row.itemNo,
  1599. orderRef3: row.userid,
  1600. orderRef4: row.orderRef1,
  1601. orderRef5: row.orderRef2,
  1602. page: 1,
  1603. limit: 1000
  1604. }
  1605. searchProjectConfirmatorFileList(inData).then(({data}) => {
  1606. if (data && data.code === 0){
  1607. this.projectConfirmatorFileList = data.page.list;
  1608. }
  1609. })
  1610. this.viewDocumentFileVisible = true
  1611. },
  1612. closeViewDocumentFileVisible(){
  1613. this.viewDocumentFileVisible = false;
  1614. this.projectConfirmatorFileList = [];
  1615. },
  1616. // 查看文件
  1617. viewFile(row) {
  1618. // 预览文件
  1619. let image = ['jpg', 'jpeg', 'png', 'gif', 'bmp']
  1620. let video = ['mp4', 'avi', 'mov', 'wmv', 'flv']
  1621. let office = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx']
  1622. let txt = ['txt']
  1623. let type = ''
  1624. let pdf = ['pdf']
  1625. if (image.includes(row.fileType.toLowerCase())) {
  1626. type = 'image/' + row.fileType
  1627. downLoadObjectFile(row).then(({data}) => {
  1628. const blob = new Blob([data], { type: type });
  1629. // 创建URL来生成预览
  1630. const fileURL = URL.createObjectURL(blob);
  1631. // 在新标签页中打开文件预览
  1632. const newTab = window.open(fileURL, '_blank')
  1633. })
  1634. }
  1635. else if (video.includes(row.fileType.toLowerCase())) {
  1636. type = 'video/' + row.fileType
  1637. downLoadObjectFile(row).then(({data}) => {
  1638. const blob = new Blob([data], { type: type });
  1639. // 创建URL来生成预览
  1640. const fileURL = URL.createObjectURL(blob);
  1641. // 在新标签页中打开文件预览
  1642. const newTab = window.open(fileURL, '_blank')
  1643. })
  1644. }
  1645. else if (txt.includes(row.fileType.toLowerCase())) {
  1646. type = 'text/plain'
  1647. downLoadObjectFile(row).then(({data}) => {
  1648. const blob = new Blob([data], { type: type });
  1649. // 创建URL来生成预览
  1650. const fileURL = URL.createObjectURL(blob);
  1651. // 在新标签页中打开文件预览
  1652. const newTab = window.open(fileURL, '_blank')
  1653. })
  1654. }
  1655. else if (office.includes(row.fileType.toLowerCase())) {
  1656. if (row.fileType.toLowerCase() === 'doc' || row.fileType.toLowerCase() === 'docx') {
  1657. type = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
  1658. } else if (row.fileType.toLowerCase() === 'ppt' || row.fileType.toLowerCase() === 'pptx') {
  1659. type = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
  1660. } else {
  1661. type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
  1662. }
  1663. downLoadObjectFile(row).then(({data}) => {
  1664. const blob = new Blob([data], { type: type });
  1665. // 创建URL来生成预览
  1666. const fileURL = URL.createObjectURL(blob);
  1667. // 在新标签页中打开文件预览
  1668. const newTab = window.open(fileURL, '_blank')
  1669. })
  1670. }
  1671. else if (pdf.includes(row.fileType.toLowerCase())) {
  1672. type = 'application/pdf'
  1673. downLoadObjectFile(row).then(({data}) => {
  1674. const blob = new Blob([data], { type: type });
  1675. // 创建URL来生成预览
  1676. const fileURL = URL.createObjectURL(blob);
  1677. // 在新标签页中打开文件预览
  1678. const newTab = window.open(fileURL, '_blank')
  1679. })
  1680. }
  1681. else {
  1682. this.$message({
  1683. message: '不支持的文件类型',
  1684. type: 'warning'
  1685. })
  1686. }
  1687. },
  1688. // 下载
  1689. downloadFile (row) {
  1690. downLoadObjectFile(row)
  1691. .then(({data}) => {
  1692. // 不限制文件下载类型
  1693. const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'})
  1694. // 下载文件名称
  1695. const fileName = row.fileName
  1696. // a标签下载
  1697. const linkNode = document.createElement('a')
  1698. linkNode.download = fileName // a标签的download属性规定下载文件的名称
  1699. linkNode.style.display = 'none'
  1700. linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL
  1701. document.body.appendChild(linkNode)
  1702. linkNode.click() // 模拟在按钮上的一次鼠标单击
  1703. URL.revokeObjectURL(linkNode.href) // 释放URL 对象
  1704. document.body.removeChild(linkNode)
  1705. })
  1706. },
  1707. deleteFile(row) {
  1708. if (this.confirmData.confirmedBy === this.$store.state.user.userDisplay) {
  1709. this.$confirm('是否删除该文件?', '提示', {
  1710. confirmButtonText: '确定',
  1711. cancelButtonText: '取消',
  1712. type: 'warning'
  1713. }).then(() => {
  1714. let inData = {
  1715. id: row.id,
  1716. orderRef1: row.orderRef1,
  1717. orderRef2: row.orderRef2,
  1718. orderRef3: row.orderRef3,
  1719. orderRef4: row.orderRef4,
  1720. orderRef5: row.orderRef5,
  1721. createdBy: this.$store.state.user.name
  1722. }
  1723. deleteProjectFile(inData).then(({data}) => {
  1724. if (data && data.code === 0) {
  1725. this.$message({
  1726. message: '删除成功',
  1727. type: 'success'
  1728. })
  1729. this.getProjectConfirmatorFileList(this.confirmData)
  1730. } else {
  1731. this.$message({
  1732. message: '删除失败',
  1733. type: 'error'
  1734. })
  1735. }
  1736. })
  1737. }).catch(() => {
  1738. this.$message({
  1739. type: 'info',
  1740. message: '已取消删除'
  1741. });
  1742. });
  1743. } else {
  1744. this.$message({
  1745. message: '只有确认人员才能删除文件',
  1746. type: 'error'
  1747. })
  1748. }
  1749. },
  1750. confirmDocument(row) {
  1751. this.confirmData = {
  1752. site: row.site,
  1753. documentType: row.documentType,
  1754. orderRef1: row.orderRef1,
  1755. orderRef2: row.orderRef2,
  1756. itemNo: row.itemNo,
  1757. userid: row.userid,
  1758. username: row.username,
  1759. userDisplay: row.userDisplay,
  1760. wantedConfirmDate: row.wantedConfirmDate,
  1761. confirmFlag: row.confirmFlag,
  1762. confirmedDate: new Date(),
  1763. createBy: row.createBy,
  1764. createDate: row.createDate,
  1765. confirmedBy: this.$store.state.user.userDisplay,
  1766. documentId: row.documentId,
  1767. remark: row.remark
  1768. }
  1769. this.modalData = {
  1770. site: row.site,
  1771. projectId: row.projectId,
  1772. projectNo: row.projectNo,
  1773. projectDesc: row.projectDesc,
  1774. projectPartId: row.projectPartId,
  1775. testPartNo: row.testPartNo,
  1776. partDesc: row.partDesc,
  1777. customerNo: row.customerNo,
  1778. customerDesc: row.customerDesc,
  1779. buNo: row.buNo,
  1780. bu: row.site + '_' + row.buNo,
  1781. cProjectTypeDb: row.projectCategory,
  1782. }
  1783. this.getProjectConfirmatorFileList(row)
  1784. this.confirmVisible = true
  1785. },
  1786. getProjectConfirmatorFileList (row) {
  1787. let inData = {
  1788. orderRef1: row.site,
  1789. orderRef3: row.userid,
  1790. orderRef2: row.itemNo,
  1791. orderRef4: row.orderRef1,
  1792. orderRef5: row.orderRef2,
  1793. page: 1,
  1794. limit: 1000
  1795. }
  1796. searchProjectConfirmatorFileList(inData).then(({data}) => {
  1797. if (data && data.code === 0){
  1798. this.projectConfirmatorFileList = data.page.list;
  1799. }
  1800. })
  1801. },
  1802. closeUploadFileVisible(){
  1803. this.confirmVisible = false;
  1804. this.projectConfirmatorFileList = [];
  1805. this.fileList = [];
  1806. this.closeFileUpdate()
  1807. },
  1808. saveUploadFile(){
  1809. this.confirmData.confirmedDate = moment(this.confirmData.confirmedDate).utcOffset('+8').format('YYYY-MM-DD HH:mm:ss');
  1810. this.confirmData.confirmedBy = this.$store.state.user.userDisplay;
  1811. this.confirmData.userid = this.$store.state.user.id;
  1812. updateProjectDocumentConfirm(this.confirmData) .then(({data}) => {
  1813. if (data.code === 0) {
  1814. this.confirmVisible = false;
  1815. this.getDataList();
  1816. // 成功操作后触发事件
  1817. EventBus.$emit('updateProjectPartInfo');
  1818. }else {
  1819. this.$alert(data.msg, '错误', {
  1820. confirmButtonText: '确定'
  1821. })
  1822. }
  1823. })
  1824. let remark = this.confirmData.remark;
  1825. const formData = new FormData();
  1826. //片接文件
  1827. for (let i = 0; i < this.fileList.length; i++) {
  1828. formData.append("file",this.fileList[i].raw)
  1829. }
  1830. formData.append("folder", 'projectPDConfirmFiles');
  1831. formData.append("orderRef1", this.confirmData.site);
  1832. formData.append("orderRef4", this.confirmData.orderRef1);
  1833. formData.append("orderRef2", this.confirmData.itemNo);
  1834. formData.append("orderRef3", this.confirmData.userid);
  1835. formData.append("orderRef5", this.confirmData.orderRef2);
  1836. formData.append("createdBy", this.$store.state.user.name);
  1837. formData.append("updatedBy", this.$store.state.user.name);
  1838. formData.append("remark", remark);
  1839. uploadProjectFile(formData).then(({data}) => {
  1840. if (data.code === 0) {
  1841. this.$message.success('操作成功');
  1842. //清空文件上传记录
  1843. this.$refs.uploadFile.clearFiles();
  1844. this.closeFileUpdate();
  1845. this.projectConfirmatorFileList = [];
  1846. }else {
  1847. this.$alert(data.msg, '错误', {
  1848. confirmButtonText: '确定'
  1849. })
  1850. }
  1851. })
  1852. },
  1853. closeFileUpdate() {
  1854. this.fileName = '';
  1855. this.uploadDialog = false;
  1856. //this.fileRemark = ''
  1857. this.$refs.uploadFile.clearFiles()
  1858. this.fileList = []
  1859. },
  1860. /*选择上传文件时*/
  1861. onChange(file,fileList){
  1862. const newFileName = file.name;
  1863. if (this.fileName) {
  1864. this.fileName += ', ' + newFileName;
  1865. } else {
  1866. this.fileName = newFileName;
  1867. }
  1868. this.fileList.push(file);
  1869. },
  1870. triggerUpload() {
  1871. this.$refs.uploadFile.$el.querySelector('input').click()
  1872. },
  1873. formatDate(row, column) {
  1874. // row 是当前行的数据对象
  1875. // column 是当前列的属性信息对象
  1876. const date = row[column.property];
  1877. if (date) {
  1878. const s = new Date(date).toLocaleDateString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit' });
  1879. return s.replace(/\//g, '-')
  1880. } else {
  1881. return '';
  1882. }
  1883. },
  1884. rowStyle ({row}) {
  1885. },
  1886. getCombinedDocumentType(row) {
  1887. // 根据您的需求,组合或拼接需要显示的字段
  1888. if (row.documentType === null || row.documentType === undefined) {
  1889. return row.documentDesc
  1890. }else {
  1891. return row.documentType
  1892. }
  1893. },
  1894. // 校验用户是否收藏
  1895. favoriteIsOk () {
  1896. let userFavorite = {
  1897. userId: this.$store.state.user.id,
  1898. languageCode: this.$i18n.locale
  1899. }
  1900. userFavoriteList(userFavorite).then(({data}) => {
  1901. for (let i = 0; i < data.list.length; i++) {
  1902. if (this.$route.meta.menuId === data.list[i].menuId) {
  1903. this.favorite = true
  1904. }
  1905. }
  1906. })
  1907. },
  1908. // 收藏 OR 取消收藏
  1909. favoriteFunction () {
  1910. let userFavorite = {
  1911. userId: this.$store.state.user.id,
  1912. functionId: this.$route.meta.menuId,
  1913. }
  1914. if (this.favorite) {
  1915. removeUserFavorite(userFavorite).then(({data}) => {
  1916. this.$message.success(data.msg)
  1917. this.favorite = false
  1918. })
  1919. } else {
  1920. // 收藏
  1921. saveUserFavorite(userFavorite).then(({data}) => {
  1922. this.$message.success(data.msg)
  1923. this.favorite = true
  1924. })
  1925. }
  1926. },
  1927. // 动态列开始 获取 用户保存的 格式列
  1928. async getTableUserColumn(tableId, columnId) {
  1929. let queryTableUser = {
  1930. userId: this.$store.state.user.name,
  1931. functionId: this.$route.meta.menuId,
  1932. tableId: tableId,
  1933. status: true,
  1934. languageCode: this.$i18n.locale
  1935. }
  1936. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  1937. if (data.rows.length > 0) {
  1938. //this.columnList1 = []
  1939. switch (columnId) {
  1940. case 1:
  1941. this.columnProjectList = data.rows
  1942. break;
  1943. // case 2:
  1944. // this.detailColumnList = data.rows
  1945. // break;
  1946. // case 3:
  1947. // this.columnList2 = data.rows
  1948. // break;
  1949. // case 4:
  1950. // this.columnList3 = data.rows
  1951. // break;
  1952. }
  1953. } else {
  1954. this.getColumnList(tableId, columnId)
  1955. }
  1956. })
  1957. },
  1958. // 获取 tableDefault 列
  1959. async getColumnList (tableId, columnId) {
  1960. let queryTable= {
  1961. functionId: this.$route.meta.menuId,
  1962. tableId: tableId,
  1963. languageCode: this.$i18n.locale
  1964. }
  1965. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  1966. if (!data.rows.length == 0) {
  1967. switch (columnId) {
  1968. case 1:
  1969. this.columnProjectList = data.rows
  1970. break;
  1971. // case 2:
  1972. // this.detailColumnList = data.rows
  1973. // break;
  1974. // case 3:
  1975. // this.columnList2 = data.rows
  1976. // break;
  1977. // case 4:
  1978. // this.columnList3 = data.rows
  1979. // break;
  1980. }
  1981. } else {
  1982. // this.showDefault = true.
  1983. }
  1984. })
  1985. },
  1986. //获取按钮的权限数据
  1987. getButtonAuthData () {
  1988. let searchFlag = this.isAuth(this.menuId+":search")
  1989. let saveFlag = this.isAuth(this.menuId+":save")
  1990. let updateFlag = this.isAuth(this.menuId+":update")
  1991. let deleteFlag = this.isAuth(this.menuId+":delete")
  1992. //处理页面的权限数据
  1993. this.authSearch = !searchFlag
  1994. this.authSave = !saveFlag
  1995. this.authUpdate = !updateFlag
  1996. this.authDelete = !deleteFlag
  1997. },
  1998. },
  1999. };
  2000. </script>
  2001. <style scoped>
  2002. .red-text /deep/ .el-input__inner {
  2003. color: red;
  2004. }
  2005. .card-item {
  2006. cursor: pointer;
  2007. margin-bottom: 20px;
  2008. transition: transform 0.3s, box-shadow 0.3s;
  2009. overflow: hidden;
  2010. //padding: 10px;
  2011. display: flex;
  2012. flex-direction: column;
  2013. justify-content: space-between;
  2014. align-items: center;
  2015. height: 208px;
  2016. width: 230px;
  2017. margin-left: 40px;
  2018. margin-top: 10px;
  2019. }
  2020. .card-item:hover {
  2021. transform: translateY(-5px);
  2022. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  2023. }
  2024. .card-title {
  2025. font-size: 18px;
  2026. font-weight: bold;
  2027. margin-bottom: 10px;
  2028. margin-top: 20px;
  2029. }
  2030. .card-count {
  2031. font-size: 55px;
  2032. color: #17B3A3;
  2033. text-align: center;
  2034. font-weight: bold;
  2035. margin-top: 50px;
  2036. }
  2037. .project-list {
  2038. font-size: 12px;
  2039. color: #333;
  2040. line-height: 1.5;
  2041. margin-bottom: 5px;
  2042. }
  2043. .el-divider {
  2044. margin: 10px 0;
  2045. }
  2046. </style>