| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257 |
- <template>
- <div class="jcsjzl" style="width: 100%;margin: auto">
- <el-container style="height:520px;">
- <el-main style="border:1px solid #d5d5ff;margin-left:5px;padding:0px;">
- <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">信息填报</p>
- <el-form :model="addObj" :label-width="formLabelWidth">
- <p style="margin-top:10px;margin-bottom: 10px">
- <i class="el-icon-caret-right"></i>
- <span style="width:120px;padding-left: 10px">监测数据质量和到报率</span>
- <span style="float:right;margin-right:70px;color: #009cee">分值</span>
- <span class="hrs"></span>
- </p>
- <el-form-item label="现场比测精度误差(cm)">
- <el-input size="mini" v-model="addObj.repeatability" v-number="addObj.repeatability" style="width:60px;margin-left:50px;"></el-input>
- <i class="el-icon-circle-plus add-icon" v-if="stationType == 'autoStation'" @click="appearDialog('精度')"></i>
- <i class="el-icon-circle-plus add-icon" v-if="stationType == 'artiStation'" @click="appearDialog('质量')"></i>
- <el-input size="mini" v-model="scoreObj.repeatabilityScore" readonly class="score_input" style="width:30px;float:right;margin-right:30px"></el-input>
- </el-form-item>
- <el-form-item label="单站月统计到报率(%)" v-if="stationType == 'autoStation'">
- <el-input size="mini" v-model="addObj.percentage" v-number="addObj.percentage" style="width:60px;margin-left:50px;"></el-input>
- <i class="el-icon-circle-plus add-icon" @click="appearDialog('到报率')"></i>
- <el-input size="mini" v-model="scoreObj.percentageScore" readonly class="score_input" style="width:30px;float:right;margin-right:30px"></el-input>
- </el-form-item>
- <el-form-item label="人工监测数据报送是否及时" v-if="stationType == 'artiStation'">
- <i class="el-icon-circle-plus add-icon" @click="appearDialog('报送')"></i>
- <el-input size="mini" v-model="scoreObj.handScore" v-number="scoreObj.handScore" class="score_input" style="width:30px;float:right;margin-right:30px"></el-input>
- <span class="score_tips">(0~15分 整数)</span>
- </el-form-item>
- <h3 style="text-align:right;padding-right:100px;line-height:60px">得分: <span style="color:red">{{scoreSum}}</span></h3>
- <el-form-item label="" label-width="60px">
- <el-button type="primary" @click="addMember">保 存</el-button>
- </el-form-item>
- </el-form>
- </el-main>
- </el-container>
- <!-- <span slot="footer" class="dialog-footer" style="justify-content: flex-end;display: flex;">
- <el-button @click="cancelHandler">取 消</el-button>
- <el-button type="primary" @click="addMember">确 定</el-button>
- </span> -->
- <problemdialog v-if="dialogShow" :objType="5" :villType="5" :objId="currentObjectId" :regId="currentObjectRgstrId"
- :objName="currentObjectName" :problemMiddleType="'监测'" :problemSmallType="problemSmallType" :stationType="stationType"
- @closeDialog="closeDialog"></problemdialog>
- </div>
- </template>
- <script>
- import request from "../../../utils/gw_ajax_request.js";
- import { getBaseExt } from "../../../api/duChaTianBao.js";
- import problemdialog from "./dxs_czwhgl_problemDialog.vue";
- export default {
- props: ["currentObjectRgstrId", "currentObjectName", "currentObjectId","stationType","currentSttp",'currentGrwCode'],
- components: {
- problemdialog:problemdialog,
- },
- data() {
- return {
- addObj: {
- repeatability: '',
- percentage: ''
- },
- scoreObj: {
- repeatabilityScore: '',
- percentageScore: '',
- handScore: ''
- },
- allScore: '',
- curOperate: "",
- formLabelWidth: "250px",
- loading: true,
- operationType1: "",
- dialogShow: false
- };
- },
- computed: {
- recPersId() {
- return localStorage.getItem("userid")
- ? localStorage.getItem("userid")
- : "1098101939614724096";
- },
- recPersName(){
- return localStorage.getItem("account")? localStorage.getItem("account"): ''
- },
- scoreSum(){
- if(this.stationType == 'autoStation'){
- this.allScore = this.scoreObj.repeatabilityScore*1 + this.scoreObj.percentageScore*1
- return this.allScore
- }else{
- this.allScore = this.scoreObj.repeatabilityScore*1 + this.scoreObj.handScore*1
- return this.allScore
- }
- }
- },
- mounted() {
- this.getRgstridObj();
- },
- watch: {
- currentGrwCode(n, o) {
- this.getRgstridObj();
- },
- 'addObj.repeatability':{
- deep:true,
- handler(newVal,oldVal){
- if(newVal >= -2 && newVal <= 2 && newVal != '' && newVal){
- this.scoreObj.repeatabilityScore = '40'
- }else{
- this.scoreObj.repeatabilityScore = '0'
- }
- }
- },
- 'addObj.percentage':{
- deep:true,
- handler(newVal,oldVal){
- if(newVal >= 95){
- this.scoreObj.percentageScore = '15'
- }else if(newVal >= 90 && newVal < 95){
- this.scoreObj.percentageScore = '10'
- }else if(newVal >= 80 && newVal < 90){
- this.scoreObj.percentageScore = '5'
- }else if(newVal < 80 ){
- this.scoreObj.percentageScore = '0'
- }
- }
- },
- },
- methods: {
- appearDialog(type) {
- this.dialogShow = true;
- this.problemSmallType = type;
- },
- closeDialog() {
- this.dialogShow = false;
- },
- getRgstridObj() {
- request.post(`/dc/insp/grw/getDataQuality?id=${this.currentObjectRgstrId}`).then(res => {
- if (res.data) {
- this.addObj.repeatability = res.data.repeatability;
- this.addObj.percentage = res.data.percentage;
-
- this.scoreObj.repeatabilityScore = res.data.repeatabilityScore;
- this.scoreObj.percentageScore = res.data.percentageScore;
- this.scoreObj.handScore = res.data.handScore;
- this.allScore = res.data.score
- this.operationType1 = "update";
- console.log(this.addObj);
- } else {
- this.addObj = {};
- this.operationType1 = "add";
- }
- });
- },
- addMember() {
- if(!this.addObj.repeatability){
- this.$message.info('请填写现场比测精度误差')
- return
- }
- if(!this.addObj.percentage && this.stationType == 'autoStation'){
- this.$message.info('请填写单站月统计到报率')
- return
- }
- if(this.addObj.percentage && this.stationType == 'autoStation' && (this.addObj.percentage < 0 || this.addObj.percentage > 100)){
- this.$message.info('单站月统计到报率为0~100之间')
- return
- }
- if(this.stationType == 'artiStation' && (!this.scoreObj.handScore || this.scoreObj.handScore < 0 || this.scoreObj.handScore > 15)){
- this.$message.info('人工监测数据报送是否及时打分为0~15之间')
- return
- }
- this.addObj["id"] = this.currentObjectRgstrId;
- this.addObj["checkPid"] = this.recPersId;
- this.addObj['checkPname'] = this.recPersName;
- this.addObj['score'] = this.scoreSum;
- this.addObj['sttp'] = this.currentSttp;
- this.addObj['percentageStatus'] = '1'
- let addObj = {};
- Object.assign(addObj, this.addObj);
- Object.assign(addObj, this.scoreObj);
- if (this.operationType1 == "add") {
- request.post("/dc/insp/grw/updateDataQuality", addObj).then(res => {
- if (res.success) {
- this.$message({
- type: "success",
- message: "监测数据质量和到报率填报成功!"
- });
- this.$emit("addShuiKuSuccess");
- } else {
- this.$message.error(res.message);
- }
- })
- .catch(err => {
- this.$message.error(res.message);
- });
- } else {
- request.post("/dc/insp/grw/updateDataQuality", addObj).then(res => {
- if (res.success) {
- this.$message({
- type: "success",
- message: "监测数据质量和到报率填报成功!"
- });
- this.$emit("addShuiKuSuccess");
- } else {
- this.$message.error(res.message);
- }
- })
- .catch(err => {
- this.$message.error(res.message);
- });
- }
- },
- cancelHandler() {
- this.$emit("cancelHandler");
- },
- handleInput(e) {
- // log(e.target.value)
- e.target.value=e.target.value.replace(/[^\d]/g,'');
- },
- },
- directives:{
- number:{
- update(el,binding,vnode){
- let _this = vnode.context
- let numReg = /^\+?[1-9][0-9]*$/
- if(binding.value && !numReg.test(binding.value)){
- if(binding.value == '0'){
- return
- }
- _this.$message.info('请输入正整数')
- }
- }
- }
- }
- };
- </script>
- <style>
- .jcsjzl label.el-form-item__label {
- width: 280px;
- }
- .jcsjzl .add-icon {
- color: #009cee;
- float: right;
- margin-right: 20px;
- font-size: 18px;
- cursor: pointer;
- }
- .score_input .el-input__inner{
- padding: 0 5px;
- }
- .score_tips{
- float: right;
- margin-right: 10px;
- font-size: 12px;
- color: #ff0000;
- }
- </style>
|