84e6da0eb8a6e0b76a117a7305bccaf5ad48b768.svn-base 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template>
  2. <div>
  3. <!-- <el-dialog :title="'责任人填报'" :visible.sync="dialogFormVisible"> -->
  4. <el-container style="height:520px;">
  5. <el-main style="border:1px solid #d5d5ff;margin-left:5px;padding:0px;">
  6. <el-form :model="formObj" :label-width="formLabelWidth" :rules="rules">
  7. <p style="margin-top:10px;margin-bottom: 10px;font-weight: bold;">
  8. <i class="left-vertical"></i>
  9. <span>其他情况</span>
  10. <span class="hrs"></span>
  11. </p>
  12. <el-form-item label="其他需要说明的情况" :required="true">
  13. <el-input type="textarea" v-model="formObj.note" autocomplete="off" style="width:50%;">
  14. </el-input>
  15. </el-form-item>
  16. <el-form-item label="">
  17. <el-button type="primary" @click="addHandler" v-if="openType">保 存</el-button>
  18. </el-form-item>
  19. </el-form>
  20. </el-main>
  21. <problem-dialog
  22. v-if="showAddProblemDialog && openType"
  23. :objType="116"
  24. :villType="116"
  25. :objId="currentObjectId"
  26. :objName="currentObjectName"
  27. :problemMiddleType="'小水电隐患管理'"
  28. :problData="probId"
  29. @closeDialog="closePlDialog"
  30. :currentObjectRgstrId="currentObjectRgstrId"
  31. ></problem-dialog>
  32. <add-pic-com v-if="jqmmDialogShow" :dialogTitle="'相关材料'" :jqmmEngId="id" :type="type" :openType="openType" @jqmmDialogClose="jqmmDialogClose"></add-pic-com>
  33. </el-container>
  34. </div>
  35. </template>
  36. <script>
  37. import inputWith from "@widget/inuptWith.vue"
  38. import problemDialog from "../../duChaWenTi/problemDialog.vue";
  39. import addPicCom from "./addPic.vue"
  40. import request from "@util/gw_ajax_request.js"
  41. import {getOtherStat} from "@api/duChaTianBao.js"
  42. import {formatDateTimeD} from "@util/gw_date.js"
  43. export default {
  44. components: {
  45. inputWith: inputWith,
  46. problemDialog,
  47. addPicCom
  48. },
  49. props: ['currentObjectId','currentObjectName','currentObjectRgstrId','openType'],
  50. data() {
  51. var checkTel = (rule, value, callback) => {
  52. var isPhone = /^([0-9]{3,4}-)?[0-9]{7,8}$/;//座机
  53. var isMob= /^[1][3,4,5,7,8][0-9]{9}$/;// 座机格式
  54. if (value&&!isMob.test(value)&&!isPhone.test(value)) {
  55. callback(new Error('请输入合理电话'));
  56. } else if(value&&(isMob.test(value)||isPhone.test(value))){
  57. callback();
  58. }
  59. // setTimeout(() => {
  60. // }, 1000);
  61. };
  62. return {
  63. id:"",
  64. objtbStatu:{
  65. wtuntStat:"",
  66. rgstrId:"",
  67. id:"",
  68. state:""
  69. },
  70. rules:{
  71. wiunWaoLegPersTel:[
  72. { validator: checkTel,trigger: 'blur' }
  73. ],
  74. techPersTel:[
  75. { validator: checkTel,trigger: 'blur' }
  76. ],
  77. patrolPersTel:[
  78. { validator: checkTel,trigger: 'blur' }
  79. ],
  80. },
  81. jqmmDialogShow: false,
  82. type: '',
  83. formObj: {
  84. note:""
  85. },
  86. dialogFormVisible: false,
  87. formLabelWidth: '400px',
  88. loading: true,
  89. operationType1:'',
  90. rsvrRules: null,
  91. probId: '',
  92. showAddProblemDialog: false
  93. }
  94. },
  95. computed:{
  96. recPersId(){
  97. return localStorage.getItem("userid")? localStorage.getItem("userid"): ''
  98. }
  99. },
  100. created(){
  101. this.findItemByType()
  102. },
  103. mounted() {
  104. this.getRgstridObj();
  105. },
  106. watch: {
  107. currentObjectRgstrId(n,o){
  108. this.getRgstridObj();
  109. },
  110. },
  111. methods: {
  112. jqmmDialogClose() {
  113. this.jqmmDialogShow = false;
  114. },
  115. showPic(type){
  116. this.type = type
  117. this.jqmmDialogShow = true
  118. },
  119. getRgstridObj(){
  120. var _self = this;
  121. getOtherStat(_self.currentObjectRgstrId).then((res)=>{
  122. _self.formObj = res.data;
  123. _self.id = res.data.id;
  124. });
  125. },
  126. addHandler(){
  127. var _self = this;
  128. _self.formObj['rgstrId'] = _self.currentObjectRgstrId;
  129. _self.formObj['recPersId'] = _self.recPersId;
  130. if(!this.formObj.note){
  131. this.formObj.state = "0"
  132. }else if(
  133. this.formObj.note){
  134. this.formObj.state = "2";
  135. }else{
  136. this.formObj.state = "1"
  137. }
  138. this.$confirm('确认保存现场督查情况信息?', '提示', {
  139. confirmButtonText: '确定',
  140. cancelButtonText: '取消',
  141. type: 'warning'
  142. })
  143. .then(() => {
  144. try{
  145. request.post('/bis/insp/hystp/othr/',_self.formObj).then((res)=>{
  146. if (res.success) {
  147. _self.$message.success("修改成功");
  148. _self.$emit("addShuiKuSuccess");
  149. }
  150. });
  151. } catch(e) {
  152. }
  153. })
  154. .catch(() => {
  155. });
  156. },
  157. cancelHandler(){
  158. this.$emit('cancelHandler');
  159. },
  160. findItemByType(){
  161. const obj ={
  162. tname: "BIS_INSP_HYSTP_OTHR",
  163. }
  164. request.post("/bis/insp/item/ques/info/findItemByType",obj).then(res =>{
  165. this.rsvrRules = res.data;
  166. })
  167. },
  168. addProblem(item,iValue){
  169. let rest = this.rsvrRules.filter(e => {
  170. return e.iValue === iValue && e.eName === item;
  171. });
  172. if (rest[0]){
  173. this.probId = rest[0].id;
  174. }
  175. this.showAddProblemDialog = true;
  176. },
  177. formatRadio(val){
  178. if(val == '1'){
  179. return '是'
  180. }else if(val == '2'){
  181. return '否'
  182. }else{
  183. return val
  184. }
  185. },
  186. closePlDialog(val) {
  187. this.showAddProblemDialog = false;
  188. }
  189. },
  190. }
  191. </script>
  192. <style scoped>
  193. #dcdxHeader {
  194. padding: 15px 20px;
  195. }
  196. #dxdcFooter {
  197. text-align: center;
  198. }
  199. #dxdcAside {
  200. border:1px solid #d5d5ff;
  201. }
  202. .el-dialog__wrapper .el-treeWhite{
  203. /* max-height: 260px !important; */
  204. }
  205. .left-vertical {
  206. width: 8px;
  207. height: 24px;
  208. background: #00b0f0;
  209. display: inline-block;
  210. vertical-align: bottom;
  211. }
  212. .add-problem-icon{
  213. font-size: 16px;
  214. }
  215. .el-icon-camera-solid,.el-icon-circle-plus{
  216. margin-left: 20px;
  217. color: #00bbff;
  218. font-size: 18px;
  219. line-height: 12px;
  220. vertical-align: middle;
  221. cursor: pointer;
  222. }
  223. .el-icon-circle-plus{
  224. vertical-align: top;
  225. }
  226. </style>