6c76d9e572b7e6a07a655f799cfbaa2c17c79b18.svn-base 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <div class="fanghong_wrapper">
  3. <el-container style="height:520px;">
  4. <el-main style="border:1px solid #d5d5ff;margin-left:5px;padding:0px;">
  5. <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">信息填报</p>
  6. <el-form :model="addObj" :label-width="formLabelWidth" ref="ruleForm" :rules="rules">
  7. <el-form-item label="存在问题原因分析">
  8. <el-input type="textarea" :rows="3" v-model="addObj.reasons"></el-input>
  9. </el-form-item>
  10. <el-form-item label="整改意见">
  11. <el-input type="textarea" :rows="3" v-model="addObj.rectSugg"></el-input>
  12. </el-form-item>
  13. <el-form-item label="备注">
  14. <el-input type="textarea" :rows="3" v-model="addObj.note"></el-input>
  15. </el-form-item>
  16. <el-form-item label>
  17. <el-button type="primary" @click="makesure" v-if="openType">保 存</el-button>
  18. </el-form-item>
  19. </el-form>
  20. </el-main>
  21. </el-container>
  22. </div>
  23. </template>
  24. <script>
  25. import request from "@util/gw_ajax_request.js";
  26. import { getReasonAndSuggInfo } from "@api/duChaTianBao.js";
  27. export default {
  28. components: {
  29. },
  30. props: ['currentObjectId','currentObjectName','currentObjectRgstrId','currentResCode','rowData','openType'],
  31. data() {
  32. return {
  33. dialogFormVisible: false,
  34. formLabelWidth: "180px",
  35. loading: true,
  36. placeholder: '',
  37. addObj: {},
  38. operationType: "",
  39. rules: {
  40. },
  41. };
  42. },
  43. computed: {
  44. recPersId() {
  45. return localStorage.getItem("userid") ? localStorage.getItem("userid") : "1098101939614724096";
  46. }
  47. },
  48. created(){
  49. },
  50. mounted() {
  51. this.getformList();
  52. },
  53. methods: {
  54. getformList() {
  55. let _self = this;
  56. getReasonAndSuggInfo(_self.currentObjectRgstrId).then(res => {
  57. if (res.success) {
  58. if (res.data && Object.keys(res.data).length) {
  59. _self.addObj = res.data;
  60. } else {
  61. _self.addObj = {};
  62. }
  63. } else {
  64. this.$message.error(res.message)
  65. }
  66. });
  67. },
  68. //保存
  69. makesure() {
  70. let _self = this;
  71. this.addObj["rgstrId"] = this.currentObjectRgstrId;
  72. this.addObj["recPersId"] = this.recPersId;
  73. this.addObj["status"] = '1';
  74. // 更改填报状态 to-do: 需要确认填报状态的字段是什么
  75. if (
  76. this.addObj.reasons ||
  77. this.addObj.rectSugg ||
  78. this.addObj.note
  79. ) {
  80. this.addObj.status = "1";
  81. }
  82. if (
  83. this.addObj.reasons &&
  84. this.addObj.rectSugg &&
  85. this.addObj.note
  86. ) {
  87. this.addObj.status = "2";
  88. }
  89. if (
  90. this.addObj.reasons == undefined &&
  91. this.addObj.rectSugg == undefined &&
  92. this.addObj.note == undefined
  93. ) {
  94. this.addObj.status = "0";
  95. }
  96. this.$refs['ruleForm'].validate((valid) => {
  97. if (valid) {
  98. this.$confirm("确认保存填写的信息吗?", "提示", {
  99. confirmButtonText: "确定",
  100. cancelButtonText: "取消",
  101. type: "warning"
  102. }).then(() => {
  103. request.post("/bis/insp/efp/rgstr/reasons/rec", _self.addObj).then(res => {
  104. if (res.success) {
  105. _self.$message.success("保存成功");
  106. _self.$emit("addShuiKuSuccess");
  107. _self.getformList();
  108. }
  109. });
  110. }).catch((err)=>{
  111. this.$message.info(err)
  112. });
  113. }else{
  114. this.$message.warning('请检查填写信息')
  115. return
  116. }
  117. });
  118. },
  119. cancelHandler() {
  120. this.$emit("cancelHandler");
  121. },
  122. handleCheckedChange(){
  123. }
  124. },
  125. watch: {
  126. currentObjectRgstrId(n, o) {
  127. this.getformList();
  128. }
  129. }
  130. };
  131. </script>
  132. <style lang="scss">
  133. #dcdxHeader {
  134. padding: 15px 20px;
  135. }
  136. #dxdcFooter {
  137. text-align: center;
  138. }
  139. #dxdcAside {
  140. border: 1px solid #d5d5ff;
  141. }
  142. .fanghong_wrapper label.el-radio {
  143. width: 60px;
  144. }
  145. .fanghong_wrapper .el-form{
  146. margin-top: 10px;
  147. }
  148. .fanghong_wrapper
  149. .add-problem-icon{
  150. font-size: 16px;
  151. }
  152. </style>