e78395aff82b3e265b10cf72e9b13e59027a6d1f.svn-base 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <template>
  2. <div>
  3. <el-container>
  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="formObj" :label-width="formLabelWidth">
  7. <p style="margin-top:10px;margin-bottom: 10px;overflow: hidden;"><i class="el-icon-caret-right"></i><span
  8. style="width:120px;padding-left: 10px">基本信息</span><span class="hrs"></span>
  9. </p>
  10. <el-form-item label="供水工程名称" required>
  11. <el-input v-model="formObj.nm" autocomplete="off" style="width:70%;"></el-input>
  12. </el-form-item>
  13. <el-form-item label="供水工程规模">
  14. <el-select v-model="formObj.designWaterSupply" clearable placeholder="请选择">
  15. <el-option label="万人工程" value="1"></el-option>
  16. <el-option label="千人工程" value="2"></el-option>
  17. <el-option label="千人以下集中供水工程" value="3"></el-option>
  18. </el-select>
  19. </el-form-item>
  20. <el-form-item label="地点(县,乡镇,行政村,村组)">
  21. <el-input v-model="formObj.loc" autocomplete="off" style="width:70%;"></el-input>
  22. </el-form-item>
  23. <el-form-item label="运行管理单位名称">
  24. <el-input v-model="formObj.runDep" autocomplete="off" style="width:70%;"></el-input>
  25. </el-form-item>
  26. <el-form-item label="管理人员数量">
  27. <el-input v-model="formObj.mngSize" autocomplete="off" style="width:70%;"></el-input>
  28. </el-form-item>
  29. <el-form-item label="" style="text-align: center">
  30. <el-button type="primary" @click="addHandler" v-if="openType">保 存</el-button>
  31. </el-form-item>
  32. </el-form>
  33. </el-main>
  34. </el-container>
  35. </div>
  36. </template>
  37. <script>
  38. import request from "@util/gw_ajax_request.js"
  39. export default {
  40. components: {
  41. },
  42. props: ['id','currentObjectRgstrId', 'currentResCode', 'currentObjectId', 'currentObjectName','openType','currentGcTitle','currentGcId'],
  43. data() {
  44. return {
  45. formObj: {
  46. nm:"",
  47. designWaterSupply:"",
  48. loc:"",
  49. runDep:"",
  50. mngSize:""
  51. },
  52. dialogFormVisible: false,
  53. formLabelWidth: '160px',
  54. loading: true,
  55. operationType1: '',
  56. currentResCode1: '',
  57. currentObjectId1: '',
  58. value1: '',
  59. provList: [],
  60. cityList: [],
  61. countryList: [],
  62. provName: '',
  63. cityName: '',
  64. countryName: '',
  65. provNames: '',
  66. cityNames: '',
  67. countryNames: '',
  68. curSelectItem: 0,
  69. showLocSelect: false,
  70. locat: {
  71. location: "",
  72. admDiv: ""
  73. },
  74. xcztShow: false,
  75. imageShow: false,
  76. xcztEngId: '',
  77. centerX: 0,
  78. centerY: 0
  79. }
  80. },
  81. computed: {
  82. recPersId() {
  83. return localStorage.getItem("userid") ? localStorage.getItem("userid") : ''
  84. }
  85. },
  86. mounted() {
  87. this.currentResCode1 = this.currentResCode;
  88. this.currentObjectId1 = this.currentObjectId;
  89. this.getRgstridObj();
  90. },
  91. watch: {
  92. id(n, o) {
  93. this.getRgstridObj();
  94. },
  95. showLocSelect(val) {
  96. if (!val) {
  97. this.formObj.rvLoc = this.locat.location
  98. this.formObj.admDiv = this.locat.admDiv
  99. this.provName = ''
  100. this.cityName = ''
  101. this.countryName = ''
  102. }
  103. }
  104. },
  105. methods: {
  106. getRgstridObj() {
  107. var _self = this;
  108. request.get("/bis/insp/villgd/wtsp/"+this.currentGcId).then(res => {
  109. if (res.success) {
  110. if (res.data) {
  111. _self.formObj = res.data;
  112. } else {
  113. _self.formObj = {};
  114. }
  115. }
  116. })
  117. },
  118. addHandler() {
  119. var _self = this;
  120. try {
  121. this.$confirm('确认保存基础信息?', '提示', {
  122. confirmButtonText: '确定',
  123. cancelButtonText: '取消',
  124. type: 'warning'
  125. }).then(() => {
  126. request.post('/bis/insp/villgd/wtsp', _self.formObj).then((res) => {
  127. if (res.success) {
  128. _self.getRgstridObj()
  129. _self.$message.success("修改成功");
  130. } else {
  131. _self.$emit('cancelHandler');
  132. }
  133. });
  134. })
  135. } catch (e) {
  136. }
  137. },
  138. cancelHandler() {
  139. this.$emit('cancelHandler');
  140. },
  141. formatRadio(val) {
  142. if (val == '1') {
  143. return '是'
  144. } else if (val == '0') {
  145. return '否'
  146. } else {
  147. return val
  148. }
  149. },
  150. getAreaList(val) {
  151. let areaParams = {
  152. adName: "",
  153. id: this.dczId,
  154. pageNum: 1,
  155. pageSize: 10000
  156. }
  157. let adCode = ''
  158. if (!val) {
  159. adCode = '000000000000'
  160. } else {
  161. adCode = val
  162. }
  163. request.get('/dc/ad/base/getAdData', {params: {'adCode': adCode}}).then(res => {
  164. if (res.success) {
  165. if (this.curSelectItem == 1) {
  166. this.cityList = res.data
  167. } else if (this.curSelectItem == 2) {
  168. this.countryList = res.data
  169. } else {
  170. this.provList = res.data
  171. }
  172. }
  173. })
  174. },
  175. provChange(val) {
  176. this.curSelectItem = 1
  177. this.cityName = ''
  178. this.countryName = ''
  179. this.formObj.admDiv = val
  180. this.provList.forEach(ele => {
  181. if (ele.adCode == this.provName) {
  182. this.provNames = ele.adName
  183. }
  184. })
  185. this.formObj.adName = this.provNames
  186. this.getAreaList(val)
  187. },
  188. RsvrTypeChange(val) {
  189. },
  190. cityChange(val) {
  191. this.curSelectItem = 2
  192. if (val && val != '') {
  193. this.formObj.admDiv = val
  194. this.countryName = ''
  195. this.cityList.forEach(ele => {
  196. if (ele.adCode == this.cityName) {
  197. this.cityNames = ele.adName
  198. }
  199. })
  200. this.formObj.adName = this.provNames + this.cityNames
  201. this.getAreaList(val)
  202. }
  203. },
  204. countryChange(val) {
  205. if (val && val != '') {
  206. this.formObj.admDiv = val
  207. this.countryList.forEach(ele => {
  208. if (ele.adCode == this.countryName) {
  209. this.countryNames = ele.adName
  210. }
  211. })
  212. this.formObj.adName = this.provNames + this.cityNames + this.countryNames
  213. this.formObj.adCode = val
  214. }
  215. },
  216. // 近期面貌
  217. recentAppearance() {
  218. this.xcztShow = true;
  219. },
  220. jqmmDialog() {
  221. this.xcztShow = false;
  222. },
  223. //影像
  224. imageClick() {
  225. if (!this.centerX && !this.centerY) {
  226. this.$message.warning('暂无经纬度信息!');
  227. return false;
  228. }
  229. this.imageShow = true;
  230. }
  231. },
  232. }
  233. </script>
  234. <style>
  235. #dcdxHeader {
  236. padding: 15px 20px;
  237. }
  238. #dxdcFooter {
  239. text-align: center;
  240. }
  241. #dxdcAside {
  242. border: 1px solid #d5d5ff;
  243. }
  244. .el-dialog__wrapper .el-treeWhite {
  245. /* max-height: 260px !important; */
  246. }
  247. </style>