addEdit1.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <el-dialog
  3. v-loading="loading"
  4. :title="title"
  5. :center="true"
  6. align="left"
  7. top="8vh"
  8. width="1024px"
  9. :close-on-click-modal="false"
  10. :visible.sync="showModelThis"
  11. element-loading-text="拼命加载中"
  12. element-loading-spinner="el-icon-loading"
  13. element-loading-background="rgba(0, 0, 0, 0.8)"
  14. @close="closeModel"
  15. >
  16. <el-card style="height: 700px; margin-top: -25px">
  17. <addview
  18. :id="id"
  19. :newTime="newTime"
  20. :show-model="showModel"
  21. :is-detail="isDetail"
  22. :invNo="invNo"
  23. :status="status"
  24. @refreshAll="refreshAll"
  25. ></addview>
  26. </el-card>
  27. </el-dialog>
  28. </template>
  29. <script>
  30. import addview from "./addview";
  31. export default {
  32. name: "invoiceApply",
  33. props: ["showModel", "id", "isDetail","status", "invNo"],
  34. components: {
  35. addview,
  36. },
  37. data() {
  38. return {
  39. loading: false,
  40. newTime: 0,
  41. showModelThis: this.showModel,
  42. };
  43. },
  44. watch: {
  45. showModel: function (val) {
  46. this.showModelThis = val;
  47. if (val) {
  48. this.initForm();
  49. }
  50. },
  51. showModelThis(val) {
  52. if (!val) {
  53. this.$emit("cancel");
  54. }
  55. },
  56. },
  57. methods: {
  58. closeModel() {
  59. console.log("closeModel!!");
  60. },
  61. async initForm() {
  62. this.newTime = 0;
  63. this.loading = true;
  64. if (this.isDetail === "003") {
  65. this.title = "添加发票申请";
  66. } else if (this.isDetail === "005") {
  67. this.title = "修改发票申请";
  68. } else if (this.isDetail === "007") {
  69. this.title = "发票申请详情";
  70. }
  71. this.changea();
  72. this.loading = false;
  73. },
  74. refreshAll() {
  75. this.showModelThis = false;
  76. this.$emit("refresh");
  77. },
  78. changea() {
  79. this.newTime = new Date().valueOf();
  80. },
  81. },
  82. };
  83. </script>
  84. <style lang="scss" scoped>
  85. .invoiceApply {
  86. }
  87. </style>