Commit 106c96572f8cf303fc9469265d8f4050c60e9628

Authored by lifengge
1 parent c8e61114

修改未检人员页面,含新增、编辑、查看弹框信息

juvenile-prosecution-vue/src/views/business/MinorList.vue
... ... @@ -18,7 +18,8 @@
18 18 </a-form>
19 19  
20 20 <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
21   - <a-button type="primary" icon="download" @click="handleExportXls('未检人员模板')" style="margin-left:8px;">模板导出</a-button>
  21 + <a-button type="primary" icon="download" @click="handleExportXls('未检人员模板')" style="margin-left:8px;">模板导出
  22 + </a-button>
22 23 <a-upload style="margin-left:8px;" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader"
23 24 :action="importExcelUrl" @change="handleImportExcel">
24 25 <a-button type="primary" icon="import">导入</a-button>
... ... @@ -71,8 +72,8 @@
71 72  
72 73 <minor-modal ref="modalForm" @ok="modalFormOk" />
73 74 <!-- 详情 -->
74   - <a-modal v-model:visible="infoVisible" title="未成年信息" :footer=null :width="1000" >
75   - <a-descriptions bordered layout="vertical" :column="4">
  75 + <a-modal v-model:visible="infoVisible" title="未成年信息" :footer=null :width="1000">
  76 + <a-descriptions bordered size="middle" :column="2" class="desc_info">
76 77 <a-descriptions-item label="户号">{{ info.householdNum }}</a-descriptions-item>
77 78 <a-descriptions-item label="人员编号">{{ info.number }}</a-descriptions-item>
78 79 <a-descriptions-item label="姓名">{{ info.name }}</a-descriptions-item>
... ... @@ -82,18 +83,18 @@
82 83 <a-descriptions-item label="学校名称">{{ info.schoolName }}</a-descriptions-item>
83 84 <a-descriptions-item label="入学年份">{{ info.startYear }}</a-descriptions-item>
84 85 <a-descriptions-item label="是否失学">{{ info.school_dictText }}</a-descriptions-item>
85   - <a-descriptions-item label="家庭住址" >{{ info.address }}</a-descriptions-item>
86   - <a-descriptions-item label="是否失学">{{ info.school_dictText }}</a-descriptions-item>
87   - <a-descriptions-item label="学校名称">{{ info.schoolName }}</a-descriptions-item>
88 86 <a-descriptions-item label="监护人">{{ info.guardian }}</a-descriptions-item>
89 87 <a-descriptions-item label="监护人关系">{{ info.relation }}</a-descriptions-item>
90   - <a-descriptions-item label="重点关注原因" :span="2">{{ info.reason_dictText }}</a-descriptions-item>
91   - <a-descriptions-item label="特殊原因" :span="4">{{ info.specialReason }}</a-descriptions-item>
92   - <a-descriptions-item label="备注" :span="4">{{ info.remark }}</a-descriptions-item>
  88 + <a-descriptions-item label="重点关注原因">{{ info.reason_dictText }}</a-descriptions-item>
  89 + <a-descriptions-item label="特殊原因" :span="2">{{ info.specialReason }}</a-descriptions-item>
  90 + <a-descriptions-item label="家庭住址" :span="2">{{ info.address }}</a-descriptions-item>
  91 + <a-descriptions-item label="备注" :span="2">{{ info.remark }}</a-descriptions-item>
93 92 </a-descriptions>
94   - <a-tabs v-model:activeKey="activeKey">
  93 + <a-tabs v-model:activeKey="activeKey" type="card">
95 94 <a-tab-pane key="1" tab="家庭成员">
96   - <a-table bordered :columns="familyColumns" :data-source="familyDatas" :scroll="{ x: true }" rowKey="id" :loading="familyLoading" :pagination="familyPagination">
  95 + <a-table bordered :columns="familyColumns" :data-source="familyDatas" :scroll="{ x: '100%', y: 240 }"
  96 + rowKey="id"
  97 + :loading="familyLoading" :pagination="familyPagination" size="middle" class="j-table-force-nowrap">
97 98 <span slot="num" slot-scope="text,record">
98 99 <j-ellipsis :value="text" :length="8" />
99 100 </span>
... ... @@ -113,7 +114,7 @@ import { JeecgListMixin } from &#39;@/mixins/JeecgListMixin&#39;
113 114 import { GetAge } from '@/utils/util'
114 115 import MinorModal from './modules/MinorModal'
115 116 import '@/assets/less/TableExpand.less'
116   -import { getAction,downFile } from '@api/manage'
  117 +import { getAction, downFile } from '@api/manage'
117 118 import { FormTypes } from '@/utils/JEditableTableUtil'
118 119 //引入JS方法
119 120 import { filterDictTextByCache } from '@/components/dict/JDictSelectUtil'
... ... @@ -229,33 +230,40 @@ export default {
229 230 {
230 231 title: '姓名',
231 232 align: 'center',
  233 + width: 80,
232 234 dataIndex: 'name'
233 235 },
234 236 {
235 237 title: '身份证号',
236 238 align: 'center',
  239 + width: 170,
237 240 dataIndex: 'identity'
238 241 },
239 242 {
240 243 title: '与户主的关系',
241 244 align: 'center',
  245 + width: 120,
242 246 dataIndex: 'relation'
243 247 },
244 248 {
245 249 title: '行政区划',
246 250 align: 'center',
  251 + width: 120,
247 252 dataIndex: 'division',
248 253 scopedSlots: { customRender: 'longText' }
249 254 },
250 255 {
251 256 title: '现住址',
252 257 align: 'center',
  258 + width: 200,
  259 + ellipsis: true,
253 260 dataIndex: 'address',
254 261 scopedSlots: { customRender: 'longText' }
255 262 },
256 263 {
257 264 title: '是否犯罪',
258 265 align: 'center',
  266 + width: 100,
259 267 dataIndex: 'crime',
260 268 customRender: (text) => {
261 269 //字典值翻译通用方法
... ... @@ -265,12 +273,16 @@ export default {
265 273 {
266 274 title: '犯罪原因',
267 275 align: 'center',
  276 + width: 200,
  277 + ellipsis: true,
268 278 dataIndex: 'reason',
269 279 scopedSlots: { customRender: 'longText' }
270 280 },
271 281 {
272 282 title: '其他参考信息',
273 283 align: 'center',
  284 + width: 200,
  285 + ellipsis: true,
274 286 dataIndex: 'other',
275 287 scopedSlots: { customRender: 'longText' }
276 288 }
... ... @@ -286,7 +298,7 @@ export default {
286 298 showQuickJumper: true,
287 299 total: 0
288 300 },
289   - familyLoading:false,
  301 + familyLoading: false
290 302 }
291 303 },
292 304 created() {
... ... @@ -302,19 +314,19 @@ export default {
302 314 return GetAge(identity)
303 315 },
304 316 handleDetail(record) {
305   - var that = this;
306   - that.info = record;
307   - that.infoVisible = true;
308   - that.familyDatas=[];
309   - if(null!==record.householdNum && ''!==record.householdNum && undefined!==record.householdNum){
  317 + var that = this
  318 + that.info = record
  319 + that.infoVisible = true
  320 + that.familyDatas = []
  321 + if (null !== record.householdNum && '' !== record.householdNum && undefined !== record.householdNum) {
310 322 let params = { householdNum: record.householdNum }
311   - that.familyLoading=true;
  323 + that.familyLoading = true
312 324 getAction(this.url.familys, params).then(res => {
313 325 if (res.success) {
314   - that.familyLoading=false;
  326 + that.familyLoading = false
315 327 that.familyDatas = res.result || []
316 328 } else {
317   - that.familyLoading=false;
  329 + that.familyLoading = false
318 330 }
319 331 })
320 332 }
... ... @@ -371,8 +383,28 @@ export default {
371 383 </style>
372 384  
373 385 <style>
374   -.ant-modal-body{
375   - max-height: 700px;
376   - overflow-y: auto;
  386 +.j-table-force-nowrap .ant-table-body {
  387 + scrollbar-width: thin;
377 388 }
378   -</style>
  389 +
  390 +/* 设置滚动条的样式 */
  391 +.j-table-force-nowrap .ant-table-body::-webkit-scrollbar {
  392 + width: 10px;
  393 + height: 10px;
  394 +}
  395 +
  396 +/* 滚动槽 */
  397 +.j-table-force-nowrap .ant-table-body::-webkit-scrollbar-track {
  398 + background: #f5f5f5;
  399 +}
  400 +
  401 +/* 滚动条滑块 */
  402 +.j-table-force-nowrap .ant-table-body::-webkit-scrollbar-thumb {
  403 + background: #dedede;
  404 + -webkit-box-shadow: none;
  405 +}
  406 +
  407 +.desc_info .ant-descriptions-item-label {
  408 + width: 140px;
  409 +}
  410 +</style>
379 411 \ No newline at end of file
... ...
juvenile-prosecution-vue/src/views/business/modules/MinorModal.vue
... ... @@ -36,13 +36,11 @@
36 36 <j-dict-select-tag v-model="model.gender" dictCode="sex" placeholder="请选择性别" />
37 37 </a-form-model-item>
38 38 </a-col>
39   - </a-row>
40   - <a-col :span="12">
41   - <a-form-model-item label="身份证号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="identity">
42   - <a-input v-model="model.identity" placeholder="请输入身份证号"></a-input>
43   - </a-form-model-item>
44   - </a-col>
45   - <a-row>
  39 + <a-col :span="12">
  40 + <a-form-model-item label="身份证号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="identity">
  41 + <a-input v-model="model.identity" placeholder="请输入身份证号"></a-input>
  42 + </a-form-model-item>
  43 + </a-col>
46 44 <a-col :span="12">
47 45 <a-form-model-item label="学校名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="schoolName">
48 46 <a-input v-model="model.schoolName" placeholder="请输入学校名称"></a-input>
... ... @@ -53,21 +51,12 @@
53 51 <a-input v-model="model.startYear" placeholder="请输入入学年份"></a-input>
54 52 </a-form-model-item>
55 53 </a-col>
56   - </a-row>
57   - <a-row>
58 54 <a-col :span="12">
59 55 <a-form-model-item label="是否失学" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="school">
60 56 <j-dict-select-tag v-model="model.school" dictCode="school_status" placeholder="请选择是否失学" />
61 57 </a-form-model-item>
62 58 </a-col>
63 59 <a-col :span="12">
64   - <a-form-model-item label="家庭住址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address">
65   - <a-textarea v-model="model.address" placeholder="请输入家庭住址" :rows="1" ></a-textarea>
66   - </a-form-model-item>
67   - </a-col>
68   - </a-row>
69   - <a-row>
70   - <a-col :span="12">
71 60 <a-form-model-item label="监护人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="guardian">
72 61 <a-input v-model="model.guardian" placeholder="请输入监护人"></a-input>
73 62 </a-form-model-item>
... ... @@ -77,41 +66,43 @@
77 66 <a-input v-model="model.relation" placeholder="请输入监护人关系"></a-input>
78 67 </a-form-model-item>
79 68 </a-col>
80   - </a-row>
81   - <a-row>
82 69 <a-col :span="12">
83   - <a-form-model-item label="重点关注原因" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="reason">
84   - <j-dict-select-tag v-model="model.reason" dictCode="attention_reason" placeholder="请选择重点关注原因" />
  70 + <a-form-model-item label="家庭住址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address">
  71 + <a-textarea v-model="model.address" placeholder="请输入家庭住址" :rows="1"></a-textarea>
85 72 </a-form-model-item>
86 73 </a-col>
87 74 <a-col :span="12">
88 75 <a-form-model-item label="特殊原因" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="specialReason">
89   - <a-textarea v-model="model.specialReason" placeholder="请输入特殊原因"></a-textarea>
  76 + <a-textarea v-model="model.specialReason" placeholder="请输入特殊原因" :rows="1"></a-textarea>
  77 + </a-form-model-item>
  78 + </a-col>
  79 + <a-col :span="12">
  80 + <a-form-model-item label="重点关注原因" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="reason">
  81 + <j-dict-select-tag v-model="model.reason" dictCode="attention_reason" placeholder="请选择重点关注原因" />
90 82 </a-form-model-item>
91 83 </a-col>
92 84 <a-col :span="12">
93 85 <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
94   - <a-textarea v-model="model.remark" placeholder="请输入备注"></a-textarea>
  86 + <a-textarea v-model="model.remark" placeholder="请输入备注" :rows="1"></a-textarea>
95 87 </a-form-model-item>
96 88 </a-col>
97 89 </a-row>
98 90 </a-form-model>
99 91 </j-form-container>
100 92 <!-- 子表单区域 -->
101   - <a-tabs activeKey="1" style="margin-top: -20px">
  93 + <a-tabs activeKey="1" type="card">
102 94 <a-tab-pane tab="家庭成员" key="1" :forceRender="true">
103 95 <j-editable-table
  96 + class="main_table"
104 97 ref="editableTable"
105 98 :loading="familyLoading"
106 99 sticky :columns="columns"
107 100 :dataSource="dataSource"
108   - :maxHeight="190"
  101 + :maxHeight="192"
109 102 :rowNumber="true"
110 103 :rowSelection="true"
111 104 :actionButton="true" />
112   -
113 105 </a-tab-pane>
114   -
115 106 </a-tabs>
116 107 </a-spin>
117 108 </j-modal>
... ... @@ -133,17 +124,16 @@ export default {
133 124 return {
134 125 confirmLoading: false,
135 126 title: '',
136   - width: 800,
137 127 visible: false,
138 128 disableSubmit: false,
139 129 model: {},
140 130 labelCol: {
141 131 xs: { span: 24 },
142   - sm: { span: 6 }
  132 + sm: { span: 5 }
143 133 },
144 134 wrapperCol: {
145 135 xs: { span: 24 },
146   - sm: { span: 16 }
  136 + sm: { span: 19 }
147 137 },
148 138 labelCol2: {
149 139 xs: { span: 24 },
... ... @@ -154,12 +144,12 @@ export default {
154 144 sm: { span: 20 }
155 145 },
156 146 validatorRules: {
157   - householdNum:[ { required: true, message: '请输入户号' },],
158   - name:[ { required: true, message: '请输入姓名' },],
159   - gender:[ { required: true, message: '请选择性别' },],
160   - identity:[ {required: true,validator:this.validateIdCard}],
161   - relation:[ { required: true, message: '请输入监护人关系' },],
162   - guardian:[ { required: true, message: '请输入监护人' },],
  147 + householdNum: [{ required: true, message: '请输入户号' }],
  148 + name: [{ required: true, message: '请输入姓名' }],
  149 + gender: [{ required: true, message: '请选择性别' }],
  150 + identity: [{ required: true, validator: this.validateIdCard }],
  151 + relation: [{ required: true, message: '请输入监护人关系' }],
  152 + guardian: [{ required: true, message: '请输入监护人' }]
163 153 },
164 154 url: {
165 155 add: '/sys/minor/add',
... ... @@ -173,7 +163,7 @@ export default {
173 163 {
174 164 title: '户号',
175 165 key: 'householdNum',
176   - width: '250px',
  166 + width: '230px',
177 167 type: FormTypes.input,
178 168 defaultValue: '',
179 169 placeholder: '请输入${title}',
... ... @@ -182,7 +172,7 @@ export default {
182 172 {
183 173 title: '人员编号',
184 174 key: 'number',
185   - width: '180px',
  175 + width: '230px',
186 176 type: FormTypes.input,
187 177 defaultValue: '',
188 178 placeholder: '请输入${title}',
... ... @@ -191,7 +181,7 @@ export default {
191 181 {
192 182 title: '姓名',
193 183 key: 'name',
194   - width: '180px',
  184 + width: '100px',
195 185 type: FormTypes.input,
196 186 defaultValue: '',
197 187 placeholder: '请输入${title}',
... ... @@ -200,20 +190,20 @@ export default {
200 190 {
201 191 title: '身份证号',
202 192 key: 'identity',
203   - width: '200px',
  193 + width: '190px',
204 194 type: FormTypes.input,
205 195 defaultValue: '',
206 196 placeholder: '请输入${title}',
207 197 validateRules: [{
208 198 // pattern: '/(^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|(^[1-9]\\d{7}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)/',
209   - pattern:'^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|[xX])$',
  199 + pattern: '^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|[xX])$',
210 200 message: '${title}格式不正确'
211 201 }]
212 202 },
213 203 {
214 204 title: '与户主的关系',
215 205 key: 'relation',
216   - width: '180px',
  206 + width: '120px',
217 207 type: FormTypes.input,
218 208 defaultValue: '',
219 209 placeholder: '请输入${title}',
... ... @@ -231,15 +221,15 @@ export default {
231 221 {
232 222 title: '现住址',
233 223 key: 'address',
234   - width: '180px',
  224 + width: '200px',
235 225 type: FormTypes.input_pop,
236 226 defaultValue: '',
237   - placeholder: '请输入${title}',
  227 + placeholder: '请输入${title}'
238 228 },
239 229 {
240 230 title: '是否犯罪',
241 231 key: 'crime',
242   - width: '200px',
  232 + width: '100px',
243 233 type: FormTypes.select,
244 234 options: [],
245 235 dictCode: 'is_crime',
... ... @@ -249,18 +239,18 @@ export default {
249 239 {
250 240 title: '犯罪原因',
251 241 key: 'reason',
252   - width: '250px',
  242 + width: '200px',
253 243 type: FormTypes.input_pop,
254 244 defaultValue: '',
255   - placeholder: '请输入${title}',
  245 + placeholder: '请输入${title}'
256 246 },
257 247 {
258 248 title: '其他参考信息',
259 249 key: 'other',
260   - width: '250px',
  250 + width: '200px',
261 251 type: FormTypes.input_pop,
262 252 defaultValue: '',
263   - placeholder: '请输入${title}',
  253 + placeholder: '请输入${title}'
264 254 }
265 255 ]
266 256 }
... ... @@ -283,17 +273,17 @@ export default {
283 273 this.modelDefault = JSON.parse(JSON.stringify(this.model))
284 274 },
285 275 methods: {
286   - getAgeByIdentity(identity){
287   - return GetAge(identity);
  276 + getAgeByIdentity(identity) {
  277 + return GetAge(identity)
288 278 },
289   - validateIdCard(rule,value,callback){
  279 + validateIdCard(rule, value, callback) {
290 280 console.log(value)
291   - if(undefined==value || null==value || ''==value){
292   - callback("请输入正确的公民身份号码!");
293   - }else if ( !value || new RegExp(/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{7}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}$)/).test(value)){
294   - callback();
295   - }else{
296   - callback("请输入正确的公民身份号码!");
  281 + if (undefined == value || null == value || '' == value) {
  282 + callback('请输入正确的公民身份号码!')
  283 + } else if (!value || new RegExp(/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{7}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}$)/).test(value)) {
  284 + callback()
  285 + } else {
  286 + callback('请输入正确的公民身份号码!')
297 287 }
298 288 },
299 289 // 获取所有的editableTable实例
... ... @@ -304,7 +294,7 @@ export default {
304 294 },
305 295  
306 296 add() {
307   - this.dataSource=[];
  297 + this.dataSource = []
308 298 // 默认新增一条数据
309 299 this.getAllTable().then(editableTables => {
310 300 editableTables[0].add()
... ... @@ -397,5 +387,48 @@ export default {
397 387 </script>
398 388  
399 389 <style scoped>
  390 +.ant-form-item {
  391 + margin-bottom: 10px;
  392 +}
  393 +</style>
  394 +
  395 +<style>
  396 +.main_table .input-table .thead {
  397 + overflow-y: auto;
  398 +}
400 399  
  400 +.main_table .input-table .thead .tr {
  401 + overflow-y: auto;
  402 +}
  403 +
  404 +.main_table .input-table .scroll-view {
  405 + overflow-y: auto;
  406 + scrollbar-width: thin;
  407 +}
  408 +
  409 +/* 设置滚动条的样式 */
  410 +.main_table .input-table .scroll-view::-webkit-scrollbar {
  411 + width: 10px;
  412 + height: 10px;
  413 +}
  414 +
  415 +/* 滚动槽 */
  416 +.main_table .input-table .scroll-view::-webkit-scrollbar-track {
  417 + background: #f5f5f5;
  418 +}
  419 +
  420 +/* 滚动条滑块 */
  421 +.main_table .input-table .scroll-view::-webkit-scrollbar-thumb {
  422 + background: #dedede;
  423 + -webkit-box-shadow: none;
  424 +}
  425 +
  426 +.main_table .ant-row-flex {
  427 + margin-top: -55px;
  428 + flex-flow: row-reverse;
  429 +}
  430 +
  431 +.main_table .ant-row-flex .action-button {
  432 + margin-bottom: 20px;
  433 +}
401 434 </style>
402 435 \ No newline at end of file
... ...