Parcourir la source

Merge branch 'develop_yh13' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh13

chenrui il y a 2 ans
Parent
commit
e2daa7abb2

+ 4 - 2
src/utils/request.js

@@ -110,7 +110,7 @@ service.interceptors.request.use(config => {
 
 // response interceptor
 service.interceptors.response.use((response) => {
-  console.log(response, 'response.data.status')
+  // console.log(response, 'response.data.status')
   const et = sessionStorage.getItem('errorTips')
   if ((response.data.status == '1001' || response.data.status == '1099') && !et) {
     sessionStorage.setItem('errorTips', 1)
@@ -140,7 +140,9 @@ service.interceptors.response.use((response) => {
       description: response.data.code
     })
   }
-  store.commit('SET_loadingStatus', false)
+  if(response.data.status!='200'){
+    store.commit('SET_loadingStatus', false)
+  }
   return response.data
 }, err)
 

+ 27 - 6
src/utils/util.js

@@ -83,18 +83,21 @@ export function treeFind (tree, func) {
   return null
 }
 // 是否有价格权限
-export function hasPriceAuth(authNode, priceOptions){
+export function hasPriceAuth(authNode, priceOptions, userAuthCode){
   const codes = []
   const ret = []
   // 过滤当前节点下的非价格权限菜单
   authNode.map(item=>{
     const a = item.code.split('_')
     const hasCode = priceOptions.find(k => k.value == a[a.length-1])
-    if(hasCode){
+    const hasRoles = userAuthCode.includes(item.code)
+    // 获取当前用户的角色拥有的价格权限
+    if(hasCode && hasRoles){
       codes.push(a[a.length-1])
     }
   })
-  // 生成权限参数
+  // 根据拥有的价格权限生成数组标记[1,0,1,0,0],每一位对应一个价格权限
+  // 有权限标记1,否则标记0
   priceOptions.map(item => {
     ret.push(codes.includes(item.value)?1:0)
   })
@@ -102,20 +105,38 @@ export function hasPriceAuth(authNode, priceOptions){
 }
 // 获取接口对应的价格权限code
 export function getAuthPriceCode (config, router, store) {
-  const permission = router.history.current.meta.permission
+  // 通过路由打开的页面的权限code
+  const permission = router.history.current.meta.permission 
+  // 手动指定的权限code,如打开的弹框页面或导出、打印
+  // 手动指定的权限在使用完后需要清空,如在关闭弹框或导出、打印接口调用完成后清空
   const curActionPermission = store.state.app.curActionPermission
+  // 价格权限的所有选项,销售价、成本价、省、市、特约价
   const priceOptions = store.state.app.priceAuthOptions
+  // 最终获取的权限code,手动指定的优先级高于路由打开的页面权限code
   const authCode = curActionPermission || permission
+  // 当前角色的分配的价格权限,这里过滤非价格权限code
+  const roles = store.state.user.roles
+  const userAuthCode = roles.permissionList.filter(item => {
+    const a = item.split('_')
+    return priceOptions.find(k => k.value == a[a.length-1])
+  })
+  // console.log(userAuthCode)
   console.log(authCode)
+  // 如果有权限code
   if(authCode){
+    // 当前正在调用的接口url
     const url = config.url
+    // 所有的权限菜单数据
     const authTree = store.state.app.authMenusList
+    // 从所有的权限菜单中查找当前权限code对应的权限菜单数据
     const authNode = treeFind(authTree,(item)=>item.code == authCode)
     console.log(authNode)
+    if(!authNode.permission){return []}
+    // 从找到的对应权限菜单数据中判断当前调用接口的url是否存在,这里和权限菜单中的后台权限code比较
     const hasReqUrl = authNode.permission.split(',').find(item => url.replace(/\//g,'_').indexOf(item)>=0)
-    
+    // 如果存在则返回一个如 [1,0,1,0,0] 的格式的价格权限字符串给后台接口
     if(hasReqUrl&&authNode.children&&authNode.children.length){
-      return hasPriceAuth(authNode.children,priceOptions)
+      return hasPriceAuth(authNode.children,priceOptions,userAuthCode)
     }
     return []
   }

+ 0 - 1
src/views/bnSetting/menu/storeMenus.vue

@@ -405,7 +405,6 @@ export default {
         return this.$message.warning('您还未选择要删除的数据')
       }
       const _this = this
-      console.log(_this.formData.id, '_this.formData.id')
       this.$confirm({
         title: '警告',
         content: `确定要删除您选择的 ${_this.formData.name} 的数据吗?`,

+ 19 - 8
src/views/expenseManagement/expenseReimbursement/detail.vue

@@ -98,17 +98,16 @@
       </a-card>
     </a-spin>
     <!-- 打印预览 -->
-    <previewModal :showModal="showModal" @close="showModal=false" :detailSn="$route.params.sn" :detailData="detailData"></previewModal>
-    <iframe id="printfsqd" name="printfsqd" hidden></iframe>
+    <previewModal ref="previewModal" @printOk="printOk"></previewModal>
   </div>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable } from '@/components'
-import { expenseAccountDetail, expenseAcctDetailFindList } from '@/api/expenseManagement'
+import { expenseAccountDetail, expenseAcctDetailFindList, getProcessInstance } from '@/api/expenseManagement'
 import previewModal from './previewModal.vue'
-import { jGPrint } from '@/libs/JGPrint.js'
+
 export default {
   name: 'ExpenseReimbursementListDetail',
   mixins: [commonMixin],
@@ -118,7 +117,6 @@ export default {
     return {
       spinning: false,
       disabled: false,
-      showModal: false, // 打印弹窗初始状态
       baseData: null,
       count: 0,
       // 加载数据方法 必须为 Promise 对象
@@ -162,9 +160,22 @@ export default {
       this.$router.push({ name: 'expenseReimbursementList' })
     },
     // 打印
-    handlePrint (type) {
-      const html = document.getElementById('printTest').innerHTML
-      jGPrint(html, type)
+    async handlePrint (type) {
+      this.spinning = true
+      // 费用明细
+      const fyListData = await expenseAcctDetailFindList({ expenseAccountSn: this.$route.params.sn }).then(res => res.data)
+      // 审核明细,待提交状态不获取
+      const spListData = this.detailData.state != 'WAIT_SUBMIT' ? await getProcessInstance({ businessType: 'EXPENSES', businessSn: this.$route.params.sn }).then(res => res.data) : null
+      this.$refs.previewModal.setData([
+      {
+        expenseInfo: this.detailData,
+        fyListData,
+        spListData
+      }
+      ])
+    },
+    printOk(res){
+      this.spinning = false
     },
     //  详情
     getDetail () {

+ 98 - 23
src/views/expenseManagement/expenseReimbursement/list.vue

@@ -10,12 +10,12 @@
                 <a-input id="salesManagementList-expenseAccountNo" v-model.trim="queryParam.expenseAccountNo" allowClear placeholder="请输入销售单号"/>
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
+            <a-col :md="4" :sm="24">
               <a-form-item label="申请人" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
                 <employee style="width: 100%;" id="salesManagementList-Employee" v-model="queryParam.applyPersonSn"></employee>
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="24">
+            <a-col :md="4" :sm="24">
               <a-form-item label="费用类型">
                 <expenseType
                   id="salesManagementList-expenseType"
@@ -26,8 +26,7 @@
                 ></expenseType>
               </a-form-item>
             </a-col>
-            <template v-if="advanced">
-              <a-col :md="6" :sm="24">
+            <a-col :md="4" :sm="24">
                 <a-form-item label="费用发生月份">
                   <a-month-picker
                     placeholder="请选择月份"
@@ -38,12 +37,24 @@
                     style="width: 100%;"/>
                 </a-form-item>
               </a-col>
+            <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-item label="主题">
                   <a-input id="salesManagementList-title" v-model.trim="queryParam.title" allowClear placeholder="请输入主题"/>
                 </a-form-item>
               </a-col>
-              <a-col :md="6" :sm="24">
+              <a-col :md="4" :sm="24">
+                <a-form-item label="打印状态">
+                  <v-select
+                    v-model="queryParam.printStatus"
+                    ref="printStatus"
+                    id="pushOrder-printStatus"
+                    code="PRINT_STATUS"
+                    placeholder="请选择打印状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24">
                 <a-form-item label="状态">
                   <v-select
                     v-model="queryParam.state"
@@ -57,7 +68,7 @@
             </template>
             <a-col :md="6" :sm="24">
               <span class="table-page-search-submitButtons">
-                <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button type="primary" :disabled="disabled" @click="searchForm">查询</a-button>
                 <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
                 <a @click="advanced=!advanced" style="margin-left: 8px">
                   {{ advanced ? '收起' : '展开' }}
@@ -71,11 +82,17 @@
       <!-- 操作按钮 -->
       <div class="table-operator">
         <a-button type="primary" class="button-error" v-if="$hasPermissions('B_eRNew')" @click="handleEdit()">新增</a-button>
+        <a-button type="primary" :loading="spinning" @click="handlePlPrint()" ghost>批量打印</a-button>
+        <span style="margin-left: 8px">
+          <template v-if="rowSelectionInfo && rowSelectionInfo.selectedRowKeys.length>0">{{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }}</template>
+        </span>
       </div>
       <!-- 列表 -->
       <s-table
         class="sTable fixPagination"
         ref="table"
+        :row-selection="$hasPermissions('B_eRPrint')?{ columnWidth: '4%', getCheckboxProps: record => ({ props: { disabled: false } })}:null"
+        @rowSelection="rowSelectionFun"
         :style="{ height: tableHeight+70.5+'px' }"
         size="small"
         :rowKey="(record) => record.id"
@@ -143,6 +160,8 @@
     <verifyModal v-drag :openModal="openModal" :itemSn="itemSn" @close="openModal=false"></verifyModal>
     <!-- 新增 -->
     <baseDataModal :show="openBaseModal" @close="openBaseModal=false"></baseDataModal>
+    <!-- 打印预览 -->
+    <previewModal ref="printModal" @printOk="printOk"></previewModal>
   </a-card>
 </template>
 
@@ -154,13 +173,15 @@ import subarea from '@/views/common/subarea.js'
 import employee from './employee.js'
 import { STable, VSelect } from '@/components'
 import verifyModal from './verifyModal.vue'
+import previewModal from './previewModal.vue'
 import expenseType from '@/views/common/expenseType.js'
-import { expenseAccountList, expenseAccountDelete, expenseAccountAgainEdit } from '@/api/expenseManagement'
+import { getBatchLastProcessInstance } from '@/api/financeBook'
+import { expenseAccountList, expenseAccountDelete, expenseAccountAgainEdit, expenseAcctDetailFindList } from '@/api/expenseManagement'
 import baseDataModal from './baseDataModal.vue'
 export default {
   name: 'ExpenseReimbursementList',
   mixins: [commonMixin],
-  components: { STable, VSelect, subarea, verifyModal, baseDataModal, employee, expenseType },
+  components: { STable, VSelect, subarea, verifyModal, baseDataModal, employee, expenseType, previewModal },
   data () {
     let _this=this
     return {
@@ -180,8 +201,24 @@ export default {
         title: '', //  主题
         expenseType: undefined, // 费用类型
         expenseType2: undefined, // 费用类型2
+        printStatus: undefined, // 打印状态
         state: undefined // 状态
       },
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '费用单号', width: '8%', align: 'center', scopedSlots: { customRender: 'expenseAccountNo' } },
+        { title: '申请人', dataIndex: 'applyPersonName', width: '6%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '申请部门', dataIndex: 'applyDepartmentName', width: '8%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '费用类型', scopedSlots: { customRender: 'expenseType' }, width: '8%', align: 'left' },
+        { title: '费用发生月份', dataIndex: 'expenseDate', width: '6%', align: 'center', customRender: function (text) { return moment(text).format('YYYY年MM月') || '--' } },
+        { title: '主题', dataIndex: 'title', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '合计金额', dataIndex: 'applyExpenseTotal', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核时间', dataIndex: 'finishDate', width: '8%', align: 'center', customRender: function (text, record) { return record.state == 'AUDIT_REJECT' || record.state == 'AUDIT_PASS' ? text : '--' } },
+        { title: '打印状态', dataIndex: 'printStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -199,6 +236,7 @@ export default {
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
+              data.list[i].content = data.list[i].content ? data.list[i].content.replace(/\n+/, '\n').split('\n') : ''
             }
             this.disabled = false
           }
@@ -206,21 +244,55 @@ export default {
           return data
         })
       },
-      columns: [{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '费用单号', width: '12%', align: 'center', scopedSlots: { customRender: 'expenseAccountNo' } },
-        { title: '申请人', dataIndex: 'applyPersonName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '申请部门', dataIndex: 'applyDepartmentName', width: '8%', align: 'left', customRender: function (text) { return text || '--' } },
-        { title: '费用类型', scopedSlots: { customRender: 'expenseType' }, width: '6%', align: 'center' },
-        { title: '费用发生月份', dataIndex: 'expenseDate', width: '6%', align: 'center', customRender: function (text) { return moment(text).format('YYYY年MM月') || '--' } },
-        { title: '主题', dataIndex: 'title', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '合计金额', dataIndex: 'applyExpenseTotal', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核时间', dataIndex: 'finishDate', width: '8%', align: 'center', customRender: function (text, record) { return record.state == 'AUDIT_REJECT' || record.state == 'AUDIT_PASS' ? text : '--' } },
-        { title: '状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }]
+      rowSelectionInfo: null // 批量选择的数据
     }
   },
   methods: {
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    printOk(res){
+      this.spinning = false
+      if(res&&res.status == 200){
+        this.$refs.table.refresh()
+      }
+    },
+    // 批量打印
+    async handlePlPrint () {
+      const _this = this
+      const rows = _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows || []
+      const slen = rows.length
+      if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && slen < 1)) {
+        _this.$message.warning('请在列表勾选后再进行批量操作!')
+        return false
+      }
+      this.spinning = true
+      const pageData = []
+      const businessSnList = []
+      
+      for(let i=0;i<rows.length;i++){
+        // 费用明细
+        const fyListData = await expenseAcctDetailFindList({ expenseAccountSn: rows[i].expenseAccountSn }).then(res => res.data)
+        // 审核明细,待提交状态不获取
+        if(rows[i].state != 'WAIT_SUBMIT'){
+          businessSnList.push(rows[i].expenseAccountSn)
+        }
+        pageData.push({
+          expenseInfo: rows[i],
+          fyListData: fyListData,
+          spListData: []
+        })
+      }
+      // 获取审核进度信息
+      const spListData = await getBatchLastProcessInstance({ 'businessType': 'EXPENSES', 'businessSnList': businessSnList }).then(res => res.data)
+      pageData.map(item => {
+        const sp = spListData[item.expenseInfo.expenseAccountSn]
+        item.spListData = sp ? sp.taskVOList : []
+      })
+      console.log(pageData)
+      this.$refs.printModal.setData(pageData)
+    },
     onChange (date, dateString) {
       this.queryParam.expenseDate = dateString
     },
@@ -292,6 +364,10 @@ export default {
         }
       })
     },
+    searchForm(){
+      this.$refs.table.refresh(true)
+      this.$refs.table.clearSelected()
+    },
     // 重置
     resetSearchForm () {
       this.queryParam = {
@@ -304,7 +380,7 @@ export default {
         applyPersonSn: undefined
       }
       this.expenseTypes = []
-      this.$refs.table.refresh(true)
+      this.searchForm()
     },
     pageInit () {
       const _this = this
@@ -314,7 +390,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 235
+      this.tableHeight = window.innerHeight - tableSearchH - 220
     }
   },
   watch: {
@@ -354,7 +430,6 @@ export default {
 <style lang="less">
   .salesManagementList-wrap{
     .sTable{
-      margin-top: 10px;
       .badge-con-t{
         .ant-badge-count{
           transform: scale(0.8);

+ 95 - 96
src/views/expenseManagement/expenseReimbursement/previewModal.vue

@@ -1,78 +1,80 @@
 <template>
-  <!-- <a-modal :footer="null" v-model="isShow" width="850px"> -->
-  <div class="container-print-view" style="width:100%;font-size: 12pt;position: fixed;font-family: auto;left:10000000px;padding:0;margin:0 auto;" id="printTest">
+  <div class="container-print-view" 
+  style="width:100%;font-size: 12pt;position: fixed;font-family: auto;left:-1000000px;padding:0;margin:0 auto;background-color: #fff;" 
+  >
+  <div class="expense-detail-print" style="width:564pt;margin:0 auto;" v-for="item in list" :key="item.expenseInfo.expenseAccountSn">
     <p class="container-title" style="text-align: center;font-size: 24px;font-weight: 600;">箭冠汽配企业费用报销单</p>
     <div class="container-info" style="width: 100%;border: 1px solid #000000;">
-      <div class="container-info-basics" v-if="expenseInfo">
+      <div class="container-info-basics" v-if="item.expenseInfo">
         <div class="basics-item" style="width: 100%;border-bottom: 1px solid #000000;padding:0;margin:0;">
-          <span style="display: inline-block;width: 50%;padding: 10px;border-right: 1px solid #000000;">申请人:{{ expenseInfo&&expenseInfo.applyPersonName?expenseInfo.applyPersonName:'' }}</span>
-          <span style="display: inline-block;border-right: none;padding: 10px;">申请部门:{{ expenseInfo&&expenseInfo.applyDepartmentName?expenseInfo.applyDepartmentName:'' }}</span>
+          <span style="display: inline-block;width: 50%;padding: 10px;border-right: 1px solid #000000;">申请人:{{ item.expenseInfo.applyPersonName?item.expenseInfo.applyPersonName:'' }}</span>
+          <span style="display: inline-block;border-right: none;padding: 10px;">申请部门:{{ item.expenseInfo.applyDepartmentName?item.expenseInfo.applyDepartmentName:'' }}</span>
         </div>
         <div class="basics-item" style="width: 100%;border-bottom: 1px solid #000000;padding:0;margin:0;">
-          <span style="display: inline-block;width: 50%;padding: 10px;border-right: 1px solid #000000;">费用类型:{{ expenseInfo&&expenseInfo.expenseTypeDictValue?expenseInfo.expenseTypeDictValue:'' }}</span>
-          <span style="display: inline-block;border-right: none;padding: 10px;">费用发生月份:{{ expenseInfo&&expenseInfo.expenseDate?expenseInfo.expenseDate.substring(0, 7):'' }}</span>
+          <span style="display: inline-block;width: 50%;padding: 10px;border-right: 1px solid #000000;">费用类型:{{ item.expenseInfo.expenseTypeDictValue?item.expenseInfo.expenseTypeDictValue:'' }}</span>
+          <span style="display: inline-block;border-right: none;padding: 10px;">费用发生月份:{{ item.expenseInfo.expenseDate?item.expenseInfo.expenseDate.substring(0, 7):'' }}</span>
         </div>
         <div class="basics-item" style="width: 100%;border-bottom: 1px solid #000000;padding:0;margin:0;">
-          <span style="display: inline-block;width: 50%;padding: 10px;border-right: 1px solid #000000;">费用单号:{{ expenseInfo&&expenseInfo.expenseAccountNo?expenseInfo.expenseAccountNo:'' }}{{ expenseInfo&&expenseInfo.stateDictValue?'('+expenseInfo.stateDictValue+')':'' }}</span>
-          <span style="display: inline-block;border-right: none;padding: 10px;">合计金额:{{ (expenseInfo&&expenseInfo.applyExpenseTotal ||expenseInfo&&expenseInfo.applyExpenseTotal==0)?expenseInfo.applyExpenseTotal+'元':'' }}</span>
+          <span style="display: inline-block;width: 50%;padding: 10px;border-right: 1px solid #000000;">费用单号:{{ item.expenseInfo.expenseAccountNo?item.expenseInfo.expenseAccountNo:'' }}{{ item.expenseInfo.stateDictValue?'('+item.expenseInfo.stateDictValue+')':'' }}</span>
+          <span style="display: inline-block;border-right: none;padding: 10px;">合计金额:{{ (item.expenseInfo.applyExpenseTotal ||item.expenseInfo.applyExpenseTotal==0)?item.expenseInfo.applyExpenseTotal+'元':'' }}</span>
         </div>
         <div class="basics-item" style="width: 100%;border-bottom: 1px solid #000000;overflow: hidden;">
           <div style="border-right: none;float: left;padding: 10px 0 10px 10px;">主题:</div>
-          <div style="padding: 10px;text-align: center;font-weight: bold;">
-            {{ expenseInfo&&expenseInfo.title?expenseInfo.title:'' }}
+          <div style="padding: 10px 10px 10px 50px;text-align: center;font-weight: bold;">
+            {{ item.expenseInfo.title?item.expenseInfo.title:'' }}
           </div>
         </div>
         <div class="basics-item" style="width: 100%;border-bottom: 1px solid #000000;padding:0;margin:0;">
-          <span style="display: inline-block;width: 50%;padding: 10px;border-right: 1px solid #000000;border-right: none;">详细说明:</span>
-          <div style="padding:0 20px 20px;">
-            <div v-for="(item,index) in expenseInfo.content" :key="index+'-content'">
-              {{ item || '--' }}
+          <span style="display: inline-block;width: 100%;padding: 10px 10px 5px;border-right: 1px solid #000000;border-right: none;">详细说明:</span>
+          <div style="padding:0 20px 10px 40px;">
+            <div v-for="(ditem,index) in item.expenseInfo.content" :key="index+'-content'">
+              {{ ditem || '--' }}
             </div>
           </div>
         </div>
       </div>
-      <div class="container-fytable" style="padding:0 10px;" v-if="fyListData">
-        <p class="table-title">费用明细:</p>
+      <div class="container-fytable" style="padding:0 10px;" v-if="item.fyListData">
+        <div class="table-title" style="padding: 10px 0;">费用明细:</div>
         <table
           border="1"
           cellspacing="0"
           cellpadding="0"
-          style="width: 100%;border-collapse: collapse;border: 1px solid black;font-size:10pt;text-align: center;"
+          style="width: 100%;border-collapse: collapse;font-size:10pt;text-align: center;"
           align="center">
           <thead>
             <tr>
-              <th style="padding:5px 10px;width:8%;">序号</th>
-              <th style="padding:5px 10px;width:26%;">记账方</th>
+              <th style="padding:5px 10px;width:6%;">序号</th>
+              <th style="padding:5px 10px;width:22%;">记账方</th>
               <!-- <th style="padding:5px 10px;width:15%;">区域/省/市</th> -->
               <th style="padding:5px 10px;width:10%;">记账费用</th>
-              <th style="padding:5px 10px;width:26%;">费用承担方</th>
-              <th style="padding:5px 10px;width:20%;">产品信息</th>
+              <th style="padding:5px 10px;width:30%;">费用承担方</th>
+              <th style="padding:5px 10px;width:22%;">产品信息</th>
             </tr>
           </thead>
           <tbody>
-            <tr v-for="(item,index) in fyListData" :key="index">
-              <td style="text-align: center;width:8%;">{{ index+1 }}</td>
-              <td style="text-align: left;width:26%;padding:5px 10px;">
-                <div>{{ item.accountTypeDictValue }}</div>
-                <div>{{ item.accountName||'' }}</div>
-                <div v-if="item.accountNameFnumber">({{ item.accountNameFnumber }})</div>
+            <tr v-for="(fyItem,index) in item.fyListData" :key="index">
+              <td style="text-align: center;width:6%;">{{ index+1 }}</td>
+              <td style="text-align: left;width:22%;padding:0 10px;">
+                <div>{{ fyItem.accountTypeDictValue }}</div>
+                <div>{{ fyItem.accountName||'' }}</div>
+                <div v-if="fyItem.accountNameFnumber">({{ fyItem.accountNameFnumber }})</div>
               </td>
               <!-- <td style="text-align: left;width:15%;padding:5px 10px;">
-                <div>{{ item.subareaNames }}</div>
-                <div>{{ item.provinceName }}</div>
-                <div>{{ item.cityName }}</div>
+                <div>{{ fyItem.subareaNames }}</div>
+                <div>{{ fyItem.provinceName }}</div>
+                <div>{{ fyItem.cityName }}</div>
               </td> -->
-              <td style="text-align: right;width:10%;padding:5px 10px;">{{ item.expense||item.expense==0?toThousands(item.expense):'' }}</td>
-              <td style="text-align: left;width:26%;padding:5px 10px;vertical-align: top;">
-                <div v-for="(ditem,index) in item.detailSplitList" :key="ditem.id+'-'+index" style="padding: 3px 0;" >
+              <td style="text-align: right;width:10%;padding:0 10px;">{{ fyItem.expense||fyItem.expense==0?toThousands(fyItem.expense):'' }}</td>
+              <td style="text-align: left;width:30%;padding:0 10px;vertical-align: top;">
+                <div v-for="(ditem,index) in fyItem.detailSplitList" :key="ditem.id+'-'+index" style="padding: 3px 0;" >
                   {{ ditem.splitObjName }}
                   <span v-if="ditem.splitObjFnumber">({{ ditem.splitObjFnumber }})</span>
                   <span v-if="ditem.childDetailSplit&&ditem.childDetailSplit.splitObjName">/</span>
                   {{ ditem.childDetailSplit?ditem.childDetailSplit.splitObjName:'' }}: {{ ditem.childDetailSplit?toThousands(ditem.childDetailSplit.splitAmount):toThousands(ditem.splitAmount) }}
                 </div>
               </td>
-              <td style="text-align: left;width:20%;padding:5px 10px;vertical-align: top;">
-                <div v-for="ditem in item.detailProductsList" :key="ditem.id" style="padding: 3px 0;">
+              <td style="text-align: left;width:22%;padding:0 10px;vertical-align: top;">
+                <div v-for="ditem in fyItem.detailProductsList" :key="ditem.id" style="padding: 3px 0;">
                   <div v-if="ditem.productCode">{{ ditem.productCode }}: {{ toThousands(ditem.expense) }}</div>
                   <div v-else-if="ditem.productBrandName">{{ ditem.productBrandName }}<span v-if="ditem.productTypeShowName">/</span>{{ ditem.productTypeShowName }}: {{ toThousands(ditem.expense) }}</div>
                   <div v-else>{{ ditem.productTypeShowName }}: {{ toThousands(ditem.expense) }}</div>
@@ -82,7 +84,7 @@
           </tbody>
         </table>
       </div>
-      <div class="container-fytable" style="padding:0 10px 10px;" v-if="spListData">
+      <div class="container-fytable" style="padding:0 10px 10px;" v-if="item.spListData&&item.spListData.length">
         <p class="table-title">审批信息:</p>
         <table
           border="1"
@@ -102,86 +104,83 @@
             </tr>
           </thead>
           <tbody>
-            <tr style="height: 30px;padding: 5px;" v-for="(item,index) in spListData" :key="index">
+            <tr style="height: 30px;padding: 5px;" v-for="(spitem,index) in item.spListData" :key="index">
               <td style="padding:5px 10px;">{{ index+1||'' }}</td>
-              <td style="padding:5px 10px;text-align: left;">{{ item.userName||'' }}</td>
-              <td style="padding:5px 10px;">{{ item.userType||'' }}</td>
-              <td style="padding:5px 10px;">{{ item.state||'' }}</td>
-              <td style="padding:5px 10px;">{{ item.remark||'' }}</td>
-              <td style="padding:5px 10px;">{{ item.hasAttachments!= '0' ? '请在钉钉中查看附件内容' : '--' }}</td>
-              <td style="padding:5px 10px;">{{ item.date||'' }}</td>
+              <td style="padding:5px 10px;text-align: left;">{{ spitem.userName||'' }}</td>
+              <td style="padding:5px 10px;">{{ spitem.userType||'' }}</td>
+              <td style="padding:5px 10px;">{{ spitem.state||'' }}</td>
+              <td style="padding:5px 10px;">{{ spitem.remark||'' }}</td>
+              <td style="padding:5px 10px;">{{ spitem.hasAttachments!= '0' ? '请在钉钉中查看附件内容' : '--' }}</td>
+              <td style="padding:5px 10px;">{{ spitem.date||'' }}</td>
             </tr></tbody>
         </table>
       </div>
+      <div class="container-fytable" style="padding:0 10px 10px;" v-else>
+        <p class="table-title">审批信息:暂无</p>
+      </div>
     </div>
   </div>
-  <!-- </a-modal> -->
+  </div>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { expenseAcctDetailFindList, getProcessInstance } from '@/api/expenseManagement'
+import { jGPlPrint } from '@/libs/JGPrint.js'
 export default {
   mixins: [commonMixin],
-  props: {
-    showModal: {
-      type: Boolean,
-      default: false
-    },
-    detailSn: {
-      type: [Number, String],
-      default: ''
-    },
-    detailData: {
-      type: Object,
-      default: () => { return null }
-    }
-  },
   data () {
     return {
-      isShow: this.showModal,
-      fyListData: [],
-      spListData: [],
-      expenseInfo: null
+      list: [],
+      printNums: []
     }
   },
   methods: {
-    pageInfo () {
-      this.getFyList()
-      if (this.expenseInfo.state != 'WAIT_SUBMIT') {
-        this.getSpList()
-      }
+    setData (list) {
+      this.list = list
+      // list.map(item => {
+      //   this.printNums.push({
+      //     billType: 'FINANCE_BOOK_DETAIL',
+      //     billSn: item.bookDetailSn,
+      //     billNo: item.bookNo,
+      //     printType: '费用单打印'
+      //   })
+      // })
+      setTimeout(()=>{
+        this.prints()
+      },100)
     },
-    getFyList () {
-      expenseAcctDetailFindList({ expenseAccountSn: this.detailSn }).then(res => {
-        if (res.status == 200) {
-          this.fyListData = res.data
-        } else {
-          this.fyListData = []
-        }
+    // 打印
+    prints(){
+      const _this = this
+      const html = document.getElementsByClassName('expense-detail-print')
+      const printCons = []
+      for (let i = 0; i < html.length; i++) {
+        const h = html[i].clientHeight
+        printCons.push({
+          h: h,
+          t: html[i].innerHTML
+        })
+      }
+      // 排序从小到大
+      printCons.sort((a, b) => {
+        return a['h'] - b['h']
       })
-    },
-    getSpList () {
-      getProcessInstance({ businessType: 'EXPENSES', businessSn: this.detailSn }).then(res => {
-        if (res.status == 200) {
-          this.spListData = res.data
-        } else {
-          this.spListData = []
+
+      const htmlStr = []
+      for (let i = 0; i < printCons.length; i++) {
+        if (printCons[i].h > 560) {
+          htmlStr.push('')
+        }else{
+          printCons[i].t = '<div style="width:564pt;margin:0 auto;height:535px;">' +printCons[i].t+'</div>'
         }
-      })
-    }
-  },
-  // mounted () {
-  //   this.pageInfo()
-  // },
-  watch: {
-    detailData (nVal, oVal) {
-      if (nVal) {
-        this.expenseInfo = nVal
-        this.fyListData = []
-        this.spListData = []
-        this.pageInfo()
+        htmlStr.push(printCons[i].t)
       }
+      this.$store.state.app.curActionPermission = 'B_eRPrint'
+      // html, type, callback, printLogParams
+      jGPlPrint(htmlStr, 'preview', function (res) {
+        _this.$store.state.app.curActionPermission = ''
+        _this.$emit('printOk', res)
+      })
     }
   }
 }

+ 5 - 2
src/views/financialManagement/collectionDetailStatic/invoiceModal.vue

@@ -6,7 +6,7 @@
     :maskClosable="false"
     :footer="null"
     @cancel="cancel"
-    width="40%">
+    width="600px">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
         id="chooseCustom-form"
@@ -26,6 +26,9 @@
             v-model="form.invoiceDate"/>
           <div style="color:#999">如果没有开票,则不填写即可</div>
         </a-form-model-item>
+        <!-- <a-form-model-item label="备注:">
+          <a-textarea id="noticeEdit-remarks" rows="4" v-model="form.remarks" :maxlenght="100" placeholder="请输入备注(最多100字符)"></a-textarea>
+        </a-form-model-item> -->
         <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;margin-top: 50px;">
           <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
           <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">确定
@@ -64,7 +67,7 @@ export default {
           span: 6
         },
         wrapperCol: {
-          span: 18
+          span: 14
         }
       },
       form: {

+ 43 - 13
src/views/financialManagement/collectionDetailStatic/list.vue

@@ -107,7 +107,7 @@
               </a-col>
             </template>
             <a-col :md="24" :sm="24" style="text-align:center;">
-              <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="collectionDetail-refresh">查询</a-button>
+              <a-button type="primary" @click="searchForm" :disabled="disabled" id="collectionDetail-refresh">查询</a-button>
               <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="collectionDetail-reset">重置</a-button>
               <a-button
                 style="margin-left: 10px"
@@ -128,16 +128,6 @@
       </div>
     </a-card>
     <a-card size="small" :bordered="false" class="collectionDetail-wrap" style="margin-top:5px;">
-      <div>
-        <a-dropdown>
-          <a-menu slot="overlay" @click="handleMenuClick">
-            <a-menu-item key="1"> <a-icon type="printer" />批量允许打印 </a-menu-item>
-            <a-menu-item key="2"> <a-icon type="block" />批量设置开票 </a-menu-item>
-          </a-menu>
-          <a-button type="primary" ghost> 批量处理 <a-icon type="down" /></a-button>
-        </a-dropdown>
-        <span style="margin-left:10px;">已选{{ selNums }}项</span>
-      </div>
       <div class="gatherMessage">
         订单总金额:<strong> {{ toThousands(countData&&countData.orderAmount||0) }}</strong>;
         收款总金额:<strong>{{ toThousands(countData&&countData.receiptAmount||0) }}</strong>;
@@ -146,6 +136,16 @@
         余款抵扣总金额:<strong>{{ toThousands(countData&&countData.balanceAmount||0) }}</strong>;
         跨月打款总金额:<strong>{{ toThousands(countData&&countData.nextMonthAmount||0) }}</strong>;
       </div>
+      <div class="gatherMessage">
+        <a-dropdown>
+          <a-menu slot="overlay" @click="handleMenuClick">
+            <a-menu-item key="1"> <a-icon type="printer" />批量允许打印 </a-menu-item>
+            <a-menu-item key="2"> <a-icon type="block" />批量设置开票 </a-menu-item>
+          </a-menu>
+          <a-button type="primary" ghost> 批量处理 <a-icon type="down" /></a-button>
+        </a-dropdown>
+        <span v-if="selNums" style="margin-left:10px;">已选{{ selNums }}项</span>
+      </div>
       <a-spin :spinning="spinning" tip="Loading...">
         <!-- 列表 -->
         <s-table
@@ -333,7 +333,7 @@ export default {
       this.invoiceIsShow = false
       this.noteIsShow = false
       this.printIsShow = false
-      this.$refs.table.refresh(true)
+      this.searchForm()
     },
     getCount (params) {
       financeBookReportDetailCount(params).then(res => {
@@ -342,6 +342,30 @@ export default {
     },
     handleMenuClick (e) {
       console.log('click', e)
+      const _this = this
+      const rows = _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows || []
+      const slen = rows.length
+      if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && slen < 1)) {
+        _this.$message.warning('请在列表勾选后再进行批量操作!')
+        return false
+      }
+
+      if(e.key == 1){ // 批量允许打印
+        const dataList = rows.filter(item => item.printStatus=='NO_PRINT' || item.printStatus=='PRINT')
+        this.$confirm({
+        title: '批量允许打印',
+        content: `已选有效数据 ${dataList.length} 条,确认将收款打印状态变更为允许打印吗?`,
+        okText: '确定',
+        centered: true,
+        cancelText: '取消',
+        onOk () {
+           // 批量允许打印接口
+        }
+      })
+      }
+      if(e.key == 2){ // 批量开票
+        
+      }
     },
     // 表格选中项
     rowSelectionFun (obj) {
@@ -372,6 +396,10 @@ export default {
       this.queryParam.auditBeginDate = date[0] ? date[0] : ''
       this.queryParam.auditEndDate = date[1] ? date[1] : ''
     },
+    searchForm(){
+      this.$refs.table.refresh(true)
+      this.$refs.table.clearSelected()
+    },
     //  重置
     resetSearchForm () {
       // 审核日期
@@ -410,16 +438,18 @@ export default {
       this.queryParam.invoiceDateType = undefined
       this.queryParam.invoiceDate = ''
       this.queryParam.payerType = undefined
-      this.$refs.table.refresh(true)
+      this.searchForm()
     },
     //  导出
     handleExport () {
       const _this = this
       _this.exportLoading = true
       _this.spinning = true
+      _this.$store.state.app.curActionPermission = 'M_FC_Details_Export'
       hdExportExcel(financeBookDetailExport, _this.queryParam, '财务收款明细统计', function () {
         _this.exportLoading = false
         _this.spinning = false
+        _this.$store.state.app.curActionPermission = ''
       })
     },
     pageInit () {

+ 42 - 4
src/views/power/role/menuModal.vue

@@ -28,9 +28,11 @@
             :autoExpandParent="autoExpandParent"
             v-model="checkedKeys"
             :treeData="treeData"
-          />
+          >
+          <a-icon v-if="authType == 0" slot="switcherIcon" type="file" />
+          </a-tree>
           </div>
-          <a-form-model-item :label-col="{span: 0}" :wrapper-col="{span: 24}" style="text-align: center;">
+          <a-form-model-item :label-col="{span: 0}" :wrapper-col="{span: 24}" style="text-align: center;margin: 18px 0 0;">
             <a-button type="primary" id="roleMenuEdit-save" @click="handleSubmit()" :style="{ marginRight: '8px' }">保存</a-button>
             <a-button id="roleMenuEdit-cancel" :style="{ marginLeft: '8px' }" @click="isshow=false">取消</a-button>
           </a-form-model-item>
@@ -91,7 +93,7 @@ export default {
       // this.autoExpandParent = false
     },
     onCheck (checkedKeys, info) {
-      console.log(checkedKeys, info.halfCheckedKeys)
+      // console.log(checkedKeys, info.halfCheckedKeys)
       this.halfCheckedKeys = info.halfCheckedKeys
       this.checkedKeys = checkedKeys
     },
@@ -148,6 +150,7 @@ export default {
           if(_this.isPriceNode(node)){
             data.splice(i,1)
           }else{
+            node.class = 'isLeaf'
             const hasNode = arr.find(item => item == node.id)
             const hasCheck = _this.checkedKeys.find(item => item == node.id)
             if (hasNode && !hasCheck) {
@@ -166,6 +169,7 @@ export default {
         if(!_this.isPriceNode(node)){
           // 删除此节点
           node.checkable = false
+          node.title = node.title.replace('(必选)','')
           if(!node.children||node.children.length==0){
             data.splice(i,1)
           }
@@ -195,6 +199,7 @@ export default {
       this.checkedData = arr ? arr.split(',') : []
       // 找出叶子节点
       const treeData = this.nowData.allMenuList
+      
       this.expandedKeys.push(treeData.id)
       if(this.authType == 1){
         this.findLeaf(treeData, this.checkedData)
@@ -206,6 +211,21 @@ export default {
       // console.log(this.checkedData)
       // console.log(this.checkedKeys)
       this.treeData = treeData
+
+      if(this.authType == 0){
+        let leafNodes = []
+        setTimeout(()=>{
+          if(leafNodes.length == 0){
+            leafNodes = document.querySelectorAll('ul > li.leafNode:first-child')
+            for(let i=0;i<leafNodes.length;i++){
+              const cn = leafNodes[i].parentNode.className
+              leafNodes[i].parentNode.className += cn.indexOf('leafParent')<0 ? ' leafParent' : ''
+              leafNodes[i].parentNode.parentNode.style.padding = '6px 0'
+            }
+          }
+        },100)
+      }
+      
     }
   },
   watch: {
@@ -260,10 +280,28 @@ export default {
     -webkit-box-shadow: inset 0 0 2px #d1d1d1;
     background: #e4e4e4;
   }
+  .ant-tree li ul{
+    white-space: pre-wrap;
+  }
+
+  .leafParent{
+    display: inline-block;
+    width: 80%;
+    float: right;
+  }
+  
+  .isLeaf{
+    display: inline-block;
+    width: 25%;
+  }
   .leafNode{
     display: inline-block;
+    padding: 0;
+    &:first-child{
+      padding: 0;
+    }
     .ant-tree-node-content-wrapper{
-      color: red;
+      color: rgb(209, 4, 4);
     }
   }
 }

+ 17 - 16
src/views/salesManagement/salesQuery/detail.vue

@@ -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_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="$hasPermissions(authCode + '_salesPrice')">总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions(authCode + '_costPrice')">总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions(authCode + '_costPrice')">总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions(authCode + '_salesPrice')">已取消金额:<strong>{{ detailData&&(detailData.totalCancelAmount || detailData.totalCancelAmount==0) ? toThousands(detailData.totalCancelAmount) : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions(authCode + '_salesPrice')">已下推金额:<strong>{{ detailData&&(detailData.totalPushedAmount || detailData.totalPushedAmount==0) ? toThousands(detailData.totalPushedAmount) : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions(authCode + '_salesPrice')">待下推金额:<strong>{{ detailData&&(detailData.totalUnpushedAmount || detailData.totalUnpushedAmount==0) ? toThousands(detailData.totalUnpushedAmount) : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions(authCode + '_salesPrice')">已发货金额:<strong>{{ detailData&&(detailData.totalDispatchAmount || detailData.totalDispatchAmount==0) ? toThousands(detailData.totalDispatchAmount) : '--' }}</strong>;</span>
+                <span v-if="$hasPermissions(authCode + '_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_salesDetail_cityPrice')"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
+                <a-checkbox v-model="isCityPrice" v-if="$hasPermissions(authCode + '_cityPrice')"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
               </div>
             </div>
           </div>
@@ -219,6 +219,7 @@ export default {
       disabled: false,
       showDsModal: false,
       showStockOut: false,
+      authCode: '',
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -303,22 +304,22 @@ 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_salesDetail_costPrice')) { //  成本价权限
+      if (this.$hasPermissions(this.authCode + '_costPrice')) { //  成本价权限
         arr.splice(4, 0, { title: '成本价', dataIndex: 'showCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
 
-      const ind = this.$hasPermissions('B_salesDetail_costPrice') ? 5 : 4
-      if(this.$hasPermissions('B_salesDetail_provincePrice')){
+      const ind = this.$hasPermissions(this.authCode + '_costPrice') ? 5 : 4
+      if(this.$hasPermissions(this.authCode + '_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.$hasPermissions('B_salesDetail_salesPrice')) { //  售价权限
+        if (this.$hasPermissions(this.authCode + '_salesPrice')) { //  售价权限
           arr.splice(ind + 2, 0, { title: '销售价', dataIndex: 'price', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         }
       } else {
-        if (this.$hasPermissions('B_salesDetail_salesPrice')) { //  售价权限
+        if (this.$hasPermissions(this.authCode + '_salesPrice')) { //  售价权限
           arr.splice(ind + 1, 0, { title: '销售价', dataIndex: 'price', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
         }
       }
@@ -421,8 +422,7 @@ export default {
       // 销售分类导出
       if (type == 'typeExport') {
         const params = {
-          salesBillSn: this.bizSn || this.$route.params.sn,
-          showCostFlag: this.$hasPermissions('B_salesDetail_costPrice')
+          salesBillSn: this.bizSn || this.$route.params.sn
         }
         _this.spinning = true
         exportExcel(salesDetailTypeExcel, params, '销售分类' + moment().format('YYYYMMDDHHmmss'), () => { 
@@ -470,6 +470,7 @@ export default {
   beforeRouteEnter (to, from, next) {
     next(vm => {
       vm.fromRouter = from
+      vm.authCode = to.meta.permission
     })
   }
 }

+ 0 - 1
src/views/salesManagement/sendOutOrder/list.vue

@@ -64,7 +64,6 @@
                     <Area id="sendOut-provinceSn" v-model="queryParam.provinceSn" placeholder="请选择省"></Area>
                   </a-form-model-item>
                 </a-form-model-item>
-                </a-form-model-item>
               </a-col>
             </template>
             <a-col :md="6" :sm="24">