峰峰执法平台简易案件程序板块 pad端
yang
2022-10-28 105e36dfd740d96c916d0065c37217aa69e2184c
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<template>
<el-main style="width: 100%;margin: 0 auto">
  <el-form ref="form" :model="form" label-width="110px" size="medium">
 
    <el-form-item label="案由">
      <el-input v-model="form.casePoint" placeholder="请填写案由"></el-input>
    </el-form-item>
 
    <el-row>
      <el-col :span="12">
        <el-form-item label="当事人姓名">
          <el-select v-model="form.litigant" placeholder="请选择当事人"
                      style="width: 100%;" @change="marketChange">
            <el-option
              v-for="item in marketList"
              :key="item.subjectName"
              :label="item.subjectName"
              :value="item">
            </el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="法人">
          <el-input v-model="form.legalPerson" placeholder="请填写法人姓名"></el-input>
        </el-form-item>
      </el-col>
    </el-row>
 
    <el-row>
      <el-col :span="12">
        <el-form-item label="证件号/信用码">
          <el-input v-model="form.certNo" placeholder="请填写证件号/信用码" ></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="联系电话">
          <el-input v-model="form.phone" placeholder="请填写当事人电话"></el-input>
        </el-form-item>
      </el-col>
    </el-row>
 
    <el-form-item label="住址">
      <el-input v-model="form.address" placeholder="请填写当事人住址"></el-input>
    </el-form-item>
 
    <el-form-item label="办案人员" prop="hanlderIds">
      <el-select v-model="form.hanlderIds" clearable filterable multiple :multiple-limit="2"
                 placeholder="请选择" style="width: 100%;" @change="setPersonname($event)">
        <el-option
          v-for="item in organPersons"
          :key="item.userId"
          :label="item.realName"
          :value="item.userId">
          <span style="float: left">{{ item.realName }}</span>
          <span style="float: right; color: #8492a6; font-size: 13px">执法证号:{{ item.lawCert }}</span>
        </el-option>
      </el-select>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="onSubmit">立即创建</el-button>
      <el-button @click="backAll">取消</el-button>
    </el-form-item>
  </el-form>
</el-main>
</template>
 
<script>
import {easycase,getMarketList,getIdByToken} from '../../api/News/pad'
import {getfindAll} from "../../api/News/useres";
export default {
  name: "padFrom",
  data(){
    return{
      form:{
        casePoint:'',
        litigant:"",
        legalPerson:"",
        certNo:"",
        phone:"",
        address:"",
        hanlderIds:[],
      },
      //办案人员数据
      organPersons:[],
      //当事人数据
      marketList:[],
    }
  },
  created() {
    this.init()
  },
  methods:{
    init(){
      // this.$nextTick(()=>{
      getIdByToken().then(res =>{
        console.log(res,'getIdByToken')
        let a = res.data.data;
        this.form.hanlderIds.push(a)
      })
      //查询当事人
      getMarketList().then((res) => {
        this.marketList = res.data.data;
      })
        //查询办案人员信息
        getfindAll().then((res) => {
          this.organPersons = res.data.data;
        })
 
      // })
    },
    marketChange(item){
      this.form.litigant = "";
      this.form.legalPerson = "";
      this.form.litigantCert = "";
      this.form.certNo = "";
      this.form.address = "";
      this.form.phone = "";
      this.form.litigantId = item.id;
      if ("经营者" == item.subjectType || "个体工商户" == item.subjectType) {
        this.form.litigant = item.subjectName;
        this.form.legalPerson = item.legalPerson;
        this.form.litigantCert = "营业执照";
        this.form.certNo = item.idCard;
        this.form.address = item.address;
        this.form.phone = item.phone;
      } else if ("公民" == item.subjectType) {
        this.form.litigant = item.subjectName;
        this.form.litigantCert = "居民身份证";
        this.form.certNo = item.idCard;
        this.form.address = item.address;
        this.form.phone = item.phone;
      } else if ("其他组织" == item.subjectType) {
        this.form.litigant = item.subjectName;
        this.form.legalPerson = item.legalPerson;
        this.form.certNo = item.idCard;
        this.form.address = item.address;
        this.form.phone = item.phone;
      }
    },
    backAll(){
      this.$router.push({
        path: '/pad',
      })
    },
    setPersonname(val) {
      let names = "";
      for (let i in this.organPersons) {
        if (val.indexOf(this.organPersons[i].userId) > -1) {
          names += this.organPersons[i].realName + ",";
        }
      }
      if (names != "") {
        this.form.hanlders = names.substring(0, names.length - 1);
      }
    },
    onSubmit(){
      console.log(this.form.hanlderIds,'this.form.hanlderIds')
      this.form.hanlderIds=this.form.hanlderIds.toString()
      if (this.form.hanlderIds.length < 1) {
        this.form.hanlders = '';
      }
      easycase(this.form).then(res =>{
        this.backAll()
      })
    },
  },
}
</script>
 
<style scoped>
 
</style>