d4c66f4d648258de36d3782003010f8c6debb6da.svn-base 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <div :style="{'height':this.tableHeight+'px'}">
  3. <el-container>
  4. <el-main style="border:1px solid #d5d5ff;margin-left:5px;padding:0px;overflow-x: hidden;">
  5. <el-table :data="villageList" :height="tableHeight1" style="width: 100%">
  6. <el-table-column align="center" show-overflow-tooltip prop="adNm" label="行政村名(*县*乡镇*村)" min-width="160"></el-table-column>
  7. <el-table-column align="center" show-overflow-tooltip prop="isPoverty" label="是否贫困村" min-width="80">
  8. <template slot-scope="scope">
  9. <span>{{formatRadio(scope.row.isPoverty)}}</span>
  10. </template>
  11. </el-table-column>
  12. <el-table-column align="center" show-overflow-tooltip prop="isFluexc" label="是否氟超标地区" min-width="100">
  13. <template slot-scope="scope">
  14. <span>{{formatRadio(scope.row.isFluexc)}}</span>
  15. </template>
  16. </el-table-column>
  17. <el-table-column align="center" show-overflow-tooltip prop="isMtarea" label="是否山区" min-width="70">
  18. <template slot-scope="scope">
  19. <span>{{formatRadio(scope.row.isMtarea)}}</span>
  20. </template>
  21. </el-table-column>
  22. <el-table-column align="center" show-overflow-tooltip prop="isCenwtSupply" label="是否集中供水村" min-width="100">
  23. <template slot-scope="scope">
  24. <span>{{formatRadio(scope.row.isCenwtSupply)}}</span>
  25. </template>
  26. </el-table-column>
  27. <el-table-column align="center" show-overflow-tooltip prop="watersupplyPer" label="集中供水人口比例" min-width="110">
  28. <template slot-scope="scope">
  29. <span>{{scope.row.watersupplyPer ? scope.row.watersupplyPer * 100 + '%' : ''}}</span>
  30. </template>
  31. </el-table-column>
  32. <el-table-column align="center" sortable show-overflow-tooltip prop="visitDate" label="暗访日期" min-width="80"></el-table-column>
  33. </el-table>
  34. </el-main>
  35. </el-container>
  36. <!-- 分页 -->
  37. <div style="text-align: center;">
  38. <el-pagination
  39. class="paginationCenter"
  40. background
  41. @size-change="handleSizeChange"
  42. @current-change="search"
  43. :current-page.sync="pageIndex"
  44. :page-sizes="[10, 20, 50, 100]"
  45. :page-size="pageSize"
  46. layout="total, sizes, prev, pager, next"
  47. :total="total">
  48. </el-pagination>
  49. </div>
  50. </div>
  51. </template>
  52. <script>
  53. import provTreeList from "../../../../../widgets/villageList_nongyin.vue";
  54. import inputWith from "../../../../../widgets/inuptWith.vue"
  55. import request from "../../../../../utils/gw_ajax_request.js"
  56. import {getTableId_ny,updateTable1_ny} from "../../../../../api/duChaTianBao.js"
  57. import {formatDateTimeD} from "../../../../../utils/gw_date.js"
  58. export default {
  59. components: {
  60. provTreeList: provTreeList,
  61. inputWith: inputWith
  62. },
  63. props: ['ryObjId'],
  64. data() {
  65. return {
  66. tableHeight: window.innerHeight * 0.5,
  67. tableHeight1: window.innerHeight * 0.5 -2,
  68. formObj: {
  69. ryObjId:'',
  70. adNm: '',
  71. villageCode:'',
  72. isPoverty: '',
  73. isFluexc: '',
  74. isMtarea: '',
  75. isCenwtSupply: '',
  76. watersupplyPer: '',
  77. recPers2: '',
  78. recPersId: '',
  79. recPersTel: '',
  80. visitDate: '',
  81. createTime:'',
  82. },
  83. getEngId:false,
  84. searchObj: {
  85. pageNum: '',
  86. pageSize: 20
  87. },
  88. pageIndex: 1,
  89. pageSize: 20,
  90. total: 0,
  91. villageList: [],
  92. dialogFormVisible: false,
  93. formLabelWidth: '160px',
  94. curOperate: '',
  95. isExits: false,
  96. loading: true
  97. }
  98. },
  99. computed:{
  100. recPersId(){
  101. return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
  102. }
  103. },
  104. mounted() {
  105. // this.getVillageList()
  106. // alert(this.ryObjId);
  107. },
  108. watch: {
  109. ryObjId(newVal,oldVal){
  110. if(newVal){
  111. this.getVillageList()
  112. }
  113. }
  114. },
  115. methods: {
  116. submitTable:function(){
  117. updateTable1_ny(
  118. this.formObj.adNm,
  119. this.ryObjId,
  120. this.formObj.isCenwtSupply,
  121. this.formObj.isFluexc,
  122. this.formObj.isMtarea,
  123. this.formObj.isPoverty,
  124. this.formObj.recPers2,
  125. this.formObj.recPersId,
  126. this.formObj.recPersTel,
  127. this.formObj.status,
  128. this.formObj.villageCode,
  129. this.formObj.visitDate,
  130. this.formObj.watersupplyPer
  131. ).then((res)=>{
  132. this.dialogFormVisible = false
  133. this.getVillageList()
  134. });
  135. },
  136. //村列表
  137. getVillageList(){
  138. this.searchObj.pageSize = this.pageSize;
  139. this.searchObj.pageNum = this.pageIndex;
  140. this.searchObj.ryObjId = this.ryObjId;
  141. let paramsObj = this.searchObj;
  142. request.post('/dc/insp/secsurveyVlg/queryListByPage',paramsObj).then((res)=>{
  143. if(res.success){
  144. this.villageList = res.data.list
  145. this.total = res.data.total
  146. // this.loading = false
  147. }
  148. })
  149. },
  150. toAddMember(type,row){
  151. this.curOperate = type
  152. let rowObj = {}
  153. Object.assign(rowObj,row)
  154. if(this.curOperate == '编辑'){
  155. this.formObj = rowObj
  156. this.formObj.watersupplyPer = this.formObj.watersupplyPer * 100
  157. }else{
  158. for (var obj in this.formObj) {
  159. this.formObj[obj] = ''
  160. }
  161. this.formObj.visitDate = formatDateTimeD()
  162. }
  163. this.dialogFormVisible = true
  164. },
  165. addTable(){
  166. this.formObj = {
  167. ryObjId:'',
  168. adNm: '',
  169. villageCode:'',
  170. isPoverty: '',
  171. isFluexc: '',
  172. isMtarea: '',
  173. isCenwtSupply: '',
  174. watersupplyPer: '',
  175. recPers2: '',
  176. recPersTel: '',
  177. visitDate: ''
  178. };
  179. this.getEngId = false;
  180. this.dialogFormVisible = true
  181. },
  182. //村信息
  183. provTreeSelectChangeHandler(params) {
  184. this.formObj.adNm = params.name;
  185. this.formObj.villageCode = params.code;
  186. },
  187. search(val){
  188. this.pageIndex = val
  189. this.getVillageList()
  190. },
  191. handleSizeChange(val){
  192. console.log(val);
  193. this.pageSize = val;
  194. this.getVillageList()
  195. },
  196. formatRadio(val){
  197. if(val == '1'){
  198. return '是'
  199. }else if(val == '0'){
  200. return '否'
  201. }else{
  202. return val
  203. }
  204. }
  205. },
  206. }
  207. </script>
  208. <style>
  209. </style>