Blame view

src/views/baseCaseHandling/Form.vue 9.84 KB
4424f41c   monkeyhouyi   网信执法、清单管理静态页面
1
  <template>
61009cfc   monkeyhouyi   2024/8/8
2
    <el-dialog
4614132f   monkeyhouyi   列表查询,案件处理
3
      :title="!dataForm.id ? '新建' : isDetail ? '详情' : formType ? '案件处理' : '编辑'"
61009cfc   monkeyhouyi   2024/8/8
4
5
6
7
8
9
10
      :close-on-click-modal="false"
      :visible.sync="visible"
      class="NCC-dialog NCC-dialog_center"
      lock-scroll
      width="50%"
      v-loading="loading"
    >
87e6927c   monkeyhouyi   弹框样式
11
      <el-row :gutter="15" class="NCC-dialog-content">
61009cfc   monkeyhouyi   2024/8/8
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
        <el-form
          ref="elForm"
          :model="dataForm"
          size="small"
          label-width="110px"
          label-position="right"
          :disabled="!!isDetail"
          :rules="rules"
        >
          <el-col :span="24" v-if="false">
            <el-form-item label="主键" prop="id">
              <el-input v-model="dataForm.id" placeholder="请输入" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="系统名称" prop="systemName">
  			      <el-select
   			        v-model="dataForm.systemName"
   			        filterable
   			        remote
   			        reserve-keyword
   			        placeholder="请输入关键词"
   			        :remote-method="getSystemSelect"
                 @change="systemChange"
93adad84   monkeyhouyi   网信执法功能添加
36
                :disabled="formType"
61009cfc   monkeyhouyi   2024/8/8
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
   			        :loading="system_loading">
   			        <el-option
   			          v-for="item in systemOption"
   			          :key="item.value"
   			          :label="item.systemName"
   			          :value="item.id">
   			        </el-option>
   			      </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="注册主体" prop="registeredEntity">
              <el-input v-model="dataForm.registeredEntity" placeholder="选择系统自动带出" clearable disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="系统类别" prop="category">
              <el-input v-model="dataForm.category" placeholder="选择系统自动带出" clearable disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="备案号" prop="recordNumber">
              <el-input v-model="dataForm.recordNumber" placeholder="选择系统自动带出" clearable disabled/>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="所属区县" prop="districtCounty">
                <el-radio-group
                  v-model="dataForm.districtCounty"
                  placeholder="请选择所属区县"
                  style="line-height: 22px"
93adad84   monkeyhouyi   网信执法功能添加
68
                  :disabled="formType"
61009cfc   monkeyhouyi   2024/8/8
69
70
71
72
73
74
75
76
77
                >
                  <el-radio v-for="v in areaOptions" :key="v.id" :label="v.id">{{
                    v.fullName
                  }}</el-radio>
                </el-radio-group>
              </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="违法原因" prop="illegalReasons">
93adad84   monkeyhouyi   网信执法功能添加
78
              <el-input type="textarea" v-model="dataForm.illegalReasons" placeholder="请输入违法原因" clearable maxlength="200" :disabled="formType"/>
61009cfc   monkeyhouyi   2024/8/8
79
80
81
82
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="处罚要求" prop="punishmentRequirements">
93adad84   monkeyhouyi   网信执法功能添加
83
              <el-input type="textarea" v-model="dataForm.punishmentRequirements" placeholder="请输入处罚要求" clearable maxlength="200" :disabled="formType"/>
61009cfc   monkeyhouyi   2024/8/8
84
85
86
87
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="处罚内容" prop="punishmentContent">
93adad84   monkeyhouyi   网信执法功能添加
88
89
90
              <el-input type="textarea" v-model="dataForm.punishmentContent" placeholder="请输入处罚内容" clearable maxlength="200" :disabled="formType"/>
            </el-form-item>
          </el-col>
1ef03631   monkeyhouyi   1
91
          <el-col :span="24" v-if="(formType && isSHILevel) || dataForm.state == '592592999649641733'">
93adad84   monkeyhouyi   网信执法功能添加
92
93
            <el-form-item label="执法方式" prop="enforceType">
              <el-radio-group v-model="dataForm.enforceType">
4614132f   monkeyhouyi   列表查询,案件处理
94
95
                <el-radio :label="'1'">柔性执法</el-radio>
                <el-radio :label="'2'">行政执法</el-radio>
93adad84   monkeyhouyi   网信执法功能添加
96
97
98
              </el-radio-group>
            </el-form-item>
          </el-col>
4614132f   monkeyhouyi   列表查询,案件处理
99
          <el-col :span="24" v-if="formType || dataForm.state == '592592999649641733'">
87e6927c   monkeyhouyi   弹框样式
100
101
            <el-form-item label="执法说明" prop="enforcecontent">
              <el-input type="textarea" v-model="dataForm.enforcecontent" placeholder="请输入处罚内容" clearable maxlength="200"/>
61009cfc   monkeyhouyi   2024/8/8
102
103
104
105
106
107
108
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
  
      <span slot="footer" class="dialog-footer">
        <el-button @click="visible = false">取 消</el-button>
93adad84   monkeyhouyi   网信执法功能添加
109
110
111
112
113
114
115
        <template  v-if="!isDetail && !formType">
          <el-button type="primary" v-if="!isDetail" @click="submit(1)" :loading="btnLoading">{{isSHILevel ? '下 发' : '上 报'}}</el-button>
          <el-button type="info" v-if="!isDetail" @click="submit(0)" :loading="btnLoading">保 存</el-button>
        </template>
        <template v-if="!isDetail && formType">
          <el-button type="primary" v-if="!isDetail" @click="handle" :loading="btnLoading">提 交</el-button>
        </template>
61009cfc   monkeyhouyi   2024/8/8
116
117
      </span>
    </el-dialog>
4424f41c   monkeyhouyi   网信执法、清单管理静态页面
118
119
  </template>
  <script>
61009cfc   monkeyhouyi   2024/8/8
120
121
122
123
  import infoMixin from "@/mixins/info";
  import request from "@/utils/request";
  import { getSystemDetail } from "@/api/baseData/info";
  import { dynamicTextUP } from "@/filters/index";
4424f41c   monkeyhouyi   网信执法、清单管理静态页面
124
  
61009cfc   monkeyhouyi   2024/8/8
125
126
127
128
129
130
131
  export default {
    mixins: [infoMixin],
    data() {
      return {
        visible: false,
        loading: false,
        isDetail: false,
93adad84   monkeyhouyi   网信执法功能添加
132
        formType: false,
61009cfc   monkeyhouyi   2024/8/8
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
        dataForm: {
  		    id: undefined,
  		    registrationTime: undefined,
  		    systemName: undefined,
  		    registeredEntity: undefined,
  		    category: undefined,
  		    recordNumber: undefined,
  		    districtCounty: undefined,
  		    illegalReasons: undefined,
  		    punishmentRequirements: undefined,
  		    punishmentContent: undefined,
  		    state: undefined,
  		    record: undefined,
  		    caseHandlingOpinions: undefined,
  		    enforcementRecords: undefined,
  		    noticeLetter: undefined,
  		    punishmentDecision: undefined,
  		    closingReport: undefined,
93adad84   monkeyhouyi   网信执法功能添加
151
          enforceType: undefined,
87e6927c   monkeyhouyi   弹框样式
152
          enforcecontent: undefined,
61009cfc   monkeyhouyi   2024/8/8
153
154
155
156
157
158
159
160
  	    },
        rules: {
          systemName: [
            { required: true, message: "请选择系统名称", trigger: "change" }
          ],
          districtCounty: [
            { required: true, message: "请选择所属区域", trigger: "change" }
          ],
93adad84   monkeyhouyi   网信执法功能添加
161
162
163
          enforceType: [
            { required: true, message: "请选择执法方式", trigger: "change" }
          ],
87e6927c   monkeyhouyi   弹框样式
164
          enforcecontent: [
93adad84   monkeyhouyi   网信执法功能添加
165
166
            { required: true, message: "请填写执法说明", trigger: "bulr" }
          ],
61009cfc   monkeyhouyi   2024/8/8
167
168
169
170
        },
        systemOption: [],
        system_loading: false,
        areaOptions: [],
93adad84   monkeyhouyi   网信执法功能添加
171
        btnLoading: false,
61009cfc   monkeyhouyi   2024/8/8
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
      };
    },
    computed: {
      isSHILevel() {
        // 判断角色是否为‘市级办公室’
        return this.$store.state.user.islader;
      },
    },
    watch: {},
    created() {
      this.getSystemSelect();
      this.initSystemTypeList();
      this.initAreaTypeList();
    },
    mounted() {},
    methods: {
      // 获取系统列表
      getSystemSelect(val) {
        let query = {
          SystemName: val || "",
        };
        this.system_loading = true;
        request({
          url: "/Extend/basesysteminfo/GetNoPagingList",
          method: "get",
          params: query,
        }).then(({data}) => {
          this.systemOption = data;
          this.system_loading = false;
        })
      },
      // 系统名称改变
      systemChange(val) {
        getSystemDetail(val).then(({data}) => {
          this.dataForm.registeredEntity = data.companyId;
          this.dataForm.category = dynamicTextUP(data.systemType, this.systemTypeOptions);
          this.dataForm.recordNumber = data.specialRecordNumber || '--';
          this.dataForm.districtCounty = data.areaId;
        })
      },
      goBack() {
        this.$emit("refresh");
      },
93adad84   monkeyhouyi   网信执法功能添加
215
216
217
      init(id, isDetail, type) {
        // type 0 上报/下派 1 处理
        this.formType = Boolean(type) || false;
61009cfc   monkeyhouyi   2024/8/8
218
219
        this.dataForm.id = id || 0;
        this.isDetail = isDetail || false;
61009cfc   monkeyhouyi   2024/8/8
220
221
222
223
        this.visible = true;
        this.$nextTick(() => {
          this.$refs["elForm"].resetFields();
          if (this.dataForm.id) {
93adad84   monkeyhouyi   网信执法功能添加
224
            this.loading = true;
61009cfc   monkeyhouyi   2024/8/8
225
226
227
228
229
            request({
              url: `/Extend/BaseCaseHandling/${this.dataForm.id}`,
              method: "GET",
            }).then((res) => {
              this.dataForm = res.data;
93adad84   monkeyhouyi   网信执法功能添加
230
              this.loading = false;
4614132f   monkeyhouyi   列表查询,案件处理
231
232
233
              this.$nextTick(() => {
                this.$refs["elForm"].clearValidate();
              })
93adad84   monkeyhouyi   网信执法功能添加
234
235
            }).catch(() => {
              this.loading = false;
61009cfc   monkeyhouyi   2024/8/8
236
237
238
239
            });
          }
        });
      },
93adad84   monkeyhouyi   网信执法功能添加
240
      // 上报/下派
61009cfc   monkeyhouyi   2024/8/8
241
242
243
244
245
246
247
      submit(type) {
        // type: 1 上报 0 保存
        let obj = {
          ...this.dataForm,
          isReport: type,
        }
  			this.$refs['elForm'].validate((valid) => {
87e6927c   monkeyhouyi   弹框样式
248
          if(valid) {
93adad84   monkeyhouyi   网信执法功能添加
249
250
251
252
253
254
255
256
            !this.dataForm.id ? this.toRequest('/Extend/BaseCaseHandling', 'POST', obj) : this.toRequest(`/Extend/BaseCaseHandling/${this.dataForm.id}`, 'PUT', obj);
          }
        })
      },
      // 处理
      handle() {
        this.$refs['elForm'].validate((valid) => {
          if(valid) {
93adad84   monkeyhouyi   网信执法功能添加
257
            this.btnLoading = true;
87e6927c   monkeyhouyi   弹框样式
258
            let { enforceType, enforcecontent } = this.dataForm;
61009cfc   monkeyhouyi   2024/8/8
259
            request({
87e6927c   monkeyhouyi   弹框样式
260
261
262
              url: `/Extend/basecasehandling/HandlingCase/${this.dataForm.id}`,
              method: "POST",
              data: { enforceType, enforcecontent },
61009cfc   monkeyhouyi   2024/8/8
263
            }).then((res) => {
4614132f   monkeyhouyi   列表查询,案件处理
264
265
              this.visible = false;
              this.$emit("refresh", true);
61009cfc   monkeyhouyi   2024/8/8
266
267
              this.$message({
                type: "success",
4614132f   monkeyhouyi   列表查询,案件处理
268
                message: res.msg,
93adad84   monkeyhouyi   网信执法功能添加
269
270
271
272
              })
            }).catch(() => {
              this.btnLoading = false;
            })
61009cfc   monkeyhouyi   2024/8/8
273
274
          }
        })
93adad84   monkeyhouyi   网信执法功能添加
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
      },
      toRequest(url, method, data) {
        this.btnLoading = true;
        request({
          url,
          method,
          data,
        }).then((res) => {
          this.$message({
            type: "success",
            message: res.msg,
            onClose: () => {
              this.visible = false;
              this.$emit("refresh", true);
            },
          });
        }).catch(() => {
          this.btnLoading = false;
        });
61009cfc   monkeyhouyi   2024/8/8
294
295
296
297
      }
    },
  };
  </script>