edit.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <div>
  3. <el-button size="small" type="primary" @click="dialogVisible = true;listData()">编 辑</el-button>
  4. <el-drawer
  5. title="编辑提成发放清单"
  6. :visible.sync="dialogVisible"
  7. size="700px"
  8. direction="rtl"
  9. append-to-body
  10. @close="onClose">
  11. <div class="drawer__panel">
  12. <el-row :gutter="20">
  13. <el-form :model="form" :rules="rules" ref="formRef" label-width="120px" label-position="left" size="mini">
  14. <el-col :span="24">
  15. <el-form-item label="备注:" prop="remarks">
  16. </el-form-item>
  17. </el-col>
  18. <el-col :span="24">
  19. <el-input v-model="form.remarks" type="textarea" rows="5" placeholder="请输入备注信息"></el-input>
  20. </el-col>
  21. </el-form>
  22. </el-row>
  23. </div>
  24. <div class="fixed__btn__panel">
  25. <el-button size="small" @click="onClose" class="normal-btn-width">取 消</el-button>
  26. <el-button size="small" type="primary" @click="onSubmit" class="normal-btn-width">确 定</el-button>
  27. </div>
  28. </el-drawer>
  29. </div>
  30. </template>
  31. <script>
  32. export default {
  33. name: "edit",
  34. props:["data"],
  35. data(){
  36. return {
  37. dialogVisible:false,
  38. tablecols:[],
  39. list:[],
  40. form:{
  41. "sa_hrpayapplyid":0,
  42. "billdate": new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
  43. "billno":"",
  44. "remarks":"",
  45. "hrpayapplydetail": []
  46. },
  47. rules:{},
  48. }
  49. },
  50. methods:{
  51. async listData(){
  52. const res = await this.$api.requested(this.param)
  53. this.list = res.data
  54. },
  55. selectionChange(row){
  56. this.form.hrpayapplydetail = row.map(item=>{
  57. return {
  58. "sa_hrpayapplydetailid": 0,
  59. "remarks": item.remarks,
  60. "sa_hrcashbillid": item.sa_hrcashbillid
  61. }
  62. })
  63. },
  64. async onSubmit(){
  65. const res = await this.$api.requested({
  66. "id": "20240117105204",
  67. "content": this.form
  68. })
  69. this.tool.showMessage(res,()=>{
  70. this.dialogVisible = false
  71. this.$emit('onSuccess')
  72. })
  73. },
  74. onClose(){
  75. this.dialogVisible = false
  76. this.form = {
  77. "sa_hrpayapplyid":0,
  78. "billdate": '',
  79. "billno":"",
  80. "remarks":"",
  81. "hrpayapplydetail": []
  82. }
  83. }
  84. },
  85. }
  86. </script>
  87. <style scoped>
  88. </style>