Przeglądaj źródła

经销商促销

chenrui 1 rok temu
rodzic
commit
ca8fa60420

+ 15 - 0
src/components/index.less

@@ -140,6 +140,21 @@
     color: #8e8f91;
   }
 }
+.ant-btn-primary.button-warn {
+  background-color: #f90;
+  border-color: #f90;
+  margin: 0 5px;
+  font-size: 12px;
+  &:hover, &:focus {
+    background-color: #ffb60a;
+    border-color: #ffb60a;
+  }
+ 
+  &:active, &.active {
+    background-color: #dd8500;
+    border-color: #dd8500;
+  }
+}
 .ant-btn-link.button-grey {
   color: #82848a;
   &:hover, &:focus {

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

@@ -3138,31 +3138,6 @@ export const asyncRouterMap = [
                 }
               }
             ]
-          },
-          {
-            path: '/dealerManagement/promotionManagement',
-            redirect: '/dealerManagement/promotionManagement/list',
-            name: 'dealerPromotionManagement',
-            component: BlankLayout,
-            meta: {
-              title: '经销商促销',
-              icon: 'setting'
-              // permission: 'M_dealerPromotionManagementList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'dealerPromotionManagementList',
-                component: () => import(/* webpackChunkName: "dealerManagement" */ '@/views/dealerManagement/promotionManagement/list.vue'),
-                meta: {
-                  title: '经销商促销',
-                  icon: 'setting',
-                  hidden: true
-                  // permission: 'M_dealerPromotionManagementList'
-                }
-              }
-            ]
           }
         ]
       },
@@ -3444,6 +3419,54 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/promotionRulesManagement/dealerPromotions',
+            redirect: '/promotionRulesManagement/dealerPromotions/list',
+            name: 'dealerPromotionManagement',
+            component: BlankLayout,
+            meta: {
+              title: '经销商促销',
+              icon: 'setting'
+              // permission: 'M_dealerPromotionManagementList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'dealerPromotionManagementList',
+                component: () => import(/* webpackChunkName: "dealerManagement" */ '@/views/promotionRulesManagement/dealerPromotions/list.vue'),
+                meta: {
+                  title: '经销商促销',
+                  icon: 'setting',
+                  hidden: true
+                  // permission: 'M_dealerPromotionManagementList'
+                }
+              },
+              {
+                path: 'detail',
+                name: 'dealerPromotionManagementDetail',
+                component: () => import(/* webpackChunkName: "promotionRulesManagement" */ '@/views/promotionRulesManagement/dealerPromotions/detail.vue'),
+                meta: {
+                  title: '促销活动详情',
+                  icon: 'thunderbolt',
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
+              },
+              {
+                path: 'ruleSet/:type',
+                name: 'dealerPromotionManagementRule',
+                component: () => import(/* webpackChunkName: "promotionRulesManagement" */ '@/views/promotionRulesManagement/dealerPromotions/detail.vue'),
+                meta: {
+                  title: '促销规则设置',
+                  icon: 'thunderbolt',
+                  replaceTab: true,
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
+              }
+            ]
           }
         ]
       },

+ 1 - 1
src/views/dealerManagement/promotionManagement/addModal.vue → src/views/promotionRulesManagement/dealerPromotions/addModal.vue

@@ -106,7 +106,7 @@ import { VSelect, Upload } from '@/components'
 import supplier from '@/views/common/supplier.js'
 import warehouse from '@/views/common/chooseWarehouse.js'
 import moment from 'moment'
-import chooseDealer from '@/views/promotionRulesManagement/promotionManagement/chooseDealer'
+import chooseDealer from '../promotionManagement/chooseDealer'
 import { sparePartsReturnSave, sparePartsReturnInfo } from '@/api/sparePartsReturn'
 export default {
   name: 'PromotionListBasicInfoModal',

+ 113 - 0
src/views/promotionRulesManagement/dealerPromotions/brandCategoryModal.vue

@@ -0,0 +1,113 @@
+<template>
+  <a-modal
+    centered
+    class="brand-category-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="openType=='brand'?'促销品费用归属品牌':'促销品费用归属品类'"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="520">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="con">
+        <div class="con-list">
+          品{{ openType=='brand'?'牌':'类' }}数量:17
+        </div>
+        <div class="con-list">
+          <span v-for="con in 30" :key="con">霍尼韦尔</span>
+        </div>
+      </div>
+      <div class="btn-cont">
+        <a-button id="brand-category-modal-back" @click="isShow = false">关闭</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { VSelect, Upload } from '@/components'
+import supplier from '@/views/common/supplier.js'
+import warehouse from '@/views/common/chooseWarehouse.js'
+import { sparePartsReturnSave, sparePartsReturnInfo } from '@/api/sparePartsReturn'
+export default {
+  name: 'PurchaseReturnBasicInfoModal',
+  mixins: [commonMixin],
+  components: { VSelect, Upload, supplier, warehouse },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    openType: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false
+    }
+  },
+  methods: {
+    // 获取编辑详情
+    getDetail () {
+      sparePartsReturnInfo({ sn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          const resultObj = res.data
+          this.attachList = resultObj.attachmentList
+          const obj = {
+            supplierSn: resultObj.supplierSn,
+            returnReason: resultObj.returnReason, // 退货原因
+            explainInfo: resultObj.explainInfo, // 补充说明
+            warehouseSn: resultObj.warehouseSn,
+            sparePartsReturnSn: this.itemSn
+          }
+          this.$nextTick(() => {
+            this.$refs.attachList.setFileList(this.attachList)
+          })
+          this.form = { ...this.form, ...obj }
+        } else {
+          this.detailsData = null
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .brand-category-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .con-list{
+      margin-bottom:8px;
+      span{
+        display: inline-block;
+        margin:5px 10px 5px 0;
+      }
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+    .ant-form-item:nth-child(4){
+      margin-bottom: 0px !important;
+    }
+  }
+
+</style>

+ 223 - 0
src/views/promotionRulesManagement/dealerPromotions/detail.vue

@@ -0,0 +1,223 @@
+<template>
+  <div class="salesDetail-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont" style="padding:16px 24px;">
+        <template slot="subTitle">
+          <a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
+          <span style="margin: 0 10px 0 20px;color: #666;font-size: 14px;font-weight: 600;">促销名称:{{ detailData&&detailData.salesReturnNo||'--' }}</span>
+          <a-button type="link" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo">
+            <a-icon :type="isShowBisiceInfo ? 'eye-invisible' : 'eye'"/> {{ isShowBisiceInfo?'隐藏':'查看' }}信息
+          </a-button>
+        </template>
+      </a-page-header>
+      <!-- 基础信息 -->
+      <a-card size="small" title="基础信息" :bordered="false" v-show="!isShowBisiceInfo" class="salesDetail-cont">
+        <a-descriptions size="small" :column="3" v-if="detailData">
+          <a-descriptions-item label="促销名称">{{ detailData.salesBillNo || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="促销时间">{{ detailData.salesBillNo || '--' }}</a-descriptions-item>
+          <a-descriptions-item :span="2" label="促销品费用归属品牌">{{ detailData.createDate || '--' }}all是积分兑换更好地给好的坤哥电饭锅快递费给对方看个房<span class="link-bule btn-box" @click="handleSeeDetail('brand')">详情</span></a-descriptions-item>
+          <a-descriptions-item label="费用所属部门">{{ detailData.buyerName || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="参与客户">{{ detailData.buyerName || '--' }}<span class="link-bule btn-box" @click="handleSee">查看</span></a-descriptions-item>
+          <a-descriptions-item :span="2" label="促销品费用归属品类">{{ detailData.buyerName || '--' }}<span class="link-bule btn-box" @click="handleSeeDetail('category')">详情</span></a-descriptions-item>
+
+          <a-descriptions-item label="促销描述" :span="3">
+            <div class="flex">
+              <div>{{ detailData.salesBillExtEntity&&detailData.salesBillExtEntity.shippingAddrProvinceName || '' }}</div>
+              <span class="link-bule btn-box">查看全部</span>
+            </div>
+          </a-descriptions-item>
+          <a-descriptions-item label="附件"><a class="link-bule" target="downloadFile" download>{{ detailData.billStatusDictValue || '--' }}</a></a-descriptions-item>
+        </a-descriptions>
+      </a-card>
+      <a-card size="small" title="规则设置" :bordered="false" class="pages-wrap">
+        <div class="btnGroup" v-if="$route.params.type=='rule'">
+          <a-button type="primary" class="button-warning" @click="handleProduct" :disabled="disabled">买产品送产品</a-button>
+          <a-button style="margin:0 10px" type="primary" class="button-warn" @click="handleAmount" :disabled="disabled">买产品送采购额</a-button>
+          <a-button type="primary" @click="handleSpecialProduct" :disabled="disabled">特价产品</a-button>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: 500 }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 产品编码 -->
+          <template slot="productCode" slot-scope="text, record">
+            <a-badge count="促" v-if="record.promotionFlag == 1">
+              <div style="padding-right: 15px;">{{ text }}</div>
+            </a-badge>
+            <span v-else>{{ text }}</span>
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              v-if="$route.params.type=='rule'"
+              size="small"
+              type="link"
+              @click="handleDetail(record)"
+              class="button-info"
+              id="promotionList-edit-btn">编辑</a-button>
+            <a-button
+              v-if="$route.params.type=='rule'"
+              size="small"
+              type="link"
+              @click="handleDel(record)"
+              class="button-error"
+              id="promotionList-del-btn">删除</a-button>
+            <a-button
+              v-if="!$route.params.type"
+              size="small"
+              type="link"
+              @click="handleDetail(record)"
+              class="button-info"
+              id="promotionList-edit-btn">详情</a-button>
+          </template>
+        </s-table>
+      </a-card>
+    </a-spin>
+    <!-- 查看参与客户 -->
+    <lookUp-customers-modal ref="lookUpCustomers" :openModal="openCustomerModal" @close="openCustomerModal = false"></lookUp-customers-modal>
+    <!-- 促销品费用归属品牌/促销品费用归属品类 -->
+    <brandCategoryModal :openType="openType" :openModal="openModal" @close="openModal = false"></brandCategoryModal>
+    <!-- 详情 -->
+    <detailModal :openModal="openDetailModal" @close="openDetailModal = false"></detailModal>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable } from '@/components'
+import lookUpCustomersModal from '../promotionManagement/lookUpCustomersModal'
+import brandCategoryModal from './brandCategoryModal'
+import detailModal from './detailModal'
+import { queryPageForWarehouseDetail, salesDetailBySn } from '@/api/sales'
+export default {
+  name: 'SalesOrderWarehouseDetail',
+  mixins: [commonMixin],
+  components: { STable, lookUpCustomersModal, brandCategoryModal, detailModal },
+  data () {
+    return {
+      disabled: false,
+      spinning: false,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        const dataAjax = Object.assign(parameter, { salesBillSn: '559837590779535360', warehouseSn: '527851347359506432' })
+        return queryPageForWarehouseDetail(dataAjax).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
+          }
+          return data
+        })
+      },
+      detailData: null, //  详情数据
+      countData: null, // 数量数据
+      fromRouter: null,
+      openModal: false,
+      isShowBisiceInfo: false,
+      openCustomerModal: false,
+      openType: undefined,
+      openDetailModal: false
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
+        { title: '促销类型', dataIndex: 'productEntity.unit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '规则门槛', dataIndex: 'productEntity.name', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '规则', dataIndex: 'productEntity.origCode', width: '28%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '订单起订金额', dataIndex: 'productCode', width: '15%', scopedSlots: { customRender: 'productCode' }, align: 'center' },
+        { title: '订单经费上限', dataIndex: 'qty', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    // 查看详情
+    handleDetail (con) {
+      this.openDetailModal = true
+    },
+    //  返回
+    handleBack () {
+      this.$router.push({ name: 'dealerPromotionManagement' })
+    },
+    //  详情
+    getDetail () {
+      salesDetailBySn({ salesBillSn: '559837590779535360' }).then(res => {
+        if (res.status == 200) {
+          this.$refs.table.refresh(true)
+          this.detailData = res.data || null
+        } else {
+          this.detailData = null
+        }
+      })
+    },
+    // 基础信息  详情弹窗
+    handleSeeDetail (name) {
+      this.openType = name
+      this.openModal = true
+    },
+    // 买产品送产品
+    handleProduct () {},
+    // 买产品送采购额
+    handleAmount () {},
+    // 特价产品
+    handleSpecialProduct () {},
+    // 查看客户
+    handleSee () {
+      this.openCustomerModal = true
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab || this.outBizSubSn || this.bizSn) { // 页签刷新 或 为弹框时调用
+      this.getDetail()
+    }
+  },
+  activated () {
+    // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
+    if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
+      this.getDetail()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.fromRouter = from
+    })
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .salesDetail-wrap{
+    .salesDetail-cont{
+      margin-bottom: 10px;
+    }
+    .btnGroup{
+      margin-bottom:15px;
+    }
+    .flex{
+      display:flex;
+      align-item:center;
+    }
+    .btn-box{
+      margin-left:5px;
+    }
+    .footer-cont{
+      margin-top: 5px;
+      text-align: center;
+    }
+  }
+</style>

+ 272 - 0
src/views/promotionRulesManagement/dealerPromotions/detailModal.vue

@@ -0,0 +1,272 @@
+<template>
+  <a-modal
+    centered
+    class="dealerPromotions-basicInfo-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="详情"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="900">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="dealerPromotions-basicInfo-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol" >
+        <a-form-model-item label="规则门槛" prop="supplierSn">是</a-form-model-item>
+        <a-form-model-item label="满赠规则" prop="supplierSn">
+          <div>购买满10000元门槛产品,可使用200  元配额,采购规则中的正价商品(配额算销售额)</div>
+          <div>同款产品购买满10个正价产品,送2个促销产品,限制正价产品款数40</div>
+        </a-form-model-item>
+        <a-form-model-item label="数量叠加" prop="supplierSn">是</a-form-model-item>
+        <a-form-model-item prop="supplierSn" v-bind="formItemLayout">
+          <span slot="label">
+            <a-tooltip title="What do you want others to call you?">
+              <a-icon type="info-circle" />
+            </a-tooltip>
+            订单起订金额
+          </span>
+        </a-form-model-item>
+        <a-form-model-item label="活动经费上限" prop="supplierSn">限制 20000元</a-form-model-item>
+        <a-form-model-item label="促销品是否与正品一致" prop="supplierSn">否</a-form-model-item>
+      </a-form-model>
+      <a-card size="small" :bordered="false" class="pages-wrap">
+        <a-radio-group v-model="chooseVal" button-style="solid">
+          <a-radio-button value="a">
+            门槛产品
+          </a-radio-button>
+          <a-radio-button value="b">
+            正价产品
+          </a-radio-button>
+          <a-radio-button value="c">
+            促销产品
+          </a-radio-button>
+        </a-radio-group>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          style="margin-top:10px;max-height:280px;"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: 500 }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 产品分类 -->
+          <template slot="productType" slot-scope="text, record">
+            <a-tag>产品分类</a-tag>
+          </template>
+          <!-- 品牌 -->
+          <template slot="productBrand" slot-scope="text, record">
+            <a-tag>品牌</a-tag>
+          </template>
+          <!-- 产品 -->
+          <template slot="product" slot-scope="text, record">
+            <a-tag>产品</a-tag>
+          </template>
+          <!-- 设置起订量 -->
+          <template slot="setNum" slot-scope="text, record">
+            <span style="margin-right:10px;">按数量设置</span>
+            <span>1</span>
+          </template>
+        </s-table>
+      </a-card>
+      <div class="btn-cont">
+        <a-button id="dealerPromotions-basicInfo-modal-back" @click="isShow = false">关闭</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable } from '@/components'
+import { sparePartsReturnSave, sparePartsReturnInfo } from '@/api/sparePartsReturn'
+export default {
+  name: 'DetailModal',
+  mixins: [commonMixin],
+  components: { STable },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      formItemLayout: {
+        labelCol: { span: 5 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
+        promotionName: '',
+        activeDate: undefined,
+        supplierSn: undefined, // 供应商
+        returnReason: '', // 退货原因
+        explainInfo: '', // 补充说明
+        warehouseSn: undefined,
+        attachmentList: ''
+      },
+      rules: {
+        supplierSn: [
+          { required: true, message: '请选择供应商名称', trigger: 'change' }
+        ]
+      },
+      chooseVal: 'a'
+    }
+  },
+  computed: {
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '产品分类', width: '20%', scopedSlots: { customRender: 'productType' }, align: 'center' },
+        { title: '品牌', width: '40%', scopedSlots: { customRender: 'productBrand' }, align: 'center' },
+        { title: '产品', width: '40%', scopedSlots: { customRender: 'product' }, align: 'center' },
+        { title: '设置起订量', width: '20%', scopedSlots: { customRender: 'setNum' }, align: 'center' }
+      ]
+      if (_this.chooseVal == 'c') {
+        arr.pop()
+      }
+      return arr
+    }
+  },
+  methods: {
+    // 选择参与客户
+    handleDealerModal () {
+      this.openDealerModal = true
+      const _this = this
+      if (_this.chooseDealerList.length == 0) {
+        _this.form.promoBuyerList = []
+      }
+      const arr = _this.chooseDealerList.map(item => {
+        return item.buyerSn
+      })
+      // 选择经销商回显
+      _this.$nextTick(() => {
+        _this.$refs.dealerChoose.pageInit(arr)
+      })
+    },
+    // 添加经销商
+    handleAddDealer (list) {
+      this.chooseDealerList = list.map(con => {
+        return {
+          buyerSn: con.dealerSn,
+          buyerName: con.dealerName
+        }
+      })
+      this.openDealerModal = false
+      // 移除表单必填项
+      this.$refs.ruleForm.clearValidate('promoBuyerList')
+    },
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          form.attachmentList = _this.attachList
+          _this.spinning = true
+          sparePartsReturnSave(form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              setTimeout(() => {
+                _this.isShow = false
+                _this.$emit('ok', res.data)
+                _this.spinning = false
+              }, 1000)
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    // 获取编辑详情
+    getDetail () {
+      sparePartsReturnInfo({ sn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          const resultObj = res.data
+          this.attachList = resultObj.attachmentList
+          const obj = {
+            supplierSn: resultObj.supplierSn,
+            returnReason: resultObj.returnReason, // 退货原因
+            explainInfo: resultObj.explainInfo, // 补充说明
+            warehouseSn: resultObj.warehouseSn,
+            sparePartsReturnSn: this.itemSn
+          }
+          this.$nextTick(() => {
+            this.$refs.attachList.setFileList(this.attachList)
+          })
+          this.form = { ...this.form, ...obj }
+        } else {
+          this.detailsData = null
+        }
+      })
+    },
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf('day') < moment().subtract(1, 'day') // 今天以后,包含今天
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.attachList = []
+        this.supplierName = null
+        this.$nextTick(() => {
+          this.$refs.attachList.setFileList('')
+          this.$refs.ruleForm.resetFields()
+        })
+      } else {
+        if (this.itemSn) {
+          this.getDetail()
+        } else {
+          // 默认仓库
+          this.form.warehouseSn = this.isShowWarehouse ? undefined : this.defWarehouse && this.defWarehouse.warehouseSn
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .dealerPromotions-basicInfo-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .dealerPromotions-basicInfo-con{
+      margin-top:10px;
+    }
+    .ant-form-item{
+      margin-bottom:0 !important;
+    }
+    .buyerBox{
+      border:1px solid #d9d9d9;margin-top:10px;border-radius:4px;padding:4px 10px;background:#f2f2f2;max-height:130px;overflow-y:scroll;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+
+</style>

+ 163 - 0
src/views/promotionRulesManagement/dealerPromotions/editActiveEndTime.vue

@@ -0,0 +1,163 @@
+<template>
+  <a-modal
+    centered
+    class="editActiveEndTime-basicInfo-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="促销时间变更"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="500">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="editActiveEndTime-basicInfo-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol" >
+        <a-form-model-item label="" prop="time">
+          <div style="margin-left:40px;">确定要变更促销名称1的促销时间吗?</div>
+        </a-form-model-item>
+        <a-form-model-item label="原结束日期" prop="time">
+          <span>2023-10-01</span>
+        </a-form-model-item>
+        <a-form-model-item label="变更后结束日期" prop="supplierSn">
+          <a-date-picker style="width:90%" @change="onChange" :format="dateFormat"/>
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button id="editActiveEndTime-basicInfo-modal-back" @click="isShow = false">取消</a-button>
+        <a-button style="margin-left: 15px;" type="primary" id="editActiveEndTime-modal-save" @click="handleSave">确定</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import moment from 'moment'
+import { sparePartsReturnSave, sparePartsReturnInfo } from '@/api/sparePartsReturn'
+export default {
+  name: 'EditActiveEndTimeModal',
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    } },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
+        time: ''
+      },
+      dateFormat: 'YYYY-MM-DD',
+      rules: {
+        supplierSn: [
+          { required: true, message: '请选择供应商名称', trigger: 'change' }
+        ]
+      }
+    }
+  },
+  methods: {
+    onChange (date, dateString) {
+      console.log(date, dateString)
+    },
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          form.attachmentList = _this.attachList
+          _this.spinning = true
+          sparePartsReturnSave(form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              setTimeout(() => {
+                _this.isShow = false
+                _this.$emit('ok', res.data)
+                _this.spinning = false
+              }, 1000)
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    // 获取编辑详情
+    getDetail () {
+      sparePartsReturnInfo({ sn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          const resultObj = res.data
+          this.attachList = resultObj.attachmentList
+          const obj = {
+            supplierSn: resultObj.supplierSn,
+            returnReason: resultObj.returnReason, // 退货原因
+            explainInfo: resultObj.explainInfo, // 补充说明
+            warehouseSn: resultObj.warehouseSn,
+            sparePartsReturnSn: this.itemSn
+          }
+          this.$nextTick(() => {
+            this.$refs.attachList.setFileList(this.attachList)
+          })
+          this.form = { ...this.form, ...obj }
+        } else {
+          this.detailsData = null
+        }
+      })
+    },
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf('day') < moment().subtract(1, 'day') // 今天以后,包含今天
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.attachList = []
+        this.supplierName = null
+        this.$nextTick(() => {
+          this.$refs.attachList.setFileList('')
+          this.$refs.ruleForm.resetFields()
+        })
+      } else {
+        if (this.itemSn) {
+          this.getDetail()
+        } else {
+          // 默认仓库
+          this.form.warehouseSn = this.isShowWarehouse ? undefined : this.defWarehouse && this.defWarehouse.warehouseSn
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .editActiveEndTime-basicInfo-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+
+</style>

+ 17 - 28
src/views/dealerManagement/promotionManagement/list.vue → src/views/promotionRulesManagement/dealerPromotions/list.vue

@@ -75,7 +75,7 @@
         bordered>
         <!-- 促销名称 -->
         <template slot="promotionName" slot-scope="text, record">
-          <div class="nameBox text-overflows2">{{ record.promotionName }}名字</div>
+          <div class="link-bule nameBox text-overflows2" @click="handleDetail(record)">{{ record.promotionName }}名字</div>
         </template>
         <!-- 参与客户 -->
         <template slot="joinCustomers" slot-scope="text, record">
@@ -141,12 +141,8 @@
     <lookUp-customers-modal ref="lookUpCustomers" :openModal="openCustomerModal" @close="openCustomerModal = false"></lookUp-customers-modal>
     <!-- 新增/编辑弹窗-->
     <add-modal v-drag :openModal="openModal" @ok="handleOk" @close="openModal=false" />
-    <!-- 审核提示语 -->
-
-    <!-- 导出提示框 -->
-    <reportModal :visible="showExport" @close="showExport=false"></reportModal>
-    <!-- 审核进度弹窗 -->
-    <!-- <reviewProgressModal v-drag :itemSn="itemSnSh" :auditTime="auditTime" :openModal="openReviewModal" @close="openReviewModal=false"></reviewProgressModal> -->
+    <!-- 促销时间变更 -->
+    <edit-active-end-time v-drag :openModal="editEndModal" @ok="handleEditOk" @close="editEndModal=false" />
   </a-card>
 </template>
 
@@ -154,11 +150,11 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import addModal from './addModal.vue'
-import lookUpCustomersModal from '@/views/promotionRulesManagement/promotionManagement/lookUpCustomersModal'
+import lookUpCustomersModal from '../promotionManagement/lookUpCustomersModal'
 // import detailModal from './detailModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
 // import chooseDepartUserModal from './chooseDepartUserModal.vue'
-// import reviewProgressModal from './reviewProgressModal.vue'
+import editActiveEndTime from './editActiveEndTime.vue'
 import reportModal from '@/views/common/reportModal.vue'
 import { hdExportExcel } from '@/libs/exportExcel'
 import supplier from '@/views/common/supplier.js'
@@ -167,16 +163,15 @@ import { sparePartsReturnList, sparePartsReturnDelete, sparePartsReturnExportDet
 export default {
   name: 'PromotionManagementList',
   mixins: [commonMixin],
-  components: { STable, supplier, VSelect, reportModal, rangeDate, warehouse, lookUpCustomersModal, addModal },
+  components: { STable, supplier, VSelect, reportModal, rangeDate, warehouse, lookUpCustomersModal, addModal, editActiveEndTime },
   data () {
     return {
       spinning: false,
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 新增弹框是否显示
       openCustomerModal: false, // 参与客户弹窗
-
+      editEndModal: false,
       openDetailModal: false, // 详情弹窗
-      openReviewModal: false, // 审核进度弹窗
       showExport: false,
       exportLoading: false,
       tableHeight: 0,
@@ -225,6 +220,11 @@ export default {
     }
   },
   methods: {
+    //  详情
+    handleDetail (row) {
+      // this.$router.push({ path: `/dealerManagement/promotionManagement/detail/${row.salesBillSn}/${row.warehouseSn}` })
+      this.$router.push({ path: `/promotionRulesManagement/dealerPromotions/detail` })
+    },
     // 创建时间
     dateChange (date) {
       this.queryParam.beginDate = date[0]
@@ -282,12 +282,7 @@ export default {
     },
     // 规则设置
     handleSetRules (row) {
-      this.itemSnSh = row.sparePartsReturnSn
-      this.auditTime = row.submitDate
-      const _this = this
-      _this.$nextTick(() => {
-        _this.openReviewModal = true
-      })
+      this.$router.push({ name: 'dealerPromotionManagementRule', params: { type: 'rule' } })
     },
     // 审核
     handleCheck (row) {
@@ -317,7 +312,10 @@ export default {
       })
     },
     // 促销时间变更
-    handleTime () {},
+    handleTime () {
+      this.editEndModal = true
+    },
+    handleEditOk () {},
     // 终止
     handleEnd (row) {
       const _this = this
@@ -360,14 +358,6 @@ export default {
         }
       })
     },
-    //  采购退货详情
-    handleDetail (row) {
-      this.itemSn = row.sparePartsReturnSn
-      const _this = this
-      _this.$nextTick(() => {
-        _this.openDetailModal = true
-      })
-    },
     // 关闭采购退货详情弹框
     closeDetailModal () {
       this.itemSn = null
@@ -455,7 +445,6 @@ export default {
 <style lang="less">
   .promotionList-wrap{
     .nameBox{
-     color: #39f;
      padding:0 5px;
     }
     .common{