e51cac7da7ecaa8f7d7d5420f0b12fcc8038332b.svn-base 9.6 KB

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