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
| <template>
| <zt-dialog ref="dialog" @confirm="formSubmit">
| <el-form :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" label-width="120px">
| <zt-form-item label="任务名称" prop="taskName" rules="required">
| <el-input v-model="dataForm.taskName"></el-input>
| </zt-form-item>
| <zt-form-item label="任务总时长" prop="taskDuration">
| <el-input v-model="dataForm.taskDuration"></el-input>
| </zt-form-item>
| </el-form>
| </zt-dialog>
| </template>
|
| <script>
| export default {
| data() {
| return {
| dataForm: {
| id: '',
| productId: '',
| productPid: '',
| taskName: '',
| taskSort: '',
| remark: '',
| taskDuration: ''
| }
| }
| },
| methods: {
| init(id,param){
| this.dataForm.productId =param.productId
| },
| // 获取信息
| async getInfo() {
| let res = await this.$http.get(`/taskReliability/Task/${this.dataForm.id}`)
| this.dataForm = {
| ...this.dataForm,
| ...res.data
| }
| },
| // 表单提交
| async formSubmit() {
| let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/taskReliability/Task/', this.dataForm)
| if (res.success) {
| await this.$tip.success()
| this.$refs.dialog.close()
| this.$emit('refreshDataList')
| }
| }
| }
| }
| </script>
|
|