62d8d5e9a2b2f6663ad7d122f6f98d6b5571730d.svn-base 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <template>
  2. <div class="zdlsqk" style="width: 100%;margin: auto">
  3. <el-container :style="{'max-height':this.dialogHeightA+'px'}">
  4. <el-main style="border:1px solid #d5d5ff;margin-left:5px;padding:0px;overflow-x: hidden;">
  5. <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">详情</p>
  6. <p style="margin-top:20px;margin-bottom: 10px">
  7. <i class="el-icon-caret-right"></i>
  8. <span style="font-weight:bold;color:#409EFF;width:120px;padding-left: 10px">效益发挥情况</span>
  9. <span class="hrs"></span>
  10. </p>
  11. <el-row :gutter="5" style="padding:10px;">
  12. <el-col :span="8" style="text-align:right;">是否发挥效益</el-col>
  13. <el-col :span="16" style="text-align:left;">
  14. {{addObj.ifEffective&&addObj.ifEffective == "1"?"是":
  15. addObj.ifEffective&&addObj.ifEffective == "2"?"否":""
  16. }}
  17. </el-col>
  18. </el-row>
  19. <el-row :gutter="5" style="padding:10px;">
  20. <el-col :span="8" style="text-align:right;">是否为饮用水源</el-col>
  21. <el-col :span="16" style="text-align:left;">
  22. {{addObj.ifWaterS&&addObj.ifWaterS == "1"?"是":
  23. addObj.ifWaterS&&addObj.ifWaterS == "2"?"否":""
  24. }}
  25. </el-col>
  26. </el-row>
  27. <el-row :gutter="5" style="padding:10px;" v-if="addObj.ifWaterS == '1'">
  28. <el-col :span="8" style="text-align:right;">饮用水源供水量</el-col>
  29. <el-col :span="16" style="text-align:left;">
  30. {{addObj.wsfdws}}(吨/年)
  31. </el-col>
  32. </el-row>
  33. <el-row :gutter="5" style="padding:10px;">
  34. <el-col :span="8" style="text-align:right;">是否有灌溉任务</el-col>
  35. <el-col :span="16" style="text-align:left;">
  36. {{addObj.diskRunInfo&&addObj.diskRunInfo == "1"?"是":
  37. addObj.diskRunInfo&&addObj.diskRunInfo == "2"?"否":""
  38. }}
  39. </el-col>
  40. </el-row>
  41. <el-row :gutter="5" style="padding:10px;" v-if="addObj.diskRunInfo == '1'">
  42. <el-col :span="8" style="text-align:right;">灌溉面积</el-col>
  43. <el-col :span="16" style="text-align:left;">
  44. {{addObj.hasSetMainFl}}(亩)
  45. </el-col>
  46. </el-row>
  47. </el-main>
  48. </el-container>
  49. </div>
  50. </template>
  51. <script>
  52. import request from "../../../utils/gw_ajax_request.js";
  53. import {getEffectionlist} from '../../../api/duChaTianBao.js'
  54. export default {
  55. components: {
  56. // problemDialog
  57. },
  58. props: ['currentObjectId','currentObjectName','currentObjectRgstrId','dialogHeightA'],
  59. data() {
  60. var checkInput = (rule, value, callback) => {
  61. if (!value) {
  62. return callback(new Error('不能为空'));
  63. }
  64. setTimeout(() => {
  65. if (!Number.isInteger(parseFloat(value))) {
  66. callback(new Error('请输入数字值'));
  67. } else {
  68. callback();
  69. }
  70. }, 500);
  71. };
  72. return {
  73. objtbStatu: {
  74. benefitStat: "",
  75. rgstrId: ""
  76. },
  77. dialogFormVisible: false,
  78. formLabelWidth: "180px",
  79. loading: true,
  80. addObj: {
  81. ifEffective: "",
  82. ifWaterS: "",
  83. wsfdws: "",
  84. diskRunInfo: "",
  85. hasSetMainFl: "",
  86. rgstrId: "",
  87. recPersId: "",
  88. recPers2: "",
  89. recPersTel: "",
  90. status: "1"
  91. },
  92. operationType: "",
  93. rsvrRules: null,
  94. probId: '',
  95. showAddProblemDialog: false,
  96. ruleForm: {
  97. wsfdws: '',
  98. hasSetMainFl: ''
  99. },
  100. rules: {
  101. wsfdws: [
  102. { validator: checkInput, trigger: 'blur' }
  103. ],
  104. hasSetMainFl: [
  105. { validator: checkInput, trigger: 'blur' }
  106. ]
  107. }
  108. };
  109. },
  110. computed: {
  111. recPersId() {
  112. return localStorage.getItem("userid") ? localStorage.getItem("userid") : "1098101939614724096";
  113. }
  114. },
  115. created(){
  116. this.findItemByType()
  117. },
  118. mounted() {
  119. this.getformList();
  120. },
  121. methods: {
  122. getformList() {
  123. let _self = this;
  124. getEffectionlist(_self.currentObjectRgstrId).then(res => {
  125. if (res.success) {
  126. if (res.data && Object.keys(res.data).length) {
  127. _self.addObj = res.data;
  128. _self.operationType = "update";
  129. } else {
  130. _self.addObj = {};
  131. _self.operationType = "add";
  132. }
  133. } else {
  134. this.$message.error(res.message)
  135. }
  136. });
  137. },
  138. //保存
  139. makesure() {
  140. let _self = this;
  141. this.addObj["rgstrId"] = this.currentObjectRgstrId;
  142. this.addObj["recPersId"] = this.recPersId;
  143. this.addObj["status"] = '1';
  144. this.objtbStatu.rgstrId = this.currentObjectRgstrId;
  145. var params = {
  146. bisInspSafeExtManage: _self.addObj
  147. };
  148. if(_self.addObj.ifWaterS == '2'){
  149. _self.addObj.wsfdws = ''
  150. }
  151. if(_self.addObj.diskRunInfo == '2'){
  152. _self.addObj.hasSetMainFl = ''
  153. }
  154. if (
  155. this.addObj.ifEffective ||
  156. this.addObj.ifWaterS ||
  157. this.addObj.diskRunInfo
  158. ) {
  159. this.objtbStatu.benefitStat = "1";
  160. }
  161. if (
  162. this.addObj.ifEffective &&
  163. this.addObj.ifWaterS &&
  164. this.addObj.diskRunInfo
  165. ) {
  166. this.objtbStatu.benefitStat = "2";
  167. }
  168. if (
  169. this.addObj.ifEffective == undefined &&
  170. this.addObj.ifWaterS == undefined &&
  171. this.addObj.diskRunInfo == undefined
  172. ) {
  173. this.objtbStatu.benefitStat = "0";
  174. }
  175. this.$refs['ruleForm'].validate((valid) => {
  176. if (valid) {
  177. this.$confirm("确认保存效益发挥情况信息吗?", "提示", {
  178. confirmButtonText: "确定",
  179. cancelButtonText: "取消",
  180. type: "warning"
  181. }).then(() => {
  182. if (_self.operationType == "add") {
  183. request.post("/dc/insp/revrBenefit", _self.addObj).then(res => {
  184. if (res.success) {
  185. _self.$message.success("添加成功");
  186. request.post("/dc/insp/rsvrRgstr/update", _self.objtbStatu).then(res => {
  187. res;
  188. });
  189. _self.$emit("addShuiKuSuccess");
  190. _self.getformList();
  191. }
  192. });
  193. } else {
  194. request.post("/dc/insp/revrBenefit", _self.addObj).then(res => {
  195. if (res.success) {
  196. _self.$message.success("修改成功");
  197. request.post("/dc/insp/rsvrRgstr/update", _self.objtbStatu).then(res => {
  198. res;
  199. });
  200. _self.$emit("addShuiKuSuccess");
  201. _self.getformList();
  202. }
  203. });
  204. }
  205. });
  206. }
  207. });
  208. },
  209. formatRadio(val) {
  210. if (val == "1") {
  211. return "是";
  212. } else if (val == "0") {
  213. return "否";
  214. } else {
  215. return val;
  216. }
  217. },
  218. cancelHandler() {
  219. this.$emit("cancelHandler");
  220. },
  221. findItemByType(){
  222. const obj ={
  223. tname: "BIS_INSP_RSVR_PROJECT"
  224. }
  225. request.post("/bis/insp/item/ques/info/findItemByType",obj).then(res =>{
  226. this.rsvrRules = res.data;
  227. })
  228. },
  229. addProblem(item){
  230. let rest = this.rsvrRules.filter(e => {
  231. return e.eName === item;
  232. });
  233. this.probId = rest[0].id;
  234. this.showAddProblemDialog = true
  235. },
  236. closePlDialog(val) {
  237. this.showAddProblemDialog = false;
  238. }
  239. },
  240. watch: {
  241. currentObjectRgstrId(n, o) {
  242. this.getformList();
  243. }
  244. }
  245. };
  246. </script>
  247. <style>
  248. #dcdxHeader {
  249. padding: 15px 20px;
  250. }
  251. #dxdcFooter {
  252. text-align: center;
  253. }
  254. #dxdcAside {
  255. border: 1px solid #d5d5ff;
  256. }
  257. .gcsthyxglqk label.el-radio {
  258. width: 200px;
  259. }
  260. .add-problem-icon{
  261. font-size: 16px;
  262. }
  263. </style>