addEdit.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <el-dialog
  3. title="新建售后申请"
  4. :center="true"
  5. align="left"
  6. top="14vh"
  7. width="1000px"
  8. :close-on-click-modal="false"
  9. :visible.sync="showModelThis"
  10. element-loading-text="拼命加载中"
  11. element-loading-spinner="el-icon-loading"
  12. element-loading-background="rgba(0, 0, 0, 0.8)"
  13. @close="closeModel"
  14. >
  15. <!-- <p>orderCode{{ sitem }}</p> -->
  16. <!-- <p>outCode{{ outCode }}</p> -->
  17. <el-card style="margin-top: -20px" v-loading="loading">
  18. <add-edit-form
  19. v-if="showModel"
  20. :id="id"
  21. :sitem="sitem"
  22. :show-model="showModel"
  23. :is-detail="isDetail"
  24. @closeModel="handClick"
  25. @refresh="refresh"
  26. />
  27. </el-card>
  28. </el-dialog>
  29. </template>
  30. <script>
  31. import addEditForm from "./addEditForm.vue";
  32. export default {
  33. name: "handover",
  34. props: ["showModel", "id", "isDetail", "sitem"],
  35. components: {
  36. addEditForm,
  37. },
  38. data() {
  39. return {
  40. sitem: null,
  41. title: "",
  42. showModelThis: this.showModel,
  43. };
  44. },
  45. watch: {
  46. showModel: function (val) {
  47. this.showModelThis = val;
  48. if (val) {
  49. this.initForm();
  50. }
  51. },
  52. showModelThis(val) {
  53. if (!val) {
  54. this.$emit("cancel");
  55. }
  56. },
  57. },
  58. methods: {
  59. closeModel() {
  60. console.log("closeModel!!");
  61. },
  62. async initForm() {
  63. this.loading = true;
  64. console.log(this.id);
  65. if (this.id === "add") {
  66. this.title = "新建售后申请";
  67. this.rulesThis = this.rules;
  68. } else {
  69. if (this.isDetail) {
  70. this.rulesThis = {};
  71. } else {
  72. this.rulesThis = this.rules;
  73. }
  74. }
  75. this.loading = false;
  76. },
  77. handClick(e) {
  78. console.log(e);
  79. this.showModelThis = e;
  80. },
  81. refresh(e) {
  82. console.log(e);
  83. this.showModelThis = e;
  84. this.$emit("refresh", true);
  85. },
  86. },
  87. };
  88. </script>
  89. <style lang="scss" scoped>
  90. </style>