hejianhao
2025-04-16 dab2d210ca06c1faa514c6388fbd5de1ab355360
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<template>
  <div>
    <el-form ref="Fromcult"  :inline="true" :model="Fromcult" label-width="155px">
      <el-form-item label="邪教名称(涉邪组织)">
        <el-input  v-model="Fromcult.cultName"  placeholder="请输入-不超过50字"  maxlength="50" show-word-limit></el-input>
      </el-form-item>
      <el-form-item label="参加邪教时间">
        <el-date-picker
          v-model="Fromcult.joinCultDate"
          type="date"
           value-format="yyyy-MM-dd"
          placeholder="选择日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="是否对外宣传">
        <el-select  placeholder="请选择"  v-model="Fromcult.isExternalPublicity">
          <el-option label="是" value="1"></el-option>
          <el-option label="否" value="0"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="备注">
        <el-input type="textarea"  v-model="Fromcult.remark"  placeholder="请输入-不超过200字"  maxlength="200" show-word-limit></el-input>
      </el-form-item>
      <el-form-item label="基本情况(参加邪教的活动情况):" label-width="250px">
        <el-input type="textarea"   v-model="Fromcult.basicSituation" placeholder="请输入-不超过200字"  maxlength="200" show-word-limit></el-input>
      </el-form-item>
      <div>
      <el-form-item>
        <el-button type="primary" @click="onSubmitcult('Fromcult')">保存</el-button>
      </el-form-item>
      </div>
    </el-form>
 
  </div>
</template>
 
<script>
export default {
  props:['editId'],
  data() {
    return{
      Fromcult:{
      address:"",
      basicSituation:"",
      cultName:"",
      id:"",
      isAlive:"",
      isExternalPublicity:"",
      isRegister:"",
      joinCultDate:"",
      populationId:"",
      receiveAllowanceBegin:"",
      remark:"",
      communityId:0,
      }
    }
  },
  watch: {
    editId(val) {
      this.Fromcult.populationId  =val;
    }
  },
  mounted() {
    /** populationId:获取人口ID  */
    if(this.$route.query.id) {
      this.Fromcult.populationId = this.$route.query.id;
      this.getDetails();
    }
 
 
  },
  methods: {
    /** 获取吸毒信息 populationId:人口id
     *  id:主键id  有id编辑 无id新增 */
    getDetails() {
         this.$api.get("population/cult/detail",{populationId:this.Fromcult.populationId},e=> {
           if(e.id) {
            this.Fromcult = e;
           }
        })
    },
    onSubmitcult(formName) {
      if(this.Fromcult.populationId == '') {
        return  this.$message({
            message: '请先填写完基础信息',
            type: 'warning'
          });
      }
      if( this.Fromcult.id) {
        //编辑
        this.$api.post("population/cult/edit",this.Fromcult,e=> {
          demo.toast("编辑成功")
        })
      }else {
        //新增
        this.$api.post("population/cult/add",this.Fromcult,e=> {
          demo.toast("保存成功")
        })
      }
    },
  }
}
</script>
 
<style>
 
</style>