recovery.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <div>
  3. <el-button style="width:100%" size="mini" :type="disabled?'':'primary'" block @click="onshow" :disabled="disabled">回收</el-button>
  4. <el-dialog title="" :visible.sync="dialogForm" width="400px" append-to-body>
  5. <div slot="title" style="font-size: 15px">
  6. 回收客户
  7. </div>
  8. <div>
  9. <el-row :gutter="20">
  10. <el-form :model="form" :rules="rules" ref="form" size="mini" label-position="top" label-width="90px">
  11. <el-col :span="24">
  12. <el-form-item prop="sa_customerpoolid" label="公海池:" >
  13. <el-select v-model="form.sa_customerpoolid" placeholder="请选择公海池" style="width: 100%">
  14. <el-option
  15. v-for="item in pool"
  16. :key="item.sa_customerpoolid"
  17. :label="item.poolname"
  18. :value="item.sa_customerpoolid">
  19. </el-option>
  20. </el-select>
  21. </el-form-item>
  22. </el-col>
  23. </el-form>
  24. </el-row>
  25. </div>
  26. <div class="dialog-footer">
  27. <el-button size="small" @click="dialogForm = false" class="normal-btn-width">取 消</el-button>
  28. <el-button size="small" type="warning" @click="onSubmit" class="normal-btn-width btn-warning">确 定</el-button>
  29. </div>
  30. </el-dialog>
  31. </div>
  32. </template>
  33. <script>
  34. export default {
  35. name: "recovery",
  36. props:["data","disabled"],
  37. data() {
  38. return {
  39. dialogForm: false,
  40. form: {
  41. sa_customerpoolid: "",
  42. sa_customersid: ""
  43. },
  44. createby:"",
  45. name:"",
  46. pool: [],
  47. rules: {
  48. sa_customerpoolid: [
  49. {required: true, message: '未选择公海池', trigger: 'change'},
  50. ],
  51. }
  52. }
  53. },
  54. methods:{
  55. onshow(){
  56. this.dialogForm = true
  57. this.poolList()
  58. if (this.data.leader.length !== 0){
  59. this.createby = this.data.leader[0].createby
  60. this.name = this.data.leader[0].name
  61. }
  62. this.$emit("onshow")
  63. },
  64. onSubmit(){
  65. this.$refs['form'].validate(async (valid) => {
  66. if (!valid) return false
  67. const res = await this.$api.requested({
  68. "id": 20221014165602,
  69. "content": {
  70. "sa_customerpoolid":this.form.sa_customerpoolid,//公海池id
  71. "sa_customersids":[this.data.sa_customersid]//客户id
  72. },
  73. })
  74. this.tool.showMessage(res, ()=>{
  75. this.dialogForm = false
  76. this.$emit("backSuccess")
  77. this.$router.go(-1)
  78. })
  79. })
  80. },
  81. /*公海池列表*/
  82. async poolList(){
  83. const res = await this.$api.requested({
  84. "id": 20221009100702,
  85. "content": {
  86. "pageNumber": 1,
  87. "pageSize": 90,
  88. "where": {
  89. "condition": "",
  90. }
  91. },
  92. })
  93. console.log(res)
  94. this.pool = res.data
  95. }
  96. },
  97. mounted() {
  98. }
  99. }
  100. </script>
  101. <style scoped>
  102. </style>