1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
| <template>
| <el-dialog
| :title="$t('操作确认')"
| :visible.sync="dialogVisible"
| width="480px"
| :before-close="onClose"
| >
| <el-form ref="depositform" :model="form" label-width="auto" :rules="rules">
| <el-form-item :label="$t('sl')" prop="applyNums">
| <el-input v-model.number="form.applyNums" type="number"></el-input>
| </el-form-item>
|
| <el-form-item :label="$t('hj101')" prop="lever">
| <el-input-number
| v-model="form.lever"
| :min="1"
| :max="100"
| ></el-input-number>
| </el-form-item>
|
| <el-form-item>
| <el-button @click="onClose">{{ $t("qx") }}</el-button>
| <el-button type="primary" @click="onSubmit" class="submit">
| {{ $t("qr") }}
| </el-button>
| </el-form-item>
| </el-form>
| </el-dialog>
| </template>
|
| <script>
| import * as api from "@/axios/api";
| export default {
| data() {
| return {
| form: {
| applyNums: "",
| lever: 1,
| },
| rules: {
| applyNums: [{ required: true, message: this.$t("请输入") }],
| lever: [{ required: true, message: this.$t("请输入") }],
| },
| };
| },
| props: {
| dialogVisible: {
| type: Boolean,
| default: false,
| },
| dataObj: {
| type: Object,
| default: () => {},
| },
| },
| created() {},
| methods: {
| // 关闭弹窗
| onClose() {
| this.$emit("update:dialogVisible", false);
| this.$emit("onClose"); // 关闭弹窗时,通知父组件
| },
| // 提交
| onSubmit() {
| this.$refs["depositform"].validate(async (valid) => {
| if (valid) {
| let opt = {
| newCode: this.dataObj.code,
| password: this.dataObj.password,
| newlistId: this.dataObj.newlistId,
| type: this.dataObj.type,
| ...this.form,
| };
| let data = await api.getNewAdd(opt);
| if (data.status == 0) {
| this.$message.success(data.msg);
| this.onClose();
| }
| } else {
| console.log("getNewAdd err");
| return false;
| }
| });
| },
| },
| };
| </script>
|
| <style lang="scss" scoped></style>
|
|