瀏覽代碼

独立填写单返回检索页

zhouna 6 年之前
父節點
當前提交
c990c640ac

+ 3 - 3
src/components/common/Crumbs.vue

@@ -11,15 +11,15 @@
 <script>
   export default {
     name: 'crumbs',
-    props: ['title','linkTo','minWidth'],//minWidth-有些头部选项比较多,最小宽度需要调整
+    props: ['title','linkTo','minWidth','param'],//minWidth-有些头部选项比较多,最小宽度需要调整
     data: function () {
       return {}
     },
     methods:{
       goBack(){
         this.$router.push({
-          path:this.linkTo,
-          query:this.curPage
+          name:this.linkTo,
+          params:this.param
         });
       }
     }

+ 0 - 1
src/components/preTreat/AddQuestionModules.vue

@@ -180,7 +180,6 @@
       },
     },
     methods: {
-      back() { this.$router.go(-1) },
       getAvailibleType(){
         api.getModuleType({moduleType:this.form.moduleType,relationId:this.form.relationId}).then((res) =>{
           if(res.data.code === '0') {

+ 5 - 3
src/components/preTreat/AddSimpleQuestion.vue

@@ -3,7 +3,8 @@
         <crumbs
                 :title="txt"
                 class="topBack"
-                linkTo="/admin/LT-YWZSJWH-DLTXDWH"
+                :param="param"
+                linkTo="SimpleQuestion"
         ></crumbs>
         <PubIndeptQa
                 @changeVal="changeVal"
@@ -46,6 +47,7 @@
     data() {
       return {
         txt:'独立填写单维护-添加独立填写单',
+        param:this.$route.params,
         imgList:[],
         dataPub: {},      //公用组件传的值都在这
         itemsTypes:[1,2],            //有明细的类型
@@ -61,7 +63,6 @@
       }
     },
     methods: {
-      back() { this.$router.go(-1) },
       changeVal(val) {   //子组件数据改变传递到父组件
         this.dataPub = val;
         //console.log('公用组件传的值都在这', val);
@@ -141,7 +142,8 @@
           api.questionAdd(param).then((res) => {
             if (res.data.code === '0') {
               this.warning(res.data.msg || '保存成功', 'success');
-              this.$router.push("/admin/LT-YWZSJWH-DLTXDWH");
+              //返回带搜索条件的首页
+              this.$router.push({name:"SimpleQuestion",params:Object.assign({},this.param,{currentPage:1})});
             } else {
               this.warning(res.data.msg)
             }

+ 12 - 6
src/components/preTreat/SimpleQuestion.vue

@@ -3,7 +3,7 @@
         <crumbs title="独立填写单维护">
             <el-form :inline="true" class="demo-form-inline">
                 <el-form-item label="归属:">
-                    <el-select size="mini" v-model="filter.tagAdscription" @change="getValue"  placeholder="归属" clearable>
+                    <el-select size="mini" v-model="filter.tagAdscription"  placeholder="归属" clearable>
                         <el-option v-if="item.val!=6&&item.val!=7&&item.val!=8&&item.val!=9&&item.val!=10&&item.val!=21&&item.val!=22" v-for="item in Adscriptions" :label="item.name" :value="item.val" :key="item.id" ></el-option>
                     </el-select>
                 </el-form-item>
@@ -110,10 +110,13 @@
     created() {
       this.getDropList();
     },
+    beforeRouteEnter(to, from, next){
+      next(vm => {
+        //const pm = to.param;
+        Object.assign(vm,to.params);
+      })
+    },
     methods: {
-      getValue(val) {
-        console.log('changeVal', val, this.filter.tagAdscription)
-      },
       getDropList() {
         api.getPreTypeList().then((res) =>{
           this.getDataList();
@@ -152,14 +155,17 @@
         this.getDataList();
       },
       addIndeptTag() {
-        this.$router.push({path:'LT-YWZSJWH-TJDLTXD'})
+        this.$router.push({name:'AddSimpleQuestion',
+                            params:{currentPage:this.currentPage,
+                                    filter:this.filter}})
       },
       modifyIndeptTag(row) {
         api.questionDetail({id:row.id}).then((res)=>{
           const {code,data,msg} = res.data;
           if(code=='0'){
             const item = Object.assign({},row,data);
-            this.$router.push({name:'AddSimpleQuestion',params:{isEdit:true,data:item}});
+            this.$router.push({name:'AddSimpleQuestion',params:{currentPage:this.currentPage,
+                filter:this.filter,isEdit:true,data:item}});
           }else{
             this.$message({
               message: msg,