123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <template>
- <div>
- <el-dialog
- title="新 建"
- :visible.sync="dialogProjectVisible"
- append-to-body
- width="900px">
- <div slot="title" style="font-size: 15px">
- 选择联系人
- </div>
- <layout_table
- ref="projectTable"
- :layout="tablecols"
- :data="list"
- :opwidth="200"
- :custom="false"
- :height="320"
- :checkbox="true"
- :onRow="row"
- @rowClick="rowClick"
- @onRow="onRow"
- >
- </layout_table>
- <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 class="dialog-footer">
- <el-button size="small" @click="onColes" class="normal-btn-width">取 消</el-button>
- <el-button size="small" type="warning" class="normal-btn-width btn-warning" @click="onSubmit">确 定</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import layout_table from '../components/table'
- export default {
- name: "contacts",
- props:["visible","index","sys_enterpriseid"],
- data(){
- return {
- dialogProjectVisible:false,
- bill_id:"",
- tablecols:[],
- list:[],
- total:0,
- currentPage:0,
- row:"",
- params:{
- "id": "20221022165503",
- "version": 1,
- "content": {
- "sys_enterpriseid": '',
- "where": {
- "condition": "",
- "workaddress": 0//0表示人,1表示地址
- }
- }
- }
- }
- },
- components:{layout_table},
- mounted() {
- console.log(this.visible)
- this.dialogProjectVisible = true
- console.log(this.index)
- console.log("企业id"+this.sys_enterpriseid)
- this.listData()
- },
- methods:{
- async listData(){
- this.params.content.sys_enterpriseid = this.sys_enterpriseid
- const res = await this.$api.requested(this.params)
- this.list = res.data
- this.total = res.total
- console.log(this.list[0])
- if (this.index !== ''){
- this.toggleSelection([this.list[this.index]])
- }
- },
- handleSizeChange(val) {
- // console.log(`每页 ${val} 条`);
- this.params.content.pageSize = val
- this.listData()
- },
- handleCurrentChange(val) {
- // console.log(`当前页: ${val}`);
- this.params.content.pageNumber = val
- this.listData()
- },
- onColes(){
- this.dialogProjectVisible = false
- this.$emit("onContacts")
- },
- onRow(row){
- console.log("**********************---------------------")
- console.log("勾选")
- console.log(row)
- this.row = row
- },
- onSubmit(){
- console.log("**********************---------------------")
- this.dialogProjectVisible = false
- this.$emit("onContacts",this.row)
- console.log(this.row)
- },
- toggleSelection(rows) {
- console.log("保存")
- console.log(rows)
- if (rows) {
- rows.forEach(row => {
- console.log("保存输出")
- console.log(row)
- console.log(this.$refs.projectTable.$refs.tables)
- this.$refs.projectTable.$refs.tables.setCurrentRow(row);
- });
- } else {
- this.$refs.projectTable.$refs.tables.clearSelection();
- }
- },
- rowClick(row){
- console.log("选中")
- console.log(row)
- }
- },
- created() {
- this.tablecols = this.tool.tabelCol(this.$route.name).contactsTable.tablecols
- }
- }
- </script>
- <style scoped>
- </style>
|