houzhongjian
2024-07-23 8501060c4f921d1e744c477e4dc08eb47b52693c
提交 | 用户 | 时间
850106 1 <template>
H 2   <el-dialog :visible.sync="visible" title="指标评价体系权重分配" :close-on-click-modal="false"
3              :close-on-press-escape="false" width="30%">
4         <el-form label-position="left" label-width="80px" :model="dataForm">
5         <el-form-item label="数量">
6             <el-input-number v-model="dataForm.number"></el-input-number>&nbsp;&nbsp;&nbsp;%
7             <el-slider v-model="dataForm.number"></el-slider>
8         </el-form-item>
9         <el-form-item label="质量">
10             <el-input-number v-model="dataForm.quality"></el-input-number>&nbsp;&nbsp;&nbsp;%
11             <el-slider v-model="dataForm.quality"></el-slider>
12         </el-form-item>
13         <el-form-item label="生产消耗">
14             <el-input-number v-model="dataForm.consume"></el-input-number>&nbsp;&nbsp;&nbsp;%
15             <el-slider v-model="dataForm.consume"></el-slider>
16         </el-form-item>
17             <el-form-item label="过程控制">
18             <el-input-number v-model="dataForm.process"></el-input-number>&nbsp;&nbsp;&nbsp;%
19             <el-slider v-model="dataForm.process"></el-slider>
20         </el-form-item>
21             <el-form-item label="管理">
22             <el-input-number v-model="dataForm.manage"></el-input-number>&nbsp;&nbsp;&nbsp;%
23             <el-slider v-model="dataForm.manage"></el-slider>
24         </el-form-item>
25         </el-form>
26             <span slot="footer" class="dialog-footer">
27       <el-button @click="visible = false">取消</el-button>
28       <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
29     </span>
30     </el-dialog>
31 </template>
32 <script>
33 export default {
34   data() {
35     return {
36       visible: false,
37       dataForm: {
38         number: "",
39         quality: "",
40         consume: "",
41         process:"",
42         manage:""
43       },
44     };
45   },
46   
47   methods: {
48     init(row) {
49       this.visible = true;
50       this.$nextTick(() => {
51       });
52     },
53     getDataList() {
54
55       this.$http({
56         url: "/iailab-ntt-data/api/data/tag/current/oadp",
57         method: "post",
58         data: [this.dataForm.id],
59       })
60         .then(({ data }) => {
61            if (data && data.code === 0) {
62             this.dataForm.value = data.data[this.dataForm.id].value;
63             this.dataForm.timestamp = data.data[this.dataForm.id].timestamp;
64              }
65         })
66         .catch((error) => {
67           console.error(error);
68         });
69     },
70     // 表单提交
71     dataFormSubmit() {
72         console.log(this.dataForm.number+this.dataForm.quality+this.dataForm.consume+this.dataForm.process+this.dataForm.manage==100)
73      if (!(this.dataForm.number+this.dataForm.quality+this.dataForm.consume+this.dataForm.process+this.dataForm.manage==100)) {
74          this.$alert('各权重之和必须为100%', {
75           confirmButtonText: '确定',
76         });
77         }
78     },
79     beforeCloseHandle(done) {
80       this.dataList = [];
81       done();
82     },
83   },
84   props: {
85     row: Object,
86   },
87 };
88 </script>