disqualification-update.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <div>
  3. <div class="my-title">编辑</div>
  4. <el-form
  5. :model="dataForm"
  6. :rules="dataRule"
  7. ref="dataForm"
  8. @keyup.enter.native="dataFormSubmit()"
  9. label-width="130px"
  10. ></el-form>
  11. <span slot="footer" class="dialog-footer">
  12. <el-button @click="onChose">取消</el-button>
  13. <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
  14. </span>
  15. </div>
  16. </template>
  17. <script>
  18. export default {
  19. name: 'quality-disqualification-update',
  20. data () {
  21. return {
  22. dataForm: {},
  23. dataRule: {}
  24. }
  25. },
  26. mounted () {},
  27. methods: {
  28. init (item) {
  29. this.dataForm = { ...item }
  30. },
  31. onChose () {
  32. this.$emit('onChose')
  33. },
  34. dataFormSubmit () {
  35. this.$refs['dataForm'].validate((valid) => {
  36. if (valid) {
  37. this.$http({
  38. url: this.$http.adornUrl(`/biz-service/disqualification/update`),
  39. method: 'post',
  40. data: this.$http.adornData({ ...this.dataForm, orgId: this.orgId })
  41. }).then(({ data }) => {
  42. if (data && data.code === '200') {
  43. this.$message({
  44. message: '操作成功',
  45. type: 'success',
  46. duration: 1500,
  47. onClose: () => {
  48. this.onChose()
  49. this.$emit('refreshDataList')
  50. }
  51. })
  52. } else {
  53. this.$message.error(data.msg)
  54. }
  55. })
  56. }
  57. })
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="scss" scoped>
  63. </style>