Browse Source

添加复制

zhangxc 5 năm trước cách đây
mục cha
commit
5d49c83631

+ 17 - 8
src/components/qualityControl/AddCombineFeild.vue

@@ -84,7 +84,8 @@
         list:[],
         labelPosition:'left',
         isFirst:true,
-        isEdit: true,
+        isEdit: false,
+        isCopy:false,
         title:'组合字段维护-添加组合字段',
         form:{
           modeId:"",
@@ -109,7 +110,7 @@
           tagName:{ required: true, message: '请输入备注', trigger: ['blur', 'change']},
           /*name:[{ required: true, message: '请输入显示名称',trigger: ['blur', 'change'] }],*/
         },
-        copy:null,
+       
         saveDisable: false,  //保存按钮禁止点击
         fieldTypes:[],
         hisTypes:[],
@@ -129,12 +130,19 @@
     },
     created(){
       this.getAllTypes();
-      let {isEdit,data} = this.$route.params;
-      if(isEdit){
-        this.title='组合字段维护-修改组合字段';
-        this.id = data.id
-        this.isEdit = isEdit
+      let {isCopy,isEdit,data} = this.$route.params;
+      if(isEdit  || isCopy){
+        if(isEdit){
+          this.title='组合字段维护-修改组合字段';
+          this.id = data.id
+          this.isEdit = isEdit
+        }
         this.form = Object.assign({},data);
+        if(isCopy){
+          this.isCopy = isCopy
+          this.form.tagName = ""
+          this.form.id=""
+        }
         let questionMappings = this.form.questionMapping ||[]
         let selectFiled = []
         for(let i = 0;  i < questionMappings.length; i++){
@@ -181,6 +189,7 @@
               tagName: searchName,
               hospitalId: this.form.hospitalId,
               modeId:  [this.form.modeId],
+              tagType: [1]
           }
           api.getQCName(param).then(res =>{
               if(res.data.code == '0'){
@@ -257,7 +266,7 @@
               return
             }
             this.form = Object.assign({}, this.form,{questionMappings: questionMappings})
-            if(this.id && !this.copy){//修改
+            if(this.id && !this.isCopy){//修改
               const param = Object.assign({},this.form,{id:this.id})
               this.saveDisable = true  //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
               api.addFieldMatch({questionWrapper:param}).then((res)=>{

+ 13 - 6
src/components/qualityControl/AddQualityControlTemp.vue

@@ -121,12 +121,19 @@ export default {
     },
     created(){
         this.getAllTypes();
-        const { isEdit, data } = this.$route.params
-        if(isEdit) {
-            this.isEdit = isEdit;
-            this.id = data.id
-            this.title ="模板维护-修改"
-            this.form.tempName = data.name
+        const {isCopy, isEdit, data } = this.$route.params
+        if(isEdit || isCopy) {
+            if(isEdit){
+                this.isEdit = isEdit;
+                this.id = data.id
+                this.title ="模板维护-修改"
+               this.form.tempName = data.name
+            }
+            if(isCopy){
+                this.isEdit = isEdit;
+                this.id = ""
+                this.form.tempName = ""
+            }
             this.form.hospital = ''+data.hospitalId
             this.form.moduleName = ''+data.modeId
          

+ 2 - 0
src/components/qualityControl/CombineFeildList.vue

@@ -62,6 +62,8 @@
                     <template slot-scope="scope">
                         <el-button type="text" size="small" @click="toEditField(scope.row, 'modify')">修改</el-button>
                         <span style="margin:0 3px;">|</span>
+                        <el-button type="text" size="small" @click="toEditField(scope.row, 'copy')">复制</el-button>
+                        <span style="margin:0 3px;">|</span>
                         <el-button type="text" size="small" class="delete" @click="showDelDialog(scope.row.id)">删除</el-button>
                     </template>
                 </el-table-column>

+ 2 - 3
src/components/qualityControl/QualityControlTemp.vue

@@ -57,8 +57,8 @@
                         label="操作">
                     <template slot-scope="scope">
                         <el-button  @click="modifyIndeptTag(scope.row, 'modify')" type="text" size="small">修改</el-button>
-                        <!-- <span style="margin:0 3px;">|</span>
-                        <el-button @click="modifyIndeptTag(scope.row, 'copy')" class="text" type="text" size="small">复制</el-button> -->
+                        <span style="margin:0 3px;">|</span>
+                        <el-button @click="modifyIndeptTag(scope.row, 'copy')" class="text" type="text" size="small">复制</el-button>
                         <span style="margin:0 3px;">|</span>
                         <el-button @click="showDelDialog(scope.row)" class="delete" type="text" size="small">删除</el-button>
                     </template>
@@ -192,7 +192,6 @@
       },
       modifyIndeptTag(row, type) {
         api.getQCTempDetail({moduleId:row.id}).then((res)=>{
-          console.log('eeee',res)
           const {code,data,msg} = res.data;
           if(code=='0'){
             const item = Object.assign({},row,data);