lilei hai 8 meses
pai
achega
78b44b6285

+ 2 - 1
src/utils/util.js

@@ -286,11 +286,12 @@ export function getAuthPriceCode (config, router, store) {
     
     // 从所有的权限菜单中查找当前权限code对应的权限菜单数据
     const authNode = treeFind(authTree,(item)=>item.code == authCode)
-    // console.log(authNode,authCode)
+    console.log(authNode,url.replace(/\//g,'_'))
     if(!authNode){return []}
     if(!authNode.permission){return []}
     // 从找到的对应权限菜单数据中判断当前调用接口的url是否存在,这里和权限菜单中的后台权限code比较
     const hasReqUrl = authNode.permission.split(',').find(item => url.replace(/\//g,'_').indexOf(item)>=0)
+    console.log(hasReqUrl)
     // 如果存在则返回一个如 [1,0,1,0,0] 的格式的价格权限字符串给后台接口
     if(hasReqUrl&&authNode.children&&authNode.children.length){
       return hasPriceAuth(authNode.children,priceOptions,userAuthCode)

+ 18 - 2
src/views/salesReturnManagement/salesReturn/detail.vue

@@ -118,7 +118,13 @@
       </a-card>
     </a-spin>
     <!-- 打印导出 -->
-    <print-modal :openModal="openModal" :itemData="detailData" :nowType="nowType" @ok="handleOk" @close="openModal=false" />
+    <print-modal
+      :openModal="openModal"
+      :showPrice="$hasPermissions('B_salesReturnPrint_salesPrice')||$hasPermissions('B_salesReturnExport_salesPrice')"
+      :itemData="detailData"
+      :nowType="nowType"
+      @ok="handleOk"
+      @close="openModal=false" />
   </div>
 </template>
 
@@ -250,7 +256,15 @@ export default {
       this.nowType = type
       // 选择是否导出价格
       if (a) {
-        this.openModal = true
+        if (type == 'export') {
+          if (this.$hasPermissions('B_salesReturnDetail_salesPrice')) {
+            this.openModal = true
+          } else {
+            this.handleOk({ priceType: 'SALES_RETURN_REASON' })
+          }
+        } else {
+          this.openModal = true
+        }
       } else {
         this.handleOk({ priceType: 'SALES_RETURN_REASON' })
       }
@@ -262,11 +276,13 @@ export default {
       _this.spinning = true
       // 导出
       if (this.nowType == 'export') {
+        this.$store.state.app.curActionPermission = 'B_salesReturnExport'
         exportExcel(salesReturnExport, params, '销售退货', function () {
           _this.spinning = false
           _this.$store.state.app.curActionPermission = ''
         })
       } else {
+        this.$store.state.app.curActionPermission = 'B_salesReturnPrint'
         // 打印或预览
         printFun(salesReturnPrint, params, this.nowType, '销售退货', () => {
           _this.spinning = false

+ 14 - 10
src/views/salesReturnManagement/salesReturn/printModal.vue

@@ -19,16 +19,10 @@
       >
         <a-form-model-item label="销售退货单号">{{ itemData&&itemData.salesReturnBillNo || '--' }}</a-form-model-item>
         <a-form-model-item label="销售退货对象">{{ itemData&&itemData.buyerName || '--' }}</a-form-model-item>
-        <a-form-model-item label="退货价格" prop="priceType" v-if="nowType=='export'">
+        <a-form-model-item label="退货价格" prop="priceType" v-if="showPrice">
           <a-radio-group v-model="form.priceType">
-            <a-radio value="SALES_RETURN_AMOUNT">导出</a-radio>
-            <a-radio value="SALES_RETURN">不导出</a-radio>
-          </a-radio-group>
-        </a-form-model-item>
-        <a-form-model-item label="退货价格" prop="priceType" v-if="nowType!='export'">
-          <a-radio-group v-model="form.priceType">
-            <a-radio value="SALES_RETURN_AMOUNT">打印</a-radio>
-            <a-radio value="SALES_RETURN">不打印</a-radio>
+            <a-radio value="SALES_RETURN_AMOUNT">{{ nowType!='export'?'打印':'导出' }}</a-radio>
+            <a-radio value="SALES_RETURN">{{ nowType!='export'?'不打印':'不导出' }}</a-radio>
           </a-radio-group>
         </a-form-model-item>
         <a-form-model-item label="货位编号" prop="orderBy" v-if="nowType!='export'">
@@ -63,6 +57,10 @@ export default {
     nowType: {
       type: String,
       default: ''
+    },
+    showPrice: {
+      type: Boolean,
+      default: true
     }
   },
   data () {
@@ -93,7 +91,7 @@ export default {
     // 确认
     handleSave () {
       const _this = this
-      this.$store.state.app.curActionPermission = this.nowType=='export' ? 'B_salesReturnExport' : 'B_salesReturnPrint'
+      this.$store.state.app.curActionPermission = this.nowType == 'export' ? 'B_salesReturnExport' : 'B_salesReturnPrint'
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const obj = {
@@ -127,6 +125,12 @@ export default {
       if (!newValue) {
         this.$emit('close')
         this.$refs.ruleForm.resetFields()
+      } else {
+        if (this.showPrice) {
+          this.form.priceType = undefined
+        } else {
+          this.form.priceType = 'SALES_RETURN'
+        }
       }
     }
   }

+ 2 - 0
src/views/salesReturnManagement/salesReturn/salesReturnEdit.vue

@@ -562,12 +562,14 @@ export default {
       _this.spinning = true
       // 导出
       if (type == 'export') {
+        this.$store.state.app.curActionPermission = 'B_salesReturnExport'
         exportExcel(salesReturnExport, params, '销售退货', function () {
           _this.spinning = false
           _this.$store.state.app.curActionPermission = ''
         })
       } else {
         // 打印或预览
+        this.$store.state.app.curActionPermission = 'B_salesReturnPrint'
         printFun(salesReturnPrint, params, type, '销售退货', () => {
           _this.spinning = false
           _this.$store.state.app.curActionPermission = ''