f57b384ad560d0cff06ba7574bf1d57748503ee3.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <template>
  2. <j-modal
  3. :title="title"
  4. :width="width"
  5. :visible="visible"
  6. :confirmLoading="confirmLoading"
  7. switchFullscreen
  8. @ok="handleOk"
  9. :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
  10. @cancel="handleCancel"
  11. cancelText="关闭">
  12. <a-tabs default-active-key="attrs" >
  13. <a-tab-pane key="attrs" tab="属性信息">
  14. <a-spin :spinning="confirmLoading">
  15. <j-form-container :disabled="disableSubmit">
  16. <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
  17. <a-row>
  18. <a-col :span="24">
  19. <a-form-model-item label="工程名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="gcmc">
  20. <a-input v-model="model.gcmc" placeholder="请输入工程名称"></a-input>
  21. </a-form-model-item>
  22. </a-col>
  23. <a-col :span="24">
  24. <a-form-model-item label="涉及河段" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sjhd">
  25. <j-popup placeholder="请选择河段主要指标中的河(渠)名称"
  26. v-model="model.sjhd"
  27. field="sjhd"
  28. org-fields="hqmc"
  29. dest-fields="sjhd"
  30. code="hqmc"
  31. :multi="true"
  32. :param="tempParam"
  33. @input="popupCallback"
  34. />
  35. </a-form-model-item>
  36. </a-col>
  37. <a-col :span="24">
  38. <a-form-model-item label="涉河类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shlx">
  39. <j-category-select placeholder="请选择工程分类下的具体工程类型,如桥梁工程!" v-model="model.shlx" pcode="A02"
  40. @change="shlxChange"/>
  41. </a-form-model-item>
  42. </a-col>
  43. <a-col :span="24">
  44. <a-form-model-item label="工程位置" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="gcwz">
  45. <a-input v-model="model.gcwz" placeholder="请输入工程位置(具体到县、乡、村)"></a-input>
  46. </a-form-model-item>
  47. </a-col>
  48. <a-col :span="24">
  49. <a-form-model-item label="经度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jd">
  50. <a-input v-model="model.jd" placeholder="请输入经度"></a-input>
  51. </a-form-model-item>
  52. </a-col>
  53. <a-col :span="24">
  54. <a-form-model-item label="纬度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="wd">
  55. <a-input v-model="model.wd" placeholder="请输入纬度"></a-input>
  56. </a-form-model-item>
  57. </a-col>
  58. <a-col :span="24">
  59. <a-form-model-item label="工程布置简况" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="gcbzqk">
  60. <a-input v-model="model.gcbzqk" placeholder="请输入工程布置简况"></a-input>
  61. </a-form-model-item>
  62. </a-col>
  63. <a-col :span="24">
  64. <a-form-model-item label="建设状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="jszt">
  65. <j-dict-select-tag type="list" v-model="model.jszt" dictCode="gcjsqk"
  66. placeholder="请选择建设状态"/>
  67. </a-form-model-item>
  68. </a-col>
  69. <a-col :span="24">
  70. <a-form-model-item label="工期开始日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="gqksrq">
  71. <j-date placeholder="请选择工期开始日期" v-model="model.gqksrq" style="width: 100%"/>
  72. </a-form-model-item>
  73. </a-col>
  74. <a-col :span="24">
  75. <a-form-model-item label="工期结束日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="gqjsrq">
  76. <j-date placeholder="请选择工期结束日期" v-model="model.gqjsrq" style="width: 100%"/>
  77. </a-form-model-item>
  78. </a-col>
  79. <a-col :span="24">
  80. <a-form-model-item label="河道岸线利用情况" :labelCol="labelCol" :wrapperCol="wrapperCol"
  81. prop="hdaxlyqk">
  82. <!-- <a-input v-model="model.hdaxlyqk" placeholder="请输入河道岸线利用情况"></a-input>-->
  83. <a-textarea rows="4" v-model="model.hdaxlyqk" placeholder="请输入河道岸线利用情况"></a-textarea>
  84. </a-form-model-item>
  85. </a-col>
  86. <a-col :span="24">
  87. <a-form-model-item label="占用河道管理范围情况" :labelCol="labelCol" :wrapperCol="wrapperCol"
  88. prop="zyhdglfw">
  89. <a-textarea rows="4" v-model="model.zyhdglfw" placeholder="请输入占用河道管理范围情况"></a-textarea>
  90. </a-form-model-item>
  91. </a-col>
  92. <a-col :span="24">
  93. <a-form-model-item label="河道岸线占用长度m" :labelCol="labelCol" :wrapperCol="wrapperCol"
  94. prop="hdaxzycd">
  95. <a-input v-model="model.hdaxzycd" placeholder="请输入河道岸线占用长度m"></a-input>
  96. </a-form-model-item>
  97. </a-col>
  98. <a-col :span="24">
  99. <a-form-model-item label="河道岸线占用面积m²" :labelCol="labelCol" :wrapperCol="wrapperCol"
  100. prop="hdaxzymj">
  101. <a-input v-model="model.hdaxzymj" placeholder="请输入河道岸线占用面积m²"></a-input>
  102. </a-form-model-item>
  103. </a-col>
  104. <a-col :span="24">
  105. <a-form-model-item label="建设期临时设施情况" :labelCol="labelCol" :wrapperCol="wrapperCol"
  106. prop="jsqlsssqk">
  107. <a-textarea rows="4" v-model="model.jsqlsssqk" placeholder="请输入建设期临时设施情况"></a-textarea>
  108. </a-form-model-item>
  109. </a-col>
  110. <a-col :span="24">
  111. <a-form-model-item label="现场联系人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="xclxr">
  112. <a-input v-model="model.xclxr" placeholder="请输入现场联系人"></a-input>
  113. </a-form-model-item>
  114. </a-col>
  115. <a-col :span="24">
  116. <a-form-model-item label="电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dh">
  117. <a-input v-model="model.dh" placeholder="请输入电话"></a-input>
  118. </a-form-model-item>
  119. </a-col>
  120. <a-col :span="24">
  121. <a-form-model-item label="其他" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="qt">
  122. <a-textarea v-model="model.qt" placeholder="请输入其他" rows="4"></a-textarea>
  123. </a-form-model-item>
  124. </a-col>
  125. </a-row>
  126. </a-form-model>
  127. </j-form-container>
  128. </a-spin>
  129. </a-tab-pane>
  130. <a-tab-pane key="map" tab="位置信息">
  131. <basic-map ref="locMap" layersUrl='/resManager.catalog/rescatalog/resList' :model="{...model,layerName:'泵站工程,岸线功能区'}"></basic-map>
  132. </a-tab-pane>
  133. </a-tabs>
  134. </j-modal>
  135. </template>
  136. <script>
  137. import {getAction, httpAction} from '@/api/manage'
  138. import {validateDuplicateValue} from '@/utils/util'
  139. import {postAction} from "../../../../../api/manage";
  140. import {loadCategoryData} from '@/api/api'
  141. import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  142. import BasicMap from "../../../../../components/BasicMap/BasicMap";
  143. export default {
  144. name: "RmAxshbfgcxxbModal",
  145. components: {
  146. BasicMap,
  147. },
  148. props: {
  149. mainId: {
  150. type: String,
  151. required: false,
  152. default: ''
  153. }
  154. },
  155. data() {
  156. return {
  157. title: "操作",
  158. width: 800,
  159. visible: false,
  160. model: {},
  161. main_id: '',
  162. labelCol: {
  163. xs: {span: 24},
  164. sm: {span: 5},
  165. },
  166. disableSubmit:false,
  167. wrapperCol: {
  168. xs: {span: 24},
  169. sm: {span: 16},
  170. },
  171. confirmLoading: false,
  172. validatorRules: {
  173. shlx: [
  174. { required: true, message: '请选择涉河类型!'},
  175. ],
  176. gcmc: [
  177. { required: true, message: '请输入工程名称!'},
  178. ],},
  179. url: {
  180. add: "/hzz.shjsgc.xmrk/rmAxxmxx/addRmAxshbfgcxxb",
  181. edit: "/hzz.shjsgc.xmrk/rmAxxmxx/editRmAxshbfgcxxb",
  182. queryById:'/sys/category/queryById',
  183. },
  184. tempParam: {},
  185. }
  186. },
  187. created() {
  188. //备份model原始值
  189. this.modelDefault = JSON.parse(JSON.stringify(this.model));
  190. // this.tabsChange();
  191. },
  192. methods: {
  193. // async loadhlcd() {
  194. // this.data1 = await postAction('/hzz.shjsgc.shxmxx/rmShxmxxb/findAllhlcd', {})
  195. // },
  196. add() {
  197. this.tempParam = {main_id: this.mainId}
  198. this.edit(this.modelDefault);
  199. },
  200. edit(record) {
  201. this.tempParam = {main_id: this.mainId}
  202. this.model = Object.assign({}, record);
  203. this.visible = true;
  204. },
  205. close() {
  206. this.$emit('close');
  207. this.visible = false;
  208. this.$refs.form.clearValidate();
  209. },
  210. handleOk() {
  211. const that = this;
  212. // 触发表单验证
  213. this.$refs.form.validate(valid => {
  214. if (valid) {
  215. that.confirmLoading = true;
  216. let httpurl = '';
  217. let method = '';
  218. if (!this.model.id) {
  219. httpurl += this.url.add;
  220. method = 'post';
  221. } else {
  222. httpurl += this.url.edit;
  223. method = 'post';
  224. }
  225. this.model['mainId'] = this.mainId
  226. httpAction(httpurl, this.model, method).then((res) => {
  227. if (res.success) {
  228. that.$message.success(res.message);
  229. that.$emit('ok');
  230. } else {
  231. that.$message.warning(res.message);
  232. }
  233. }).finally(() => {
  234. that.confirmLoading = false;
  235. that.close();
  236. })
  237. } else {
  238. return false
  239. }
  240. })
  241. },
  242. handleCancel() {
  243. this.close()
  244. },
  245. popupCallback(value, row) {
  246. this.model = Object.assign(this.model, row);
  247. },
  248. shlxChange(value){
  249. if(value){
  250. let param = {
  251. id:value
  252. }
  253. getAction(this.url.queryById,param).then(res=>{
  254. if(res.success){
  255. let hasChild = res.result.hasChild;
  256. if(hasChild == '1'){
  257. this.$message.warn('请选择工程分类下的具体工程类型,如桥梁工程!')
  258. }
  259. }
  260. })
  261. }
  262. }
  263. },
  264. initDictConfig() {
  265. loadCategoryData({code: 'A02'}).then((res) => {
  266. if (res.success) {
  267. this.$set(this.dictOptions, 'shlx', res.result)
  268. }
  269. })
  270. },
  271. tabsChange(key) {
  272. let that = this;
  273. if (key == "map") {
  274. this.$nextTick(() => {
  275. this.$refs.locMap.locateByCoords({...this.model});
  276. })
  277. }
  278. },
  279. locateByCoords() {
  280. let loc_x = this.lng;
  281. let loc_y = this.lat;
  282. this.$refs.locMap.locateByCoords(loc_x, loc_y);
  283. },
  284. beforeMount() {
  285. if (!this.height) {
  286. let calcHeight = window.document.documentElement.clientHeight - 225;
  287. let m_height = calcHeight.toString() + 'px';
  288. this.mapHeight = m_height;
  289. }
  290. },
  291. }
  292. </script>