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

量表修改

上级 8d72bdb6
......@@ -22,6 +22,7 @@
<el-button
v-if="item.formType === 'button'"
type="primary"
:disabled="item.disabled"
@click="item.clickFunc ? item.clickFunc($event) : defaultClick($event)"
:icon="item.icon">{{ item.btnText }}
</el-button>
......@@ -65,6 +66,7 @@
<el-checkbox-group
v-else-if="item.formType === 'checkbox'"
v-model="form[item.model]"
:disabled="item.disabled"
@change="item.changeFun ? item.changeFun($event) : defaultFun($event)"
>
<el-checkbox
......@@ -79,6 +81,7 @@
<el-radio-group
v-else-if="item.formType === 'radio'"
v-model="form[item.model]"
:disabled="item.disabled"
@change="item.changeFun ? item.changeFun($event) : defaultFun($event)"
>
<el-radio
......
......@@ -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
export default ($this) => {
let hanldeValue = () => {
$this.addComponents.forEach((item,index)=>{
if(item.name == 'diabetesSourseAuxiliary'){
const glycosylatedHemoglobinPercent = item.formObject.glycosylatedHemoglobinPercent
const glycosylatedHemoglobinDate = item.formObject.glycosylatedHemoglobinDate
......
......@@ -65,6 +65,7 @@ export default ($this) => {
className: 'obj-form-title radio-block',
prop: 'followUpClassification',
model: 'followUpClassification',
disabled: false,
spanNum: 24,
label: '此次履约分类:',
options: [
......
......@@ -3,7 +3,7 @@
<!--渲染不同的模块表单-->
<div v-if="canRender" v-for="(item, index) in addComponents">
<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
:ref="'form' + index"
:id="'form' + index"
......@@ -30,7 +30,7 @@
</template>
<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
import FormScale from '@/components/followup/form/index'
......@@ -64,7 +64,7 @@
scaleNo: '',
doctorId: '',
planTimesId: '',
addComponents: [],
addComponents: [], //所需要展示的模块
addComponentsSourceList: [],
formData: {},//整个表单对象
dialogFormVisible: false,//是否显示添加用药情况dialog
......@@ -179,10 +179,6 @@
this.domain = res.data;
// 获取量表模块
this.getFormModules();
if(this.showBtn!='0'){
// 获取量表详情
this.getFormDetail();
}
}else{
this.$message({
message: res.message,
......@@ -205,17 +201,39 @@
// },
// 获取展示的模块
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'){
this.moduleList = res.data;
for(let i=0;i<this.moduleList.length;i++){
for(let j=0;j<this.addComponentsSourceList.length;j++){
// if(this.moduleList[i]==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{
this.$message({
message: res.message,
......@@ -244,6 +262,7 @@
for(let i=0;i<this.addComponents.length;i++){
let formName = this.addComponents[i].formName;
// let type2Obj = {};
//对用药情况模块的数据做特殊处理
if(this.formData[formName] && formName == 'h_s_002'){
let getDataHS002 = this.formData[formName];
if(Array.isArray(getDataHS002)){
......@@ -258,7 +277,7 @@
arrList: this.medication,
...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];
let symptom = this.formData[formName].symptom;
this.addComponents[i].formObject.symptom = JSON.parse(symptom || '[]');
......@@ -340,6 +359,11 @@
font-weight: bold;
font-size: 18px;
border-bottom: 1px dashed #ccc;
.gray-tip{
color: #8C8C8C;
margin-left: 20px;
font-size: 16px;
}
}
}
}
......
......@@ -3,7 +3,7 @@
<!--渲染不同的模块表单-->
<div v-if="canRender" v-for="(item, index) in addComponents">
<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
:ref="'form' + index"
:id="'form' + index"
......@@ -32,7 +32,7 @@
</template>
<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
import FormScale from '@/components/followup/form/index'
......@@ -196,17 +196,34 @@
// 获取展示的模块
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'){
this.moduleList = res.data;
for(let i=0;i<this.moduleList.length;i++){
for(let j=0;j<this.addComponentsSourceList.length;j++){
// if(this.moduleList[i]==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'){
// 获取量表详情
......@@ -238,6 +255,9 @@
getScaleDetail(this.domain,this.planPatientsTimesId,this.scaleNo).then(res=>{
this.formData = res.data
let keysList = Object.keys(this.formData);
// console.log('获取模块',this.addComponents)
// console.log('获取详情',this.formData)
// console.log('获取详情key',keysList)
if(keysList.length > 0){
for(let i=0;i<this.addComponents.length;i++){
let formName = this.addComponents[i].formName;
......@@ -361,6 +381,11 @@
font-weight: bold;
font-size: 22px;
border-bottom: 1px dashed #ccc;
.gray-tip{
color: #8C8C8C;
margin-left: 20px;
font-size: 16px;
}
}
}
}
......
......@@ -3,7 +3,7 @@
<!--渲染不同的模块表单-->
<div v-for="(item, index) in addComponents" :key="index">
<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
:ref="'form' + index"
:id="'form' + index"
......@@ -26,7 +26,7 @@
</template>
<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
import FormScale from '@/components/followup/form/index'
......@@ -153,9 +153,6 @@
if(formName==='stroke_006'||formName==='stroke_014'||formName==='stroke_015'){
this.addComponents[index].ruleNew = val;
this.setRuleToTrue(index);
// if(this.$refs['form' + index].length > 0){
// this.$refs['form' + index][0].resetFields();
// }
}
})
......@@ -202,10 +199,10 @@
this.domain = res.data;
// 获取量表模块
this.getFormModules();
if(this.showBtn!='0'){
// 获取量表详情
this.getFormDetail();
}
// if(this.showBtn!='0'){
// // 获取量表详情
// this.getFormDetail();
// }
}else{
this.$message({
message: res.message,
......@@ -216,6 +213,17 @@
},
// 动态开启验证开关
setRuleToTrue(index){
if (this.addComponents[index].disabled === true) { //对未授权的做处理,让置灰且非必填
this.addComponents[index].dataSource.forEach((item,k)=>{
this.addComponents[index].dataSource[k].disabled = true;
if(item.rules && item.rules.length > 0){
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){
......@@ -225,19 +233,41 @@
}
}
})
}
},
// 获取展示的模块
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'){
this.moduleList = res.data;
for(let i=0;i<this.moduleList.length;i++){
for(let j=0;j<this.addComponentsSourceList.length;j++){
// if(this.moduleList[i]==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{
this.$message({
......@@ -326,6 +356,11 @@
font-weight: bold;
font-size: 22px;
border-bottom: 1px dashed #ccc;
.gray-tip{
color: #8C8C8C;
margin-left: 20px;
font-size: 16px;
}
}
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册