lilei 2 vuotta sitten
vanhempi
commit
d154cfdcbd

+ 100 - 88
src/views/bnSetting/menu/adminMenus.vue

@@ -73,33 +73,7 @@
                 rules: [{ required: true, message: '请输入名称!' }] }]"
             />
           </a-form-item>
-          <!-- 路由英文名 -->
-          <!-- <a-form-item v-if="!formData.type||formData.type=='0'" label="路由英文名" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-            <a-input
-              placeholder="请输入路由英文名"
-              v-decorator="['formData.routeName', {
-                initialValue: formData.routeName,
-                rules: [{ required: true, message: '请输入路由英文名!' }] }]"
-            />
-          </a-form-item> -->
-          <!-- 路径 -->
-          <!-- <a-form-item v-if="!formData.type||formData.type=='0'" label="路径" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-            <a-input
-              placeholder="请输入路径"
-              v-decorator="['formData.routePath', {
-                initialValue: formData.routePath,
-                rules: [{ required: true, message: '请输入路径!' }] }]"
-            />
-          </a-form-item> -->
-          <!-- 请求路径 -->
-          <!-- <a-form-item v-if="formData.type==1" label="请求路径" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-            <a-input
-              placeholder="请输入请求路径"
-              v-decorator="['formData.urlPath', {
-                initialValue: formData.urlPath,
-                rules: [{ required: true, message: '请输入请求路径!' }] }]"
-            />
-          </a-form-item> -->
+
           <!-- 前端权限编码 -->
           <a-form-item label="前端权限编码" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-input
@@ -125,35 +99,9 @@
               ]"
             />
           </a-form-item>
-          <!-- 图标 -->
-          <!-- <a-form-item v-if="!formData.type ||formData.type=='0' " label="图标" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-            <a-input
-              placeholder="请输入图标名称"
-              v-decorator="['formData.icon', {
-                initialValue: formData.icon,
-                rules: [] }]"
-            />
-          </a-form-item> -->
-          <!-- 前端组件 -->
-          <!-- <a-form-item v-if="!formData.type ||formData.type=='0'" label="前端组件" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-            <a-input
-              placeholder="请输入前端组件路径"
-              v-decorator="['formData.componentPath', {
-                initialValue: formData.componentPath,
-                rules: [{ required: true, message: '请输入前端组件路径!' }] }]"
-            />
-          </a-form-item> -->
-
-          <!-- 第三方链接 -->
-          <!-- <a-form-item v-if="!formData.type ||formData.type=='0'" label="第三方链接" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-            <a-input
-              placeholder="请输入第三方链接地址"
-              v-decorator="['formData.urlPath', {
-                initialValue: formData.urlPath,
-                rules: [] }]"
-            />
-          </a-form-item> -->
-
+          <a-form-item label="价格权限" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+            <a-checkbox-group v-model="authPrice" :options="priceOptions" @change="onPriceChange" />
+          </a-form-item>
           <!-- 排序值 -->
           <a-form-item label="排序值" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
             <a-input-number
@@ -184,12 +132,9 @@
           </a-form-item>
 
           <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-            <a-button type="primary" @click="handleSubmit()">
+            <a-button size="large" type="primary" @click="handleSubmit()">
               保存
             </a-button>
-            <a-button :style="{ marginLeft: '8px' }" @click="clear">
-              重置
-            </a-button>
           </a-form-item>
         </a-form>
 
@@ -214,6 +159,14 @@ export default {
   props: {},
   data () {
     return {
+      priceOptions:[
+        {label:'售价',value:'salesPrice'},
+        {label:'成本价',value:'costPrice'},
+        {label:'省级价',value:'provincePrice'},
+        {label:'市级价',value:'cityPrice'},
+        {label:'特约价',value:'specialPrice'}
+      ],
+      authPrice: [],
       treeData: [],
       dataList: [],
       searchValue: '',
@@ -225,6 +178,7 @@ export default {
       form: this.$form.createForm(this, { name: 'menu' }),
       showChildModal: false,
       parentData: {}, // 父级菜单
+      currMenusData:null,
       formData: {
         id: '',
         name: '',
@@ -249,18 +203,71 @@ export default {
     }
   },
   methods: {
+    onPriceChange(val){
+      console.log(val,this.authPrice,this.currMenusData)
+      const data = this.currMenusData
+      if(!data){
+        this.$message.warning('请选择一个父级菜单')
+        this.authPrice = []
+        return false
+      }
+
+      // 当前选中节点的价格code
+      const child = data&&data.dataRef&&data.dataRef.children ? data.dataRef.children : []
+      data.dataRef.children = child
+      const curAuth = []
+      child.map(item=>{
+        const a = item.code.split('_')
+        curAuth.push(a[a.length-1])
+      })
+       
+      // 添加
+      if(val.length > curAuth.length){
+        const diff = val.filter(item => !new Set(curAuth).has(item))
+        console.log(diff)
+        const n = this.priceOptions.find(item=>item.value == diff[0])
+        this.addChildPrice({
+          parentId: data.id,
+          name: n.label,
+          code: data.code +'_'+diff[0],
+          status: 1,
+          sort: curAuth.length
+        },function(ret){
+          ret.title = ret.name
+          child.push(ret)
+        })
+      }else{
+        // 删除
+        const diff = curAuth.filter(item => !new Set(val).has(item))
+        const idx = child.findIndex(item => {
+          const a = item.code.split('_')
+          return a[a.length-1] == diff[0]
+        })
+         
+        console.log(child[idx])
+        this.delChildPrice(child[idx].id,function(){
+          child.splice(idx,1)
+        })
+      }
+    },
     onExpand (expandedKeys) {
       // console.log('onExpand', expandedKeys)
       this.expandedKeys = expandedKeys
       this.autoExpandParent = false
     },
     onSelect (selectedKeys, info) {
-      console.log('onSelect', info)
       this.selectedKeys = selectedKeys
       if (info.selected) {
+        this.clear()
         const data = info.selectedNodes[0].data.props
-        const isLeaf = data.dataRef.children
-        // this.formData = Object.assign({}, this.formData, info.selectedNodes[0].data.props)
+        const isLeaf = data.dataRef.children || []
+        console.log('onSelect', isLeaf)
+        this.currMenusData = data // 当前节点的子级
+        // 价格权限回显
+        isLeaf.map(item => {
+          const a = item.code.split('_')
+          this.authPrice.push(a[a.length-1])
+        })
         this.formData = {
           id: data.id,
           parentId: data.parentId,
@@ -353,7 +360,6 @@ export default {
       this.showChildModal = true
       this.parentData = {}
     },
-
     //  取消选择
     cancelSel () {
       this.selectedKeys = []
@@ -364,6 +370,7 @@ export default {
     clear () {
       this.form.resetFields()
       this.formData.id = ''
+      this.formData.parentId = ''
       this.formData.name = ''
       this.formData.routePath = ''
       this.formData.icon = ''
@@ -376,8 +383,9 @@ export default {
       this.formData.code = ''
       this.formData.permission = ''
       this.formData.isLeaf = true
+      this.currMenusData = null
+      this.authPrice = []
     },
-
     // 删除数据
     delect () {
       if (!this.selectedKeys.length) {
@@ -391,46 +399,50 @@ export default {
         okText: '确定',
         cancelText: '取消',
         onOk () {
-          deleteYyMenu({
-            id: _this.formData.id
-          }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success('删除成功')
-              _this.getYyMenuList()
-            }
-          }).catch(() => {
-            _this.$message.success('删除失败, 请稍后重试')
-          })
+          _this.delChildPrice(_this.formData.id)
         }
       })
     },
-
+    // 删除子级
+    delChildPrice(id,callback){
+      const _this = this
+      deleteYyMenu({
+        id: id
+      }).then(res => {
+        if (res.status == 200) {
+          _this.$message.success('删除成功')
+          _this.getYyMenuList()
+          callback&&callback()
+        }
+      }).catch(() => {
+        _this.$message.success('删除失败, 请稍后重试')
+      })
+    },
     // 保存提交
     handleSubmit () {
       const _this = this
       this.form.validateFields((err, values) => {
         if (!err) {
-          console.log(values.formData, ' formData.type222222222')
           if (values.formData.permission) {
             values.formData.permission = values.formData.permission.replace(/\//g, '_')
           }
-          saveYyMenu(Object.assign({ id: this.formData.id }, values.formData)).then(res => {
-            console.log(res, 'res--save')
-            if (res.status + '' === '200') {
-              this.$message.success(res.message ? res.message : '保存成功')
-              _this.getYyMenuList()
-              _this.clear()
-            } else {
-              // this.$message.warning(res.message)
-            }
-          })
+          this.addChildPrice(Object.assign({ id: this.formData.id }, values.formData))
+        }
+      })
+    },
+    // 新增子级
+    addChildPrice(data,callback){
+      saveYyMenu(data).then(res => {
+        if (res.status + '' === '200') {
+          this.$message.success(res.message ? res.message : '保存成功')
+          this.getYyMenuList()
+          callback&&callback(res.data)
         }
       })
     },
     handleCancel () {
       this.clear()
     }
-
   },
   mounted () {
   },

+ 12 - 8
src/views/power/role/menuModal.vue

@@ -124,13 +124,14 @@ export default {
       this.checkedKeys = []
       this.expandedKeys = []
     },
-    // 查找叶子节点
+    // 选中已勾选菜单
     findLeaf (data, arr) {
       for (let i = 0; i < data.length; i++) {
         const node = data[i]
         if (node.children) {
           this.findLeaf(node.children, arr)
         } else {
+          node.class = 'leafNode'
           const hasNode = arr.find(item => {
             return item == node.id
           })
@@ -159,15 +160,15 @@ export default {
     nowData: {
       handler (newValue, oldValue) {
         if (this.isshow && newValue) {
-          this.treeData = this.nowData.allMenuList
           this.id = this.nowData.role.id
           this.titleText = '分配权限' + '(' + this.nowData.role.name + ')'
-          if (this.nowData.role.menuIds) {
-            const arr = this.nowData.role.menuIds.split(',')
-            this.checkedData = arr
-            // 找出叶子节点
-            this.findLeaf(this.treeData, arr)
-          }
+          // 已选节点
+          const arr = this.nowData.role.menuIds
+          this.checkedData = arr ? arr.split(',') : []
+          // 找出叶子节点
+          this.findLeaf(this.nowData.allMenuList, this.checkedData)
+          this.treeData = this.nowData.allMenuList
+          console.log(this.treeData)
         }
       },
       deep: true
@@ -199,4 +200,7 @@ export default {
     -webkit-box-shadow: inset 0 0 2px #d1d1d1;
     background: #e4e4e4;
   }
+  .leafNode{
+    display: inline-block;
+  }
 </style>

+ 3 - 3
src/views/salesManagement/salesQuery/chooseActive.vue

@@ -107,11 +107,11 @@ export default {
         { title: '单位', dataIndex: 'unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '促销类型', dataIndex: 'promoRuleGoods.promoRuleTypeName', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
       ]
-      if (this.$hasPermissions('B_isShowCost')) { // 成本价权限
+      if (this.$hasPermissions('B_salesEdit_costPrice')) { // 成本价权限
         arr.splice(2, 0, { title: '成本价', dataIndex: 'cost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
-      if (this.$hasPermissions('B_isShowPrice')) { // 售价权限
-        const ind = this.$hasPermissions('B_isShowCost') ? 3 : 2
+      if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
+        const ind = this.$hasPermissions('B_salesEdit_costPrice') ? 3 : 2
         arr.splice(ind, 0, { title: '原售价', dataIndex: 'productPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
         arr.splice(ind + 1, 0, { title: '促销价', dataIndex: 'promoRuleGoods.goodsPrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }

+ 30 - 21
src/views/salesManagement/salesQuery/detail.vue

@@ -13,7 +13,7 @@
             id="salesDetail-xs-print-btn"
             v-if="$hasPermissions('B_salesPrint')"
             :disabled="localDataSource.length==0"
-            @click="handlePrint('SALES_BILL')">销售打印</a-button>
+            @click="handlePrint('SALES_BILL',$hasPermissions('B_salesPrint_salesPrice'))">销售打印</a-button>
           <a-button
             key="2"
             type="default"
@@ -21,7 +21,7 @@
             id="salesDetail-xsfl-print-btn"
             v-if="$hasPermissions('B_salesTypePrint')"
             :disabled="localDataSource.length==0"
-            @click="handlePrint('SALES_BILL_TYPE')">销售分类打印</a-button>
+            @click="handlePrint('SALES_BILL_TYPE',$hasPermissions('B_salesTypePrint_salesPrice'))">销售分类打印</a-button>
           <a-divider type="vertical" />
           <a-button
             key="3"
@@ -30,7 +30,7 @@
             id="salesDetail-export-btn"
             v-if="$hasPermissions('B_salesDetailExport')"
             :disabled="localDataSource.length==0"
-            @click="handlePrint('export')">导出Excel</a-button>
+            @click="handlePrint('export',$hasPermissions('B_salesDetailExport_salesPrice'))">导出Excel</a-button>
           <a-button
             key="4"
             type="default"
@@ -38,7 +38,7 @@
             id="salesDetail-export-btn"
             v-if="$hasPermissions('B_salesTypeExport')"
             :disabled="localDataSource.length==0"
-            @click="handlePrint('typeExport')">销售分类导出</a-button>
+            @click="handlePrint('typeExport',$hasPermissions('B_salesTypeExport_salesPrice'))">销售分类导出</a-button>
         </template>
       </a-page-header>
       <!-- 基础信息 -->
@@ -75,19 +75,19 @@
                 待下推数量:<strong>{{ detailData&&(detailData.totalUnpushedQty || detailData.totalUnpushedQty==0) ? detailData.totalUnpushedQty : '--' }}</strong>;
                 已发货数量:<strong>{{ detailData&&(detailData.totalDispatchQty || detailData.totalDispatchQty==0) ? detailData.totalDispatchQty : '--' }}</strong>;
                 待发货数量:<strong>{{ detailData&&(detailData.totalUndispatchQty || detailData.totalUndispatchQty==0) ? detailData.totalUndispatchQty : '--' }}</strong>;<br/>
-                <span v-if="$hasPermissions('B_isShowPrice')">总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</strong>;</span>
-                <span v-if="$hasPermissions('B_isShowCost')">总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</strong>;</span>
-                <span v-if="$hasPermissions('B_isShowCost')">总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;</span>
-                <span v-if="$hasPermissions('B_isShowPrice')">已取消金额:<strong>{{ detailData&&(detailData.totalCancelAmount || detailData.totalCancelAmount==0) ? toThousands(detailData.totalCancelAmount) : '--' }}</strong>;</span>
-                <span v-if="$hasPermissions('B_isShowPrice')">已下推金额:<strong>{{ detailData&&(detailData.totalPushedAmount || detailData.totalPushedAmount==0) ? toThousands(detailData.totalPushedAmount) : '--' }}</strong>;</span>
-                <span v-if="$hasPermissions('B_isShowPrice')">待下推金额:<strong>{{ detailData&&(detailData.totalUnpushedAmount || detailData.totalUnpushedAmount==0) ? toThousands(detailData.totalUnpushedAmount) : '--' }}</strong>;</span>
-                <span v-if="$hasPermissions('B_isShowPrice')">已发货金额:<strong>{{ detailData&&(detailData.totalDispatchAmount || detailData.totalDispatchAmount==0) ? toThousands(detailData.totalDispatchAmount) : '--' }}</strong>;</span>
-                <span v-if="$hasPermissions('B_isShowPrice')">待发货金额:<strong>{{ detailData&&(detailData.totalUndispatchAmount || detailData.totalUndispatchAmount==0) ? toThousands(detailData.totalUndispatchAmount) : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions('B_salesDetail_salesPrice')">总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions('B_salesDetail_costPrice')">总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions('B_salesDetail_costPrice')">总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions('B_salesDetail_salesPrice')">已取消金额:<strong>{{ detailData&&(detailData.totalCancelAmount || detailData.totalCancelAmount==0) ? toThousands(detailData.totalCancelAmount) : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions('B_salesDetail_salesPrice')">已下推金额:<strong>{{ detailData&&(detailData.totalPushedAmount || detailData.totalPushedAmount==0) ? toThousands(detailData.totalPushedAmount) : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions('B_salesDetail_salesPrice')">待下推金额:<strong>{{ detailData&&(detailData.totalUnpushedAmount || detailData.totalUnpushedAmount==0) ? toThousands(detailData.totalUnpushedAmount) : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions('B_salesDetail_salesPrice')">已发货金额:<strong>{{ detailData&&(detailData.totalDispatchAmount || detailData.totalDispatchAmount==0) ? toThousands(detailData.totalDispatchAmount) : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions('B_salesDetail_salesPrice')">待发货金额:<strong>{{ detailData&&(detailData.totalUndispatchAmount || detailData.totalUndispatchAmount==0) ? toThousands(detailData.totalUndispatchAmount) : '--' }}</strong>;</span>
                 <span v-if="isCityPrice">市级总售价:<strong>{{ detailData&&(detailData.totalCityAmount || detailData.totalCityAmount==0) ? toThousands(detailData.totalCityAmount) : '--' }}</strong>;</span>
               </div>
               <div>
                 <a-button v-if="detailData && (detailData.billStatus == 'WAIT_AUDIT' || detailData.billStatus == 'HQ_CHANGE')" type="link" @click="openStockOut">缺货明细</a-button>
-                <a-checkbox v-model="isCityPrice" v-if="$hasPermissions('B_isShowPrice')"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
+                <a-checkbox v-model="isCityPrice" v-if="$hasPermissions('B_salesDetail_cityPrice')"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
               </div>
             </div>
           </div>
@@ -303,19 +303,26 @@ export default {
         { title: '已下推数', dataIndex: 'pushedQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '已取消数', dataIndex: 'cancelQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
-      if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
+      if (this.$hasPermissions('B_salesDetail_costPrice')) { //  成本价权限
         arr.splice(4, 0, { title: '成本价', dataIndex: 'showCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
-      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
-        const ind = this.$hasPermissions('B_isShowCost') ? 5 : 4
+
+      const ind = this.$hasPermissions('B_salesDetail_costPrice') ? 5 : 4
+      if(this.$hasPermissions('B_salesDetail_provincePrice')){
         arr.splice(ind, 0, { title: '省级价', dataIndex: 'provincePrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        if (this.isCityPrice) {
-          arr.splice(ind + 1, 0, { title: '市级价', dataIndex: 'cityPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      // 是否勾选市级价格
+      if (this.isCityPrice) {
+        arr.splice(ind + 1, 0, { title: '市级价', dataIndex: 'cityPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        if (this.$hasPermissions('B_salesDetail_salesPrice')) { //  售价权限
           arr.splice(ind + 2, 0, { title: '销售价', dataIndex: 'price', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        } else {
+        }
+      } else {
+        if (this.$hasPermissions('B_salesDetail_salesPrice')) { //  售价权限
           arr.splice(ind + 1, 0, { title: '销售价', dataIndex: 'price', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         }
       }
+
       if (this.detailData && (this.detailData.billStatus == 'WAIT_AUDIT' || this.detailData.billStatus == 'HQ_CHANGE') && this.$hasPermissions('B_salesAudit')) { //  审核,需用到库存
         arr.splice(arr.length - 3, 0, { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '6%', align: 'center' })
       }
@@ -408,17 +415,19 @@ export default {
       })
     },
     // 打印导出
-    handlePrint (type) {
+    handlePrint (type,showPriceFlag) {
       const _this = this
       // 销售分类导出
       if (type == 'typeExport') {
         const params = {
           salesBillSn: this.bizSn || this.$route.params.sn,
-          showCostFlag: this.$hasPermissions('B_isShowCost')
+          showCostFlag: this.$hasPermissions('B_salesDetail_costPrice'),
+          showPriceFlag: showPriceFlag
         }
         _this.spinning = true
         exportExcel(salesDetailTypeExcel, params, '销售分类' + moment().format('YYYYMMDDHHmmss'), () => { _this.spinning = false })
       } else {
+        this.detailData.showPriceFlag = showPriceFlag
         this.nowType = type
         this.openModal = true
       }

+ 2 - 2
src/views/salesManagement/salesQuery/edit.vue

@@ -36,7 +36,7 @@
         <a-alert type="info" style="margin-bottom: 10px;">
           <div slot="message" class="total-bar">
             <div>
-              <span v-if="$hasPermissions('B_isShowPrice')">总售价:<strong>{{ detailData&&(detailData.totalCommonAmount || detailData.totalCommonAmount==0) ? toThousands(detailData.totalCommonAmount) : '--' }}</strong>;</span>
+              <span v-if="$hasPermissions('B_salesEdit_salesPrice')">总售价:<strong>{{ detailData&&(detailData.totalCommonAmount || detailData.totalCommonAmount==0) ? toThousands(detailData.totalCommonAmount) : '--' }}</strong>;</span>
               总款数:<strong>{{ detailData&&(detailData.totalCommonCategory || detailData.totalCommonCategory==0) ? detailData.totalCommonCategory : '--' }}</strong>;
               总数量:<strong>{{ detailData&&(detailData.totalCommonQty || detailData.totalCommonQty==0) ? detailData.totalCommonQty : '--' }}</strong>;
             </div>
@@ -290,7 +290,7 @@ export default {
         // { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
-      if (this.$hasPermissions('B_isShowPrice')) { // 售价权限
+      if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
         arr.splice(3, 0, { title: '售价', dataIndex: 'price', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
         arr.splice(7, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }

+ 4 - 3
src/views/salesManagement/salesQuery/list.vue

@@ -125,7 +125,7 @@
                 已取消数量:<strong>{{ totalData&&(totalData.totalCancelQty || totalData.totalCancelQty==0) ? totalData.totalCancelQty : '--' }}</strong>;
                 待下推数量:<strong>{{ totalData&&(totalData.totalUnpushedQty || totalData.totalUnpushedQty==0) ? totalData.totalUnpushedQty : '--' }}</strong>;
               </div>
-              <div v-if="$hasPermissions('B_isShowPrice')">
+              <div v-if="$hasPermissions('M_salesQueryList_salesPrice')">
                 总售价:<strong>{{ totalData&&(totalData.totalAmount || totalData.totalAmount==0) ? toThousands(totalData.totalAmount) : '--' }}</strong>;
                 已下推金额::<strong>{{ totalData&&(totalData.totalPushedAmount || totalData.totalPushedAmount==0) ? toThousands(totalData.totalPushedAmount) : '--' }}</strong>;
                 已取消金额::<strong>{{ totalData&&(totalData.totalCancelAmount || totalData.totalCancelAmount==0) ? toThousands(totalData.totalCancelAmount) : '--' }}</strong>;
@@ -382,11 +382,11 @@ export default {
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
       ]
       if (this.showCancelNum) {
-        const ind = this.$hasPermissions('B_isShowPrice') ? 10 : 8
+        const ind = this.$hasPermissions('M_salesQueryList_salesPrice') ? 10 : 8
         arr.splice(ind, 0, { title: '已取消数量', dataIndex: 'totalCancelQty', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
         arr.splice(ind + 1, 0, { title: '待下推数量', dataIndex: 'totalUnpushedQty', width: '4%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
-      if (this.$hasPermissions('B_isShowPrice')) { // 售价权限
+      if (this.$hasPermissions('M_salesQueryList_salesPrice')) { // 售价权限
         arr.splice(6, 0, { title: '总售价', dataIndex: 'totalAmount', width: '4%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         arr.splice(8, 0, { title: '下推总金额', dataIndex: 'totalPushedAmount', width: '4%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
@@ -398,6 +398,7 @@ export default {
     handleExport () {
       const _this = this
       const params = _this.queryParam
+      params.showPriceFlag = this.$hasPermissions("B_sales_export_salesPrice")
       _this.exportLoading = true
       _this.spinning = true
       hdExportExcel(salesDetailExport, params, '销售明细', function () {

+ 1 - 0
src/views/salesManagement/salesQuery/printModal.vue

@@ -160,6 +160,7 @@ export default {
               dataScope: _this.form.dataScope == 'all' ? '' : _this.form.dataScope,
               type: isPrint || 'preview'
             }
+            obj.showPriceFlag = _this.itemData.showPriceFlag
             _this.$emit('ok', obj)
           }
           _this.isShow = false

+ 1 - 1
src/views/salesManagement/salesQuery/queryPart.vue

@@ -167,7 +167,7 @@ export default {
         { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: '8%', align: 'center' },
         { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
-      if (this.$hasPermissions('B_isShowPrice')) { // 售价权限
+      if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
         arr.splice(6, 0, { title: '售价', dataIndex: 'productPrice', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
       return arr

+ 3 - 3
src/views/salesManagement/salesQuery/queryPromotable.vue

@@ -85,11 +85,11 @@ export default {
         { title: '促销类型', dataIndex: 'promotionRulesName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
-      if (this.$hasPermissions('B_isShowCost')) { // 成本价权限
+      if (this.$hasPermissions('B_salesEdit_costPrice')) { // 成本价权限
         arr.splice(3, 0, { title: '成本价', dataIndex: 'showCost', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
-      if (this.$hasPermissions('B_isShowPrice')) { // 售价权限
-        const ind = this.$hasPermissions('B_isShowCost') ? 4 : 3
+      if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
+        const ind = this.$hasPermissions('B_salesEdit_costPrice') ? 4 : 3
         arr.splice(ind, 0, { title: '原售价', dataIndex: 'origPrice', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
         arr.splice(ind + 1, 0, { title: '促销价', dataIndex: 'price', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }

+ 23 - 12
src/views/salesManagement/salesQuery/stockOutDetailModal.vue

@@ -80,18 +80,6 @@ export default {
       disabled: false,
       exportLoading: false,
       exportClassifyLoading: false,
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productEntity.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '单位', dataIndex: 'productEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售数量', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '销售价', dataIndex: 'price', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '销售金额', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '缺货数量', dataIndex: 'lackQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '缺货金额', dataIndex: 'lackAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
@@ -114,6 +102,29 @@ export default {
       }
     }
   },
+  computed:{
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售数量', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '销售价', dataIndex: 'price', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        // { title: '销售金额', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '缺货数量', dataIndex: 'lackQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '缺货金额', dataIndex: 'lackAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+      ]
+      
+      if (this.$hasPermissions('B_salesDetail_salesPrice')) { // 售价权限
+        arr.splice(6, 0, { title: '销售价', dataIndex: 'price', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(7, 0, { title: '销售金额', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     handleExport () {
       const _this = this