Browse Source

促销编辑

lilei 1 year ago
parent
commit
a23825e924

+ 77 - 54
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -24,24 +24,61 @@
         </a-descriptions>
         </a-descriptions>
       </div>
       </div>
     </div>
     </div>
+    <!-- 筛选条件 -->
+   <div class="table-page-search-wrapper" style="margin:0" v-show="showSearchBox">
+     <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+       <a-row :gutter="15">
+         <a-col :md="4" :sm="24">
+           <a-form-item label="出库仓库" prop="warehouseSn">
+             <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn" @load="warehouseLoad"></chooseWarehouse>
+           </a-form-item>
+         </a-col>
+         <a-col :md="4" :sm="24">
+           <a-form-item label="产品编码" prop="productCode">
+             <a-input id="salesEdit-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
+           </a-form-item>
+         </a-col>
+         <a-col :md="4" :sm="24">
+           <a-form-item label="产品名称" prop="productName">
+             <a-input id="salesEdit-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
+           </a-form-item>
+         </a-col>
+         <a-col :md="4" :sm="24">
+           <a-form-item label="品牌">
+             <ProductBrand id="salesEdit-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+           </a-form-item>
+         </a-col>
+         <a-col :md="4" :sm="24">
+           <a-form-item label="产品分类">
+             <productTypeAll placeholder="请选择产品分类" @change="changeProductType" v-model="productType" id="salesEdit-productType"></productTypeAll>
+           </a-form-item>
+         </a-col>
+         <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
+           <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesEdit-refresh">查询</a-button>
+           <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesEdit-reset">重置</a-button>
+         </a-col>
+       </a-row>
+     </a-form>
+   </div>
+
+   <!-- 总计 -->
+   <div class="table-page-search-wrapper">
+      <a-alert type="info" banner :showIcon="false">
+        <div slot="message" class="alert-bar">
+          <div>
+            还需门槛产品金额1000/4000(5000),已选择0元(可使用8000元配额)正价产品,已选择8个正价产品(满10送2),<strong>再满2件产品,可享受优惠</strong>,差200元到订单起订金额(1800元),可选择4个促销产品,已选择2个促销产品
+          </div>
+          <div>
+            <div v-if="$hasPermissions('B_salesEdit_salesPrice')">总金额:<strong>{{ detailData&&(detailData.totalCommonAmount || detailData.totalCommonAmount==0) ? toThousands(detailData.totalCommonAmount) : '--' }}</strong></div>
+            <div v-if="$hasPermissions('B_salesEdit_salesPrice')">优惠金额:<strong>{{ detailData&&(detailData.totalCommonAmount || detailData.totalCommonAmount==0) ? toThousands(detailData.totalCommonAmount) : '--' }}</strong></div>
+          </div>
+        </div>
+      </a-alert>
+    </div>
+    
     <div class="table-page-search-wrapper">
     <div class="table-page-search-wrapper">
       <a-row :gutter="15" type="flex" justify="space-between" align="middle">
       <a-row :gutter="15" type="flex" justify="space-between" align="middle">
         <a-col :md="12" :sm="24" style="text-align:left;">
         <a-col :md="12" :sm="24" style="text-align:left;">
-          <!-- 总计 -->
-          <a-alert type="info" style="width:auto;display: inline-block;" banner :showIcon="false">
-            <div slot="message">
-              <div>
-                已满足1000元门槛金额,已选择180元正价产品配额,<strong>再满2件产品,可享受满赠优惠/已满足促销要求,可享受优惠</strong>
-              </div>
-            </div>
-          </a-alert>
-          <div>
-            <span v-if="$hasPermissions('B_salesEdit_salesPrice')">总金额:<strong>{{ detailData&&(detailData.totalCommonAmount || detailData.totalCommonAmount==0) ? toThousands(detailData.totalCommonAmount) : '--' }}</strong>;</span>
-            <span v-if="$hasPermissions('B_salesEdit_salesPrice')">优惠金额:<strong>{{ detailData&&(detailData.totalCommonAmount || detailData.totalCommonAmount==0) ? toThousands(detailData.totalCommonAmount) : '--' }}</strong>;</span>
-          </div>
-        </a-col>
-        <a-col :md="12" :sm="24" style="text-align:right;">
-          <span v-if="selectTotal" style="margin-right:5px;">已选{{ selectTotal }}项</span>
           <a-dropdown>
           <a-dropdown>
             <a-menu slot="overlay" @click="handleMenuClick">
             <a-menu slot="overlay" @click="handleMenuClick">
               <a-menu-item key="0">
               <a-menu-item key="0">
@@ -55,10 +92,13 @@
               </a-menu-item>
               </a-menu-item>
             </a-menu>
             </a-menu>
             <a-button
             <a-button
-              type="link"
+              type="default"
               class="button-info"
               class="button-info"
             > 批量操作 <a-icon type="down" /> </a-button>
             > 批量操作 <a-icon type="down" /> </a-button>
           </a-dropdown>
           </a-dropdown>
+          <span v-if="selectTotal" style="margin-left:5px;">已选{{ selectTotal }}项</span>
+        </a-col>
+        <a-col :md="12" :sm="24" style="text-align:right;">
           <a-button
           <a-button
             type="link"
             type="link"
             class="button-info"
             class="button-info"
@@ -78,42 +118,7 @@
         </a-col>
         </a-col>
       </a-row>
       </a-row>
     </div>
     </div>
-   <!-- 筛选条件 -->
-   <div class="table-page-search-wrapper" style="margin:0" v-show="showSearchBox">
-     <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-       <a-row :gutter="15">
-         <a-col :md="4" :sm="24">
-           <a-form-item label="出库仓库" prop="warehouseSn">
-             <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn" @load="warehouseLoad"></chooseWarehouse>
-           </a-form-item>
-         </a-col>
-         <a-col :md="4" :sm="24">
-           <a-form-item label="产品编码" prop="productCode">
-             <a-input id="salesEdit-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
-           </a-form-item>
-         </a-col>
-         <a-col :md="4" :sm="24">
-           <a-form-item label="产品名称" prop="productName">
-             <a-input id="salesEdit-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
-           </a-form-item>
-         </a-col>
-         <a-col :md="4" :sm="24">
-           <a-form-item label="品牌">
-             <ProductBrand id="salesEdit-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
-           </a-form-item>
-         </a-col>
-         <a-col :md="4" :sm="24">
-           <a-form-item label="产品分类">
-             <productTypeAll placeholder="请选择产品分类" @change="changeProductType" v-model="productType" id="salesEdit-productType"></productTypeAll>
-           </a-form-item>
-         </a-col>
-         <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
-           <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesEdit-refresh">查询</a-button>
-           <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesEdit-reset">重置</a-button>
-         </a-col>
-       </a-row>
-     </a-form>
-   </div>
+   
     <!-- 已选配件列表 -->
     <!-- 已选配件列表 -->
     <s-table
     <s-table
       class="sTable"
       class="sTable"
@@ -169,6 +174,7 @@
       <!-- 出库仓库 -->
       <!-- 出库仓库 -->
       <template slot="warehouseBox" slot-scope="text, record">
       <template slot="warehouseBox" slot-scope="text, record">
         <a-select
         <a-select
+          size="small"
           style="width:100%;" 
           style="width:100%;" 
           placeholder="请选择仓库"
           placeholder="请选择仓库"
           v-model="record.warehouseSn"
           v-model="record.warehouseSn"
@@ -188,6 +194,14 @@
           class="button-error"
           class="button-error"
           @click="handleDel(record)"
           @click="handleDel(record)"
         >删除</a-button>
         >删除</a-button>
+
+        <a-button
+          size="small"
+          type="link"
+          :loading="delLoading"
+          class="button-primary"
+          @click="handleDel(record)"
+        >更换活动</a-button>
       </template>
       </template>
     </s-table>
     </s-table>
   
   
@@ -592,6 +606,15 @@
 </script>
 </script>
 
 
 <style lang="less">
 <style lang="less">
-  .total-bar{
-  }
+   .alert-bar{
+    display: flex;
+    justify-content: space-between;
+    > div{
+      &:first-child{
+        flex-grow: 1;
+        width:70%;
+        padding-right: 100px;
+      }
+    }
+   }
 </style>
 </style>

+ 50 - 44
src/views/salesManagement/salesQueryNew/comps/productNormalList.vue

@@ -1,49 +1,5 @@
 <template>
 <template>
   <div>
   <div>
-    <div class="table-page-search-wrapper">
-      <a-row :gutter="15" type="flex" justify="space-between" align="middle">
-        <a-col :md="12" :sm="24" style="text-align:left;">
-          <!-- 总计 -->
-         <div>
-            <span v-if="$hasPermissions('B_salesEdit_salesPrice')">总售价:<strong>{{ detailData&&(detailData.totalCommonAmount || detailData.totalCommonAmount==0) ? toThousands(detailData.totalCommonAmount) : '--' }}</strong>;</span>
-            总款数:<strong>{{ detailData&&(detailData.totalCommonCategory || detailData.totalCommonCategory==0) ? detailData.totalCommonCategory : '--' }}</strong>;
-            总数量:<strong>{{ detailData&&(detailData.totalCommonQty || detailData.totalCommonQty==0) ? detailData.totalCommonQty : '--' }}</strong>;
-         </div>
-        </a-col>
-        <a-col :md="12" :sm="24" style="text-align:right;">
-          <span v-if="selectTotal" style="margin-right:5px;">已选{{ selectTotal }}项</span>
-          <a-dropdown>
-            <a-menu slot="overlay" @click="handleMenuClick">
-              <a-menu-item key="0">
-                仓库设置
-              </a-menu-item>
-              <a-menu-item key="1">
-                删除已选项
-              </a-menu-item>
-              <a-menu-item key="2">
-                全部删除
-              </a-menu-item>
-            </a-menu>
-            <a-button
-              type="link"
-              class="button-info"
-            > 批量操作 <a-icon type="down" /> </a-button>
-          </a-dropdown>
-          <a-button
-            type="link"
-            class="button-info"
-             @click="showSearch=!showSearch" ><a-icon type="search"/> 筛选</a-button>
-          <a-button
-            type="link"
-            class="button-info"
-            @click="openGuideModal=true"><a-icon type="login" /> 导入产品</a-button>
-          <a-button
-            type="link"
-            class="button-info"
-            @click="openCpModal=true"><a-icon type="plus" /> 添加产品</a-button>
-        </a-col>
-      </a-row>
-    </div>
     <!-- 筛选条件 -->
     <!-- 筛选条件 -->
     <div class="table-page-search-wrapper" style="margin:0" v-show="showSearch">
     <div class="table-page-search-wrapper" style="margin:0" v-show="showSearch">
       <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
       <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
@@ -80,6 +36,55 @@
         </a-row>
         </a-row>
       </a-form>
       </a-form>
     </div>
     </div>
+    <!-- 总计 -->
+    <div class="table-page-search-wrapper">
+      <a-alert type="info" banner :showIcon="false">
+        <div slot="message">
+            <span v-if="$hasPermissions('B_salesEdit_salesPrice')">总售价:<strong>{{ detailData&&(detailData.totalCommonAmount || detailData.totalCommonAmount==0) ? toThousands(detailData.totalCommonAmount) : '--' }}</strong>;</span>
+            总款数:<strong>{{ detailData&&(detailData.totalCommonCategory || detailData.totalCommonCategory==0) ? detailData.totalCommonCategory : '--' }}</strong>;
+            总数量:<strong>{{ detailData&&(detailData.totalCommonQty || detailData.totalCommonQty==0) ? detailData.totalCommonQty : '--' }}</strong>;
+        </div>
+      </a-alert>
+    </div>
+    <div class="table-page-search-wrapper">
+      <a-row :gutter="15" type="flex" justify="space-between" align="middle">
+        <a-col :md="12" :sm="24" style="text-align:left;">
+          <a-dropdown>
+            <a-menu slot="overlay" @click="handleMenuClick">
+              <a-menu-item key="0">
+                仓库设置
+              </a-menu-item>
+              <a-menu-item key="1">
+                删除已选项
+              </a-menu-item>
+              <a-menu-item key="2">
+                全部删除
+              </a-menu-item>
+            </a-menu>
+            <a-button
+              type="default"
+              class="button-info"
+            > 批量操作 <a-icon type="down" /> </a-button>
+          </a-dropdown>
+          <span v-if="selectTotal" style="margin-left:5px;">已选{{ selectTotal }}项</span>
+        </a-col>
+        <a-col :md="12" :sm="24" style="text-align:right;">
+          <a-button
+            type="link"
+            class="button-info"
+             @click="showSearch=!showSearch" ><a-icon type="search"/> 筛选</a-button>
+          <a-button
+            type="link"
+            class="button-info"
+            @click="openGuideModal=true"><a-icon type="login" /> 导入产品</a-button>
+          <a-button
+            type="link"
+            class="button-info"
+            @click="openCpModal=true"><a-icon type="plus" /> 添加产品</a-button>
+        </a-col>
+      </a-row>
+    </div>
+    
     <!-- 已选配件列表 -->
     <!-- 已选配件列表 -->
     <s-table
     <s-table
       class="sTable"
       class="sTable"
@@ -135,6 +140,7 @@
       <!-- 出库仓库 -->
       <!-- 出库仓库 -->
       <template slot="warehouseBox" slot-scope="text, record">
       <template slot="warehouseBox" slot-scope="text, record">
         <a-select
         <a-select
+          size="small"
           style="width:100%;" 
           style="width:100%;" 
           placeholder="请选择仓库"
           placeholder="请选择仓库"
           v-model="record.warehouseSn"
           v-model="record.warehouseSn"

+ 41 - 19
src/views/salesManagement/salesQueryNew/edit.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <div class="salesEdit-wrap">
+  <div class="salesNewEdit-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-page-header :ghost="false" :backIcon="false" @back="handleBack" >
       <a-page-header :ghost="false" :backIcon="false" @back="handleBack" >
         <!-- 自定义的二级文字标题 -->
         <!-- 自定义的二级文字标题 -->
@@ -28,26 +28,31 @@
       </a-card>
       </a-card>
       <!-- 正常产品 -->
       <!-- 正常产品 -->
       <a-card size="small" :bordered="false" class="salesEdit-cont" v-if="salesBillSn">
       <a-card size="small" :bordered="false" class="salesEdit-cont" v-if="salesBillSn">
-        <productNormalList ref="productNormalList" :detailData="detailData" :warehouseSn="warehouseSn" :salesBillSn="salesBillSn"></productNormalList>
+        <div style="padding: 10px;">
+          <productNormalList ref="productNormalList" :detailData="detailData" :warehouseSn="warehouseSn" :salesBillSn="salesBillSn"></productNormalList>
+        </div>
       </a-card>
       </a-card>
       <!-- 活动产品 -->
       <!-- 活动产品 -->
-      <a-collapse v-model="activeKey" expand-icon-position="right" style="background: #f8f8f8;border-color: #f8f8f8;">
-        <a-collapse-panel 
-        v-for="item in activeList" 
-        :key="item.activeId" 
-        forceRender 
-        style="background: #fff;border-radius: 5px;margin-bottom: 10px;border: 0;overflow: hidden;">
-          <div slot="header" style="display: inline-block;padding:6px;width:80%;">
+      <a-card 
+      size="small" 
+      :bordered="false" 
+      class="salesEdit-cont" 
+      v-for="item in activeList" 
+      :key="item.activeId" 
+      >
+        <div slot="title" style="display: inline-block;width:80%;">
             <div>
             <div>
               <strong style="margin-right:10px;font-size:16px;">{{item.activeName}}</strong> ({{item.activeDesc}})
               <strong style="margin-right:10px;font-size:16px;">{{item.activeName}}</strong> ({{item.activeDesc}})
-              <span style="margin-left:10px;color:#00aaff;"  @click="(event) => {showDesc(event, item.activeId)}">
+              <span style="margin-left:10px;color:#00aaff;cursor: pointer;"  @click="(event) => {showDesc(event, item.activeId)}">
                 <a-icon title="查看活动详情" type="eye"/> 详情
                 <a-icon title="查看活动详情" type="eye"/> 详情
               </span>
               </span>
             </div>
             </div>
           </div>
           </div>
+        <div slot="extra" @click="tooglePanel(item)" style="cursor: pointer;">{{ item.isActive ? '收起' : '展开' }} <a-icon type="caret-right" :rotate="item.isActive ? 90 : 0"/> </div>
+        <div v-show="item.isActive" style="padding: 10px;">
           <productList :ref="'productList-'+item.activeId" :detailData="detailData" :warehouseSn="warehouseSn" :salesBillSn="salesBillSn"></productList>
           <productList :ref="'productList-'+item.activeId" :detailData="detailData" :warehouseSn="warehouseSn" :salesBillSn="salesBillSn"></productList>
-        </a-collapse-panel>
-      </a-collapse>
+        </div>
+      </a-card>
     </a-spin>
     </a-spin>
     <div class="affix-cont">
     <div class="affix-cont">
       <div class="footer-price">
       <div class="footer-price">
@@ -122,7 +127,6 @@ export default {
     return {
     return {
       spinning: false,
       spinning: false,
       activeList:[], // 活动列表
       activeList:[], // 活动列表
-      activeKey: [], // 默认展开的活动
       activeDesKey: {},
       activeDesKey: {},
       salesBillSn: null, // 销售单sn
       salesBillSn: null, // 销售单sn
       detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
       detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
@@ -135,11 +139,29 @@ export default {
       showDetail: false
       showDetail: false
     }
     }
   },
   },
+  computed: {
+    shippingAddress () {
+      const shippingAddrProvinceName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrProvinceName ? this.detailData.salesBillExtEntity.shippingAddrProvinceName : ''
+      const shippingAddrCityName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrCityName ? this.detailData.salesBillExtEntity.shippingAddrCityName : ''
+      const shippingAddrCountyName = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddrCountyName ? this.detailData.salesBillExtEntity.shippingAddrCountyName : ''
+      const shippingAddr = this.detailData && this.detailData.salesBillExtEntity && this.detailData.salesBillExtEntity.shippingAddr ? this.detailData.salesBillExtEntity.shippingAddr : ''
+      if (!shippingAddrProvinceName && !shippingAddrCityName && !shippingAddrCountyName && !shippingAddr) {
+        return '--'
+      } else {
+        return shippingAddrProvinceName + shippingAddrCityName + shippingAddrCountyName + shippingAddr
+      }
+    }
+  },
   methods: {
   methods: {
     //  返回
     //  返回
     handleBack () {
     handleBack () {
       this.$router.push({ name: 'salesQueryNewList', query: { closeLastOldTab: true } })
       this.$router.push({ name: 'salesQueryNewList', query: { closeLastOldTab: true } })
     },
     },
+    tooglePanel(item){
+      console.log(1)
+      item.isActive=!item.isActive
+      this.activeList.splice()
+    },
     //  销售单详情
     //  销售单详情
     getOrderDetail (flag) {
     getOrderDetail (flag) {
       salesDetailBySn({ salesBillSn: this.$route.params.sn }).then(res => {
       salesDetailBySn({ salesBillSn: this.$route.params.sn }).then(res => {
@@ -242,7 +264,7 @@ export default {
         }
         }
       ]
       ]
       this.activeList.map(item => {
       this.activeList.map(item => {
-        this.activeKey.push(item.activeId)
+        item.isActive = true
         this.activeDesKey['search-'+item.activeId] = false
         this.activeDesKey['search-'+item.activeId] = false
       })
       })
     },
     },
@@ -270,10 +292,10 @@ export default {
 </script>
 </script>
 
 
 <style lang="less">
 <style lang="less">
-  .salesEdit-wrap{
+  .salesNewEdit-wrap{
     position: relative;
     position: relative;
     height: 100%;
     height: 100%;
-    padding-bottom: 51px;
+    padding-bottom: 75px;
     box-sizing: border-box;
     box-sizing: border-box;
     >.ant-spin-nested-loading{
     >.ant-spin-nested-loading{
       overflow-y: auto;
       overflow-y: auto;
@@ -300,11 +322,11 @@ export default {
         -webkit-box-orient: vertical;
         -webkit-box-orient: vertical;
       }
       }
     }
     }
-    .ant-collapse .ant-collapse-header {
-        padding: 3px 0 5px 8px!important;
+    .ant-card-small > .ant-card-body {
+        padding: 0!important;
     }
     }
     .affix-cont{
     .affix-cont{
-      padding: 5px 15px;
+      padding: 10px 15px;
       text-align: right;
       text-align: right;
       display: flex;
       display: flex;
       justify-content: space-between;
       justify-content: space-between;