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.

957 lines
29 KiB

4 years ago
4 years ago
  1. <template>
  2. <div class="mod-config">
  3. <div>
  4. <span @click="favoriteFunction()">
  5. <icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg" ></icon-svg>
  6. </span>
  7. </div>
  8. <el-form :inline="true" :model="querySysLanguagePack" @keyup.enter.native="getDataList()">
  9. <el-form-item :label="inputLabel.headerInput.label1">
  10. <el-input style="width: 100px;" v-model="queryHeaderData.toolId" ></el-input>
  11. </el-form-item>
  12. <el-form-item :label="inputLabel.headerInput.label2">
  13. <el-input style="width: 100px;" v-model="queryHeaderData.toolInstanceId" ></el-input>
  14. </el-form-item>
  15. <el-form-item>
  16. <el-button @click="getDataList()" type="primary">{{buttons.search}}</el-button>
  17. <el-button @click="saveColumnList()" type="primary" v-show="showDefault">{{buttons.defaultTable}}
  18. </el-button>
  19. <el-button @click="userSetting" type="primary">{{ buttons.settingTable}}</el-button>
  20. <download-excel
  21. :fields="fields()"
  22. :data="exportData"
  23. type="xls"
  24. :name="exportName"
  25. :header="exportHeader"
  26. :footer="exportFooter"
  27. :defaultValue="exportDefaultValue"
  28. :fetch="createExportData"
  29. :before-generate="startDownload"
  30. :before-finish="finishDownload"
  31. worksheet="导出信息"
  32. class="el-button el-button--primary el-button--medium">
  33. {{buttons.download}}
  34. </download-excel>
  35. <el-button v-if="isAuth(':prd:delete')" type="danger" @click="deleteHandle()"
  36. :disabled="dataListSelections.length <= 0">{{ buttons.deleteList}}
  37. </el-button>
  38. </el-form-item>
  39. </el-form>
  40. <el-table
  41. id="commmon"
  42. :height="height"
  43. :data="dataList"
  44. border
  45. v-loading="dataListLoading"
  46. @selection-change="selectionChangeHandle"
  47. style="width: 100%;">
  48. <el-table-column
  49. v-for="(item,index) in columnList" :key="index"
  50. :sortable="item.columnSortable"
  51. :prop="item.columnProp"
  52. :header-align="item.headerAlign"
  53. :show-overflow-tooltip="item.showOverflowTooltip"
  54. :align="item.align"
  55. :fixed="item.fixed"
  56. :width="item.columnWidth"
  57. :label="item.columnLabel">
  58. <template slot-scope="scope">
  59. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  60. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  61. style="width: 100px; height: 80px"/></span>
  62. </template>
  63. </el-table-column>
  64. <el-table-column
  65. v-if="isAuth('checkIn:iscz')"
  66. fixed="right"
  67. header-align="center"
  68. align="center"
  69. width="90"
  70. :label="buttons.cz">
  71. <template slot-scope="scope">
  72. <a @click="alertModel(scope.row ,'Y')">{{buttons.qualified}}</a>
  73. <a @click="alertModel(scope.row ,'N')">{{buttons.unqualified}}</a>
  74. </template>
  75. </el-table-column>
  76. </el-table>
  77. <column v-if="visible" ref="column" @refreshData="getTableUserColumn"></column>
  78. <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-drag :title="inputLabel.modelInput.label1" :visible.sync="setUp.modelFlag" width="350px">
  79. <el-form label-position="top">
  80. <el-form-item :label="inputLabel.modelInput.label2">
  81. <el-input type="textarea" :rows="3" placeholder="请输入内容" style="width: 300px;padding: 0px 3px;" v-model="remark"></el-input>
  82. </el-form-item>
  83. </el-form>
  84. <span slot="footer" class="dialog-footer">
  85. <el-button @click="setUp.modelFlag = false">取消</el-button>
  86. <el-button type="primary" :disabled="setUp.saveModelFlag" @click="modelVerification()">确定</el-button>
  87. </span>
  88. </el-dialog>
  89. </div>
  90. </template>
  91. <script>
  92. import column from "../common/column";
  93. import {
  94. searchSysLanguagePackList,
  95. searchSysLanguageParam,
  96. searchFunctionButtonList,
  97. saveButtonList,
  98. searchSysLanguage,
  99. searchLanguageListByLanguageCode,
  100. saveSysLanguageOne
  101. } from "@/api/sysLanguage.js"
  102. import getLodop from '@/utils/LodopFuncs.js'
  103. import {
  104. saveTableDefaultList,
  105. saveTableUser,
  106. getTableDefaultListLanguage,
  107. getTableUserListLanguage
  108. } from "@/api/table.js"
  109. import {
  110. userFavoriteList,
  111. saveUserFavorite,
  112. removeUserFavorite
  113. } from '@/api/userFavorite.js'
  114. import {
  115. getToolInspectionApplyList,
  116. updateSoToolInspectionApplyList,
  117. inserteEEmailToSendQueue,
  118. } from '@/api/toolMan/checkIn.js'
  119. export default {
  120. components: {
  121. column
  122. },
  123. data() {
  124. return {
  125. currentData : {},
  126. flag : '',
  127. setUp :{
  128. modelFlag : false,
  129. saveModelFlag : false,
  130. },
  131. remark : '',
  132. queryHeaderData: {
  133. site : this.$store.state.user.site,
  134. applyType : '待上机检',
  135. toolInstanceId : '',
  136. toolId : '',
  137. },
  138. inputLabel :{
  139. headerInput : {
  140. label1 : '工具编码',
  141. label2 : '实例编码',
  142. },
  143. modelInput : {
  144. label1 : '审核信息',
  145. label2 : '不合格原因',
  146. },
  147. },
  148. site : this.$store.state.user.site,
  149. userName : this.$store.state.user.name,
  150. // table高度
  151. height:450,
  152. // 是否收藏
  153. favorite: false,
  154. addLanguage: false,
  155. functionId: 1601,
  156. tableId: "offInspection1601",
  157. value1: true,
  158. visible: false,
  159. showDefault: false,
  160. // 默认table 查询参数
  161. queryTable: {
  162. functionId: 1601,
  163. tableId: "offInspection1601",
  164. languageCode: this.$i18n.locale
  165. },
  166. // 用户table 查询参数
  167. queryTableUser: {
  168. userId: this.$store.state.user.name,
  169. functionId: 1601,
  170. tableId: "offInspection1601",
  171. status: true,
  172. languageCode: this.$i18n.locale
  173. },
  174. // 语言词典查询参数
  175. querySysLanguageParam: {
  176. languageCode: this.$i18n.locale
  177. },
  178. // 语言词典集合
  179. sysLanguageParams: [],
  180. // 用户table 配置集合
  181. userColumnList: [],
  182. // 展示列集
  183. columnList: [
  184. {
  185. userId: this.$store.state.user.name,
  186. functionId: 1601,
  187. serialNumber: 'offInspection1601ToolId',
  188. tableId: "offInspection1601",
  189. tableName: "offInspectionTable",
  190. columnProp: "toolId",
  191. headerAlign: "center",
  192. align: "center",
  193. columnLabel: "工具编码",
  194. columnHidden: false,
  195. columnImage: false,
  196. columnSortable: false,
  197. sortLv: 0,
  198. status: true,
  199. fixed: false,
  200. },
  201. {
  202. userId: this.$store.state.user.name,
  203. functionId: 1601,
  204. serialNumber: 'offInspection1601ToolInstanceId',
  205. tableId: "offInspection1601",
  206. tableName: "offInspectionTable",
  207. columnProp: "toolInstanceId",
  208. headerAlign: "center",
  209. align: "center",
  210. columnLabel: "实例编码",
  211. columnHidden: false,
  212. columnImage: false,
  213. columnSortable: false,
  214. sortLv: 0,
  215. status: true,
  216. fixed: false,
  217. },
  218. {
  219. userId: this.$store.state.user.name,
  220. functionId: 1601,
  221. serialNumber: 'offInspection1601ToolDescription',
  222. tableId: "offInspection1601",
  223. tableName: "offInspectionTable",
  224. columnProp: "toolDescription",
  225. headerAlign: "center",
  226. align: "center",
  227. columnLabel: "工具名称",
  228. columnHidden: false,
  229. columnImage: false,
  230. columnSortable: false,
  231. sortLv: 0,
  232. status: true,
  233. fixed: false,
  234. },
  235. {
  236. userId: this.$store.state.user.name,
  237. functionId: 1601,
  238. serialNumber: 'offInspection1601AppliedBy',
  239. tableId: "offInspection1601",
  240. tableName: "offInspectionTable",
  241. columnProp: "userDisplay",
  242. headerAlign: "center",
  243. align: "center",
  244. columnLabel: "申请人",
  245. columnHidden: false,
  246. columnImage: false,
  247. columnSortable: false,
  248. sortLv: 0,
  249. status: true,
  250. fixed: false,
  251. },
  252. {
  253. userId: this.$store.state.user.name,
  254. functionId: 1601,
  255. serialNumber: 'offInspection1601AppliedDate',
  256. tableId: "offInspection1601",
  257. tableName: "offInspectionTable",
  258. columnProp: "appliedDate",
  259. headerAlign: "center",
  260. align: "center",
  261. columnLabel: "申请时间",
  262. columnHidden: false,
  263. columnImage: false,
  264. columnSortable: false,
  265. sortLv: 0,
  266. status: true,
  267. fixed: false,
  268. },
  269. {
  270. userId: this.$store.state.user.name,
  271. functionId: 1601,
  272. serialNumber: 'offInspection1601OrderNo',
  273. tableId: "offInspection1601",
  274. tableName: "offInspectionTable",
  275. columnProp: "orderNo",
  276. headerAlign: "center",
  277. align: "center",
  278. columnLabel: "工单号",
  279. columnHidden: false,
  280. columnImage: false,
  281. columnSortable: false,
  282. sortLv: 0,
  283. status: true,
  284. fixed: false,
  285. },
  286. // {
  287. // userId: this.$store.state.user.name,
  288. // functionId: 1601,
  289. // serialNumber: 'offInspection1601PartNo',
  290. // tableId: "offInspection1601",
  291. // tableName: "offInspectionTable",
  292. // columnProp: "partNo",
  293. // headerAlign: "center",
  294. // align: "center",
  295. // columnLabel: "物料编码",
  296. // columnHidden: false,
  297. // columnImage: false,
  298. // columnSortable: false,
  299. // sortLv: 0,
  300. // status: true,
  301. // fixed: false,
  302. // columnWidth : 100,
  303. // },
  304. // {
  305. // userId: this.$store.state.user.name,
  306. // functionId: 1601,
  307. // serialNumber: 'offInspection1601PartDesc',
  308. // tableId: "offInspection1601",
  309. // tableName: "offInspectionTable",
  310. // columnProp: "partDesc",
  311. // headerAlign: "center",
  312. // align: "center",
  313. // columnLabel: "物料名称",
  314. // columnHidden: false,
  315. // columnImage: false,
  316. // columnSortable: false,
  317. // sortLv: 0,
  318. // status: true,
  319. // fixed: false,
  320. // },
  321. ],
  322. // 展示列集
  323. columnList1: [
  324. // {
  325. // userId: this.$store.state.user.name,
  326. // functionId: 1601,
  327. // tableId: "common1002",
  328. // tableName: "commonLanguage",
  329. // columnProp: "functionId",
  330. // headerAlign: "center",
  331. // align: "center",
  332. // columnLabel: "功能编码",
  333. // columnHidden: false,
  334. // columnImage: false,
  335. // columnSortable: true,
  336. // sortLv: 0,
  337. // status: true,
  338. // fixed: false
  339. // },
  340. // {
  341. // userId: this.$store.state.user.name,
  342. // functionId: 1601,
  343. // tableId: "common1002",
  344. // tableName: "commonLanguage",
  345. // columnProp: "objectId",
  346. // headerAlign: "center",
  347. // align: "center",
  348. // columnLabel: "序列化编码",
  349. // columnHidden: false,
  350. // columnImage: false,
  351. // columnSortable: true,
  352. // sortLv: 0,
  353. // status: true,
  354. // fixed: false,
  355. // },
  356. // {
  357. // userId: this.$store.state.user.name,
  358. // functionId: 1601,
  359. // tableId: "common1002",
  360. // tableName: "commonLanguage",
  361. // columnProp: "objectType",
  362. // headerAlign: "center",
  363. // align: "center",
  364. // columnLabel: "类型",
  365. // columnHidden: false,
  366. // columnImage: false,
  367. // columnSortable: true,
  368. // sortLv: 0,
  369. // status: true,
  370. // fixed: false,
  371. // },
  372. // {
  373. // userId: this.$store.state.user.name,
  374. // functionId: 1601,
  375. // tableId: "common1002",
  376. // tableName: "commonLanguage",
  377. // columnProp: "languageValue",
  378. // headerAlign: "center",
  379. // align: "center",
  380. // columnLabel: "语言值",
  381. // columnHidden: false,
  382. // columnImage: false,
  383. // columnSortable: true,
  384. // sortLv: 0,
  385. // status: true,
  386. // fixed: false,
  387. // },
  388. // {
  389. // userId: this.$store.state.user.name,
  390. // functionId: 1601,
  391. // tableId: "common1002",
  392. // tableName: "commonLanguage",
  393. // columnProp: "languageCode",
  394. // headerAlign: "center",
  395. // align: "center",
  396. // columnLabel: "语言编码",
  397. // columnHidden: false,
  398. // columnImage: false,
  399. // columnSortable: true,
  400. // sortLv: 0,
  401. // status: true,
  402. // fixed: false,
  403. // }
  404. ],
  405. // 数据集
  406. dataList: [],
  407. queryButton: {
  408. functionId: 1601,
  409. table_id: 'common1001',
  410. languageCode: this.$i18n.locale,
  411. objectType: 'button'
  412. },
  413. buttons: {
  414. add: '添加',
  415. edit: '编辑',
  416. delete: '删除',
  417. deleteList: '批量删除',
  418. cz: '操作',
  419. search: '查询',
  420. download: '导出',
  421. settingTable: '设置列表',
  422. defaultTable: '设置默认配置',
  423. qualified : '合格',
  424. unqualified : '不合格',
  425. },
  426. // 导出 start
  427. exportData: [],
  428. exportName: "页面功能语言",
  429. exportHeader: ["页面功能语言"],
  430. exportFooter: [],
  431. exportDefaultValue: "这一行这一列没有数据",
  432. // 导出 end
  433. buttonList: [
  434. // {
  435. // functionId: "1601",
  436. // languageValue: '添加',
  437. // objectId: 'add',
  438. // objectType: "button",
  439. // tableId: "common1001"
  440. // },
  441. // {
  442. // functionId: "1601",
  443. // languageValue: '编辑',
  444. // objectId: 'edit',
  445. // objectType: "button",
  446. // tableId: "common1001"
  447. // },
  448. // {
  449. // functionId: "1601",
  450. // languageValue: '删除',
  451. // objectId: 'delete',
  452. // objectType: "button",
  453. // tableId: "common1001"
  454. // },
  455. // {
  456. // functionId: "1601",
  457. // languageValue: '批量删除',
  458. // objectId: 'deleteList',
  459. // objectType: "button",
  460. // tableId: "common1001"
  461. // },
  462. // {
  463. // functionId: "1601",
  464. // languageValue: '操作',
  465. // objectId: 'cz',
  466. // objectType: "button",
  467. // tableId: "common1001"
  468. // },
  469. // {
  470. // functionId: "1601",
  471. // languageValue: '查询',
  472. // objectId: 'search',
  473. // objectType: "button",
  474. // tableId: "common1001"
  475. // },
  476. // {
  477. // functionId: "1601",
  478. // languageValue: '导出',
  479. // objectId: 'download',
  480. // objectType: "button",
  481. // tableId: "common1001"
  482. // },
  483. // {
  484. // functionId: "1601",
  485. // languageValue: '设置列表',
  486. // objectId: 'settingTable',
  487. // objectType: "button",
  488. // tableId: "common1001"
  489. // },
  490. // {
  491. // functionId: "1601",
  492. // languageValue: '设置默认配置',
  493. // objectId: 'defaultTable',
  494. // objectType: "button",
  495. // tableId: "common1001"
  496. // }
  497. ],
  498. languageList: [],
  499. languageColumnList: [],
  500. languageDataList: [],
  501. queryLanguage: {},
  502. // 数据集条件
  503. querySysLanguagePack: {
  504. functionId: '',
  505. page: 1,
  506. limit: 1,
  507. languageValue: '',
  508. objectType: '',
  509. objectId: ''
  510. },
  511. // 分页
  512. pageIndex: 1,
  513. pageSize: 20,
  514. totalPage: 0,
  515. dataListLoading: false,
  516. dataListSelections: [],
  517. addOrUpdateVisible: false
  518. }
  519. },
  520. mounted() {
  521. this.$nextTick(()=>{
  522. this.height = window.innerHeight - 200;
  523. })
  524. },
  525. activated() {
  526. this.getDataList()
  527. this.getLanguageList()
  528. },
  529. methods: {
  530. saveEmail(row){
  531. let saveData = {
  532. seqNo : '9005',
  533. submitedBy : this.userName,
  534. content : 1,
  535. tableName : 'tool_detail',
  536. key1 : 'site',
  537. key2 : 'tool_instance_id',
  538. key3 : '',
  539. values1 : row.site,
  540. values2 : row.toolInstanceId,
  541. values3 : '',
  542. additionEmailAddress : row.email,
  543. }
  544. inserteEEmailToSendQueue(saveData).then(({data}) =>{
  545. })
  546. },
  547. alertModel(row ,passFlag){
  548. let status = ''
  549. if(passFlag == 'Y'){
  550. status = '合格'
  551. }else {
  552. status = '不合格'
  553. }
  554. this.$confirm(`确定该工具` + status + '?', '操作提示', {
  555. confirmButtonText: '确定',
  556. cancelButtonText: '取消',
  557. type: 'warning'
  558. }).then(() => {
  559. this.currentData = row
  560. this.flag = passFlag
  561. this.remark = ''
  562. if(passFlag == 'N'){
  563. this.setUp.modelFlag = true
  564. }else {
  565. this.saveToolInspection(row ,passFlag)
  566. }
  567. })
  568. },
  569. modelVerification(){
  570. this.saveModelFlag = true
  571. if(this.remark == ''){
  572. this.$alert('请输入原因!', '操作提示', {
  573. confirmButtonText: '确定',
  574. type :"warning",
  575. callback: action => {
  576. this.saveModelFlag = false
  577. }
  578. });
  579. return false
  580. }
  581. this.saveModelFlag = false
  582. this.setUp.modelFlag = false
  583. this.saveToolInspection(this.currentData ,this.flag)
  584. },
  585. saveToolInspection(row ,passFlag){
  586. let status = ''
  587. let updateFlag = 'N'
  588. let addToolingHistFlag = 'Y'
  589. if(passFlag == 'Y'){
  590. status = '合格'
  591. }else {
  592. status = '不合格'
  593. updateFlag = 'Y'
  594. addToolingHistFlag = 'N'
  595. }
  596. let applyType = "";
  597. let addFlag = "N";
  598. if(passFlag == "N"){
  599. applyType = "待隔离处理";
  600. addFlag = "Y";
  601. }
  602. if(row.remark == null){
  603. row.remark= "";
  604. }
  605. let saveList = []
  606. let saveData = {
  607. id :row.id ,
  608. passFlag : passFlag,
  609. actCheckBy : this.userName,
  610. site : row.site,
  611. toolInstanceId : row.toolInstanceId,
  612. status : status,
  613. orderref1 : row.orderref1,
  614. toolId : row.toolId,
  615. applyType : row.applyType,
  616. newApplyType : applyType,
  617. addFlag : addFlag,
  618. checkBy :row.checkBy,
  619. // remark : row.remark,
  620. updateFlag : updateFlag,
  621. addToolingHistFlag : addToolingHistFlag,
  622. remark : this.remark,
  623. }
  624. saveList.push(saveData)
  625. updateSoToolInspectionApplyList(saveList).then(({data}) => {
  626. if(data.code == 0){
  627. this.$message.success(data.msg)
  628. this.getDataList()
  629. if (passFlag == 'N'){
  630. this.setUp.modelFlag = false
  631. this.saveEmail()
  632. }
  633. }else {
  634. this.$alert(data.msg, '操作提示', {
  635. confirmButtonText: '确定',
  636. type :"warning",
  637. callback: action => {
  638. }
  639. });
  640. }
  641. })
  642. },
  643. // 打印方式
  644. printReport(){
  645. alert( this.$store.state.user.site)
  646. //
  647. // const LODOP = getLodop()
  648. // if (LODOP) {
  649. // var strBodyStyle = '<style>'
  650. // strBodyStyle += 'table { border-top: 1 solid #000000; border-left: 1 solid #000000; border-collapse:collapse; border-spacing:0;}'
  651. // strBodyStyle += 'caption { line-height:2em; }'
  652. // strBodyStyle += 'td { border-right: 1 solid #000000; border-bottom: 1 solid #000000; text-align:center; padding:2px 3px; font-size:11px;}'
  653. // strBodyStyle += '</style>' //设置打印样式
  654. // var strFormHtml = strBodyStyle + '<body>' + document.getElementById('commmon').innerHTML + '</body>' //获取打印内容
  655. //
  656. // LODOP.PRINT_INIT('') //初始化
  657. // LODOP.PRINT_DESIGN();
  658. // //LODOP.PREVIEW();
  659. // //LODOP.PRINT();
  660. //
  661. // LODOP.SET_PRINT_PAGESIZE(2, 0, 0, 'A4') //设置横向
  662. // LODOP.ADD_PRINT_HTM('1%', '1%', '98%', '98%', strFormHtml) //设置打印内容
  663. // LODOP.SET_PREVIEW_WINDOW(2, 0, 0, 800, 600, '') //设置预览窗口模式和大小
  664. // LODOP.PREVIEW()
  665. // }
  666. },
  667. // 校验用户是否收藏
  668. favoriteIsOk(){
  669. let userFavorite ={
  670. userId:this.$store.state.user.id,
  671. languageCode:this.$i18n.locale
  672. }
  673. userFavoriteList(userFavorite).then(({data}) =>{
  674. let size = data.list.filter(item => item.userId==userFavorite.menuId).length;
  675. if (size>0){
  676. this.favorite = true
  677. }else {
  678. this.favorite = false
  679. }
  680. })
  681. },
  682. // 收藏 OR 取消收藏
  683. favoriteFunction(){
  684. let userFavorite ={
  685. userId: this.$store.state.user.id,
  686. functionId: this.$route.meta.menuId,
  687. }
  688. if (this.favorite){
  689. // 取消收藏
  690. this.$confirm(`确定取消收藏`, '提示', {
  691. confirmButtonText: '确定',
  692. cancelButtonText: '取消',
  693. type: 'warning'
  694. }).then(() => {
  695. removeUserFavorite(userFavorite).then(({data})=>{
  696. this.$message.success(data.msg)
  697. this.favorite = false
  698. })
  699. })
  700. }else {
  701. // 收藏
  702. saveUserFavorite(userFavorite).then(({data})=>{
  703. this.$message.success(data.msg)
  704. this.favorite = true
  705. })
  706. }
  707. },
  708. // 保存语言编辑
  709. saveLanguageList(val) {
  710. saveSysLanguageOne(val).then(({data}) => {
  711. if (data.code == 0) {
  712. this.$message.success(data.msg)
  713. } else {
  714. this.$message.error(data.msg)
  715. }
  716. })
  717. },
  718. // 编辑语言
  719. addLanguageFun() {
  720. if (this.querySysLanguagePack.languageCode) {
  721. this.addLanguage = true
  722. this.languageColumnList = []
  723. let query = {
  724. functionId: 1601,
  725. tableId: "common1002",
  726. languageCode: this.$i18n.locale
  727. }
  728. getTableDefaultListLanguage(query).then(({data}) => {
  729. if (data.rows.length > 0) {
  730. this.languageColumnList = data.rows
  731. }
  732. })
  733. this.languageColumnList = this.columnList
  734. searchLanguageListByLanguageCode(this.querySysLanguagePack).then(({data}) => {
  735. this.languageDataList = data.rows
  736. })
  737. } else {
  738. this.$message("请选中一种语言")
  739. }
  740. },
  741. // 获取多语言列表
  742. getLanguageList() {
  743. searchSysLanguage(this.queryLanguage).then(({data}) => {
  744. this.languageList = data.rows
  745. })
  746. },
  747. // 获取button的词典
  748. getFunctionButtonList() {
  749. searchFunctionButtonList(this.queryButton).then(({data}) => {
  750. if (JSON.stringify(data.data) != '{}' ) {
  751. this.buttons = data.data
  752. } else {
  753. // saveButtonList(this.buttonList).then(({data}) => {
  754. // })
  755. }
  756. })
  757. },
  758. // 获取语言词典
  759. getSysLanguageParamList() {
  760. searchSysLanguageParam(this.querySysLanguageParam).then(({data}) => {
  761. this.sysLanguageParams = data.rows
  762. })
  763. },
  764. // 打开页面设置
  765. userSetting() {
  766. this.visible = true;
  767. let queryTable = {
  768. userId: this.$store.state.user.name,
  769. functionId: 1601,
  770. tableId: "common1001",
  771. languageCode: this.$i18n.locale
  772. }
  773. this.$nextTick(() => {
  774. this.$refs.column.init(queryTable);
  775. });
  776. },
  777. // 获取 用户保存的 格式列
  778. getTableUserColumn() {
  779. getTableUserListLanguage(this.queryTableUser).then(({data}) => {
  780. if (data.rows.length > 0) {
  781. //this.columnList = []
  782. this.columnList = data.rows
  783. } else {
  784. this.getColumnList()
  785. }
  786. })
  787. },
  788. // 保存 默认配置 列
  789. saveColumnList() {
  790. saveTableDefaultList(this.columnList).then(({data}) => {
  791. if (data.code == 0) {
  792. this.$message.success(data.msg)
  793. this.showDefault = false
  794. } else {
  795. this.$message.error(data.msg)
  796. }
  797. })
  798. saveTableDefaultList(this.columnList1).then(({data}) => {
  799. if (data.code == 0) {
  800. this.$message.success(data.msg)
  801. this.showDefault = false
  802. } else {
  803. this.$message.error(data.msg)
  804. }
  805. })
  806. saveButtonList(this.buttonList).then(({data}) => {
  807. })
  808. this.getFunctionButtonList()
  809. this.getFunctionButtonList();
  810. this.getColumnList()
  811. },
  812. // 获取 tableDefault 列
  813. getColumnList() {
  814. getTableDefaultListLanguage(this.queryTable).then(({data}) => {
  815. if (!data.rows.length == 0) {
  816. this.showDefault = false
  817. this.columnList = data.rows
  818. } else {
  819. this.showDefault = true
  820. }
  821. })
  822. },
  823. // 获取数据列表
  824. getDataList() {
  825. this.dataListLoading = true
  826. getToolInspectionApplyList(this.queryHeaderData).then(({data}) => {
  827. if (data && data.code === 0) {
  828. this.dataList = data.rows
  829. } else {
  830. this.dataList = []
  831. }
  832. this.dataListLoading = false
  833. })
  834. },
  835. // 每页数
  836. sizeChangeHandle(val) {
  837. this.pageSize = val
  838. this.pageIndex = 1
  839. this.getDataList()
  840. },
  841. // 当前页
  842. currentChangeHandle(val) {
  843. this.pageIndex = val
  844. this.getDataList()
  845. },
  846. // 多选
  847. selectionChangeHandle(val) {
  848. this.dataListSelections = val
  849. },
  850. // 删除
  851. deleteHandle(id) {
  852. var ids = id ? [id] : this.dataListSelections.map(item => {
  853. return item.id
  854. })
  855. this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
  856. confirmButtonText: '确定',
  857. cancelButtonText: '取消',
  858. type: 'warning'
  859. }).then(() => {
  860. this.$http({
  861. url: this.$http.adornUrl('//prd/delete'),
  862. method: 'post',
  863. data: this.$http.adornData(ids, false)
  864. }).then(({data}) => {
  865. if (data && data.code === 0) {
  866. this.$message({
  867. message: '操作成功',
  868. type: 'success',
  869. duration: 1500,
  870. onClose: () => {
  871. this.getDataList()
  872. }
  873. })
  874. } else {
  875. this.$message.error(data.msg)
  876. }
  877. })
  878. })
  879. },
  880. // 导出
  881. fields(){
  882. let json = "{"
  883. this.columnList.forEach((item,index) =>{
  884. if (index == this.columnList.length-1 ){
  885. json +="\""+item.columnLabel+"\"" +":"+"\""+item.columnProp+"\""
  886. }else {
  887. json += "\""+item.columnLabel+"\"" +":"+"\""+item.columnProp+"\""+ ","
  888. }
  889. })
  890. json +="}"
  891. let s = eval("(" + json + ")")
  892. return s
  893. },
  894. createExportData() {
  895. // 点击导出按钮之后,开始导出数据之前的执行函数,返回值为需要下载的数据
  896. // TODO:构造需要下载的数据返回
  897. if(this.dataListSelections.length>0){
  898. return this.dataListSelections;
  899. }
  900. return this.dataList;
  901. },
  902. startDownload() {
  903. // this.exportData = this.dataList
  904. },
  905. finishDownload() {
  906. }
  907. },
  908. created() {
  909. this.getTableUserColumn()
  910. this.getSysLanguageParamList()
  911. this.getFunctionButtonList()
  912. this.favoriteIsOk()
  913. }
  914. }
  915. </script>
  916. <style scoped >
  917. .wrapper {
  918. height: calc(100% - 40px);
  919. }
  920. .sl-input {
  921. background-color: transparent;
  922. border: 0 !important;
  923. font-size: 12px !important;
  924. height: 12px !important;
  925. line-height: 14px !important;
  926. background-color: transparent !important;
  927. width: 140px;
  928. }
  929. .sl-input:focus, textarea:focus {
  930. outline: none;
  931. }
  932. .sl-svg{
  933. overflow: hidden;
  934. float: right;
  935. }
  936. </style>