bb9e9033a537cea76005201e5b95bb210e32b34a.svn-base 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <template>
  2. <div class="jcsjzl" style="width: 100%;margin: auto">
  3. <el-container style="height:520px;">
  4. <el-main style="border:1px solid #d5d5ff;margin-left:5px;padding:0px;">
  5. <p style="font-weight:bolder;background-color:#d5d5ff;padding:3px;">信息填报</p>
  6. <el-form :model="addObj" :label-width="formLabelWidth">
  7. <p style="margin-top:10px;margin-bottom: 10px">
  8. <i class="el-icon-caret-right"></i>
  9. <span style="width:120px;padding-left: 10px">监测数据质量和到报率</span>
  10. <span style="float:right;margin-right:70px;color: #009cee">分值</span>
  11. <span class="hrs"></span>
  12. </p>
  13. <el-form-item label="现场比测精度误差(cm)">
  14. <el-input size="mini" v-model="addObj.repeatability" v-number="addObj.repeatability" style="width:60px;margin-left:50px;"></el-input>
  15. <i class="el-icon-circle-plus add-icon" v-if="stationType == 'autoStation'" @click="appearDialog('精度')"></i>
  16. <i class="el-icon-circle-plus add-icon" v-if="stationType == 'artiStation'" @click="appearDialog('质量')"></i>
  17. <el-input size="mini" v-model="scoreObj.repeatabilityScore" readonly class="score_input" style="width:30px;float:right;margin-right:30px"></el-input>
  18. </el-form-item>
  19. <el-form-item label="单站月统计到报率(%)" v-if="stationType == 'autoStation'">
  20. <el-input size="mini" v-model="addObj.percentage" v-number="addObj.percentage" style="width:60px;margin-left:50px;"></el-input>
  21. <i class="el-icon-circle-plus add-icon" @click="appearDialog('到报率')"></i>
  22. <el-input size="mini" v-model="scoreObj.percentageScore" readonly class="score_input" style="width:30px;float:right;margin-right:30px"></el-input>
  23. </el-form-item>
  24. <el-form-item label="人工监测数据报送是否及时" v-if="stationType == 'artiStation'">
  25. <i class="el-icon-circle-plus add-icon" @click="appearDialog('报送')"></i>
  26. <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>
  27. <span class="score_tips">(0~15分 整数)</span>
  28. </el-form-item>
  29. <h3 style="text-align:right;padding-right:100px;line-height:60px">得分: <span style="color:red">{{scoreSum}}</span></h3>
  30. <el-form-item label="" label-width="60px">
  31. <el-button type="primary" @click="addMember">保 存</el-button>
  32. </el-form-item>
  33. </el-form>
  34. </el-main>
  35. </el-container>
  36. <!-- <span slot="footer" class="dialog-footer" style="justify-content: flex-end;display: flex;">
  37. <el-button @click="cancelHandler">取 消</el-button>
  38. <el-button type="primary" @click="addMember">确 定</el-button>
  39. </span> -->
  40. <problemdialog v-if="dialogShow" :objType="5" :villType="5" :objId="currentObjectId" :regId="currentObjectRgstrId"
  41. :objName="currentObjectName" :problemMiddleType="'监测'" :problemSmallType="problemSmallType" :stationType="stationType"
  42. @closeDialog="closeDialog"></problemdialog>
  43. </div>
  44. </template>
  45. <script>
  46. import request from "../../../utils/gw_ajax_request.js";
  47. import { getBaseExt } from "../../../api/duChaTianBao.js";
  48. import problemdialog from "./dxs_czwhgl_problemDialog.vue";
  49. export default {
  50. props: ["currentObjectRgstrId", "currentObjectName", "currentObjectId","stationType","currentSttp",'currentGrwCode'],
  51. components: {
  52. problemdialog:problemdialog,
  53. },
  54. data() {
  55. return {
  56. addObj: {
  57. repeatability: '',
  58. percentage: ''
  59. },
  60. scoreObj: {
  61. repeatabilityScore: '',
  62. percentageScore: '',
  63. handScore: ''
  64. },
  65. allScore: '',
  66. curOperate: "",
  67. formLabelWidth: "250px",
  68. loading: true,
  69. operationType1: "",
  70. dialogShow: false
  71. };
  72. },
  73. computed: {
  74. recPersId() {
  75. return localStorage.getItem("userid")
  76. ? localStorage.getItem("userid")
  77. : "1098101939614724096";
  78. },
  79. recPersName(){
  80. return localStorage.getItem("account")? localStorage.getItem("account"): ''
  81. },
  82. scoreSum(){
  83. if(this.stationType == 'autoStation'){
  84. this.allScore = this.scoreObj.repeatabilityScore*1 + this.scoreObj.percentageScore*1
  85. return this.allScore
  86. }else{
  87. this.allScore = this.scoreObj.repeatabilityScore*1 + this.scoreObj.handScore*1
  88. return this.allScore
  89. }
  90. }
  91. },
  92. mounted() {
  93. this.getRgstridObj();
  94. },
  95. watch: {
  96. currentGrwCode(n, o) {
  97. this.getRgstridObj();
  98. },
  99. 'addObj.repeatability':{
  100. deep:true,
  101. handler(newVal,oldVal){
  102. if(newVal >= -2 && newVal <= 2 && newVal != '' && newVal){
  103. this.scoreObj.repeatabilityScore = '40'
  104. }else{
  105. this.scoreObj.repeatabilityScore = '0'
  106. }
  107. }
  108. },
  109. 'addObj.percentage':{
  110. deep:true,
  111. handler(newVal,oldVal){
  112. if(newVal >= 95){
  113. this.scoreObj.percentageScore = '15'
  114. }else if(newVal >= 90 && newVal < 95){
  115. this.scoreObj.percentageScore = '10'
  116. }else if(newVal >= 80 && newVal < 90){
  117. this.scoreObj.percentageScore = '5'
  118. }else if(newVal < 80 ){
  119. this.scoreObj.percentageScore = '0'
  120. }
  121. }
  122. },
  123. },
  124. methods: {
  125. appearDialog(type) {
  126. this.dialogShow = true;
  127. this.problemSmallType = type;
  128. },
  129. closeDialog() {
  130. this.dialogShow = false;
  131. },
  132. getRgstridObj() {
  133. request.post(`/dc/insp/grw/getDataQuality?id=${this.currentObjectRgstrId}`).then(res => {
  134. if (res.data) {
  135. this.addObj.repeatability = res.data.repeatability;
  136. this.addObj.percentage = res.data.percentage;
  137. this.scoreObj.repeatabilityScore = res.data.repeatabilityScore;
  138. this.scoreObj.percentageScore = res.data.percentageScore;
  139. this.scoreObj.handScore = res.data.handScore;
  140. this.allScore = res.data.score
  141. this.operationType1 = "update";
  142. console.log(this.addObj);
  143. } else {
  144. this.addObj = {};
  145. this.operationType1 = "add";
  146. }
  147. });
  148. },
  149. addMember() {
  150. if(!this.addObj.repeatability){
  151. this.$message.info('请填写现场比测精度误差')
  152. return
  153. }
  154. if(!this.addObj.percentage && this.stationType == 'autoStation'){
  155. this.$message.info('请填写单站月统计到报率')
  156. return
  157. }
  158. if(this.addObj.percentage && this.stationType == 'autoStation' && (this.addObj.percentage < 0 || this.addObj.percentage > 100)){
  159. this.$message.info('单站月统计到报率为0~100之间')
  160. return
  161. }
  162. if(this.stationType == 'artiStation' && (!this.scoreObj.handScore || this.scoreObj.handScore < 0 || this.scoreObj.handScore > 15)){
  163. this.$message.info('人工监测数据报送是否及时打分为0~15之间')
  164. return
  165. }
  166. this.addObj["id"] = this.currentObjectRgstrId;
  167. this.addObj["checkPid"] = this.recPersId;
  168. this.addObj['checkPname'] = this.recPersName;
  169. this.addObj['score'] = this.scoreSum;
  170. this.addObj['sttp'] = this.currentSttp;
  171. this.addObj['percentageStatus'] = '1'
  172. let addObj = {};
  173. Object.assign(addObj, this.addObj);
  174. Object.assign(addObj, this.scoreObj);
  175. if (this.operationType1 == "add") {
  176. request.post("/dc/insp/grw/updateDataQuality", addObj).then(res => {
  177. if (res.success) {
  178. this.$message({
  179. type: "success",
  180. message: "监测数据质量和到报率填报成功!"
  181. });
  182. this.$emit("addShuiKuSuccess");
  183. } else {
  184. this.$message.error(res.message);
  185. }
  186. })
  187. .catch(err => {
  188. this.$message.error(res.message);
  189. });
  190. } else {
  191. request.post("/dc/insp/grw/updateDataQuality", addObj).then(res => {
  192. if (res.success) {
  193. this.$message({
  194. type: "success",
  195. message: "监测数据质量和到报率填报成功!"
  196. });
  197. this.$emit("addShuiKuSuccess");
  198. } else {
  199. this.$message.error(res.message);
  200. }
  201. })
  202. .catch(err => {
  203. this.$message.error(res.message);
  204. });
  205. }
  206. },
  207. cancelHandler() {
  208. this.$emit("cancelHandler");
  209. },
  210. handleInput(e) {
  211. // log(e.target.value)
  212. e.target.value=e.target.value.replace(/[^\d]/g,'');
  213. },
  214. },
  215. directives:{
  216. number:{
  217. update(el,binding,vnode){
  218. let _this = vnode.context
  219. let numReg = /^\+?[1-9][0-9]*$/
  220. if(binding.value && !numReg.test(binding.value)){
  221. if(binding.value == '0'){
  222. return
  223. }
  224. _this.$message.info('请输入正整数')
  225. }
  226. }
  227. }
  228. }
  229. };
  230. </script>
  231. <style>
  232. .jcsjzl label.el-form-item__label {
  233. width: 280px;
  234. }
  235. .jcsjzl .add-icon {
  236. color: #009cee;
  237. float: right;
  238. margin-right: 20px;
  239. font-size: 18px;
  240. cursor: pointer;
  241. }
  242. .score_input .el-input__inner{
  243. padding: 0 5px;
  244. }
  245. .score_tips{
  246. float: right;
  247. margin-right: 10px;
  248. font-size: 12px;
  249. color: #ff0000;
  250. }
  251. </style>