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
| <template>
| <div>
| <el-form ref="Frompetition" :inline="true" :model="Frompetition" label-width="110px">
| <el-form-item label="备注">
| <el-input type="textarea" :disabled="true" v-model="Frompetition.remark" placeholder="" maxlength="200" show-word-limit></el-input>
| </el-form-item>
| <!-- <el-form-item>
| <el-button type="primary" @click="onSubmitpetition('Frompetition')">保存</el-button>
| </el-form-item> -->
| </el-form>
| </div>
| </template>
|
| <script>
| export default {
| props:["editId"],
| data() {
| return{
| Frompetition:{
| remark:'',
| populationId:'',
| id:'',
| }
| }
| },
| watch: {
| editId(val) {
| this.Frompetition.populationId =val;
| }
| },
| mounted() {
| /** populationId:获取人口ID */
| if(this.$route.query.id) {
| this.Frompetition.populationId = this.$route.query.id;
| this.Frompetition.communityId = this.$route.query.com;
| this.getDetails();
| }
|
| },
| methods: {
| /** 获取吸毒信息 populationId:人口id
| * id:主键id 有id编辑 无id新增 */
| getDetails() {
| this.$api.get("population/key/detail",{populationId:this.Frompetition.populationId,communityId:this.Frompetition.communityId},e=> {
| if(e.id) {
| this.Frompetition = e;
| }
| })
| },
|
| onSubmitpetition(formName) {
| if(this.Frompetition.populationId == '') {
| return this.$message({
| message: '请先填写完基础信息',
| type: 'warning'
| });
| }
| if( this.Frompetition.id) {
| //编辑
| this.$api.post("population/key/edit",this.Frompetition,e=> {
| demo.toast("编辑成功")
| })
| }else {
| //新增
| this.$api.post("population/key/add",this.Frompetition,e=> {
| demo.toast("保存成功")
| })
| }
| },
| }
| }
| </script>
|
| <style>
|
| </style>
|
|