提交 4c0a8947 编写于 作者: yi.li's avatar yi.li

量表修改

上级 8d72bdb6
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<el-button <el-button
v-if="item.formType === 'button'" v-if="item.formType === 'button'"
type="primary" type="primary"
:disabled="item.disabled"
@click="item.clickFunc ? item.clickFunc($event) : defaultClick($event)" @click="item.clickFunc ? item.clickFunc($event) : defaultClick($event)"
:icon="item.icon">{{ item.btnText }} :icon="item.icon">{{ item.btnText }}
</el-button> </el-button>
...@@ -65,6 +66,7 @@ ...@@ -65,6 +66,7 @@
<el-checkbox-group <el-checkbox-group
v-else-if="item.formType === 'checkbox'" v-else-if="item.formType === 'checkbox'"
v-model="form[item.model]" v-model="form[item.model]"
:disabled="item.disabled"
@change="item.changeFun ? item.changeFun($event) : defaultFun($event)" @change="item.changeFun ? item.changeFun($event) : defaultFun($event)"
> >
<el-checkbox <el-checkbox
...@@ -79,6 +81,7 @@ ...@@ -79,6 +81,7 @@
<el-radio-group <el-radio-group
v-else-if="item.formType === 'radio'" v-else-if="item.formType === 'radio'"
v-model="form[item.model]" v-model="form[item.model]"
:disabled="item.disabled"
@change="item.changeFun ? item.changeFun($event) : defaultFun($event)" @change="item.changeFun ? item.changeFun($event) : defaultFun($event)"
> >
<el-radio <el-radio
......
...@@ -496,7 +496,7 @@ export const getFirstAccess = () => { ...@@ -496,7 +496,7 @@ export const getFirstAccess = () => {
/** /**
* Add by Anndy Yang * Add by Anndy Yang
* 统一验证:量表内是否存在敏感字段、居民是否签署隐私协议、7天内是否发送过授权短信 * 统一验证:量表内是否存在敏感字段、居民是否签署隐私协议、7天内是否发送过授权短信
* @param {[type]} data * @param {[type]} data
{ {
"scaleNo":"String,量表编号", "scaleNo":"String,量表编号",
// "patientIds":"List<Integer>,医生/居民id集合", // pc端只传这个字段 // "patientIds":"List<Integer>,医生/居民id集合", // pc端只传这个字段
...@@ -505,7 +505,7 @@ export const getFirstAccess = () => { ...@@ -505,7 +505,7 @@ export const getFirstAccess = () => {
"userType":"Integer,用户类型(1:居民,2:医生,3:其他)", "userType":"Integer,用户类型(1:居民,2:医生,3:其他)",
"validateType":"1:3个条件依次校验,2:后面2个条件依次校验" "validateType":"1:3个条件依次校验,2:后面2个条件依次校验"
} }
* @return {[type]} * @return {[type]}
{ {
"code": "000000", "code": "000000",
"message": "成功", "message": "成功",
...@@ -538,3 +538,11 @@ export const getFirstAccess = () => { ...@@ -538,3 +538,11 @@ export const getFirstAccess = () => {
}) })
}; };
// 关于权限获取展示的模块信息
export const getScaleModels2 = (domain,scaleNo, params) => {
return fetch({
url: `${domain}/followup/protocol/${scaleNo}/models`,
method: 'get',
params: params,
})
}
...@@ -3,7 +3,6 @@ import { checkRange, checkIsInteger, checkNumberIsToFixed, checkNumberIsToFixedT ...@@ -3,7 +3,6 @@ import { checkRange, checkIsInteger, checkNumberIsToFixed, checkNumberIsToFixedT
export default ($this) => { export default ($this) => {
let hanldeValue = () => { let hanldeValue = () => {
$this.addComponents.forEach((item,index)=>{ $this.addComponents.forEach((item,index)=>{
if(item.name == 'diabetesSourseAuxiliary'){ if(item.name == 'diabetesSourseAuxiliary'){
const glycosylatedHemoglobinPercent = item.formObject.glycosylatedHemoglobinPercent const glycosylatedHemoglobinPercent = item.formObject.glycosylatedHemoglobinPercent
const glycosylatedHemoglobinDate = item.formObject.glycosylatedHemoglobinDate const glycosylatedHemoglobinDate = item.formObject.glycosylatedHemoglobinDate
......
...@@ -65,6 +65,7 @@ export default ($this) => { ...@@ -65,6 +65,7 @@ export default ($this) => {
className: 'obj-form-title radio-block', className: 'obj-form-title radio-block',
prop: 'followUpClassification', prop: 'followUpClassification',
model: 'followUpClassification', model: 'followUpClassification',
disabled: false,
spanNum: 24, spanNum: 24,
label: '此次履约分类:', label: '此次履约分类:',
options: [ options: [
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!--渲染不同的模块表单--> <!--渲染不同的模块表单-->
<div v-if="canRender" v-for="(item, index) in addComponents"> <div v-if="canRender" v-for="(item, index) in addComponents">
<div v-if="item.showModule" class="content-box" > <div v-if="item.showModule" class="content-box" >
<div v-if="!item.hideTitle" class="title">{{item.title}}</div> <div v-if="!item.hideTitle" class="title">{{item.title}}<span class="gray-tip" v-if="item.disabled"><i class="el-icon-warning-outline" style="margin-right: 5px;"></i>获得居民授权才可进行此项填写</span></div>
<el-form <el-form
:ref="'form' + index" :ref="'form' + index"
:id="'form' + index" :id="'form' + index"
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</template> </template>
<script> <script>
import { getDomain, getScaleModels, getScaleDetail, postScale, updateScalesStatus, submitScale } from '@/utils/followup/followapis' import { getDomain, getScaleModels, getScaleDetail, postScale, updateScalesStatus, submitScale, getScaleModels2 } from '@/utils/followup/followapis'
// 量表 template // 量表 template
import FormScale from '@/components/followup/form/index' import FormScale from '@/components/followup/form/index'
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
scaleNo: '', scaleNo: '',
doctorId: '', doctorId: '',
planTimesId: '', planTimesId: '',
addComponents: [], addComponents: [], //所需要展示的模块
addComponentsSourceList: [], addComponentsSourceList: [],
formData: {},//整个表单对象 formData: {},//整个表单对象
dialogFormVisible: false,//是否显示添加用药情况dialog dialogFormVisible: false,//是否显示添加用药情况dialog
...@@ -179,10 +179,6 @@ ...@@ -179,10 +179,6 @@
this.domain = res.data; this.domain = res.data;
// 获取量表模块 // 获取量表模块
this.getFormModules(); this.getFormModules();
if(this.showBtn!='0'){
// 获取量表详情
this.getFormDetail();
}
}else{ }else{
this.$message({ this.$message({
message: res.message, message: res.message,
...@@ -205,17 +201,39 @@ ...@@ -205,17 +201,39 @@
// }, // },
// 获取展示的模块 // 获取展示的模块
getFormModules(){ getFormModules(){
getScaleModels(this.domain,this.scaleNo).then(res=>{ // getScaleModels(this.domain,this.scaleNo).then(res=>{
getScaleModels2(this.domain,this.scaleNo).then(res=>{
if(res.code=='000000'){ if(res.code=='000000'){
this.moduleList = res.data; this.moduleList = res.data;
for(let i=0;i<this.moduleList.length;i++){ for(let i=0;i<this.moduleList.length;i++){
for(let j=0;j<this.addComponentsSourceList.length;j++){ for(let j=0;j<this.addComponentsSourceList.length;j++){
// if(this.moduleList[i]==this.addComponentsSourceList[j].formName){ // if(this.moduleList[i]==this.addComponentsSourceList[j].formName){
if(this.moduleList[i].modelCode==this.addComponentsSourceList[j].formName){ if(this.moduleList[i].modelCode==this.addComponentsSourceList[j].formName){
this.addComponents.push(this.addComponentsSourceList[j]) // this.addComponents.push(this.addComponentsSourceList[j])
//把获取到每个模块的disabeld状态更新进将要渲染的数组
this.addComponents.push({...this.addComponentsSourceList[j],disabled: this.moduleList[i].disabled})
} }
} }
} }
/*start--根据当前模块是否获得居民权限,来判断是否可填写当前模块*/
this.addComponents.forEach((item,index)=>{
if (item.disabled === true) {
item.dataSource.forEach((item2,index2)=>{
// item2.disabled = true;
this.addComponents[index].dataSource[index2].disabled = true;
if (this.addComponents[index].dataSource[index2].rules) {
this.addComponents[index].dataSource[index2].rules[0].required = false;
}
})
}
})
console.log('糖尿病数组', this.addComponents)
/*end--*/
if(this.showBtn!='0'){
// 获取量表详情
this.getFormDetail();
}
}else{ }else{
this.$message({ this.$message({
message: res.message, message: res.message,
...@@ -244,6 +262,7 @@ ...@@ -244,6 +262,7 @@
for(let i=0;i<this.addComponents.length;i++){ for(let i=0;i<this.addComponents.length;i++){
let formName = this.addComponents[i].formName; let formName = this.addComponents[i].formName;
// let type2Obj = {}; // let type2Obj = {};
//对用药情况模块的数据做特殊处理
if(this.formData[formName] && formName == 'h_s_002'){ if(this.formData[formName] && formName == 'h_s_002'){
let getDataHS002 = this.formData[formName]; let getDataHS002 = this.formData[formName];
if(Array.isArray(getDataHS002)){ if(Array.isArray(getDataHS002)){
...@@ -258,7 +277,7 @@ ...@@ -258,7 +277,7 @@
arrList: this.medication, arrList: this.medication,
...this.type2Obj ...this.type2Obj
} }
}else if(this.formData[formName] && formName == 'diabetes_001'){ }else if(this.formData[formName] && formName == 'diabetes_001'){ //对症状模块做处理
this.addComponents[i].formObject = this.formData[formName]; this.addComponents[i].formObject = this.formData[formName];
let symptom = this.formData[formName].symptom; let symptom = this.formData[formName].symptom;
this.addComponents[i].formObject.symptom = JSON.parse(symptom || '[]'); this.addComponents[i].formObject.symptom = JSON.parse(symptom || '[]');
...@@ -340,6 +359,11 @@ ...@@ -340,6 +359,11 @@
font-weight: bold; font-weight: bold;
font-size: 18px; font-size: 18px;
border-bottom: 1px dashed #ccc; border-bottom: 1px dashed #ccc;
.gray-tip{
color: #8C8C8C;
margin-left: 20px;
font-size: 16px;
}
} }
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!--渲染不同的模块表单--> <!--渲染不同的模块表单-->
<div v-if="canRender" v-for="(item, index) in addComponents"> <div v-if="canRender" v-for="(item, index) in addComponents">
<div v-if="item.showModule" class="content-box" > <div v-if="item.showModule" class="content-box" >
<div v-if="!item.hideTitle" class="title">{{item.title}}</div> <div v-if="!item.hideTitle" class="title">{{item.title}}<span class="gray-tip" v-if="item.disabled"><i class="el-icon-warning-outline" style="margin-right: 5px;"></i>获得居民授权才可进行此项填写</span></div>
<el-form <el-form
:ref="'form' + index" :ref="'form' + index"
:id="'form' + index" :id="'form' + index"
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</template> </template>
<script> <script>
import { getDomain, getScaleModels, getScaleDetail, postScale, updateScalesStatus, submitScale } from '@/utils/followup/followapis' import { getDomain, getScaleModels, getScaleDetail, postScale, updateScalesStatus, submitScale, getScaleModels2 } from '@/utils/followup/followapis'
// 量表 template // 量表 template
import FormScale from '@/components/followup/form/index' import FormScale from '@/components/followup/form/index'
...@@ -196,17 +196,34 @@ ...@@ -196,17 +196,34 @@
// 获取展示的模块 // 获取展示的模块
getFormModules(){ getFormModules(){
getScaleModels(this.domain,this.scaleNo).then(res=>{ // getScaleModels(this.domain,this.scaleNo).then(res=>{
getScaleModels2(this.domain,this.scaleNo).then(res=>{
if(res.code=='000000'){ if(res.code=='000000'){
this.moduleList = res.data; this.moduleList = res.data;
for(let i=0;i<this.moduleList.length;i++){ for(let i=0;i<this.moduleList.length;i++){
for(let j=0;j<this.addComponentsSourceList.length;j++){ for(let j=0;j<this.addComponentsSourceList.length;j++){
// if(this.moduleList[i]==this.addComponentsSourceList[j].formName){ // if(this.moduleList[i]==this.addComponentsSourceList[j].formName){
if(this.moduleList[i].modelCode==this.addComponentsSourceList[j].formName){ if(this.moduleList[i].modelCode==this.addComponentsSourceList[j].formName){
this.addComponents.push(this.addComponentsSourceList[j]) // this.addComponents.push(this.addComponentsSourceList[j])
//把获取到每个模块的disabeld状态更新进将要渲染的数组
this.addComponents.push({...this.addComponentsSourceList[j],disabled: this.moduleList[i].disabled})
} }
} }
} }
console.log('高血压展示模块',this.addComponents)
/*start--根据当前模块是否获得居民权限,来判断是否可填写当前模块*/
this.addComponents.forEach((item,index)=>{
if (item.disabled === true) {
item.dataSource.forEach((item2,index2)=>{
// item2.disabled = true;
this.addComponents[index].dataSource[index2].disabled = true;
if (this.addComponents[index].dataSource[index2].rules) {
this.addComponents[index].dataSource[index2].rules[0].required = false;
}
})
}
})
/*end--*/
if(this.showBtn!='0'){ if(this.showBtn!='0'){
// 获取量表详情 // 获取量表详情
...@@ -238,6 +255,9 @@ ...@@ -238,6 +255,9 @@
getScaleDetail(this.domain,this.planPatientsTimesId,this.scaleNo).then(res=>{ getScaleDetail(this.domain,this.planPatientsTimesId,this.scaleNo).then(res=>{
this.formData = res.data this.formData = res.data
let keysList = Object.keys(this.formData); let keysList = Object.keys(this.formData);
// console.log('获取模块',this.addComponents)
// console.log('获取详情',this.formData)
// console.log('获取详情key',keysList)
if(keysList.length > 0){ if(keysList.length > 0){
for(let i=0;i<this.addComponents.length;i++){ for(let i=0;i<this.addComponents.length;i++){
let formName = this.addComponents[i].formName; let formName = this.addComponents[i].formName;
...@@ -361,6 +381,11 @@ ...@@ -361,6 +381,11 @@
font-weight: bold; font-weight: bold;
font-size: 22px; font-size: 22px;
border-bottom: 1px dashed #ccc; border-bottom: 1px dashed #ccc;
.gray-tip{
color: #8C8C8C;
margin-left: 20px;
font-size: 16px;
}
} }
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!--渲染不同的模块表单--> <!--渲染不同的模块表单-->
<div v-for="(item, index) in addComponents" :key="index"> <div v-for="(item, index) in addComponents" :key="index">
<div v-if="item.showModule" class="content-box" > <div v-if="item.showModule" class="content-box" >
<div v-if="!item.hideTitle" class="title">{{item.title}}</div> <div v-if="!item.hideTitle" class="title">{{item.title}}<span class="gray-tip" v-if="item.disabled"><i class="el-icon-warning-outline" style="margin-right: 5px;"></i>获得居民授权才可进行此项填写</span></div>
<el-form <el-form
:ref="'form' + index" :ref="'form' + index"
:id="'form' + index" :id="'form' + index"
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</template> </template>
<script> <script>
import { getDomain, getScaleModels, getScaleDetail, postScale, updateScalesStatus, submitScale } from '@/utils/followup/followapis' import { getDomain, getScaleModels, getScaleDetail, postScale, updateScalesStatus, submitScale, getScaleModels2 } from '@/utils/followup/followapis'
// 量表 template // 量表 template
import FormScale from '@/components/followup/form/index' import FormScale from '@/components/followup/form/index'
...@@ -153,9 +153,6 @@ ...@@ -153,9 +153,6 @@
if(formName==='stroke_006'||formName==='stroke_014'||formName==='stroke_015'){ if(formName==='stroke_006'||formName==='stroke_014'||formName==='stroke_015'){
this.addComponents[index].ruleNew = val; this.addComponents[index].ruleNew = val;
this.setRuleToTrue(index); this.setRuleToTrue(index);
// if(this.$refs['form' + index].length > 0){
// this.$refs['form' + index][0].resetFields();
// }
} }
}) })
...@@ -202,10 +199,10 @@ ...@@ -202,10 +199,10 @@
this.domain = res.data; this.domain = res.data;
// 获取量表模块 // 获取量表模块
this.getFormModules(); this.getFormModules();
if(this.showBtn!='0'){ // if(this.showBtn!='0'){
// 获取量表详情 // // 获取量表详情
this.getFormDetail(); // this.getFormDetail();
} // }
}else{ }else{
this.$message({ this.$message({
message: res.message, message: res.message,
...@@ -216,29 +213,62 @@ ...@@ -216,29 +213,62 @@
}, },
// 动态开启验证开关 // 动态开启验证开关
setRuleToTrue(index){ setRuleToTrue(index){
this.addComponents[index].dataSource.forEach((item,k)=>{ if (this.addComponents[index].disabled === true) { //对未授权的做处理,让置灰且非必填
if(item.rules && item.rules.length > 0){ this.addComponents[index].dataSource.forEach((item,k)=>{
if(!this.needRule){ this.addComponents[index].dataSource[k].disabled = true;
this.addComponents[index].dataSource[k].rules[0].required = true; if(item.rules && item.rules.length > 0){
}else{ this.addComponents[index].dataSource[k].rules[0].required = false;
this.addComponents[index].dataSource[k].rules[0].required = false;
} }
} if(this.$refs['form' + index].length > 0){
}) this.$refs['form' + index][0].resetFields();
}
})
}else {
this.addComponents[index].dataSource.forEach((item,k)=>{
if(item.rules && item.rules.length > 0){
if(!this.needRule){
this.addComponents[index].dataSource[k].rules[0].required = true;
}else{
this.addComponents[index].dataSource[k].rules[0].required = false;
}
}
})
}
}, },
// 获取展示的模块 // 获取展示的模块
getFormModules(){ getFormModules(){
getScaleModels(this.domain,this.scaleNo).then(res=>{ // getScaleModels(this.domain,this.scaleNo).then(res=>{
getScaleModels2(this.domain,this.scaleNo).then(res=>{
if(res.code=='000000'){ if(res.code=='000000'){
this.moduleList = res.data; this.moduleList = res.data;
for(let i=0;i<this.moduleList.length;i++){ for(let i=0;i<this.moduleList.length;i++){
for(let j=0;j<this.addComponentsSourceList.length;j++){ for(let j=0;j<this.addComponentsSourceList.length;j++){
// if(this.moduleList[i]==this.addComponentsSourceList[j].formName){ // if(this.moduleList[i]==this.addComponentsSourceList[j].formName){
if(this.moduleList[i].modelCode==this.addComponentsSourceList[j].formName){ if(this.moduleList[i].modelCode==this.addComponentsSourceList[j].formName){
this.addComponents.push(this.addComponentsSourceList[j]) // this.addComponents.push(this.addComponentsSourceList[j])
//把获取到每个模块的disabeld状态更新进将要渲染的数组
this.addComponents.push({...this.addComponentsSourceList[j],disabled: this.moduleList[i].disabled})
} }
} }
} }
/*start--根据当前模块是否获得居民权限,来判断是否可填写当前模块*/
this.addComponents.forEach((item,index)=>{
if (item.disabled === true) {
item.dataSource.forEach((item2,index2)=>{
// item2.disabled = true;
this.addComponents[index].dataSource[index2].disabled = true;
if (this.addComponents[index].dataSource[index2].rules) {
this.addComponents[index].dataSource[index2].rules[0].required = false;
}
})
}
})
/*end--*/
console.log('展示的数组信息',this.addComponents)
if(this.showBtn!='0'){
// 获取量表详情
this.getFormDetail();
}
}else{ }else{
this.$message({ this.$message({
message: res.message, message: res.message,
...@@ -326,6 +356,11 @@ ...@@ -326,6 +356,11 @@
font-weight: bold; font-weight: bold;
font-size: 22px; font-size: 22px;
border-bottom: 1px dashed #ccc; border-bottom: 1px dashed #ccc;
.gray-tip{
color: #8C8C8C;
margin-left: 20px;
font-size: 16px;
}
} }
} }
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册