Explorar o código

修理厂促销

chenrui %!s(int64=2) %!d(string=hai) anos
pai
achega
646b8a1e1d

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

@@ -3211,6 +3211,31 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/promotionRulesManagement/promotionManagement',
+            redirect: '/promotionRulesManagement/promotionManagement/list',
+            name: 'promotionManagement',
+            component: BlankLayout,
+            meta: {
+              title: '修理厂促销',
+              icon: 'file-ppt'
+              // permission: 'M_promotionManagementList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'promotionManagementList',
+                component: () => import(/* webpackChunkName: "promotionRulesManagement" */ '@/views/promotionRulesManagement/promotionManagement/list.vue'),
+                meta: {
+                  title: '促销列表',
+                  icon: 'file-ppt',
+                  hidden: true
+                  // permission: 'M_promotionManagementList'
+                }
+              }
+            ]
           }
         ]
       },

+ 380 - 0
src/views/promotionRulesManagement/promotionManagement/addModal.vue

@@ -0,0 +1,380 @@
+<template>
+  <a-modal
+    centered
+    class="promotion-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="isEdit?'编辑':'新增'"
+    v-model="isShow"
+    @cancel="isShow = false"
+    :width="900">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="promotion-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-row :gutter="15">
+          <a-col :md="12" :sm="24" v-if="!isEdit">
+            <a-form-model-item label="促销名称" prop="targetType">
+              <a-input v-model="form.targetName" placeholder="请输入促销名称" :maxLength="100"></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="12" :sm="24">
+            <a-form-model-item label="促销时间" prop="time">
+              <a-range-picker
+                style="width:100%"
+                v-model="form.time"
+                :format="dateFormat"
+                @change="dateChange"
+                :placeholder="['开始时间', '结束时间']" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="12" :sm="24" v-if="!isEdit">
+            <a-form-model-item label="调往对象名称" :prop="isDealer||isDepartment ? 'targetSn' : 'targetName'">
+              <a-select
+                v-if="isDealer"
+                show-search
+                id="promotion-dealerName"
+                v-model="form.targetSn"
+                placeholder="请选择经销商"
+                :filter-option="false"
+                :not-found-content="fetching ? undefined : null"
+                @search="fetchUser"
+                @change="handleChange"
+              >
+                <a-spin v-if="fetching" slot="notFoundContent" size="small" />
+                <a-select-option v-for="item in dealerData" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
+              </a-select>
+              <department v-else-if="isDepartment" style="width: 100%;" placeholder="请选择部门" @change="departementChange" v-model="form.targetSn"></department>
+              <a-input v-else v-model="form.targetName" placeholder="请输入调往对象名称(最多30个字符)" :maxLength="30"></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="12" :sm="24" v-if="!isEdit">
+            <a-form-model-item label="调出仓库" prop="warehouseSn">
+              <warehouse
+                v-model="form.warehouseSn"
+                id="promotion-warehouseSn"
+                placeholder="请选择调出仓库"
+              />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="12" :sm="24">
+            <a-form-model-item label="费用/调拨类型" prop="costTypeSn">
+              <AllocateType id="promotion-allocateTypeSn" v-model="allocateTypeVal" placeholder="请选择费用/调拨类型" @change="allocateTypeChange"></AllocateType>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="12" :sm="24">
+            <a-form-model-item label="费用归属品牌">
+              <ProductBrand id="promotion-productBrandSn" @change="changeBrand" v-model="form.productBrandSn" placeholder="请选择费用归属品牌(单选)"></ProductBrand>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="12" :sm="24">
+            <a-form-model-item label="费用归属品类">
+              <productTypeAll placeholder="请选择费用归属品类(单选,可选二级或三级)" @change="changeProductType" v-model="productType" id="promotion-productType"></productTypeAll>
+            </a-form-model-item>
+          </a-col>
+
+          <a-col :md="24" :sm="24">
+            <a-form-model-item style="margin-bottom:10px;" label="备注" prop="remark" :wrapperCol="{ span: 20 }" :labelCol="{ span: 4 }">
+              <a-textarea id="promotion-remark" :maxLength="120" v-model="form.remark" placeholder="请输入备注(最多120个字符)" allowClear />
+            </a-form-model-item>
+          </a-col>
+          <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+            <a-form-model-item label="附件" help="(支持图片、word、excel、PDF等格式,最多10个附件)" :label-col="{span:4}" :wrapper-col="{span:18}">
+              <Upload
+                style="height: 100%;"
+                id="allocateBill-attachList"
+                v-model="form.attachmentList"
+                ref="attachList"
+                :fileSize="10"
+                :maxNums="10"
+                fileType="*"
+                uploadType="attach"
+                :action="attachAction"
+                @change="changeAttach"
+                upText="上传附件"></Upload>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button type="primary" :loading="spinning" id="promotion-modal-save" @click="handleSave">保存</a-button>
+        <a-button id="promotion-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import debounce from 'lodash/debounce'
+import { VSelect, Upload } from '@/components'
+import { allocateBillSave } from '@/api/allocateBill'
+import { dealerSubareaScopeList } from '@/api/dealer'
+import { getLookUpData } from '@/api/data'
+import ProductBrand from '@/views/common/productBrand.js'
+import productTypeAll from '@/views/common/productTypeAll.js'
+import AllocateType from '@/views/common/allocateType.js'
+import warehouse from '@/views/common/chooseWarehouse.js'
+import department from '@/views/expenseManagement/expenseReimbursement/department.js'
+export default {
+  name: 'TransferOutBasicInfoModal',
+  mixins: [commonMixin],
+  components: { VSelect, Upload, ProductBrand, productTypeAll, AllocateType, department, warehouse },
+  props: {
+    openModal: {
+      //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    detailData: Object
+  },
+  data () {
+    this.lastFetchId = 0
+    this.fetchUser = debounce(this.fetchUser, 800)
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      formItemLayout: {
+        labelCol: { span: 8 },
+        wrapperCol: { span: 16 }
+      },
+      productType: [],
+      attachList: [],
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo',
+      form: {
+        targetType: 'DEALER',
+        targetSn: undefined,
+        targetName: '',
+        costTypeSn: '',
+        allocateTypeSn: '',
+        allocateSortSn: '',
+        warehouseSn: undefined, // 仓库
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
+        time: [],
+        promoStartDate: '',
+        promoEndDate: '',
+        remark: '',
+        attachmentList: ''
+      },
+      rules: {
+        targetType: [{ required: true, message: '请选择调往对象', trigger: 'change' }],
+        targetSn: [{ required: true, message: '请选择调往对象名称', trigger: 'change' }],
+        costTypeSn: [{ required: true, message: '请选择费用/调拨类型', trigger: 'change' }],
+        warehouseSn: [{ required: true, message: '请选择调出仓库', trigger: 'change' }],
+        targetName: [{ required: true, message: '请输入调往对象名称', trigger: 'blur' }]
+      },
+      fetching: false,
+      dealerData: [], //  经销商  下拉数据
+      targetTypeList: [], //  调往对象类型
+      allocateTypeVal: [],
+      dateFormat: 'YYYY-MM-DD',
+      isEdit: false
+    }
+  },
+  computed: {
+    // 当前所选调往对象是否为经销商
+    isDealer () {
+      return this.form.targetType == 'DEALER'
+    },
+    isDepartment () {
+      return this.form.targetType == 'DEPARTMENT'
+    }
+  },
+  methods: {
+    // 日期  change
+    dateChange (date, dateStrings) {
+      console.log(date, dateStrings)
+      this.form.time = dateStrings
+      this.form.promoStartDate = date.length ? dateStrings[0] : ''
+      this.form.promoEndDate = date.length ? dateStrings[1] : ''
+    },
+    //  附件上传
+    changeAttach (file) {
+      this.attachList = JSON.parse(file)
+      this.attachList.map(item => {
+        item.fileType = item.extName
+      })
+    },
+    departementChange (v, row) {
+      console.log(v, row)
+      this.form.targetName = row.name
+    },
+    // 调拨类别 change
+    allocateTypeChange (val, opt) {
+      console.log(val, opt, '------------')
+      this.allocateTypeVal = val || ''
+      this.form.costTypeSn = val && val[0] ? val[0] : ''
+      this.form.allocateSortSn = val && val[1] ? val[1] : ''
+      this.form.allocateTypeSn = val && val[2] ? val[2] : ''
+      // 名称
+      this.form.costTypeName = opt && opt[0] ? opt[0].name : ''
+      this.form.allocateSortName = opt && opt[1] ? opt[1].name : ''
+      this.form.allocateTypeName = opt && opt[2] ? opt[2].name : ''
+    },
+    //  产品分类  change
+    changeProductType (val, id, opt) {
+      console.log(val, opt, '------------')
+      this.form.productTypeSn1 = val && val[0] ? val[0] : ''
+      this.form.productTypeSn2 = val && val[1] ? val[1] : ''
+      this.form.productTypeSn3 = val && val[2] ? val[2] : ''
+      // 名称
+      this.form.productTypeName1 = opt && opt[0] ? opt[0].productTypeName : ''
+      this.form.productTypeName2 = opt && opt[1] ? opt[1].productTypeName : ''
+      this.form.productTypeName3 = opt && opt[2] ? opt[2].productTypeName : ''
+    },
+    // 品牌
+    changeBrand (val, id, opt) {
+      console.log(val, opt, '------------')
+      this.form.productBrandName = opt ? opt.brandName : ''
+    },
+    fetchUser (dealerName) {
+      if (dealerName == '') return
+      this.lastFetchId += 1
+      const fetchId = this.lastFetchId
+      this.dealerData = []
+      this.fetching = true
+      dealerSubareaScopeList({ nameLike: dealerName.replace(/\s+/g, ''), pageNo: 1, pageSize: 20 }).then(res => {
+        if (fetchId !== this.lastFetchId) {
+          return
+        }
+        this.dealerData = res.data && res.data.list ? res.data.list : []
+        this.fetching = false
+      })
+    },
+    // 调往对象名称经销商  change
+    handleChange (value) {
+      const ind = this.dealerData.findIndex(item => item.dealerSn == value)
+      console.log(this.dealerData[ind])
+      this.form.targetName = this.dealerData[ind].dealerName
+      this.form.warehouseSn = this.dealerData[ind].defaultWarehouseSn
+    },
+    //  保存
+    handleSave () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          if (!form.productBrandName) {
+            form.productBrandSn = ''
+          }
+          form.attachmentList = this.attachList
+          _this.spinning = true
+          allocateBillSave(form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.isShow = false
+              _this.$emit('ok', res.data)
+            }
+            _this.spinning = false
+          })
+        } else {
+          _this.spinning = false
+          return false
+        }
+      })
+    },
+    // 调往对象  change
+    targetTypeChange (e) {
+      this.$refs.ruleForm.resetFields()
+      this.form.targetSn = undefined
+      this.form.targetName = ''
+      this.form.warehouseSn = undefined
+      this.form.targetType = e.target.value
+    },
+    // 调往对象类型
+    getTargetTypeList () {
+      const _this = this
+      getLookUpData({
+        pageNo: 1,
+        pageSize: 1000,
+        lookupCode: 'TARGET_TYPE'
+      }).then(res => {
+        if (res.status == 200) {
+          _this.targetTypeList = res.data.list
+        } else {
+          _this.targetTypeList = []
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.$refs.ruleForm.resetFields()
+        this.allocateTypeVal = []
+        this.productType = []
+        this.attachList = []
+        this.form.attachmentList = ''
+        this.$refs.attachList.setFileList('')
+        this.form = {
+          targetType: 'DEALER',
+          targetSn: undefined,
+          targetName: '',
+          costTypeSn: '',
+          allocateTypeSn: '',
+          allocateSortSn: '',
+          warehouseSn: undefined,
+          productBrandSn: undefined, //  产品品牌
+          productTypeSn1: '', //  产品一级分类
+          productTypeSn2: '', //  产品二级分类
+          productTypeSn3: '', //  产品三级分类
+          time: [],
+          promoStartDate: '',
+          promoEndDate: '',
+          remark: ''
+        }
+      } else {
+        this.getTargetTypeList()
+        // 编辑
+        if (this.detailData) {
+          this.isEdit = true
+          this.form = Object.assign(this.form, this.detailData)
+          // 获取附件列表
+          this.form.attachmentList = ''
+          this.attachList = this.detailData.attachmentList
+          this.$nextTick(() => {
+            this.$refs.attachList.setFileList(this.attachList)
+          })
+
+          this.allocateTypeVal = [this.detailData.costTypeSn, this.detailData.allocateSortSn, this.detailData.allocateTypeSn]
+          if (this.detailData.productTypeSn1) {
+            this.productType = [this.detailData.productTypeSn1, this.detailData.productTypeSn2, this.detailData.productTypeSn3]
+          }
+          if (this.form.promoStartDate && this.form.promoEndDate) {
+            this.form.time = [this.form.promoStartDate, this.form.promoEndDate]
+          }
+          if (!this.form.productBrandSn) {
+            this.form.productBrandSn = undefined
+          }
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.promotion-modal {
+	.ant-modal-body {
+		padding: 40px 40px 24px;
+	}
+	.btn-cont {
+		text-align: center;
+		margin: 35px 0 10px;
+	}
+}
+</style>

+ 405 - 0
src/views/promotionRulesManagement/promotionManagement/list.vue

@@ -0,0 +1,405 @@
+<template>
+  <a-card size="small" :bordered="false" class="salesReturn-wrap">
+    <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="创建时间">
+                <rangeDate ref="rangeCreateDate" :value="createDate" @change="dateCreateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="促销名称">
+                <a-input id="salesReturn-salesReturnBillNo" v-model.trim="queryParam.salesReturnBillNo" allowClear placeholder="请输入总部销退单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="显示状态">
+                <v-select
+                  v-model="queryParam.salesReturnBillSource"
+                  ref="salesReturnBillSource"
+                  id="salesReturn-salesReturnBillSource"
+                  code="SALES_SOURCE"
+                  placeholder="请选择显示状态"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <a-form-item label="促销状态">
+                <v-select
+                  v-model="queryParam.billStatus"
+                  ref="billStatus"
+                  id="salesReturn-billStatus"
+                  code="SALES_RETURN_BILL_STATUS"
+                  placeholder="请选择促销状态"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+        <!-- 操作按钮 -->
+        <div class="table-operator">
+          <a-button type="primary" class="button-error" @click="openModal = true">新增</a-button>
+        </div>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+94.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <!-- 自定义表头 -->
+        <template slot="arrowFalgTitle">
+          <a-tooltip placement="top">
+            <template slot="title">
+              <span>易码通轮播促销展示显示状态</span>
+            </template>
+            显示状态<a-icon type="question-circle" :style="{ marginLeft: '10px' }" />
+          </a-tooltip>
+        </template>
+        <!-- 参与客户 -->
+        <template slot="joinCustomers" slot-scope="text, record">
+          <span @click="openCustomerModal=true">共有17个客户</span>
+        </template>
+        <!-- 提货单 -->
+        <template slot="pickUpSalesReturnNum" slot-scope="text, record">
+          <span class="link-bule" @click="handleBillOfLadingDetail(record)">{{ record.pickUpSalesReturnNum }}</span>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <div>
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              @click="handleEexamine(record)"
+              id="salesReturn-eexamine-btn">发布修改</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              @click="beforeSubmit(record)"
+              id="salesReturn-eexamine-btn">促销编辑</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-info"
+              @click="handleEdit(record)"
+              id="salesReturn-edit-btn">促销发布</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-error"
+              @click="handleDel(record)"
+              id="salesReturn-del-btn">删除</a-button>
+          </div>
+        </template>
+      </s-table>
+    </a-spin>
+    <!-- 参与客户 -->
+    <lookUp-customers-modal ref="lookUpCustomers" :openModal="openCustomerModal" @close="openCustomerModal = false"></lookUp-customers-modal>
+    <!-- 促销描述 -->
+    <promotion-desc-modal :openModal="openDescModal" @close="openDescModal = false"></promotion-desc-modal>
+    <!-- 促销展示 -->
+    <promotion-show-modal :openModal="openShowModal" @close="openShowModal = false"></promotion-show-modal>
+    <!-- 选择客户弹框 -->
+    <choose-custom-modal :show="openModal" @ok="handleEdit" @cancel="openModal=false"></choose-custom-modal>
+
+    <!-- 审核进度 -->
+    <verifyModal v-drag :openModal="visibleAudit" :itemSn="auditInfo&&auditInfo.salesReturnBillSn" @close="visibleAudit=false"></verifyModal>
+    <!-- 选择审核人员 -->
+    <chooseDepartUserModal v-drag :openModal="openDepartUserModal" @close="openDepartUserModal=false" @submit="handleSubmit"></chooseDepartUserModal>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import subarea from '@/views/common/subarea.js'
+import Area from '@/views/common/area.js'
+// import chooseCustomModal from './chooseCustomModal.vue'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+// import verifyModal from './verifyModal.vue'
+// import chooseDepartUserModal from './chooseDepartUserModal.vue'
+import rangeDate from '@/views/common/rangeDate.vue'
+import warehouse from '@/views/common/chooseWarehouse.js'
+import { salesReturnList, salesReturnQueryCount, salesReturnDel, salesReturnSubmit } from '@/api/salesReturn'
+import moment from 'moment'
+import getDate from '@/libs/getDate.js'
+import lookUpCustomersModal from './lookUpCustomersModal'
+import promotionDescModal from './promotionDescModal'
+import promotionShowModal from './promotionShowModal'
+export default {
+  name: 'SalesReturnList',
+  mixins: [commonMixin],
+  components: {
+    STable,
+    VSelect,
+    dealerSubareaScopeList,
+    rangeDate,
+    lookUpCustomersModal,
+    Area,
+    subarea,
+    warehouse,
+    promotionShowModal,
+    promotionDescModal
+  },
+  data () {
+    return {
+      spinning: false,
+      // 高级搜索 展开/关闭
+      advanced: true,
+      tableHeight: 0,
+      disabled: false, //  查询、重置按钮是否可操作
+      openDescModal: false,
+      openShowModal: true,
+      createDate: [
+        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+      ], //  创建时间
+      openModal: false, // 选择客户弹框是否显示
+      openDepartUserModal: false,
+      openCustomerModal: false,
+      // 查询参数
+      queryParam: {
+        beginDate: getDate.getThreeMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        beginAuditDate: '',
+        endAuditDate: '',
+        buyerSn: undefined, //  客户名称
+        salesReturnBillNo: undefined, //  总部销退单号
+        purchaseReturnApplyNo: '',
+        syncFlag: undefined, // 是否同步给客户
+        billStatus: undefined, // 业务状态
+        warehouseSn: undefined, // 仓库
+        subareaArea: {
+          subareaSn: undefined,
+          subareaAreaSn: undefined
+        },
+        shippingAddrProvinceSn: undefined,
+        salesReturnBillSource: undefined
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        return salesReturnList(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          // 统计
+          this.getCount(params)
+          return data
+        })
+      },
+      visibleAudit: false,
+      auditInfo: null,
+      spinningAudit: false,
+      countData: null,
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '促销名称', dataIndex: 'buyerName', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '促销时间', dataIndex: 'joinCustomers', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '参与客户', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '12%', align: 'center' },
+        { title: '促销描述', scopedSlots: { customRender: 'salesDesc' }, width: '12%', align: 'center' },
+        { title: '促销展示', scopedSlots: { customRender: 'salesShow' }, width: '6%', align: 'center' },
+        { slots: { title: 'arrowFalgTitle' }, scopedSlots: { customRender: 'arrowFalg' }, width: '6%', align: 'center' },
+        { title: '促销状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ]
+    }
+  },
+  methods: {
+    getCount (params) {
+      salesReturnQueryCount(params).then(res => {
+        this.countData = res.data
+      })
+    },
+    //  创建时间  change
+    dateCreateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    //  审核时间  change
+    dateExamineChange (date) {
+      this.queryParam.beginAuditDate = date[0]
+      this.queryParam.endAuditDate = date[1]
+    },
+    custChange (val) {
+      this.queryParam.buyerSn = val.key
+    },
+    // 客服确认
+    handleConfirm (row) {
+      this.$router.push({ name: 'custConfirm', params: { sn: row.salesReturnBillSn, buyerSn: row.buyerSn } })
+    },
+    // 申请提货
+    handlePickUp (row) {
+      this.$store.state.app.tempBillOfData = row
+      this.$router.push({ name: 'billOfLadingAdd', query: { path: 'salerReturn' } })
+    },
+    // 编辑
+    handleEdit (row) {
+      this.$router.push({ name: 'salesReturnEdit', params: { sn: row.salesReturnBillSn, buyerSn: row.buyerSn } })
+    },
+    // 详情
+    handleDetail (row) {
+      this.$router.push({ name: 'salesReturnDetail', params: { sn: row.salesReturnBillSn } })
+    },
+    // 提货单查看
+    handleBillOfLadingDetail (row) {
+      if (row.pickUpSalesReturnNum == '0单') {
+        this.$message.info('此销售退货单没有提货单')
+      } else {
+        this.$router.push({ name: 'billOfLadingList', query: { billNo: row.salesReturnBillNo } })
+      }
+    },
+    // 删除
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: row.salesReturnBillSource == 'SALES' ? '确认要删除吗?' : '确认要取消吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          salesReturnDel({ salesReturnBillSn: row.salesReturnBillSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    //  审核进度
+    handleEexamine (row) {
+      this.auditInfo = row
+      this.visibleAudit = true
+    },
+    beforeSubmit (row) {
+      this.auditInfo = row
+      this.openDepartUserModal = true
+    },
+    // 提交
+    handleSubmit (data) {
+      this.spinning = true
+      salesReturnSubmit({ salesReturnBillSn: this.auditInfo.salesReturnBillSn, ...data }).then(res => {
+        if (res.status == 200) {
+          this.$refs.table.refresh()
+          this.$message.success(res.message)
+        }
+        this.spinning = false
+      })
+    },
+    subareaChange (val) {
+      this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
+    },
+    resetSearchForm () {
+      this.$refs.rangeCreateDate.resetDate(this.createDate)
+      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+
+      this.$refs.rangeExamineDate.resetDate()
+      this.queryParam.beginAuditDate = ''
+      this.queryParam.endAuditDate = ''
+
+      this.queryParam.buyerSn = undefined
+      this.$refs.dealerSubareaScopeList.resetForm()
+      this.queryParam.salesReturnBillNo = ''
+      this.queryParam.purchaseReturnApplyNo = ''
+      this.queryParam.billStatus = undefined
+      this.queryParam.subareaArea.subareaSn = undefined
+      this.queryParam.subareaArea.subareaAreaSn = undefined
+      this.queryParam.syncFlag = undefined
+      this.queryParam.salesReturnBillSource = undefined
+      this.queryParam.shippingAddrProvinceSn = undefined
+      this.queryParam.warehouseSn = undefined
+      if (this.advanced) {
+        this.$refs.subarea.clearData()
+      }
+      this.$refs.table.refresh(true)
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 215
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+<style lang="less">
+  .salesReturn-wrap{
+    .sTable{
+      .badge-con-t{
+        .ant-badge-count{
+          transform: scale(0.8);
+          font-size: 13px;
+        }
+      }
+    }
+  }
+</style>

+ 343 - 0
src/views/promotionRulesManagement/promotionManagement/lookUpCustomersModal.vue

@@ -0,0 +1,343 @@
+<template>
+  <a-modal
+    centered
+    class="lookUpCustomers-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="参与客户"
+    v-model="isShow"
+    @cancel="isShow = false"
+    width="60%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-card size="small" :bordered="false">
+        <!-- 筛选条件 -->
+        <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-model-item label="地区">
+                  <AreaList id="actualSalesReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="区域/分区">
+                  <subarea ref="subarea" id="salesManagementList-subarea" @change="subareaChange"></subarea>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="经销商名称">
+                  <a-input id="salesManagementList-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" allowClear placeholder="请输入经销商名称"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckMakeInventoryList-refresh">查询</a-button>
+                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckMakeInventoryList-reset">重置</a-button>
+                <a-button
+                  style="margin-left: 10px"
+                  type="primary"
+                  class="button-warning"
+                  @click="handleExport"
+                  :disabled="disabled"
+                  :loading="exportLoading"
+                >导出</a-button>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :defaultLoadData="false"
+          :scroll="{ y: 450 }"
+          :rowClassName="(record, index) => record.checkProfitLossQty < 0 ? 'redBg-row':''"
+          bordered>
+        </s-table>
+      </a-card>
+      <div class="btn-cont">
+        <a-button type="primary" id="lookUpCustomers-modal-back" @click="isShow = false">关闭</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { hdPrint } from '@/libs/JGPrint.js'
+import { STable } from '@/components'
+import ProductType from '@/views/common/productType.js'
+import subarea from '@/views/common/subarea.js'
+import AreaList from '@/views/common/areaList.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+import { checkWarehouseDetailList, checkWarehouseDetail, checkWarehouseDetailCount, checkWarehouseDetailExport, checkWarehouseDetailPrint, checkWarehouseWarehouse } from '@/api/checkWarehouse'
+export default {
+  name: 'LookUpCustomersModal',
+  components: { STable, ProductType, subarea, AreaList },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: String || Number,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      disabled: false,
+      advanced: false,
+      exportShow: false,
+      queryParam: {
+        productName: '',
+        productCode: '',
+        productTypeSn1: undefined,
+        productTypeSn2: undefined,
+        productTypeSn3: undefined,
+        warehouseSn: undefined,
+        subareaArea: {
+          subareaSn: undefined,
+          subareaAreaSn: undefined
+        },
+        exportLoading: false,
+        dealer: {
+          dealerSn: undefined,
+          provinceSn: undefined,
+          citySn: undefined,
+          districtSn: undefined,
+          dealerLevel: undefined
+        }
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam, { checkWarehouseSn: this.itemSn })
+        if (this.isPrice) {
+          params.profitLossFlag = 1
+        }
+        return checkWarehouseDetailList(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            this.getDetailCount(params)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.localDataSource = data.list || []
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      basicInfoData: null, //  基本信息
+      productTotal: null,
+      productType: [],
+      warehouseList: [], //  仓库  下拉数据
+      localDataSource: [],
+      isPrice: false, //  仅显示盈亏
+      openPrintModal: false,
+      nowType: null,
+      printerType: 'NEEDLE', //  打印机类型
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '地区', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '区域', dataIndex: 'productUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分区', dataIndex: 'productUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '经销商名称', dataIndex: 'productUnit', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商户类型', dataIndex: 'productUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户级别', dataIndex: 'productUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+    }
+  },
+  methods: {
+    areaChange (val) {
+      this.queryParam.dealer.provinceSn = val[0] ? val[0] : ''
+      this.queryParam.dealer.citySn = val[1] ? val[1] : ''
+      this.queryParam.dealer.districtSn = val[2] ? val[2] : ''
+    },
+    subareaChange (val) {
+      this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
+    },
+    // 详情
+    getDetail () {
+      checkWarehouseDetail({ sn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          this.basicInfoData = res.data || null
+        } else {
+          this.basicInfoData = null
+        }
+      })
+    },
+    // 合计
+    getDetailCount (params) {
+      checkWarehouseDetailCount(params).then(res => {
+        if (res.status == 200) {
+          this.productTotal = res.data
+          if (res.data && res.data.checkLossQty) {
+            this.productTotal.checkLossQty = Math.abs(this.productTotal.checkLossQty || 0)
+          }
+        } else {
+          this.productTotal = null
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.productName = ''
+      this.queryParam.productCode = ''
+      this.queryParam.warehouseSn = undefined
+      this.queryParam.productTypeSn1 = undefined
+      this.queryParam.productTypeSn2 = undefined
+      this.queryParam.productTypeSn3 = undefined
+      this.productType = []
+      this.queryParam.dealer = {
+        dealerSn: undefined,
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined,
+        dealerLevel: undefined
+      }
+      this.queryParam.subareaArea = {
+        subareaSn: undefined,
+        subareaAreaSn: undefined,
+        bizUserSn: undefined
+      }
+      this.$refs.areaList.clearData()
+      this.$refs.subarea.clearData()
+      this.$refs.table.refresh(true)
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    // 仓库下拉数据
+    getWarehouseList () {
+      checkWarehouseWarehouse({}).then(res => {
+        if (res.status == 200) {
+          this.warehouseList = res.data
+        } else {
+          this.warehouseList = []
+        }
+      })
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      _this.$store.state.app.curActionPermission = 'B_sales_export'
+      _this.exportLoading = true
+      _this.spinning = true
+      hdExportExcel(checkWarehouseDetailExport, _this.queryParam, '销售明细', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+        _this.showExport = true
+        _this.$store.state.app.curActionPermission = ''
+      })
+    },
+    // 打印导出
+    handlePrint (type, data) {
+      if (type == 'export') {
+        this.exportShow = false
+        this.nowType = type
+        this.handleOk(data)
+      } else {
+        this.nowType = type
+        this.openPrintModal = true
+      }
+    },
+    handleOk (objs) {
+      const _this = this
+      let params, type
+      let url = checkWarehouseDetailPrint //  打印
+      if (this.nowType == 'export') { //  导出
+        url = checkWarehouseDetailExport
+        params = { checkWarehouseSn: this.itemSn, ...objs }
+        type = 'export'
+      } else { //  打印
+        params = JSON.parse(JSON.stringify(objs))
+        params.printType = this.printerType
+        type = params.type
+        delete params.type
+      }
+      _this.spinning = true
+      // 打印或导出
+      hdPrint(this.printerType, type, url, params, '库存盘点', function () {
+        _this.spinning = false
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.printerType = 'NEEDLE'
+        this.$refs.table.clearTable()
+        this.basicInfoData = null
+      } else {
+        const _this = this
+        setTimeout(() => (
+          _this.resetSearchForm()
+        ), 300)
+      }
+    },
+    itemSn (newValue, oldValue) {
+      if (this.isShow && newValue) {
+        this.isPrice = false
+        this.getDetail()
+        this.getWarehouseList()
+      }
+    },
+    isPrice (newValue, oldValue) {
+      this.$refs.table.refresh(true)
+    }
+  }
+}
+</script>
+<style lang="less" scoped>
+  .lookUpCustomers-modal{
+    .ant-modal-body{
+      padding: 0 24px 24px;
+    }
+    .redBg-row{
+      background-color: #f5cdc8;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 5px 0 10px;
+    }
+    .table-page-search-wrapper{
+      margin-bottom:6px;
+      /deep/.ant-select-selection{
+        border:0 !important;
+        box-shadow: none !important;
+      }
+      .ant-form.ant-form-inline .ant-form-item{
+        border:1px solid #dadada;
+        border-radius: 3px;
+        overflow: hidden;
+        margin-bottom: 10px!important;
+        /deep/.ant-form-item-label{
+          padding-left: 11px !important;
+          padding-right: 0!important;
+        }
+      }
+    }
+  }
+</style>

+ 67 - 0
src/views/promotionRulesManagement/promotionManagement/promotionDescModal.vue

@@ -0,0 +1,67 @@
+<template>
+  <a-modal
+    centered
+    class="promotionDesc-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="modalTit"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="500">
+    <div class="promotionDesc-con">
+      <p>购买满 10000 元正价产品,送 1000 元代金券可用于购买促销品</p>
+      <p>购买满 20000 元正价产品,返 3000 元代金券可用于购买促销品</p>
+      <p>正价消费满 1000 元 减 500 元</p>
+    </div>
+    <div class="btn-cont">
+      <a-button type="primary" id="promotionDesc-modal-back" @click="isShow = false">关闭</a-button>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+export default {
+  name: 'PromotionDescModal',
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      modalTit: '促销描述',
+      isShow: this.openModal //  是否打开弹框
+    }
+  },
+  methods: {
+
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .promotionDesc-modal{
+    .promotionDesc-con{
+       text-align: center;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 50px 0 0px;
+    }
+  }
+</style>

+ 71 - 0
src/views/promotionRulesManagement/promotionManagement/promotionShowModal.vue

@@ -0,0 +1,71 @@
+<template>
+  <a-modal
+    centered
+    class="promotionDesc-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="modalTit"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="500">
+    <div class="promotionDesc-con">
+      <img src="https://img0.baidu.com/it/u=107997771,2476879867&fm=253&fmt=auto&app=138&f=JPEG?w=716&h=500" alt="图片走丢了" srcset="">
+    </div>
+    <div class="btn-cont">
+      <a-button id="promotionDesc-modal-back" @click="isShow = false">下载图片</a-button>
+      <a-button style="margin-left:10px;" type="primary" id="promotionDesc-modal-back" @click="isShow = false">关闭</a-button>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+export default {
+  name: 'PromotionDescModal',
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      modalTit: '促销展示',
+      isShow: this.openModal //  是否打开弹框
+    }
+  },
+  methods: {
+
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .promotionDesc-modal{
+    .promotionDesc-con{
+      max-height:600px;
+      overflow-y: scroll;
+      img{
+         width:100%;
+         height:auto;
+       }
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 30px 0 0px;
+    }
+  }
+</style>

+ 2 - 2
vue.config.js

@@ -108,9 +108,9 @@ const vueConfig = {
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.2.111/ocs-admin',
+        // target: 'http://192.168.2.111/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
-        // target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
+        target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,
         changeOrigin: true,
         pathRewrite: {