|
@@ -46,7 +46,7 @@
|
|
|
<InfoParagraph
|
|
|
v-for="(f,i) in form.prags"
|
|
|
v-if="!upload"
|
|
|
- :key="i + showType"
|
|
|
+ :key="(i+1)*10000 + showType"
|
|
|
:data="f"
|
|
|
:index="i"
|
|
|
:total="form.prags.length"
|
|
@@ -198,6 +198,7 @@ export default {
|
|
|
created: function() {
|
|
|
const { isEdit, data, isCopy } = this.$route.params;
|
|
|
if (isEdit || isCopy) {
|
|
|
+ this.showType = data.type; // 编辑页确认显示类型
|
|
|
this.isEdit = isEdit;
|
|
|
this.isCopy = isCopy;
|
|
|
this.title = isEdit ? '修改' : isCopy ? '复制' : '添加';
|
|
@@ -426,12 +427,69 @@ export default {
|
|
|
return +it;
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ // 额外的表单检验
|
|
|
+ formVal(){
|
|
|
+ let positiontemp = this.form.prags.map(item => {
|
|
|
+ return [...item.position];
|
|
|
+ });
|
|
|
+ let positionArr = positiontemp.reduce(function(a, b) {
|
|
|
+ return a.concat(b);
|
|
|
+ }); // 所有被选中的值集合
|
|
|
+ // console.log(positionArr, 'positionArr');
|
|
|
+ // console.log(this.showType, '当前页的显示类型');
|
|
|
+ let isVisFlag = positionArr.some(item => item === 2);
|
|
|
+ let isDiagFlag = positionArr.some(item => item === 3);
|
|
|
+ // console.log(isVisFlag, 'isVisFlag');
|
|
|
+ if (
|
|
|
+ (this.showType == 3 || this.showType == 4 || this.showType == 5) &&
|
|
|
+ isVisFlag
|
|
|
+ ) {
|
|
|
+ //若医学术语为检验/检查,且内容类型选择了注意事项,此时“注意事项标题”是必填项
|
|
|
+ this.$refs.groups.clearValidate();
|
|
|
+ this.rules.titleChange.push({
|
|
|
+ required: true,
|
|
|
+ message: '请输入注意事项标题',
|
|
|
+ trigger: 'change'
|
|
|
+ });
|
|
|
+ this.$refs.groups.validateField('titleChange');
|
|
|
+ this.rules.titleChange = this.rules.titleChange.slice(0, 1);
|
|
|
+
|
|
|
+ if (this.form.titleChange.trim() !== '') {
|
|
|
+ // console.log('内容不为空');
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ // return;
|
|
|
+ } else if (isDiagFlag && this.showType == 1) {
|
|
|
+ // 若医学术语为诊断,且内容类型选择了临床路径,此时“临床路径标题”是必填项
|
|
|
+ this.$refs.groups.clearValidate();
|
|
|
+ this.rules.titleChange.push({
|
|
|
+ required: true,
|
|
|
+ message: '请输入临床路径标题',
|
|
|
+ trigger: 'change'
|
|
|
+ });
|
|
|
+ this.$refs.groups.validateField('titleChange');
|
|
|
+ this.rules.titleChange = this.rules.titleChange.slice(0, 1);
|
|
|
+
|
|
|
+ if (this.form.titleChange.trim() !== '') {
|
|
|
+ // console.log('内容不为空');
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
submitForm() {
|
|
|
if (this.isSuccessUpload === 1) {
|
|
|
this.warning('文件上传中,请稍等');
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+ let flagVal = this.formVal() // 额外的表单校验
|
|
|
+ // console.log(flagVal,'flagVal======================');
|
|
|
+ if(flagVal === false) return
|
|
|
//验证外层表单
|
|
|
let goOn = true,
|
|
|
it = null;
|
|
@@ -504,9 +562,9 @@ export default {
|
|
|
|
|
|
if (!this.isEdit) {
|
|
|
// 新增页面
|
|
|
- this.saveDisable = true
|
|
|
- this.sendSaveOrEdit(param)
|
|
|
- return
|
|
|
+ this.saveDisable = true;
|
|
|
+ this.sendSaveOrEdit(param);
|
|
|
+ return;
|
|
|
}
|
|
|
this.showSaveDialog(
|
|
|
param,
|
|
@@ -516,7 +574,7 @@ export default {
|
|
|
showSaveDialog(param, msg) {
|
|
|
this.showConfirmDialog(msg, () => {
|
|
|
this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
|
|
|
- this.sendSaveOrEdit(param)
|
|
|
+ this.sendSaveOrEdit(param);
|
|
|
});
|
|
|
},
|
|
|
|
|
@@ -552,7 +610,7 @@ export default {
|
|
|
|
|
|
// 弹出窗
|
|
|
showConfirmDialog(msg, resolve) {
|
|
|
- this.$confirm(msg, '', {
|
|
|
+ this.$confirm(msg, '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
cancelButtonClass: 'cancel',
|