yangfeng
2023-07-12 245912b3b595400ecdd5965ce5e466d190f06ae4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<template>
  <div class="role-peimission">
    <div class="btn-pager">
      <el-button @click="addpermssionClick" type="primary" size="small">新增权限</el-button>
    </div>
    <TableCommonView ref="tableListRef" :select-box="false" :table-list="tableList">
      <template slot="tableButton">
        <el-table-column label="操作" width="320">
          <template slot-scope="scope">
            <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
            <el-button @click="handleClick(scope.row)" type="text" size="small">复制</el-button>
            <el-button @click="handleClick(scope.row)" type="text" size="small">设置成员</el-button>
            <el-button @click="handleClick(scope.row)" type="text" size="small">字段权限</el-button>
            <el-button @click="handleClick(scope.row)" type="text" size="small">删除</el-button>
            <el-button @click="handleClick(scope.row)" type="text" size="small">上移</el-button>
            <el-button @click="handleClick(scope.row)" type="text" size="small">下移</el-button>
          </template>
        </el-table-column>
      </template>
    </TableCommonView>
    <!-- 新建/编辑 -->
    <AddContractManageDialog v-if="editConfig.visible" :edit-common-config="editConfig" />
  </div>
</template>
 
<script>
import AddContractManageDialog from "@/views/sales/contractManage/AddContractManageDialog"
 
export default {
  name: "RoleOeimission",
  props: {},
  components: {
    AddContractManageDialog
  },
  computed: {
    searchCommonHeight() {
      return this.$refs.searchCommonView.offsetHeight
    }
  },
  data() {
    return {
      tableList: {},
      editConfig: {
        visible: false,
        title: "新建",
        infomation: {}
      }
    }
  },
  created() {
    this.setTable()
  },
  methods: {
    setTable() {
      this.tableList = {
        tableInfomation: [
          {
            number: "1",
            owner: "总经理",
            notes: ""
          }
        ],
        tableColumn: [
          { label: "#", prop: "number", width: 80 },
          { label: "权限名称", prop: "owner", width: 160 },
          { label: "备注", prop: "notes" }
        ]
      }
      this.searchOptions = []
      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
        const label = this.tableList.tableColumn[i].label
        this.searchOptions.push({ value: (i + 1).toString(), label: label })
      }
    },
    // 新建
    addBtnClick() {
      this.editConfig.visible = true
      this.editConfig.title = "新建"
      this.editConfig.infomation = {
        customName: "",
        documentNumber: "ZDYBD01-3",
        owner: "",
        contractStatus: "",
        salesQuotation: "",
        approvalWorkflow: "",
        approvalSteps: "",
        approvalPerson: "",
        approvalOpinion: ""
      }
    },
    // 编辑
    handleClick(row) {
      console.log(row)
      this.editConfig.visible = true
      this.editConfig.title = "编辑"
      this.editConfig.infomation = {
        customName: "",
        documentNumber: "TKD20230521-12",
        owner: "",
        contractStatus: "",
        salesQuotation: "",
        approvalWorkflow: "",
        approvalSteps: "",
        approvalPerson: "",
        approvalOpinion: ""
      }
    }
  }
}
</script>
 
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.role-peimission {
  .btn-pager {
    margin: 0px 20px 20px;
    float: right;
  }
}
</style>