Files
dvcp_v2_wxcp_app/src/project/pingchang/AppCommunityManagement/Add.vue

345 lines
11 KiB
Vue
Raw Normal View History

2022-09-22 15:36:02 +08:00
<template>
<div class="Add">
<div class="item mar-b16">
<div class="label">
2022-09-26 10:51:06 +08:00
<span class="tips"></span>区域选择
2022-09-22 15:36:02 +08:00
</div>
<div class="value">
2022-09-26 10:51:06 +08:00
<AiAreaPicker v-model="form.areaId" :areaId="user.areaId" @select="areaSelect" :name.sync="form.areaName" style="color: #666" selectRoot>
2022-09-26 15:56:02 +08:00
<span style="margin-left: 4px" v-if="form.areaName">{{ form.areaName }}</span>
2022-09-22 15:36:02 +08:00
<span v-else class="color-999">请选择</span>
<u-icon name="arrow-right" color="#999" size="16" style="margin-left: 4px" />
</AiAreaPicker>
</div>
</div>
<div class="info mar-b16">
<div class="item solid">
<div class="label">
<span class="tips">*</span>管控对象
</div>
2022-09-26 15:56:02 +08:00
<div class="value color-999">{{form.name}}</div>
2022-09-22 15:36:02 +08:00
</div>
<div class="item solid">
<div class="label">
<span class="tips">*</span>手机号
</div>
2022-09-26 15:56:02 +08:00
<div class="value color-999">{{form.phone}}</div>
2022-09-22 15:36:02 +08:00
</div>
<div class="item solid">
<div class="label">
<span class="tips">*</span>身份证号
</div>
2022-09-26 15:56:02 +08:00
<div class="value color-999">{{form.idNumber}}</div>
2022-09-22 15:36:02 +08:00
</div>
<div class="item solid">
<div class="label">
<span class="tips">*</span>居家状态
</div>
2022-09-26 10:51:06 +08:00
<div class="value" @click="dictSelectClick('EP_homeStatus2', 'homeStatus')">
<span :class="form.homeStatus === '' ? 'color-999' : ''">{{ $dict.getLabel('EP_homeStatus2', form.homeStatus) || '请选择'}}</span>
2022-09-22 15:36:02 +08:00
<u-icon name="arrow-right" color="#999" size="16" style="margin-left: 4px" />
</div>
</div>
<div class="item solid">
<div class="label">
<span class="tips">*</span>隔离时间
</div>
2022-09-26 10:51:06 +08:00
<div class="value" @click="showDateSelect=true">
<span class="color-999" v-if="!form.quarantineBeginTime">请选择</span>
<span v-else>{{form.quarantineBeginTime}}{{form.quarantineEndTime}}</span>
2022-09-22 15:36:02 +08:00
<u-icon name="arrow-right" color="#999" size="16" style="margin-left: 4px" />
</div>
</div>
<div class="item">
<div class="label">
<span class="tips">*</span>隔离策略
</div>
2022-09-26 10:51:06 +08:00
<div class="value" @click="dictSelectClick('EP_quarantineStrategy', 'quarantineStrategy')">
<span :class="form.quarantineStrategy === '' ? 'color-999' : ''">{{ $dict.getLabel('EP_quarantineStrategy', form.quarantineStrategy) || '请选择'}}</span>
2022-09-22 15:36:02 +08:00
<u-icon name="arrow-right" color="#999" size="16" style="margin-left: 4px" />
</div>
</div>
</div>
<div class="info mar-b16">
<div class="item solid">
<div class="label">
<span class="tips">*</span>管控人
</div>
2022-09-26 10:51:06 +08:00
<div class="value">
2022-09-27 14:56:05 +08:00
<AiPagePicker type="sysUser" single :selected.sync="form.controllerList" action="/app/wxcp/wxuser/list?status=1" nodeKey="id" @select="handleSelectUser">
<span style="margin-left: 4px" v-if="form.controllerList && form.controllerList.length">{{ form.controllerList[0].name }}</span>
<span v-else class="color-999">请选择</span>
<u-icon name="arrow-right" color="#999" size="16" style="margin-left: 4px" />
</AiPagePicker>
<!-- <u-input placeholder="请输入" input-align="right" height="32" maxlength="6" v-model="form.controllerUserName" :custom-style="{'font-size': '17px'}" /> -->
2022-09-26 10:51:06 +08:00
</div>
2022-09-22 15:36:02 +08:00
</div>
<div class="item solid">
<div class="label">
<span class="tips">*</span>联系方式
</div>
2022-09-26 10:51:06 +08:00
<div class="value">
2022-09-26 15:56:02 +08:00
<u-input placeholder="请输入" type="number" input-align="right" height="32" maxlength="11" v-model="form.controllerUserPhone" :custom-style="{'font-size': '17px'}" />
2022-09-26 10:51:06 +08:00
</div>
2022-09-22 15:36:02 +08:00
</div>
<div class="item">
<div class="label">
2022-09-26 10:51:06 +08:00
<span class="tips"></span>管控内容
2022-09-22 15:36:02 +08:00
</div>
</div>
2022-09-26 15:56:02 +08:00
<div class="item-textarea">
2022-09-26 16:40:23 +08:00
<u-input v-model="form.controllerContent" type="textarea" placeholder="请输入详细描述信息" height="200" :custom-style="{'font-size': '17px'}" maxlength="500" />
2022-09-26 15:56:02 +08:00
</div>
2022-09-22 15:36:02 +08:00
</div>
2022-10-09 10:32:31 +08:00
<div class="info mar-b16" style="padding-bottom: 24px;">
2022-09-22 15:36:02 +08:00
<div class="item">
<div class="label">
<span class="tips">*</span>图片
</div>
</div>
2022-09-27 17:30:32 +08:00
<div style="padding-right: 16px;">
2022-09-26 10:51:06 +08:00
<AiUploader :def.sync="form.fileList" multiple placeholder="上传图片" :limit="9" action="/admin/file/add2"></AiUploader>
2022-09-22 15:36:02 +08:00
</div>
</div>
2022-10-09 10:32:31 +08:00
<div class="info" style="padding-bottom: 24px;">
<div class="item">
<div class="label" style="width:100%;">
<span class="tips">*</span>核酸阴性证明图片解除管理必填
</div>
</div>
<div style="padding-right: 16px;">
<AiUploader :def.sync="form.proveFileList" multiple placeholder="上传核酸阴性证明" :limit="9" action="/admin/file/add2"></AiUploader>
</div>
</div>
2022-09-22 15:36:02 +08:00
<div class="btn-height"></div>
<div class="footer">
2022-09-26 10:51:06 +08:00
<div class="cancel" @click="submit('2')">解除管理</div>
2022-09-29 10:10:47 +08:00
<div class="confirm" @click="submit('1')">保存</div>
2022-09-22 15:36:02 +08:00
</div>
2022-09-26 10:51:06 +08:00
<u-calendar v-model="showDateSelect" mode="range" min-year="2020" max-date="2050-12-31" @change="dateConfirm"></u-calendar>
<u-select v-model="showDictSelect" :list="$dict.getDict(selectDictName)" label-name="dictName" value-name="dictValue" @confirm="dictConfirm"></u-select>
2022-09-22 15:36:02 +08:00
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
data() {
return {
areaId: '',
areaName: '',
2022-09-26 10:51:06 +08:00
files: [],
id: '',
form: {
homeStatus: '',
quarantineBeginTime: '',
2022-09-27 14:56:05 +08:00
quarantineStrategy: '',
2022-10-09 10:32:31 +08:00
controllerList: [],
proveFileList: []
2022-09-26 10:51:06 +08:00
},
showDateSelect: false,
showDictSelect: false,
selectDictName: '',
selectFormName: '',
2022-09-22 15:36:02 +08:00
}
},
computed: {
...mapState(['user']),
},
2022-09-26 10:51:06 +08:00
onLoad(option) {
this.id = option.id
this.$dict.load('EP_homeStatus2', 'EP_quarantineStrategy').then(() => {
this.id = option.id
this.getDetail()
})
2022-09-22 15:36:02 +08:00
},
onShow() {
2022-09-26 10:51:06 +08:00
document.title = '排查管理'
2022-09-22 15:36:02 +08:00
},
methods: {
2022-09-26 10:51:06 +08:00
submit(status) {
if(this.form.homeStatus === '') {
return this.$u.toast('请选择居家状态')
}
if(!this.form.quarantineBeginTime) {
return this.$u.toast('请选择隔离时间')
}
if(this.form.quarantineStrategy === '') {
return this.$u.toast('请选择隔离策略')
}
if(!this.form.controllerUserName) {
return this.$u.toast('请输入管控人姓名')
}
if(!this.form.controllerUserPhone) {
return this.$u.toast('请输入联系方式')
}
if(this.form.controllerUserPhone && !/^1[0-9]{10,10}$/.test(this.form.controllerUserPhone)) {
return this.$u.toast("请输入正确的手机号码");
}
if( !this.form.fileList.length) {
return this.$u.toast('请上传图片')
}
2022-10-09 10:32:31 +08:00
if(status == 1 && !this.form.proveFileList.length) {
return this.$u.toast('请上传核酸阴性证明图片')
}
2022-09-28 10:34:16 +08:00
this.$confirm(status == 2 ? '确认解除管理该记录' : '确认保存该记录').then(() => {
this.confirmSubmit(status)
})
},
confirmSubmit(status) {
2022-09-26 10:51:06 +08:00
this.form.status = status
this.form.id = this.id
2022-09-26 15:56:02 +08:00
this.$http.post(`/app/appepidemicpreventioncommunitymanagement/troubleshooting`, this.form).then((res) => {
2022-09-26 10:51:06 +08:00
if (res.code == 0) {
this.$u.toast('提交成功')
uni.$emit('updateDetail')
uni.$emit('updateList')
uni.navigateBack()
}
})
},
getDetail() {
this.$http.post(`/app/appepidemicpreventioncommunitymanagement/queryDetailById?id=${this.id}`).then((res) => {
if (res.code == 0) {
2022-09-27 14:56:05 +08:00
this.form = {...res.data}
this.form.controllerList = []
2022-09-28 10:34:16 +08:00
if(!this.form.controllerUserName) {
this.form.controllerUserName = this.user.name
this.form.controllerUserId = this.user.id
this.form.controllerUserPhone = this.user.phone
}
var info = {
name: this.form.controllerUserName,
id: this.form.controllerUserId,
mobile: this.form.controllerUserPhone
2022-09-27 14:56:05 +08:00
}
2022-09-28 09:35:30 +08:00
this.form.controllerList.push(info)
2022-09-26 15:56:02 +08:00
if(this.form.homeStatus === null) {
this.form.homeStatus = ''
}
2022-09-26 10:51:06 +08:00
}
})
},
dateConfirm(e) {
this.form.quarantineBeginTime = e.startDate
this.form.quarantineEndTime = e.endDate
},
dictSelectClick(dictName, formName) {
this.selectDictName = dictName
this.selectFormName = formName
this.showDictSelect = true
},
dictConfirm(e) {
this.form[this.selectFormName] = e[0].value
},
2022-09-22 15:36:02 +08:00
areaSelect(e) {
2022-09-26 10:51:06 +08:00
this.form.areaId = e
2022-09-22 15:36:02 +08:00
},
2022-09-27 14:56:05 +08:00
handleSelectUser(e) {
console.log(e)
this.form.controllerUserPhone = e[0].mobile
2022-09-27 17:28:30 +08:00
this.form.controllerUserName = e[0].name
2022-09-27 14:56:05 +08:00
this.form.controllerUserId = e[0].id
}
2022-09-22 15:36:02 +08:00
},
}
</script>
<style scoped lang="scss">
.Add {
background-color: #F3F6F9;
padding-top: 16px;
2022-09-27 14:56:05 +08:00
overflow-x: hidden;
2022-09-22 15:36:02 +08:00
.item {
2022-09-26 15:56:02 +08:00
width: 100%;
2022-09-22 15:36:02 +08:00
background-color: #fff;
display: flex;
padding: 40px 0 40px 32px;
.label {
width: 200px;
line-height: 48px;
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 34px;
color: #666;
.tips {
display: inline-block;
font-family: PingFangSC-Medium;
font-weight: 700;
font-size: 34px;
color: #F46;
margin-right: 8px;
vertical-align: text-top;
}
}
.value {
width: calc(100% - 200px);
padding-right: 32px;
text-align: right;
font-family: PingFangSC-Regular;
font-size: 34px;
color: #333;
}
2022-09-26 15:56:02 +08:00
.color-999 {
color: #999;
2022-09-22 15:36:02 +08:00
}
}
2022-09-26 15:56:02 +08:00
.item-textarea {
2022-09-22 15:36:02 +08:00
width: calc(100% - 32px);
}
.info {
padding-left: 32px;
background-color: #fff;
.item {
padding-left: 0;
}
.solid {
border-bottom: 1px solid #ddd;
box-sizing: border-box;
}
}
.mar-b16 {
margin-bottom: 16px;
}
.btn-height{
height: 130px;
}
.footer {
width: 100%;
height: 128px;
background: #FFF;
box-shadow: inset 0 0 0 0 #D4D4D4;
padding: 24px 32px;
box-sizing: border-box;
display: flex;
2022-09-22 16:10:43 +08:00
position: fixed;
bottom: 0;
2022-09-22 15:36:02 +08:00
div {
flex: 1;
height: 80px;
line-height: 80px;
background: #FFF;
border-radius: 8px;
font-family: PingFangSC-Regular;
font-size: 32px;
text-align: center;
}
.cancel {
color: #f46;
line-height: 76px;
border: 1px solid #CCCCCC;
box-sizing: border-box;
margin-right: 32px;
}
.confirm {
background-color: #1365DD;
color: #fff;
}
}
}
</style>