c323159f5365563da93e9ee8ff52b46c81c2df60.svn-base 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686
  1. <template>
  2. <!-- 弹出窗 -->
  3. <el-dialog title="添加督查对象" width="60%" @close="closeDuChaDuiXiangDialog" :visible.sync="dialogFormVisible"
  4. :close-on-click-modal="false"
  5. :modal-append-to-body="true"
  6. :append-to-body="true">
  7. <el-container>
  8. <!--<el-aside width="200px" style="border:1px solid #d5d5ff">-->
  9. <!--<p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">-->
  10. <!--<i class="el-icon-share"></i>所属机构-->
  11. <!--</p>-->
  12. <!--<provTreeListQy-->
  13. <!--ref="provTreeListQyRef"-->
  14. <!--v-show="showLeftTree"-->
  15. <!--:ddczId='dczId'-->
  16. <!--rootCode="000000"-->
  17. <!--rootType="1"-->
  18. <!--style="max-height:485px;"-->
  19. <!--@treeDataEmit="treeDataEmit"-->
  20. <!--@provTreeSelectChange="provTreeSelectChangeHandler_qy">-->
  21. <!---->
  22. <!--</provTreeListQy>-->
  23. <!--<provTreeList-->
  24. <!--v-show="!showLeftTree"-->
  25. <!--rootCode="000000"-->
  26. <!--rootType="1"-->
  27. <!--style="max-height:485px;"-->
  28. <!--@provTreeSelectChange="provTreeSelectChangeHandler"-->
  29. <!--&gt;</provTreeList>-->
  30. <!--</el-aside>-->
  31. <el-main style="border:1px solid #d5d5ff;margin-left:5px;padding:0px;">
  32. <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">督查对象</p>
  33. <el-form style="padding:10px">
  34. <div>
  35. <el-form size="mini" :inline="true" class="demo-form-inline">
  36. <el-form-item label="供水工程名称">
  37. <el-input
  38. style="width:140px;"
  39. v-model="searchNameOfRsName"
  40. clearable
  41. placeholder="请输入供水工程名称"
  42. ></el-input>
  43. </el-form-item>
  44. <el-form-item label="工程类型" prop="prjType">
  45. <el-select v-model="prjType" clearable placeholder="请选择" autocomplete="off">
  46. <el-option label="团部" value="1"></el-option>
  47. <el-option label="跨团" value="2"></el-option>
  48. <el-option label="单连" value="3"></el-option>
  49. <el-option label="连连" value="4"></el-option>
  50. <el-option label="城乡一体化" value="5"></el-option>
  51. <el-option label="地方供水" value="6"></el-option>
  52. <el-option label="地方向兵团供水" value="7"></el-option>
  53. </el-select>
  54. </el-form-item>
  55. <el-form-item label="工程性质" prop="prjNtr">
  56. <el-select v-model="prjNtr" clearable placeholder="请选择" autocomplete="off">
  57. <el-option label="规模化供水工程" value="1"></el-option>
  58. <el-option label="小型供水工程" value="2"></el-option>
  59. <el-option label="分散供水工程" value="3"></el-option>
  60. </el-select>
  61. </el-form-item>
  62. <br/>
  63. <el-form-item label="工程规模" prop="waterSupply">
  64. <el-select v-model="waterSupply" clearable placeholder="请选择" autocomplete="off">
  65. <el-option label="城乡一体化工程" value="1"></el-option>
  66. <el-option label="万人供水工程" value="2"></el-option>
  67. <el-option label="千人供水工程" value="3"></el-option>
  68. <el-option label="千人以下供水工程" value="4"></el-option>
  69. <el-option label="水井" value="5"></el-option>
  70. <el-option label="其他" value="6"></el-option>
  71. </el-select>
  72. </el-form-item>
  73. <el-form-item>
  74. <el-button type="primary" @click="refreshCurrentShow">查询</el-button>
  75. </el-form-item>
  76. <el-form-item>
  77. <el-button type="primary" @click="toAddNewRsvr">添加新供水工程</el-button>
  78. </el-form-item>
  79. </el-form>
  80. <el-table
  81. border
  82. v-loading="loading"
  83. :data="currentShowList"
  84. tooltip-effect="dark"
  85. style="width: 100%"
  86. @selection-change="handleSelectionChange"
  87. >
  88. <el-table-column align="center" type="selection" width="60"></el-table-column>
  89. <el-table-column align="center" prop="index" label="序号" min-width="40"></el-table-column>
  90. <el-table-column
  91. align="center"
  92. show-overflow-tooltip
  93. prop="nm"
  94. label="供水工程名称"
  95. min-width="100"
  96. ></el-table-column>
  97. <el-table-column
  98. align="center"
  99. show-overflow-tooltip
  100. prop="prjType"
  101. label="工程类型"
  102. :formatter="prjTypeFormatter"
  103. min-width="80"
  104. ></el-table-column>
  105. <el-table-column
  106. align="center"
  107. show-overflow-tooltip
  108. prop="prjNtr"
  109. label="工程性质"
  110. :formatter="prjNtrFormatter"
  111. min-width="80"
  112. ></el-table-column>
  113. <el-table-column
  114. align="center"
  115. show-overflow-tooltip
  116. prop="waterSupply"
  117. label="工程规模"
  118. :formatter="waterSupplyFormatter"
  119. min-width="80"
  120. ></el-table-column>
  121. </el-table>
  122. <div
  123. class="block"
  124. style="display:flex;flex-direction:row;justify-content:center;align-items:center;padding-top: 5px;background-color: #fff;"
  125. >
  126. <el-pagination
  127. small
  128. @current-change="handleCurrentChange"
  129. :pager-count="5"
  130. :current-page.sync="pageIndex"
  131. :page-size="pageSize"
  132. layout="total, prev, pager, next"
  133. :total="total"
  134. ></el-pagination>
  135. </div>
  136. </div>
  137. </el-form>
  138. </el-main>
  139. </el-container>
  140. <div slot="footer" class="dialog-footer">
  141. <el-button @click="closeDuChaDuiXiangDialog">取 消</el-button>
  142. <el-button type="primary" @click="saveChange">确 定</el-button>
  143. </div>
  144. <el-dialog title="添加新供水工程" :visible.sync="addRsvrVisible" append-to-body width="40%" >
  145. <el-form label-width="200px" :model="formObj" :rules="rules" ref="formObj">
  146. <el-form-item label="工程名称" prop="nm">
  147. <el-input v-model="formObj.nm" clearable autocomplete="off"></el-input>
  148. </el-form-item>
  149. <el-form-item label="工程类型" prop="prjType">
  150. <el-select v-model="formObj.prjType" clearable placeholder="请选择" autocomplete="off" style="width:60%;">
  151. <el-option label="团部" value="1"></el-option>
  152. <el-option label="跨团" value="2"></el-option>
  153. <el-option label="单连" value="3"></el-option>
  154. <el-option label="连连" value="4"></el-option>
  155. <el-option label="城乡一体化" value="5"></el-option>
  156. <el-option label="地方供水" value="6"></el-option>
  157. <el-option label="地方向兵团供水" value="7"></el-option>
  158. </el-select>
  159. </el-form-item>
  160. <el-form-item label="工程性质" prop="prjNtr">
  161. <el-select v-model="formObj.prjNtr" clearable placeholder="请选择" autocomplete="off" style="width:60%;">
  162. <el-option label="规模化供水工程" value="1"></el-option>
  163. <el-option label="小型供水工程" value="2"></el-option>
  164. <el-option label="分散供水工程" value="3"></el-option>
  165. </el-select>
  166. </el-form-item>
  167. <el-form-item label="工程规模" prop="waterSupply">
  168. <el-select v-model="formObj.waterSupply" clearable placeholder="请选择" autocomplete="off" style="width:60%;">
  169. <el-option label="城乡一体化工程" value="1"></el-option>
  170. <el-option label="万人供水工程" value="2"></el-option>
  171. <el-option label="千人供水工程" value="3"></el-option>
  172. <el-option label="千人以下供水工程" value="4"></el-option>
  173. <el-option label="水井" value="5"></el-option>
  174. <el-option label="其他" value="6"></el-option>
  175. </el-select>
  176. </el-form-item>
  177. <el-form-item label="行政区划" style="position: relative">
  178. <el-input
  179. v-model="formObj.adName"
  180. autocomplete="off"
  181. @focus="showMenuTree = true"
  182. auto-complete="off"
  183. readonly
  184. style="width:60%;"
  185. ></el-input>
  186. <provTreeList
  187. style="width:300px;"
  188. v-if="showMenuTree"
  189. :rootCode="rootCode"
  190. :rootType="rootType"
  191. @provTreeSelectChange="provTreeSelectChangeHandler"
  192. ></provTreeList>
  193. </el-form-item>
  194. <el-form-item label="覆盖人口数" prop="rsName">
  195. <el-input v-model="formObj.persSize" clearable autocomplete="off" style="width:60%;"></el-input>
  196. </el-form-item>
  197. </el-form>
  198. <div slot="footer" class="dialog-footer">
  199. <el-button @click="addRsvrVisible = false">取 消</el-button>
  200. <el-button type="primary" @click="addNewRsvr('formObj')">确 定</el-button>
  201. </div>
  202. </el-dialog>
  203. </el-dialog>
  204. </template>
  205. <script>
  206. import request from '@util/gw_ajax_request'
  207. import provTreeList from "@widget/provTreeList.vue";
  208. // import provTreeListQy from "../../widgets/provTreeList_quyu.vue"
  209. import {
  210. getObjListNotInspGroupId,
  211. addDcAndObjRel
  212. } from "@api/duChaDuiXiang_xsk_API.js";
  213. export default {
  214. components: {
  215. provTreeList: provTreeList,
  216. provTreeListQy: resolve => {
  217. require(['@widget/provTreeList_quyu.vue'], resolve)
  218. },
  219. },
  220. props: ["dczId", "dczName", "plnaId", "objType", "rowData","villageAdCode"],
  221. data() {
  222. return {
  223. showMenuTree:false,
  224. rootCode: "000000",
  225. rootType: "2",
  226. addOnce: false,
  227. objTypeName: '小水库',
  228. xsk: true,
  229. ncys: false,
  230. shgc: false,
  231. dxs: false,
  232. searchNameOfRsName: "",
  233. prjType:"",
  234. prjNtr:"",
  235. waterSupply:"",
  236. searchNameOfAdName: "",
  237. searchNameOfwtdstNm: "",
  238. addLevel: "",
  239. rsAdmDep: "",
  240. engScal: "",
  241. wtdstState: "",
  242. engLevel: "",
  243. wtdstType: "",
  244. stnm: '',
  245. pageIndex: 1,
  246. pageSize: 10,
  247. total: 0,
  248. currentShowList: [],
  249. dialogFormVisible: true,
  250. formLabelWidth: "120",
  251. addArr: "",
  252. addName: "",
  253. addLttd: "",
  254. addLgtd: "",
  255. multipleSelection: [],
  256. searchProvTreeListCode: "",
  257. qyDataList: [],
  258. loading: false,
  259. showLeftTree: true,
  260. addRsvrVisible: false,
  261. formObj: {
  262. nm:"",
  263. adName:"",
  264. adCode:"",
  265. loc:"",
  266. prjType:"",
  267. prjNtr:"",
  268. waterSupply:"",
  269. persSize:""
  270. },
  271. areasList: [],
  272. props: {
  273. value: 'id',
  274. label: 'label',
  275. children: 'cities'
  276. },
  277. rules: {
  278. nm: [
  279. {required: true, message: '请输入工程名称', trigger: 'blur'},
  280. ],
  281. prjType: [
  282. {required: true, message: '请输入工程类型', trigger: 'blur'}
  283. ],
  284. prjNtr: [
  285. {required: true, message: '请选择工程性质', trigger: 'blur'}
  286. ],
  287. waterSupply: [
  288. {required: true, message: '请选择工程规模', trigger: 'blur'}
  289. ]
  290. },
  291. provList: [],
  292. cityList: [],
  293. countryList: [],
  294. provName: '',
  295. cityName: '',
  296. countryName: '',
  297. provNames: '',
  298. cityNames: '',
  299. countryNames: '',
  300. curSelectItem: 0
  301. }
  302. },
  303. watch: {
  304. dczId: function (n, o) {
  305. this.searchProvTreeListCode = "";
  306. },
  307. qyDataList(n, o) {
  308. if (this.qyDataList.length == 0) {
  309. this.showLeftTree = false;
  310. } else {
  311. this.showLeftTree = true;
  312. }
  313. console.log("区域树" + n.length + this.showLeftTree + this.objType);
  314. if (this.objType == '1') {
  315. this.getTableData_sk();
  316. this.getAreaList()
  317. } else if (this.objType == '5') {
  318. this.getTableData_dxs();
  319. }
  320. }
  321. },
  322. mounted() {
  323. this.getTableData_sk();
  324. },
  325. computed: {
  326. userId: function () {
  327. return localStorage.getItem("userid") ? localStorage.getItem("userid") : '1098101939614724096'
  328. },
  329. },
  330. methods: {
  331. provTreeSelectChangeHandler: function(params) {
  332. this.$set(this.formObj,'adName',params.name);
  333. this.$set(this.formObj,'adCode',params.code);
  334. },
  335. changeCurrentObjSelectName(item) {
  336. this.objType = item;
  337. },
  338. selectChange(val) {
  339. console.log(val);
  340. this.objType = val;
  341. },
  342. prjTypeFormatter: function (row, column) {
  343. return row.prjType == 1 ? "团部" :
  344. row.prjType == 2 ? "跨团" :
  345. row.prjType == 3 ? "单连" :
  346. row.prjType == 4 ? "连连" :
  347. row.prjType == 5 ? "城乡一体化" :
  348. row.prjType == 6 ? "地方供水" :
  349. row.prjType == 7 ? "地方向兵团供水" : ""
  350. },
  351. prjNtrFormatter: function (row, column) {
  352. return row.prjNtr == 1 ? "规模化供水工程" :
  353. row.prjNtr == 2 ? "小型供水工程" :
  354. row.prjNtr == 3 ? "分散供水工程" : ""
  355. },
  356. waterSupplyFormatter: function (row, column) {
  357. return row.waterSupply == 1 ? "城乡一体化工程" :
  358. row.waterSupply == 2 ? "万人供水工程" :
  359. row.waterSupply == 3 ? "千人供水工程" :
  360. row.waterSupply == 4 ? "千人以下供水工程" :
  361. row.waterSupply == 5 ? "水井" :
  362. row.waterSupply == 6 ? "其他" : ""
  363. },
  364. wtdstStateFormatter: function (row, column) {
  365. return row.wtdstState == 1 ? "已修复" : "未修复";
  366. },
  367. rsAdmDepFormatter: function (row, column) {
  368. return row.rsAdmDep == 1
  369. ? "水利部门"
  370. : row.rsAdmDep == 2
  371. ? "电力部门"
  372. : row.rsAdmDep == 3
  373. ? "农业部门"
  374. : row.rsAdmDep == 4
  375. ? "林业部门"
  376. : row.rsAdmDep == 5
  377. ? "城建部门"
  378. : row.rsAdmDep == 6
  379. ? "航运部门"
  380. : row.rsAdmDep == 7
  381. ? "环保部门"
  382. : "其他部门";
  383. },
  384. adGradFormatter: function (row, column) {
  385. return row.adGrad == 1
  386. ? "国家级"
  387. : row.adGrad == 2
  388. ? "省级"
  389. : row.adGrad == 3
  390. ? "地市级"
  391. : row.adGrad == 4
  392. ? "县级"
  393. : row.adGrad == 5
  394. ? "乡级"
  395. : row.adGrad == 6
  396. ? "村"
  397. : "村组";
  398. },
  399. adNameFormatter: function (row, column) {
  400. return row.adName;
  401. },
  402. adFullNameFormatter: function (row, column) {
  403. return row.adFullName;
  404. },
  405. adCodeFormatter: function (row, column) {
  406. return row.adCode;
  407. },
  408. saveChange() {
  409. this.addObjectChange();
  410. },
  411. treeDataEmit(item) {
  412. this.qyDataList = item;
  413. if (this.qyDataList.length == 0) {
  414. this.showLeftTree = false;
  415. } else {
  416. this.showLeftTree = true;
  417. }
  418. },
  419. getTableData_sk() {
  420. var _self = this;
  421. // if(_self.qyDataList.length == 0){
  422. // _self.showLeftTree = false;
  423. // }else{
  424. // _self.showLeftTree = true;
  425. // }
  426. _self.loading = true;
  427. // var str = '';
  428. // for(var i=0;i<_self.qyDataList.length;i++){
  429. // str+= _self.qyDataList[i].adCode+',';
  430. // }
  431. // str = str.substring(0,str.length-1);
  432. // var obj = {
  433. // "adcd": str,
  434. // "rsName": _self.searchNameOfRsName,
  435. // "engScal": _self.engScal,
  436. // "id": _self.userId,
  437. // "groupId":_self.dczId,
  438. // "pageNum":_self.pageIndex,
  439. // "pageSize":_self.pageSize
  440. // }
  441. let obj = {
  442. "regmId": _self.villageAdCode,
  443. "nm": _self.searchNameOfRsName,
  444. "prjType": _self.prjType,
  445. "prjNtr":_self.prjNtr,
  446. "waterSupply":_self.waterSupply,
  447. "pageNum": _self.pageIndex,
  448. "pageSize": _self.pageSize,
  449. "rgstrId": _self.rowData.rgstrId
  450. }
  451. request.post('/bis/insp/xjvill/run/pageNotDC', obj).then((res) => {
  452. _self.loading = false;
  453. _self.currentShowList = res.data.list;
  454. _self.currentShowList.forEach((element, index) => {
  455. element["index"] = _self.pageSize * (_self.pageIndex - 1) + index + 1;
  456. });
  457. _self.total = res.data.total;
  458. })
  459. },
  460. getTableData: function (callBackFunction = null) {
  461. var _self = this;
  462. if (!this.dczId) {
  463. // this.dczId = 'jwW2Wihf5E9X3UC9t45fmSHyffUs2rzI';
  464. }
  465. if (_self.objType == '1' || _self.objType == "5") {
  466. return;
  467. }
  468. let str = '';
  469. for (var i = 0; i < _self.qyDataList.length; i++) {
  470. str += _self.qyDataList[i].adCode + ',';
  471. }
  472. str = str.substring(0, str.length - 1);
  473. getObjListNotInspGroupId(
  474. this.dczId,
  475. this.objType,
  476. this.pageSize,
  477. this.pageIndex,
  478. this.searchNameOfRsName, //水库名称
  479. this.searchNameOfAdName, //农村饮水行政区划名称
  480. this.searchNameOfwtdstNm, //水毁工程名称
  481. this.engScal, //水库-工程规模
  482. this.rsAdmDep, //水库-归口管理部门
  483. this.wtdstType, //水毁-工程类别
  484. this.wtdstState, //水毁-修复状态
  485. this.searchProvTreeListCode == '' ? str : this.searchProvTreeListCode,
  486. ).then(
  487. res => {
  488. _self.currentShowList = [];
  489. res.data.list.forEach((element, index) => {
  490. element["index"] = _self.pageSize * (_self.pageIndex - 1) + index + 1;
  491. _self.currentShowList.push(element);
  492. });
  493. console.log(_self.currentShowList);
  494. _self.total = res.data.total;
  495. if (callBackFunction && typeof (callBackFunction) == 'function') {
  496. callBackFunction();
  497. }
  498. },
  499. err => {
  500. console.log("查询错误");
  501. if (callBackFunction && typeof (callBackFunction) == 'function') {
  502. callBackFunction();
  503. }
  504. }
  505. );
  506. },
  507. handleSelectionChange(val) {
  508. this.multipleSelection = val;
  509. },
  510. handleCurrentChange(val) {
  511. console.log(`当前页: ${val}`);
  512. this.refreshCurrentShow();
  513. },
  514. refreshCurrentShow: function () {
  515. this.getTableData_sk();
  516. },
  517. addObjectChange: function () {
  518. const length = this.multipleSelection.length;
  519. for (let i = 0; i < length; i++) {
  520. this.addArr += this.multipleSelection[i].id + ";";
  521. }
  522. this.addArr = this.addArr.substr(0, this.addArr.length - 1);
  523. try {
  524. let obj = {
  525. "regmId": this.villageAdCode,
  526. "cwsIds": this.addArr,
  527. "regstrId": this.rowData.rgstrId
  528. }
  529. request.post(`/bis/insp/xjvill/run/addBatch`,obj)
  530. .then(res =>{
  531. if(res.success){
  532. this.dialogFormVisible = false;
  533. this.$message.success("添加成功");
  534. this.$emit("addSuccess");
  535. _self.addArr = "";
  536. }else{
  537. this.$message.warning(res.message);
  538. }
  539. })
  540. } catch (e) {
  541. alert("暂无数据");
  542. }
  543. },
  544. // provTreeSelectChangeHandler: function (params) {
  545. // this.searchProvTreeListCode = params.code;
  546. // if (this.objType == '1') {
  547. // this.getTableData_sk1();
  548. // } else if (this.objType == '2' || this.objType == '3') {
  549. // this.getTableData();
  550. // } else {
  551. //
  552. // }
  553. // },
  554. provTreeSelectChangeHandler_qy(params) {
  555. this.searchProvTreeListCode = params.code;
  556. if (this.objType == '1') {
  557. this.getTableData_sk1();
  558. } else if (this.objType == '5') {
  559. this.getTableData_dxs1();
  560. } else if (this.objType == '2' || this.objType == '3') {
  561. this.getTableData();
  562. }
  563. },
  564. toAddNewRsvr() {
  565. this.cityList = [];
  566. this.countryList = [];
  567. this.provList = [];
  568. this.provName = "";
  569. this.cityName = "";
  570. this.countryName = "";
  571. for (var obj in this.formObj) {
  572. this.formObj[obj] = '';
  573. }
  574. this.addRsvrVisible = true;
  575. this.curSelectItem = null;
  576. this.getAreaList();
  577. },
  578. addNewRsvr(formName) {
  579. let obj = {
  580. "adName": this.formObj.adName,
  581. "adCode": this.formObj.adCode,
  582. "nm": this.formObj.nm,
  583. "prjType": this.formObj.prjType,
  584. "prjNtr": this.formObj.prjNtr,
  585. "waterSupply": this.formObj.waterSupply,
  586. "loc": this.formObj.loc,
  587. }
  588. this.$refs[formName].validate((valid) => {
  589. if (valid) {
  590. request.post('/att/xjcws/base', obj).then(res => {
  591. if (res.success) {
  592. this.$message.success('添加成功')
  593. this.getTableData_sk();
  594. this.addRsvrVisible = false
  595. } else {
  596. _this.$message.error(res.message)
  597. }
  598. }).catch(res => {
  599. this.$message.error(res.message)
  600. })
  601. } else {
  602. console.log('error submit!!');
  603. return false;
  604. }
  605. });
  606. },
  607. getAreaList(val) {
  608. let adCode = ''
  609. if (!val) {
  610. adCode = '000000000000'
  611. } else {
  612. adCode = val
  613. }
  614. request.get('/dc/ad/base/getAdData', {params: {'adCode': adCode}}).then(res => {
  615. if (res.success) {
  616. if (this.curSelectItem == 1) {
  617. this.cityList = res.data
  618. } else if (this.curSelectItem == 2) {
  619. this.countryList = res.data
  620. } else {
  621. this.provList = res.data
  622. }
  623. }
  624. })
  625. },
  626. handleItemChange(val) {
  627. this.getAreaList(val)
  628. },
  629. provChange(val) {
  630. this.curSelectItem = 1
  631. this.cityName = ''
  632. this.countryName = ''
  633. this.formObj.admDiv = val
  634. this.provList.forEach(ele => {
  635. if (ele.adCode == this.provName) {
  636. this.provNames = ele.adName
  637. }
  638. })
  639. this.formObj.location = this.provNames
  640. this.getAreaList(val)
  641. },
  642. cityChange(val) {
  643. this.curSelectItem = 2
  644. if (val && val != '') {
  645. this.formObj.admDiv = val
  646. this.countryName = ''
  647. this.cityList.forEach(ele => {
  648. if (ele.adCode == this.cityName) {
  649. this.cityNames = ele.adName
  650. }
  651. })
  652. this.formObj.location = this.provNames + this.cityNames
  653. this.getAreaList(val)
  654. }
  655. },
  656. countryChange(val) {
  657. if (val && val != '') {
  658. this.formObj.admDiv = val
  659. this.countryList.forEach(ele => {
  660. if (ele.adCode == this.countryName) {
  661. this.countryNames = ele.adName
  662. }
  663. })
  664. this.formObj.location = this.provNames + this.cityNames + this.countryNames
  665. }
  666. },
  667. closeDuChaDuiXiangDialog() {
  668. this.dialogFormVisible = false;
  669. this.$emit("closeDuChaDuiXiangDialog");
  670. }
  671. }
  672. };
  673. </script>
  674. <style>
  675. </style>