123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- /*
- * @Author: howie
- * @Date: 2022-06-14 10:14:37
- * @LastEditors: howie
- * @LastEditTime: 2022-07-03 17:47:25
- * @FilePath: \supply-front\src\mixin\index.js
- * @Description:
- *
- * Copyright (c) 2022, All Rights Reserved.
- */
- export default {
- data() {
- return {
- currentPage: 1, // 当前页码
- pageSize: 10, // 每页数量
- listTotal: 0, // 列表总数
- listLoading: false, // 加载
- screenForm: {}, // 筛选表单数据
- dataList: [], // 表格数据
- ids: [], // 多选数据id
- dialogVisible: false, // 弹框
- conditionList: []
- }
- },
- created() {
- this.getList()
- },
- methods: {
- // 提交筛选表单
- submitScreenForm() {
- this.currentPage = 1
- this.getList()
- },
- // 重置筛选表单
- resetScreenForm() {
- this.$nextTick(()=>{
- this.$refs.screenForm.resetFields()
- })
- this.currentPage = 1
- this.getList()
- },
- hanlePagination(val) {
- // 更改每页数量
- this.handleSizeChange(val)
- // 更改当前页
- this.handleCurrentChange(val)
- },
- // 更改每页数量
- handleSizeChange(val) {
- this.pageSize = val
- this.currentPage = 1
- this.getList()
- },
- // 更改当前页
- handleCurrentChange(val) {
- this.currentPage = val
- this.getList()
- },
- // Windows全局打印
- hanlePrint() {
- window.print()
- },
- // 筛选全部数据
- hanleSelectAll(selection, index) {
- this.ids = selection.map(k => {
- return k.id || k.updPriceBillId
- })
- console.log(this.ids)
- },
- /**
- * @description 单条数据删除 或者 全部数据删除
- * @author zhou
- * @param {*} id 删除单条数据传
- * @return {*} Promise.resolve(ids)
- */
- hanleDeleteAllPromise(id) {
- return new Promise((resolve, reject) => {
- const ids = id ? [id] : this.ids
- if (!ids.length) {
- this.$errorMsg('请选择删除内容')
- return
- }
- resolve(ids)
- })
- }
- }
- }
|