1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <template>
- <div>
- <el-button size="small" type="primary" @click="dialogVisible = true;listData()">{{$t(`设置领域提成`)}}</el-button>
- <el-drawer
- :title="$t(`领域提成`)"
- :visible.sync="dialogVisible"
- size="70%"
- direction="rtl"
- append-to-body
- @close="onClose">
- <div class="drawer__panel" style="margin-bottom: 0 !important;">
- <addField @addSuccess="listData"></addField>
- <tableMerge ref="tableMerge" style="margin-top: 20px" :layout="tablecols" :data="list" :opwidth="200" :custom="true" :height="'calc(100vh - 140px)'" :mergeArr="mergeArr" fixedName="operation">
- <template v-slot:customcol="scope">
- <p >{{$t(scope.column.data[scope.column.columnname])}}</p>
- </template>
- <template v-slot:opreation="scope">
- <editField :data="scope.data" class="inline-16" @editSuccess="listData"></editField>
- <el-button size="mini" type="text" @click="onDel(scope.data)">{{$t('删 除')}}</el-button>
- </template>
- </tableMerge>
- </div>
- </el-drawer>
- </div>
- </template>
- <script>
- import addField from './addField'
- import tableMerge from '@/components/dynamic-table-merge/index'
- import editField from './editField'
- export default {
- name: "setFieldCommission",
- data(){
- return {
- dialogVisible:false,
- tablecols:[],
- list:[],
- total:0,
- currentPage:0,
- mergeArr: ['value', 'remarks','rewardtype', 'changeby', 'changedate', 'operation'],
- param:{
- "id": "20240311150804",
- "content": {
- "type":'领域'
- }
- }
- }
- },
- components:{addField,tableMerge,editField},
- methods:{
- async listData(){
- const res = await this.$api.requested(this.param)
- this.list = res.data
- },
- onDel(row){
- this.$confirm(this.$t('此操作将永久删除该方案, 是否继续')+'?', this.$t('提示'), {
- confirmButtonText: this.$t('确定'),
- cancelButtonText: this.$t('取消'),
- type: 'warning'
- }).then(async () => {
- const res = await this.$api.requested({
- "id": 20240313133204,
- "content": {
- "value": row.value,
- "type":'领域'
- }
- })
- this.tool.showMessage(res,()=>{
- this.listData()
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: this.$t('已取消删除')
- });
- });
- },
- onClose(){
- }
- },
- mounted() {
- },
- created() {
- this.tablecols = this.tool.tabelCol(this.$route.name).fieldCommissionTable.tablecols
- }
- }
- </script>
- <style scoped>
- </style>
|