This commit is contained in:
shijingjing
2022-02-07 14:10:28 +08:00
parent 7db3fdaf00
commit 9390a6935d

View File

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