Переглянути джерело

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

李磊 2 роки тому
батько
коміт
dfa32c17fd

+ 10 - 0
public/index.html

@@ -23,6 +23,16 @@
       }
      </script>
      <script src="./menus.js"></script>
+     <script>
+      var _hmt = _hmt || [];
+      (function() {
+        var hm = document.createElement("script");
+        hm.src = "https://hm.baidu.com/hm.js?060d7a1ce785a05c78b3d70a29020532";
+        var s = document.getElementsByTagName("script")[0]; 
+        s.parentNode.insertBefore(hm, s);
+      })();
+    </script>
+     
   </head>
   <body>
     <noscript>

+ 1 - 1
public/version.json

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

+ 35 - 11
src/App.vue

@@ -10,6 +10,7 @@
 <script>
 import zhCN from 'ant-design-vue/es/locale/zh_CN';
 import { AppDeviceEnquire } from '@/utils/mixin'
+import { onTextSelected } from '@/utils/util'
 import moment from 'moment';//引入moment 
 import 'moment/locale/zh-cn';
 moment.locale('zh-cn'); //设置语言 或 moment.lang('zh-cn'); 
@@ -23,6 +24,7 @@ export default {
     }
   },
   created () {
+    const _this = this
     this.envtips = process.env.VUE_APP_ENVTIPS
     // 在页面加载时读取sessionStorage
     if (sessionStorage.getItem('store')) {
@@ -42,19 +44,30 @@ export default {
         window.location.reload()
       }
     })
-    window.addEventListener('visibilitychange',()=>{
-      this.$store.state.app.visibilityState = document.visibilityState == 'visible'
+    // window.addEventListener('visibilitychange',()=>{
+    //   this.$store.state.app.visibilityState = document.visibilityState == 'visible'
+    // })
+    // window.addEventListener('focus',(e)=>{
+    //   if(!this.$store.state.app.visibilityState){
+    //     this.$store.state.app.visibilityState = true
+    //   }
+    // })
+    // window.addEventListener('blur',(e)=>{
+    //   if(this.$store.state.app.visibilityState){
+    //     this.$store.state.app.visibilityState = false
+    //   }
+    // })
+    // 选择文本后复制
+    window.addEventListener('mouseup', (e) => {
+      onTextSelected(this.$copyText,this.$message)
     })
-    window.addEventListener('focus',(e)=>{
-      if(!this.$store.state.app.visibilityState){
-        this.$store.state.app.visibilityState = true
-      }
-    })
-    window.addEventListener('blur',(e)=>{
-      if(this.$store.state.app.visibilityState){
-        this.$store.state.app.visibilityState = false
+    window.addEventListener('mousedown', (e) => {
+      const n = document.getElementsByClassName('copy-rect')
+      if(n[0]){
+        document.body.removeChild(n[0])
       }
     })
+
     this.$message.config({
       top: `100px`,
       duration: 3,
@@ -63,10 +76,21 @@ export default {
   }
 }
 </script>
-<style>
+<style lang="less">
   #app {
     height: 100%;
   }
+  .copy-rect{
+      background: #fff;
+      border: 1px solid #eee;
+      border-radius: 5px;
+      font-size: 12px;
+      padding: 2px 5px;
+      cursor: pointer;
+      &:hover{
+        color: #0282eb;
+      }
+    }
   .envtipsBox{
     position: fixed;
     z-index: 100000;

+ 1 - 1
src/components/Select/index.js

@@ -28,7 +28,7 @@ export default {
     },
     isEnable: { // 是否只获取已启用的数据
       type: Boolean,
-      default: false
+      default: true
     }
   }),
   created () {

+ 19 - 3
src/components/Table/index.js

@@ -90,6 +90,10 @@ export default {
     index: {
       type: [String, Number],
       default: ''
+    },
+    disableRowSelect: {
+      type: Boolean,
+      default: false
     }
   }),
   watch: {
@@ -361,13 +365,25 @@ export default {
         on: {
           // 鼠标单击行
           click: event => {
-            // 记录当前点击的行标识
-            this.leftAlignId = record[this.rowKeyName]
+            if(!this.disableRowSelect){
+              // 记录当前点击的行标识
+              this.leftAlignId = record[this.rowKeyName]
+            }
           },
           dblclick: (event) => {
             event.stopPropagation()
             this.$emit('dblclick', record, index)
-          }
+          },
+          mouseenter: (event) => {
+            this.$emit('mouseenter',record,index)
+          },
+          mouseleave:  (event) => {
+            this.$emit('mouseleave',record,index)
+          },
+          contextmenu: (event) => {
+            console.log(event,'contextmenu')
+            this.$emit('contextmenu',record,index)
+          },
         }
       }
     },

+ 3 - 3
src/store/modules/app.js

@@ -247,12 +247,12 @@ const app = {
     SetWinHeight ({ commit }, val) {
       commit('SET_WIN_HEIGHT', val)
     },
-    getReturnReasonData({ commit }, code, isEnable) {
+    getLookUpDataByCode({ commit }, params) {
       getLookUpData({
         pageNo: 1,
         pageSize: 1000,
-        lookupCode: code,
-        isEnable: isEnable ? 1 : undefined
+        lookupCode: params.code,
+        isEnable: params.isEnable
       }).then(res => {
         if (res.status == 200) {
           commit('SET_returnReason', res.data.list)

+ 70 - 0
src/utils/util.js

@@ -70,4 +70,74 @@ export function oneOf (value, validList) {
     }
   }
   return false
+}
+
+// 选择文本
+export function onTextSelected($copyText,$message){
+  const textDiv = document.getElementsByClassName('copy-rect')
+  const selection = window.getSelection()
+  if (!selection) {
+    return
+  }
+  if (selection.rangeCount <= 0) {
+    return
+  }
+
+  const range = selection.getRangeAt(0)
+  if (!range) {
+    return
+  }
+  const rect = range.getBoundingClientRect()
+  if (!rect) {
+    return
+  }
+
+  if (rect.width <= 0) {
+    return
+  }
+
+  const wholeText = range.startContainer.wholeText
+  if (!wholeText) {
+    return
+  }
+
+  if (wholeText && wholeText.length <= 0) {
+    return
+  }
+
+  const str = wholeText.slice(range.startOffset, range.endOffset)
+  if (!str) {
+    return
+  }
+  
+  let copyNode = textDiv[0]
+  if(!copyNode){
+    if (str.length > 0) {
+      copyNode = document.createElement('div')
+      copyNode.innerHTML = '复制'
+      copyNode.className = 'copy-rect'
+      copyNode.style.position = 'fixed'
+      copyNode.style.top = rect.top - rect.height - 10  + 'px'
+      copyNode.style.left = rect.left + rect.width - 20 + 'px'
+      copyNode.style.height = 'auto'
+      copyNode.style.width = 'auto'
+      document.body.appendChild(copyNode)
+
+      copyNode.addEventListener('mousedown',(event) => {
+        console.log(event)
+        event.stopPropagation()
+        console.log(str)
+        $copyText(str).then(message => {
+          console.log('copy', message)
+          $message.success('复制完毕')
+          document.body.removeChild(copyNode)
+        }).catch(err => {
+          console.log('copy.err', err)
+          $message.error('复制失败')
+          document.body.removeChild(copyNode)
+        })
+      }) 
+    }
+  }
+  
 }

+ 5 - 2
src/views/Home.vue

@@ -787,7 +787,7 @@ export default {
     }
   },
   methods: {
-    ...mapActions(['getReturnReasonData']),
+    ...mapActions(['getLookUpDataByCode']),
     hasNewProduct () {
       queryNewProductPage({ pageNo: 1, pageSize: 20, onlineFalg: this.onlineFalg }).then(res => {
         if (res.status == 200) {
@@ -901,7 +901,10 @@ export default {
         vm.openResetPwd = true
       }
       // 退货原因列表
-      vm.getReturnReasonData('RETURN_REASON')
+      vm.getLookUpDataByCode({
+        code: 'RETURN_REASON',
+        isEnable: 1
+      })
     })
   }
 }

+ 2 - 2
src/views/productManagement/newProduct/detail.vue

@@ -25,10 +25,10 @@
             <a-descriptions-item label="商品尺寸:">{{ (detailsData && detailsData.size) || '--' }}</a-descriptions-item>
             <a-descriptions-item label="重量:">{{ (detailsData && detailsData.weight) || '--' }}</a-descriptions-item>
             <a-descriptions-item label="计量单位:">{{ (detailsData && detailsData.unit) || '--' }}</a-descriptions-item>
-            <a-descriptions-item label="市级价:" v-if="this.specialPriceObj.dealerLevel&&this.specialPriceObj.dealerLevel == 'PROVINCE'">{{ detailsData&&(detailsData.cityPrice||detailsData.cityPrice==0) ? toThousands(detailsData.cityPrice):'--' }}</a-descriptions-item>
+            <!-- <a-descriptions-item label="市级价:" v-if="this.specialPriceObj.dealerLevel&&this.specialPriceObj.dealerLevel == 'PROVINCE'">{{ detailsData&&(detailsData.cityPrice||detailsData.cityPrice==0) ? toThousands(detailsData.cityPrice):'--' }}</a-descriptions-item>
             <a-descriptions-item label="特约价:" v-if="(this.specialPriceObj.isShowSpecialPrice&&this.specialPriceObj.isShowSpecialPrice != 0)">{{ detailsData && (detailsData.specialPrice||detailsData.specialPrice==0)?toThousands(detailsData.specialPrice) : '--' }}</a-descriptions-item>
             <a-descriptions-item label="终端价:">{{ detailsData && (detailsData.terminalPrice || detailsData.terminalPrice==0)?toThousands(detailsData.terminalPrice):'--' }}</a-descriptions-item>
-            <a-descriptions-item label="车主价:">{{ detailsData && (detailsData.carOwnersPrice || detailsData.carOwnersPrice==0)?toThousands(detailsData.carOwnersPrice):'--' }}</a-descriptions-item>
+            <a-descriptions-item label="车主价:">{{ detailsData && (detailsData.carOwnersPrice || detailsData.carOwnersPrice==0)?toThousands(detailsData.carOwnersPrice):'--' }}</a-descriptions-item> -->
           </a-descriptions>
           <div class="productDetail">
             <h4>产品介绍</h4>

+ 1 - 5
src/views/productManagement/productInfo/list.vue

@@ -32,7 +32,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="是否有库存">
-                  <a-select @change="handleHasQty" allowClear :value="queryParam.stockEmptyFlag" placeholder="请选择查看是否有库存">
+                  <a-select allowClear v-model="queryParam.stockEmptyFlag" placeholder="请选择查看是否有库存">
                     <a-select-option value="0">
                     </a-select-option>
@@ -335,10 +335,6 @@ export default {
       this.rowSelectionInfo = null
       this.$refs.table.refresh(true)
     },
-    // 查看库存
-    handleHasQty (val) {
-      this.queryParam.stockEmptyFlag = val
-    },
     //  新增/编辑
     handleEdit (row) {
       if (row) {

+ 29 - 17
src/views/productManagement/productInfoJg/list.vue

@@ -23,7 +23,6 @@
             <a-col :md="6" :sm="24">
               <a-form-item label="产品品牌">
                 <ProductBrand id="productInfoList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
-                </a-select>
               </a-form-item>
             </a-col>
             <!-- <a-col :md="6" :sm="24">
@@ -36,6 +35,18 @@
                 <v-select code="ENABLE_FLAG" id="productInfoList-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择状态"></v-select>
               </a-form-item>
             </a-col>
+            <a-col :md="6" :sm="24">
+            <a-form-item label="是否有库存">
+              <a-select allowClear v-model="queryParam.stockEmptyFlag" placeholder="请选择查看是否有库存">
+                <a-select-option value="0">
+                  是
+                </a-select-option>
+                <a-select-option value="1">
+                  否
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
           </template>
           <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
             <a-button type="primary" @click="searchForm" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
@@ -62,24 +73,21 @@
           <span v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys">已选 {{ rowSelectionInfo.selectedRowKeys.length }} 项</span>
         </a-col>
         <a-col class="gutter-row " :span="16" style="text-align: right;">
-          <a-popover trigger="hover" placement="bottom">
-            <template slot="content">
-              <div class="setTableList">
-                <p>
+          <a-dropdown v-model="showCell">
+              <a-button type="link" class="button-default"> <a-icon type="setting" />  显示</a-button>
+              <a-menu slot="overlay">
+                <a-menu-item>
                   <a-checkbox v-model="isTerminalPrice">
                     自定义终端价
                   </a-checkbox>
-                </p>
-                <a-checkbox v-model="isCarOwnersPrice">
-                  自定义车主价
-                </a-checkbox>
-              </div>
-            </template>
-            <a-button type="link" class="button-default">
-              <a-icon type="setting" />
-              显示
-            </a-button>
-          </a-popover>
+                </a-menu-item>
+                <a-menu-item>
+                  <a-checkbox v-model="isCarOwnersPrice">
+                    自定义车主价
+                  </a-checkbox>
+                </a-menu-item>
+              </a-menu>
+          </a-dropdown>
           <a-divider type="vertical" style="margin:5px 0;"/>
           <a-dropdown>
             <a-menu slot="overlay" @click="handleActions">
@@ -174,6 +182,7 @@ export default {
   data () {
     return {
       advanced: true, // 高级搜索 展开/关闭
+      showCell: false,
       tableHeight: 0,
       productType: [],
       queryParam: { //  查询条件
@@ -186,7 +195,8 @@ export default {
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
         onlineFalg: '',
-        enabledFlag: '1'
+        enabledFlag: '1',
+        stockEmptyFlag: undefined
       },
       openGuideModal: false,
       isTerminalPrice: false,
@@ -235,6 +245,7 @@ export default {
         { title: '车主价', dataIndex: 'carOwnersPrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         // { title: '自定义终端价', dataIndex: 'price1', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         // { title: '自定义车主价', dataIndex: 'price2', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '可用库存', dataIndex: 'currentStockQty', width: '7%', align: 'center', customRender: function (text) {return text || text == 0 ? text : '--'}},
         { title: '状态', scopedSlots: { customRender: 'enabledFlag' }, width: '7%', align: 'center' },
         { title: '产品图片', scopedSlots: { customRender: 'imageUrl' }, width: '6%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
@@ -295,6 +306,7 @@ export default {
       this.queryParam.productTypeSn3 = ''
       this.queryParam.onlineFalg = ''
       this.queryParam.enabledFlag = '1'
+      this.queryParam.stockEmptyFlag = undefined
       this.productType = []
       this.$refs.table.refresh(true)
       this.rowSelectionInfo = null

+ 25 - 3
src/views/reportData/bulkReturnReport/detailList.vue

@@ -83,6 +83,7 @@
     <a-alert type="info" style="margin-bottom:10px">
       <div class="ftext" slot="message">
         产品总数量:<strong>{{ (totalData && (totalData.purchaseQty || totalData.purchaseQty==0)) ? totalData.purchaseQty : '--' }}</strong>;
+        退货总金额:<strong>{{ (totalData && (totalData.productTotalPrice || totalData.productTotalPrice==0)) ? toThousands(totalData.productTotalPrice) : '--' }}</strong>;
         <div v-if="$hasPermissions('M_ShowAllCost')" style="display: inline-block;">
           退货总成本:<strong>{{ (totalData && (totalData.purchaseTotalCost || totalData.purchaseTotalCost==0)) ? toThousands(totalData.purchaseTotalCost) : '--' }}</strong>;
         </div>
@@ -93,11 +94,23 @@
       class="sTable"
       ref="table"
       size="small"
-      :rowKey="(record) => record.id"
+      :rowKey="(record) => record.no"
+      rowKeyName="no"
       :columns="columns"
       :data="loadData"
       :defaultLoadData="false"
+      :disableRowSelect="true"
+      @mouseenter="(record, index) => openPopid = record.no"
+      @mouseleave="(record, index) => openPopid = ''"
       bordered>
+      <template slot="cost" slot-scope="text, record">
+        <a-popover placement="top" :visible="openPopid == record.no && !!record.stockOutDetailList">
+          <template slot="content">
+            <a-table bordered :columns="costColumns" :pagination="false" :data-source="record.stockOutDetailList"></a-table>
+          </template>
+          {{ toThousands(text) }}
+        </a-popover>
+      </template>
     </s-table>
   </a-spin>
 </template>
@@ -143,6 +156,7 @@ export default {
       rules: {
         'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }]
       },
+      openPopid: '',
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
       // 加载数据方法 必须为 Promise 对象
@@ -173,6 +187,14 @@ export default {
     }
   },
   computed: {
+    costColumns () {
+      const _this = this
+      return [
+        { title: '批次号', dataIndex: 'stockBatchNo', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本单价', dataIndex: 'putCost', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '数量', dataIndex: 'outQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+    },
     columns () {
       const _this = this
       const arr = [
@@ -183,12 +205,12 @@ export default {
         { title: '产品名称', dataIndex: 'productEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '数量', dataIndex: 'purchaseQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货', dataIndex: 'productTotalPrice', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '退货金额', dataIndex: 'productTotalPrice', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         // { title: '成本', dataIndex: 'purchaseTotalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '审核时间', dataIndex: 'auditTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(8, 0, { title: '成本', dataIndex: 'purchaseTotalCost', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(8, 0, { title: '成本', dataIndex: 'purchaseTotalCost', scopedSlots: { customRender: 'cost' }, width: '5%', align: 'right' })
       }
       return arr
     }

+ 2 - 1
src/views/reportData/bulkReturnReport/list.vue

@@ -58,6 +58,7 @@
       <div class="ftext" slot="message">
         总单数:<strong>{{ (totalData && (totalData.totalRowSize || totalData.totalRowSize==0)) ? totalData.totalRowSize : '--' }}</strong>;
         产品总数量:<strong>{{ (totalData && (totalData.productTotalQty || totalData.productTotalQty==0)) ? totalData.productTotalQty : '--' }}</strong>;
+        退货总金额:<strong>{{ (totalData && (totalData.productTotalPrice || totalData.productTotalPrice==0)) ? toThousands(totalData.productTotalPrice) : '--' }}</strong>;
         <div v-if="$hasPermissions('M_ShowAllCost')" style="display: inline-block;">
           退货总成本:<strong>{{ (totalData && (totalData.productTotalCost || totalData.productTotalCost==0)) ? toThousands(totalData.productTotalCost) : '--' }}</strong>;
         </div>
@@ -141,7 +142,7 @@ export default {
         { title: '供应商', dataIndex: 'supplierName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '款数', dataIndex: 'productTotalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '数量', dataIndex: 'productTotalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '退货', dataIndex: 'productTotalPrice', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '退货金额', dataIndex: 'productTotalPrice', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         // { title: '成本', dataIndex: 'productTotalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '审核时间', dataIndex: 'auditTime', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
       ]

+ 58 - 33
src/views/salesManagement/salesQuery/list.vue

@@ -109,17 +109,28 @@
         </a-form>
       </div>
       <!-- 操作按钮 -->
-      <div class="table-operator">
-        <a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesNews')" @click="handleAdd(0)">新增(零售)</a-button>
-        <a-button type="primary" class="button-warning" v-if="$hasPermissions('B_salesNews')" @click="handleAdd(1)">新增(铺货)</a-button>
-        <a-checkbox style="margin-left:10px;" v-model="isByCustQuery" id="sales-byCustQuery">按客户查询</a-checkbox>
-        <a-popover placement="right">
-          <template slot="content">
-            使用此查询时,时间可清空,必须选择一个客户
-          </template>
-          <a-icon type="question-circle" />
-        </a-popover>
-
+      <div class="table-operator" style="display:flex;align-items: center;justify-content: space-between;">
+        <div>
+          <a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesNews')" @click="handleAdd(0)">新增(零售)</a-button>
+          <a-button type="primary" class="button-warning" v-if="$hasPermissions('B_salesNews')" @click="handleAdd(1)">新增(铺货)</a-button>
+          <a-checkbox style="margin-left:10px;" v-model="isByCustQuery" id="sales-byCustQuery">按客户查询</a-checkbox>
+          <a-popover placement="right">
+            <template slot="content">
+              使用此查询时,时间可清空,必须选择一个客户
+            </template>
+            <a-icon type="question-circle" />
+          </a-popover>
+        </div>
+        <div>
+          <a-dropdown v-model="showCell">
+              <a-button type="link" class="button-default"> <a-icon type="setting" />  显示</a-button>
+              <a-menu slot="overlay">
+                <a-menu-item>
+                  <a-checkbox v-model="showDiscount" id="salesQuery-edit-discount">折后总售价</a-checkbox>
+                </a-menu-item>
+              </a-menu>
+          </a-dropdown>
+        </div>
       </div>
       <a-alert type="info" style="margin-bottom:10px">
         <div slot="message">
@@ -253,6 +264,8 @@ export default {
       exportLoading: false, // 导出loading
       openModal: false, // 选择客户弹框是否显示
       isByCustQuery: false, // 是否按客户查询
+      showDiscount: false,
+      showCell: false,
       time: [
         getDate.getMonthDays(12).starttime,
         getDate.getMonthDays(12).endtime
@@ -285,28 +298,6 @@ export default {
         totalRecord: 0
       },
       selType: '0', // 0零售 1铺货
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
-        { title: '来源', dataIndex: 'sourceTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '9%', align: 'center' },
-        { title: '客户名称', dataIndex: 'buyerNameCurrent', align: 'center', width: '15%', customRender: function (text) { return text || '--' } },
-        { title: '总款数', dataIndex: 'totalCategory', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总数量', dataIndex: 'totalQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总售价', dataIndex: 'totalAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '折扣金额', dataIndex: 'discountAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '折后总售价', dataIndex: 'discountedAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核时间', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '2%', align: 'center' },
-        { title: '急件', scopedSlots: { customRender: 'oosFlag' }, width: '2%', align: 'center' },
-        { title: '出库', scopedSlots: { customRender: 'waitOut' }, width: '2%', align: 'center' },
-        { title: '收款', scopedSlots: { customRender: 'financial' }, width: '2%', align: 'center' },
-        // { title: '财务状态', dataIndex: 'financialStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -337,6 +328,39 @@ export default {
       distributionFlag: '0'
     }
   },
+  computed:{
+    columns(){
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
+        { title: '来源', dataIndex: 'sourceTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '9%', align: 'center' },
+        { title: '客户名称', dataIndex: 'buyerNameCurrent', align: 'center', width: '15%', customRender: function (text) { return text || '--' } },
+        { title: '总款数', dataIndex: 'totalCategory', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总数量', dataIndex: 'totalQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总售价', dataIndex: 'totalAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        // { title: '折扣金额', dataIndex: 'discountAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        // { title: '折后总售价', dataIndex: 'discountedAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核时间', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '2%', align: 'center' },
+        { title: '急件', scopedSlots: { customRender: 'oosFlag' }, width: '2%', align: 'center' },
+        { title: '出库', scopedSlots: { customRender: 'waitOut' }, width: '2%', align: 'center' },
+        { title: '收款', scopedSlots: { customRender: 'financial' }, width: '2%', align: 'center' },
+        // { title: '财务状态', dataIndex: 'financialStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+    
+      // 显示折扣
+      if (this.showDiscount) {
+        arr.splice(7, 0, { title: '折扣金额', dataIndex: 'discountAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(8, 0, { title: '折后总售价', dataIndex: 'discountedAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  时间  change
     dateChange (date) {
@@ -511,6 +535,7 @@ export default {
     handleExport () {
       const _this = this
       const params = this.queryParam
+      params.showDiscountAmountFlag = this.showDiscount ? 1 : 0
       this.exportLoading = true
       _this.spinning = true
       salesExport(params).then(res => {

+ 44 - 22
src/views/salesManagement/salesQueryNew/list.vue

@@ -129,6 +129,14 @@
           <div class="action-buttons">
             <a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesNews')" @click="handleAdd(0)"><a-icon type="plus" /> 新增(零售)</a-button>
             <a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesNews')" @click="handleAdd(1)"><a-icon type="plus" /> 新增(铺货)</a-button>
+            <a-dropdown v-model="showCell">
+              <a-button type="link" class="button-default"> <a-icon type="setting" />  显示</a-button>
+              <a-menu slot="overlay">
+                <a-menu-item>
+                  <a-checkbox v-model="showDiscount" id="salesQuery-edit-discount">折后总售价</a-checkbox>
+                </a-menu-item>
+              </a-menu>
+          </a-dropdown>
           </div>
         </div>
 
@@ -257,6 +265,8 @@ export default {
       exportLoading: false, // 导出loading
       openModal: false, // 选择客户弹框是否显示
       isByCustQuery: false, // 是否按客户查询
+      showDiscount: false,
+      showCell: false,
       time: [
         getDate.getMonthDays(12).starttime,
         getDate.getMonthDays(12).endtime
@@ -289,28 +299,6 @@ export default {
         totalRecord: 0
       },
       selType: '0', // 0零售 1铺货
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
-        { title: '来源', dataIndex: 'sourceTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '9%', align: 'center' },
-        { title: '客户名称', dataIndex: 'buyerNameCurrent', align: 'center', width: '15%', customRender: function (text) { return text || '--' } },
-        { title: '总款数', dataIndex: 'totalCategory', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总数量', dataIndex: 'totalQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '总售价', dataIndex: 'totalAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '折扣金额', dataIndex: 'discountAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '折后总售价', dataIndex: 'discountedAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核时间', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '2%', align: 'center' },
-        { title: '急件', scopedSlots: { customRender: 'oosFlag' }, width: '2%', align: 'center' },
-        { title: '出库', scopedSlots: { customRender: 'waitOut' }, width: '2%', align: 'center' },
-        { title: '收款', scopedSlots: { customRender: 'financial' }, width: '2%', align: 'center' },
-        // { title: '财务状态', dataIndex: 'financialStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -341,6 +329,39 @@ export default {
       distributionFlag: '0'
     }
   },
+  computed:{
+    columns(){
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
+        { title: '来源', dataIndex: 'sourceTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '9%', align: 'center' },
+        { title: '客户名称', dataIndex: 'buyerNameCurrent', align: 'center', width: '15%', customRender: function (text) { return text || '--' } },
+        { title: '总款数', dataIndex: 'totalCategory', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总数量', dataIndex: 'totalQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总售价', dataIndex: 'totalAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        // { title: '折扣金额', dataIndex: 'discountAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        // { title: '折后总售价', dataIndex: 'discountedAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核时间', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '2%', align: 'center' },
+        { title: '急件', scopedSlots: { customRender: 'oosFlag' }, width: '2%', align: 'center' },
+        { title: '出库', scopedSlots: { customRender: 'waitOut' }, width: '2%', align: 'center' },
+        { title: '收款', scopedSlots: { customRender: 'financial' }, width: '2%', align: 'center' },
+        // { title: '财务状态', dataIndex: 'financialStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ]
+    
+      // 显示折扣
+      if (this.showDiscount) {
+        arr.splice(7, 0, { title: '折扣金额', dataIndex: 'discountAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(8, 0, { title: '折后总售价', dataIndex: 'discountedAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  时间  change
     dateChange (date) {
@@ -515,6 +536,7 @@ export default {
     handleExport () {
       const _this = this
       const params = this.queryParam
+      params.showDiscountAmountFlag = this.showDiscount ? 1 : 0
       this.exportLoading = true
       _this.spinning = true
       salesExport(params).then(res => {

+ 1 - 1
vue.config.js

@@ -211,7 +211,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.0.183:8503/qpls-md',
+        // target: 'http://192.168.0.103/qpls-md',
         target: 'http://p.iscm.360arrow.com/qpls-md',
         // ws: false,
         ws: true,