|
@@ -52,6 +52,7 @@
|
|
|
:index="i"
|
|
|
:total="form.prags.length"
|
|
|
:isEdit="isEdit"
|
|
|
+ :isCopy="isCopy"
|
|
|
ref="subForm"
|
|
|
@add="addParagraph(i)"
|
|
|
@del="delParagraph"
|
|
@@ -109,6 +110,7 @@
|
|
|
import api from '@api/cdss.js';
|
|
|
import InfoParagraph from './MedicineInfoPg';
|
|
|
import config from '@api/config';
|
|
|
+import $ from 'jquery'
|
|
|
|
|
|
export default {
|
|
|
name: 'AddMedicinePrompt',
|
|
@@ -156,7 +158,7 @@ export default {
|
|
|
{ required: true, message: '请输入标题名称', trigger: 'change' },
|
|
|
{
|
|
|
validator: (rule, value, callback) => {
|
|
|
- if (value.length > 30) {
|
|
|
+ if (value.trim().length > 30) {
|
|
|
callback(new Error('标题名称不能超过30字'));
|
|
|
} else {
|
|
|
callback();
|
|
@@ -168,7 +170,16 @@ export default {
|
|
|
fileList: [
|
|
|
{ required: true, message: '请上传文件', trigger: 'change' }
|
|
|
],
|
|
|
- titleChange: [{ max: 30, message: '标题最多30字', trigger: 'change' }]
|
|
|
+ titleChange: [{
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ if (!value.trim()) {
|
|
|
+ callback(new Error('请输入'+this.titleChange.replace(":","")));
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ trigger: 'change'
|
|
|
+ },{ max: 30, message: '标题最多30字', trigger: 'change' }]
|
|
|
},
|
|
|
saveDisable: false, //保存按钮禁止点击
|
|
|
showDrop: false, //下拉框显示文字bug1774
|
|
@@ -212,6 +223,13 @@ export default {
|
|
|
this.isCopy = isCopy;
|
|
|
this.title = isEdit ? '修改' : isCopy ? '复制' : '添加';
|
|
|
(isEdit||isCopy) && this.changeWord(data);
|
|
|
+ if(isCopy){
|
|
|
+ const _this=this;
|
|
|
+ setTimeout(()=>{
|
|
|
+ _this.handleClear();
|
|
|
+ },300)
|
|
|
+
|
|
|
+ }
|
|
|
api.getTremList({ id: data.id }).then(res => {
|
|
|
if (res.data.code == '0') {
|
|
|
const data = res.data.data;
|
|
@@ -328,6 +346,14 @@ export default {
|
|
|
handleMouseleave() {
|
|
|
this.isShowTip = false;
|
|
|
},
|
|
|
+ deleteWord(){
|
|
|
+ this.showType = -1;
|
|
|
+ this.form.selectedTermName ='';
|
|
|
+ this.form.selectedTerm = '';
|
|
|
+ this.form.name = '';
|
|
|
+ this.form.typeId = '';
|
|
|
+ this.titleChange ='';
|
|
|
+ },
|
|
|
changeWord(newVal) {
|
|
|
// console.log(newVal, '选中');
|
|
|
this.showType = newVal.type || -1;
|