lilei 4 days ago
parent
commit
30bc940b1f

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": 1753769995847
 }

+ 7 - 1
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()

+ 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: {

+ 12 - 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.freezeFlag" :checked="queryParam.freezeFlag" id="inventoryQueryList-freezeFlag">只查冻结产品</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, // 显示禁用产品
+        freezeFlag: false, // 冻结产品
         minUnsalableDays: undefined, // 滞销天数最小值
         maxUnsalableDays: undefined, // 滞销天数最大值
         productSysFlag: undefined // 产品来源,箭冠or自建
@@ -239,6 +245,8 @@ export default {
           // 格式化数据
           params.zeroQtyFlag = params.zeroQtyFlag ? '0' : ''
           params.enableFlag = params.enableFlag ? '' : '1'
+          params.freezeFlag = params.freezeFlag ? '0' : ''
+
           params.product = {
             sysFlag: params.productSysFlag || undefined
           }
@@ -377,6 +385,7 @@ export default {
       this.queryParam.brandName = undefined
       this.queryParam.productTypeName = undefined
       this.queryParam.zeroQtyFlag = false
+      this.queryParam.freezeFlag = false
       this.queryParam.warehouse = []
       this.queryParam.warehouseSn = ''
       this.queryParam.warehouseLocationSn = ''
@@ -417,6 +426,7 @@ export default {
       const params = JSON.parse(JSON.stringify(this.queryParam))
       params.zeroQtyFlag = params.zeroQtyFlag ? '0' : ''
       params.enableFlag = params.enableFlag ? '' : '1'
+      params.freezeFlag = params.freezeFlag ? '0' : ''
       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

+ 42 - 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="editHwOk"
+      @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 },
@@ -405,6 +422,25 @@ export default {
         this.openHwModal = true
       }
     },
+    editHwOk (data) {
+      if (data.shelfPlaceCode) {
+        const params = {
+          id: this.nowData.id,
+          shelfPlaceCode: data.shelfPlaceCode,
+          shelfSn: data.shelfSn
+        }
+        // 开始提交数据
+        this.spinning = true
+        addPlaceAndProduct(params).then(res => {
+          if (res.status == 200) {
+            this.$refs.table.refresh()
+          }
+          this.spinning = false
+        })
+      } else {
+        this.$refs.table.refresh()
+      }
+    },
     // 基本信息
     getDetail () {
       shelfDetail({ sn: this.$route.params.sn }).then(res => {
@@ -455,11 +491,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) {

+ 28 - 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-buyerRelationType" v-model="queryParam.buyerRelationType" 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.status"
+                  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,9 @@ export default {
         warehouseSn: undefined, //  仓库
         warehouseLocationSn: undefined, // 仓位
         salesBillNo: '', // 销售单号
-        salesManName: '' // 销售员
+        salesManName: '', // 销售员
+        state: undefined, // 业务状态
+        buyerRelationType: undefined // 客户关系
       },
       rules: {
         'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }]
@@ -257,9 +275,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: 'productEntity.code', 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 +290,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 +377,8 @@ export default {
       this.queryParam.warehouseCascade = []
       this.queryParam.salesBillNo = ''
       this.queryParam.salesManName = ''
+      this.queryParam.buyerRelationType = undefined// 客户关系
+      this.queryParam.status = undefined // 急件状态
       this.productType = []
       this.totalData = null
       if (this.advanced) {

+ 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-buyerRelationType" v-model="queryParam.buyerRelationType" 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, // 产品名称
+        buyerRelationType: undefined
       },
       productType: [], // 产品分类
       rules: {
@@ -317,6 +323,7 @@ export default {
       this.queryParam.productTypeSn3 = undefined
       this.queryParam.productCode = undefined
       this.queryParam.productName = undefined
+      this.queryParam.buyerRelationType = 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-buyerRelationType" v-model="queryParam.buyerRelationType" 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.status"
+                  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: '', // 销售人员
+        buyerRelationType: undefined, // 客户关系
+        status: 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: 'productEntity.code', 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.buyerRelationType = undefined// 客户关系
+      this.queryParam.status = undefined // 急件状态
       this.$refs.ruleForm.resetFields()
       this.totalData = null
       if (this.advanced) {

+ 93 - 36
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: { // 仓库信息
@@ -165,7 +169,6 @@ export default {
       buyerSn: '', // 客户sn
       priceType: '', // 价格类型
       disabled: false, //  查询、重置按钮是否可操作
-      columns: [], // 列
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -215,40 +218,88 @@ 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: 'specialPrice',
+            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: '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: 'specialPrice', 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: '21%', align: 'center', customRender: function (text) { return text || '--' } },
+          { title: '售价', dataIndex: 'salePrice', width: '10%', align: 'right', scopedSlots: { customRender: 'price' } },
+          // { title: '批发价', dataIndex: 'specialPrice', 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: 'specialPrice', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(this.grabFlag == 1 ? 8 : 6, 0, { title: '终端价', dataIndex: 'terminalPrice', align: 'right', width: '5%', 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: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      return arr.filter(item => !_this.showCell.includes(item.dataIndex))
     }
   },
   methods: {
@@ -257,6 +308,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

+ 80 - 18
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">
@@ -117,6 +118,7 @@
                   :loading="delLoading"
                   style="margin-left: 10px"
                   id="salesReturn-delAll">清空列表</a-button>
+                <hideCellMenus placeholder="显示" @change="showCellChange" :defHiddenKes="colsArr" v-model="showCell"></hideCellMenus>
               </div>
             </a-col>
           </a-row>
@@ -215,8 +217,10 @@ import Print from '@/views/common/print.vue'
 import { hdPrint } from '@/libs/JGPrint'
 import queryPart from './queryPart.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
+import hideCellMenus from '@/views/common/hideCellMenus'
 // 接口
 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 {
@@ -226,11 +230,11 @@ export default {
     VSelect,
     queryPart,
     chooseCustomModal,
-    Print
+    Print,
+    hideCellMenus
   },
   mixins: [commonMixin],
   data () {
-    const _this = this
     return {
       spinning: false,
       disabled: false,
@@ -250,21 +254,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 +289,67 @@ export default {
         })
       },
       printerType: 'NEEDLE', //  打印机类型
-      isShowBisiceInfo: false // 是否显示详情信息
+      isShowBisiceInfo: false, // 是否显示详情信息
+      showCell: [], // 已选要显示的列
+      currentDealerInfo: null
+    }
+  },
+  computed: {
+    colsArr () {
+      const _this = this
+      // 省级且有市级价权限
+      if (_this.currentDealerInfo && _this.currentDealerInfo.dealerLevel == 'PROVINCE' && _this.$hasPermissions('M_ShowAllCityPrice')) {
+        return [
+          {
+            title: '批发价',
+            key: 'specialPrice',
+            disabled: false,
+            checked: false
+          },
+          {
+            title: '终端价',
+            key: 'terminalPrice',
+            disabled: false,
+            checked: false
+          }
+        ]
+      } else {
+        return [
+          {
+            title: '终端价',
+            key: 'terminalPrice',
+            disabled: false,
+            checked: false
+          }
+        ]
+      }
+    },
+    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: 'specialPrice', 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: 'specialPrice', 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 +357,18 @@ export default {
     handleBack () {
       this.$router.push({ name: 'salesReturnList' })
     },
+    showCellChange (val) {
+      this.$refs.queryPart.showCell = val
+    },
+    // 获取省级经销商、市级经销商和特约经销商信息
+    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 +624,7 @@ export default {
       this.getOrderDetail()
       this.getWarehouseCascade()
       this.resetForm()
+      this.getCurrentDealerInfo()
     }
   },
   mounted () {

+ 89 - 20
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 -->
@@ -117,6 +123,7 @@
                   :loading="delLoading"
                   style="margin-left: 10px"
                   id="salesReturnGrabEdit-del-all">清空列表</a-button>
+                <hideCellMenus placeholder="显示" @change="showCellChange" :defHiddenKes="colsArr" v-model="showCell"></hideCellMenus>
               </div>
             </a-col>
           </a-row>
@@ -199,6 +206,8 @@ 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 hideCellMenus from '@/views/common/hideCellMenus'
 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'
@@ -209,7 +218,8 @@ export default {
     VSelect,
     queryPart,
     chooseCustomModal,
-    Print
+    Print,
+    hideCellMenus
   },
   mixins: [commonMixin],
   data () {
@@ -233,23 +243,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 +277,70 @@ export default {
         })
       },
       printerType: 'NEEDLE', //  打印机类型
-      isShowBisiceInfo: false // 是否显示详情信息
+      isShowBisiceInfo: false, // 是否显示详情信息
+      showCell: [], // 已选要显示的列
+      currentDealerInfo: null
+    }
+  },
+  computed: {
+    colsArr () {
+      const _this = this
+      // 省级且有市级价权限
+      if (_this.currentDealerInfo && _this.currentDealerInfo.dealerLevel == 'PROVINCE' && _this.$hasPermissions('M_ShowAllCityPrice')) {
+        return [
+          {
+            title: '批发价',
+            key: 'specialPrice',
+            disabled: false,
+            checked: false
+          },
+          {
+            title: '终端价',
+            key: 'terminalPrice',
+            disabled: false,
+            checked: false
+          }
+        ]
+      } else {
+        return [
+          {
+            title: '终端价',
+            key: 'terminalPrice',
+            disabled: false,
+            checked: false
+          }
+        ]
+      }
+    },
+    // 表头
+    columns () {
+      const _this = this
+      const arr = [
+        { 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: 'specialPrice', 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(5, 0, { title: '批发价', dataIndex: 'specialPrice', 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: {
@@ -292,6 +348,18 @@ export default {
     handleBack () {
       this.$router.push({ name: 'salesReturnList' })
     },
+    showCellChange (val) {
+      this.$refs.queryPart.showCell = val
+    },
+    // 获取省级经销商、市级经销商和特约经销商信息
+    getCurrentDealerInfo () {
+      getCurrentDealer().then(res => {
+        if (res.status == 200) {
+          this.currentDealerInfo = res.data
+          this.$refs.queryPart.setCell(this.currentDealerInfo)
+        }
+      })
+    },
     // 选择客户成功
     chooseCustomOk (data) {
       this.openModal = false
@@ -540,6 +608,7 @@ export default {
       this.getOrderDetail()
       this.getWarehouseCascade()
       this.resetForm()
+      this.getCurrentDealerInfo()
     }
   },
   mounted () {