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.

760 lines
24 KiB

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