b0cd48ef7a524aee5dbf38425eaa93b2c0473850.svn-base 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <div id="zfqkContainer">
  3. <el-container :style="{'height':this.testHeight+'px'}" >
  4. <el-main style="border:1px solid #d5d5ff;margin-left:5px;padding:0px;overflow-x: hidden;">
  5. <el-table :data="tableData" :height="testHeight1" style="width: 100%" >
  6. <el-table-column prop="viewPreName" label="走访人姓名" min-width="100" align="center"></el-table-column>
  7. <el-table-column prop="knowResManager" label="是否知晓水库管护员" min-width="150" align="center">
  8. <template slot-scope="scope">
  9. <span style="font-weight:bolder;color:#67C23A" v-if="scope.row.knowResManager == 1">是</span>
  10. <span style="font-weight:bolder;color:#F56C6C" v-if="scope.row.knowResManager == 0">否</span>
  11. </template>
  12. </el-table-column>
  13. <el-table-column prop="managerComment" label="对管护责任人评价" min-width="150" align="center">
  14. <template slot-scope="scope">
  15. <span
  16. style="font-weight:bolder;color:#F56C6C"
  17. v-if="scope.row.managerComment == 3"
  18. >不满意</span>
  19. <span style="font-weight:bolder;color:#E6A23C" v-if="scope.row.managerComment == 2">一般</span>
  20. <span style="font-weight:bolder;color:#67C23A" v-if="scope.row.managerComment == 1">满意</span>
  21. </template>
  22. </el-table-column>
  23. <el-table-column prop="note" label="备注" :show-overflow-tooltip="true" min-width="170"></el-table-column>
  24. <!-- <el-table-column align="center" show-overflow-tooltip label="操作" min-width="160" fixed="right">
  25. <template slot-scope="scope">
  26. <el-button type="success" plain @click="manageItem(scope.row)">编辑</el-button>
  27. <el-button type="danger" plain @click="deleteItem(scope.row)">删除</el-button>
  28. </template>
  29. </el-table-column>-->
  30. </el-table>
  31. </el-main>
  32. <span slot="footer" class="dialog-footer" style="justify-content: flex-end;display: flex;">
  33. <!-- <el-button @click="cancelHandler">取 消</el-button> -->
  34. </span>
  35. </el-container>
  36. <el-dialog :title="'行政村填报'" :visible.sync="dialogFormVisible" :modal="false">
  37. <el-container style="height:520px;">
  38. <el-main style="border:1px solid #d5d5ff;margin-left:5px;padding:0px;">
  39. <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">信息填报</p>
  40. <el-form :model="formObj" label-width="120px" status-icon>
  41. <p style="margin-top:10px;margin-bottom: 10px">
  42. <i class="el-icon-caret-right"></i>
  43. <span style="width:120px;padding-left: 10px">行政村基本信息</span>
  44. <span class="hrs"></span>
  45. </p>
  46. <el-form-item label="走访人员名称">
  47. <!-- <el-input v-model="formObj.adNm" autocomplete="off" style="width:70%;"></el-input> -->
  48. <el-input v-model.number="formObj.viewPreName" style="width:70%;"></el-input>
  49. </el-form-item>
  50. <p style="margin-top:10px;margin-bottom: 10px">
  51. <i class="el-icon-caret-right"></i>
  52. <span style="width:120px;padding-left: 10px">行政村调研信息</span>
  53. <span class="hrs"></span>
  54. </p>
  55. <el-form-item label="是否知晓水库管护人员">
  56. <el-radio v-model="formObj.knowResManager" label="1">是</el-radio>
  57. <el-radio v-model="formObj.knowResManager" label="0">否</el-radio>
  58. </el-form-item>
  59. <el-form-item label="对管护责任人的评价">
  60. <el-radio v-model="formObj.managerComment" label="1">满意</el-radio>
  61. <el-radio v-model="formObj.managerComment" label="2">一般</el-radio>
  62. <el-radio v-model="formObj.managerComment" label="3">不满意</el-radio>
  63. </el-form-item>
  64. <el-form-item label="备注">
  65. <el-input v-model="formObj.note" type="textarea" :rows="2"></el-input>
  66. </el-form-item>
  67. <el-form-item label="操作">
  68. <el-button @click="dialogFormVisible = false">取 消</el-button>
  69. <el-button type="primary" @click="addSkZouFangSubmit">确 定</el-button>
  70. </el-form-item>
  71. </el-form>
  72. </el-main>
  73. </el-container>
  74. </el-dialog>
  75. </div>
  76. </template>
  77. <script>
  78. import request from "../../../../../utils/gw_ajax_request.js";
  79. import {
  80. getskZouFangByrgstrId,
  81. getSkZouFangViewId,
  82. addZouFangRenYuanList_sk,
  83. updateZouFangRenYuanList_sk,
  84. getZouFangrenYuanListByViewId
  85. } from "../../../../../api/duChaTianBao.js";
  86. import { formatDateTimeD } from "../../../../../utils/gw_date.js";
  87. export default {
  88. components: {},
  89. props: ["currentObjectRgstrId"],
  90. data() {
  91. return {
  92. tableData: [],
  93. testHeight: window.innerHeight * 0.5,
  94. testHeight1: window.innerHeight * 0.5 - 2,
  95. dialogFormVisible: false,
  96. viewId: "",
  97. formObj: {
  98. viewPreName: "",
  99. knowResManager: "",
  100. managerComment: "",
  101. note: "",
  102. viewId: ""
  103. }
  104. };
  105. },
  106. computed: {
  107. recPersId() {
  108. return localStorage.getItem("userid")
  109. ? localStorage.getItem("userid")
  110. : "";
  111. }
  112. },
  113. mounted() {
  114. this.getZouFangCun();
  115. },
  116. watch: {
  117. currentObjectRgstrId(n, o) {
  118. this.getZouFangCun();
  119. }
  120. },
  121. methods: {
  122. addHandler: function() {
  123. this.dialogFormVisible = true;
  124. },
  125. addZouFang: function() {
  126. this.dialogFormVisible = false;
  127. },
  128. getZouFangCun: function() {
  129. getskZouFangByrgstrId(this.currentObjectRgstrId).then(
  130. res => {
  131. if (res.data && res.success) {
  132. this.viewId = res.data.viewId;
  133. this.getRenYuanListData();
  134. } else {
  135. console.log("未创建走访表,创建走访表");
  136. this.getSkZouFangViewId();
  137. }
  138. },
  139. err => {}
  140. );
  141. },
  142. getRenYuanListData: function() {
  143. getZouFangrenYuanListByViewId(this.viewId).then(
  144. res => {
  145. console.log(res);
  146. this.tableData = res.data.list;
  147. },
  148. err => {}
  149. );
  150. },
  151. getSkZouFangViewId: function() {
  152. getSkZouFangViewId(this.recPersId, this.currentObjectRgstrId).then(
  153. res => {
  154. console.log(res);
  155. if (res.data && res.success) {
  156. this.viewId = res.data.viewId;
  157. } else {
  158. }
  159. },
  160. err => {}
  161. );
  162. },
  163. addSkZouFangSubmit: function() {
  164. let updateArray = this.tableData;
  165. this.formObj["viewId"] = this.viewId;
  166. updateArray.push(this.formObj);
  167. updateZouFangRenYuanList_sk(
  168. updateArray,
  169. this.viewId,
  170. this.currentObjectRgstrId
  171. ).then(res => {
  172. console.log(res);
  173. this.getRenYuanListData();
  174. this.dialogFormVisible = false;
  175. });
  176. },
  177. manageItem: function(row) {
  178. let updateArray = [];
  179. this.tableData.forEach((element, index) => {
  180. if (element.viewPreName != row.viewPreName) {
  181. updateArray.push(element);
  182. }
  183. });
  184. this.formObj = row;
  185. this.dialogFormVisible = true;
  186. this.tableData = updateArray;
  187. },
  188. deleteItem: function(row) {
  189. let updateArray = [];
  190. this.tableData.forEach((element, index) => {
  191. if (element.viewPreName != row.viewPreName) {
  192. updateArray.push(element);
  193. }
  194. });
  195. updateZouFangRenYuanList_sk(
  196. updateArray,
  197. this.viewId,
  198. this.currentObjectRgstrId
  199. ).then(res => {
  200. console.log(res);
  201. this.getRenYuanListData();
  202. });
  203. }
  204. }
  205. };
  206. </script>
  207. <style>
  208. </style>