123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <template>
- <div>
- <!-- <add class="normal-margin" :data="data" @insertSuccess="onSuccess" style="float: left;"></add>
- <div style="width: 20%;float: left;margin-left: 2%">
- <el-input
- placeholder="请输入内容"
- v-model="search"
- clearable
- @clear="clearData()"
- size="mini"
- @keyup.enter.native="queryClick()">
- <i slot="prefix" class="el-icon-search" @click="queryClick()"></i>
- </el-input>
- </div>-->
- <tableLayout :layout="tablecols" :data="list" :opwidth="200" :custom="true" :height="tableHieght" >
- <template v-slot:customcol="scope">
- <p>{{scope.column.data[scope.column.columnname]}}</p>
- </template>
- <template v-slot:opreation="scope">
- <!-- <edit v-if="tool.checkAuth($route.name,'update')" :data="scope.data" @updateSuccess="onSuccess"></edit>
- <toVoid v-if="tool.checkAuth($route.name,'toVoid')" :data="scope.data" @toVoidSuccess="onSuccess"></toVoid>-->
- </template>
- </tableLayout>
- <div style="margin-top:16px;text-align:right">
- <el-pagination
- background
- small
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="currentPage"
- :page-size="params.content.pageSize"
- layout="total, prev, pager, next, jumper"
- :total="total">
- </el-pagination>
- </div>
- </div>
- </template>
- <script>
- import add from './modules/add'
- import edit from './modules/edit'
- import toVoid from './modules/toVoid'
- import {mapGetters} from 'vuex'
- export default {
- name: "list",
- props:["data"],
- data(){
- return {
- tableHieght:"600px",
- tablecols:[],
- list:[],
- total:0,
- currentPage:0,
- search:"",
- params:{
- "id": "20221022165503",
- "content": {
- "sys_enterpriseid": "",
- "pageNumber": 1,
- "pageSize": 20,
- "where": {
- "condition": "",
- "workaddress":0
- }
- }
- }
- }
- },
- components:{
- add,edit,toVoid
- },
- computed:{
- ...mapGetters({
- dataToForm:'dataToForm'
- })
- },
- methods:{
- async listData(){
- this.params.content.sys_enterpriseid = this.data.sys_enterpriseid
- const res = await this.$api.requested(this.params)
- this.list = res.data
- this.total = res.total
- this.currentPage = res.pageTotal
- },
- handleSizeChange(val) {
- // console.log(`每页 ${val} 条`);
- this.params.content.pageSize = val
- this.listData(data)
- },
- handleCurrentChange(val) {
- // console.log(`当前页: ${val}`);
- this.params.content.pageNumber = val
- this.listData(data)
- },
- onSuccess(){
- this.listData()
- },
- clearData(){
- this.search = ""
- },
- queryClick(){
- this.params.content.where.condition = this.search
- this.listData()
- }
- },
- mounted() {
- this.listData()
- },
- created() {
- this.tablecols = this.tool.tabelCol(this.$route.name).contactsTable.tablecols
- },
- watch:{
- "dataToForm":function (val){
- console.log(val)
- }
- }
- }
- </script>
- <style scoped>
- /deep/.el-input__prefix {
- display: flex;
- align-items: center;
- }
- </style>
|