RewardsAndPunishmentsMeasureManage.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <div class="data-dictionary h100">
  3. <common-layout ref="layoutRef" :table-attrs="{
  4. 'has-operation':true
  5. }" :form-attrs="{
  6. 'span-attrs':{
  7. span:3
  8. }
  9. }" :table-header="rewardsAndPunishmentsMeasureManageHeader" :get-table-list="getTableData" :filter-form="rewardsAndPunishmentsMeasureManage">
  10. <template v-if="store.isManager" #plusBtn>
  11. <el-button type="primary" :icon="Plus" @click="openDialog('add')">新增</el-button>-->
  12. </template>
  13. <template #operation="{data}">
  14. <el-button type="info" @click="openDialog('detail',data)">查看</el-button>
  15. <el-button v-if="store.isManager" type="info" @click="openDialog('edit',data)">修改</el-button>
  16. <el-button v-if="store.isManager" type="info" @click="deleteObj(data)">删除</el-button>
  17. </template>
  18. </common-layout>
  19. <template v-if="isEditDialogShow">
  20. <RewardsAndPunishmentsMeasureManageSettingDialog @getTableData="getTableData" :dialog-operation-type="dialogOperationType" :current-dialog-obj="currentDialogOpObj" v-model:dialog-visible="isEditDialogShow"/>
  21. </template>
  22. </div>
  23. </template>
  24. <script>
  25. import {ref} from "vue";
  26. import {useRootStore} from "@/pinia/useStore";
  27. import CommonLayout from "@/components/CommonLayout.vue";
  28. import {rewardsAndPunishmentsMeasureManageHeader} from "@/data/all-table-header";
  29. import {rewardsAndPunishmentsMeasureManage} from "@/data/all-form";
  30. import {Plus, Search} from "@element-plus/icons-vue"
  31. import {useDetailOrEdit} from "@/units/use-method/usePagination";
  32. import RewardsAndPunishmentsMeasureManageSettingDialog
  33. from "@/views/main/c-views/combined-rewards-and-punishments/rewards-and-punishments-measure-manage/RewardsAndPunishmentsMeasureManageSettingDialog.vue";
  34. import {
  35. proDeleteXyxxJccs,
  36. proSelectXyxxJccs
  37. } from "@/service/combined-rewards-and-punishments/rewards-and-punishments-measure-manage/rewards-and-punishments-measure-manage";
  38. import {handleMes} from "@/units/element-ui/tip";
  39. import {InsertSyslog} from "@/units/use-method/user-log";
  40. export default {
  41. name: "RewardsAndPunishmentsMeasureManage",
  42. components:{RewardsAndPunishmentsMeasureManageSettingDialog, CommonLayout},
  43. computed: {
  44. Plus(){
  45. return Plus
  46. }
  47. },
  48. setup(){
  49. const layoutRef = ref(null);
  50. const isEditDialogShow = ref(false);
  51. const {changeOperation,currentOpObj:currentDialogOpObj,operationType:dialogOperationType} = useDetailOrEdit()
  52. const store =useRootStore();
  53. function getTableData (){
  54. debugger
  55. proSelectXyxxJccs({
  56. bwlmc:layoutRef.value.form.BWLMC,
  57. zrbm:layoutRef.value.form.ZRBM,
  58. pageIndex:layoutRef.value.pageIndex,
  59. pageSize:layoutRef.value.pageSize
  60. }).then(res =>{
  61. InsertSyslog(localStorage.getItem("xyxx_usercode"),localStorage.getItem("xyxx_unitcode"), "信息查询", "奖惩措施管理查询成功", "奖惩措施管理", "")
  62. layoutRef.value.getResData(res.msg[0].Rows,res.msg[0].TotalRowCount)
  63. })
  64. }
  65. function openDialog(type,data){
  66. isEditDialogShow.value = true;
  67. changeOperation(type,data)
  68. }
  69. function deleteObj(data){
  70. proDeleteXyxxJccs({
  71. code:data.CSID
  72. }).then(res =>{
  73. handleMes(res,() => {
  74. InsertSyslog(localStorage.getItem("xyxx_usercode"),localStorage.getItem("xyxx_unitcode"), "信息删除", "奖惩措施管理删除成功", "奖惩措施管理", "")
  75. getTableData();
  76. })
  77. })
  78. }
  79. return {
  80. store,
  81. rewardsAndPunishmentsMeasureManage,
  82. rewardsAndPunishmentsMeasureManageHeader,
  83. getTableData,
  84. openDialog,
  85. deleteObj,
  86. layoutRef,
  87. isEditDialogShow,
  88. dialogOperationType,
  89. currentDialogOpObj
  90. }
  91. }
  92. }
  93. </script>
  94. <style scoped>
  95. </style>