Explorar o código

Merge branch 'lin_增值服务' into feature/pyh_批量弹窗页面优化

pengyh hai 1 ano
pai
achega
a0c584242c

+ 30 - 11
src/layout/components/TagsView/index.vue

@@ -1,16 +1,11 @@
 <template>
   <div id="tags-view-container" class="tags-view-container">
     <scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll">
-      <div
-        v-for="(tag, index) in visitedViews"
-        ref="tag"
-        :key="tag.path + index"
+      <div v-for="(tag, index) in visitedViews" ref="tag" :key="tag.path + index"
         :class="['tags-view-item', isActive(tag) ? 'active' : '']"
         :data="JSON.stringify({ path: tag.path, query: tag.query, fullPath: tag.fullPath })"
-        @click="djclick({ path: tag.path, query: tag.query, fullPath: tag.fullPath })"
-        @dblclick="sjclick(tag)"
-        @contextmenu.prevent="openMenu(tag, $event)"
-      >
+        @click="djclick({ path: tag.path, query: tag.query, fullPath: tag.fullPath })" @dblclick="sjclick(tag)"
+        @contextmenu.prevent="openMenu(tag, $event)">
         {{ tag.title }}
         <span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
       </div>
@@ -111,10 +106,24 @@ export default {
       }
     },
     addTags() {
-      const { name,params } = this.$route
-      const {pageType,pageCode,pagePam} =params
+      const { name, meta, params } = this.$route
+      const { pageName, pageType, pageCode, pagePam } = params
       if (name) {
-        this.$store.dispatch('tagsView/addView', {...this.$route, nameKey:`${name}_${pageType}_${pageCode}_${pagePam}_${Math.floor(Date.now() / 1000)}`})
+        this.$store.dispatch('tagsView/addView', {
+          ...this.$route,
+          meta: {
+            ...meta,
+            ...(() => {
+              if (pageName) {
+                return {
+                  title: `${meta.title}-${pageName}`
+                }
+              }
+              return {}
+            })(),
+          },
+          nameKey: `${name}_${pageType}_${pageCode}_${pagePam}_${Math.floor(Date.now() / 1000)}`,
+        })
       }
       return false
     },
@@ -213,6 +222,7 @@ export default {
   background: #fff;
   border-bottom: 1px solid #d8dce5;
   box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);
+
   .tags-view-wrapper {
     .tags-view-item {
       user-select: none;
@@ -228,16 +238,20 @@ export default {
       font-size: 12px;
       margin-left: 5px;
       margin-top: 4px;
+
       &:first-of-type {
         margin-left: 15px;
       }
+
       &:last-of-type {
         margin-right: 15px;
       }
+
       &.active {
         background-color: #42b983;
         color: #fff;
         border-color: #42b983;
+
         &::before {
           content: '';
           background: #fff;
@@ -251,6 +265,7 @@ export default {
       }
     }
   }
+
   .contextmenu {
     margin: 0;
     background: #fff;
@@ -263,10 +278,12 @@ export default {
     font-weight: 400;
     color: #333;
     box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);
+
     li {
       margin: 0;
       padding: 7px 16px;
       cursor: pointer;
+
       &:hover {
         background: #eee;
       }
@@ -286,11 +303,13 @@ export default {
       text-align: center;
       transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
       transform-origin: 100% 50%;
+
       &:before {
         transform: scale(0.6);
         display: inline-block;
         vertical-align: -3px;
       }
+
       &:hover {
         background-color: #b4bccc;
         color: #fff;

+ 2 - 2
src/permission.js

@@ -159,7 +159,7 @@ function buildRoute(route, parentUrl = '', bool = true) {
       item.meta.roleItems = roleItems
 
       if (!pages.find(ite => ite.path === item.path)) {
-        item.path = `${item.path}${bool?'/:pageType?/:pageCode?/:pagePam?':''}`
+        item.path = `${item.path}${bool?'/:pageName?/:pageType?/:pageCode?/:pagePam?':''}`
         pages.push(item)
       }
 
@@ -181,7 +181,7 @@ function buildRoute(route, parentUrl = '', bool = true) {
         item.component = _import(`${fullUrl}/index`)
         item.component.name = item.name
         if (!pages.find(ite => ite.path === item.path)) {
-          item.path = `${item.path}${bool?'/:pageType?/:pageCode?/:pagePam?':''}`
+          item.path = `${item.path}${bool?'/:pageName?/:pageType?/:pageCode?/:pagePam?':''}`
           pages.push(item)
         }
 

+ 1 - 1
src/views/workOrder/workOrderPool/detail.vue

@@ -53,7 +53,7 @@ export default {
   },
   data() {
     return {
-      activeName: this.$route.query.activeName || 'workOrderInfo',
+      activeName: this?.$route?.params?.pagePam || 'workOrderInfo',
       EvaluationShow: false,
       SettleAccountsShow: false
     }

+ 27 - 57
src/views/workOrder/workOrderPool/index.vue

@@ -204,54 +204,24 @@ export default {
   },
   methods: {
     initFun() {
-      if (this.$route.path === "/workOrder/workOrderPool") {
-        if (this.$route.query.id) {
-          this.createFormBool = false
-          this.detailFormBool = false
-          this.recordSelected = []
-          this.$nextTick(() => {
-            this.id = this.$route.query.id
-            this.$nextTick(() => {
-              this.detailFormBool = true
-            })
-          })
-        }
-        if (this.$route.query.saleOrderId) {
-          this.createFormBool = false
-          this.detailFormBool = false
-          this.recordSelected = []
-          this.$nextTick(() => {
-            this.defaultSearchData = [{ "param": "a.sale_order_id", "compare": "=", "value": this.$route.query.saleOrderId, label: "销售订单号" }]
-            this.$nextTick(() => {
-              // this.defaultSearchData = []
-              this.$router.push({ name: "workOrderPool", params: {}, query: {} })
-            })
-          })
-        }
-        if (this.$route.query.pgIncreItemId) {
-          this.createFormBool = false
-          this.detailFormBool = false
-          this.recordSelected = []
-          this.$nextTick(() => {
-            this.defaultSearchData = [{ "param": "a.pg_incre_order_id", "compare": "=", "value": this.$route.query.pgIncreItemId, label: "增置服务明细ID" }]
-            this.$nextTick(() => {
-              // this.defaultSearchData = []
-              this.$router.push({ name: "workOrderPool", params: {}, query: {} })
-            })
-          })
-        }
-        if (this.$route.query.rpProjectRepairId) {
-          this.createFormBool = false
-          this.detailFormBool = false
-          this.recordSelected = []
-          this.$nextTick(() => {
-            this.defaultSearchData = [{ "param": "a.rp_project_repair_id", "compare": "=", "value": this.$route.query.rpProjectRepairId, label: "维保配置ID" }]
-            this.$nextTick(() => {
-              // this.defaultSearchData = []
-              this.$router.push({ name: "workOrderPool", params: {}, query: {} })
-            })
-          })
-        }
+      if(this.pageType == "detail"){
+        this.id = this.pageCode
+        this.$nextTick(() => {
+          this.detailFormBool = true
+        })
+      }
+      
+      if(this.pageType == "saleOrderId"){
+        this.defaultSearchData = [{ "param": "a.sale_order_id", "compare": "=", "value": this.pageCode, label: "销售订单号" }]
+      }
+
+
+      if(this.pageType == "pgIncreItemId"){
+        this.defaultSearchData = [{ "param": "a.pg_incre_order_id", "compare": "=", "value": this.pageCode, label: "增置服务明细ID" }]
+      }
+
+      if(this.pageType == "rpProjectRepairId"){
+        this.defaultSearchData = [{ "param": "a.rp_project_repair_id", "compare": "=", "value": this.pageCode, label: "维保配置ID" }]
       }
     },
 
@@ -324,15 +294,15 @@ export default {
         if (pam.orderSmallType) {
           pam.params.push({ "param": "a.order_small_type", "compare": "=", "value": pam.orderSmallType })
         }
-        if (this.$route.query.saleOrderId && !pam.params.find(item => item.param == "a.sale_order_id")) {
-          pam.params.push({ "param": "a.sale_order_id", "compare": "like", "value": this.$route.query.saleOrderId, label: "销售订单号" })
-        }
-        if (this.$route.query.pgIncreItemId && !pam.params.find(item => item.param == "a.pg_incre_order_id")) {
-          pam.params.push({ "param": "a.pg_incre_order_id", "compare": "like", "value": this.$route.query.pgIncreItemId, label: "增置服务明细ID" })
-        }
-        if (this.$route.query.rpProjectRepairId  && !pam.params.find(item => item.param == "a.rp_project_repair_id")) {
-          pam.params.push({ "param": "a.rp_project_repair_id", "compare": "=", "value": this.$route.query.rpProjectRepairId })
-        }
+        // if (this.$route.query.saleOrderId && !pam.params.find(item => item.param == "a.sale_order_id")) {
+        //   pam.params.push({ "param": "a.sale_order_id", "compare": "like", "value": this.$route.query.saleOrderId, label: "销售订单号" })
+        // }
+        // if (this.$route.query.pgIncreItemId && !pam.params.find(item => item.param == "a.pg_incre_order_id")) {
+        //   pam.params.push({ "param": "a.pg_incre_order_id", "compare": "like", "value": this.$route.query.pgIncreItemId, label: "增置服务明细ID" })
+        // }
+        // if (this.$route.query.rpProjectRepairId  && !pam.params.find(item => item.param == "a.rp_project_repair_id")) {
+        //   pam.params.push({ "param": "a.rp_project_repair_id", "compare": "=", "value": this.$route.query.rpProjectRepairId })
+        // }
         cb && cb(pam)
         return orderBaseList(pam)
       } catch (err) {