chenrui 4 年之前
父节点
当前提交
4fbe6b259e

+ 1 - 1
.env

@@ -2,7 +2,7 @@ NODE_ENV=production
 VUE_APP_PREVIEW=false
 VUE_APP_API_BASE_URL=https://it.zyucgj.com/zyit/
 VUE_APP_VERSION=V1.0.1
-VUE_APP_PRO_NAME=箭冠汽配BOSS系统
+VUE_APP_PRO_NAME=箭冠运营中心系统
 VUE_APP_LOGO=@/assets/logo.png
 VUE_APP_THEME_COLOR=#ed1c24
 VUE_APP_COM_NAME=广州市箭冠网络科技有限公司

+ 1 - 1
.env.development

@@ -2,7 +2,7 @@ NODE_ENV=development
 VUE_APP_PREVIEW=true
 VUE_APP_API_BASE_URL=/api
 VUE_APP_VERSION=V1.0.1
-VUE_APP_PRO_NAME=箭冠汽配BOSS系统-dev
+VUE_APP_PRO_NAME=箭冠运营中心系统-dev
 VUE_APP_LOGO=@/assets/logo.png
 VUE_APP_THEME_COLOR=#ed1c24
 VUE_APP_COM_NAME=广州市箭冠网络科技有限公司

+ 1 - 1
.env.preview

@@ -2,7 +2,7 @@ NODE_ENV=production
 VUE_APP_PREVIEW=true
 VUE_APP_API_BASE_URL=http://it.test.zyucgj.com/zyit
 VUE_APP_VERSION=V1.0.1
-VUE_APP_PRO_NAME=箭冠汽配BOSS系统-pre
+VUE_APP_PRO_NAME=箭冠运营中心系统-pre
 VUE_APP_LOGO=@/assets/logo.png
 VUE_APP_THEME_COLOR=#ed1c24
 VUE_APP_COM_NAME=广州市箭冠网络科技有限公司

+ 199 - 2
src/components/global.less

@@ -527,10 +527,207 @@ body {
 
 .content {
   .table-operator {
-    margin-bottom: 18px;
-
+    padding: 15px 0;
+    border-top: 1px solid #eee;
+    button {
+      margin-right: 8px;
+    }
+  }
+  .table-operator-nobor{
+    padding: 0 0 15px 0;
     button {
       margin-right: 8px;
     }
   }
 }
+
+/* 扩展ant design pro按钮组件颜色 */
+.ant-btn-primary.button-primary {
+  background-color: #39f;
+  border-color: #39f;
+  margin: 0 5px;
+  font-size: 12px;
+  &:hover, &:focus {
+    background-color: #52a6fb;
+    border-color: #52a6fb;
+  }
+ 
+  &:active, &.active {
+    background-color: #3d80bf;
+    border-color: #3d80bf;
+  }
+}
+ 
+.ant-btn-primary.button-info {
+  background-color: #2db7f5;
+  border-color: #2db7f5;
+  margin: 0 5px;
+  font-size: 12px;
+  &:hover, &:focus {
+    background-color: #32c8f5;
+    border-color: #32c8f5;
+  }
+ 
+  &:active, &.active {
+    background-color: #27a3d8;
+    border-color: #27a3d8;
+  }
+}
+ 
+.ant-btn-primary.button-success {
+  background-color: #0c6;
+  border-color: #0c6;
+  margin: 0 5px;
+  font-size: 12px;
+  &:hover, &:focus {
+    background-color: #01dc8c;
+    border-color: #01dc8c;
+  }
+ 
+  &:active, &.active {
+    background-color: #00af57;
+    border-color: #00af57;
+  }
+}
+ 
+.ant-btn-primary.button-warning {
+  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-primary.button-error {
+  background-color: #f30;
+  border-color: #f30;
+  margin: 0 5px;
+  font-size: 12px;
+  &:hover, &:focus {
+    background-color: #ff6666;
+    border-color: #ff6666;
+  }
+ 
+  &:active, &.active {
+    background-color: #d62a00;
+    border-color: #d62a00;
+  }
+}
+ 
+.ant-btn-primary.button-geekblue {
+  background-color: #2F54EB;
+  border-color: #2F54EB;
+  margin: 0 5px;
+  font-size: 12px;
+  &:hover, &:focus {
+    background-color: #1d39c4;
+    border-color: #1d39c4;
+  }
+ 
+  &:active, &.active {
+    background-color: #597ef7;
+    border-color: #597ef7;
+  }
+}
+ 
+.ant-btn-primary.button-purple {
+  background-color: #722ED1;
+  border-color: #722ED1;
+  margin: 0 5px;
+  font-size: 12px;
+  &:hover, &:focus {
+    background-color: #9254de;
+    border-color: #9254de;
+  }
+ 
+  &:active, &.active {
+    background-color: #531dab;
+    border-color: #531dab;
+  }
+}
+
+// btn-link
+.ant-btn-link.button-primary {
+  color: #39f;
+  &:hover, &:focus {
+    color: #52a6fb;
+  }
+ 
+  &:active, &.active {
+    color: #3d80bf;
+  }
+}
+ 
+.ant-btn-link.button-info {
+  color: #2db7f5;
+  &:hover, &:focus {
+    color: #32c8f5;
+  }
+ 
+  &:active, &.active {
+    color: #27a3d8;
+  }
+}
+ 
+.ant-btn-link.button-success {
+  color: #0c6;
+  &:hover, &:focus {
+    color: #01dc8c;
+  }
+ 
+  &:active, &.active {
+    color: #00af57;
+  }
+}
+ 
+.ant-btn-link.button-warning {
+  color: #e89105;
+  &:hover, &:focus {
+    color: #ffb60a;
+  }
+ 
+  &:active, &.active {
+    color: #dd8500;
+  }
+}
+ 
+.ant-btn-link.button-error {
+  color: #f30;
+  &:hover, &:focus {
+    color: #ff6666;
+  }
+ 
+  &:active, &.active {
+    color: #d62a00;
+  }
+}
+ 
+.ant-btn-link.button-geekblue {
+  color: #2F54EB;
+  &:hover, &:focus {
+    color: #1d39c4;
+  }
+ 
+  &:active, &.active {
+    color: #597ef7;
+  }
+}
+ 
+.ant-btn-link.button-purple {
+  color: #722ED1;
+  &:hover, &:focus {
+    color: #9254de;
+  }
+ 
+  &:active, &.active {
+    color: #531dab;
+  }
+}

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

@@ -912,6 +912,77 @@ export const asyncRouterMap = [
           }
         ]
       },
+      // 促销管理
+      {
+        path: '/promotionRulesManagement',
+        redirect: '/promotionRulesManagement/promotionRules',
+        component: PageView,
+        meta: {
+          title: '促销管理',
+          icon: 'cluster'
+          // permission: 'M_shop'
+        },
+        children: [
+          {
+            path: '/promotionRulesManagement/promotionRules',
+            redirect: '/promotionRulesManagement/promotionRules/list',
+            name: 'promotionRules',
+            component: RouteView,
+            meta: {
+              title: '促销规则管理',
+              icon: 'pull-request'
+              // permission: 'M_goodsManage_list'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'promotionRulesManagementList',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/promotionRulesManagement/promotionRules/list.vue'),
+                meta: {
+                  title: '促销规则列表',
+                  icon: 'pull-request',
+                  hidden: true
+                  // permission: 'M_goodsManage_list'
+                }
+              },
+              {
+                path: 'add',
+                name: 'promotionRulesManagementAdd',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/promotionRulesManagement/promotionRules/edit.vue'),
+                meta: {
+                  title: '新增促销规则',
+                  icon: 'pull-request',
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
+              },
+              {
+                path: 'edit/:id',
+                name: 'promotionRulesManagementEdit',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/promotionRulesManagement/promotionRules/edit.vue'),
+                meta: {
+                  title: '编辑促销规则',
+                  icon: 'pull-request',
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
+              },
+              {
+                path: 'detail/:id/:sn',
+                name: 'promotionRulesManagementDetail',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/promotionRulesManagement/promotionRules/detail.vue'),
+                meta: {
+                  title: '促销规则详情',
+                  icon: 'pull-request',
+                  hidden: true
+                  // permission: 'B_goodsManage_edit'
+                }
+              }
+            ]
+          }
+        ]
+      },
       // 财务管理
       {
         path: '/financialManagement',

+ 37 - 16
src/views/dealerManagement/marketingDivisionSet/editModal.vue

@@ -30,15 +30,25 @@
           <!-- <a-select placeholder="请选择省份/市" id="productBrandEdit-level" allowClear v-model="form.level">
             <a-select-option v-for="item in productBrandList" :key="item.productBrandSn" :value="item.productBrandSn">{{ item.productBrandName }}</a-select-option>
           </a-select> -->
-          <a-tree
+          <!-- <a-tree
             v-model="checkedKeys"
             checkable
             :expanded-keys="expandedKeys"
             :auto-expand-parent="autoExpandParent"
             :selected-keys="selectedKeys"
             :tree-data="treeData"
+            :check-strictly="true"
             @expand="onExpand"
             @select="onSelect"
+          /> -->
+          <a-tree
+            checkable
+            @check="onCheck"
+            @expand="onExpand"
+            :expandedKeys="expandedKeys"
+            :autoExpandParent="autoExpandParent"
+            v-model="checkedKeys"
+            :treeData="treeData"
           />
         </a-form-model-item>
       </a-form-model>
@@ -146,33 +156,44 @@ export default {
   methods: {
     onExpand (expandedKeys) {
       console.log('onExpand', expandedKeys)
-      // if not set autoExpandParent to false, if children expanded, parent can not collapse.
-      // or, you can remove all expanded children keys.
       this.expandedKeys = expandedKeys
       this.autoExpandParent = false
     },
-    onCheck (checkedKeys) {
-      console.log('onCheck', checkedKeys)
+    onCheck (checkedKeys, info) {
+      console.log('onCheck', checkedKeys, info)
+      // this.checkedData = [...checkedKeys, ...info.halfCheckedKeys]
       this.checkedKeys = checkedKeys
     },
-    onSelect (selectedKeys, info) {
-      console.log('onSelect', info)
-      this.selectedKeys = selectedKeys
-    },
+    // onExpand (expandedKeys) {
+    //   console.log('onExpand', expandedKeys)
+    //   // if not set autoExpandParent to false, if children expanded, parent can not collapse.
+    //   // or, you can remove all expanded children keys.
+    //   this.expandedKeys = expandedKeys
+    //   this.autoExpandParent = false
+    // },
+    // onCheck (checkedKeys) {
+    //   console.log('onCheck', checkedKeys)
+    //   this.checkedKeys = checkedKeys
+    // },
+    // onSelect (selectedKeys, info) {
+    //   console.log('onSelect', info)
+    //   this.selectedKeys = selectedKeys
+    // },
     //  保存
     handleSave () {
+      console.log(this.checkedKeys)
       const _this = this
       _this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const formData = JSON.parse(JSON.stringify(_this.form))
           formData.id = _this.itemId ? _this.itemId : undefined
-          dealerProductBrandSave(formData).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$emit('ok')
-              _this.isShow = false
-            }
-          })
+          // dealerProductBrandSave(formData).then(res => {
+          //   if (res.status == 200) {
+          //     _this.$message.success(res.message)
+          //     _this.$emit('ok')
+          //     _this.isShow = false
+          //   }
+          // })
         } else {
           return false
         }

+ 60 - 0
src/views/promotionRulesManagement/promotionRules/chooseProductsModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <a-modal
+    centered
+    class="marketingDivisionSetEdit-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="选择正价产品"
+    v-model="isShow"
+    @cancle="isShow=false"
+    width="80%">
+    <div class="table-operator">
+      <a-button id="chooseProducts-brand" type="primary" class="button-error" @click="">选择产品品牌</a-button>
+      <a-button id="chooseProducts-type" type="primary" class="button-info" @click="">选择产品分类</a-button>
+      <a-button id="chooseProducts-product" type="primary" class="button-success" @click="">选择产品</a-button>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+export default {
+  name: 'ChooseProductsModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: [Number, String],
+      default: ''
+    },
+    nowData: {
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal //  是否打开弹框
+    }
+  },
+  methods: {
+
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 8 - 0
src/views/promotionRulesManagement/promotionRules/detail.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 302 - 0
src/views/promotionRulesManagement/promotionRules/edit.vue

@@ -0,0 +1,302 @@
+<template>
+  <div class="promotionRulesEdit-wrap">
+    <!-- 内容 -->
+    <a-page-header :ghost="false" :backIcon="false" class="promotionRulesEdit-cont" >
+      <!-- 自定义的二级文字标题 -->
+      <template slot="subTitle">
+        <a id="promotionRulesEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+      </template>
+    </a-page-header>
+    <a-form-model ref="ruleForm" :model="form" :rules="rules" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" >
+      <a-card size="small" :bordered="false" class="promotionRulesEdit-cont">
+        <!-- 基础设置 -->
+        <div class="module">
+          <h3 class="module-tit">基础设置</h3>
+          <a-divider style="margin-top: 0;" />
+          <a-row :gutter="15">
+            <a-col span="12">
+              <a-form-model-item label="活动名称" prop="name">
+                <a-input
+                  id="promotionRulesEdit-name"
+                  :maxLength="100"
+                  v-model.trim="form.name"
+                  @change="filterEmpty"
+                  placeholder="请输入活动名称(最多100个字符)"
+                  allowClear />
+              </a-form-model-item>
+            </a-col>
+            <a-col span="12">
+              <a-form-model-item label="活动时间" prop="activityTime">
+                <a-row :gutter="15">
+                  <a-col span="8">
+                    <a-select
+                      id="promotionRulesEdit-isLimit"
+                      placeholder="请选择"
+                      v-model="form.isLimit"
+                      style="width: 100%;">
+                      <a-select-option v-for="item in rangeList" :key="item.val" :value="item.val">{{ item.name }}</a-select-option>
+                    </a-select>
+                  </a-col>
+                  <a-col span="16">
+                    <a-range-picker
+                      v-if="form.isLimit==1"
+                      style="width:100%"
+                      id="promotionRulesEdit-activityTime"
+                      :disabledDate="disabledDate"
+                      v-model="form.activityTime"
+                      :format="dateFormat"
+                      :placeholder="['开始时间', '结束时间']" />
+                  </a-col>
+                </a-row>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="15">
+            <a-col span="12">
+              <a-form-model-item label="参与客户" prop="activityTime">
+                <a-row :gutter="15">
+                  <a-col span="8">
+                    <a-select
+                      id="promotionRulesEdit-isLimit"
+                      placeholder="请选择"
+                      v-model="form.isLimit"
+                      style="width: 100%;">
+                      <a-select-option v-for="item in rangeList" :key="item.val" :value="item.val">{{ item.name }}</a-select-option>
+                    </a-select>
+                  </a-col>
+                  <a-col span="16">
+                    <a-select
+                      v-if="form.isLimit==1"
+                      id="promotionRulesEdit-isLimit"
+                      placeholder="请选择客户"
+                      v-model="form.isLimit"
+                      style="width: 100%;">
+                      <a-select-option v-for="item in rangeList" :key="item.val" :value="item.val">{{ item.name }}</a-select-option>
+                    </a-select>
+                  </a-col>
+                </a-row>
+              </a-form-model-item>
+            </a-col>
+            <a-col span="12">
+              <a-form-model-item prop="activityTime">
+                <template slot="label">
+                  <a-popover style="margin-top: 13px;">
+                    <template slot="content">即促销品的销售价总额不能高于限值,达到后活动不能参与。</template>
+                    <a-icon type="question-circle" theme="twoTone" />
+                  </a-popover>
+                  <span>活动经费上限</span>
+                </template>
+                <a-row :gutter="15">
+                  <a-col span="8">
+                    <a-select
+                      id="promotionRulesEdit-isLimit"
+                      placeholder="请选择"
+                      v-model="form.isLimit"
+                      style="width: 100%;">
+                      <a-select-option v-for="item in rangeList" :key="item.val" :value="item.val">{{ item.name }}</a-select-option>
+                    </a-select>
+                  </a-col>
+                  <a-col span="16">
+                    <a-input-number
+                      v-if="form.isLimit==1"
+                      id="promotionRulesEdit-carOwnersPrice"
+                      v-model="form.carOwnersPrice"
+                      :min="1"
+                      :max="999999"
+                      :precision="2"
+                      style="width: 85%;margin-right: 5px;"
+                      placeholder="请输入活动经费上限(1~999999)"
+                      allowClear />
+                    <span v-if="form.isLimit==1">万元</span>
+                  </a-col>
+                </a-row>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="15">
+            <a-col span="12">
+              <a-form-model-item prop="activityTime">
+                <template slot="label">
+                  <a-popover style="margin-top: 13px;">
+                    <template slot="content">即限制每个采购单需达到下限金额才能参与促销。</template>
+                    <a-icon type="question-circle" theme="twoTone" />
+                  </a-popover>
+                  <span>订单起订金额</span>
+                </template>
+                <a-row :gutter="15">
+                  <a-col span="8">
+                    <a-select
+                      id="promotionRulesEdit-isLimit"
+                      placeholder="请选择"
+                      v-model="form.isLimit"
+                      style="width: 100%;">
+                      <a-select-option v-for="item in rangeList" :key="item.val" :value="item.val">{{ item.name }}</a-select-option>
+                    </a-select>
+                  </a-col>
+                  <a-col span="16">
+                    <a-input-number
+                      v-if="form.isLimit==1"
+                      id="promotionRulesEdit-carOwnersPrice"
+                      v-model="form.carOwnersPrice"
+                      :min="1"
+                      :max="999999"
+                      :precision="2"
+                      style="width: 85%;margin-right: 5px;"
+                      placeholder="请输入订单起订金额(1~999999)"
+                      allowClear />
+                    <span v-if="form.isLimit==1">万元</span>
+                  </a-col>
+                </a-row>
+              </a-form-model-item>
+            </a-col>
+            <a-col span="12">
+              <a-form-model-item label="备注" prop="name">
+                <a-input
+                  id="promotionRulesEdit-name"
+                  :maxLength="100"
+                  v-model.trim="form.name"
+                  placeholder="请输入备注(最多100个字符)"
+                  allowClear />
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+        </div>
+      </a-card>
+      <a-card size="small" :bordered="false" class="promotionRulesEdit-cont">
+        <!-- 促销规则设置 -->
+        <div class="module">
+          <h3 class="module-tit">促销规则设置</h3>
+          <a-divider style="margin-top: 0;" />
+          <a-form-model-item label="促销类型" prop="type" extra="(即买正价产品送促销品,例如买刹车片送滤芯)" :label-col="{span: 2}" :wrapper-col="{span: 8}">
+            <a-select
+              id="promotionRulesEdit-type"
+              placeholder="请选择"
+              v-model="form.type"
+              style="width: 80%;">
+              <a-select-option v-for="item in typeList" :key="item.val" :value="item.val">{{ item.name }}</a-select-option>
+            </a-select>
+            <a-button icon="plus" size="small" id="promotionRulesEdit-add-btn" style="margin-left: 10px;"></a-button>
+          </a-form-model-item>
+          <div v-if="form.type==0">
+            <a-form-model-item label="促销设置" required :label-col="{span: 2}" :wrapper-col="{span: 22}">
+              购买满
+              <a-form-model-item prop="name" style="display: inline-block;">
+                <a-input-number
+                  id="promotionRulesEdit-carOwnersPrice"
+                  v-model="form.carOwnersPrice"
+                  :min="1"
+                  :max="999999"
+                  :precision="0"
+                  style="width: 200px;margin-right: 5px;"
+                  placeholder="请输入数量(1~999999)"
+                  allowClear />
+              </a-form-model-item>
+              正价产品送
+              <a-form-model-item prop="name" style="display: inline-block;">
+                <a-input-number
+                  id="promotionRulesEdit-carOwnersPrice"
+                  v-model="form.carOwnersPrice"
+                  :min="1"
+                  :max="999999"
+                  :precision="0"
+                  style="width: 200px;margin-right: 5px;"
+                  placeholder="请输入数量(1~999999)"
+                  allowClear />
+              </a-form-model-item>
+              促销品
+            </a-form-model-item>
+            <a-row :gutter="15">
+              <a-col span="12">
+                <a-form-model-item label="正价产品" prop="name">
+                  <a-button size="small" @click="openModal=true" id="promotionRulesEdit-zj" type="primary" class="button-error">请选择</a-button>
+                </a-form-model-item>
+              </a-col>
+              <a-col span="12">
+                <a-form-model-item label="正价产品" prop="name">
+                  <a-button size="small" id="promotionRulesEdit-zj" type="primary" class="button-info">已选</a-button>
+                </a-form-model-item>
+              </a-col>
+            </a-row>
+          </div>
+        </div>
+      </a-card>
+    </a-form-model>
+    <a-affix :offset-bottom="0">
+      <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
+        <a-button
+          type="primary"
+          id="promotionRulesEdit-submit"
+          size="large"
+          class="button-primary"
+          style="padding: 0 60px;">保存</a-button>
+      </div>
+    </a-affix>
+    <!-- 选择正价产品 -->
+    <chooseProductsModal :openModal="openModal" @click="openModal=false" />
+  </div>
+</template>
+
+<script>
+import moment from 'moment'
+import ChooseProductsModal from './chooseProductsModal.vue'
+export default {
+  components: { ChooseProductsModal },
+  data () {
+    return {
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
+        name: '', // 产品名称
+        isLimit: 0, // 是否限制活动时间
+        activityTime: [],
+        type: undefined // 促销类型
+      },
+      rules: {
+        name: [
+          { required: true, message: '请输入产品名称', trigger: 'blur' }
+        ]
+      },
+      rangeList: [ //  是否限制
+        { name: '不限', val: 0 },
+        { name: '限制', val: 1 }
+      ],
+      typeList: [ //  促销类型
+        { name: '买产品送产品', val: 0 },
+        { name: '买产品送采购额', val: 1 },
+        { name: '特价产品销售', val: 2 },
+        { name: '加价换购', val: 3 }
+      ],
+      dateFormat: 'YYYY-MM-DD',
+      openModal: false // 是否选择正价产品
+    }
+  },
+  methods: {
+    // 过滤空格
+    filterEmpty () {
+      let str = this.form.name
+      str = str.replace(/\ +/g, '')
+      str = str.replace(/[ ]/g, '')
+      str = str.replace(/[\r\n]/g, '')
+      this.form.name = str
+    },
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf('day') < moment().subtract(1, 'day') // 今天以后,包含今天
+    },
+    // 返回列表
+    handleBack () {
+
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .promotionRulesEdit-wrap{
+    .promotionRulesEdit-cont{
+      margin-bottom: 10px;
+    }
+  }
+</style>

+ 212 - 0
src/views/promotionRulesManagement/promotionRules/list.vue

@@ -0,0 +1,212 @@
+<template>
+  <a-card size="small" :bordered="false" class="promotionRulesList-wrap">
+    <!-- 搜索条件 -->
+    <div 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-range-picker
+                style="width:100%"
+                id="promotionRulesList-createDate"
+                :disabledDate="disabledDate"
+                v-model="createDate"
+                :format="dateFormat"
+                :placeholder="['开始时间', '结束时间']" />
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="促销名称">
+              <a-input id="promotionRulesList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入促销名称"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="状态">
+              <v-select code="ENABLE_FLAG" id="promotionRulesList-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择状态"></v-select>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="promotionRulesList-refresh">查询</a-button>
+            <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="promotionRulesList-reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 操作按钮 -->
+    <div class="table-operator">
+      <a-button id="promotionRulesList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
+    </div>
+    <!-- 总计 -->
+    <a-alert type="info" showIcon style="margin-bottom:15px">
+      <div slot="message">合计: <strong>222</strong>条</div>
+    </a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      :scroll="{ x: 1350, y: tableHeight }"
+      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="enabledFlag" slot-scope="text, record">
+        <a-switch
+          id="promotionRulesList-enable"
+          checkedChildren="启用"
+          unCheckedChildren="禁用"
+          v-if="$hasPermissions('B_product_dealerProduct_enable')"
+          @change="changeStatus(record)"
+          :checked="record.enabledFlag == 1 ? true : false" />
+        <span v-else :style="{color:(record.enabledFlag==1?'#00aa00':'#999')}"> {{ record.enabledFlag==1? '已启用': '已禁用' }} </span>
+      </template>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+        <a-button
+          size="small"
+          type="link"
+          class="button-info"
+          @click="handleEdit(record)"
+          id="promotionRulesList-edit-btn">编辑</a-button>
+        <a-button
+          size="small"
+          type="link"
+          class="button-success"
+          @click="handleDetail(record)"
+          id="promotionRulesList-detail-btn">详情</a-button>
+      </template>
+    </s-table>
+  </a-card>
+</template>
+
+<script>
+import moment from 'moment'
+import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+import { dealerProductTypeList } from '@/api/dealerProductType'
+import { dealerProductList, dealerProductUpdate, dealerProductExport } from '@/api/dealerProduct'
+import { STable, VSelect } from '@/components'
+export default {
+  components: { STable, VSelect },
+  data () {
+    return {
+      createDate: [], //  创建时间
+      dateFormat: 'YYYY-MM-DD',
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        code: '', //  产品编码
+        name: '', //  产品名称
+        origCode: '', //  原厂编码
+        sysFlag: '0',
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
+        enabledFlag: undefined //  状态
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出loading
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
+        { title: '促销名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '促销时间', dataIndex: 'createsDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '参与客户', dataIndex: 'code', width: 220, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '备注', dataIndex: 'origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '状态', scopedSlots: { customRender: 'enabledFlag' }, width: 140, align: 'center', fixed: 'right' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center', fixed: 'right' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 502
+        }
+        return dealerProductList(Object.assign(parameter, this.queryParam)).then(res => {
+          const 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
+            const productTypeName1 = data.list[i].productTypeName1 ? data.list[i].productTypeName1 : ''
+            const productTypeName2 = data.list[i].productTypeName2 ? ' > ' + data.list[i].productTypeName2 : ''
+            const productTypeName3 = data.list[i].productTypeName3 ? ' > ' + data.list[i].productTypeName3 : ''
+            data.list[i].productTypeName = productTypeName1 + productTypeName2 + productTypeName3
+          }
+          this.disabled = false
+          return data
+        })
+      },
+      openModal: false, //  查看客户详情  弹框
+      itemId: '', //  当前产品id
+      productBrandList: [], //  品牌下拉数据
+      productTypeList: [] //  分类下拉数据
+    }
+  },
+  methods: {
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf() > Date.now()
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.name = ''
+      this.queryParam.enabledFlag = undefined
+      this.createDate = []
+      this.$refs.table.refresh(true)
+    },
+    //  新增/编辑
+    handleEdit (row) {
+      if (row) { //  编辑
+        this.$router.push({ path: `/promotionRulesManagement/promotionRules/edit/${row.id}` })
+      } else { //  新增
+        this.$router.push({ path: '/promotionRulesManagement/promotionRules/add' })
+      }
+    },
+    //  详情
+    handleDetail (row) {
+      this.itemId = row.id
+      this.openModal = true
+    },
+    // 启用 禁用
+    changeStatus (record) {
+      if (record.enabledFlag == '1') {
+        this.$confirm({
+          title: '提示',
+          content: '产品被禁用后,不能再销售,确定禁用吗?',
+          centered: true,
+          onOk: () => {
+            this.setEnable(record)
+          }
+        })
+      } else {
+        this.setEnable(record)
+      }
+    },
+    // 启用 禁用
+    setEnable (record) {
+      const params = {
+        id: record.id,
+        enabledFlag: record.enabledFlag == 1 ? '0' : '1'
+      }
+      // dealerProductUpdate(params).then(res => {
+      //   if (res.status == 200) {
+      //     this.$message.success(res.message)
+      //     this.$refs.table.refresh()
+      //   } else {
+      //     this.$refs.table.refresh()
+      //   }
+      // })
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+
+    })
+  }
+}
+</script>

+ 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
     proxy: {
       '/api': {
-        target: 'http://192.168.16.103:8503/qpls-md',
-        // target: 'http://it.test.zyucgj.com/zyit',
+        // target: 'http://192.168.16.103:8503/qpls-md',
+        target: 'http://qpls-md.360arrow.com.cn/qpls-md',
         // target: 'https://it.test.qiubcar.com/zyit',
         ws: false,
         changeOrigin: true,