宣传资讯
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<el-form-item label="户主姓名" prop="name">
|
||||
<!-- <el-input v-model="form.name" placeholder="请输入姓名" maxlength="20" show-word-limit
|
||||
:disabled="isEdit"/> -->
|
||||
<el-input size="small" class="user-selecter" v-model="form.name" placeholder="请输入姓名" clearable :disabled="isEdit">
|
||||
<el-input size="small" class="user-selecter" v-model="form.name" placeholder="请输入姓名" clearable :disabled="isEdit || isSelectUser">
|
||||
<template slot="append">
|
||||
<ai-person-select :instance="instance" @selectPerson="checkName">
|
||||
</ai-person-select>
|
||||
@@ -19,7 +19,7 @@
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="身份证号" prop="idNumber">
|
||||
<el-input v-model="form.idNumber" placeholder="请输入身份证号" :maxlength="18" :disabled="isEdit"
|
||||
<el-input v-model="form.idNumber" placeholder="请输入身份证号" :maxlength="18" :disabled="isEdit || isSelectUser"
|
||||
@change="handleIdNumberAutocomplete"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别" prop="sex">
|
||||
@@ -73,8 +73,8 @@
|
||||
<ai-select v-model="form.specialPovertySupport" :selectList="dict.getDict('fpYesOrNo')"/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-form-item label="健康状况" prop="healthyStatus">
|
||||
<el-checkbox-group v-model="form.healthyStatus">
|
||||
<el-form-item label="健康状况" prop="healthyStatusList">
|
||||
<el-checkbox-group v-model="form.healthyStatusList">
|
||||
<el-checkbox :label="item.dictValue" v-for="(item, index) in dict.getDict('fpHealth')" :key="index">{{item.dictName}}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
@@ -127,19 +127,19 @@
|
||||
|
||||
<ai-card title="情况描述">
|
||||
<template slot="content">
|
||||
<el-form-item label="风险因素" prop="sex">
|
||||
<ai-select v-model="form.sex" :selectList="dict.getDict('sex')" disabled/>
|
||||
<el-form-item label="风险因素" prop="riskType">
|
||||
<ai-select v-model="form.riskType" :selectList="dict.getDict('fpRiskType')"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注说明" prop="currentAreaId">
|
||||
<el-form-item prop="currentAddress">
|
||||
<el-input v-model="form.currentAddress" placeholder="备注说明" maxlength="500" show-word-limit clearable type="textarea" />
|
||||
<el-form-item label="备注说明">
|
||||
<el-form-item>
|
||||
<el-input v-model="form.detail" placeholder="备注说明" maxlength="500" show-word-limit clearable type="textarea" />
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<el-form-item label="图片(最多9张)" >
|
||||
<ai-uploader
|
||||
:isShowTip="true"
|
||||
:instance="instance"
|
||||
v-model="form.file"
|
||||
v-model="form.files"
|
||||
fileType="img"
|
||||
acceptType=".png,.jpg,.jpeg"
|
||||
:limit="9">
|
||||
@@ -257,6 +257,7 @@ export default {
|
||||
isHousehold: [{required: true, message: "请选择是否户主"}],
|
||||
householdRelation: [{required: true, message: "请选择与户主关系"}],
|
||||
householdIdNumber: [{required: true, message: "请选择户主身份证号"}],
|
||||
riskType: [{required: true, message: "请选择风险因素"}],
|
||||
}
|
||||
},
|
||||
rootArea() {
|
||||
@@ -267,17 +268,32 @@ export default {
|
||||
return {
|
||||
form: {
|
||||
householdRelation: "",
|
||||
healthyStatus: [],
|
||||
file: []
|
||||
healthyStatus: '',
|
||||
healthyStatusList: [],
|
||||
file: [],
|
||||
},
|
||||
isSelectUser: false, //是否选择人员
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
checkName(e) {
|
||||
// this.formData.name = e.name
|
||||
// this.formData.idNumber = e.idNumber
|
||||
// this.formData.phone = e.phone
|
||||
// this.formData.areaId = e.householdAreaId
|
||||
if(!e) {
|
||||
this.isSelectUser = false
|
||||
this.form.name = ''
|
||||
this.form.idNumber = ''
|
||||
this.form.phone =''
|
||||
this.form.areaId = ''
|
||||
this.form.birthDate = ''
|
||||
this.form.sex = ''
|
||||
this.form.age = ''
|
||||
return
|
||||
}
|
||||
this.form.name = e.name
|
||||
this.form.idNumber = e.idNumber
|
||||
this.form.phone = e.phone
|
||||
this.form.areaId = e.householdAreaId
|
||||
this.handleIdNumberAutocomplete(e.idNumber)
|
||||
this.isSelectUser = true
|
||||
},
|
||||
back() {
|
||||
this.$router.push({})
|
||||
@@ -299,8 +315,8 @@ export default {
|
||||
submit() {
|
||||
this.$refs.ruleForm.validate(v => {
|
||||
if (v) {
|
||||
if (this.form.isHousehold == 1) {
|
||||
this.form.householdIdNumber = this.form.idNumber
|
||||
if (this.form.healthyStatusList.length) {
|
||||
this.form.healthyStatus = this.form.healthyStatusList.join(',')
|
||||
}
|
||||
this.instance.post(`/app/apppreventionreturntopoverty/addOrUpdate`, this.form).then(res => {
|
||||
if (res.code == 0) {
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
<ai-search-bar>
|
||||
<template #left>
|
||||
<ai-select placeholder="档案状态" v-model="search.status" :selectList="dict.getDict('fpPrtpStatus')" @change="page.current=1,getTableData()"/>
|
||||
<ai-select placeholder="监测对象类型" v-model="search.status" :selectList="dict.getDict('fpPrtpStatus')" @change="page.current=1,getTableData()"/>
|
||||
<ai-select placeholder="风险因素" v-model="search.status" :selectList="dict.getDict('fpPrtpStatus')" @change="page.current=1,getTableData()"/>
|
||||
<ai-select placeholder="监测对象类型" v-model="search.objectType" :selectList="dict.getDict('fpType')" @change="page.current=1,getTableData()"/>
|
||||
<ai-select placeholder="风险因素" v-model="search.riskType" :selectList="dict.getDict('fpRiskType')" @change="page.current=1,getTableData()"/>
|
||||
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.birthStart" type="date" size="small"
|
||||
unlink-panels placeholder="选择出生开始日期" @change="page.current=1,getTableData()" />
|
||||
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.birthEnd" type="date" size="small" placeholder="选择出生结束日期"
|
||||
@@ -87,7 +87,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
search: {name: ""},
|
||||
search: {name: '', objectType: '', riskType: '',isHousehold: 1},
|
||||
page: {current: 1, size: 10, total: 0},
|
||||
tableData: [],
|
||||
colConfigs: [
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<el-form-item label="发布地区" prop="areaId">
|
||||
<ai-area-get :instance="instance" v-model="form.areaId" :root="rootArea" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文章类型" prop="moduleId" style="width:50%;">
|
||||
<el-form-item label="文章类型" prop="moduleId" style="width:50%;" v-if="miniTypeList.length">
|
||||
<ai-select v-model="form.moduleId" :selectList="miniTypeList" @change="getNewTypeList"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类" prop="categoryId" style="width:50%;">
|
||||
@@ -106,7 +106,7 @@ export default {
|
||||
files: []
|
||||
},
|
||||
miniTypeList: [],
|
||||
newTypeList: []
|
||||
newTypeList: [],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -161,17 +161,14 @@ export default {
|
||||
},
|
||||
getDetail() {
|
||||
let {id} = this.$route.query
|
||||
if(!id) {
|
||||
return
|
||||
}
|
||||
id && this.instance.post("/app/apppreventionreturntopoverty/queryDetailById", null, {
|
||||
id && this.instance.post("/app/apppublicityinfo/queryDetailById", null, {
|
||||
params: {id}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
if(res.data.pictureUrl) {
|
||||
res.data.pictureUrlList = [{url: res.data.pictureUrl}]
|
||||
}
|
||||
this.form = res.data
|
||||
this.form = {...res.data}
|
||||
this.getNewTypeList()
|
||||
}
|
||||
})
|
||||
@@ -180,29 +177,35 @@ export default {
|
||||
let {parentId} = this.$route.query
|
||||
this.instance.post(`/app/apppublicitycategory/list?categoryType=1&size=100&parentId=${parentId}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
res.data.records.map((item) => {
|
||||
item.dictName = item.categoryName
|
||||
item.dictValue = item.id
|
||||
this.miniTypeList = res.data.records.map((item) => {
|
||||
return {
|
||||
dictName: item.categoryName,
|
||||
dictValue: item.id
|
||||
}
|
||||
})
|
||||
this.miniTypeList = res.data.records
|
||||
console.log(this.miniTypeList)
|
||||
if(this.$route.query.id) {
|
||||
this.getDetail()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
getNewTypeList() {
|
||||
this.instance.post(`/app/apppublicitycategory/list?categoryType=2&size=100&parentId=${this.form.moduleId}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
res.data.records.map((item) => {
|
||||
item.dictName = item.categoryName
|
||||
item.dictValue = item.id
|
||||
res.data.records
|
||||
this.newTypeList = res.data.records.map((item) => {
|
||||
return {
|
||||
dictName: item.categoryName,
|
||||
dictValue: item.id
|
||||
}
|
||||
})
|
||||
this.newTypeList = res.data.records
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getTypeList()
|
||||
this.getDetail()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
@selection-change="v=>ids=v.map(e=>e.id)">
|
||||
<el-table-column slot="options" label="操作" fixed="right" align="center" width='150px'>
|
||||
<template slot-scope="{row}">
|
||||
<el-button type="text" @click="showDetail(row.id)">编辑</el-button>
|
||||
<el-button type="text" @click="showEdit(row.id)">编辑</el-button>
|
||||
<el-button type="text" @click="handleDelete(row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -130,7 +130,7 @@ export default {
|
||||
methods: {
|
||||
getTableData() {
|
||||
this.instance.post("/app/apppublicityinfo/list", null, {
|
||||
params: {...this.page, ...this.search}
|
||||
params: {...this.page, ...this.search, moduleId: this.miniTypeList[this.miniTypeIndex].id || ''}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.tableData = res.data?.records
|
||||
@@ -139,7 +139,7 @@ export default {
|
||||
})
|
||||
},
|
||||
showEdit(id) {
|
||||
this.$router.push({query: {id: id, parentId: this.typeList[this.typeIndex].id}, hash: "#add"})
|
||||
this.$router.push({query: {id: id, parentId: this.typeList[this.typeIndex].id, moduleId: this.miniTypeList[this.miniTypeIndex].id}, hash: "#add"})
|
||||
},
|
||||
handleDelete(ids) {
|
||||
this.$confirm("是否删除该条宣传资讯信息").then(() => {
|
||||
@@ -197,6 +197,10 @@ export default {
|
||||
this.instance.post(`/app/apppublicitycategory/list?categoryType=1&size=100&parentId=${parentId}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.miniTypeList = res.data.records
|
||||
if(res.data.records && res.data.records.length) {
|
||||
this.miniTypeClick(0)
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -214,6 +218,9 @@ export default {
|
||||
},
|
||||
miniTypeClick(e) {
|
||||
this.miniTypeIndex = e
|
||||
this.current = 1
|
||||
this.tableData = []
|
||||
this.getTableData()
|
||||
},
|
||||
editMini(index) {
|
||||
this.form = {...this.miniTypeList[index]}
|
||||
|
||||
Reference in New Issue
Block a user