lilei пре 2 година
родитељ
комит
05a23dfad7

+ 56 - 2
src/config/router.config.js

@@ -94,7 +94,7 @@ export const asyncRouterMap = [
                 }
                 }
               },
               },
               {
               {
-                path: 'jsSet/:id',
+                path: 'jsSet/:shelfSn',
                 name: 'settlementSet',
                 name: 'settlementSet',
                 component: () => import('@/views/numsGoodsShelves/goodsShelvesAdministration/settlementSet.vue'),
                 component: () => import('@/views/numsGoodsShelves/goodsShelvesAdministration/settlementSet.vue'),
                 meta: {
                 meta: {
@@ -125,7 +125,61 @@ export const asyncRouterMap = [
               icon: 'user',
               icon: 'user',
               permission: 'M_partsDealerManagement '
               permission: 'M_partsDealerManagement '
             }
             }
-          }
+          },
+          {
+            path: '/numsGoodsShelves/redPacket',
+            redirect: '/numsGoodsShelves/redPacket/list',
+            name: 'redPacket',
+            component: BlankLayout,
+            meta: {
+              title: '红包活动设置',
+              icon: 'monitor',
+              // permission: 'M_redPacket'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'redPacketList',
+                component: () => import('@/views/numsGoodsShelves/redPacket/list.vue'),
+                meta: {
+                  title: '红包活动设置',
+                  icon: 'monitor',
+                  hidden: true
+                }
+              },
+              {
+                path: 'edit/:sn',
+                name: 'redPacketEdit',
+                component: () => import('@/views/numsGoodsShelves/redPacket/edit.vue'),
+                meta: {
+                  title: '编辑红包活动',
+                  hidden: true,
+                  replaceTab: true
+                }
+              },
+              {
+                path: 'add',
+                name: 'redPacketAdd',
+                component: () => import('@/views/numsGoodsShelves/redPacket/edit.vue'),
+                meta: {
+                  title: '新增红包活动',
+                  hidden: true,
+                  replaceTab: true
+                }
+              },
+            ]
+          },
+          {
+            path: '/numsGoodsShelves/redPacketStatistics',
+            name: 'redPacketStatistics',
+            component: () => import('@/views/numsGoodsShelves/redPacket/redPacketStatistics.vue'),
+            meta: {
+              title: '红包活动统计',
+              icon: 'user',
+              // permission: 'M_redPacketStatistics'
+            }
+          },
         ]
         ]
       },
       },
       // 系统设置
       // 系统设置

+ 0 - 1
src/views/numsGoodsShelves/goodsShelvesAdministration/list.vue

@@ -93,7 +93,6 @@ export default {
       queryParam: {
       queryParam: {
         dealerSn: undefined, // 配件经销商sn
         dealerSn: undefined, // 配件经销商sn
         shelfName: '', // 货架名称
         shelfName: '', // 货架名称
-        state: '', // 货架状态
         settleType: '', // 结算状态
         settleType: '', // 结算状态
         storeSn: undefined, // 汽车修理厂
         storeSn: undefined, // 汽车修理厂
         state: undefined// 货架状态
         state: undefined// 货架状态

+ 219 - 0
src/views/numsGoodsShelves/redPacket/edit.vue

@@ -0,0 +1,219 @@
+<template>
+  <div class="redPacketSetEidit-page">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="redPacketSetEidit-baseInfo">
+        <template slot="subTitle">
+          <a href="javascript:;" @click="handleBack" id="redPacketSetEidit-handleBack">
+            <a-icon type="left"></a-icon> 返回列表
+          </a>
+          <span style="margin: 0 15px;color: #666;font-weight: bold;">新增红包活动</span>
+        </template>
+      </a-page-header>
+      <a-card :bordered="false" size="small" class="pages-wrap">
+        <div class="redPacketSetEidit-baseInfo">
+          <a-form-model
+            id="redPacketSetEidit-form"
+            ref="ruleForm"
+            :model="form"
+            :rules="rules"
+            :label-col="formItemLayout.labelCol"
+            :wrapper-col="formItemLayout.wrapperCol"
+          >
+            <a-row :gutter="24">
+              <a-row>
+                <a-col :span="12">
+                  <a-form-model-item label="活动名称" prop="activeName">
+                    <a-input id="redPacket-activeName" allowClear v-model.trim="form.activeName" placeholder="请输入活动名称"/>
+                  </a-form-model-item>
+                </a-col>
+                <a-col :span="12">
+                  <a-form-model-item label="活动截止时间" prop="activeTime" help="活动成发布后即刻开始,无需设置开始时间">
+                    <a-input id="redPacket-time" style="width: 70%;margin-right:10px;" allowClear v-model.trim="form.activeTime" placeholder="请输入活动截止时间(精确到小时)"/>
+                    <a-checkbox>永久</a-checkbox>
+                  </a-form-model-item>
+                </a-col>
+              </a-row>
+              <a-row>
+                <a-col :span="12">
+                  <a-form-model-item label="参与货架" prop="settleType">
+                    <a-button type="link" @click="openModal=true">点击选择</a-button>
+                  </a-form-model-item>
+                </a-col>
+                <a-col :span="12">
+                  <a-form-model-item label="活动范围" prop="activeOrg" help="修配易码通用户下单后可获得红包奖励">
+                    <a-checkbox-group
+                      v-model="form.activeOrg"
+                      name="checkboxgroup"
+                      :options="plainOptions"
+                    />
+                  </a-form-model-item>
+                </a-col>
+              </a-row>
+              <a-row>
+                <a-col :span="12">
+                  <a-form-model-item label="备注" prop="remark">
+                    <a-textarea :rows="4" placeholder="请输入备注"></a-textarea>
+                  </a-form-model-item>
+                </a-col>
+              </a-row>
+            </a-row>
+            <a-form-model-item :label-col="{span: 0}" :wrapper-col="{span: 24}" style="text-align: center;">
+              <a-button type="default" @click="handleBack" style="margin-right:20px;" id="redPacketSetEidit-cansel">取消</a-button>
+              <a-button type="primary" @click="handleSubmit" id="redPacketSetEidit-handleSubmit">保存</a-button>
+            </a-form-model-item>
+          </a-form-model>
+        </div>
+      </a-card>
+      <!-- 修改结算方式弹窗 -->
+      <shelfModal :visible="openModal" :checkedList="pageInfo" @close="openModal=false"></shelfModal>
+    </a-spin>
+  </div>
+</template>
+
+<script>
+import { VSelect } from '@/components'
+import { shelfDetail, shelfSettleRuleSave, settleRuleDetail } from '@/api/shelf.js'
+import shelfModal from './shelfModal.vue'
+import { toThousands } from '@/libs/tools.js'
+export default {
+  components: { shelfModal, VSelect },
+  data () {
+    return {
+      spinning: false,
+      openModal: false, // 货位模板弹窗初始状态
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 14 }
+      },
+      plainOptions: [{ label: '货架订单', value: '1' }],
+      settleInfo: null, // 结算详情
+      settlementType: '', // 结算方式
+      pageInfo: null,
+      images: [], // 货架图片
+      form: {
+        settleType: undefined, // 结算方式
+        creditLimit: '', // 授信额度
+        creditWarnLimit: '', // 结算提醒金额
+        settleDay: undefined, // 每月结算日
+        warnBeforeDays: undefined, // 结算提醒提前天数
+        limitFlag: 0, // 是否限制使用
+        bondFlag: '', // 是否缴纳保证金
+        bondAmount: '' // 保证金金额
+      },
+      dateList: [{ id: 1, name: 1 }, { id: 2, name: 2 }, { id: 3, name: 3 }, { id: 4, name: 4 }, { id: 5, name: 5 }, { id: 6, name: 6 }, { id: 7, name: 7 }, { id: 8, name: 8 }, { id: 9, name: 9 }, { id: 10, name: 10 }, { id: 11, name: 11 }, { id: 12, name: 12 }, { id: 13, name: 13 }, { id: 14, name: 14 }, { id: 15, name: 15 }, { id: 16, name: 16 }, { id: 17, name: 17 }, { id: 18, name: 18 }, { id: 19, name: 19 }, { id: 20, name: 20 }, { id: 21, name: 21 }, { id: 22, name: 22 }, { id: 23, name: 23 }, { id: 24, name: 24 }, { id: 25, name: 25 }],
+      dateTXList: [{ id: 1, name: 1 }, { id: 2, name: 2 }, { id: 3, name: 3 }, { id: 4, name: 4 }, { id: 5, name: 5 }, { id: 6, name: 6 }, { id: 7, name: 7 }, { id: 8, name: 8 }, { id: 9, name: 9 }, { id: 10, name: 10 }],
+      rules: {
+        settleType: [ { required: true, message: '请选择结算方式', trigger: 'change' } ],
+        creditLimit: [ { required: true, message: '请输入授信额度', trigger: 'blur' } ],
+        creditWarnLimit: [{ required: true, message: '请输入结算提醒金额', trigger: 'blur' }],
+        settleDay: [ { required: true, message: '请选择每月结算日期', trigger: 'change' } ],
+        warnBeforeDays: [ { required: true, message: '请选择每月结算提醒提前的日期', trigger: 'change' } ],
+        bondFlag: [ { required: true, message: '请选择是否缴纳保证金', trigger: 'change' }],
+        bondAmount: [ { required: true, message: '请输入保证金金额', trigger: 'blur' }]
+      },
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '10%', align: 'center', customRender: function (text, record, index) { return index + 1 || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '保证金金额', dataIndex: 'bondAmount', width: '30%', align: 'right', customRender: function (text) { return toThousands(text, 2) || '--' } },
+        { title: '状态', dataIndex: 'stateDictValue', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '支付时间', width: '20%', align: 'center', dataIndex: 'payDate' }
+      ]
+    }
+  },
+  computed: {
+    isEdit () {
+      return this.$route.params.sn
+    }
+  },
+  methods: {
+    handleBack () {
+      this.form = {
+        settleType: undefined, // 结算方式
+        creditLimit: '', // 授信额度
+        creditWarnLimit: '', // 结算提醒金额
+        settleDay: undefined, // 每月结算日
+        warnBeforeDays: undefined, // 结算提醒提前天数
+        limitFlag: 0, // 是否限制使用
+        bondFlag: '', // 是否缴纳保证金
+        bondAmount: '' // 保证金金额
+      }
+      this.$refs.ruleForm.resetFields()
+      this.$router.push({ name: 'redPacketList' })
+    },
+    // 活动详情
+    getDetail () {
+      this.spinning = true
+      shelfDetail({
+        shelfSn: this.$route.params.sn
+      }).then(res => {
+        if (res.status == 200) {
+          this.pageInfo = Object.assign({}, res.data)
+        } else {
+          this.pageInfo = null
+        }
+        this.spinning = false
+      })
+    },
+    // 保存
+    handleSubmit () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = Object.assign({}, _this.form)
+          if (this.isEdit) {
+            params.shelfSn = this.pageInfo.shelfSn
+            params.storeSn = this.pageInfo.storeSn
+            params.dealerSn = this.pageInfo.dealerSn
+          }
+          _this.spinning = true
+          shelfSettleRuleSave(params).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              setTimeout(function () {
+                _this.isshow = false
+                _this.spinning = false
+                _this.handleBack()
+              }, 300)
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      // 编辑
+      if (vm.$route.params.sn) {
+        vm.getDetail()
+      }
+    })
+  }
+}
+</script>
+
+<style lang="less">
+  .redPacketSetEidit-page{
+    position: relative;
+    height: 100%;
+    padding-bottom: 51px;
+    box-sizing: border-box;
+    .redPacketSetEidit-baseInfo{
+      margin-bottom: 10px;
+      .ant-input-number-handler-wrap{
+        display: none;
+      }
+    }
+    .bzj-collapse{
+      margin-top: 10px;
+      .ant-collapse-content-box{
+        padding: 10px !important;
+      }
+    }
+
+  }
+</style>

+ 178 - 0
src/views/numsGoodsShelves/redPacket/list.vue

@@ -0,0 +1,178 @@
+<template>
+  <a-card size="small" :bordered="false">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="活动名称">
+                <a-input id="redPacket-shelfName" allowClear v-model.trim="queryParam.shelfName" placeholder="请输入活动名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="活动状态">
+                <v-select id="redPacket-state" code="SHELF_STATE" v-model="queryParam.state" allowClear placeholder="请选择状态"></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="$refs.table.refresh(true)" id="redPacket-search">查询</a-button>
+              <a-button type="" @click="reset" id="redPacket-reset" style="margin-left: 10px;">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <div class="table-operator">
+        <a-button type="primary" class="button-error" @click="handleEdit()" id="redPacket-handleEdit">新增红包活动</a-button>
+      </div>
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px', wordBreak: 'break-all' }"
+        size="small"
+        rowKey="id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <template slot="action" slot-scope="text, record">
+          <a-button size="small" type="link" class="button-info" @click="handlePublish(record)">发布</a-button>
+          <a-button size="small" type="link" class="button-info" @click="handleEdit(record)">编辑</a-button>
+          <a-button size="small" type="link" class="button-error" @click="handleDelete(record)">删除</a-button>
+          <a-button size="small" type="link" class="button-info" @click="handleDetail(record)">详情</a-button>
+        </template>
+      </s-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import { getShelfList } from '@/api/shelf.js'
+import dealerList from '@/views/common/dealerList.vue'
+import storeList from '@/views/common/storeList.vue'
+export default {
+  name: 'UserList',
+  components: { STable, VSelect, storeList, dealerList },
+  data () {
+    return {
+      spinning: false,
+      advanced: false,
+      tableHeight: 0,
+      // 查询参数
+      queryParam: {
+        state: '', // 货架状态
+        settleType: '' // 结算状态
+      },
+      showModal: false,
+      itemData: null, // 编辑行数据
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '活动名称', dataIndex: 'shelfName', width: '17%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '活动发布时间', dataIndex: 'createDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '活动截止时间', dataIndex: 'createDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '参与货架', dataIndex: 'dealerName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '活动范围', dataIndex: 'storeName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '活动状态', dataIndex: 'shelfPlaceNum', width: '8%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '备注', dataIndex: 'settleTypeDictValue', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', width: '12%', align: 'left', scopedSlots: { customRender: 'action' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        return getShelfList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (let i = 0; i < data.list.length; i++) {
+              const _item = data.list[i]
+              _item.no = no + i + 1
+            }
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    // 重置
+    reset () {
+      this.queryParam = {
+        shelfName: '', // 货架名称
+        state: undefined// 货架状态
+      }
+      this.$refs.table.refresh(true)
+    },
+    // 编辑/新增
+    handleEdit (row) {
+      if (row) { //  编辑
+        this.$router.push({ name: 'redPacketEdit', params: { shelfSn: row.sn } })
+      } else {
+        this.$router.push({ name: 'redPacketAdd' })
+      }
+    },
+    // 发布
+    handlePublish (row) {
+    },
+    // 删除
+    handleDelete (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要删除吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          productAudit({ sn: row.productSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    // 详情
+    handleDetail (row) {
+      this.showModal = true
+      this.itemData = row
+    },
+    pageInit () {
+      const _this = this
+      _this.$refs.table.refresh()
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 215
+    }
+  },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    this.pageInit()
+    this.reset()
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      if (from.name == 'redPacketEdit' || from.name == 'redPacketAdd') {
+        vm.$refs.table.refresh()
+      } else {
+        vm.reset()
+      }
+    })
+  }
+}
+</script>

+ 273 - 0
src/views/numsGoodsShelves/redPacket/redPacketStatistics.vue

@@ -0,0 +1,273 @@
+<template>
+  <a-card size="small" :bordered="false">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="活动名称">
+                <a-input id="redPacket-shelfName" allowClear v-model.trim="queryParam.shelfName" placeholder="请输入活动名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="货架名称">
+                <a-input id="redPacket-shelfName" allowClear v-model.trim="queryParam.shelfName" placeholder="请输入货架名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="配件经销商">
+                <dealerList ref="dealerList" @change="dealerChange" id="redPacket-dealerChange"></dealerList>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="汽车修理厂">
+                  <storeList ref="storeList" @change="storeChange" id="redPacket-storeChange"></storeList>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="员工姓名">
+                  <a-input id="redPacket-shelfName" allowClear v-model.trim="queryParam.shelfName" placeholder="请输入员工姓名"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="员工手机号码">
+                  <a-input id="redPacket-shelfName" allowClear v-model.trim="queryParam.shelfName" placeholder="请输入员工手机号码"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="订单编号">
+                  <a-input id="redPacket-shelfName" allowClear v-model.trim="queryParam.shelfName" placeholder="请输入员工手机号码"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="订单类型">
+                  <v-select id="redPacket-state" code="SHELF_STATE" v-model="queryParam.state" allowClear placeholder="请选择订单类型"></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="iSCM销售单号">
+                  <a-input id="redPacket-shelfName" allowClear v-model.trim="queryParam.shelfName" placeholder="请输入iSCM销售单号"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="红包奖励时间">
+                  <rangeDate ref="rangeDate" @change="dateChange" />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="红包发放状态">
+                  <v-select id="redPacket-state" code="SHELF_STATE" v-model="queryParam.state" allowClear placeholder="请选择红包发放状态"></v-select>
+                </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)" id="redPacket-search">查询</a-button>
+              <a-button type="" @click="reset" id="gredPacket-reset" style="margin-left: 10px;">重置</a-button>
+              <a-button type="primary" class="button-warning" id="gredPacket-export" style="margin-left: 10px;">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 8px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
+        <div class="table-operator">
+          <a-button type="primary" class="button-error" id="redPacket-handleEdit">批量标记已发</a-button>
+          <span>已选2项</span>
+        </div>
+        <a-alert type="info" style="margin-bottom:10px">
+          <div slot="message">
+            售价总计:<strong>{{ totalData&&(totalData.totalRecord || totalData.totalRecord==0) ? totalData.totalRecord : '--' }}</strong>;
+            成本总计:<strong>{{ totalData&&(totalData.totalCategory || totalData.totalCategory==0) ? totalData.totalCategory : '--' }}</strong>;
+            毛利总计:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
+            红包金额总计:<strong>{{ totalData&&(totalData.totalPushedQty || totalData.totalPushedQty==0) ? totalData.totalPushedQty : '--' }}</strong>;
+          </div>
+        </a-alert>
+      </div>
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px', wordBreak: 'break-all' }"
+        size="small"
+        rowKey="id"
+        :columns="columns"
+        :row-selection="{ columnWidth: 40 }"
+        @rowSelection="rowSelectionFun"
+        :data="loadData"
+        :scroll="{ y: tableHeight, x: 2360 }"
+        :defaultLoadData="false"
+        bordered>
+        <template slot="action" slot-scope="text, record">
+          <a-button size="small" type="link" class="button-info" @click="handlePublish(record)">标记已发</a-button>
+          <a-button size="small" type="link" class="button-error" @click="handleDelete(record)">删除</a-button>
+        </template>
+      </s-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import { getShelfList } from '@/api/shelf.js'
+import dealerList from '@/views/common/dealerList.vue'
+import storeList from '@/views/common/storeList.vue'
+import rangeDate from '@/views/common/rangeDate.vue'
+export default {
+  name: 'UserList',
+  components: { STable, VSelect, storeList, dealerList, rangeDate },
+  data () {
+    return {
+      spinning: false,
+      advanced: false,
+      tableHeight: 0,
+      // 查询参数
+      queryParam: {
+        state: '', // 货架状态
+        settleType: '' // 结算状态
+      },
+      itemData: null, // 编辑行数据
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '60px', align: 'center' },
+        { title: '活动名称', dataIndex: 'shelfName', width: '120px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '货架名称', dataIndex: 'dealerName', width: '120px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '配件经销商', dataIndex: 'dealerName', width: '120px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '汽车修理厂', dataIndex: 'storeName', width: '120px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '员工姓名', dataIndex: 'createDate', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '员工手机号码', dataIndex: 'dealerName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '订单编号', dataIndex: 'storeName', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '订单类型', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '订单状态', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '下单时间', dataIndex: 'createDate', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: 'VIN', dataIndex: 'settleTypeDictValue', width: '140px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '车型', dataIndex: 'storeName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'storeName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'storeName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '下单数量', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '售价', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '售价小计', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '成本小计', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '毛利小计', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '红包奖励时间', dataIndex: 'createDate', width: '90px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '红包毛利比例', dataIndex: 'shelfPlaceNum', width: '90px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '红包金额', dataIndex: 'shelfPlaceNum', width: '80px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '红包发放状态', dataIndex: 'shelfPlaceNum', width: '100px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '红包发放时间', dataIndex: 'createDate', width: '100px', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '操作', width: '120px', align: 'left', scopedSlots: { customRender: 'action' }, fixed: 'right' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        return getShelfList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (let i = 0; i < data.list.length; i++) {
+              const _item = data.list[i]
+              _item.no = no + i + 1
+            }
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      rowSelectionInfo: null
+    }
+  },
+  methods: {
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    // 经销商 change
+    dealerChange (obj) {
+      this.queryParam.dealerSn = obj.key || undefined
+    },
+    // 汽车修理厂 change
+    storeChange (obj) {
+      this.queryParam.storeSn = obj.key || undefined
+    },
+    // 重置
+    reset () {
+      this.queryParam = {
+        shelfName: '', // 货架名称
+        state: undefined// 货架状态
+      }
+      if (this.advanced) {
+        this.$refs.rangeDate.resetDate()
+        this.queryParam.beginDate = ''
+        this.queryParam.endDate = ''
+      }
+      this.$refs.table.refresh(true)
+    },
+    // 编辑/新增
+    handleEdit (row) {
+      if (row) { //  编辑
+        this.$router.push({ name: 'redPacketEdit', params: { shelfSn: row.sn } })
+      } else {
+        this.$router.push({ name: 'redPacketAdd' })
+      }
+    },
+    // 发布
+    handlePublish (row) {
+    },
+    // 删除
+    handleDelete (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要删除吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          productAudit({ sn: row.productSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    pageInit () {
+      const _this = this
+      _this.$refs.table.refresh()
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 255
+    }
+  },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    this.pageInit()
+    this.reset()
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      if (from.name == 'redPacketEdit' || from.name == 'redPacketAdd') {
+        vm.$refs.table.refresh()
+      } else {
+        vm.reset()
+      }
+    })
+  }
+}
+</script>

+ 176 - 0
src/views/numsGoodsShelves/redPacket/shelfModal.vue

@@ -0,0 +1,176 @@
+<template>
+  <div>
+    <a-modal
+      centered
+      wrapClassName="settlementModifyModal-modal"
+      :footer="null"
+      :maskClosable="false"
+      title="选择参与货架"
+      v-model="isshow"
+      @cancle="handleBack"
+      width="80%">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <div ref="tableSearch" class="table-page-search-wrapper">
+          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+            <a-row :gutter="15">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="货架名称">
+                  <a-input id="goodsShelvesAdministrationList-shelfName" allowClear v-model.trim="queryParam.shelfName" placeholder="请输入货架名称"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="配件经销商">
+                  <dealerList ref="dealerList" @change="dealerChange" id="goodsShelvesAdministrationList-dealerChange"></dealerList>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="汽车修理厂">
+                  <storeList ref="storeList" @change="storeChange" id="goodsShelvesAdministrationList-storeChange"></storeList>
+                </a-form-item>
+              </a-col>
+              <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
+                <a-button type="primary" @click="$refs.table.refresh(true)" id="goodsShelvesAdministrationList-search">查询</a-button>
+                <a-button type="" @click="reset" id="goodsShelvesAdministrationList-reset" style="margin-left: 10px;">重置</a-button>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          rowKey="id"
+          :columns="columns"
+          :row-selection="{ columnWidth: 40 }"
+          @rowSelection="rowSelectionFun"
+          :data="loadData"
+          :scroll="{ y: 350 }"
+          bordered>
+        </s-table>
+        <div style="padding:10px;text-align:center;">
+          <a-button type="default" @click="handleBack" style="margin-right:20px;">取消</a-button>
+          <a-button type="primary" @click="handleOk">确定</a-button>
+        </div>
+      </a-spin>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import { getShelfList } from '@/api/shelf.js'
+import dealerList from '@/views/common/dealerList.vue'
+import storeList from '@/views/common/storeList.vue'
+export default {
+  name: 'SettlementModifyModal',
+  components: {
+    STable, VSelect, storeList, dealerList
+  },
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    checkedList: {
+      type: Array,
+      default: function () {
+        return []
+      }
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isshow: this.visible,
+      // 查询参数
+      queryParam: {
+        dealerSn: undefined, // 配件经销商sn
+        shelfName: '', // 货架名称
+        storeSn: undefined, // 汽车修理厂
+        state: 'ENABLE'
+      },
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '货架名称', dataIndex: 'shelfName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '配件经销商', dataIndex: 'dealerName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '汽车修理厂', dataIndex: 'storeName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '货架状态', dataIndex: 'stateDictValue', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: <div>已参加活动&nbsp;<a-tooltip placement='top' title='如果货架存在未开始或进行中的红包活动,则不能再参与其它红包活动。'><a-icon type="question-circle" /></a-tooltip></div>, width: '20%', align: 'center', dataIndex: 'storeName1', customRender: function (text) { return text || '--' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        return getShelfList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (let i = 0; i < data.list.length; i++) {
+              const _item = data.list[i]
+              _item.no = no + i + 1
+            }
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      rowSelectionInfo: null
+    }
+  },
+  methods: {
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    // 经销商 change
+    dealerChange (obj) {
+      this.queryParam.dealerSn = obj.key || undefined
+    },
+    // 汽车修理厂 change
+    storeChange (obj) {
+      this.queryParam.storeSn = obj.key || undefined
+    },
+    handleBack () {
+      this.$emit('close')
+    },
+    handleOk () {
+      const _this = this
+      if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
+        _this.$message.warning('请选择货架!')
+      }
+      this.$emit('ok', _this.rowSelectionInfo.selectedRowKeys)
+    },
+    // 重置
+    reset () {
+      this.queryParam = {
+        dealerSn: undefined, // 配件经销商sn
+        shelfName: '', // 货架名称
+        storeSn: undefined, // 汽车修理厂
+        state: 'ENABLE'
+      }
+      this.$refs.dealerList.resetForm()
+      this.$refs.storeList.resetForm()
+      this.$refs.table.refresh(true)
+    }
+  },
+  watch: {
+    visible (newValue, oldValue) {
+      this.isshow = newValue
+    },
+    isshow (newValue, oldValue) {
+      if (!newValue) {
+        this.$refs.ruleForm.resetFields()
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+<style lang="less">
+.settlementModifyModal-modal{
+  .ant-input-number-handler-wrap{
+    display: none;
+  }
+}
+</style>

+ 2 - 2
vue.config.js

@@ -108,8 +108,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
     proxy: {
       '/api': {
       '/api': {
-        // target: 'http://p.xprh.360arrow.com/xprh-admin',
-        target: 'http://192.168.0.215:8701/xprh-admin',
+        target: 'http://p.xprh.360arrow.com/xprh-admin',
+        // target: 'http://192.168.0.215:8701/xprh-admin',
         // ws: false,
         // ws: false,
         ws: true,
         ws: true,
         changeOrigin: true,
         changeOrigin: true,