setFieldCommission.vue 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <div>
  3. <el-button size="small" type="primary" @click="dialogVisible = true;listData()">{{$t(`设置领域提成`)}}</el-button>
  4. <el-drawer
  5. :title="$t(`领域提成`)"
  6. :visible.sync="dialogVisible"
  7. size="70%"
  8. direction="rtl"
  9. append-to-body
  10. @close="onClose">
  11. <div class="drawer__panel" style="margin-bottom: 0 !important;">
  12. <addField @addSuccess="listData"></addField>
  13. <tableMerge ref="tableMerge" style="margin-top: 20px" :layout="tablecols" :data="list" :opwidth="200" :custom="true" :height="'calc(100vh - 140px)'" :mergeArr="mergeArr" fixedName="operation">
  14. <template v-slot:customcol="scope">
  15. <p >{{$t(scope.column.data[scope.column.columnname])}}</p>
  16. </template>
  17. <template v-slot:opreation="scope">
  18. <editField :data="scope.data" class="inline-16" @editSuccess="listData"></editField>
  19. <el-button size="mini" type="text" @click="onDel(scope.data)">{{$t('删 除')}}</el-button>
  20. </template>
  21. </tableMerge>
  22. </div>
  23. </el-drawer>
  24. </div>
  25. </template>
  26. <script>
  27. import addField from './addField'
  28. import tableMerge from '@/components/dynamic-table-merge/index'
  29. import editField from './editField'
  30. export default {
  31. name: "setFieldCommission",
  32. data(){
  33. return {
  34. dialogVisible:false,
  35. tablecols:[],
  36. list:[],
  37. total:0,
  38. currentPage:0,
  39. mergeArr: ['value', 'remarks','rewardtype', 'changeby', 'changedate', 'operation'],
  40. param:{
  41. "id": "20240311150804",
  42. "content": {
  43. "type":'领域'
  44. }
  45. }
  46. }
  47. },
  48. components:{addField,tableMerge,editField},
  49. methods:{
  50. async listData(){
  51. const res = await this.$api.requested(this.param)
  52. this.list = res.data
  53. },
  54. onDel(row){
  55. this.$confirm(this.$t('此操作将永久删除该方案, 是否继续')+'?', this.$t('提示'), {
  56. confirmButtonText: this.$t('确定'),
  57. cancelButtonText: this.$t('取消'),
  58. type: 'warning'
  59. }).then(async () => {
  60. const res = await this.$api.requested({
  61. "id": 20240313133204,
  62. "content": {
  63. "value": row.value,
  64. "type":'领域'
  65. }
  66. })
  67. this.tool.showMessage(res,()=>{
  68. this.listData()
  69. })
  70. }).catch(() => {
  71. this.$message({
  72. type: 'info',
  73. message: this.$t('已取消删除')
  74. });
  75. });
  76. },
  77. onClose(){
  78. }
  79. },
  80. mounted() {
  81. },
  82. created() {
  83. this.tablecols = this.tool.tabelCol(this.$route.name).fieldCommissionTable.tablecols
  84. }
  85. }
  86. </script>
  87. <style scoped>
  88. </style>