| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- <template>
- <div class="popupContentClass" :style="{'height':testHeight1+'px'}">
- <p style="margin-top:20px;">
- <div style="display: flex;align-items: center;margin-bottom: 10px">
- <div style="width: 4px;height: 14px;background: rgba(44,158,255,1);border-radius: 1px;margin-right: 10px;"></div>
- <span style="font-size:14px;font-family:MicrosoftYaHei;color:rgba(51,51,51,1);">效益发挥情况</span>
- </div>
- </p>
- <el-row class="rowClass">
- <el-col :span="6" class="nameClass">是否发挥效益:</el-col>
- <el-col :span="6" class="valueClass" :style="{'height':testHeight+'px'}">
- {{addObj.ifEffective&&addObj.ifEffective == "1"?"是":
- addObj.ifEffective&&addObj.ifEffective == "2"?"否":""}}
- </el-col>
- <el-col :span="6" v-if="addObj.ifEffective == 2" class="nameClass">未发挥效益原因:</el-col>
- <el-col :span="6" class="valueClass" :style="{'height':testHeight+'px'}">
- {{addObj.effvCas == "1"?"水源问题":
- addObj.effvCas == "2"?"工程缺陷":
- addObj.effvCas == "3"?"规划需求变化":
- addObj.effvCas == "4"?"其他原因":""
- }}
- </el-col>
- </el-row>
- <el-row class="rowClass">
- <el-col :span="6" class="nameClass">是否为饮用水源:</el-col>
- <el-col :span="6" class="valueClass" :style="{'height':testHeight+'px'}">
- {{addObj.ifWaterS&&addObj.ifWaterS == "1"?"是":
- addObj.ifWaterS&&addObj.ifWaterS == "2"?"否":""}}
- </el-col>
- <el-col :span="6" v-if="addObj.ifWaterS == '1'" class="nameClass">饮用水源供水量:</el-col>
- <el-col :span="6" v-if="addObj.ifWaterS == '1'" class="valueClass" :style="{'height':testHeight+'px'}">
- {{addObj.wsfdws}}(吨/年)
- </el-col>
- </el-row>
- <el-row class="rowClass">
- <el-col :span="6" class="nameClass">是否有灌溉任务:</el-col>
- <el-col :span="6" class="valueClass" :style="{'height':testHeight+'px'}">
- {{addObj.diskRunInfo&&addObj.diskRunInfo == "1"?"是":
- addObj.diskRunInfo&&addObj.diskRunInfo == "2"?"否":""}}
- </el-col>
- <el-col :span="6" v-if="addObj.diskRunInfo == '1'" class="nameClass">灌溉面积:</el-col>
- <el-col :span="6" v-if="addObj.diskRunInfo == '1'" class="valueClass" :style="{'height':testHeight+'px'}">
- {{addObj.hasSetMainFl}}(亩)
- </el-col>
- <el-col :span="6" class="nameClass">其他情况:</el-col>
- <el-col :span="6" class="valueClass" :style="{'height':testHeight+'px'}">
- {{addObj.otherNote}}
- </el-col>
- </el-row>
- </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 {
- testHeight:(window.innerHeight * 0.5 - 114) / 6,
- testHeight1:window.innerHeight * 0.5,
- 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 scoped>
- @import "../../../assets/css/popup.css";
- </style>
|