Browse Source

修改bug

chenrui 3 months ago
parent
commit
6724f14965

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

@@ -3522,6 +3522,31 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/promotionManagement/subsidizedProducts',
+            redirect: '/promotionManagement/subsidizedProducts/list',
+            name: 'subsidizedProducts',
+            component: BlankLayout,
+            meta: {
+              title: '补贴产品',
+              icon: 'contacts'
+              // permission: 'M_subsidizedProductsList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'subsidizedProductsList',
+                component: () => import(/* webpackChunkName: "promotionManagement" */ '@/views/promotionManagement/subsidizedProducts/list.vue'),
+                meta: {
+                  title: '补贴产品列表',
+                  icon: 'contacts',
+                  hidden: true
+                  // permission: 'M_subsidizedProductsList'
+                }
+              }
+            ]
+          },
           {
             path: '/promotionManagement/couponDetails',
             redirect: '/promotionManagement/couponDetails/list',

+ 83 - 0
src/views/common/mallCategory.js

@@ -0,0 +1,83 @@
+import { queryExtList } from '@/api/shopProduct'
+const mallCategory = {
+  template: `
+      <a-cascader
+        @change="handleChange"
+        change-on-select 
+        :changeOnSelect="true"
+        :value="defaultVal"
+        expand-trigger="hover"
+        :options="categoryOptions"
+        :fieldNames="{ label: 'categoryName', value: 'categorySn', children: 'shopCategoryList' }"
+        :id="id"
+        placeholder="请选择商城类目"
+        allowClear />
+    `,
+  props: {
+    value: {
+      type: Array,
+      default: function () {
+        return []
+      }
+    },
+    id: {
+      type: String,
+      default: ''
+    },
+    level: {
+      type: Number,
+      default: 3
+    }
+  },
+  data () {
+    return {
+      defaultVal: this.value,
+      categoryOptions: []
+    }
+  },
+  watch: {
+    value (newValue, oldValue) {
+      this.defaultVal = newValue
+    }
+  },
+  mounted () {
+    this.getCategoryList()
+  },
+  methods: {
+    // change时间
+    handleChange (value) {
+      this.defaultVal = value
+      this.$emit('change', this.defaultVal)
+    },
+    // 格式化数据
+    formatData (data) {
+      if (this.level == 1) {
+        data.forEach(item => {
+          if (item.shopProductList) item.shopProductList = []
+        })
+      }
+      if (this.level == 2) {
+        data.forEach(item => {
+          if (item.shopProductList) {
+            item.shopProductList.forEach(child => {
+              if (child.shopProductList) child.shopProductList = []
+            })
+          }
+        })
+      }
+      return data
+    },
+    // 获取产品类目列表
+    getCategoryList () {
+      queryExtList({}).then(res => {
+        if (res.status == 200) {
+          this.categoryOptions = this.formatData(res.data)
+        } else {
+          this.categoryOptions = []
+        }
+      })
+    }
+  }
+}
+
+export default mallCategory

+ 19 - 21
src/views/common/productType.js

@@ -32,7 +32,7 @@ const ProductType = {
       type: String,
       default: ''
     },
-    level:{
+    level: {
       type: Number,
       default: 3
     }
@@ -47,7 +47,7 @@ const ProductType = {
     value (newValue, oldValue) {
       this.defaultVal = newValue
     },
-    tenantId(newValue, oldValue){
+    tenantId (newValue, oldValue) {
       console.log(newValue)
     }
   },
@@ -60,42 +60,41 @@ const ProductType = {
       this.$emit('change', this.defaultVal)
     },
     // 格式化数据
-    formatData(data){
-      if(this.level == 1){
-         data.forEach(item => {
-           if(item.children) item.children = []
-         })
+    formatData (data) {
+      if (this.level == 1) {
+        data.forEach(item => {
+          if (item.children) item.children = []
+        })
       }
-      if(this.level == 2){
-         data.forEach(item => {
-           if(item.children) {
-             item.children.forEach(child => {
-                if(child.children) child.children = []
-             })
-           }
-         })
+      if (this.level == 2) {
+        data.forEach(item => {
+          if (item.children) {
+            item.children.forEach(child => {
+              if (child.children) child.children = []
+            })
+          }
+        })
       }
       return data
     },
     //  产品分类列表 sysFlag: 1 箭冠 0 自建
     getProductType () {
       const params = {}
-      if(this.tenantId!="NONE"){
+      if (this.tenantId != 'NONE') {
         params.tenantId = this.tenantId
       }
-      if(this.tenantId=="NONE"){
+      if (this.tenantId == 'NONE') {
         params.sysFlag = '1'
       }
-      if(this.isDealer){
+      if (this.isDealer) {
         dealerProductTypeList(params).then(res => {
           if (res.status == 200) {
             this.productTypeList = this.formatData(res.data)
-            console.log(this.formatData(res.data))
           } else {
             this.productTypeList = []
           }
         })
-      }else{
+      } else {
         productTypeQuery(params).then(res => {
           if (res.status == 200) {
             this.productTypeList = this.formatData(res.data)
@@ -104,7 +103,6 @@ const ProductType = {
           }
         })
       }
-      
     }
   }
 }

+ 205 - 0
src/views/promotionManagement/subsidizedProducts/chooseImportModal.vue

@@ -0,0 +1,205 @@
+<template>
+  <a-modal
+    centered
+    class="chooseImport-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="确认导入"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="80%">
+    <div class="chooseImport-con">
+      <!-- 可导入数据 -->
+      <p class="">可导入数据{{ loadData.length }}条</p>
+      <a-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.allocateSn"
+        :columns="nowColumns"
+        :dataSource="loadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <a-divider />
+      <!-- 不可导入数据 -->
+      <p class="red">不可导入数据{{ unLoadData.length }}条</p>
+      <a-table
+        class="unTable"
+        ref="unTable"
+        size="small"
+        :rowKey="(record) => record.errorDesc"
+        :columns="nowUnColumns"
+        :dataSource="unLoadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+        <template slot="errorMsg" slot-scope="text,record">
+          <a-popover placement="topRight">
+            <template slot="content">
+              <p v-for="d in record.importErrorMsgSet">{{ d }}</p>
+            </template>
+            <a-button type="link">
+              查看
+            </a-button>
+          </a-popover>
+        </template>
+      </a-table>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="chooseImport-submit"
+          size="large"
+          :class="loadData.length==0?'button-grey':'button-primary'"
+          @click="handleSubmit"
+          style="padding: 0 40px;">确认导入</a-button>
+        <a-button
+          id="chooseImport-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 40px;margin-left: 15px;">取消</a-button>
+        <a-button
+          type="primary"
+          id="chooseImport-error"
+          size="large"
+          class="button-error"
+          @click="handleError"
+          style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+import { salesDetailFailExcel } from '@/api/salesDetail'
+export default {
+  name: 'ChooseImportModal',
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    paramsData: { // 参数
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    const _this = this
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      // 正确数据
+      nowColumns: [
+        { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原售价', dataIndex: 'warehouseName', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '补贴金额', dataIndex: 'warehouseLocationName', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '补贴后售价', dataIndex: 'importPrice', width: '14%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+      ],
+      loadData: [],
+      // 错误项
+      nowUnColumns: [
+        { title: '序号', dataIndex: 'no', width: '9%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '原售价', dataIndex: 'warehouseLocationName', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '补贴金额', dataIndex: 'importPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '补贴后售价', dataIndex: 'importQty', width: '20%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '备注', scopedSlots: { customRender: 'errorMsg' }, width: '10%', align: 'center' }
+      ],
+      unLoadData: [],
+      loading: false
+    }
+  },
+  methods: {
+    // 获取数据
+    getData () {
+      const paramsData = JSON.parse(JSON.stringify(this.paramsData))
+      this.loadData = paramsData.rightList || []
+      this.unLoadData = paramsData.errorList || []
+      // 正确的
+      this.loadData.map((item, index) => {
+        item.no = index + 1
+        item.salesBillNo = paramsData.salesBillNo
+        item.salesBillSn = paramsData.salesBillSn
+      })
+      // 错误的
+      this.unLoadData.map((item, index) => {
+        item.no = index + 1
+        item.salesBillNo = paramsData.salesBillNo
+        item.salesBillSn = paramsData.salesBillSn
+      })
+    },
+    // 确认导入
+    handleSubmit () {
+      if (this.paramsData.rightList.length == 0) {
+        this.$message.warning('无可导入的产品!')
+      } else {
+        const data = this.paramsData.rightList
+        data.map(item => {
+          item.salesBillNo = this.paramsData.salesBillNo
+          item.salesBillSn = this.paramsData.salesBillSn
+        })
+        this.$emit('ok', data)
+        this.isShow = false
+      }
+    },
+    // 导出错误项
+    handleError () {
+      const _this = this
+      if (_this.paramsData.errorList.length < 1) {
+        _this.$message.info('暂无可导出错误项~')
+        return
+      }
+      _this.spinning = true
+      hdExportExcel(salesDetailFailExcel, _this.paramsData.errorList, '补贴金额错误项', function () {
+        _this.spinning = false
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.loadData = []
+        this.unLoadData = []
+      } else {
+        this.getData()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseImport-modal{
+    .chooseImport-con{
+      .red{
+        color: #f30;
+      }
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel,.button-error{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 151 - 0
src/views/promotionManagement/subsidizedProducts/editModal.vue

@@ -0,0 +1,151 @@
+<template>
+  <a-modal
+    centered
+    class="bindEdit-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="编辑"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="500">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="bindEdit-form">
+        <span class="subsidyRequired">*</span>产品补贴<a-input style="width: 40%;margin:0 10px;" id="chooseShelf-name" v-model.trim="num" allowClear placeholder="请输入"/>元
+      </div>
+      <div class="btn-cont">
+        <a-button id="bindEdit-modal-back" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
+        <a-button type="primary" id="bindEdit-modal-save" @click="handleSave">保存</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable } from '@/components'
+import { jxsorgRelationSave, jxsorgRelationDetail } from '@/api/jxsorg'
+export default {
+  name: 'BindEditModal',
+  components: { STable },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    },
+    nowData: {
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      num: undefined
+    }
+  },
+  methods: {
+    //  详情
+    getDetail () {
+      const _this = this
+      jxsorgRelationDetail({ sn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          _this.form.orgSn = res.data.orgSn || undefined
+          _this.$refs.orgList.fetchUser(res.data.orgName)
+          _this.$refs.orgList.dealerName = { key: res.data.orgSn }
+          const childSnList = []
+          const childSnListStr = []
+          if (res.data.childList) {
+            res.data.childList.map(item => {
+              childSnList.push({ key: item.sn })
+              childSnListStr.push(item.sn)
+            })
+          }
+          _this.form.childSnList = childSnListStr.length == 0 ? undefined : childSnListStr
+          _this.$refs.orgMultipleList.setData(childSnList, res.data.childList || [])
+          _this.$refs.orgMultipleList.dealerName = childSnList
+        }
+      })
+    },
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.spinning = true
+          jxsorgRelationSave(_this.form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$emit('ok')
+              setTimeout(function () {
+                _this.isShow = false
+                _this.spinning = false
+              }, 300)
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    // 中心店 change
+    orgChange (obj) {
+      this.form.orgSn = obj.key || undefined
+    },
+    // 配送店  change
+    orgMultipleChange (obj) {
+      const _this = this
+      this.form.childSnList = []
+      obj.map(item => {
+        _this.form.childSnList.push(item.key || undefined)
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.$refs.ruleForm.resetFields()
+        this.form.childSnList = undefined
+        this.$refs.orgList.resetForm()
+        this.$refs.orgMultipleList.resetForm()
+      }
+    },
+    itemSn (newValue, oldValue) {
+      if (this.isShow && newValue) {
+        this.getDetail()
+      }
+    }
+  }
+}
+</script>
+<style lang="less" scoped>
+  .bindEdit-modal{
+    /deep/.ant-modal-body {
+    	padding: 40px 40px 24px;
+    }
+    .bindEdit-form{
+      text-align: center;
+    }
+    .subsidyRequired{
+      margin-right: 5px;
+      color:#ED1c24;
+    }
+    .btn-cont {
+    	text-align: center;
+    	margin: 50px 0 10px;
+    }
+  }
+</style>

+ 196 - 0
src/views/promotionManagement/subsidizedProducts/importGuideModal.vue

@@ -0,0 +1,196 @@
+<template>
+  <a-modal
+    centered
+    class="importGuide-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="导入"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="800">
+    <div class="importGuide-con">
+      <div class="explain-con">
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>1</span>准备导入
+          </div>
+          <ul>
+            <li>1) 请先下载导入模板,模板中已标示出必填项</li>
+            <li>2) 产品必须是商城内已上架的产品</li>
+            <li>3) 列表页已存在的产品,不可导入</li>
+            <li>
+              <a :href="filePath" style="margin: 5px 0 0;display: block;">
+                <a-icon type="download" style="padding-right: 5px;" />下载导入模板
+              </a>
+            </li>
+          </ul>
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>2</span>上传数据文件
+          </div>
+          <p>目前支持的文件类型*.xls,*.xlsx.</p>
+          <div style="overflow: hidden;padding-left: 23px;">
+            <Upload
+              id="importGuide-attachList"
+              ref="importUpload"
+              :maxNums="1"
+              fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
+              uploadType="attach"
+              :action="attachAction"
+              :uploadParams="uploadParams"
+              upText="添加文件"
+              @remove="resetSearchForm"
+              @change="changeImport"></Upload>
+          </div>
+        </div>
+      </div>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="importGuide-nextStep"
+          size="large"
+          class="button-primary"
+          @click="handlerNextStep"
+          style="padding: 0 60px;">下一步</a-button>
+        <a-button
+          id="importGuide-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+    <!-- 导入 -->
+    <chooseImportModal :openModal="openImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
+  </a-modal>
+</template>
+
+<script>
+import ChooseImportModal from './chooseImportModal.vue'
+import { Upload } from '@/components'
+export default {
+  name: 'ImportGuideModal',
+  components: { ChooseImportModal, Upload },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    params: { // 参数
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      openImportModal: false, //  导入
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/salesDetail/importDetail', // 接口
+      paramsData: null, // 单据信息
+      uploadParams: { // 上传参数
+        savePathType: 'local'
+      },
+      filePath: location.protocol + '//' + location.host + '/templ/产品补贴金额导入模板.xlsx' // 下载模板
+    }
+  },
+  methods: {
+    // 清空数据
+    resetSearchForm () {
+      this.$refs.importUpload.setFileList() //  清空导入文件
+      this.paramsData = null //  清空上传数据
+    },
+    // 下一步
+    handlerNextStep () {
+      if (this.paramsData) {
+        this.openImportModal = true
+      } else {
+        this.$message.warning('添加文件后再进行下一步操作!')
+      }
+    },
+    // 上传文件  change
+    changeImport (file) {
+      // console.log(file, JSON.parse(file))
+      if (file && JSON.parse(file).length > 0) {
+        this.paramsData = Object.assign({}, JSON.parse(file)[0] || null, this.params)
+      } else {
+        this.paramsData = null
+      }
+    },
+    // 导入
+    hanldeOk (obj) {
+      if (obj && obj.length > 0) {
+        this.$emit('ok', obj)
+        this.isShow = false
+      }
+    },
+    // 关闭
+    handleClose () {
+      this.openImportModal = false
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetSearchForm()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .importGuide-modal{
+    .importGuide-con{
+      .explain-con{
+        .explain-item{
+          margin-bottom: 10px;
+          .explain-tit{
+            font-weight: bold;
+            span{
+              display: inline-block;
+              width: 18px;
+              height: 18px;
+              line-height: 16px;
+              text-align: center;
+              margin-right: 5px;
+              border-radius: 50%;
+              border: 1px solid rgba(0, 0, 0, 0.3);
+            }
+          }
+          p{
+            margin: 8px 0;
+            padding-left: 23px;
+          }
+          ul{
+            list-style: none;
+            padding: 0;
+            padding-left: 23px;
+            margin: 0;
+            li{
+              line-height: 26px;
+            }
+          }
+        }
+        #importGuide-attachList{
+          width: 100%;
+        }
+      }
+      .btn-con{
+        margin: 10px 0 20px;
+        text-align: center;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

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

@@ -0,0 +1,304 @@
+<template>
+  <a-card size="small" :bordered="false" class="subsidizedProducts-wrap searchBoxNormal">
+    <!-- 搜索条件 -->
+    <div ref="tableSearch" class="table-page-search-wrapper">
+      <a-form layout="inline" id="subsidizedProducts-form" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品名称">
+              <a-input id="subsidizedProducts-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品编码/原厂编码">
+              <a-input id="subsidizedProducts-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码/原厂编码"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品品牌">
+              <productBrand id="subsidizedProducts-productBrandSn" v-model="queryParam.productBrandSn"></productBrand>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品分类">
+                <productType id="subsidizedProducts-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></productType>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="商城类目">
+                <mallCategory id="subsidizedProducts-category" @change="changeProductsCategory" v-model="category"></mallCategory>
+              </a-form-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="subsidizedProducts-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="subsidizedProducts-reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 操作按钮 -->
+    <div class="table-operator-nobor">
+      <a-button id="subsidizedProducts-add" type="primary" class="button-error" @click="openAddModal=true">新增</a-button>
+      <a-button id="subsidizedProducts-edit" type="primary" class="button-info" @click="handleAdd">批量编辑</a-button>
+      <a-button id="subsidizedProducts-del" type="primary" class="button-error" ghost @click="handleAdd">批量删除</a-button>
+      <a-button id="subsidizedProducts-import" style="margin-left:5px;" @click="handleAdd">导入</a-button>
+    </div>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+70+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :pageSize="20"
+        :scroll="{ y: tableHeight - 10 }"
+        :defaultLoadData="false"
+        :row-selection="{ columnWidth: 40 }"
+        @rowSelection="rowSelectionFun"
+        bordered>
+        <!-- 产品分类 -->
+        <template slot="productType" slot-scope="text, record">
+          <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 促销时间 -->
+        <template slot="promoTime" slot-scope="text, record">
+          <span v-if="record.promoStartDate">{{ record.promoStartDate }} 至 {{ record.promoEndDate }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 商城类目 -->
+        <template slot="categoryName" slot-scope="text, record">
+          <span v-if="record.indName || record.dirName">{{ record.indName }} {{ (record.indName&&record.dirName) ? '>' : '' }} {{ record.dirName }}</span>
+          <span v-else>--</span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            v-if="$hasPermissions('B_product_dealerProduct_edit')"
+            type="link"
+            class="button-primary"
+            @click="handleEdit(record)"
+            :id="'productInfoList-edit-'+record.productSn"
+          >
+            编辑
+          </a-button>
+          <a-button
+            v-if="$hasPermissions('B_product_dealerProduct_detail')"
+            size="small"
+            type="link"
+            class="button-error"
+            @click="handleDel(record)"
+            :id="'productInfoList-detail-'+record.productSn"
+          >
+            删除
+          </a-button>
+          <span v-if="!$hasPermissions('B_product_dealerProduct_edit') && !$hasPermissions('B_product_dealerProduct_detail')">--</span>
+        </template>
+      </s-table>
+    </a-spin>
+    <!-- 新增 -->
+    <subsidyAddModal ref="partQuery" :openModal="openAddModal" @close="openAddModal=false"></subsidyAddModal>
+    <!-- 编辑 -->
+    <subsidy-edit-modal :openModal="openEditModal" @ok="$refs.table.refresh(true)" @close="openEditModal=false" />
+    <!-- 导入产品 -->
+    <importGuideModal :openModal="openGuideModal" @close="openGuideModal=false" @ok="hanldeImprotOk" />
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+// 组件
+import { STable, VSelect } from '@/components'
+import productType from '@/views/common/productType.js'
+import productBrand from '@/views/common/productBrand.js'
+import mallCategory from '@/views/common/mallCategory.js'
+import subsidyAddModal from './subsidyAddModal.vue'
+import subsidyEditModal from './editModal.vue'
+import importGuideModal from './importGuideModal.vue'
+// 接口
+import { shopPromoProductList } from '@/api/shopPromoProduct'
+export default {
+  name: 'SubsidizedProductsList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, productType, productBrand, mallCategory, subsidyAddModal, subsidyEditModal, importGuideModal },
+  data () {
+    const _this = this
+    return {
+      spinning: false,
+      advanced: true, // 高级搜索 展开/关闭
+      disabled: false, //  查询、重置按钮是否可操作
+      tableHeight: 0, // 表格高度
+      // form表单label布局
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 16 }
+      },
+      productType: [], // 产品分类
+      category: [], // 商城类目
+      // 查询条件
+      queryParam: {
+        productName: '', // 产品名称
+        productCode: '', // 产品编码/原厂编码
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
+        categorySn: undefined // 商城类目sn
+      },
+      openAddModal: false, // 打开新增弹窗
+      openEditModal: false, // 打开编辑弹窗
+      rowSelectionInfo: null, // 批量编辑、删除  选择数据
+      openGuideModal: false, // 导入弹窗
+      columns: [
+        { title: '序号', dataIndex: 'no', align: 'center', width: '50px' },
+        { title: '创建时间', dataIndex: 'createTime', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', align: 'center', width: '12%', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'productBrandName', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', align: 'center', width: '15%', scopedSlots: { customRender: 'productType' } },
+        { title: '商城类目', scopedSlots: { customRender: 'categoryName' }, width: '13%', align: 'center' },
+        { title: '原售价', dataIndex: 'promoName', width: '11%', align: 'right', customRender: text => { return (text || text == 0) ? _this.toThousands(text) : '--' } },
+        { title: '补贴金额', dataIndex: 'promoStartDate', align: 'center', width: '11%', scopedSlots: { customRender: 'promoTime' } },
+        { title: '补贴后售价', dataIndex: 'promoTypeDictValue', align: 'center', width: '11%', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '11%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        return shopPromoProductList(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    // 新增
+    handleAdd () {
+
+    },
+    // 确定导入产品
+    hanldeImprotOk (obj) {
+      this.spinning = true
+      salesDetailInsertImport(obj).then(res => {
+        if (res.status == 200) {
+          this.$refs.table.refresh(true)
+          this.getOrderDetail(false)
+        }
+        this.spinning = false
+      })
+    },
+    // 编辑
+    handleEdit () {
+      this.openEditModal = true
+    },
+    //  删除
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定删除产品吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          jxsorgRelationDel({ sn: row.orgSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+            _this.spinning = false
+          })
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.productName = ''
+      this.queryParam.productCode = ''
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.queryParam.categorySn = undefined
+      this.productType = []
+      this.category = []
+      this.$refs.table.refresh()
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    // 商城类目
+    changeProductsCategory (val) {
+      this.queryParam.categorySn = (val[0] && val[1]) ? val[1] : (val[0] && !val[1]) ? val[0] : undefined
+    },
+    // 初始化
+    pageInit () {
+      const _this = this
+      _this.getCategoryList()
+      _this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    // 计算表格高度
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 225
+    }
+  },
+  watch: {
+    // 展开关闭  监听表格高度变化
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh(true)
+    }
+  }
+}
+</script>

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

@@ -0,0 +1,303 @@
+<template>
+  <a-drawer
+    title="新增"
+    placement="right"
+    :visible="isShow"
+    width="80%"
+    :get-container="false"
+    :wrap-style="{ position: 'absolute' }"
+    @close="isShow = false"
+    wrapClassName="outIndetail-modal jg-drawer-wrap"
+  >
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="searchBox" class="table-page-search-wrapper">
+        <a-form-model
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :model="queryParam"
+          @keyup.enter.native="$refs.table.refresh(true)" >
+          <a-row :gutter="5">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品编码">
+                <a-input id="chooseShelf-code" ref="searchProductCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="原厂编码">
+                <a-input id="chooseShelf-code" ref="searchProductCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="产品名称">
+                <a-input id="chooseShelf-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="产品分类">
+                <productType id="chooseShelf-productType" :isDealer="true" @change="changeProductType" v-model="productType"></productType>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品品牌">
+                <productBrand id="promoProducts-productBrandSn" v-model="queryParam.productBrandSn"></productBrand>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="商城类目">
+                <a-cascader
+                  id="promoProducts-category"
+                  expandTrigger="hover"
+                  :changeOnSelect="true"
+                  :fieldNames="fieldNames"
+                  :options="categoryOptions"
+                  placeholder="请选择商城类目"
+                  @change="changeProductsCategory"
+                  allowClear
+                  v-model="category"/>
+              </a-form-item>
+            </a-col>
+            <a-col flex="auto" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" id="chooseShelf-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" id="chooseShelf-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
+        <div class="table-operator">
+          <span class="subsidyRequired">*</span>产品补贴<a-input style="width: 20%;margin:0 10px;" id="chooseShelf-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入"/>元
+          <a-button id="chooseShelf-handlePlAdd" style="margin:0 10px;" type="primary" @click="handlePlAdd">批量添加</a-button>
+          <span v-if="selectTotal">已选{{ selectTotal }}项</span>
+        </div>
+      </div>
+      <div class="outIndetail-modal-table">
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          :row-selection="{ columnWidth: 40 }"
+          @rowSelection="rowSelectionFun"
+          bordered>
+        </s-table>
+      </div>
+    </a-spin>
+  </a-drawer>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable } from '@/components'
+// 组件
+import productType from '@/views/common/productType.js'
+import productBrand from '@/views/common/productBrand.js'
+// 接口
+import { stockOutDetailList } from '@/api/stockOut'
+import { queryExtList } from '@/api/shopProduct'
+export default {
+  name: 'SubsidyAddModal',
+  components: { STable, productType, productBrand },
+  mixins: [commonMixin],
+  props: {
+    openModal: {
+      //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    outBizType: { // 出库类型 SHOP_CALL_OUT(店内调出)   /  SALES (销售)
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      tableHeight: 0, // 表格高度
+      baseData: null, // 单据详情信息
+      productType: [],
+      categoryOptions: [], // 产品类目列表
+      category: [], // 类目val
+      // 查询条件
+      queryParam: {
+        productName: '', // 产品名称
+        productCode: '', // 产品编码/原厂编码
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
+        promoName: '', // 促销名称
+        promoType: undefined, // 促销状态
+        promoState: undefined, // 促销状态
+        categorySn: undefined, // 商城类目
+        shopProductStatus: undefined, // 商城状态
+        shopProductDelFlag: 0, // 促销产品标志
+        promoStateList: ['NOT_RELEASE', 'HAVE_RELEASE', 'IS_CLOSE']// 促销列表只查询这两种状态
+      },
+      fieldNames: { label: 'categoryName', value: 'categorySn', children: 'shopCategoryList' },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = this.baseData
+        console.log(params)
+        const queryParams = { outBizType: this.outBizType, productSn: params.productSn }
+        if (this.outBizType == 'SALES') {
+          queryParams.outBizSn = params.salesBillSn
+          queryParams.outBizNo = params.salesBillNo
+        }
+        if (this.outBizType == 'SHOP_CALL_OUT') {
+          queryParams.outBizSn = params.storeCallOutSn
+          queryParams.outBizNo = params.storeCallOutNo
+        }
+        // 仓库仓位
+        queryParams.warehouseSn = params.warehouseSn
+        queryParams.warehouseLocationSn = params.warehouseLocationSn
+        return stockOutDetailList(queryParams).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = 0
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = no + i + 1
+              data[i].totalCost = Number(data[i].putCost * data[i].outQty).toFixed(2)
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  computed: {
+    // 已选数量
+    selectTotal () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRows.length
+    },
+    // 列定义
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'stockBatchNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'putBizTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商城售价', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '终端价', dataIndex: 'putCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '品牌', dataIndex: 'outQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '产品分类', dataIndex: 'totalCost1', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '包装数', dataIndex: 'totalCost2', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'totalCost3', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      // 是否有成本价权限
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(5, 0, { title: '成本价', dataIndex: 'putCost1', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(7, 0, { title: '成本小计', dataIndex: 'totalCost6', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    // 计算表格高度
+    setTableH () {
+      this.$nextTick(() => {
+        const searchBoxH = this.$refs.searchBox.offsetHeight
+        this.tableHeight = window.innerHeight - searchBoxH - 235
+      })
+    },
+    // 获取产品类目列表
+    getCategoryList () {
+      const _this = this
+      _this.spinning = true
+      queryExtList({}).then(res => {
+        if (res.status == 200) {
+          this.categoryOptions = res.data || []
+        }
+        _this.spinning = false
+      })
+    },
+    // 商城类目
+    changeProductsCategory (val) {
+      this.queryParam.categorySn = (val[0] && val[1]) ? val[1] : (val[0] && !val[1]) ? val[0] : undefined
+    },
+    // 关闭弹框
+    cansel () {
+      this.isShow = false
+      this.baseData = null
+    },
+    // 查询列表
+    getData (row) {
+      this.baseData = row
+      this.$nextTick(() => {
+        this.$refs.table.refresh(true)
+      })
+    },
+    // 批量添加
+    handlePlAdd () {
+      if (this.selectTotal) {
+        this.$emit('plAdd', this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || [])
+      } else {
+        this.$message.info('请选择产品')
+      }
+    },
+    resetSearchForm () {
+
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      } else {
+        this.setTableH()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.outIndetail-modal {
+	.ant-drawer-body {
+		padding: 10px 20px;
+    .outIndetail-modal-table{
+      padding: 20px 0 0;
+    }
+    .baseInfo{
+      line-height: 24px;
+      font-size: 14px;
+    }
+	}
+}
+.table-operator{
+  .subsidyRequired{
+    margin-right: 5px;
+    color:#ED1c24;
+  }
+}
+
+</style>

+ 31 - 10
src/views/salesManagement/onlinePayOrder/detail.vue

@@ -77,14 +77,15 @@
               急件总款数:<strong>{{ detailData&&(detailData.oosCategory || detailData.oosCategory==0) ? detailData.oosCategory : '--' }}</strong>;
               急件总数量:<strong>{{ detailData&&(detailData.oosQty || detailData.oosQty==0) ? detailData.oosQty : '--' }}</strong>;<br/>
               总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</strong>;
-              <template v-if="showCost">
+              <template v-if="!showCell.includes('totalCost')">
                 总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</strong>;
                 总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;
               </template>
               <span v-if="detailData&&detailData.sourceType&&detailData.sourceType==='XPRH_PURCHASE'"> 返券金额:<strong>{{ detailData&&(detailData.totalGiveAmount || detailData.totalGiveAmount==0) ? toThousands(detailData.totalGiveAmount) : '--' }}</strong>;</span>
+              <span>补贴金额:<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="onlinePayDetail-cost">成本价</a-checkbox>
+              <hideCellMenus id="onlinePayOrderList-showCellMenus" placeholder="显示" :defHiddenKes="colsArr" v-model="showCell"></hideCellMenus>
             </div>
           </div>
           <!-- 列表 -->
@@ -152,12 +153,13 @@ import { STable, VSelect } from '@/components'
 import editRemarkModal from './editRemarkModal.vue'
 import PrintPanel from '@/views/common/printPanel.vue'
 import outInDetialModal from '../salesQueryNew/outInDetialModal.vue'
+import hideCellMenus from '@/views/common/hideCellMenus'
 // 接口
 import { salesDetailBySn, salesDetailPrint, salesDetailExport } from '@/api/sales'
 import { salesDetailList } from '@/api/salesDetail'
 export default {
   name: 'OnlinePayOrderDetail',
-  components: { STable, VSelect, PrintPanel, editRemarkModal, outInDetialModal },
+  components: { STable, VSelect, PrintPanel, editRemarkModal, outInDetialModal, hideCellMenus },
   mixins: [commonMixin],
   props: {
     outBizSn: { //  有值则为弹框,无值则为页面
@@ -170,7 +172,6 @@ export default {
       showPage: false, // 是否显示组件
       spinning: false,
       disabled: false,
-      showCost: false, // 是否显示成本价
       printOrgCode: false, // 是否打印原创编码
       printAllName: false, // 是否打印全部名称
       printRemarks: false, // 是否打印备注
@@ -209,7 +210,28 @@ export default {
       },
       localDataSource: [], // 原始列表数据
       detailData: null, //  详情数据
-      isShowBisiceInfo: false// 显示基础内容
+      isShowBisiceInfo: false, // 显示基础内容
+      colsArr: [// 需要显示的列
+        {
+          title: '成本价',
+          key: 'totalCost',
+          disabled: false,
+          checked: false
+        },
+        {
+          title: '补贴金额',
+          key: 'oosFlagDictValue1',
+          disabled: false,
+          checked: false
+        },
+        {
+          title: '返券金额',
+          key: 'giveAmount',
+          disabled: false,
+          checked: false
+        }
+      ],
+      showCell: []// 已选要显示的列
     }
   },
   computed: {
@@ -234,20 +256,19 @@ 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) : '--') } }
       ]
+      arr.push({ title: '补贴金额', dataIndex: 'oosFlagDictValue1', width: '6%', align: 'center', 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) : '--') } })
+        arr.push({ title: '返券金额', 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) : '--') } })
-      }
+      arr.push({ slots: { title: 'costTitle' }, dataIndex: 'totalCost', 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 : '--') } })
       }
       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: {