9dc2aadc6022e5034fa06a0026595a9cb3a3b071.svn-base 8.9 KB

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