e4d46974fdd856a2620f65dfd47e4e9d1e4c5d76.svn-base 5.2 KB

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