del.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <div class="inline-16">
  3. <el-button slot="reference" size="small" type="text" @click="dialogTableVisible=true">作 废</el-button>
  4. <el-dialog title="新增产品组" append-to-body :visible.sync="dialogTableVisible" width="30%">
  5. <el-row :gutter="20">
  6. <el-form label-position="right" ref="form" :rules="rules" inline label-width="100px" :model="form" size="small">
  7. <el-col :span="24">
  8. <el-form-item label="作废原因" prop="deletereason">
  9. <el-input v-model="form.deletereason" placeholder="请输入商品组名称"></el-input>
  10. </el-form-item>
  11. </el-col>
  12. </el-form>
  13. </el-row>
  14. <span slot="footer" class="dialog-footer">
  15. <div>
  16. <el-button @click="dialogTableVisible = false" size="small">取 消</el-button>
  17. <el-button type="primary" @click="submit" size="small">确 定</el-button>
  18. </div>
  19. </span>
  20. </el-dialog>
  21. </div>
  22. </template>
  23. <script>
  24. /*
  25. id:数据id
  26. nameId:接口id
  27. nameKey:接口字段
  28. */
  29. export default {
  30. data () {
  31. return {
  32. dialogTableVisible:false,
  33. form: {
  34. "sa_projectids":[],
  35. "deletereason": ""
  36. },
  37. rules:{
  38. deletereason: [
  39. { required: true, message: '请填写作废原因', trigger: 'blur' },
  40. ],
  41. }
  42. }
  43. },
  44. props: ['id'],
  45. methods: {
  46. async submit() {
  47. this.form.sa_projectids = [this.id]
  48. let res = await this.$api.requested({
  49. "id": 20221020144302,
  50. "content": this.form
  51. })
  52. this.tool.showMessage(res,() => {
  53. this.$emit('deleteSuccess')
  54. })
  55. },
  56. }
  57. }
  58. </script>
  59. <style scoped>
  60. /deep/.el-form-item {
  61. width: 100% !important;
  62. }
  63. /deep/.el-form-item__content {
  64. width: calc(100% - 100px);
  65. }
  66. </style>