|
@@ -142,12 +142,12 @@
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="身份证号" prop="sfzid">
|
|
|
- <el-input v-model="form.sfzid" type="number" placeholder="请输入身份证号" class="inp" />
|
|
|
+ <el-input v-model.number="form.sfzid" placeholder="请输入身份证号" class="inp" type="number" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="电话1" prop="telOne">
|
|
|
- <el-input v-model="form.telOne" type="number" placeholder="请输入电话1" class="inp" />
|
|
|
+ <el-input v-model.number="form.telOne" placeholder="请输入电话1" class="inp" type="number" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -208,7 +208,7 @@
|
|
|
<el-col>
|
|
|
<el-form-item label="客户类别" prop="clientType">
|
|
|
<el-radio-group v-model="form.clientType">
|
|
|
- <el-radio v-for="item in userType" :label="item.dictValue">{{ item.dictLabel }}</el-radio>
|
|
|
+ <el-radio v-for="item in userType" :label="item.dictSort">{{ item.dictLabel }}</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -217,7 +217,7 @@
|
|
|
<el-col>
|
|
|
<el-form-item label="居住情况" prop="liveStatus">
|
|
|
<el-radio-group v-model="form.liveStatus">
|
|
|
- <el-radio v-for="item in liveStatus" :label="item.dictValue">{{ item.dictLabel }}</el-radio>
|
|
|
+ <el-radio v-for="item in liveStatus" :label="item.dictSort">{{ item.dictLabel }}</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -308,7 +308,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="服务类型" prop="serviceType">
|
|
|
+ <el-form-item label="服务状态" prop="serviceType">
|
|
|
<el-select v-model="form.serviceType" class="inp">
|
|
|
<el-option v-for="i in serviceType" :key="i.dictValue" :value="i.dictValue"
|
|
|
:label="i.dictLabel"></el-option>
|
|
@@ -347,7 +347,7 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-form-item label="慢性疾病" prop="slowIllness">
|
|
|
- <el-checkbox-group v-model="checked">
|
|
|
+ <el-checkbox-group v-model="form.checked">
|
|
|
<el-checkbox v-for="i in slowIllness" :key="i.dictValue" :label="i.dictValue">{{ i.dictLabel }}</el-checkbox>
|
|
|
</el-checkbox-group>
|
|
|
</el-form-item>
|
|
@@ -421,12 +421,12 @@
|
|
|
<el-input v-model="form.eatPoint" placeholder="请输入饮食特点" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="特长" prop="speciality">
|
|
|
- <el-checkbox-group v-model="specialityChecked">
|
|
|
+ <el-checkbox-group v-model="form.specialityChecked">
|
|
|
<el-checkbox v-for="i in speciality" :key="i.dictValue" :label="i.dictValue">{{ i.dictLabel }}</el-checkbox>
|
|
|
</el-checkbox-group>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="爱好" prop="hobby">
|
|
|
- <el-checkbox-group v-model="hobbyChecked">
|
|
|
+ <el-checkbox-group v-model="form.hobbyChecked">
|
|
|
<el-checkbox v-for="i in hobby" :key="i.dictValue" :label="i.dictValue">{{ i.dictLabel }}</el-checkbox>
|
|
|
</el-checkbox-group>
|
|
|
</el-form-item>
|
|
@@ -802,16 +802,23 @@ export default {
|
|
|
{ required: true, message: '请选择性别', trigger: 'change' }
|
|
|
],
|
|
|
sfzid: [
|
|
|
- { required: true, message: '请输入身份证号', trigger: 'blur' },
|
|
|
- { type: 'number', message: '必须为数字' }
|
|
|
+ { required: true, message: '请输入身份证号', trigger: 'blur' }
|
|
|
],
|
|
|
telOne: [
|
|
|
- { required: true, message: '请输入电话', trigger: 'blur' },
|
|
|
- { type: 'number', message: '必须为数字' }
|
|
|
+ { required: true, message: '请输入电话', trigger: 'blur' }
|
|
|
],
|
|
|
birthday: [
|
|
|
{required: true, message: '请选择出生日期', trigger: 'change'}
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ clientType: [
|
|
|
+ {required: true, message: '请选择客户类别', trigger: 'change'}
|
|
|
+ ],
|
|
|
+ familyAddress: [
|
|
|
+ {required: true, message: '请选择客户类别', trigger: 'blur'}
|
|
|
+ ],
|
|
|
+ serviceType: [
|
|
|
+ {required: true, message: '请选择服务状态', trigger: 'blur'}
|
|
|
+ ],
|
|
|
},
|
|
|
marryStatus: [],
|
|
|
userType: [],
|
|
@@ -849,10 +856,12 @@ export default {
|
|
|
forte: null,
|
|
|
aihao: null,
|
|
|
nation: [],
|
|
|
- minzu: null
|
|
|
+ minzu: null,
|
|
|
+ sub_flag: false
|
|
|
};
|
|
|
},
|
|
|
- created() {
|
|
|
+ async created() {
|
|
|
+ await this.getdict()
|
|
|
this.getList();
|
|
|
this.getDicts('sys_relation').then(res => {
|
|
|
this.relation = res.data
|
|
@@ -891,15 +900,18 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- checked(val) {
|
|
|
+ 'form.checked': {
|
|
|
+ handler(val) {
|
|
|
this.form.slowIllness = JSON.stringify(val)
|
|
|
- },
|
|
|
- specialityChecked(val) {
|
|
|
+ }},
|
|
|
+ 'form.specialityChecked': {
|
|
|
+ handler(val) {
|
|
|
this.form.speciality = JSON.stringify(val)
|
|
|
- },
|
|
|
- hobbyChecked(val) {
|
|
|
+ }},
|
|
|
+ 'form.hobbyChecked': {
|
|
|
+ handler(val) {
|
|
|
this.form.hobby = JSON.stringify(val)
|
|
|
- },
|
|
|
+ }},
|
|
|
'form.marrStatus': {
|
|
|
handler(val) {
|
|
|
if (val) {
|
|
@@ -1008,7 +1020,7 @@ export default {
|
|
|
},
|
|
|
handleUploadSuccess(res, file) {
|
|
|
if (res.code != 200) {
|
|
|
- this.$modal.msgError(`上传模板不正确,请重新上传`);
|
|
|
+ this.$modal.msgError(`${res.msg}`);
|
|
|
this.$modal.closeLoading()
|
|
|
this.$refs.fileUpload.handleRemove(file);
|
|
|
} else {
|
|
@@ -1040,39 +1052,80 @@ export default {
|
|
|
this.manageList = res.rows
|
|
|
})
|
|
|
},
|
|
|
- /** 查询用户档案列表 */
|
|
|
- async getList() {
|
|
|
- this.loading = true;
|
|
|
+ async getdict() {
|
|
|
let { data: marryStatus } = await this.getDicts('sys_marry_status')
|
|
|
+ marryStatus.map(item => {
|
|
|
+ item.dictValue = Number(item.dictValue)
|
|
|
+ })
|
|
|
this.marryStatus = marryStatus
|
|
|
let { data: nation } = await this.getDicts('sys_national')
|
|
|
+ nation.map(item => {
|
|
|
+ item.dictValue = Number(item.dictValue)
|
|
|
+ })
|
|
|
this.nation = nation
|
|
|
let { data: userType } = await this.getDicts('sys_user_type')
|
|
|
+ userType.map(item => {
|
|
|
+ item.dictValue = Number(item.dictValue)
|
|
|
+ })
|
|
|
this.userType = userType
|
|
|
let { data: liveStatus } = await this.getDicts('sys_live_status')
|
|
|
+ liveStatus.map(item => {
|
|
|
+ item.dictValue = Number(item.dictValue)
|
|
|
+ })
|
|
|
this.liveStatus = liveStatus
|
|
|
let { data: serviceType } = await this.getDicts('sys_service_type')
|
|
|
+ serviceType.map(item => {
|
|
|
+ item.dictValue = Number(item.dictValue)
|
|
|
+ })
|
|
|
this.serviceType = serviceType
|
|
|
let { data: treateSure } = await this.getDicts('sys_treate_sure')
|
|
|
+ treateSure.map(item => {
|
|
|
+ item.dictValue = Number(item.dictValue)
|
|
|
+ })
|
|
|
this.treateSure = treateSure
|
|
|
let { data: moneyCome } = await this.getDicts('sys_money_come')
|
|
|
+ moneyCome.map(item => {
|
|
|
+ item.dictValue = Number(item.dictValue)
|
|
|
+ })
|
|
|
this.moneyCome = moneyCome
|
|
|
let { data: bloodType } = await this.getDicts('sys_blood_type')
|
|
|
+ bloodType.map(item => {
|
|
|
+ item.dictValue = Number(item.dictValue)
|
|
|
+ })
|
|
|
this.bloodType = bloodType
|
|
|
let { data: disablityStatus } = await this.getDicts('sys_disablity_status')
|
|
|
+ disablityStatus.map(item => {
|
|
|
+ item.dictValue = Number(item.dictValue)
|
|
|
+ })
|
|
|
this.disablityStatus = disablityStatus
|
|
|
let { data: disablityEntry } = await this.getDicts('sys_disablity_entry')
|
|
|
+ disablityEntry.map(item => {
|
|
|
+ item.dictValue = Number(item.dictValue)
|
|
|
+ })
|
|
|
this.disablityEntry = disablityEntry
|
|
|
let { data: educaLevel } = await this.getDicts('sys_educa_level')
|
|
|
+ educaLevel.map(item => {
|
|
|
+ item.dictValue = Number(item.dictValue)
|
|
|
+ })
|
|
|
this.educaLevel = educaLevel
|
|
|
let { data: shiStatus } = await this.getDicts('sys_shi_status')
|
|
|
+ shiStatus.map(item => {
|
|
|
+ item.dictValue = Number(item.dictValue)
|
|
|
+ })
|
|
|
this.shiStatus = shiStatus
|
|
|
let { data: hobby } = await this.getDicts('sys_hobby')
|
|
|
this.hobby = hobby
|
|
|
let { data: speciality } = await this.getDicts('sys_speciality')
|
|
|
this.speciality = speciality
|
|
|
let { data: slowIllness } = await this.getDicts('sys_slow_illness')
|
|
|
+ // slowIllness.map(item => {
|
|
|
+ // item.dictValue = Number(item.dictValue)
|
|
|
+ // })
|
|
|
this.slowIllness = slowIllness
|
|
|
+ },
|
|
|
+ /** 查询用户档案列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
listProfile(this.queryParams).then(response => {
|
|
|
this.profileList = response.rows;
|
|
|
this.profileList.map(item => {
|
|
@@ -1117,6 +1170,7 @@ export default {
|
|
|
}
|
|
|
if (item.slowIllness != null && item.slowIllness != '') {
|
|
|
let arr = JSON.parse(item.slowIllness)
|
|
|
+ item.checked = JSON.parse(JSON.stringify(arr))
|
|
|
item.slowillness = []
|
|
|
arr.map(i => {
|
|
|
item.slowillness.push(this.slowIllness[i].dictLabel)
|
|
@@ -1204,7 +1258,10 @@ export default {
|
|
|
photo: null,
|
|
|
otherPhoto: null,
|
|
|
remarks: null,
|
|
|
- createTime: null
|
|
|
+ createTime: null,
|
|
|
+ checked: [],
|
|
|
+ specialityChecked: [],
|
|
|
+ hobbyChecked: []
|
|
|
};
|
|
|
this.tEmergentPeopleList = [];
|
|
|
this.resetForm("form");
|
|
@@ -1236,7 +1293,17 @@ export default {
|
|
|
this.reset();
|
|
|
const id = row.id || this.ids
|
|
|
getProfile(id).then(response => {
|
|
|
+ if (response.data.slowIllness) (
|
|
|
+ response.data.checked = JSON.parse(response.data.slowIllness)
|
|
|
+ )
|
|
|
+ if (response.data.speciality) (
|
|
|
+ response.data.specialityChecked = JSON.parse(response.data.speciality)
|
|
|
+ )
|
|
|
+ if (response.data.hobby) (
|
|
|
+ response.data.hobbyChecked = JSON.parse(response.data.hobby)
|
|
|
+ )
|
|
|
this.form = response.data;
|
|
|
+ console.log(this.form);
|
|
|
this.tEmergentPeopleList = response.data.temergentPeopleList;
|
|
|
this.open = true;
|
|
|
this.title = "修改用户档案";
|
|
@@ -1260,6 +1327,10 @@ export default {
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
+ if (this.sub_flag) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.sub_flag = true
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
this.form.temergentPeopleList = this.tEmergentPeopleList;
|
|
|
if (valid) {
|
|
@@ -1267,13 +1338,19 @@ export default {
|
|
|
updateProfile(this.form).then(response => {
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
|
+ this.sub_flag = false
|
|
|
this.getList();
|
|
|
+ }, err => {
|
|
|
+ this.sub_flag = false
|
|
|
});
|
|
|
} else {
|
|
|
addProfile(this.form).then(response => {
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
this.open = false;
|
|
|
+ this.sub_flag = false
|
|
|
this.getList();
|
|
|
+ }, err => {
|
|
|
+ this.sub_flag = false
|
|
|
});
|
|
|
}
|
|
|
}
|