add
This commit is contained in:
@@ -55,7 +55,7 @@
|
|||||||
<div class="value">
|
<div class="value">
|
||||||
<AiAreaPicker v-model="form.areaId" :areaId="user.areaId" @select="areaSelect" :name.sync="form.areaName">
|
<AiAreaPicker v-model="form.areaId" :areaId="user.areaId" @select="areaSelect" :name.sync="form.areaName">
|
||||||
<span class="label" v-if="form.areaName">{{ form.areaName }}</span>
|
<span class="label" v-if="form.areaName">{{ form.areaName }}</span>
|
||||||
<span v-else>请选择</span>
|
<span v-else :class="form.areaName === '' ? 'color-999' : ''">请选择</span>
|
||||||
<u-icon name="arrow-right" color="#666" size="24" style="margin-left:4px;"/>
|
<u-icon name="arrow-right" color="#666" size="24" style="margin-left:4px;"/>
|
||||||
</AiAreaPicker>
|
</AiAreaPicker>
|
||||||
</div>
|
</div>
|
||||||
@@ -69,10 +69,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<span class="label"><span class="tips">*</span>所属网格</span>
|
<span class="label"><span class="tips">*</span>所属网格</span>
|
||||||
<div class="value">
|
<div class="value" @click="showGird=true">
|
||||||
<u-input type="text" placeholder="请输入" disabled v-model="form.girdName" input-align="right"
|
<span
|
||||||
placeholder-style="color:#999;font-size:16px;" height="48" :clearable="false"
|
:class="form.girdName === '' ? 'color-999' : ''">{{
|
||||||
@click="showGird=true"/>
|
$dict.getLabel('appSpecialTypeFive', form.girdName) || '请选择'
|
||||||
|
}}</span>
|
||||||
|
<u-icon name="arrow-right" color="#cccccc" size="14"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="this.form.userType != ''">
|
<div v-if="this.form.userType != ''">
|
||||||
@@ -111,7 +113,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer" @click="submit">
|
<div class="footer" @click="submit">
|
||||||
<div class="btn">保存</div>
|
<div class="btn">{{ isEdit? '保存' : '提交'}}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<u-picker mode="time" v-model="dateShow" :params="deteParams" start-year="2010" @confirm="dateConfirm">请选择
|
<u-picker mode="time" v-model="dateShow" :params="deteParams" start-year="2010" @confirm="dateConfirm">请选择
|
||||||
@@ -294,7 +296,7 @@ export default {
|
|||||||
{
|
{
|
||||||
label: '有无犯罪史',
|
label: '有无犯罪史',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
dict: 'houselivingStatus',
|
dict: 'isReflection',
|
||||||
formDbName: 'crime'
|
formDbName: 'crime'
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@@ -304,7 +306,7 @@ export default {
|
|||||||
{
|
{
|
||||||
label: '是否累犯',
|
label: '是否累犯',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
dict: 'houselivingStatus',
|
dict: 'yesOrNo',
|
||||||
formDbName: 'isSecond'
|
formDbName: 'isSecond'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -349,7 +351,7 @@ export default {
|
|||||||
{
|
{
|
||||||
label: '是否重新犯罪',
|
label: '是否重新犯罪',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
dict: 'houselivingStatus',
|
dict: 'yesOrNo',
|
||||||
formDbName: 'isRepeat'
|
formDbName: 'isRepeat'
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@@ -359,31 +361,37 @@ export default {
|
|||||||
id: "",
|
id: "",
|
||||||
index: "",
|
index: "",
|
||||||
showGird: false,
|
showGird: false,
|
||||||
girdlist: []
|
girdlist: [],
|
||||||
|
isEdit: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['user']),
|
...mapState(['user']),
|
||||||
|
|
||||||
},
|
},
|
||||||
onLoad(o) {
|
onLoad(o) {
|
||||||
// console.log(o);
|
|
||||||
this.$dict.load('appSpecialSituation', 'appSpecialPlacement', 'appSpecialDenger', 'appSpecialCrime',
|
this.$dict.load('appSpecialSituation', 'appSpecialPlacement', 'appSpecialDenger', 'appSpecialCrime',
|
||||||
'appSpecialControl', 'appSpecialDebug', 'appSpecialDrug', 'appSpecialChangeType', 'appSpecialCure', 'appSpecialDengerLevel',
|
'appSpecialControl', 'appSpecialDebug', 'appSpecialDrug', 'appSpecialChangeType', 'appSpecialCure', 'appSpecialDengerLevel',
|
||||||
'appSpecialDisableLevel', 'appSpecialDisableType', 'appSpecialHealth', 'appSpecialMarriage', 'appSpecialTypeFive').then(() => {
|
'appSpecialDisableLevel', 'appSpecialDisableType', 'appSpecialHealth', 'appSpecialMarriage', 'appSpecialTypeFive','isReflection','yesOrNo').then(() => {
|
||||||
}),
|
}),
|
||||||
this.gridName()
|
this.gridName()
|
||||||
if (o) {
|
if (o) {
|
||||||
|
this.isEdit = true
|
||||||
this.id = o.id
|
this.id = o.id
|
||||||
this.index = o.index
|
this.index = o.index
|
||||||
this.getDetail()
|
this.getDetail()
|
||||||
}
|
}
|
||||||
|
if (!o.id) {
|
||||||
|
this.isEdit = false
|
||||||
|
this.getDetail()
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
document.title = '新增人员'
|
document.title = '新增人员'
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
getDetail() {
|
getDetail() {
|
||||||
if (!this.id) return
|
if (!this.id) return
|
||||||
var urlList = ['app/appspecialdisabled/queryDetailById', 'app/appspecialmental/queryDetailById', 'app/appspecialadjustment/queryDetailById',
|
var urlList = ['app/appspecialdisabled/queryDetailById', 'app/appspecialmental/queryDetailById', 'app/appspecialadjustment/queryDetailById',
|
||||||
@@ -393,46 +401,44 @@ export default {
|
|||||||
params: {
|
params: {
|
||||||
id: this.id
|
id: this.id
|
||||||
}
|
}
|
||||||
}).then(({res}) => {
|
}).then((res) => {
|
||||||
console.log(res);
|
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.form = res
|
this.form.userType = this.index
|
||||||
// this.form.userType = this.index
|
this.form.name = res.data.name
|
||||||
// this.form.name = res.data.name
|
this.form.idNumber = res.data.idNumber
|
||||||
// this.form.idNumber = res.data.idNumber
|
this.form.gender=res.data.gender,
|
||||||
// this.form.gender=res.data.gender,
|
this.form.birth=res.data.birth,
|
||||||
// this.form.birth=res.data.birth,
|
this.form.phone=res.data.phone,
|
||||||
// this.form.phone=res.data.phone,
|
this.form.areaName=res.data.areaName,
|
||||||
// this.form.areaName=res.data.areaName,
|
this.form.address=res.data.address,
|
||||||
// this.form.address=res.data.address,
|
this.form.girdName=res.data.girdName,
|
||||||
// this.form.girdName=res.data.girdName,
|
this.form.areaId=res.data.areaId,
|
||||||
// this.form.areaId=res.data.areaId,
|
this.form.income=res.data.income,
|
||||||
// this.form.income=res.data.income,
|
this.form.marriage = res.data.marriage,
|
||||||
// this.form.marriage = res.data.marriage,
|
this.form.health = res.data.health
|
||||||
// this.form.health = res.data.health
|
this.form.type = res.data.type
|
||||||
// this.form.type = res.data.type
|
this.form.level= res.data.level
|
||||||
// this.form.level= res.data.level
|
this.form.sickTime= res.data.sickTime
|
||||||
// this.form.sickTime= res.data.sickTime
|
this.form.helpName= res.data.helpName
|
||||||
// this.form.helpName= res.data.helpName
|
this.form.helpPhone= res.data.helpPhone
|
||||||
// this.form.helpPhone= res.data.helpPhone
|
this.form.crime= res.data.crime
|
||||||
// this.form.crime= res.data.crime
|
this.form.startTime= res.data.startTime
|
||||||
// this.form.startTime= res.data.startTime
|
this.form.endTime= res.data.endTime
|
||||||
// this.form.endTime= res.data.endTime
|
this.form.isCreateGroup= res.data.isCreateGroup
|
||||||
// this.form.isCreateGroup= res.data.isCreateGroup
|
this.form.isRelease= res.data.isRelease
|
||||||
// this.form.isRelease= res.data.isRelease
|
this.form.firstTime= res.data.firstTime
|
||||||
// this.form.firstTime= res.data.firstTime
|
this.form.status= res.data.status
|
||||||
// this.form.status= res.data.status
|
this.form.debug= res.data.debug
|
||||||
// this.form.debug= res.data.debug
|
this.form.control= res.data.control
|
||||||
// this.form.control= res.data.control
|
this.form.controlName= res.data.controlName
|
||||||
// this.form.controlName= res.data.controlName
|
this.form.controlPhone= res.data.controlPhone
|
||||||
// this.form.controlPhone= res.data.controlPhone
|
this.form.isSecond= res.data.isSecond
|
||||||
// this.form.isSecond= res.data.isSecond
|
this.form.place= res.data.place
|
||||||
// this.form.= res.data.
|
this.form.denger= res.data.denger
|
||||||
// this.form.= res.data.
|
this.form.placement= res.data.placement
|
||||||
// this.form.= res.data.
|
this.form.situation= res.data.situation
|
||||||
// this.form.= res.data.
|
this.form.situationTime= res.data.situationTime
|
||||||
// this.form.= res.data.
|
this.form.isRepeat= res.data.isRepeat
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -458,13 +464,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
confirmGirdSelect(e) {
|
confirmGirdSelect(e) {
|
||||||
|
console.log(e)
|
||||||
this.form.girdId = e[0].value
|
this.form.girdId = e[0].value
|
||||||
this.form.girdName = e[0].label
|
this.form.girdName = e[0].label
|
||||||
},
|
},
|
||||||
|
|
||||||
gridName() {
|
gridName() {
|
||||||
this.$http.post('app/appgirdmemberinfo/queryMyGirdListByLevel2AndUser').then(res => {
|
this.$http.post('app/appgirdmemberinfo/queryMyGirdListByLevel2AndUser').then(res => {
|
||||||
console.log(res);
|
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
var list = []
|
var list = []
|
||||||
res.data.map((e, index) => {
|
res.data.map((e, index) => {
|
||||||
@@ -501,15 +507,19 @@ export default {
|
|||||||
var urlList = ['app/appspecialdisabled/addOrUpdate', 'app/appspecialmental/addOrUpdate', 'app/appspecialadjustment/addOrUpdate',
|
var urlList = ['app/appspecialdisabled/addOrUpdate', 'app/appspecialmental/addOrUpdate', 'app/appspecialadjustment/addOrUpdate',
|
||||||
'app/appspecialdrug/addOrUpdate', 'app/appspecialprison/addOrUpdate']
|
'app/appspecialdrug/addOrUpdate', 'app/appspecialprison/addOrUpdate']
|
||||||
|
|
||||||
this.$http.post(urlList[this.form.userType], {...this.form}).then(res => {
|
this.$http.post(urlList[this.form.userType], {
|
||||||
|
...this.form,
|
||||||
|
id: this.isEdit ? this.id : ''
|
||||||
|
}).then(res => {
|
||||||
if(res.code == 0) {
|
if(res.code == 0) {
|
||||||
this.$u.toast('信息保存成功')
|
this.$u.toast(this.isEdit ? '信息保存成功' : '信息提交成功')
|
||||||
uni.$emit('specialPeopleList')
|
uni.$emit('specialPeopleList')
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}, 600)
|
}, 600)
|
||||||
|
this.isEdit = !this.isEdit
|
||||||
} else if(res.code == 1) {
|
} else if(res.code == 1) {
|
||||||
this.$u.toast('保存失败,信息未填写')
|
this.$u.toast('保存失败,信息未填写')
|
||||||
} else {
|
} else {
|
||||||
this.$confirm('是否放弃编辑当前信息').then(()=>{
|
this.$confirm('是否放弃编辑当前信息').then(()=>{
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
|
|||||||
Reference in New Issue
Block a user