lilei hai 2 meses
pai
achega
ef921e9302

+ 1 - 0
src/utils/request.js

@@ -111,6 +111,7 @@ const err = (error) => {
 
 // request interceptor
 service.interceptors.request.use(config => {
+  console.log(store.state.app.curActionPermission)
   const authPrice = getAuthPriceCode(config, router, store)
   const token = store.getters.token
   if (token) {

+ 1 - 0
src/utils/util.js

@@ -266,6 +266,7 @@ export function getAuthPriceCode (config, router, store) {
   // 手动指定的权限code,如打开的弹框页面或导出、打印
   // 手动指定的权限在使用完后需要清空,如在关闭弹框或导出、打印接口调用完成后清空
   const curActionPermission = store.state.app.curActionPermission
+  console.log(curActionPermission)
   // 价格权限的所有选项,销售价、成本价、省、市、特约价
   const priceOptions = store.state.app.priceAuthOptions
   // 最终获取的权限code,手动指定的优先级高于路由打开的页面权限code

+ 3 - 3
src/views/salesManagement/salesQueryNew/detail.vue

@@ -709,7 +709,7 @@ export default {
         _this.spinning = true
         exportExcel(salesDetailTypeExcel, params, '销售分类' + moment().format('YYYYMMDDHHmmss'), () => {
           _this.spinning = false
-          _this.$store.state.app.curActionPermission = ''
+          _this.closePrint()
         })
       } else {
         this.detailData.authCode = authCode
@@ -732,13 +732,13 @@ export default {
       if (this.nowType == 'export') { //  导出
         exportExcel(salesDetailExcel, params, '销售' + moment().format('YYYYMMDDHHmmss'), () => {
           _this.spinning = false
-          _this.$store.state.app.curActionPermission = ''
+          _this.closePrint()
         })
       } else { //  打印
         const taskName = this.nowType == 'SALES_BILL' ? '销售单' : '销售分类'
         printFun(salesDetailPrint, params, objs.type, taskName, () => {
           _this.spinning = false
-          _this.$store.state.app.curActionPermission = ''
+          _this.closePrint()
         })
       }
     }

+ 3 - 3
src/views/salesManagement/salesQueryNew/detailAll.vue

@@ -489,7 +489,7 @@ export default {
         _this.spinning = true
         exportExcel(salesDetailTypeExcel, params, '销售分类' + moment().format('YYYYMMDDHHmmss'), () => {
           _this.spinning = false
-          _this.$store.state.app.curActionPermission = ''
+          _this.closePrint()
         })
       } else {
         this.detailData.authCode = authCode
@@ -512,13 +512,13 @@ export default {
       if (this.nowType == 'export') { //  导出
         exportExcel(salesDetailExcel, params, '销售' + moment().format('YYYYMMDDHHmmss'), () => {
           _this.spinning = false
-          _this.$store.state.app.curActionPermission = ''
+          _this.closePrint()
         })
       } else { //  打印
         const taskName = this.nowType == 'SALES_BILL' ? '销售单' : '销售分类'
         printFun(salesDetailPrint, params, objs.type, taskName, () => {
           _this.spinning = false
-          _this.$store.state.app.curActionPermission = ''
+          _this.closePrint()
         })
       }
     }

+ 5 - 3
src/views/salesManagement/salesQueryNew/printModal.vue

@@ -6,7 +6,7 @@
     class="sales-print-type-modal"
     :title="modalTit"
     v-model="isShow"
-    @cancel="isShow=false"
+    @cancel="cancel"
     :width="600">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
@@ -73,7 +73,7 @@
         </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
-        <a-button id="sales-print-back" @click="isShow = false">取消</a-button>
+        <a-button id="sales-print-back" @click="cancel">取消</a-button>
         <a-button type="primary" class="button-info" id="sales-print-save" @click="handleSave()" style="margin-left: 15px;">{{ nowType=='export' ? '导出' : '打印预览' }}</a-button>
         <a-button v-if="nowType!='export'" type="primary" id="sales-print" @click="handleSave('print')" style="margin-left: 10px;">快捷打印</a-button>
       </div>
@@ -147,6 +147,9 @@ export default {
     }
   },
   methods: {
+    cancel () {
+      this.$emit('close')
+    },
     // 确认
     handleSave (isPrint) {
       const _this = this
@@ -227,7 +230,6 @@ export default {
     //  重定义的弹框状态
     isShow (newValue, oldValue) {
       if (!newValue) {
-        this.$emit('close')
         // 重置表单选项
         this.form = {
           id: 'all',