bf3b3e7e4fc2872f118387f70264cb63504cc2e8.svn-base 8.6 KB

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