addEdtModal.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <div class="dialog">
  3. <el-dialog
  4. :title="formData.JGMC"
  5. width="40%"
  6. :visible.sync="dialogVisible"
  7. :before-close="close"
  8. :modal-append-to-body="false"
  9. :close-on-click-modal="false"
  10. >
  11. <div class="content">
  12. <div v-if="modelType === 'info'">
  13. <el-tabs
  14. type="border-card"
  15. class="xz_box"
  16. v-model="activeTabs"
  17. stretch
  18. >
  19. <el-tab-pane label="申请记录" name="sqjl">
  20. <CustomDetails :model="formData" :config="detailInfos">
  21. <template #attachment>
  22. <span>{{ formData.attachment }}</span>
  23. <i class="usable el-icon-tickets" @click="download"></i>
  24. </template>
  25. </CustomDetails>
  26. </el-tab-pane>
  27. <el-tab-pane
  28. label="审核记录"
  29. name="shjl"
  30. v-if="formData.state == 3 || formData.state == 4"
  31. >
  32. <!-- <el-tabs
  33. type="border-card"
  34. class="xz_box"
  35. v-model="activetime"
  36. stretch
  37. >
  38. <el-tab-pane
  39. v-for="(il, i) in formData.list"
  40. :key="i"
  41. :label="il.spTime"
  42. :name="il.spTime"
  43. > -->
  44. <CustomDetails :model="formData" :config="shjlInfos">
  45. <template #jg>
  46. <span> {{ stateMap[formData.state].name }}</span>
  47. </template>
  48. </CustomDetails>
  49. <!-- </el-tab-pane>
  50. </el-tabs> -->
  51. </el-tab-pane>
  52. <el-tab-pane
  53. label="撤回记录"
  54. name="chjl"
  55. v-if="formData.state == 2"
  56. >
  57. <CustomDetails :model="formData" :config="chInfos">
  58. </CustomDetails>
  59. </el-tab-pane>
  60. </el-tabs>
  61. </div>
  62. <div v-else-if="modelType === 'withdraw'">
  63. <!-- :rules="rules" -->
  64. <el-form :model="ruleForm" ref="ruleForm" label-width="100px">
  65. <el-form-item label="撤回原因:" prop="sqRevokeReason">
  66. <el-input
  67. v-model="ruleForm.sqRevokeReason"
  68. :rows="5"
  69. type="textarea"
  70. placeholder="理由描述"
  71. ></el-input>
  72. </el-form-item>
  73. <div class="tip">
  74. 说明:输入撤回原因,确定撤回后,系统会自动撤回,无需申请,系统后台会记录撤回信息。
  75. </div>
  76. </el-form>
  77. </div>
  78. </div>
  79. <span slot="footer" class="dialog-footer">
  80. <!-- <span class="clearBtn" @click="submit(true)">保存至模板</span> -->
  81. <el-button size="small" type="primary" plain @click="close">关闭</el-button>
  82. <el-button size="small" type="primary" v-if="modelType !== 'info'" @click="submit"
  83. >确 定</el-button
  84. >
  85. </span>
  86. </el-dialog>
  87. </div>
  88. </template>
  89. <script>
  90. import CustomDetails from "@/components/mapView/custom-detailsInfo.vue";
  91. import { detailInfos, shjlInfos, chInfos, stateMap } from "../config";
  92. import { revoke } from "@/api/shared.js";
  93. export default {
  94. components: {
  95. CustomDetails,
  96. },
  97. props: {},
  98. data() {
  99. return {
  100. detailInfos: detailInfos,
  101. shjlInfos: shjlInfos,
  102. chInfos: chInfos,
  103. modelType: "info",
  104. formData: {},
  105. ruleForm: { id: "", sqRevokeReason: "" },
  106. dialogVisible: false,
  107. activeTabs: "sqjl",
  108. activetime: "",
  109. stateMap: stateMap,
  110. };
  111. },
  112. created() {},
  113. methods: {
  114. download(obj) {
  115. window.open(obj.fileUrl);
  116. },
  117. // 关闭弹窗
  118. close() {
  119. this.dialogVisible = false;
  120. this.$emit("close");
  121. },
  122. reset(id) {
  123. this.ruleForm = {
  124. id: id,
  125. sqRevokeReason: "",
  126. };
  127. },
  128. Init(type, rowdata) {
  129. this.dialogVisible = true;
  130. this.activeTabs = "sqjl";
  131. this.modelType = type;
  132. this.formData = rowdata;
  133. this.reset(rowdata.id);
  134. // this.formData.list = [rowdata];
  135. // this.activetime = this.formData.list[0].spTime;
  136. },
  137. async submit() {
  138. revoke(this.ruleForm).then((res) => {
  139. if (res.code == 200) {
  140. this.$message.success("撤回成功!");
  141. this.close();
  142. }
  143. });
  144. },
  145. },
  146. };
  147. </script>
  148. <style lang="scss" scoped>
  149. .dialog {
  150. .content {
  151. height: 400px;
  152. overflow-y: auto;
  153. overflow-x: hidden;
  154. }
  155. .tip {
  156. color: #f56c6c;
  157. margin-left: 25px;
  158. }
  159. .is-plain{
  160. background-color: #3f94f53f ;
  161. border-color: #3f93f5;
  162. }
  163. }
  164. </style>
  165. <style lang="scss" >
  166. </style>