lilei 2 年之前
父節點
當前提交
8b62ffbdd7

+ 9 - 0
public/index.html

@@ -23,6 +23,15 @@
       }
      </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": 1679284823291
 }

+ 36 - 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,31 @@ 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
+    //   }
+    // })
+    console.log(this.$copyText,this.$message)
+    // 选择文本后复制
+    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 +77,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;

+ 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)
+          },
         }
       }
     },

+ 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)
+        })
+      }) 
+    }
+  }
+  
 }

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

+ 16 - 2
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>
@@ -186,7 +197,8 @@ export default {
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
         onlineFalg: '',
-        enabledFlag: '1'
+        enabledFlag: '1',
+        stockEmptyFlag: undefined
       },
       openGuideModal: false,
       isTerminalPrice: false,
@@ -235,6 +247,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' }
@@ -298,6 +311,7 @@ export default {
       this.productType = []
       this.$refs.table.refresh(true)
       this.rowSelectionInfo = null
+      this.queryParam.stockEmptyFlag = undefined
       this.$refs.table.clearSelected()
     },
     // 获取省级经销商、市级经销商和特约经销商信息

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

@@ -93,11 +93,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">
+          <template slot="content">
+            <a-table bordered :columns="costColumns" :pagination="false" :data-source="record.tableData"></a-table>
+          </template>
+          {{ toThousands(text) }}
+        </a-popover>
+      </template>
     </s-table>
   </a-spin>
 </template>
@@ -143,6 +155,7 @@ export default {
       rules: {
         'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }]
       },
+      openPopid: '',
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
       // 加载数据方法 必须为 Promise 对象
@@ -173,6 +186,14 @@ export default {
     }
   },
   computed: {
+    costColumns(){
+      const _this = this
+      return [
+        { title: '批次号', dataIndex: 'sparePartsReturnNo', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '成本单价', dataIndex: 'productTotalPrice', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '数量', dataIndex: 'purchaseQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+    },
     columns () {
       const _this = this
       const arr = [
@@ -183,12 +204,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: 'productTotalAmount', 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
     }

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

@@ -141,7 +141,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: 'productTotalAmount', 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 || '--' } }
       ]

+ 43 - 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) {