赫艾前端
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.

784 lines
25 KiB

  1. <template>
  2. <div class="mod-config">
  3. <!-- 条件查询 -->
  4. <el-form :inline="true" label-position="top" :model="searchData">
  5. <!-- <el-form-item :label="'BU'">-->
  6. <!-- <el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 80px">-->
  7. <!-- <el-option-->
  8. <!-- v-for = "i in userBuList"-->
  9. <!-- :key = "i.buNo"-->
  10. <!-- :label = "i.buDesc"-->
  11. <!-- :value = "i.buDesc">-->
  12. <!-- </el-option>-->
  13. <!-- </el-select>-->
  14. <!-- </el-form-item>-->
  15. <el-form-item :label="'工厂编码'">
  16. <el-input v-model="searchData.site" clearable style="width: 120px"></el-input>
  17. </el-form-item>
  18. <el-form-item :label="'样本量编码'">
  19. <el-input v-model="searchData.samplingQtyNo" clearable style="width: 120px"></el-input>
  20. </el-form-item>
  21. <el-form-item :label="'样本量字码'">
  22. <el-input v-model="searchData.samplingQtyDesc" clearable style="width: 120px"></el-input>
  23. </el-form-item>
  24. <el-form-item :label="'样本量'">
  25. <el-input v-model="searchData.samplingQty" clearable style="width: 120px"></el-input>
  26. </el-form-item>
  27. <el-form-item :label="'是否可用'">
  28. <el-select v-model="searchData.samplingQtyActive" style="width: 80px">
  29. <el-option label="全部" value=""></el-option>
  30. <el-option label="是" value="Y"></el-option>
  31. <el-option label="否" value="N"></el-option>
  32. </el-select>
  33. </el-form-item>
  34. <el-form-item :label="' '">
  35. <el-button v-if="!authSearch" type="primary" @click="getDataList()">查询</el-button>
  36. <el-button v-if="!authSave" type="primary" @click="addModal()">新增</el-button>
  37. <el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</el-button>
  38. <!-- <download-excel-->
  39. <!-- :fields="fields()"-->
  40. <!-- :data="exportData"-->
  41. <!-- type="xls"-->
  42. <!-- :name="exportName"-->
  43. <!-- :header="exportHeader"-->
  44. <!-- :footer="exportFooter"-->
  45. <!-- :fetch="createExportData"-->
  46. <!-- :before-generate="startDownload"-->
  47. <!-- :before-finish="finishDownload"-->
  48. <!-- worksheet="导出信息"-->
  49. <!-- class="el-button el-button&#45;&#45;primary el-button&#45;&#45;medium">-->
  50. <!-- {{ "导出" }}-->
  51. <!-- </download-excel>-->
  52. </el-form-item>
  53. </el-form>
  54. <!-- 展示列表 -->
  55. <el-table
  56. :height="height"
  57. :data="dataList"
  58. border
  59. style="width: 100%;">
  60. <el-table-column
  61. v-for="(item,index) in columnList" :key="index"
  62. :sortable="item.columnSortable"
  63. :prop="item.columnProp"
  64. :header-align="item.headerAlign"
  65. :show-overflow-tooltip="item.showOverflowTooltip"
  66. :align="item.align"
  67. :fixed="item.fixed===''?false:item.fixed"
  68. :min-width="item.columnWidth"
  69. :label="item.columnLabel">
  70. <template slot-scope="scope">
  71. <span v-if="!item.columnHidden">
  72. <span v-if="columnsProp.includes(item.columnProp)">{{ scope.row[`${item.columnProp}Desc`] }}</span>
  73. <span v-else>
  74. {{ scope.row[item.columnProp] }}
  75. </span>
  76. </span>
  77. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  78. </template>
  79. </el-table-column>
  80. <el-table-column
  81. fixed="right"
  82. header-align="center"
  83. align="center"
  84. width="160"
  85. label="操作">
  86. <template slot-scope="scope">
  87. <a v-if="!authUpdate" type="text" size="small" @click="updateModal(scope.row)">修改</a>
  88. <a v-if="!authDelete" type="text" size="small" @click="deleteModal(scope.row)">删除</a>
  89. </template>
  90. </el-table-column>
  91. </el-table>
  92. <el-pagination
  93. @size-change="sizeChangeHandle"
  94. @current-change="currentChangeHandle"
  95. :current-page="pageIndex"
  96. :page-sizes="[20, 50, 100, 200, 500]"
  97. :page-size="pageSize"
  98. :total="totalPage"
  99. layout="total, sizes, prev, pager, next, jumper">
  100. </el-pagination>
  101. <!-- 新增和修改 -->
  102. <el-dialog title="检验方法" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="430px">
  103. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  104. <!-- <el-form-item label="BU" prop="bu" :rules="rules.bu">-->
  105. <!-- <el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 390px">-->
  106. <!-- <el-option-->
  107. <!-- v-for = "i in userBuList"-->
  108. <!-- :key = "i.buNo"-->
  109. <!-- :label = "i.sitename"-->
  110. <!-- :value = "i.buNo">-->
  111. <!-- <span style="float: left;width: 100px">{{ i.sitename }}</span>-->
  112. <!-- <span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px">-->
  113. <!-- {{ i.buDesc }}-->
  114. <!-- </span>-->
  115. <!-- </el-option>-->
  116. <!-- </el-select>-->
  117. <!-- </el-form-item>-->
  118. <el-form-item label="工厂编码:" prop="site" :rules="rules.site">
  119. <el-input v-model="modalData.site" disabled style="width: 120px"></el-input>
  120. </el-form-item>
  121. </el-form>
  122. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  123. <el-form-item label="样本量字码:" prop="samplingQtyDesc" :rules="rules.samplingQtyDescType">
  124. <el-input v-model="modalData.samplingQtyDesc" style="width: 120px"></el-input>
  125. </el-form-item>
  126. <el-form-item label="样本量:" prop="samplingQty" :rules="rules.samplingQtyType">
  127. <el-input v-model="modalData.samplingQty" type="number" style="width: 120px"></el-input>
  128. </el-form-item>
  129. <el-form-item :label="'是否可用'" prop="samplingQtyActive" :rules="rules.samplingQtyActiveType">
  130. <el-select filterable v-model="modalData.samplingQtyActive" style="width: 120px">
  131. <el-option label="是" value="Y"></el-option>
  132. <el-option label="否" value="N"></el-option>
  133. </el-select>
  134. </el-form-item>
  135. </el-form>
  136. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  137. <el-form-item label="样本量说明:">
  138. <el-input v-model="modalData.samplingQtyRemark" style="width: 390px"></el-input>
  139. </el-form-item>
  140. </el-form>
  141. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  142. <el-button type="primary" @click="saveData()">保存</el-button>
  143. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  144. </el-footer>
  145. </el-dialog>
  146. </div>
  147. </template>
  148. <script>
  149. import {
  150. samplingQtySearch, // 查询样本量
  151. samplingQtySave, // 新增样本量
  152. samplingQtyUpdate, // 修改样本量
  153. samplingQtyDelete, // 删除样本量
  154. getSiteAndBuByUserName
  155. } from "@/api/qc/qc.js"
  156. import excel from "@/utils/excel-util.js";
  157. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  158. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  159. export default {
  160. watch: {
  161. searchData: {
  162. deep: true,
  163. handler: function (newV, oldV) {
  164. this.searchData.samplingQtyDesc = this.searchData.samplingQtyDesc.toUpperCase()
  165. }
  166. },
  167. modalData: {
  168. deep: true,
  169. handler: function (newV, oldV) {
  170. this.modalData.samplingQtyDesc = this.modalData.samplingQtyDesc.toUpperCase()
  171. }
  172. }
  173. },
  174. data () {
  175. return {
  176. columnsProp:['createBy', 'samplingQtyActive', 'updateBy'],
  177. // 是否收藏
  178. favorite: false,
  179. // 导出 start
  180. exportData: [],
  181. exportName: "样本量" + this.dayjs().format('YYYYMMDDHHmmss'),
  182. exportHeader: ["样本量"],
  183. exportFooter: [],
  184. exportList: [],
  185. // 导出 end
  186. searchData: {
  187. site: '',
  188. userName: this.$store.state.user.name,
  189. samplingQtyNo: '',
  190. samplingQtyDesc: '',
  191. samplingQty: '',
  192. samplingQtyActive: '',
  193. buDesc: '',
  194. page: 1,
  195. limit: 10,
  196. },
  197. pageIndex: 1,
  198. pageSize: 20,
  199. totalPage: 0,
  200. height: 200,
  201. dataList: [],
  202. modalFlag: false,
  203. modalDisableFlag: false,
  204. modalData: {
  205. flag: '',
  206. site: '',
  207. bu: '',
  208. samplingQtyNo: '',
  209. samplingQtyDesc: '',
  210. samplingQty: '',
  211. samplingQtyRemark: '',
  212. samplingQtyActive: '',
  213. createBy: this.$store.state.user.name,
  214. updateBy: this.$store.state.user.name
  215. },
  216. // 标头展示
  217. columnList: [
  218. {
  219. userId: this.$store.state.user.name,
  220. functionId: 301009,
  221. serialNumber: '301009TableSite',
  222. tableId: "301009Table",
  223. tableName: "样本大小表",
  224. columnProp: 'site',
  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: '',
  234. columnWidth: 100,
  235. },
  236. {
  237. userId: this.$store.state.user.name,
  238. functionId: 301009,
  239. serialNumber: '301009TableSamplingQtyNo',
  240. tableId: "301009Table",
  241. tableName: "样本大小表",
  242. columnProp: 'samplingQtyNo',
  243. headerAlign: 'center',
  244. align: "center",
  245. columnLabel: '样本量编码',
  246. columnHidden: false,
  247. columnImage: false,
  248. columnSortable: false,
  249. sortLv: 0,
  250. status: true,
  251. fixed: '',
  252. columnWidth: 100,
  253. },
  254. {
  255. userId: this.$store.state.user.name,
  256. functionId: 301009,
  257. serialNumber: '301009TableSamplingQtyDesc',
  258. tableId: "301009Table",
  259. tableName: "样本大小表",
  260. columnProp: 'samplingQtyDesc',
  261. headerAlign: 'center',
  262. align: "center",
  263. columnLabel: '样本量字码',
  264. columnHidden: false,
  265. columnImage: false,
  266. columnSortable: false,
  267. sortLv: 0,
  268. status: true,
  269. fixed: '',
  270. columnWidth: 100,
  271. },
  272. {
  273. userId: this.$store.state.user.name,
  274. functionId: 301009,
  275. serialNumber: '301009TableSamplingQty',
  276. tableId: "301009Table",
  277. tableName: "样本大小表",
  278. columnProp: 'samplingQty',
  279. headerAlign: 'center',
  280. align: "right",
  281. columnLabel: '样本量',
  282. columnHidden: false,
  283. columnImage: false,
  284. columnSortable: false,
  285. sortLv: 0,
  286. status: true,
  287. fixed: '',
  288. columnWidth: 100,
  289. },
  290. {
  291. userId: this.$store.state.user.name,
  292. functionId: 301009,
  293. serialNumber: '301009TableSamplingQtyRemark',
  294. tableId: "301009Table",
  295. tableName: "样本大小表",
  296. columnProp: 'samplingQtyRemark',
  297. headerAlign: 'center',
  298. align: "left",
  299. columnLabel: '样本量说明',
  300. columnHidden: false,
  301. columnImage: false,
  302. columnSortable: false,
  303. sortLv: 0,
  304. status: true,
  305. fixed: '',
  306. columnWidth: 200,
  307. },
  308. {
  309. userId: this.$store.state.user.name,
  310. functionId: 301009,
  311. serialNumber: '301009TableSamplingQtyActive',
  312. tableId: "301009Table",
  313. tableName: "样本大小表",
  314. columnProp: 'samplingQtyActive',
  315. headerAlign: 'center',
  316. align: "center",
  317. columnLabel: '是否可用',
  318. columnHidden: false,
  319. columnImage: false,
  320. columnSortable: false,
  321. sortLv: 0,
  322. status: true,
  323. fixed: '',
  324. columnWidth: 100,
  325. },
  326. {
  327. userId: this.$store.state.user.name,
  328. functionId: 301009,
  329. serialNumber: '301009TableCreateDate',
  330. tableId: "301009Table",
  331. tableName: "样本大小表",
  332. columnProp: 'createDate',
  333. headerAlign: 'center',
  334. align: "center",
  335. columnLabel: '创建时间',
  336. columnHidden: false,
  337. columnImage: false,
  338. columnSortable: false,
  339. sortLv: 0,
  340. status: true,
  341. fixed: '',
  342. columnWidth: 170,
  343. },
  344. {
  345. userId: this.$store.state.user.name,
  346. functionId: 301009,
  347. serialNumber: '301009TableCreateBy',
  348. tableId: "301009Table",
  349. tableName: "样本大小表",
  350. columnProp: 'createBy',
  351. headerAlign: 'center',
  352. align: "center",
  353. columnLabel: '创建人',
  354. columnHidden: false,
  355. columnImage: false,
  356. columnSortable: false,
  357. sortLv: 0,
  358. status: true,
  359. fixed: '',
  360. columnWidth: 100,
  361. },
  362. {
  363. userId: this.$store.state.user.name,
  364. functionId: 301009,
  365. serialNumber: '301009TableUpdateDate',
  366. tableId: "301009Table",
  367. tableName: "样本大小表",
  368. columnProp: 'updateDate',
  369. headerAlign: 'center',
  370. align: "center",
  371. columnLabel: '更新时间',
  372. columnHidden: false,
  373. columnImage: false,
  374. columnSortable: false,
  375. sortLv: 0,
  376. status: true,
  377. fixed: '',
  378. columnWidth: 170,
  379. },
  380. {
  381. userId: this.$store.state.user.name,
  382. functionId: 301009,
  383. serialNumber: '301009TableUpdateBy',
  384. tableId: "301009Table",
  385. tableName: "样本大小表",
  386. columnProp: 'updateBy',
  387. headerAlign: 'center',
  388. align: "center",
  389. columnLabel: '更新人',
  390. columnHidden: false,
  391. columnImage: false,
  392. columnSortable: false,
  393. sortLv: 0,
  394. status: true,
  395. fixed: '',
  396. columnWidth: 100,
  397. },
  398. ],
  399. rules: {
  400. site:[
  401. {
  402. required: true,
  403. message: ' ',
  404. trigger: ['blur','change']
  405. }
  406. ],
  407. samplingQtyDescType:[
  408. {
  409. required: true,
  410. message: ' ',
  411. trigger: ['blur','change']
  412. }
  413. ],
  414. samplingQtyType:[
  415. {
  416. required: true,
  417. message: ' ',
  418. trigger: ['blur','change']
  419. }
  420. ],
  421. samplingQtyActiveType:[
  422. {
  423. required: true,
  424. message: ' ',
  425. trigger: ['blur','change']
  426. }
  427. ],
  428. bu:[
  429. {
  430. required: true,
  431. message: ' ',
  432. trigger: ['blur','change']
  433. }
  434. ]
  435. },
  436. userBuList: [],
  437. authSearch: false,
  438. authSave: false,
  439. authUpdate: false,
  440. authDelete: false,
  441. menuId: this.$route.meta.menuId,
  442. }
  443. },
  444. mounted () {
  445. this.$nextTick(() => {
  446. this.height = window.innerHeight - 180
  447. })
  448. },
  449. created () {
  450. // 按钮控制
  451. this.getButtonAuthData()
  452. // 获取用户的 site 和 bu
  453. // this.getSiteAndBuByUserName()
  454. // 校验用户是否收藏
  455. // this.favoriteIsOk()
  456. // 动态列
  457. // this.getTableUserColumn(this.$route.meta.menuId+'table',1)
  458. if (!this.authSearch) {
  459. // 获取数据列表
  460. this.getDataList()
  461. }
  462. },
  463. methods: {
  464. // 获取用户的bu
  465. getSiteAndBuByUserName () {
  466. let tempData = {
  467. username: this.$store.state.user.name,
  468. }
  469. getSiteAndBuByUserName(tempData).then(({data}) => {
  470. if (data.code === 0) {
  471. this.userBuList = data.rows
  472. }
  473. })
  474. },
  475. // 每页数
  476. sizeChangeHandle (val) {
  477. this.pageSize = val
  478. this.pageIndex = 1
  479. this.getDataList()
  480. },
  481. // 当前页
  482. currentChangeHandle (val) {
  483. this.pageIndex = val
  484. this.getDataList()
  485. },
  486. // 查询获取数据列表
  487. getDataList () {
  488. this.searchData.limit = this.pageSize
  489. this.searchData.page = this.pageIndex
  490. samplingQtySearch(this.searchData).then(({data}) => {
  491. if (data.code === 0) {
  492. this.dataList = data.page.list
  493. this.pageIndex = data.page.currPage
  494. this.pageSize = data.page.pageSize
  495. this.totalPage = data.page.totalCount
  496. }
  497. })
  498. },
  499. // 新增按钮
  500. addModal () {
  501. this.modalData = {
  502. flag: '1',
  503. site: this.$store.state.user.site,
  504. buNo: '*',
  505. // bu: this.userBuList[0].buNo,
  506. samplingQtyNo: '',
  507. samplingQtyDesc: '',
  508. samplingQty: '',
  509. samplingQtyRemark: '',
  510. samplingQtyActive: 'Y',
  511. createBy: this.$store.state.user.name,
  512. updateBy: this.$store.state.user.name
  513. }
  514. this.modalDisableFlag = false
  515. this.modalFlag = true
  516. },
  517. // 修改按钮
  518. updateModal (row) {
  519. this.modalData = {
  520. flag: '2',
  521. bu: row.site + '_' + row.buNo,
  522. site: row.site,
  523. samplingQtyNo: row.samplingQtyNo,
  524. samplingQtyDesc: row.samplingQtyDesc,
  525. samplingQty: row.samplingQty,
  526. samplingQtyRemark: row.samplingQtyRemark,
  527. samplingQtyActive: row.samplingQtyActive,
  528. createBy: this.$store.state.user.name,
  529. updateBy: this.$store.state.user.name
  530. }
  531. this.modalDisableFlag = true
  532. this.modalFlag = true
  533. },
  534. // 删除方法
  535. deleteModal (row) {
  536. this.$confirm(`是否删除这个样本量?`, '提示', {
  537. confirmButtonText: '确定',
  538. cancelButtonText: '取消',
  539. type: 'warning'
  540. }).then(() => {
  541. samplingQtyDelete(row).then(({data}) => {
  542. if (data && data.code === 0) {
  543. this.getDataList()
  544. this.$message({
  545. message: '操作成功',
  546. type: 'success',
  547. duration: 1500,
  548. onClose: () => {}
  549. })
  550. } else {
  551. this.$alert(data.msg, '错误', {
  552. confirmButtonText: '确定'
  553. })
  554. }
  555. })
  556. }).catch(() => {
  557. })
  558. },
  559. // 新增/修改方法
  560. saveData () {
  561. if (this.modalData.samplingQtyDesc === '' || this.modalData.samplingQtyDesc == null) {
  562. this.$message.warning('请输入样本量字码!')
  563. return
  564. }
  565. if (this.modalData.samplingQty === '' || this.modalData.samplingQty == null) {
  566. this.$message.warning('请输入样本量!')
  567. return
  568. }
  569. if (this.modalData.samplingQtyActive === '' || this.modalData.samplingQtyActive == null) {
  570. this.$message.warning('请选择是否在用!')
  571. return
  572. }
  573. if (this.modalData.flag === '1') { // 新增
  574. samplingQtySave(this.modalData).then(({data}) => {
  575. if (data && data.code === 0) {
  576. this.getDataList()
  577. this.modalFlag = false
  578. this.$message({
  579. message: '操作成功',
  580. type: 'success',
  581. duration: 1500,
  582. onClose: () => {}
  583. })
  584. } else {
  585. this.$alert(data.msg, '错误', {
  586. confirmButtonText: '确定'
  587. })
  588. }
  589. })
  590. } else { // 修改
  591. samplingQtyUpdate(this.modalData).then(({data}) => {
  592. if (data && data.code === 0) {
  593. this.getDataList()
  594. this.modalFlag = false
  595. this.$message({
  596. message: '操作成功',
  597. type: 'success',
  598. duration: 1500,
  599. onClose: () => {}
  600. })
  601. } else {
  602. this.$alert(data.msg, '错误', {
  603. confirmButtonText: '确定'
  604. })
  605. }
  606. })
  607. }
  608. },
  609. // 校验用户是否收藏
  610. favoriteIsOk () {
  611. let userFavorite = {
  612. userId: this.$store.state.user.id,
  613. languageCode: this.$i18n.locale
  614. }
  615. userFavoriteList(userFavorite).then(({data}) => {
  616. for (let i = 0; i < data.list.length; i++) {
  617. if (this.$route.meta.menuId === data.list[i].menuId) {
  618. this.favorite = true
  619. }
  620. }
  621. })
  622. },
  623. // 收藏 OR 取消收藏
  624. favoriteFunction () {
  625. let userFavorite = {
  626. userId: this.$store.state.user.id,
  627. functionId: this.$route.meta.menuId,
  628. }
  629. if (this.favorite) {
  630. removeUserFavorite(userFavorite).then(({data}) => {
  631. this.$message.success(data.msg)
  632. this.favorite = false
  633. })
  634. } else {
  635. // 收藏
  636. saveUserFavorite(userFavorite).then(({data}) => {
  637. this.$message.success(data.msg)
  638. this.favorite = true
  639. })
  640. }
  641. },
  642. // 导出excel
  643. async createExportData () {
  644. this.searchData.limit = -1
  645. this.searchData.page = 1
  646. await samplingQtySearch(this.searchData).then(({data}) => {
  647. this.exportList = data.rows
  648. })
  649. return this.exportList
  650. },
  651. async exportExcel() {
  652. this.searchData.limit = -1
  653. this.searchData.page = 1
  654. excel.exportTable({
  655. url: "/pms/qc/samplingQtySearch",
  656. columnMapping: this.columnList,//可以直接用table,不需要的列就剔除
  657. mergeSetting: [],//需要合并的列
  658. params: this.searchData,
  659. fileName: this.exportName+".xlsx",
  660. rowFetcher: res => res.data,
  661. columnFormatter: [],
  662. dropColumns: [],//需要剔除的列,例如dropColumns: ["netWeight"],即剔除净重列
  663. })
  664. },
  665. startDownload () {},
  666. finishDownload () {},
  667. fields () {
  668. let json = "{"
  669. this.columnList.forEach((item, index) => {
  670. if (index == this.columnList.length - 1) {
  671. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  672. } else {
  673. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  674. }
  675. })
  676. json += "}"
  677. let s = eval("(" + json + ")")
  678. return s
  679. },
  680. // 动态列开始 获取 用户保存的 格式列
  681. async getTableUserColumn (tableId, columnId) {
  682. let queryTableUser = {
  683. userId: this.$store.state.user.name,
  684. functionId: this.$route.meta.menuId,
  685. tableId: tableId,
  686. status: true,
  687. languageCode: this.$i18n.locale
  688. }
  689. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  690. if (data.rows.length > 0) {
  691. //this.columnList1 = []
  692. switch (columnId) {
  693. case 1:
  694. this.columnList = data.rows
  695. break;
  696. // case 2:
  697. // this.columnDetailList = data.rows
  698. // break;
  699. // case 3:
  700. // this.columnList2 = data.rows
  701. // break;
  702. // case 4:
  703. // this.columnList3 = data.rows
  704. // break;
  705. }
  706. } else {
  707. this.getColumnList(tableId, columnId)
  708. }
  709. })
  710. },
  711. // 获取 tableDefault 列
  712. async getColumnList (tableId, columnId) {
  713. let queryTable = {
  714. functionId: this.$route.meta.menuId,
  715. tableId: tableId,
  716. languageCode: this.$i18n.locale
  717. }
  718. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  719. if (!data.rows.length == 0) {
  720. switch (columnId) {
  721. case 1:
  722. this.columnList = data.rows
  723. break;
  724. // case 2:
  725. // this.columnDetailList = data.rows
  726. // break;
  727. // case 3:
  728. // this.columnList2 = data.rows
  729. // break;
  730. // case 4:
  731. // this.columnList3 = data.rows
  732. // break;
  733. }
  734. } else {
  735. // this.showDefault = true.
  736. }
  737. })
  738. },
  739. //获取按钮的权限数据
  740. getButtonAuthData () {
  741. let searchFlag = this.isAuth(this.menuId+":search")
  742. let saveFlag = this.isAuth(this.menuId+":save")
  743. let updateFlag = this.isAuth(this.menuId+":update")
  744. let deleteFlag = this.isAuth(this.menuId+":delete")
  745. //处理页面的权限数据
  746. this.authSearch = !searchFlag
  747. this.authSave = !saveFlag
  748. this.authUpdate = !updateFlag
  749. this.authDelete = !deleteFlag
  750. },
  751. }
  752. }
  753. </script>
  754. <style scoped>
  755. .el-table /deep/ .cell{
  756. height: auto;
  757. line-height: 1.5;
  758. }
  759. </style>