소스 검색

修改bug

chenrui 3 달 전
부모
커밋
6372ed78c6

+ 1 - 0
src/views/promotionManagement/subsidizedProducts/list.vue

@@ -222,6 +222,7 @@ export default {
       this.$info({
         title: '提示',
         content: infoTip,
+        centered: true,
         onOk () {
           console.log('我知道了')
         }

+ 2 - 0
src/views/promotionManagement/subsidizedProducts/subsidyAddModal.vue

@@ -193,6 +193,7 @@ export default {
       }
       const newList = this.rowSelectionInfo.selectedRows.map(item => {
         item.subsidyAmount = this.subsidyAmount
+        delete item.id
         return item
       })
       this.$emit('plAdd', newList)
@@ -206,6 +207,7 @@ export default {
       this.queryParam.productTypeSn1 = ''
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
+      this.subsidyAmount = undefined
       this.productType = []
       this.category = []
       this.rowSelectionInfo = null

+ 23 - 12
src/views/salesManagement/salesQuery/detail.vue

@@ -71,7 +71,7 @@
               <span v-if="detailData&&detailData.sourceType&&detailData.sourceType==='XPRH_PURCHASE'"> 返券金额:<strong>{{ detailData&&(detailData.totalGiveAmount || detailData.totalGiveAmount==0) ? toThousands(detailData.totalGiveAmount) : '--' }}</strong>;</span>
             </div>
             <div>
-              <a-checkbox v-model="showCost" v-if="$hasPermissions('M_ShowAllCost')" id="salesQuery-cost">成本价</a-checkbox>
+              <hideCellMenus placeholder="显示" :defHiddenKes="colsArr" v-model="showCell"></hideCellMenus>
             </div>
           </div>
         </a-alert>
@@ -131,12 +131,13 @@ import { hdPrint } from '@/libs/JGPrint'
 import { STable, VSelect } from '@/components'
 import outInDetialModal from '@/views/common/outInDetialModal.vue'
 import Print from '@/views/common/print.vue'
+import hideCellMenus from '@/views/common/hideCellMenus'
 // 接口
 import { salesDetailBySn, salesDetailPrint, salesDetailExport } from '@/api/sales'
 import { salesDetailList } from '@/api/salesDetail'
 export default {
   name: 'SalesDetail',
-  components: { STable, VSelect, Print, outInDetialModal },
+  components: { STable, VSelect, Print, outInDetialModal, hideCellMenus },
   mixins: [commonMixin],
   props: {
     outBizSn: { //  有值则为弹框,无值则为页面
@@ -183,7 +184,22 @@ export default {
         })
       },
       localDataSource: [], // 原始列表数据
-      detailData: null //  详情数据
+      detailData: null, //  详情数据
+      colsArr: [
+        {
+          title: '成本价',
+          key: 'totalCost',
+          disabled: false,
+          checked: false
+        },
+        {
+          title: '返券金额',
+          key: 'giveAmount',
+          disabled: !(this.detailData && this.detailData.sourceType && this.detailData.sourceType === 'XPRH_PURCHASE'),
+          checked: false
+        }
+      ],
+      showCell: []// 已选要显示的列
     }
   },
   computed: {
@@ -209,15 +225,10 @@ export default {
         { title: '单位', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '售价小计', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '折后小计', dataIndex: 'discountedAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '折扣金额', dataIndex: 'discountAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+        { title: '折扣金额', dataIndex: 'discountAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { slots: { title: 'costTitle' }, dataIndex: 'totalCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: <a-tooltip placement="bottom" title='返券金额以销售单完结时的活动规则为准'>返券金额&nbsp;<a-icon type="question-circle" /></a-tooltip>, dataIndex: 'giveAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
       ]
-      // 实际总成本
-      if (this.showCost) {
-        arr.push({ slots: { title: 'costTitle' }, dataIndex: 'totalCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-      }
-      if (this.detailData && this.detailData.sourceType && this.detailData.sourceType === 'XPRH_PURCHASE') {
-        arr.push({ title: <a-tooltip placement="bottom" title='返券金额以销售单完结时的活动规则为准'>返券金额&nbsp;<a-icon type="question-circle" /></a-tooltip>, dataIndex: 'giveAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-      }
       // 下级创建,不显示仓库仓位
       if (!this.isOwerEdit) {
         arr.push({ title: '库存数量', dataIndex: 'currentStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
@@ -227,7 +238,7 @@ export default {
       }
       arr.push({ title: '是否急件', dataIndex: 'oosFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } })
       arr.push({ title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' })
-      return arr
+      return arr.filter(item => !_this.showCell.includes(item.dataIndex))
     }
   },
   methods: {

+ 23 - 12
src/views/salesManagement/salesQueryNew/detail.vue

@@ -78,7 +78,7 @@
               <span v-if="detailData&&detailData.sourceType&&detailData.sourceType==='XPRH_PURCHASE'"> 返券金额:<strong>{{ detailData&&(detailData.totalGiveAmount || detailData.totalGiveAmount==0) ? toThousands(detailData.totalGiveAmount) : '--' }}</strong>;</span>
             </div>
             <div>
-              <a-checkbox v-model="showCost" v-if="$hasPermissions('M_ShowAllCost')" id="salesQuery-cost">成本价</a-checkbox>
+              <hideCellMenus placeholder="显示" :defHiddenKes="colsArr" v-model="showCell"></hideCellMenus>
             </div>
           </div>
           <!-- 列表 -->
@@ -138,12 +138,13 @@ import { hdPrint } from '@/libs/JGPrint'
 import { STable, VSelect } from '@/components'
 import outInDetialModal from './outInDetialModal.vue'
 import PrintPanel from '@/views/common/printPanel.vue'
+import hideCellMenus from '@/views/common/hideCellMenus'
 // 接口
 import { salesDetailBySn, salesDetailPrint, salesDetailExport } from '@/api/sales'
 import { salesDetailList } from '@/api/salesDetail'
 export default {
   name: 'SalesDetail',
-  components: { STable, VSelect, PrintPanel, outInDetialModal },
+  components: { STable, VSelect, PrintPanel, outInDetialModal, hideCellMenus },
   mixins: [commonMixin],
   props: {
     outBizSn: { //  有值则为弹框,无值则为页面
@@ -194,7 +195,22 @@ export default {
       },
       localDataSource: [], // 原始列表数据
       detailData: null, //  详情数据
-      isShowBisiceInfo: false// 显示基础内容
+      isShowBisiceInfo: false, // 显示基础内容
+      colsArr: [
+        {
+          title: '成本价',
+          key: 'totalCost',
+          disabled: false,
+          checked: false
+        },
+        {
+          title: '返券金额',
+          key: 'giveAmount',
+          disabled: !(this.detailData && this.detailData.sourceType && this.detailData.sourceType === 'XPRH_PURCHASE'),
+          checked: false
+        }
+      ],
+      showCell: []// 已选要显示的列
     }
   },
   computed: {
@@ -220,15 +236,10 @@ export default {
         { title: '单位', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '售价小计', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '折后小计', dataIndex: 'discountedAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '折扣金额', dataIndex: 'discountAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+        { title: '折扣金额', dataIndex: 'discountAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { slots: { title: 'costTitle' }, dataIndex: 'totalCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: <a-tooltip placement="bottom" title='返券金额以销售单完结时的活动规则为准'>返券金额&nbsp;<a-icon type="question-circle" /></a-tooltip>, dataIndex: 'giveAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
       ]
-      // 实际总成本
-      if (this.showCost) {
-        arr.push({ slots: { title: 'costTitle' }, dataIndex: 'totalCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-      }
-      if (this.detailData && this.detailData.sourceType && this.detailData.sourceType === 'XPRH_PURCHASE') {
-        arr.push({ title: <a-tooltip placement="bottom" title='返券金额以销售单完结时的活动规则为准'>返券金额&nbsp;<a-icon type="question-circle" /></a-tooltip>, dataIndex: 'giveAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-      }
       // 下级创建,不显示仓库仓位
       if (!this.isOwerEdit) {
         arr.push({ title: '库存数量', dataIndex: 'currentStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
@@ -238,7 +249,7 @@ export default {
       }
       arr.push({ title: '是否急件', dataIndex: 'oosFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } })
       arr.push({ title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' })
-      return arr
+      return arr.filter(item => !_this.showCell.includes(item.dataIndex))
     }
   },
   methods: {