Browse Source

Merge branch 'develop_yh69' of jianguan-web/qpls-md-html into pre-release

李磊 1 day ago
parent
commit
1dd776f6ba

BIN
public/lodop/CLodop_Setup_for_Win32NT.exe


BIN
public/lodop/CLodop_Setup_for_Win64NT_6.628EN.exe


BIN
public/lodop/clodop.png


+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1753080682372
+  "version": 1754018781933
 }

+ 36 - 0
src/api/reportData.js

@@ -568,6 +568,41 @@ export const linkageGroupList = (params) => {
     }
   })
 }
+// 销售利润报表-分页列表
+export const reportSalesProfitList = (params) => {
+  const url = `/report/reportSalesProfit/reportPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('销售利润报表列表查询')
+    }
+  })
+}
+// 销售利润报表-列表合计
+export const reportSalesProfitCount = (params) => {
+  return axios({
+    url: '/report/reportSalesProfit/reportCount',
+    data: params,
+    method: 'post'
+  })
+}
+// 销售利润报表  导出
+export const reportSalesProfitExport = params => {
+  return axios.request({
+    url: `/report/reportSalesProfit/export`,
+    data: params,
+    method: 'post',
+    responseType: 'blob',
+    headers: {
+      'module': encodeURIComponent('导出')
+    }
+  })
+}
+
 // 销售报表  导出
 export const reportSalesBillExport = params => {
   return axios.request({
@@ -592,6 +627,7 @@ export const reportSalesBillDetailExport = params => {
     }
   })
 }
+
 // 盘点报表  盘点单报表 列表 分页
 export const reportCheckWarehouseList = (params) => {
   const url = `/report/reportCheckWarehouse/reportPage/${params.pageNo}/${params.pageSize}`

+ 11 - 5
src/components/Table/index.js

@@ -134,7 +134,13 @@ export default {
       showTotal: total => `共 ${total} 条记录`,
       showSizeChanger: this.showSizeChanger
     }) || false
-    this.needTotalList = this.initTotalList(this.columns)
+    const columns = this.columns
+    columns.forEach(item => {
+      if(item.sorter){
+        item.sortDirections = ['descend', 'ascend','']
+      }
+    })
+    this.needTotalList = this.initTotalList(columns)
     this.localSorter = null
     if (this.defaultLoadData) {
       this.loadData()
@@ -170,8 +176,9 @@ export default {
      * @param {Object} sorter 排序条件
      */
     loadData (pagination, filters, sorter) {
-      console.log(sorter)
+      // console.log(sorter,this.localSorter)
       this.localLoading = true
+      this.localSorter = sorter
       const parameter = Object.assign({
         pageNo: (pagination && pagination.current) ||
           this.showPagination && this.localPagination.current || this.pageNum,
@@ -180,16 +187,15 @@ export default {
         tableId: this.tableId,
         index: this.index
       },
-      (sorter && sorter.field && {
+      (sorter && sorter.field &&sorter.order && {
         sortField: sorter.field
-      }) || this.localSorter && {sortField: this.localSorter.field},
+      }) || this.localSorter && this.localSorter.order && {sortField: this.localSorter.field},
       (sorter && sorter.order && {
         sortOrder: sorter.order
       }) || this.localSorter && {sortOrder: this.localSorter.order}, {
         ...filters
       }
       )
-      this.localSorter = sorter
       // console.log('parameter', parameter)
       const result = this.data(parameter)
       // 对接自己的通用数据接口需要修改下方代码中的 r.pageNo, r.count, r.data

+ 25 - 22
src/config/router.config.js

@@ -2460,6 +2460,31 @@ export const asyncRouterMap = [
           permission: 'M_reportData'
         },
         children: [
+          {
+            path: '/reportData/salesProfitReport',
+            redirect: '/reportData/salesProfitReport/index',
+            name: 'salesProfitReport',
+            component: BlankLayout,
+            meta: {
+              title: '销售利润报表',
+              icon: 'profile',
+              permission: 'M_salesProfitReportList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'index',
+                name: 'salesProfitReportIndex',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesProfitReport/list.vue'),
+                meta: {
+                  title: '销售利润报表',
+                  icon: 'profile',
+                  hidden: true,
+                  permission: 'M_salesProfitReportList'
+                }
+              },
+            ]
+          },
           {
             path: '/reportData/salesReport',
             redirect: '/reportData/salesReport/index',
@@ -2483,28 +2508,6 @@ export const asyncRouterMap = [
                   permission: 'M_salesReportList,M_salesDetailReportList'
                 }
               },
-              {
-                path: 'list',
-                name: 'salesReportList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesReport/list.vue'),
-                meta: {
-                  title: '销售报表列表',
-                  icon: 'profile',
-                  hidden: true,
-                  permission: 'M_salesReportList'
-                }
-              },
-              {
-                path: 'list',
-                name: 'salesDetailReportList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/salesDetailReport/list.vue'),
-                meta: {
-                  title: '销售明细报表列表',
-                  icon: 'profile',
-                  hidden: true,
-                  permission: 'M_salesDetailReportList'
-                }
-              }
             ]
           },
           {

+ 19 - 14
src/libs/JGPrint.js

@@ -10,7 +10,7 @@ export const JGPrintTag = function (width, height, data) {
   if (!LODOP) {
     confirm({
       title: '提示?',
-      content: h => <div>打印控件未安装,请先下载并安装。安装完成后,刷新页面即可打印。</div>,
+      content: h => <div><div>1.如果已安装过打印控件,双击桌面上的C-Lodop (Print)图标启动服务,然后按F5刷新页面再试</div><div>2.打印控件未安装,请先下载并安装。安装完成后,按F5刷新页面即可打印。</div></div>,
       okText: '立即下载',
       okType: 'danger',
       cancelText: '暂不打印',
@@ -18,9 +18,9 @@ export const JGPrintTag = function (width, height, data) {
       onOk () {
         var agent = navigator.userAgent.toLowerCase()
         if (agent.indexOf('win32') >= 0 || agent.indexOf('wow32') >= 0) {
-          window.open('https://demo.lodop.net:8443/Lodop6.226_Clodop6.594.zip')
+          window.open('/lodop/CLodop_Setup_for_Win32NT.exe')
         } else if (agent.indexOf('win64') >= 0 || agent.indexOf('wow64') >= 0) {
-          window.open('https://www.lodop.net/download/CLodop_Setup_for_Win64NT_6.611EN.zip')
+          window.open('/lodop/CLodop_Setup_for_Win64NT_6.628EN.exe')
         }
       }
     })
@@ -34,8 +34,7 @@ export const JGPrintTag = function (width, height, data) {
   const tline1 = (data.shelfName.length > 17 ? 2 : 1)
   const top0 = top + tline * 5
   const top1 = top0 + 5
-  const top2 = top1 + 10
-  const top3 = top2 + 6
+  let top2 = top1 + 10.5
   // 经销商名称
   LODOP.SET_PRINT_STYLE('TextNeatRow', true)
   LODOP.SET_PRINT_STYLE('FontSize', 10)
@@ -48,21 +47,27 @@ export const JGPrintTag = function (width, height, data) {
   LODOP.ADD_PRINT_TEXT(top0 + 'mm', '3mm', '54mm', '10mm', tline1 > 1 ? data.shelfName.substring(0, 14) + '...' : data.shelfName)
   LODOP.SET_PRINT_STYLEA(0, 'Alignment', 2)
   LODOP.SET_PRINT_STYLEA(0, 'Horient', 2)
+  // 二维码
+  LODOP.ADD_PRINT_BARCODE(top1 + 'mm', '4mm', 80, 80, 'QRCode', data.qrCodeContent)
+  LODOP.SET_PRINT_STYLE('QRCodeVersion', 5)
   // 货位号
   LODOP.SET_PRINT_STYLE('TextNeatRow', true)
   LODOP.SET_PRINT_STYLE('FontSize', 30)
-  LODOP.ADD_PRINT_TEXT(top1 + 'mm', '50%', '28mm', '15mm', data.shelfPlaceCode)
+  LODOP.ADD_PRINT_TEXT(top1 + 'mm', '42%', '35mm', '15mm', data.shelfPlaceCode)
   // 产品编码
+  const codeLen = data.productCode.length
   LODOP.SET_PRINT_STYLE('TextNeatRow', true)
   LODOP.SET_PRINT_STYLE('FontSize', 12)
-  LODOP.ADD_PRINT_TEXT(top2 + 'mm', '50%', '30mm', '15mm', data.productCode)
-  // 二维码
-  LODOP.ADD_PRINT_BARCODE(top1 + 'mm', '6mm', 80, 80, 'QRCode', data.qrCodeContent)
-  LODOP.SET_PRINT_STYLE('QRCodeVersion', 5)
+  LODOP.ADD_PRINT_TEXT(top2 + 'mm', '42%', '35mm', '11mm', data.productCode.slice(0,15))
+  if(codeLen>15){
+    top2 = top2 + 3.5
+    LODOP.ADD_PRINT_TEXT(top2 + 'mm', '42%', '35mm', '11mm', data.productCode.slice(15))
+  }
   // 时间
+  let top3 = top2 + 5
   LODOP.SET_PRINT_STYLE('TextNeatRow', true)
   LODOP.SET_PRINT_STYLE('FontSize', 9)
-  LODOP.ADD_PRINT_TEXT(top3 + 'mm', '50%', '30mm', '15mm', data.printTime)
+  LODOP.ADD_PRINT_TEXT(top3 + 'mm', '42%', '30mm', '10mm', data.printTime)
   // LODOP.SET_PRINT_STYLE("QRCodeErrorLevel",'H')
   // 指定打印机
   LODOP.SET_PRINTER_INDEX(store.state.app.printDefNeedle)
@@ -280,16 +285,16 @@ export const jGPrint = function (data, type, printerType, taskName) {
     if (!LODOP) {
       confirm({
         title: '提示?',
-        content: h => <div>打印控件未安装,请先下载并安装。安装完成后,刷新页面即可打印。</div>,
+        content: h => <div><div>1.如果已安装过打印控件,双击桌面上的C-Lodop (Print)图标启动服务,然后按F5刷新页面再试</div><div>2.打印控件未安装,请先下载并安装。安装完成后,按F5刷新页面即可打印。</div></div>,
         okText: '立即下载',
         okType: 'danger',
         cancelText: '暂不打印',
         onOk () {
           var agent = navigator.userAgent.toLowerCase()
           if (agent.indexOf('win32') >= 0 || agent.indexOf('wow32') >= 0) {
-            window.open('https://demo.lodop.net:8443/Lodop6.226_Clodop6.594.zip')
+            window.open('/lodop/CLodop_Setup_for_Win32NT.exe')
           } else if (agent.indexOf('win64') >= 0 || agent.indexOf('wow64') >= 0) {
-            window.open('https://www.lodop.net/download/CLodop_Setup_for_Win64NT_6.594EN.zip')
+            window.open('/lodop/CLodop_Setup_for_Win64NT_6.628EN.exe')
           }
         }
       })

+ 14 - 0
src/views/common/hideCellMenus.js

@@ -12,6 +12,12 @@ const HideCellMenus = {
      </a-dropdown>
     `,
   props: {
+    value: {
+      type: Array,
+      default: function () {
+        return []
+      }
+    },
     defHiddenKes: {
       type: Array,
       defatut: function () {
@@ -53,6 +59,14 @@ const HideCellMenus = {
         this.$emit('input', hidekey)
       },
       immediate: true
+    },
+    value: {
+      handler: function (val) {
+        this.list.forEach(item => {
+          item.checked = !val.includes(item.key)
+        })
+      },
+      immediate: true
     }
   },
   methods: {

+ 17 - 2
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -83,10 +83,15 @@
                 </a-form-item>
               </a-col>
             </template>
-            <a-col :md="12" :sm="24">
-              <div style="margin-bottom: 10px;">
+            <a-col :md="6" :sm="24">
+              <div style="margin-top: 6px;">
                 <a-checkbox v-model="queryParam.zeroQtyFlag" id="inventoryQueryList-zeroQtyFlag">只查看有库存</a-checkbox>
                 <a-checkbox v-model="queryParam.enableFlag" :checked="queryParam.enableFlag" id="inventoryQueryList-enableFlag">包括禁用产品</a-checkbox>
+                <a-checkbox v-model="queryParam.freezeQtyFlag" :checked="queryParam.freezeQtyFlag" id="inventoryQueryList-freezeQtyFlag">只查冻结产品</a-checkbox>
+              </div>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <div style="margin-bottom: 10px;">
                 <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryQueryList-refresh">查询</a-button>
                 <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryQueryList-reset">重置</a-button>
                 <a-button
@@ -204,6 +209,7 @@ export default {
         warehouseLocationSn: '', // 仓位sn
         zeroQtyFlag: false, //  库存情况
         enableFlag: true, // 显示禁用产品
+        freezeQtyFlag: false, // 冻结产品
         minUnsalableDays: undefined, // 滞销天数最小值
         maxUnsalableDays: undefined, // 滞销天数最大值
         productSysFlag: undefined // 产品来源,箭冠or自建
@@ -222,6 +228,7 @@ export default {
         if (this.checkValueRange()) {
           this.disabled = true
           this.spinning = true
+          console.log(parameter, '------------')
           // 排序
           if (parameter.sortField == 'currentStockQty') {
             parameter.sortField = 'currentStockQty'
@@ -235,10 +242,16 @@ export default {
             parameter.sortField = 'unsalableDays'
             parameter.sortAlias = ''
           }
+          if (parameter.sortField == 'freezeQty') {
+            parameter.sortField = 'stockFreezeQty'
+            parameter.sortAlias = ''
+          }
           const params = Object.assign(parameter, this.queryParam)
           // 格式化数据
           params.zeroQtyFlag = params.zeroQtyFlag ? '0' : ''
           params.enableFlag = params.enableFlag ? '' : '1'
+          params.freezeQtyFlag = params.freezeQtyFlag ? '1' : ''
+
           params.product = {
             sysFlag: params.productSysFlag || undefined
           }
@@ -377,6 +390,7 @@ export default {
       this.queryParam.brandName = undefined
       this.queryParam.productTypeName = undefined
       this.queryParam.zeroQtyFlag = false
+      this.queryParam.freezeQtyFlag = false
       this.queryParam.warehouse = []
       this.queryParam.warehouseSn = ''
       this.queryParam.warehouseLocationSn = ''
@@ -417,6 +431,7 @@ export default {
       const params = JSON.parse(JSON.stringify(this.queryParam))
       params.zeroQtyFlag = params.zeroQtyFlag ? '0' : ''
       params.enableFlag = params.enableFlag ? '' : '1'
+      params.freezeQtyFlag = params.freezeQtyFlag ? '1' : ''
       params.showCost = this.$hasPermissions('M_ShowAllCost') ? 1 : 0
       // 仓库仓位
       params.warehouseSn = params.warehouse[0]

+ 3 - 3
src/views/numsGoodsShelves/shelfProductTempl/addHwModal.vue

@@ -17,7 +17,7 @@
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol">
         <a-form-model-item label="货位号" prop="shelfPlaceCode">
-          <a-input id="shelfSet-newHw-shelfPlaceCode" v-model="form.shelfPlaceCode" @input="placeCodeBlur" placeholder="请输入货位号(字母+数字格式)"></a-input>
+          <a-input id="shelfSet-newHw-shelfPlaceCode" v-model="form.shelfPlaceCode" @input="placeCodeBlur" placeholder="请输入货位号(首字母+数字)格式,例:A01、A02、A0323"></a-input>
         </a-form-model-item>
         <a-form-model-item label="绑定产品" prop="productSn">
           <productJqList id="shelfSet-newHw-productJqList" ref="productJqList" dataType="jg" @change="productJqChange"></productJqList>
@@ -107,8 +107,8 @@ export default {
         shelfPlaceCode: [
           { required: true, message: '请输入货位号', trigger: 'blur' },
           {
-          	pattern: /^[a-zA-Z]{1}[0-9]{1,29}$/g,
-          	message: '货位号必需字母+数字,且不能超过30个字符'
+          	pattern: /^[a-zA-Z]{1}[0-9]{1,5}$/g,
+          	message: '货位号必需首字母+数字,且不能超过6个字符'
           }
         ],
         productSn: [{ required: true, message: '请选择产品', trigger: 'blur' }],

+ 2 - 2
src/views/numsGoodsShelves/shelfSet/addHwModal.vue

@@ -18,7 +18,7 @@
         :wrapper-col="formItemLayout.wrapperCol">
         <a-form-model-item label="货架名称">{{ nowData&&nowData.shelfName || '--' }}</a-form-model-item>
         <a-form-model-item label="货位号" prop="shelfPlaceCode">
-          <a-input id="shelfSet-newHw-shelfPlaceCode" v-model="form.shelfPlaceCode" @input="placeCodeBlur" placeholder="请输入货位号(字母+数字格式)"></a-input>
+          <a-input id="shelfSet-newHw-shelfPlaceCode" v-model="form.shelfPlaceCode" @input="placeCodeBlur" placeholder="请输入货位号(首字母+数字)格式,例:A01、A02、A0323"></a-input>
         </a-form-model-item>
         <a-form-model-item label="绑定产品" v-if="type=='add'">
           <productJqList id="shelfSet-newHw-product" ref="productJqList" :params="{customerSn:nowData&&nowData.customerSn}" @change="productJqChange"></productJqList>
@@ -111,7 +111,7 @@ export default {
       rules: {
         shelfPlaceCode: [
           { required: true, message: '请输入货位号', trigger: 'blur' },
-          { pattern: /^[a-zA-Z]{1}[0-9]{1,29}$/g, message: '货位号必需字母+数字,且不能超过30个字符' }
+          { pattern: /^[a-zA-Z]{1}[0-9]{1,5}$/g, message: '货位号必需首字母+数字,且不能超过6个字符' }
         ],
         price: [{ required: true, message: '请输入销售价', trigger: 'blur' }],
         cost: [{ required: true, message: '请输入结算价', trigger: 'blur' }],

+ 18 - 1
src/views/numsGoodsShelves/shelfSet/bindProductModal.vue

@@ -17,7 +17,12 @@
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol">
         <a-form-model-item label="货架名称">{{ nowData&&nowData.shelfName || '--' }}</a-form-model-item>
-        <a-form-model-item label="货位号">{{ nowData&&nowData.shelfPlaceCode || '--' }}</a-form-model-item>
+        <a-form-model-item label="货位号" v-if="type != 'edit'">
+          {{ nowData&&nowData.shelfPlaceCode }}
+        </a-form-model-item>
+        <a-form-model-item label="货位号" prop="shelfPlaceCode" v-if="type == 'edit'">
+          <a-input id="shelfSet-newHw-shelfPlaceCode" v-model="form.shelfPlaceCode" @input="placeCodeBlur" placeholder="请输入货位号(首字母+数字)格式,例:A01、A02、A0323"></a-input>
+        </a-form-model-item>
         <a-form-model-item :label="type == 'replace' ? '原绑定产品':'绑定产品'" v-if="type != 'bind'">
           {{ productInfo&&productInfo.productCode }}
           <p style="margin: 0;">{{ productInfo&&productInfo.productName || '--' }}</p>
@@ -100,6 +105,7 @@ export default {
         wrapperCol: { span: 18 }
       },
       form: {
+        shelfPlaceCode: '', // 货位号
         productSn: undefined, // 产品sn
         productCode: undefined, // 产品编码
         price: '', // 车主价
@@ -107,6 +113,10 @@ export default {
         maxQty: '' // 最大库容
       },
       rules: {
+        shelfPlaceCode: [
+          { required: true, message: '请输入货位号', trigger: 'blur' },
+          { pattern: /^[a-zA-Z]{1}[0-9]{1,5}$/g, message: '货位号必需首字母+数字,且不能超过6个字符' }
+        ],
         productSn: [{ required: true, message: '请选择绑定产品', trigger: 'change' }],
         price: [{ required: true, message: '请输入销售价', trigger: 'change' }],
         cost: [{ required: true, message: '请输入结算价', trigger: 'change' }],
@@ -131,6 +141,12 @@ export default {
     }
   },
   methods: {
+    // 货位号变更
+    placeCodeBlur (v) {
+      this.$nextTick(() => {
+        this.form.shelfPlaceCode = this.form.shelfPlaceCode.toLocaleUpperCase()
+      })
+    },
     // 选择产品
     productJqChange (obj) {
       this.form.productSn = obj.key || undefined
@@ -180,6 +196,7 @@ export default {
           if (this.type == 'edit') {
             this.form.productSn = res.data.productSn
             this.form.productCode = res.data.productCode
+            this.form.shelfPlaceCode = this.nowData ? this.nowData.shelfPlaceCode : ''
           }
           this.form.price = res.data.price
           this.form.cost = res.data.cost

+ 23 - 6
src/views/numsGoodsShelves/shelfSet/set.vue

@@ -169,7 +169,13 @@
               v-if="!(record.shelfProductApiEntity&&record.shelfProductApiEntity.productSn)"
               @click="handleDel(record)"
             >删除</a-button>
-            <a-button size="small" type="link" :id="'shelfSet-print-'+record.id" class="button-primary" @click.stop="handlePrintSticker(record)">打印贴签</a-button>
+            <a-button
+              size="small"
+              v-if="record.shelfProductApiEntity&&record.shelfProductApiEntity.productSn"
+              type="link"
+              :id="'shelfSet-print-'+record.id"
+              class="button-primary"
+              @click.stop="handlePrintSticker(record)">打印贴签</a-button>
           </template>
         </s-table>
       </a-card>
@@ -177,9 +183,20 @@
     <!-- 基础设置 -->
     <basic-info-modal :openModal="openInfoModal" :nowData="basicInfoData" @ok="handleInfoOk" @close="openInfoModal=false" />
     <!-- 修改信息/绑定产品/更换产品 -->
-    <bind-product-modal :openModal="openModal" :type="modalType" :nowData="nowData" @ok="$refs.table.refresh()" @close="handleCancel" />
+    <bind-product-modal
+      :openModal="openModal"
+      :type="modalType"
+      :nowData="nowData"
+      @ok="$refs.table.refresh()"
+      @close="handleCancel" />
     <!-- 编辑、新增货位 -->
-    <addHwModal :openModal="openHwModal" :type="modalType" :nowData="nowData" @ok="$refs.table.refresh()" @close="handleCancel" />
+    <addHwModal
+      ref="addHwModal"
+      :openModal="openHwModal"
+      :type="modalType"
+      :nowData="nowData"
+      @ok="$refs.table.refresh()"
+      @close="handleCancel" />
     <!-- 更换产品 -->
     <common-modal
       :openModal="openTipsModal"
@@ -215,7 +232,7 @@ import importHuoweiModal from './importHuoweiModal.vue' // 导入货位模板
 import shelfTemplate from '@/views/common/shelfTemplate' // 货架模板下拉组件
 import printView from '../replenishmentManagement/printView.vue' // 打印贴签组件
 // 接口
-import { shelfDetail, shelfProductList, shelfProductBatchInsert, delShelfPlaceSn, shelfProductEnable, getShelfPriceShow, shelfProductExport, importShelfTemplate } from '@/api/shelf'
+import { shelfDetail, shelfProductList, shelfProductBatchInsert, delShelfPlaceSn, shelfProductEnable, getShelfPriceShow, shelfProductExport, importShelfTemplate, addPlaceAndProduct } from '@/api/shelf'
 export default {
   name: 'ShelfMonitoringWarehousing',
   components: { STable, VSelect, commonModal, bindProductModal, addHwModal, ImportGuideModal, basicInfoModal, importHuoweiModal, shelfTemplate, printView },
@@ -455,11 +472,11 @@ export default {
       this.openModal = true
     },
     // 编辑弹框取消
-    handleCancel () {
+    handleCancel (type) {
       this.modalType = null
       this.nowData = null
-      this.openModal = false
       this.openHwModal = false
+      this.openModal = false
     },
     // 导入成功
     handleGuideOk (obj) {

+ 29 - 7
src/views/reportData/salesDetailReport/list.vue

@@ -1,6 +1,6 @@
 <template>
   <a-spin :spinning="spinning" tip="Loading...">
-    <a-alert :show-icon="false" type="error" message="注:销售单报表包含急件销售数量、售价,销售明细报表不包含急件销售数量、成本、售价" banner style="margin-bottom: 10px;" />
+    <a-alert :show-icon="false" type="error" message="注:报表中成本包含急件冲减的成本" banner style="margin-bottom: 10px;" />
     <!-- 搜索条件 -->
     <div class="table-page-search-wrapper">
       <a-form-model
@@ -106,8 +106,24 @@
                 <AreaList id="salesDetailReportList-area" changeOnSelect ref="areaList" @change="areaChange"></AreaList>
               </a-form-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户关系">
+                <v-select code="CUSTOMER_RELATION_TYPE" id="salesReportList-customerRelationType" v-model="queryParam.customerRelationType" allowClear placeholder="请选择客户关系"></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="急件">
+                <v-select
+                  v-model="queryParam.urgentBillStatus"
+                  ref="status"
+                  id="salesReportList-status"
+                  code="URGENT_STATUS"
+                  placeholder="请选择急件状态"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
           </template>
-          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+          <a-col :md="advanced?24:6" :sm="24" style="margin-bottom: 10px;" :style="{textAlign:advanced?'center':''}">
             <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesDetailReportList-refresh">查询</a-button>
             <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesDetailReportList-reset">重置</a-button>
             <a-button
@@ -205,7 +221,10 @@ export default {
         warehouseSn: undefined, //  仓库
         warehouseLocationSn: undefined, // 仓位
         salesBillNo: '', // 销售单号
-        salesManName: '' // 销售员
+        salesManName: '', // 销售员
+        state: undefined, // 业务状态
+        customerRelationType: undefined, // 客户关系
+        urgentBillStatus: undefined // 急件状态
       },
       rules: {
         'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }]
@@ -257,9 +276,10 @@ export default {
         { title: '客户名称', dataIndex: 'salesTargetName', width: '8%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品编码', dataIndex: 'productEntity.code', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '急件', dataIndex: 'urgentBillStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌', dataIndex: 'productEntity.productBrandName', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '二级分类', dataIndex: 'productTypeName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '二级分类', dataIndex: 'productTypeName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '10%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单位', dataIndex: 'productEntity.unit', width: '3%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '数量', dataIndex: 'productQty', width: '3%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -271,8 +291,8 @@ export default {
         { title: '审核时间', dataIndex: 'salesAuditDate', width: '5%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(10, 0, { title: '成本', dataIndex: 'totalCost', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(14, 0, { title: '毛利', dataIndex: 'grossProfit', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(12, 0, { title: '总成本', dataIndex: 'totalCost', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(16, 0, { title: '毛利', dataIndex: 'grossProfit', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }
@@ -358,6 +378,8 @@ export default {
       this.queryParam.warehouseCascade = []
       this.queryParam.salesBillNo = ''
       this.queryParam.salesManName = ''
+      this.queryParam.customerRelationType = undefined// 客户关系
+      this.queryParam.urgentBillStatus = undefined // 急件状态
       this.productType = []
       this.totalData = null
       if (this.advanced) {

+ 365 - 0
src/views/reportData/salesProfitReport/list.vue

@@ -0,0 +1,365 @@
+<template>
+  <div class="jg-page-wrap">
+    <a-card size="small" :bordered="false" class="table-page-search-wrapper">
+      <!-- 搜索条件 -->
+      <a-form-model
+        id="salesProfit-form"
+        ref="ruleForm"
+        class="form-model-con"
+        layout="inline"
+        :model="queryParam"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+        @keyup.enter.native="handleSearch" >
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="创建时间">
+              <rangeDate id="salesProfit-creatDate" ref="creatDate" v-model="creatTime" @change="creatDateChange" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-model-item label="客户名称">
+              <custList id="salesProfit-buyerName" ref="custSatelliteList" @change="custSatelliteChange"></custList>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="客户类型">
+              <custType id="salesProfit-salesTargetType" v-model="queryParam.salesTargetType" allowClear placeholder="请选择客户类型"></custType>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="收款方式">
+                <v-select
+                  code="SETTLE_STYLE"
+                  id="salesProfit-settleStyleSn"
+                  v-model="queryParam.settleStyleSn"
+                  allowClear
+                  placeholder="请选择收款方式"
+                ></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="审核时间">
+                <rangeDate id="salesProfit-rangeDate" ref="rangeDate" v-model="time" @change="dateChange" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="业务员">
+                <a-input id="salesProfit-manName" v-model.trim="queryParam.manName" allowClear placeholder="请输入业务员"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="单号">
+                <a-input id="salesProfit-billNo" v-model.trim="queryParam.billNo" allowClear placeholder="请输入单号"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="客户所在区">
+                <AreaList id="salesProfit-areaList" changeOnSelect ref="areaList" @change="areaChange"></AreaList>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="单据类型">
+                <a-select id="salesProfit-billType" v-model="queryParam.billType" allowClear placeholder="请选择单据类型">
+                  <a-select-option value="SALES_BILL">销售</a-select-option>
+                  <a-select-option value="SALES_RETURN">销售退货</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户关系">
+                <v-select code="CUSTOMER_RELATION_TYPE" id="salesProfit-customerRelationType" v-model="queryParam.customerRelationType" allowClear placeholder="请选择客户关系"></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="急件">
+                <v-select
+                  v-model="queryParam.urgentBillStatus"
+                  ref="status"
+                  id="salesProfit-status"
+                  code="URGENT_STATUS"
+                  placeholder="请选择急件状态"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24">
+            <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesProfit-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesProfit-reset">重置</a-button>
+            <a-button
+              type="primary"
+              style="margin-left: 5px"
+              @click="handleExport"
+              :disabled="disabled"
+              :loading="exportLoading"
+              v-if="$hasPermissions('M_salesProfitExport')"
+              class="button-warning"
+              id="salesProfit-export-btn">导出</a-button>
+            <a @click="advanced=!advanced" style="margin-left: 5px" id="salesProfit-advanced">
+              {{ advanced ? '收起' : '展开' }}
+              <a-icon :type="advanced ? 'up' : 'down'"/>
+            </a>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </a-card>
+    <a-card size="small" :bordered="false">
+      <!-- 合计 -->
+      <a-alert type="info" style="margin-bottom:10px">
+        <div class="ftext" slot="message">
+          总单数:<strong>{{ (totalData && (totalData.totalRecord || totalData.totalRecord==0)) ? totalData.totalRecord : '--' }}</strong>;
+          产品总数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
+          <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+            总成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? toThousands(totalData.totalCost) : '--' }}</strong>;
+          </div>
+          总售价:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</strong>;
+          折后总售价:<strong>{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? toThousands(totalData.discountedAmount) : '--' }}</strong>;
+          <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+            总毛利:<strong>{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? toThousands(totalData.totalProfit) : '--' }}</strong>。
+          </div>
+        </div>
+      </a-alert>
+      <!-- 列表 -->
+      <a-spin :spinning="spinning" tip="Loading...">
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.no"
+          rowKeyName="no"
+          :columns="columns"
+          :data="loadData"
+          :defaultLoadData="false"
+          bordered>
+        </s-table>
+      </a-spin>
+    </a-card>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { downloadExcel } from '@/libs/JGPrint.js'
+import custType from '@/views/common/custType.js'
+import AreaList from '@/views/common/areaList.js'
+import custList from '@/views/common/custList.vue'
+import { reportSalesProfitList, reportSalesProfitCount, reportSalesProfitExport } from '@/api/reportData'
+export default {
+  components: { STable, VSelect, rangeDate, custList, AreaList, custType },
+  mixins: [commonMixin],
+  data () {
+    return {
+      spinning: false,
+      labelCol: { span: 8 },
+      wrapperCol: { span: 16 },
+      advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        createBeginDate: '', // 创建开始时间
+        createEndDate: '', // 创建结束时间
+        beginDate: '', // 审核开始时间
+        endDate: '', // 审核结束时间
+        buyerName: undefined, // 客户名称
+        buyerSn: undefined, // 客户sn
+        salesTargetType: undefined, // 客户类型
+        provinceSn: undefined, //  省
+        citySn: undefined, //  市
+        countySn: undefined, //  区
+        settleStyleSn: undefined, // 收款方式
+        billNo: '', // 单号
+        manName: '', // 销售人员
+        billType: undefined, // 单据类型
+        customerRelationType: undefined, // 客户关系
+        urgentBillStatus: undefined // 急件状态
+      },
+      creatTime: [], // 创建时间
+      time: [], // 审核时间
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const params = Object.assign(parameter, this.queryParam)
+        this.spinning = true
+        delete params.time
+        return reportSalesProfitList(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            // 总计
+            this.getCount(params)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      totalData: null, //  合计
+      addrProvinceList: [], //  省下拉
+      addrCityList: [], //  市下拉
+      addrDistrictList: [], //  区下拉
+      allocateTypeList: [], //  调拨类型
+      custTypeList: [] //  客户类型 下拉数据
+    }
+  },
+  computed: {
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '单号', dataIndex: 'billNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '急件', dataIndex: 'urgentBillStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'buyerName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '款数', dataIndex: 'totalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本', dataIndex: 'totalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总售价', dataIndex: 'totalAmount', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '折扣金额', dataIndex: 'discountAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '折后总售价', dataIndex: 'discountedAmount', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        // { title: '毛利', dataIndex: 'totalProfit', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '业务员', dataIndex: 'manName', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '审核时间', dataIndex: 'auditDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(7, 0, { title: '总成本', dataIndex: 'totalCost', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(11, 0, { title: '毛利', dataIndex: 'totalProfit', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    // 所在区域
+    areaChange (val) {
+      this.queryParam.provinceSn = val[0] ? val[0] : undefined
+      this.queryParam.citySn = val[1] ? val[1] : undefined
+      this.queryParam.countySn = val[2] ? val[2] : undefined
+    },
+    // 合计
+    getCount (params) {
+      reportSalesProfitCount(params).then(res => {
+        if (res.status == 200) {
+          this.totalData = res.data
+        } else {
+          this.totalData = null
+        }
+      })
+    },
+    // 创建时间
+    creatDateChange (date) {
+      this.creatTime = date
+      this.queryParam.createBeginDate = date[0] || ''
+      this.queryParam.createEndDate = date[1] || ''
+    },
+    //  创建时间  change
+    dateChange (date) {
+      this.time = date
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    //  查询
+    handleSearch () {
+      let hasVal = false
+      for (const key in this.queryParam) {
+        if (this.queryParam[key]) {
+          hasVal = true
+          break
+        }
+      }
+      if (hasVal) {
+        this.$refs.table.refresh(true)
+      } else {
+        this.$message.info('请至少输入一个查询条件')
+      }
+    },
+    // 客户名称
+    custSatelliteChange (v, row) {
+      if (row && row.customerSn) {
+        this.queryParam.buyerSn = row.customerSn
+        this.queryParam.buyerName = undefined
+      } else {
+        this.queryParam.buyerName = v
+        this.queryParam.buyerSn = undefined
+      }
+    },
+    //  重置
+    resetSearchForm () {
+      this.$refs.creatDate.resetDate()
+      this.creatTime = []
+      this.queryParam.createBeginDate = ''
+      this.queryParam.createEndDate = ''
+      this.queryParam.buyerName = undefined
+      this.queryParam.buyerSn = undefined
+      this.queryParam.salesTargetType = undefined
+      this.queryParam.provinceSn = undefined
+      this.queryParam.citySn = undefined
+      this.queryParam.countySn = undefined
+
+      this.queryParam.settleStyleSn = undefined
+      this.queryParam.showCost = undefined
+      this.queryParam.billNo = ''
+      this.queryParam.manName = ''
+      this.queryParam.billType = undefined
+      this.queryParam.customerRelationType = undefined// 客户关系
+      this.queryParam.urgentBillStatus = undefined // 急件状态
+      this.$refs.ruleForm.resetFields()
+      this.totalData = null
+      if (this.advanced) {
+        this.$refs.rangeDate.resetDate()
+        this.time = []
+        this.queryParam.beginDate = ''
+        this.queryParam.endDate = ''
+        this.$refs.custSatelliteList.resetForm()
+        this.$refs.areaList.clearData()
+      }
+      this.$refs.table.clearTable()
+    },
+    // 导出
+    handleExport () {
+      const _this = this
+      let hasVal = false
+      for (const key in this.queryParam) {
+        if (this.queryParam[key]) {
+          hasVal = true
+          break
+        }
+      }
+      if (hasVal) {
+        const params = _this.queryParam
+        params.showCost = this.$hasPermissions('M_ShowAllCost') ? '1' : '0'
+        _this.exportLoading = true
+        _this.spinning = true
+        reportSalesProfitExport(params).then(res => {
+          downloadExcel(res, '销售报表')
+          _this.exportLoading = false
+          _this.spinning = false
+          _this.queryParam.showCost = undefined
+        })
+      } else {
+        this.$message.info('请至少输入一个查询条件')
+      }
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>

+ 8 - 1
src/views/reportData/salesRankingReport/list.vue

@@ -40,6 +40,11 @@
                   <a-input id="salesDetailReportList-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
                 </a-form-model-item>
               </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="客户关系">
+                  <v-select code="CUSTOMER_RELATION_TYPE" id="salesDetailReportList-customerRelationType" v-model="queryParam.customerRelationType" allowClear placeholder="请选择客户关系"></v-select>
+                </a-form-model-item>
+              </a-col>
             </template>
             <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
               <a-button type="primary" @click="handleSearch" :disabled="disabled" id="customerReportList-refresh">查询</a-button>
@@ -182,7 +187,8 @@ export default {
         productTypeSn2: undefined, //  产品二级分类
         productTypeSn3: undefined, //  产品三级分类
         productCode: undefined, // 产品编码
-        productName: undefined// 产品名称
+        productName: undefined, // 产品名称
+        customerRelationType: undefined
       },
       productType: [], // 产品分类
       rules: {
@@ -317,6 +323,7 @@ export default {
       this.queryParam.productTypeSn3 = undefined
       this.queryParam.productCode = undefined
       this.queryParam.productName = undefined
+      this.queryParam.customerRelationType = undefined
       this.productType = []
       this.$refs.ruleForm.resetFields()
       this.totalData = null

+ 27 - 6
src/views/reportData/salesReport/list.vue

@@ -1,6 +1,6 @@
 <template>
   <a-spin :spinning="spinning" tip="Loading...">
-    <a-alert :show-icon="false" type="error" message="注:销售单报表包含急件销售数量、售价,销售明细报表不包含急件销售数量、成本、售价" banner style="margin-bottom: 10px;" />
+    <a-alert :show-icon="false" type="error" message="注:报表中成本包含急件冲减的成本" banner style="margin-bottom: 10px;" />
     <!-- 搜索条件 -->
     <div class="table-page-search-wrapper">
       <a-form-model
@@ -66,6 +66,22 @@
                 <rangeDate id="salesReportList-outWareTime" ref="outWareRangeDate" v-model="outWareTime" @change="outWareDateChange" />
               </a-form-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="客户关系">
+                <v-select code="CUSTOMER_RELATION_TYPE" id="salesReportList-customerRelationType" v-model="queryParam.customerRelationType" allowClear placeholder="请选择客户关系"></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="急件">
+                <v-select
+                  v-model="queryParam.urgentBillStatus"
+                  ref="status"
+                  id="salesReportList-status"
+                  code="URGENT_STATUS"
+                  placeholder="请选择急件状态"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
           </template>
           <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
             <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesReportList-refresh">查询</a-button>
@@ -151,7 +167,9 @@ export default {
         countySn: undefined, //  区
         settleStyleSn: undefined,
         salesBillNo: '', // 销售单号
-        salesManName: '' // 销售人员
+        salesManName: '', // 销售人员
+        customerRelationType: undefined, // 客户关系
+        urgentBillStatus: undefined // 急件状态
       },
       creatTime: [], // 创建时间
       time: [], // 审核时间
@@ -197,6 +215,7 @@ export default {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '销售单号', dataIndex: 'salesBillNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '急件', dataIndex: 'urgentBillStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '客户名称', dataIndex: 'salesTargetName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '款数', dataIndex: 'totalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -206,12 +225,12 @@ export default {
         { title: '折扣金额', dataIndex: 'discountAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '折后总售价', dataIndex: 'discountedAmount', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         // { title: '毛利', dataIndex: 'totalProfit', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '业务员', dataIndex: 'salesManName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '审核时间', dataIndex: 'salesAuditDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '业务员', dataIndex: 'salesManName', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '审核时间', dataIndex: 'salesAuditDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(6, 0, { title: '成本', dataIndex: 'totalCost', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(10, 0, { title: '毛利', dataIndex: 'totalProfit', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(7, 0, { title: '总成本', dataIndex: 'totalCost', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(11, 0, { title: '毛利', dataIndex: 'totalProfit', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }
@@ -293,6 +312,8 @@ export default {
       this.queryParam.showCost = undefined
       this.queryParam.salesBillNo = ''
       this.queryParam.salesManName = ''
+      this.queryParam.customerRelationType = undefined// 客户关系
+      this.queryParam.urgentBillStatus = undefined // 急件状态
       this.$refs.ruleForm.resetFields()
       this.totalData = null
       if (this.advanced) {

+ 98 - 37
src/views/salesManagement/salesReturn/queryPart.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="salesReturn-productList-wrap">
     <!-- 搜索条件 -->
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+    <div class="table-page-search-wrapper" style="display:flex;align-items: center;justify-content: space-between;">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)" style="flex-grow: 1;">
         <a-row :gutter="15">
           <a-col :md="6" :sm="24" v-if="grabFlag == 1">
             <a-form-item label="审核时间">
@@ -36,6 +36,9 @@
           </a-col>
         </a-row>
       </a-form>
+      <div>
+        <hideCellMenus placeholder="显示" @change="showCellChange" :defHiddenKes="colsArr" v-model="showCell"></hideCellMenus>
+      </div>
     </div>
     <!-- 列表 -->
     <s-table
@@ -132,9 +135,10 @@ import { salesReturnProductList } from '@/api/salesReturn'
 import { stockList } from '@/api/stock'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
+import hideCellMenus from '@/views/common/hideCellMenus'
 export default {
   name: 'SalesReturnQueryPart',
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect, rangeDate, hideCellMenus },
   mixins: [commonMixin],
   props: {
     warehouseCascadeData: { // 仓库信息
@@ -160,12 +164,12 @@ export default {
         endDate: '', // 结束时间
         salesBillNo: '', //  销售单号
         productName: '', // 产品名称
-        productCode: '' //  产品编码
+        productCode: '', //  产品编码
+        oosFlag: undefined // 是否急件
       },
       buyerSn: '', // 客户sn
       priceType: '', // 价格类型
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [], // 列
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -215,40 +219,90 @@ export default {
           return data
         })
       },
-      listData: []
+      listData: [],
+      currentDealerInfo: null,
+      showCell: []// 已选要显示的列
     }
   },
-  mounted () {
-    // 抓单
-    if (this.grabFlag == 1) {
-      this.columns = [
-        { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '14%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', dataIndex: 'salesBillNo', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售审核时间', dataIndex: 'auditDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '售价', dataIndex: 'price', align: 'right', width: '5%', scopedSlots: { customRender: 'price' } },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售数量', dataIndex: 'qty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已退数量', dataIndex: 'hasReturnQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '本次退货数量', align: 'center', width: '7%', scopedSlots: { customRender: 'returnQty' } },
-        { title: '废品数量', align: 'center', width: '6%', scopedSlots: { customRender: 'celQty' } },
-        { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: '10%', align: 'center' },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }]
-    } else {
-      // 不抓单
-      this.columns = [
-        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '22%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
-        { title: '产品名称', dataIndex: 'productName', width: '22%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: '21%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '售价', dataIndex: 'salePrice', width: '10%', align: 'right', scopedSlots: { customRender: 'price' } },
-        { title: '单位', dataIndex: 'productUnit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: '10%', align: 'center' },
-        { title: '本次退货数量', align: 'center', width: '7%', scopedSlots: { customRender: 'returnQty' } },
-        { title: '废品数量', align: 'center', width: '6%', scopedSlots: { customRender: 'celQty' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }]
+  computed: {
+    colsArr () {
+      const _this = this
+      // 省级且有市级价权限
+      if (_this.currentDealerInfo && _this.currentDealerInfo.dealerLevel == 'PROVINCE' && _this.$hasPermissions('M_ShowAllCityPrice')) {
+        return [
+          {
+            title: '批发价',
+            key: 'wholesalePrice',
+            disabled: false,
+            checked: false
+          },
+          {
+            title: '终端价',
+            key: 'terminalPrice',
+            disabled: false,
+            checked: false
+          }
+        ]
+      } else {
+        return [
+          {
+            title: '终端价',
+            key: 'terminalPrice',
+            disabled: false,
+            checked: false
+          }
+        ]
+      }
+    },
+    columns () {
+      const _this = this
+      let arr = []
+      // 抓单
+      if (this.grabFlag == 1) {
+        arr = [
+          { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
+          { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '14%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
+          { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+          { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+          { title: '销售单号', dataIndex: 'salesBillNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+          { title: '销售审核时间', dataIndex: 'auditDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+          { title: '急件', dataIndex: 'oosFlagDictValue', width: '5%', align: 'center', customRender: function (text) { return text == '是' ? text : '' } },
+          { title: '原售价', dataIndex: 'price', align: 'right', width: '7%', scopedSlots: { customRender: 'price' } },
+          { title: '折后售价', dataIndex: 'discountedPrice', align: 'right', width: '7%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+          // { title: '批发价', dataIndex: 'wholesalePrice', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+          // { title: '终端价', dataIndex: 'terminalPrice', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+          { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+          { title: '销售数量', dataIndex: 'qty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '已退数量', dataIndex: 'hasReturnQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+          { title: '本次退货数量', align: 'center', width: '7%', scopedSlots: { customRender: 'returnQty' } },
+          { title: '废品数量', align: 'center', width: '6%', scopedSlots: { customRender: 'celQty' } },
+          { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: '10%', align: 'center' },
+          { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }]
+      } else {
+        // 不抓单
+        arr = [
+          { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+          { title: '产品编码', dataIndex: 'productCode', width: '22%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true },
+          { title: '产品名称', dataIndex: 'productName', width: '22%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+          { title: '原厂编码', dataIndex: 'productOrigCode', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
+          { title: '原售价', dataIndex: 'salePrice', width: '10%', align: 'right', scopedSlots: { customRender: 'price' } },
+          // { title: '批发价', dataIndex: 'wholesalePrice', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+          // { title: '终端价', dataIndex: 'terminalPrice', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+          { title: '单位', dataIndex: 'productUnit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+          { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: '10%', align: 'center' },
+          { title: '本次退货数量', align: 'center', width: '7%', scopedSlots: { customRender: 'returnQty' } },
+          { title: '废品数量', align: 'center', width: '6%', scopedSlots: { customRender: 'celQty' } },
+          { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }]
+      }
+
+      // 省级且有市级价权限
+      if (_this.currentDealerInfo && _this.currentDealerInfo.dealerLevel == 'PROVINCE' && _this.$hasPermissions('M_ShowAllCityPrice')) {
+        arr.splice(this.grabFlag == 1 ? 7 : 5, 0, { title: '批发价', dataIndex: 'wholesalePrice', align: 'right', width: '6%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(this.grabFlag == 1 ? 8 : 6, 0, { title: '终端价', dataIndex: 'terminalPrice', align: 'right', width: '6%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      } else {
+        arr.splice(this.grabFlag == 1 ? 7 : 5, 0, { title: '终端价', dataIndex: 'terminalPrice', align: 'right', width: '6%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      return arr.filter(item => !_this.showCell.includes(item.dataIndex))
     }
   },
   methods: {
@@ -257,6 +311,12 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    showCellChange (val) {
+      this.$emit('showCellChange', val)
+    },
+    setCell (data) {
+      this.currentDealerInfo = data
+    },
     // 双击列表选择配件
     handleClickRow (record) {
       const _this = this
@@ -299,6 +359,7 @@ export default {
       this.queryParam.salesBillNo = ''
       this.queryParam.productName = ''
       this.queryParam.productCode = ''
+      this.queryParam.oosFlag = undefined
       this.$refs.table.refresh(true)
     },
     // 初始化,客户sn、价格类型

+ 44 - 17
src/views/salesManagement/salesReturn/salesReturnEdit.vue

@@ -49,6 +49,7 @@
           grabFlag="0"
           :newLoading="isInster"
           :warehouseCascadeData="warehouseCascadeData"
+          @showCellChange="v=> showCell = v"
           @add="saveProduct"></queryPart>
       </a-card>
       <a-card size="small" :bordered="false" class="pages-wrap" ref="tableWrap">
@@ -217,6 +218,7 @@ import queryPart from './queryPart.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
 // 接口
 import { warehouseCascadeList } from '@/api/warehouse'
+import { getCurrentDealer } from '@/api/product'
 import { salesReturnDetail, salesReturnQueryCount, salesReturnDetailList, salesReturnDiscount, salesReturnDelAll, salesReturnDetailDel, salesReturnSaveProduct, salesReturnSubmit, salesReturnDetailPrint, salesDetailExport } from '@/api/salesReturn'
 
 export default {
@@ -230,7 +232,6 @@ export default {
   },
   mixins: [commonMixin],
   data () {
-    const _this = this
     return {
       spinning: false,
       disabled: false,
@@ -250,21 +251,6 @@ export default {
         orderBy: 'sales_return_bill_detail.CREATE_DATE desc' // 排序
       },
       countData: null, // 统计信息
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', align: 'center', width: '12%', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'left', width: '12%', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', align: 'center', width: '12%', customRender: function (text) { return text || '--' } },
-        { title: '售价', dataIndex: 'price', align: 'center', width: '7%', scopedSlots: { customRender: 'price' } },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', align: 'center', width: '5%', customRender: function (text) { return text || '--' } },
-        { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: '12%', align: 'center' },
-        { title: '退货数量', dataIndex: 'qty', align: 'center', width: '6%', scopedSlots: { customRender: 'qty' } },
-        { title: '废品数量', dataIndex: 'celQty', align: 'center', width: '6%', scopedSlots: { customRender: 'celQty' } },
-        { title: '退货金额小计', align: 'right', scopedSlots: { customRender: 'returnAmount' }, width: '8%' },
-        { title: '折后金额小计', dataIndex: 'discountedAmount', align: 'right', width: '8%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       chooseLoadData: [], // 已选列表原始数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -300,7 +286,38 @@ export default {
         })
       },
       printerType: 'NEEDLE', //  打印机类型
-      isShowBisiceInfo: false // 是否显示详情信息
+      isShowBisiceInfo: false, // 是否显示详情信息
+      showCell: [], // 已选要显示的列
+      currentDealerInfo: null
+    }
+  },
+  computed: {
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', align: 'center', width: '12%', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'left', width: '12%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', align: 'center', width: '12%', customRender: function (text) { return text || '--' } },
+        { title: '售价', dataIndex: 'price', align: 'center', width: '7%', scopedSlots: { customRender: 'price' } },
+        // { title: '批发价', dataIndex: 'wholesalePrice', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        // { title: '终端价', dataIndex: 'terminalPrice', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', align: 'center', width: '5%', customRender: function (text) { return text || '--' } },
+        { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: '12%', align: 'center' },
+        { title: '退货数量', dataIndex: 'qty', align: 'center', width: '6%', scopedSlots: { customRender: 'qty' } },
+        { title: '废品数量', dataIndex: 'celQty', align: 'center', width: '6%', scopedSlots: { customRender: 'celQty' } },
+        { title: '退货金额小计', align: 'right', scopedSlots: { customRender: 'returnAmount' }, width: '8%' },
+        { title: '折后金额小计', dataIndex: 'discountedAmount', align: 'right', width: '8%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+      // 省级且有市级价权限
+      if (_this.currentDealerInfo && _this.currentDealerInfo.dealerLevel == 'PROVINCE' && _this.$hasPermissions('M_ShowAllCityPrice')) {
+        arr.splice(5, 0, { title: '批发价', dataIndex: 'wholesalePrice', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(6, 0, { title: '终端价', dataIndex: 'terminalPrice', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      } else {
+        arr.splice(5, 0, { title: '终端价', dataIndex: 'terminalPrice', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      return arr.filter(item => !_this.showCell.includes(item.dataIndex))
     }
   },
   methods: {
@@ -308,6 +325,15 @@ export default {
     handleBack () {
       this.$router.push({ name: 'salesReturnList' })
     },
+    // 获取省级经销商、市级经销商和特约经销商信息
+    getCurrentDealerInfo () {
+      getCurrentDealer().then(res => {
+        if (res.status == 200) {
+          this.currentDealerInfo = res.data
+          this.$refs.queryPart.setCell(this.currentDealerInfo)
+        }
+      })
+    },
     // 选择客户成功
     chooseCustomOk (data) {
       this.openModal = false
@@ -563,6 +589,7 @@ export default {
       this.getOrderDetail()
       this.getWarehouseCascade()
       this.resetForm()
+      this.getCurrentDealerInfo()
     }
   },
   mounted () {

+ 54 - 21
src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue

@@ -44,7 +44,13 @@
       </a-card>
       <a-card size="small" :bordered="false" class="pages-wrap">
         <!-- 查询配件列表 -->
-        <queryPart ref="queryPart" grabFlag="1" :newLoading="isInster" :warehouseCascadeData="warehouseCascadeData" @add="saveProduct"></queryPart>
+        <queryPart
+          ref="queryPart"
+          grabFlag="1"
+          :newLoading="isInster"
+          :warehouseCascadeData="warehouseCascadeData"
+          @showCellChange="v=> showCell = v"
+          @add="saveProduct"></queryPart>
       </a-card>
       <a-card size="small" :bordered="false" class="pages-wrap">
         <!-- alert -->
@@ -199,6 +205,7 @@ import { STable, VSelect } from '@/components'
 import queryPart from './queryPart.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
 import { warehouseCascadeList } from '@/api/warehouse'
+import { getCurrentDealer } from '@/api/product'
 import { salesReturnDetail, salesReturnQueryCount, salesReturnDetailList, salesReturnDiscount, salesReturnDelAll, salesReturnDetailDel, salesReturnSaveProduct, salesReturnSubmit, salesReturnDetailPrint, salesDetailExport } from '@/api/salesReturn'
 import Print from '@/views/common/print.vue'
 import { hdPrint } from '@/libs/JGPrint'
@@ -213,7 +220,6 @@ export default {
   },
   mixins: [commonMixin],
   data () {
-    const _this = this
     return {
       spinning: false,
       disabled: false,
@@ -233,23 +239,6 @@ export default {
         orderBy: 'sales_return_bill_detail.CREATE_DATE desc' // 排序
       },
       countData: null,
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', dataIndex: 'salesBillNo', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '售价', dataIndex: 'price', align: 'right', width: '4%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '单位', dataIndex: 'dealerProductEntity.unit', align: 'center', width: '4%', customRender: function (text) { return text || '--' } },
-        { title: '销售数量', dataIndex: 'salesQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '本次退货数量', dataIndex: 'qty', align: 'center', width: '7%', scopedSlots: { customRender: 'qty' } },
-        { title: '废品数量', dataIndex: 'celQty', align: 'center', width: '6%', scopedSlots: { customRender: 'celQty' } },
-        { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: '10%', align: 'center' },
-        { title: '退货金额小计', align: 'right', scopedSlots: { customRender: 'returnAmount' }, width: '7%' },
-        { title: '折后金额小计', dataIndex: 'discountedAmount', align: 'right', width: '7%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '5%', align: 'center' }
-      ],
       chooseLoadData: [], // 已添加数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -284,7 +273,41 @@ export default {
         })
       },
       printerType: 'NEEDLE', //  打印机类型
-      isShowBisiceInfo: false // 是否显示详情信息
+      isShowBisiceInfo: false, // 是否显示详情信息
+      showCell: [], // 已选要显示的列
+      currentDealerInfo: null
+    }
+  },
+  computed: {
+    // 表头
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', dataIndex: 'salesBillNo', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '售价', dataIndex: 'price', align: 'right', width: '6%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        // { title: '批发价', dataIndex: 'wholesalePrice', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        // { title: '终端价', dataIndex: 'terminalPrice', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', align: 'center', width: '4%', customRender: function (text) { return text || '--' } },
+        { title: '销售数量', dataIndex: 'salesQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '本次退货数量', dataIndex: 'qty', align: 'center', width: '7%', scopedSlots: { customRender: 'qty' } },
+        { title: '废品数量', dataIndex: 'celQty', align: 'center', width: '6%', scopedSlots: { customRender: 'celQty' } },
+        { title: '仓库仓位', scopedSlots: { customRender: 'warehouse' }, width: '10%', align: 'center' },
+        { title: '退货金额小计', align: 'right', scopedSlots: { customRender: 'returnAmount' }, width: '7%' },
+        { title: '折后金额小计', dataIndex: 'discountedAmount', align: 'right', width: '7%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '5%', align: 'center' }
+      ]
+      // 省级且有市级价权限
+      if (_this.currentDealerInfo && _this.currentDealerInfo.dealerLevel == 'PROVINCE' && _this.$hasPermissions('M_ShowAllCityPrice')) {
+        arr.splice(6, 0, { title: '批发价', dataIndex: 'wholesalePrice', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(7, 0, { title: '终端价', dataIndex: 'terminalPrice', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      } else {
+        arr.splice(6, 0, { title: '终端价', dataIndex: 'terminalPrice', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      return arr.filter(item => !_this.showCell.includes(item.dataIndex))
     }
   },
   methods: {
@@ -292,6 +315,15 @@ export default {
     handleBack () {
       this.$router.push({ name: 'salesReturnList' })
     },
+    // 获取省级经销商、市级经销商和特约经销商信息
+    getCurrentDealerInfo () {
+      getCurrentDealer().then(res => {
+        if (res.status == 200) {
+          this.currentDealerInfo = res.data
+          this.$refs.queryPart.setCell(this.currentDealerInfo)
+        }
+      })
+    },
     // 选择客户成功
     chooseCustomOk (data) {
       this.openModal = false
@@ -479,7 +511,7 @@ export default {
         'salesBillSn': row.salesBillSn,
         'salesBillNo': row.salesBillNo,
         'salesBillDetailSn': row.salesBillDetailSn,
-        'price': row.price,
+        'price': row.discountedPrice,
         'cost': row.cost,
         'productSn': row.productSn,
         'celQty': row.celQty,
@@ -540,6 +572,7 @@ export default {
       this.getOrderDetail()
       this.getWarehouseCascade()
       this.resetForm()
+      this.getCurrentDealerInfo()
     }
   },
   mounted () {