| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- <template>
- <div class="zdlsqk" style="width: 100%;margin: auto">
- <el-container :style="{'max-height':this.dialogHeightA+'px'}">
- <el-main style="border:1px solid #d5d5ff;margin-left:5px;padding:0px;overflow-x: hidden;">
- <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">详情</p>
- <p style="margin-top:20px;margin-bottom: 10px">
- <i class="el-icon-caret-right"></i>
- <span style="font-weight:bold;color:#409EFF;width:120px;padding-left: 10px">效益发挥情况</span>
- <span class="hrs"></span>
- </p>
- <el-row :gutter="5" style="padding:10px;">
- <el-col :span="8" style="text-align:right;">是否发挥效益</el-col>
- <el-col :span="16" style="text-align:left;">
- {{addObj.ifEffective&&addObj.ifEffective == "1"?"是":
- addObj.ifEffective&&addObj.ifEffective == "2"?"否":""
- }}
- </el-col>
- </el-row>
- <el-row :gutter="5" style="padding:10px;">
- <el-col :span="8" style="text-align:right;">是否为饮用水源</el-col>
- <el-col :span="16" style="text-align:left;">
- {{addObj.ifWaterS&&addObj.ifWaterS == "1"?"是":
- addObj.ifWaterS&&addObj.ifWaterS == "2"?"否":""
- }}
- </el-col>
- </el-row>
- <el-row :gutter="5" style="padding:10px;" v-if="addObj.ifWaterS == '1'">
- <el-col :span="8" style="text-align:right;">饮用水源供水量</el-col>
- <el-col :span="16" style="text-align:left;">
- {{addObj.wsfdws}}(吨/年)
- </el-col>
- </el-row>
- <el-row :gutter="5" style="padding:10px;">
- <el-col :span="8" style="text-align:right;">是否有灌溉任务</el-col>
- <el-col :span="16" style="text-align:left;">
- {{addObj.diskRunInfo&&addObj.diskRunInfo == "1"?"是":
- addObj.diskRunInfo&&addObj.diskRunInfo == "2"?"否":""
- }}
- </el-col>
- </el-row>
- <el-row :gutter="5" style="padding:10px;" v-if="addObj.diskRunInfo == '1'">
- <el-col :span="8" style="text-align:right;">灌溉面积</el-col>
- <el-col :span="16" style="text-align:left;">
- {{addObj.hasSetMainFl}}(亩)
- </el-col>
- </el-row>
- </el-main>
- </el-container>
- </div>
- </template>
- <script>
- import request from "../../../utils/gw_ajax_request.js";
- import {getEffectionlist} from '../../../api/duChaTianBao.js'
- export default {
- components: {
- // problemDialog
- },
- props: ['currentObjectId','currentObjectName','currentObjectRgstrId','dialogHeightA'],
- data() {
- var checkInput = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('不能为空'));
- }
- setTimeout(() => {
- if (!Number.isInteger(parseFloat(value))) {
- callback(new Error('请输入数字值'));
- } else {
- callback();
- }
- }, 500);
- };
- return {
- objtbStatu: {
- benefitStat: "",
- rgstrId: ""
- },
- dialogFormVisible: false,
- formLabelWidth: "180px",
- loading: true,
- addObj: {
- ifEffective: "",
- ifWaterS: "",
- wsfdws: "",
- diskRunInfo: "",
- hasSetMainFl: "",
- rgstrId: "",
- recPersId: "",
- recPers2: "",
- recPersTel: "",
- status: "1"
- },
- operationType: "",
- rsvrRules: null,
- probId: '',
- showAddProblemDialog: false,
- ruleForm: {
- wsfdws: '',
- hasSetMainFl: ''
- },
- rules: {
- wsfdws: [
- { validator: checkInput, trigger: 'blur' }
- ],
- hasSetMainFl: [
- { validator: checkInput, trigger: 'blur' }
- ]
- }
- };
- },
- computed: {
- recPersId() {
- return localStorage.getItem("userid") ? localStorage.getItem("userid") : "1098101939614724096";
- }
- },
- created(){
- this.findItemByType()
- },
- mounted() {
- this.getformList();
- },
- methods: {
- getformList() {
- let _self = this;
- getEffectionlist(_self.currentObjectRgstrId).then(res => {
- if (res.success) {
- if (res.data && Object.keys(res.data).length) {
- _self.addObj = res.data;
- _self.operationType = "update";
- } else {
- _self.addObj = {};
- _self.operationType = "add";
- }
- } else {
- this.$message.error(res.message)
- }
- });
- },
- //保存
- makesure() {
- let _self = this;
- this.addObj["rgstrId"] = this.currentObjectRgstrId;
- this.addObj["recPersId"] = this.recPersId;
- this.addObj["status"] = '1';
- this.objtbStatu.rgstrId = this.currentObjectRgstrId;
- var params = {
- bisInspSafeExtManage: _self.addObj
- };
- if(_self.addObj.ifWaterS == '2'){
- _self.addObj.wsfdws = ''
- }
- if(_self.addObj.diskRunInfo == '2'){
- _self.addObj.hasSetMainFl = ''
- }
- if (
- this.addObj.ifEffective ||
- this.addObj.ifWaterS ||
- this.addObj.diskRunInfo
- ) {
- this.objtbStatu.benefitStat = "1";
- }
- if (
- this.addObj.ifEffective &&
- this.addObj.ifWaterS &&
- this.addObj.diskRunInfo
- ) {
- this.objtbStatu.benefitStat = "2";
- }
- if (
- this.addObj.ifEffective == undefined &&
- this.addObj.ifWaterS == undefined &&
- this.addObj.diskRunInfo == undefined
- ) {
- this.objtbStatu.benefitStat = "0";
- }
- this.$refs['ruleForm'].validate((valid) => {
- if (valid) {
- this.$confirm("确认保存效益发挥情况信息吗?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(() => {
- if (_self.operationType == "add") {
- request.post("/dc/insp/revrBenefit", _self.addObj).then(res => {
- if (res.success) {
- _self.$message.success("添加成功");
- request.post("/dc/insp/rsvrRgstr/update", _self.objtbStatu).then(res => {
- res;
- });
- _self.$emit("addShuiKuSuccess");
- _self.getformList();
- }
- });
- } else {
- request.post("/dc/insp/revrBenefit", _self.addObj).then(res => {
- if (res.success) {
- _self.$message.success("修改成功");
- request.post("/dc/insp/rsvrRgstr/update", _self.objtbStatu).then(res => {
- res;
- });
- _self.$emit("addShuiKuSuccess");
- _self.getformList();
- }
- });
- }
- });
- }
-
- });
- },
- formatRadio(val) {
- if (val == "1") {
- return "是";
- } else if (val == "0") {
- return "否";
- } else {
- return val;
- }
- },
- cancelHandler() {
- this.$emit("cancelHandler");
- },
- findItemByType(){
- const obj ={
- tname: "BIS_INSP_RSVR_PROJECT"
- }
- request.post("/bis/insp/item/ques/info/findItemByType",obj).then(res =>{
- this.rsvrRules = res.data;
- })
- },
- addProblem(item){
- let rest = this.rsvrRules.filter(e => {
- return e.eName === item;
- });
- this.probId = rest[0].id;
- this.showAddProblemDialog = true
- },
- closePlDialog(val) {
- this.showAddProblemDialog = false;
- }
- },
- watch: {
- currentObjectRgstrId(n, o) {
- this.getformList();
- }
- }
- };
- </script>
- <style>
- #dcdxHeader {
- padding: 15px 20px;
- }
- #dxdcFooter {
- text-align: center;
- }
- #dxdcAside {
- border: 1px solid #d5d5ff;
- }
- .gcsthyxglqk label.el-radio {
- width: 200px;
- }
- .add-problem-icon{
- font-size: 16px;
- }
- </style>
|