ソースを参照

抵扣产品、重置设置、目录更新

chenrui 3 ヶ月 前
コミット
3136446ab9

+ 9 - 9
src/App.vue

@@ -8,17 +8,17 @@
 </template>
 
 <script>
-import zhCN from 'ant-design-vue/es/locale/zh_CN';
+import zhCN from 'ant-design-vue/es/locale/zh_CN'
 import { AppDeviceEnquire } from '@/utils/mixin'
 import { onTextSelected } from '@/utils/util'
-import moment from 'moment';//引入moment 
-import 'moment/locale/zh-cn';
-moment.locale('zh-cn'); //设置语言 或 moment.lang('zh-cn'); 
+import moment from 'moment'// 引入moment
+import 'moment/locale/zh-cn'
+moment.locale('zh-cn') // 设置语言 或 moment.lang('zh-cn');
 export default {
   mixins: [AppDeviceEnquire],
   data () {
     return {
-      locale:zhCN,
+      locale: zhCN,
       envtips: '',
       moment
     }
@@ -26,10 +26,10 @@ export default {
   created () {
     const _this = this
     this.envtips = process.env.VUE_APP_ENVTIPS
-    
+
     // 获取所有数据字典
     this.$store.dispatch('getAllLookUp')
-    
+
     // 在页面加载时读取sessionStorage
     if (sessionStorage.getItem('store')) {
       const data = JSON.parse(sessionStorage.getItem('store'))
@@ -63,11 +63,11 @@ export default {
     // })
     // 选择文本后复制
     window.addEventListener('mouseup', (e) => {
-      onTextSelected(this.$copyText,this.$message)
+      onTextSelected(this.$copyText, this.$message)
     })
     window.addEventListener('mousedown', (e) => {
       const n = document.getElementsByClassName('copy-rect')
-      if(n[0]){
+      if (n[0]) {
         document.body.removeChild(n[0])
       }
     })

+ 75 - 0
src/api/rechargeRule.js

@@ -0,0 +1,75 @@
+import { axios } from '@/utils/request'
+
+// 充值设置  有分页
+export const rechargeRuleList = (params) => {
+  const url = `/rechargeRule/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+
+// 充值设置  新增
+export const rechargeRuleCreate = (params) => {
+  return axios({
+    url: '/rechargeRule/create',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('新增')
+    }
+  })
+}
+
+// 充值设置  编辑
+export const rechargeRuleModify = (params) => {
+  return axios({
+    url: '/rechargeRule/modify',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('编辑')
+    }
+  })
+}
+
+// 充值设置   获取详情
+export const rechargeRuleDetail = (params) => {
+  return axios({
+    url: `/rechargeRule/findBySn/${params.sn}`,
+    method: 'get',
+    headers: {
+      'module': encodeURIComponent('详情')
+    }
+  })
+}
+
+// 充值设置   修改状态
+export const rechargeRuleUpdateState = (params) => {
+  return axios({
+    url: '/rechargeRule/updateState',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('修改状态')
+    }
+  })
+}
+
+// 充值设置  删除
+export const rechargeRuleDel = (params) => {
+  return axios({
+    url: '/rechargeRule/delete',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('删除')
+    }
+  })
+}

+ 80 - 0
src/api/shopProductSubsidy.js

@@ -0,0 +1,80 @@
+import { axios } from '@/utils/request'
+
+//  补贴产品 列表  有分页
+export const subsidizedProductList = (params) => {
+  const url = `/shopProductSubsidy/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+
+// 补贴产品 批量删除
+export const subsidizedProductDel = (params) => {
+  return axios({
+    url: `/shopProductSubsidy/delBatch`,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('删除')
+    }
+  })
+}
+
+// 补贴产品  批量编辑
+export const subsidizedProductEdit = (params) => {
+  return axios({
+    url: '/shopProductSubsidy/editBatch',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('编辑')
+    }
+  })
+}
+
+// 补贴产品   新增  弹窗产品列表  有分页
+export const queryProductPageList = (params) => {
+  const url = `/shopProductSubsidy/queryProductPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+
+// 补贴产品 新增  批量保存
+export const subsidizedProductSave = (params) => {
+  return axios({
+    url: `/shopProductSubsidy/saveBatch`,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('保存')
+    }
+  })
+}
+
+// 补贴产品  错误项导出
+export const exportImportDetailError = (params) => {
+  return axios({
+    url: '/shopProductSubsidy/exportImportDetailError',
+    data: params,
+    method: 'post',
+    responseType: 'blob',
+    headers: {
+      'module': encodeURIComponent('导出错误项')
+    }
+  })
+}

+ 0 - 1
src/components/Menu/SideMenu.vue

@@ -1,7 +1,6 @@
 <template>
   <a-layout-sider
     :class="['sider', isDesktop() ? null : 'shadow', theme, fixSiderbar ? 'ant-fixed-sidemenu' : null ]"
-    width="180px"
     :collapsible="collapsible"
     v-model="collapsed"
     :trigger="null">

+ 2 - 2
src/components/global.less

@@ -177,7 +177,7 @@ body {
       transition: width 0.2s;
 
       &.ant-header-side-opened {
-        width: calc(100% - 160px);
+        width: calc(100% - 180px);
       }
 
       &.ant-header-side-closed {
@@ -195,7 +195,7 @@ body {
       right:0;
       margin: auto;
       &.ant-header-side-opened {
-        width: calc(100% - 160px);
+        width: calc(100% - 180px);
       }
       
       &.ant-header-side-closed {

+ 373 - 424
src/config/router.config.js

@@ -6,7 +6,7 @@ import {
   BlankLayout,
   PageView
 } from '@/layouts'
-
+// 菜单模块
 export const asyncRouterMap = [
   {
     path: '/',
@@ -419,13 +419,13 @@ export const asyncRouterMap = [
           }
         ]
       },
-      // 数字货架
+      // 修配易码通-数字货架
       {
         path: '/numsGoodsShelves',
         redirect: '/numsGoodsShelves/shelfSet',
         component: PageView,
         meta: {
-          title: '数字货架',
+          title: '修配易码通-数字货架',
           icon: 'hdd',
           permission: 'M_numsGoodsShelves'
         },
@@ -707,93 +707,6 @@ export const asyncRouterMap = [
               }
             ]
           },
-          {
-            path: '/numsGoodsShelves/onlinePayInvoice',
-            redirect: '/numsGoodsShelves/onlinePayInvoice/list',
-            name: 'onlinePayInvoice',
-            component: BlankLayout,
-            meta: {
-              title: '线上支付账单',
-              icon: 'monitor',
-              permission: 'M_onlinePayInvoiceList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'onlinePayInvoiceList',
-                component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/onlinePayInvoice/list.vue'),
-                meta: {
-                  title: '线上支付账单',
-                  icon: 'monitor',
-                  hidden: true,
-                  permission: 'M_onlinePayInvoiceList'
-                }
-              },
-              {
-                path: 'detail/:sn/:shelfSn/:shelfName',
-                name: 'onlinePayInvoiceDetail',
-                component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/onlinePayInvoice/detail.vue'),
-                meta: {
-                  title: '线上支付明细',
-                  icon: 'monitor',
-                  hidden: true,
-                  replaceTab: true,
-                  permission: 'M_onlinePayInvoiceDetail'
-                }
-              }
-            ]
-          },
-          {
-            path: '/numsGoodsShelves/withdrawalManagement',
-            redirect: '/numsGoodsShelves/withdrawalManagement/list',
-            name: 'ngsWithdrawalManagement',
-            component: BlankLayout,
-            meta: {
-              title: '提现管理',
-              icon: 'monitor',
-              permission: 'M_NGS_withdrawalManagement'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'ngsWithdrawalManagementList',
-                component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/withdrawalManagement/list.vue'),
-                meta: {
-                  title: '提现管理列表',
-                  icon: 'monitor',
-                  hidden: true
-                  // permission: 'M_ngsWithdrawalManagementList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/numsGoodsShelves/withdrawalManagementNew',
-            redirect: '/numsGoodsShelves/withdrawalManagementNew/list',
-            name: 'withdrawalManagementNew',
-            component: BlankLayout,
-            meta: {
-              title: '提现管理',
-              icon: 'monitor',
-              permission: 'M_withdrawalManagementNewList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'withdrawalManagementNewList',
-                component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/withdrawalManagementNew/list.vue'),
-                meta: {
-                  title: '提现管理列表',
-                  icon: 'monitor',
-                  hidden: true,
-                  permission: 'M_withdrawalManagementNewList'
-                }
-              }
-            ]
-          },
           // {
           //   path: '/numsGoodsShelves/recallStockManagement',
           //   redirect: '/numsGoodsShelves/recallStockManagement/list',
@@ -878,6 +791,93 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          }
+          // {
+          //   path: '/numsGoodsShelves/accountManagement',
+          //   redirect: '/numsGoodsShelves/accountManagement/list',
+          //   name: 'accountManagement',
+          //   component: BlankLayout,
+          //   meta: {
+          //     title: '账户明细',
+          //     icon: 'monitor'
+          //     // permission: 'M_salesQueryList'
+          //   },
+          //   hideChildrenInMenu: true,
+          //   children: [
+          //     {
+          //       path: 'list',
+          //       name: 'accountManagementList',        //       component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/accountManagement/list.vue'),
+          //       meta: {
+          //         title: '账户明细列表',
+          //         icon: 'monitor',
+          //         hidden: true
+          //         // permission: 'M_salesQueryList'
+          //       }
+          //     }
+          //   ]
+          // }
+        ]
+      },
+      // 修配易码通-商城
+      {
+        path: '/yimatongMall',
+        redirect: '/numsGoodsShelves/shelfSet',
+        component: PageView,
+        meta: {
+          title: '修配易码通-商城',
+          icon: 'hdd',
+          permission: 'M_numsGoodsShelves'
+        },
+        children: [
+          {
+            path: '/numsGoodsShelves/withdrawalManagementNew',
+            redirect: '/numsGoodsShelves/withdrawalManagementNew/list',
+            name: 'withdrawalManagementNew',
+            component: BlankLayout,
+            meta: {
+              title: '提现管理',
+              icon: 'monitor'
+              // permission: 'M_withdrawalManagementNewList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'withdrawalManagementNewList',
+                component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/withdrawalManagementNew/list.vue'),
+                meta: {
+                  title: '提现管理列表',
+                  icon: 'monitor',
+                  hidden: true
+                  // permission: 'M_withdrawalManagementNewList'
+                }
+              }
+            ]
+          },
+          {
+            path: '/promotionManagement/couponDetails',
+            redirect: '/promotionManagement/couponDetails/list',
+            name: 'couponDetails',
+            component: BlankLayout,
+            meta: {
+              title: '优惠券核销',
+              icon: 'contacts',
+              permission: 'M_couponDetailsList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'couponDetailsList',
+                component: () => import(/* webpackChunkName: "promotionManagement" */ '@/views/promotionManagement/couponDetails/list.vue'),
+                meta: {
+                  title: '优惠券核销',
+                  icon: 'contacts',
+                  hidden: true,
+                  permission: 'M_couponDetailsList'
+                }
+              }
+            ]
           },
           {
             path: '/numsGoodsShelves/customerAccount',
@@ -904,6 +904,93 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/numsGoodsShelves/onlinePayInvoice',
+            redirect: '/numsGoodsShelves/onlinePayInvoice/list',
+            name: 'onlinePayInvoice',
+            component: BlankLayout,
+            meta: {
+              title: '线上支付账单',
+              icon: 'monitor'
+              // permission: 'M_onlinePayInvoiceList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'onlinePayInvoiceList',
+                component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/onlinePayInvoice/list.vue'),
+                meta: {
+                  title: '线上支付账单',
+                  icon: 'monitor',
+                  hidden: true
+                  // permission: 'M_onlinePayInvoiceList'
+                }
+              },
+              {
+                path: 'detail/:sn/:shelfSn/:shelfName',
+                name: 'onlinePayInvoiceDetail',
+                component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/onlinePayInvoice/detail.vue'),
+                meta: {
+                  title: '线上支付明细',
+                  icon: 'monitor',
+                  hidden: true,
+                  replaceTab: true
+                  // permission: 'M_onlinePayInvoiceDetail'
+                }
+              }
+            ]
+          },
+          {
+            path: '/promotionManagement/subsidizedProducts',
+            redirect: '/promotionManagement/subsidizedProducts/list',
+            name: 'subsidizedProducts',
+            component: BlankLayout,
+            meta: {
+              title: '抵扣产品',
+              icon: 'contacts'
+              // permission: 'M_subsidizedProductsList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'subsidizedProductsList',
+                component: () => import(/* webpackChunkName: "promotionManagement" */ '@/views/promotionManagement/subsidizedProducts/list.vue'),
+                meta: {
+                  title: '抵扣产品列表',
+                  icon: 'contacts',
+                  hidden: true
+                  // permission: 'M_subsidizedProductsList'
+                }
+              }
+            ]
+          },
+          {
+            path: '/promotionManagement/rechargeSettings',
+            redirect: '/promotionManagement/rechargeSettings/list',
+            name: 'rechargeSettings',
+            component: BlankLayout,
+            meta: {
+              title: '充值设置',
+              icon: 'contacts'
+              // permission: 'M_rechargeSettingsList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'rechargeSettingsList',
+                component: () => import(/* webpackChunkName: "promotionManagement" */ '@/views/promotionManagement/rechargeSettings/list.vue'),
+                meta: {
+                  title: '充值设置',
+                  icon: 'contacts',
+                  hidden: true
+                  // permission: 'M_rechargeSettingsList'
+                }
+              }
+            ]
+          },
           {
             path: '/numsGoodsShelves/easyPassShopping',
             redirect: '/numsGoodsShelves/easyPassShopping/index',
@@ -928,31 +1015,68 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/promotionManagement/promotionInfo',
+            redirect: '/promotionManagement/promotionInfo/list',
+            name: 'promotionInfo',
+            component: BlankLayout,
+            meta: {
+              title: '促销活动',
+              icon: 'contacts',
+              permission: 'M_promotionInfoList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'promotionInfoList',
+                component: () => import(/* webpackChunkName: "promotionManagement" */ '@/views/promotionManagement/promotionInfo/list.vue'),
+                meta: {
+                  title: '促销活动列表',
+                  icon: 'contacts',
+                  hidden: true,
+                  permission: 'M_promotionInfoList'
+                }
+              },
+              {
+                path: 'edit/:sn/:pageType',
+                name: 'promotionInfoEdit',
+                component: () => import(/* webpackChunkName: "promotionManagement" */ '@/views/promotionManagement/promotionInfo/edit.vue'),
+                meta: {
+                  title: '编辑促销',
+                  icon: 'contacts',
+                  hidden: true,
+                  permission: 'M_promotionInfoEdit'
+                }
+              }
+            ]
+          },
+          {
+            path: '/promotionManagement/promotionalProducts',
+            redirect: '/promotionManagement/promotionalProducts/list',
+            name: 'promotionalProducts',
+            component: BlankLayout,
+            meta: {
+              title: '促销产品',
+              icon: 'contacts',
+              permission: 'M_promotionalProduct'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'promotionalProductsList',
+                component: () => import(/* webpackChunkName: "promotionManagement" */ '@/views/promotionManagement/promotionalProducts/list.vue'),
+                meta: {
+                  title: '促销产品列表',
+                  icon: 'contacts',
+                  hidden: true,
+                  permission: 'M_promotionalProductList'
+                }
+              }
+            ]
           }
-          // {
-          //   path: '/numsGoodsShelves/accountManagement',
-          //   redirect: '/numsGoodsShelves/accountManagement/list',
-          //   name: 'accountManagement',
-          //   component: BlankLayout,
-          //   meta: {
-          //     title: '账户明细',
-          //     icon: 'monitor'
-          //     // permission: 'M_salesQueryList'
-          //   },
-          //   hideChildrenInMenu: true,
-          //   children: [
-          //     {
-          //       path: 'list',
-          //       name: 'accountManagementList',        //       component: () => import(/* webpackChunkName: "numsGoodsShelves" */ '@/views/numsGoodsShelves/accountManagement/list.vue'),
-          //       meta: {
-          //         title: '账户明细列表',
-          //         icon: 'monitor',
-          //         hidden: true
-          //         // permission: 'M_salesQueryList'
-          //       }
-          //     }
-          //   ]
-          // }
         ]
       },
       // 采购管理
@@ -1265,44 +1389,6 @@ export const asyncRouterMap = [
           }
         ]
       },
-      // 出库管理
-      {
-        path: '/outboundOrderManagement',
-        redirect: '/outboundOrderManagement/outboundOrder',
-        component: PageView,
-        meta: {
-          title: '出库管理',
-          icon: 'export',
-          permission: 'M_outboundList'
-        },
-        children: [
-          {
-            path: '/outboundOrderManagement/outboundOrder',
-            redirect: '/outboundOrderManagement/outboundOrder/list',
-            name: 'outboundOrder',
-            component: BlankLayout,
-            meta: {
-              title: '出库',
-              icon: 'export',
-              permission: 'M_outboundList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'outboundOrderList',
-                component: () => import(/* webpackChunkName: "outboundOrderManagement" */ '@/views/outboundOrderManagement/outboundOrder/list.vue'),
-                meta: {
-                  title: '出库列表',
-                  icon: 'export',
-                  hidden: true,
-                  permission: 'M_outboundList'
-                }
-              }
-            ]
-          }
-        ]
-      },
       // 财务管理
       {
         path: '/financialManagement',
@@ -1314,67 +1400,6 @@ export const asyncRouterMap = [
           permission: 'M_financial'
         },
         children: [
-          {
-            path: '/financialManagement/warehousingAudit',
-            redirect: '/financialManagement/warehousingAudit/list',
-            name: 'warehousingAudit',
-            component: BlankLayout,
-            meta: {
-              title: '入库审核',
-              icon: 'pull-request',
-              permission: 'M_warehousingAuditList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'warehousingAuditList',
-                component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/warehousingAudit/list.vue'),
-                meta: {
-                  title: '入库审核列表',
-                  icon: 'pull-request',
-                  hidden: true,
-                  permission: 'M_warehousingAuditList'
-                }
-              },
-              {
-                path: 'detail/:sn',
-                name: 'warehousingAuditDetail',
-                component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/warehousingAudit/detail.vue'),
-                meta: {
-                  title: '入库审核详情',
-                  icon: 'pull-request',
-                  hidden: true,
-                  permission: 'M_warehousingAudit_detail'
-                }
-              }
-            ]
-          },
-          {
-            path: '/financialManagement/inventoryCheckAudit',
-            redirect: '/financialManagement/inventoryCheckAudit/list',
-            name: 'inventoryCheckAudit',
-            component: BlankLayout,
-            meta: {
-              title: '盘点审核',
-              icon: 'laptop',
-              permission: 'M_inventoryCheckAuditList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'inventoryCheckAuditList',
-                component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/inventoryCheckAudit/list.vue'),
-                meta: {
-                  title: '盘点审核列表',
-                  icon: 'laptop',
-                  hidden: true,
-                  permission: 'M_inventoryCheckAuditList'
-                }
-              }
-            ]
-          },
           {
             path: '/financialManagement/financialPayment',
             redirect: '/financialManagement/financialPayment/list',
@@ -1911,31 +1936,92 @@ export const asyncRouterMap = [
                 }
               },
               {
-                path: 'detail/:sn',
-                name: 'storeTransferOutDetail',
-                component: () => import(/* webpackChunkName: "allocationManagement" */ '@/views/allocationManagement/storeTransferOut/detail.vue'),
+                path: 'detail/:sn',
+                name: 'storeTransferOutDetail',
+                component: () => import(/* webpackChunkName: "allocationManagement" */ '@/views/allocationManagement/storeTransferOut/detail.vue'),
+                meta: {
+                  title: '店内调出详情',
+                  icon: 'interaction',
+                  hidden: true,
+                  permission: 'B_storeCallOutDetail'
+                }
+              }
+            ]
+          }
+        ]
+      },
+      // 库存管理
+      {
+        path: '/inventoryManagement',
+        redirect: '/inventoryManagement/inventoryQuery',
+        component: PageView,
+        meta: {
+          title: '库存管理',
+          icon: 'shop',
+          permission: 'M_inventory'
+        },
+        children: [
+          {
+            path: '/financialManagement/warehousingAudit',
+            redirect: '/financialManagement/warehousingAudit/list',
+            name: 'warehousingAudit',
+            component: BlankLayout,
+            meta: {
+              title: '入库审核',
+              icon: 'pull-request',
+              permission: 'M_warehousingAuditList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'warehousingAuditList',
+                component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/warehousingAudit/list.vue'),
+                meta: {
+                  title: '入库审核列表',
+                  icon: 'pull-request',
+                  hidden: true,
+                  permission: 'M_warehousingAuditList'
+                }
+              },
+              {
+                path: 'detail/:sn',
+                name: 'warehousingAuditDetail',
+                component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/warehousingAudit/detail.vue'),
+                meta: {
+                  title: '入库审核详情',
+                  icon: 'pull-request',
+                  hidden: true,
+                  permission: 'M_warehousingAudit_detail'
+                }
+              }
+            ]
+          },
+          {
+            path: '/outboundOrderManagement/outboundOrder',
+            redirect: '/outboundOrderManagement/outboundOrder/list',
+            name: 'outboundOrder',
+            component: BlankLayout,
+            meta: {
+              title: '出库',
+              icon: 'export',
+              permission: 'M_outboundList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'outboundOrderList',
+                component: () => import(/* webpackChunkName: "outboundOrderManagement" */ '@/views/outboundOrderManagement/outboundOrder/list.vue'),
                 meta: {
-                  title: '店内调出详情',
-                  icon: 'interaction',
+                  title: '出库列表',
+                  icon: 'export',
                   hidden: true,
-                  permission: 'B_storeCallOutDetail'
+                  permission: 'M_outboundList'
                 }
               }
             ]
-          }
-        ]
-      },
-      // 库存管理
-      {
-        path: '/inventoryManagement',
-        redirect: '/inventoryManagement/inventoryQuery',
-        component: PageView,
-        meta: {
-          title: '库存管理',
-          icon: 'shop',
-          permission: 'M_inventory'
-        },
-        children: [
+          },
           {
             path: '/inventoryManagement/inventoryQuery',
             redirect: '/inventoryManagement/inventoryQuery/list',
@@ -2081,6 +2167,31 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/financialManagement/inventoryCheckAudit',
+            redirect: '/financialManagement/inventoryCheckAudit/list',
+            name: 'inventoryCheckAudit',
+            component: BlankLayout,
+            meta: {
+              title: '盘点审核',
+              icon: 'laptop',
+              permission: 'M_inventoryCheckAuditList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'inventoryCheckAuditList',
+                component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/inventoryCheckAudit/list.vue'),
+                meta: {
+                  title: '盘点审核列表',
+                  icon: 'laptop',
+                  hidden: true,
+                  permission: 'M_inventoryCheckAuditList'
+                }
+              }
+            ]
+          },
           {
             path: '/inventoryManagement/inventoryImport',
             redirect: '/inventoryManagement/inventoryImport/list',
@@ -3105,13 +3216,13 @@ export const asyncRouterMap = [
           }
         ]
       },
-      // 客户管理
+      // 客户与供应商
       {
         path: '/customerManagement',
         redirect: '/customerManagement/customerInfo',
         component: PageView,
         meta: {
-          title: '客户管理',
+          title: '客户与供应商',
           icon: 'idcard',
           permission: 'M_customerInfoList'
         },
@@ -3122,7 +3233,7 @@ export const asyncRouterMap = [
             name: 'customerInfo',
             component: BlankLayout,
             meta: {
-              title: '客户管理',
+              title: '客户与供应商',
               icon: 'idcard',
               permission: 'M_customerInfoList'
             },
@@ -3133,7 +3244,7 @@ export const asyncRouterMap = [
                 name: 'customerInfoList',
                 component: () => import(/* webpackChunkName: "customerManagement" */ '@/views/customerManagement/customerInfo/list.vue'),
                 meta: {
-                  title: '客户列表',
+                  title: '客户与供应商列表',
                   icon: 'idcard',
                   hidden: true,
                   permission: 'M_customerInfoList'
@@ -3187,6 +3298,31 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/supplierManagement/supplierInfo',
+            redirect: '/supplierManagement/supplierInfo/list',
+            name: 'supplierInfo',
+            component: BlankLayout,
+            meta: {
+              title: '供应商管理',
+              icon: 'contacts',
+              permission: 'M_supplierInfoList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'supplierInfoList',
+                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/supplierManagement/supplierInfo/list.vue'),
+                meta: {
+                  title: '供应商列表',
+                  icon: 'contacts',
+                  hidden: true,
+                  permission: 'M_supplierInfoList'
+                }
+              }
+            ]
           }
         ]
       },
@@ -3437,193 +3573,6 @@ export const asyncRouterMap = [
           }
         ]
       },
-      //  供应商管理
-      {
-        path: '/supplierManagement',
-        redirect: '/supplierManagement/supplierInfo',
-        component: PageView,
-        meta: {
-          title: '供应商管理',
-          icon: 'contacts',
-          permission: 'M_supplierInfoList'
-        },
-        children: [
-          {
-            path: '/supplierManagement/supplierInfo',
-            redirect: '/supplierManagement/supplierInfo/list',
-            name: 'supplierInfo',
-            component: BlankLayout,
-            meta: {
-              title: '供应商管理',
-              icon: 'contacts',
-              permission: 'M_supplierInfoList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'supplierInfoList',
-                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/supplierManagement/supplierInfo/list.vue'),
-                meta: {
-                  title: '供应商列表',
-                  icon: 'contacts',
-                  hidden: true,
-                  permission: 'M_supplierInfoList'
-                }
-              }
-            ]
-          }
-        ]
-      },
-      // 促销管理
-      {
-        path: '/promotionManagement',
-        redirect: '/promotionManagement/promotionInfo',
-        component: PageView,
-        meta: {
-          title: '促销管理',
-          icon: 'contacts',
-          permission: 'M_promotionInfo'
-        },
-        children: [
-          {
-            path: '/promotionManagement/promotionInfo',
-            redirect: '/promotionManagement/promotionInfo/list',
-            name: 'promotionInfo',
-            component: BlankLayout,
-            meta: {
-              title: '促销活动',
-              icon: 'contacts',
-              permission: 'M_promotionInfoList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'promotionInfoList',
-                component: () => import(/* webpackChunkName: "promotionManagement" */ '@/views/promotionManagement/promotionInfo/list.vue'),
-                meta: {
-                  title: '促销活动列表',
-                  icon: 'contacts',
-                  hidden: true,
-                  permission: 'M_promotionInfoList'
-                }
-              },
-              {
-                path: 'edit/:sn/:pageType',
-                name: 'promotionInfoEdit',
-                component: () => import(/* webpackChunkName: "promotionManagement" */ '@/views/promotionManagement/promotionInfo/edit.vue'),
-                meta: {
-                  title: '编辑促销',
-                  icon: 'contacts',
-                  hidden: true,
-                  permission: 'M_promotionInfoEdit'
-                }
-              }
-            ]
-          },
-          {
-            path: '/promotionManagement/promotionalProducts',
-            redirect: '/promotionManagement/promotionalProducts/list',
-            name: 'promotionalProducts',
-            component: BlankLayout,
-            meta: {
-              title: '促销产品',
-              icon: 'contacts',
-              permission: 'M_promotionalProduct'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'promotionalProductsList',
-                component: () => import(/* webpackChunkName: "promotionManagement" */ '@/views/promotionManagement/promotionalProducts/list.vue'),
-                meta: {
-                  title: '促销产品列表',
-                  icon: 'contacts',
-                  hidden: true,
-                  permission: 'M_promotionalProductList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/promotionManagement/subsidizedProducts',
-            redirect: '/promotionManagement/subsidizedProducts/list',
-            name: 'subsidizedProducts',
-            component: BlankLayout,
-            meta: {
-              title: '补贴产品',
-              icon: 'contacts'
-              // permission: 'M_subsidizedProductsList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'subsidizedProductsList',
-                component: () => import(/* webpackChunkName: "promotionManagement" */ '@/views/promotionManagement/subsidizedProducts/list.vue'),
-                meta: {
-                  title: '补贴产品列表',
-                  icon: 'contacts',
-                  hidden: true
-                  // permission: 'M_subsidizedProductsList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/promotionManagement/rechargeSettings',
-            redirect: '/promotionManagement/rechargeSettings/list',
-            name: 'rechargeSettings',
-            component: BlankLayout,
-            meta: {
-              title: '充值设置',
-              icon: 'contacts'
-              // permission: 'M_rechargeSettingsList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'rechargeSettingsList',
-                component: () => import(/* webpackChunkName: "promotionManagement" */ '@/views/promotionManagement/rechargeSettings/list.vue'),
-                meta: {
-                  title: '充值设置',
-                  icon: 'contacts',
-                  hidden: true
-                  // permission: 'M_rechargeSettingsList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/promotionManagement/couponDetails',
-            redirect: '/promotionManagement/couponDetails/list',
-            name: 'couponDetails',
-            component: BlankLayout,
-            meta: {
-              title: '优惠券详情',
-              icon: 'contacts',
-              permission: 'M_couponDetailsList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'couponDetailsList',
-                component: () => import(/* webpackChunkName: "promotionManagement" */ '@/views/promotionManagement/couponDetails/list.vue'),
-                meta: {
-                  title: '优惠券详情',
-                  icon: 'contacts',
-                  hidden: true,
-                  permission: 'M_couponDetailsList'
-                }
-              }
-            ]
-          }
-        ]
-      },
       // 中心店/配送店管理
       {
         path: '/storeManagement',

+ 1 - 1
src/layouts/BasicLayout.vue

@@ -177,7 +177,7 @@ export default {
         return '0'
       }
       if (this.sidebarOpened) {
-        return '180px'
+        return '200px'
       }
       return '80px'
     },

+ 2 - 2
src/views/numsGoodsShelves/customerAccount/clearRecordModal.vue

@@ -19,7 +19,7 @@
             @keyup.enter.native="$refs.table.refresh(true)" >
             <a-row :gutter="5">
               <a-col :md="8" :sm="24">
-                <a-form-item label="创建时间">
+                <a-form-item label="清零时间">
                   <rangeDate id="rechargeList-time" ref="rangeDate" :value="time" @change="dateChange" />
                 </a-form-item>
               </a-col>
@@ -101,7 +101,7 @@ export default {
       },
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '时间', dataIndex: 'stockBatchNo', width: '24%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '清零时间', dataIndex: 'stockBatchNo', width: '24%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '金额(¥)', dataIndex: 'warehouseLocationName', width: '24%', align: 'right', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '清零对象', dataIndex: 'outQty', width: '24%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作人', dataIndex: 'outQty1', width: '24%', align: 'center', customRender: function (text) { return text || '--' } }

+ 43 - 42
src/views/promotionManagement/rechargeSettings/editModal.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     centered
-    class="subsidyEditModal-modal"
+    class="rechargeEdit-modal"
     :footer="null"
     :maskClosable="false"
     :title="itemSn?'编辑':'新增'"
@@ -10,34 +10,34 @@
     :width="750">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
-        id="edit-remark-form"
+        id="rechargeEdit-form"
         ref="ruleForm"
         :model="form"
         :rules="rules"
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol"
       >
-        <a-form-model-item label="充值规则" prop="remarks">
+        <a-form-model-item label="充值规则" prop="rechargeAmount">
           <div>
             充值<a-input-number
-              id="subsidyEditModal-name"
-              v-model.trim="form.num"
+              id="rechargeEdit-rechargeAmount"
+              v-model.trim="form.rechargeAmount"
               style="width: 35%;margin:0 10px;"
               :max="999999"
               :precision="2"
               placeholder="请输入"/>元,送<a-input-number
-                id="subsidyEditModal-name"
-                v-model.trim="form.num1"
+                id="rechargeEdit-giveAmount"
+                v-model.trim="form.giveAmount"
                 style="width: 35%;margin:0 10px;"
                 :max="999999"
                 :precision="2"
                 placeholder="请输入"/>元补贴
           </div>
         </a-form-model-item>
-        <a-form-model-item label="备注" prop="remarks">
+        <a-form-model-item label="备注">
           <a-textarea
             :autosize="{minRows: 5, maxRows: 5}"
-            id="subsidyEditModal-remarks"
+            id="rechargeEdit-remarks"
             :maxLength="100"
             v-model="form.remarks"
             placeholder="请输入备注(最多100个字符)"
@@ -46,8 +46,8 @@
         <div class="tipWord">注意:请设置【补贴产品】</div>
       </a-form-model>
       <div class="btn-cont">
-        <a-button type="primary" id="subsidyEditModal-save" @click="handleSave">保存</a-button>
-        <a-button id="subsidyEditModal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+        <a-button type="primary" id="rechargeEdit-save" @click="handleSave">保存</a-button>
+        <a-button id="rechargeEdit-cancel" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
       </div>
     </a-spin>
   </a-modal>
@@ -55,7 +55,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { jxsorgRelationSave } from '@/api/jxsorg'
+import { rechargeRuleDetail, rechargeRuleCreate } from '@/api/rechargeRule'
 export default {
   name: 'RechargeEditModal',
   mixins: [commonMixin],
@@ -79,15 +79,13 @@ export default {
       },
       // 提交数据
       form: {
-        dealerSn: undefined, // 客户sn
-        changeAmount: undefined, // 调账金额
+        rechargeAmount: undefined, // 充值金额
+        giveAmount: undefined, // 赠送金额
         remark: undefined// 备注
       },
       // 必填项判断
       rules: {
-        changeAmount: [{ required: true, message: '请输入调账金额', trigger: 'blur' },
-          { pattern: /^(?!0$).+/, message: '调账金额不能为0', trigger: 'blur' }
-        ]
+        rechargeAmount: [{ required: true, message: '请输入充值金额', trigger: 'blur' }]
       }
     }
   },
@@ -97,38 +95,43 @@ export default {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
+          if (!_this.form.giveAmount) {
+            _this.$message.waining('请输入赠送金额')
+            return
+          }
           _this.spinning = true
-          jxsorgRelationSave(_this.form).then(res => {
+          rechargeRuleCreate(_this.form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$emit('ok')
               setTimeout(function () {
                 _this.isShow = false
-                _this.spinning = false
               }, 300)
-            } else {
-              _this.spinning = false
             }
+            _this.spinning = false
           })
         } else {
           return false
         }
       })
     },
-    // 中心店 change
-    resetForm (obj) {
-      this.$refs.ruleForm.resetFields()
-      this.form.childSnList = undefined
-      this.$refs.orgList.resetForm()
-      this.$refs.orgMultipleList.resetForm()
-    },
-    // 配送店  change
-    orgMultipleChange (obj) {
+    // 获取详情
+    getDetail () {
       const _this = this
-      this.form.childSnList = []
-      obj.map(item => {
-        _this.form.childSnList.push(item.key || undefined)
+      _this.spinning = false
+      rechargeRuleDetail({ sn: _this.itemSn }).then(res => {
+        if (res.status == 200) {
+          _this.form = res.data
+        }
+        _this.spinning = false
       })
+    },
+    // 重置
+    resetForm (obj) {
+      this.form.rechargeAmount = undefined
+      this.form.giveAmount = undefined
+      this.form.remark = undefined
+      this.$refs.ruleForm.resetFields()
     }
   },
   watch: {
@@ -140,6 +143,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        this.resetForm()
       }
     },
     itemSn (newValue, oldValue) {
@@ -151,24 +155,21 @@ export default {
 }
 </script>
 <style lang="less" scoped>
-  .bindEdit-modal{
+  .rechargeEdit-modal{
     /deep/.ant-modal-body {
     	padding: 40px 40px 24px;
     }
-    .bindEdit-form{
+    .rechargeEdit-form{
       text-align: center;
     }
-    .subsidyRequired{
-      margin-right: 5px;
-      color:#ED1c24;
+    .tipWord{
+      margin:-10px 0  0 48px;
+      color:gray;
     }
     .btn-cont {
     	text-align: center;
     	margin: 50px 0 10px;
     }
   }
-  .tipWord{
-    margin:-10px 0  0 48px;
-    color:gray;
-  }
+
 </style>

+ 44 - 30
src/views/promotionManagement/rechargeSettings/list.vue

@@ -12,15 +12,15 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="充值规则">
-                <a-input id="rechargeList-promoName" v-model.trim="queryParam.promoName" allowClear placeholder="请输入充值规则"/>
+                <a-input id="rechargeList-ruleDesc" v-model.trim="queryParam.ruleDesc" allowClear placeholder="请输入充值规则"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="状态">
                 <v-select
-                  v-model="queryParam.promoType"
+                  v-model="queryParam.state"
                   ref="sourceType"
-                  id="rechargeList-promoType"
+                  id="rechargeList-state"
                   code="SHOP_PROMO_PROMO_STATE"
                   placeholder="请选择状态"
                   allowClear></v-select>
@@ -35,7 +35,7 @@
       </div>
       <!-- 操作按钮 -->
       <div class="table-operator-nobor">
-        <a-button id="rechargeList-add" type="primary" class="button-error" @click="openEditModal=true">新增</a-button>
+        <a-button id="rechargeList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
       </div>
       <!-- 列表 -->
       <s-table
@@ -56,18 +56,17 @@
             v-if="$hasPermissions('B_customer_customerInfo_enable')"
             checkedChildren="启用"
             unCheckedChildren="禁用"
-            v-model="record.enabledFlag"
-            @change="changeFlagHandle(text, record)"/>
-          <span v-else :style="{color:(record.enabledFlag==1?'#00aa00':'#999')}"> {{ record.enabledFlag==1? '已启用': '已禁用' }} </span>
+            v-model="record.state"
+            @change="handleOpenOrClose(record)"/>
+          <span v-else :style="{color:(record.state==1?'#00aa00':'#999')}"> {{ record.state==1? '已启用': '已禁用' }} </span>
         </template>
         <!-- 操作 -->
-        <!-- state  HAVE_RELEASE 已开启 IS_OVER已结束 IS_CLOSE 已关闭 NOT_RELEASE 未开启 -->
         <template slot="action" slot-scope="text, record">
           <a-button
             size="small"
             type="link"
             class="button-primary"
-            @click="handleOpenOrClose(record,'1')"
+            @click="handleEdit(record)"
             :id="'rechargeList-editBtn-'+record.id">编辑</a-button>
           <a-button
             size="small"
@@ -79,7 +78,7 @@
       </s-table>
     </a-spin>
     <!-- 新增/编辑 -->
-    <recharge-edit-modal v-drag :itemSn="itemId" :openModal="openEditModal" @ok="$refs.table.refresh(true)" @close="openEditModal = false" />
+    <recharge-edit-modal v-drag :itemSn="itemId" :openModal="openEditModal" @ok="addOrEditOk" @close="closeEditModal" />
   </a-card>
 </template>
 
@@ -90,7 +89,7 @@ import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import rechargeEditModal from './editModal.vue'
 // 接口
-import { shopPromoList, openOrCloseActive } from '@/api/shopPromo'
+import { rechargeRuleList, rechargeRuleUpdateState, rechargeRuleDel } from '@/api/rechargeRule'
 export default {
   name: 'RechargeSettingsList',
   components: { STable, VSelect, rangeDate, rechargeEditModal },
@@ -99,14 +98,14 @@ export default {
     return {
       spinning: false,
       tableHeight: 0, // 表格高度
-      openDescModal: false, // 促销展示弹窗
+      disabled: false, //  查询、重置按钮是否可操作
       time: [], // 创建时间
       //  查询条件
       queryParam: {
-        beginDate: undefined, // 发布开始时间
-        endDate: undefined, // 发布结束时间
-        promoName: '', //  充值规则
-        promoState: undefined// 状态
+        beginDate: undefined, // 创建开始时间
+        endDate: undefined, // 创建结束时间
+        ruleDesc: undefined, //  充值规则
+        state: undefined// 状态
       },
       openEditModal: false, // 新增/编辑弹窗
       itemId: null, // id值
@@ -114,8 +113,8 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '充值规则', dataIndex: 'promoName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '备注', dataIndex: 'desc', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '充值规则', dataIndex: 'ruleDesc', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '备注', dataIndex: 'remarks', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '状态', scopedSlots: { customRender: 'statusBox' }, width: '15%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ],
@@ -123,7 +122,7 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return shopPromoList(Object.assign(parameter, this.queryParam)).then(res => {
+        return rechargeRuleList(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -146,23 +145,39 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    // 新增/编辑
+    handleEdit (row) {
+      this.itemId = row ? row.rechargeRuleSn : null
+      this.$nextTick(() => {
+        this.openEditModal = true
+      })
+    },
+    // 关闭  新增/编辑弹窗
+    closeEditModal () {
+      this.itemId = null
+      this.openEditModal = false
+    },
+    // 新增/编辑成功
+    addOrEditOk () {
+      this.closeEditModal()
+      this.$refs.table.refresh(true)
+    },
     // 状态  启用禁用
-    handleOpenOrClose (row, val) {
+    handleOpenOrClose (row) {
       const _this = this
+      const tipWord = row.state == 1 ? '禁用' : '启用' + '后,易码通' + row.state == 1 ? '不可以' : '可以' + '看到该充值规则'
       this.$confirm({
         title: '提示',
-        content: '促销活动一旦' + (val == '1' ? '开启' : '关闭') + ',客户' + (val == '1' ? '可' : '无法') + '参与活动。确认' + (val == '1' ? '开启' : '关闭') + '吗?',
+        content: tipWord,
         centered: true,
         onOk () {
           _this.spinning = true
-          openOrCloseActive({ promoSn: row.promoSn, dealerOpenState: val }).then(res => {
+          rechargeRuleUpdateState({ rechargeRuleSn: row.rechargeRuleSn, state: row.state == 1 ? '0' : '1' }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
-              _this.spinning = false
-            } else {
-              _this.spinning = false
             }
+            _this.spinning = false
           })
         }
       })
@@ -172,11 +187,11 @@ export default {
       const _this = this
       this.$confirm({
         title: '提示',
-        content: '确定删除【买2000.00元送100.00元】的充值规则吗?',
+        content: '确定删除【' + row.ruleDesc + '】的充值规则吗?',
         centered: true,
         onOk () {
           _this.spinning = true
-          jxsorgRelationDel({ sn: row.orgSn }).then(res => {
+          rechargeRuleDel({ rechargeRuleSn: row.rechargeRuleSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
@@ -192,9 +207,8 @@ export default {
       this.$refs.rangeDate.resetDate(this.time)
       this.queryParam.beginDate = undefined
       this.queryParam.endDate = undefined
-      this.queryParam.promoName = ''
-      this.queryParam.promoType = undefined
-      this.queryParam.promoState = undefined
+      this.queryParam.ruleDesc = undefined
+      this.queryParam.state = undefined
       this.$refs.table.refresh(true)
     },
     // 初始化

+ 18 - 26
src/views/promotionManagement/subsidizedProducts/chooseImportModal.vue

@@ -1,14 +1,14 @@
 <template>
   <a-modal
     centered
-    class="chooseImport-modal"
+    class="chooseImportSubsidy-modal"
     :footer="null"
     :maskClosable="false"
     title="确认导入"
     v-model="isShow"
     @cancel="isShow=false"
     width="80%">
-    <div class="chooseImport-con">
+    <div class="chooseImportSubsidy-con">
       <!-- 可导入数据 -->
       <p class="">可导入数据{{ loadData.length }}条</p>
       <a-table
@@ -52,20 +52,20 @@
       <div class="btn-con">
         <a-button
           type="primary"
-          id="chooseImport-submit"
+          id="chooseImportSubsidy-submit"
           size="large"
           :class="loadData.length==0?'button-grey':'button-primary'"
           @click="handleSubmit"
           style="padding: 0 40px;">确认导入</a-button>
         <a-button
-          id="chooseImport-cancel"
+          id="chooseImportSubsidy-cancel"
           size="large"
           class="button-cancel"
           @click="isShow=false"
           style="padding: 0 40px;margin-left: 15px;">取消</a-button>
         <a-button
           type="primary"
-          id="chooseImport-error"
+          id="chooseImportSubsidy-error"
           size="large"
           class="button-error"
           @click="handleError"
@@ -78,9 +78,9 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { hdExportExcel } from '@/libs/exportExcel'
-import { salesDetailFailExcel } from '@/api/salesDetail'
+import { exportImportDetailError } from '@/api/shopProductSubsidy'
 export default {
-  name: 'ChooseImportModal',
+  name: 'ChooseImportSubsidyModal',
   mixins: [commonMixin],
   props: {
     openModal: { //  弹框显示状态
@@ -102,20 +102,20 @@ export default {
       nowColumns: [
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原售价', dataIndex: 'warehouseName', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '补贴金额', dataIndex: 'warehouseLocationName', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '补贴后售价', dataIndex: 'importPrice', width: '14%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+        { title: '产品名称', dataIndex: 'productName', width: '25%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原售价', dataIndex: 'shopProductPrice', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '补贴金额', dataIndex: 'subsidyAmount', width: '14%', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '补贴后售价', dataIndex: 'subsidyedPrice', width: '14%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
       ],
       loadData: [],
       // 错误项
       nowUnColumns: [
         { title: '序号', dataIndex: 'no', width: '9%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '原售价', dataIndex: 'warehouseLocationName', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '补贴金额', dataIndex: 'importPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '补贴后售价', dataIndex: 'importQty', width: '20%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
+        { title: '产品名称', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原售价', dataIndex: 'shopProductPrice', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '补贴金额', dataIndex: 'subsidyAmount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '补贴后售价', dataIndex: 'subsidyedPrice', width: '20%', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '备注', scopedSlots: { customRender: 'errorMsg' }, width: '10%', align: 'center' }
       ],
       unLoadData: [],
@@ -131,14 +131,10 @@ export default {
       // 正确的
       this.loadData.map((item, index) => {
         item.no = index + 1
-        item.salesBillNo = paramsData.salesBillNo
-        item.salesBillSn = paramsData.salesBillSn
       })
       // 错误的
       this.unLoadData.map((item, index) => {
         item.no = index + 1
-        item.salesBillNo = paramsData.salesBillNo
-        item.salesBillSn = paramsData.salesBillSn
       })
     },
     // 确认导入
@@ -147,10 +143,6 @@ export default {
         this.$message.warning('无可导入的产品!')
       } else {
         const data = this.paramsData.rightList
-        data.map(item => {
-          item.salesBillNo = this.paramsData.salesBillNo
-          item.salesBillSn = this.paramsData.salesBillSn
-        })
         this.$emit('ok', data)
         this.isShow = false
       }
@@ -163,7 +155,7 @@ export default {
         return
       }
       _this.spinning = true
-      hdExportExcel(salesDetailFailExcel, _this.paramsData.errorList, '补贴金额错误项', function () {
+      hdExportExcel(exportImportDetailError, _this.paramsData.errorList, '补贴金额错误项', function () {
         _this.spinning = false
       })
     }
@@ -188,8 +180,8 @@ export default {
 </script>
 
 <style lang="less" scoped>
-  .chooseImport-modal{
-    .chooseImport-con{
+  .chooseImportSubsidy-modal{
+    .chooseImportSubsidy-con{
       .red{
         color: #f30;
       }

+ 49 - 79
src/views/promotionManagement/subsidizedProducts/editModal.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     centered
-    class="bindEdit-modal"
+    class="subsidyEdit-modal"
     :footer="null"
     :maskClosable="false"
     title="编辑"
@@ -9,109 +9,85 @@
     @cancel="isShow=false"
     :width="500">
     <a-spin :spinning="spinning" tip="Loading...">
-      <div class="bindEdit-form">
-        <span class="subsidyRequired">*</span>产品补贴<a-input-number
-          id="chooseShelf-name"
-          v-model.trim="num"
+      <div class="subsidyEdit-form">
+        <span class="subsidyRequired">*</span>补贴金额<a-input-number
+          id="subsidyEdit-subsidyAmount"
+          v-model.trim="subsidyAmount"
           style="width: 40%;margin:0 10px;"
-          :max="999999"
+          :min="0.01"
+          :max="99999999"
           :precision="2"
           placeholder="请输入"/>元
       </div>
       <div class="btn-cont">
-        <a-button id="bindEdit-modal-back" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
-        <a-button type="primary" id="bindEdit-modal-save" @click="handleSave">保存</a-button>
+        <a-button id="subsidyEdit-modal-cancel" @click="isShow = false" style="margin-right: 15px;">取消</a-button>
+        <a-button type="primary" id="subsidyEdit-modal-save" @click="handleSave">保存</a-button>
       </div>
     </a-spin>
   </a-modal>
 </template>
 
 <script>
-import { commonMixin } from '@/utils/mixin'
-import { STable } from '@/components'
-import { jxsorgRelationSave, jxsorgRelationDetail } from '@/api/jxsorg'
+// 接口
+import { subsidizedProductEdit } from '@/api/shopProductSubsidy'
 export default {
-  name: 'BindEditModal',
-  components: { STable },
-  mixins: [commonMixin],
+  name: 'SubsidyEditModal',
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
     },
-    itemSn: {
+    itemSn: {// 补贴产品sn
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+    itemAmount: {// 补贴金额
       type: [Number, String],
       default: ''
-    },
-    nowData: {
-      type: Object,
-      default: null
     }
   },
   data () {
     return {
       spinning: false,
       isShow: this.openModal, //  是否打开弹框
-      num: undefined
+      subsidyAmount: undefined// 补贴金额
     }
   },
   methods: {
-    //  详情
-    getDetail () {
+    //  保存
+    handleSave () {
       const _this = this
-      jxsorgRelationDetail({ sn: this.itemSn }).then(res => {
+      if (!_this.subsidyAmount) {
+        _this.$message.warning('请输入补贴金额!')
+        return
+      }
+      _this.spinning = true
+      subsidizedProductEdit({ subsidyAmount: _this.subsidyAmount, productSns: _this.itemSn }).then(res => {
         if (res.status == 200) {
-          _this.form.orgSn = res.data.orgSn || undefined
-          _this.$refs.orgList.fetchUser(res.data.orgName)
-          _this.$refs.orgList.dealerName = { key: res.data.orgSn }
-          const childSnList = []
-          const childSnListStr = []
-          if (res.data.childList) {
-            res.data.childList.map(item => {
-              childSnList.push({ key: item.sn })
-              childSnListStr.push(item.sn)
-            })
+          if (res.data) {
+            this.getErrorInfo(res.data)
+          } else {
+            _this.$message.success(res.message)
+            _this.$emit('ok')
+            setTimeout(function () {
+              _this.isShow = false
+            }, 300)
           }
-          _this.form.childSnList = childSnListStr.length == 0 ? undefined : childSnListStr
-          _this.$refs.orgMultipleList.setData(childSnList, res.data.childList || [])
-          _this.$refs.orgMultipleList.dealerName = childSnList
         }
+        _this.spinning = false
       })
     },
-    //  保存
-    handleSave () {
-      const _this = this
-      this.$refs.ruleForm.validate(valid => {
-        if (valid) {
-          _this.spinning = true
-          jxsorgRelationSave(_this.form).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$emit('ok')
-              setTimeout(function () {
-                _this.isShow = false
-                _this.spinning = false
-              }, 300)
-            } else {
-              _this.spinning = false
-            }
-          })
-        } else {
-          return false
+    // 报错弹窗
+    getErrorInfo (infoTip) {
+      this.$info({
+        title: '提示',
+        content: infoTip,
+        onOk () {
+          console.log('我知道了')
         }
       })
-    },
-    // 中心店 change
-    orgChange (obj) {
-      this.form.orgSn = obj.key || undefined
-    },
-    // 配送店  change
-    orgMultipleChange (obj) {
-      const _this = this
-      this.form.childSnList = []
-      obj.map(item => {
-        _this.form.childSnList.push(item.key || undefined)
-      })
     }
   },
   watch: {
@@ -123,26 +99,20 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-        this.$refs.ruleForm.resetFields()
-        this.form.childSnList = undefined
-        this.$refs.orgList.resetForm()
-        this.$refs.orgMultipleList.resetForm()
-      }
-    },
-    itemSn (newValue, oldValue) {
-      if (this.isShow && newValue) {
-        this.getDetail()
+      } else {
+        // 单行编辑时,补贴金额数据回显
+        this.subsidyAmount = this.itemAmount || undefined
       }
     }
   }
 }
 </script>
 <style lang="less" scoped>
-  .bindEdit-modal{
+  .subsidyEdit-modal{
     /deep/.ant-modal-body {
     	padding: 40px 40px 24px;
     }
-    .bindEdit-form{
+    .subsidyEdit-form{
       text-align: center;
     }
     .subsidyRequired{

+ 10 - 11
src/views/promotionManagement/subsidizedProducts/importGuideModal.vue

@@ -1,14 +1,14 @@
 <template>
   <a-modal
     centered
-    class="importGuide-modal"
+    class="importGuideSubsidy-modal"
     :footer="null"
     :maskClosable="false"
     title="导入"
     v-model="isShow"
     @cancel="isShow=false"
     :width="800">
-    <div class="importGuide-con">
+    <div class="importGuideSubsidy-con">
       <div class="explain-con">
         <div class="explain-item">
           <div class="explain-tit">
@@ -32,7 +32,7 @@
           <p>目前支持的文件类型*.xls,*.xlsx.</p>
           <div style="overflow: hidden;padding-left: 23px;">
             <Upload
-              id="importGuide-attachList"
+              id="importGuideSubsidy-attachList"
               ref="importUpload"
               :maxNums="1"
               fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
@@ -49,13 +49,13 @@
       <div class="btn-con">
         <a-button
           type="primary"
-          id="importGuide-nextStep"
+          id="importGuideSubsidy-nextStep"
           size="large"
           class="button-primary"
           @click="handlerNextStep"
           style="padding: 0 60px;">下一步</a-button>
         <a-button
-          id="importGuide-cancel"
+          id="importGuideSubsidy-cancel"
           size="large"
           class="button-cancel"
           @click="isShow=false"
@@ -71,7 +71,7 @@
 import ChooseImportModal from './chooseImportModal.vue'
 import { Upload } from '@/components'
 export default {
-  name: 'ImportGuideModal',
+  name: 'ImportGuideSubsidyModal',
   components: { ChooseImportModal, Upload },
   props: {
     openModal: { //  弹框显示状态
@@ -87,7 +87,7 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       openImportModal: false, //  导入
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/salesDetail/importDetail', // 接口
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/shopProductSubsidy/importForShopProductSubsidy', // 接口
       paramsData: null, // 单据信息
       uploadParams: { // 上传参数
         savePathType: 'local'
@@ -111,7 +111,6 @@ export default {
     },
     // 上传文件  change
     changeImport (file) {
-      // console.log(file, JSON.parse(file))
       if (file && JSON.parse(file).length > 0) {
         this.paramsData = Object.assign({}, JSON.parse(file)[0] || null, this.params)
       } else {
@@ -148,8 +147,8 @@ export default {
 </script>
 
 <style lang="less" scoped>
-  .importGuide-modal{
-    .importGuide-con{
+  .importGuideSubsidy-modal{
+    .importGuideSubsidy-con{
       .explain-con{
         .explain-item{
           margin-bottom: 10px;
@@ -180,7 +179,7 @@ export default {
             }
           }
         }
-        #importGuide-attachList{
+        #importGuideSubsidy-attachList{
           width: 100%;
         }
       }

+ 84 - 38
src/views/promotionManagement/subsidizedProducts/list.vue

@@ -41,9 +41,9 @@
     <!-- 操作按钮 -->
     <div class="table-operator-nobor">
       <a-button id="subsidizedProducts-add" type="primary" class="button-error" @click="openAddModal=true">新增</a-button>
-      <a-button id="subsidizedProducts-edit" type="primary" class="button-info" @click="handleAdd">批量编辑</a-button>
-      <a-button id="subsidizedProducts-del" type="primary" class="button-error" ghost @click="handleAdd">批量删除</a-button>
-      <a-button id="subsidizedProducts-import" style="margin-left:5px;" @click="handleAdd">导入</a-button>
+      <a-button id="subsidizedProducts-edit" type="primary" class="button-info" @click="handleEdit()">批量编辑</a-button>
+      <a-button id="subsidizedProducts-del" type="primary" class="button-error" ghost @click="handleDel()">批量删除</a-button>
+      <a-button id="subsidizedProducts-import" style="margin-left:5px;" @click="openGuideModal=true">导入</a-button>
     </div>
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 列表 -->
@@ -52,7 +52,8 @@
         ref="table"
         :style="{ height: tableHeight+70+'px' }"
         size="small"
-        :rowKey="(record) => record.id"
+        :rowKey="(record) => record.productSn"
+        rowKeyName="productSn"
         :columns="columns"
         :data="loadData"
         :pageSize="20"
@@ -63,12 +64,7 @@
         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="promoTime" slot-scope="text, record">
-          <span v-if="record.promoStartDate">{{ record.promoStartDate }} 至 {{ record.promoEndDate }}</span>
+          <span v-if="record.productEntity&&(record.productEntity.productTypeName2 || record.productEntity.productTypeName3)">{{ record.productEntity.productTypeName2 }} {{ record.productEntity.productTypeName3 ? '>' : '' }} {{ record.productEntity.productTypeName3 }}</span>
           <span v-else>--</span>
         </template>
         <!-- 商城类目 -->
@@ -103,11 +99,11 @@
       </s-table>
     </a-spin>
     <!-- 新增 -->
-    <subsidyAddModal ref="partQuery" :openModal="openAddModal" @close="openAddModal=false"></subsidyAddModal>
+    <subsidyAddModal ref="partQuery" :openModal="openAddModal" @plAdd="subsidyAddOk" @close="openAddModal=false"></subsidyAddModal>
     <!-- 编辑 -->
-    <subsidy-edit-modal :openModal="openEditModal" @ok="$refs.table.refresh(true)" @close="openEditModal=false" />
+    <subsidy-edit-modal :itemAmount="itemAmount" :itemSn="itemId" :openModal="openEditModal" @ok="clearChooseData" @close="closeEditModal" />
     <!-- 导入产品 -->
-    <importGuideModal :openModal="openGuideModal" @close="openGuideModal=false" @ok="hanldeImprotOk" />
+    <importGuideModal :openModal="openGuideModal" @close="openGuideModal=false" @ok="subsidyAddOk" />
   </a-card>
 </template>
 
@@ -122,7 +118,7 @@ import subsidyAddModal from './subsidyAddModal.vue'
 import subsidyEditModal from './editModal.vue'
 import importGuideModal from './importGuideModal.vue'
 // 接口
-import { shopPromoProductList } from '@/api/shopPromoProduct'
+import { subsidizedProductList, subsidizedProductDel, subsidizedProductSave } from '@/api/shopProductSubsidy'
 export default {
   name: 'SubsidizedProductsList',
   mixins: [commonMixin],
@@ -155,18 +151,20 @@ export default {
       openEditModal: false, // 打开编辑弹窗
       rowSelectionInfo: null, // 批量编辑、删除  选择数据
       openGuideModal: false, // 导入弹窗
+      itemId: null, // 当前行补贴产品sn
+      itemAmount: null, // 当前行补贴金额
       columns: [
         { title: '序号', dataIndex: 'no', align: 'center', width: '50px' },
-        { title: '创建时间', dataIndex: 'createTime', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productOrigCode', align: 'center', width: '12%', customRender: function (text) { return text || '--' } },
-        { title: '产品品牌', dataIndex: 'productBrandName', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', align: 'center', width: '12%', customRender: function (text) { return text || '--' } },
+        { title: '产品品牌', dataIndex: 'productEntity.productBrandName', align: 'center', width: '10%', customRender: function (text) { return text || '--' } },
         { title: '产品分类', align: 'center', width: '15%', scopedSlots: { customRender: 'productType' } },
         { title: '商城类目', scopedSlots: { customRender: 'categoryName' }, width: '13%', align: 'center' },
-        { title: '原售价', dataIndex: 'promoName', width: '11%', align: 'right', customRender: text => { return (text || text == 0) ? _this.toThousands(text) : '--' } },
-        { title: '补贴金额', dataIndex: 'promoStartDate', align: 'center', width: '11%', scopedSlots: { customRender: 'promoTime' } },
-        { title: '补贴后售价', dataIndex: 'promoTypeDictValue', align: 'center', width: '11%', customRender: function (text) { return text || '--' } },
+        { title: '原售价', dataIndex: 'shopProductPrice', width: '11%', align: 'right', customRender: text => { return (text || text == 0) ? _this.toThousands(text) : '--' } },
+        { title: '补贴金额', dataIndex: 'subsidyAmount', align: 'right', width: '11%', customRender: text => { return (text || text == 0) ? _this.toThousands(text) : '--' } },
+        { title: '补贴后售价', dataIndex: 'subsidyedPrice', align: 'right', width: '11%', customRender: text => { return (text || text == 0) ? _this.toThousands(text) : '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '11%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -174,7 +172,7 @@ export default {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
-        return shopPromoProductList(params).then(res => {
+        return subsidizedProductList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -190,49 +188,97 @@ export default {
       }
     }
   },
+  computed: {
+    // 已选数量
+    selectTotal () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRows.length
+    }
+  },
   methods: {
     // 表格选中项
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
     },
-    // 新增
-    handleAdd () {
-
-    },
-    // 确定导入产品
-    hanldeImprotOk (obj) {
+    // 新增补贴产品   确定导入产品
+    subsidyAddOk (list) {
       this.spinning = true
-      salesDetailInsertImport(obj).then(res => {
+      subsidizedProductSave(list).then(res => {
         if (res.status == 200) {
-          this.$refs.table.refresh(true)
-          this.getOrderDetail(false)
+          if (res.data) {
+            this.getErrorInfo(res.data)
+          } else {
+            this.openAddModal = false
+            this.$message.success(res.message)
+            this.$refs.table.refresh(true)
+          }
         }
         this.spinning = false
       })
     },
-    // 编辑
-    handleEdit () {
-      this.openEditModal = true
+    // 报错弹窗
+    getErrorInfo (infoTip) {
+      this.$info({
+        title: '提示',
+        content: infoTip,
+        onOk () {
+          console.log('我知道了')
+        }
+      })
+    },
+    // 批量编辑、编辑
+    handleEdit (row) {
+      // 批量编辑
+      if (!row) {
+        if (!this.selectTotal) {
+          this.$message.warning('请先勾选产品!')
+          return
+        }
+        this.itemId = this.rowSelectionInfo.selectedRowKeys
+      } else {
+        this.itemId = [row.productSn]
+        this.itemAmount = row.subsidyAmount
+      }
+      this.$nextTick(() => {
+        this.openEditModal = true
+      })
+    },
+    // 关闭编辑/批量编辑 弹窗
+    closeEditModal () {
+      this.itemId = null
+      this.itemAmount = null
+      this.openEditModal = false
     },
     //  删除
     handleDel (row) {
       const _this = this
-      this.$confirm({
+      if (!row && !this.selectTotal) {
+        this.$message.warning('请先勾选产品!')
+        return
+      }
+      const snList = row ? [row.productSn] : _this.rowSelectionInfo.selectedRowKeys
+      _this.$confirm({
         title: '提示',
         content: '确定删除产品吗?',
         centered: true,
         onOk () {
           _this.spinning = true
-          jxsorgRelationDel({ sn: row.orgSn }).then(res => {
+          subsidizedProductDel({ productSns: snList }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
-              _this.$refs.table.refresh()
+              _this.clearChooseData()
             }
             _this.spinning = false
           })
         }
       })
     },
+    // 清空选择项,刷新列表页
+    clearChooseData () {
+      this.closeEditModal()
+      this.rowSelectionInfo = null
+      this.$refs.table.clearSelected()
+      this.$refs.table.refresh()
+    },
     //  重置
     resetSearchForm () {
       this.queryParam.productName = ''

+ 95 - 137
src/views/promotionManagement/subsidizedProducts/subsidyAddModal.vue

@@ -7,7 +7,7 @@
     :get-container="false"
     :wrap-style="{ position: 'absolute' }"
     @close="isShow = false"
-    wrapClassName="outIndetail-modal jg-drawer-wrap"
+    wrapClassName="subsidyAdd-modal jg-page-wrap"
   >
     <a-spin :spinning="spinning" tip="Loading...">
       <!-- 搜索条件 -->
@@ -16,59 +16,58 @@
           ref="ruleForm"
           class="form-model-con"
           layout="inline"
-          :model="queryParam"
           @keyup.enter.native="$refs.table.refresh(true)" >
-          <a-row :gutter="5">
+          <a-row :gutter="5" type="flex" justify="center" align="center">
             <a-col :md="6" :sm="24">
               <a-form-model-item label="产品编码">
-                <a-input id="chooseShelf-code" ref="searchProductCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+                <a-input id="subsidyAdd-code" ref="searchProductCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="原厂编码">
-                <a-input id="chooseShelf-code" ref="searchProductCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+                <a-input id="subsidyAdd-productOrigCode" ref="productOrigCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="产品名称">
-                <a-input id="chooseShelf-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+                <a-input id="subsidyAdd-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-model-item label="产品分类">
-                <productType id="chooseShelf-productType" :isDealer="true" @change="changeProductType" v-model="productType"></productType>
+                <productType id="subsidyAdd-productType" :isDealer="true" @change="changeProductType" v-model="productType"></productType>
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="产品品牌">
-                <productBrand id="promoProducts-productBrandSn" v-model="queryParam.productBrandSn"></productBrand>
-              </a-form-item>
+              <a-form-model-item label="产品品牌">
+                <productBrand id="subsidyAdd-productBrandSn" v-model="queryParam.productBrandSn"></productBrand>
+              </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="商城类目">
-                <mallCategory id="subsidizedProducts-category" @change="changeProductsCategory" v-model="category"></mallCategory>
-              </a-form-item>
+              <a-form-model-item label="商城类目">
+                <mallCategory id="subsidyAdd-category" @change="changeProductsCategory" v-model="category"></mallCategory>
+              </a-form-model-item>
             </a-col>
             <a-col flex="auto" style="margin-bottom: 10px;">
-              <a-button type="primary" @click="$refs.table.refresh(true)" id="chooseShelf-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" id="chooseShelf-reset">重置</a-button>
+              <a-button type="primary" @click="$refs.table.refresh(true)" id="subsidyAdd-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" id="subsidyAdd-reset">重置</a-button>
             </a-col>
           </a-row>
         </a-form-model>
+      </div>
+      <div class="subsidyAdd-modal-table">
         <div class="table-operator">
           <span class="subsidyRequired">*</span>产品补贴<a-input-number
-            id="chooseShelf-name"
-            v-model.trim="queryParam.productName"
+            id="subsidyAdd-name"
+            v-model.trim="subsidyAmount"
             style="width: 20%;margin:0 10px;"
-            :max="999999"
+            :max="99999999"
             :precision="2"
             :step="1"
             placeholder="请输入"/>元
-          <a-button id="chooseShelf-handlePlAdd" style="margin:0 10px;" type="primary" @click="handlePlAdd">批量添加</a-button>
-          <span v-if="selectTotal">已选{{ selectTotal }}项</span>
+          <a-button id="subsidyAdd-handlePlAdd" style="margin:0 10px;" type="primary" @click="handlePlAdd">批量添加</a-button>
+          <span style="margin-left: 10px;" v-if="selectTotal">已选{{ selectTotal }}项</span>
         </div>
-      </div>
-      <div class="outIndetail-modal-table">
         <!-- 列表 -->
         <s-table
           class="sTable"
@@ -77,11 +76,21 @@
           :rowKey="(record) => record.id"
           :columns="columns"
           :data="loadData"
-          :scroll="{ y: tableHeight }"
+          :style="{ height: 580+'px' }"
+          :scroll="{ y: 530 }"
           :defaultLoadData="false"
           :row-selection="{ columnWidth: 40 }"
           @rowSelection="rowSelectionFun"
           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="baozh" slot-scope="text, record">
+            {{ record.packQty||'--' }}{{ record.packQty ? record.unit : '' }}/{{ record.packQtyUnit||'--' }}
+          </template>
         </s-table>
       </div>
     </a-spin>
@@ -94,76 +103,64 @@ import { STable } from '@/components'
 // 组件
 import productType from '@/views/common/productType.js'
 import productBrand from '@/views/common/productBrand.js'
+import mallCategory from '@/views/common/mallCategory.js'
 // 接口
-import { stockOutDetailList } from '@/api/stockOut'
-import { queryExtList } from '@/api/shopProduct'
+import { queryProductPageList } from '@/api/shopProductSubsidy'
 export default {
   name: 'SubsidyAddModal',
-  components: { STable, productType, productBrand },
+  components: { STable, productType, productBrand, mallCategory },
   mixins: [commonMixin],
   props: {
     openModal: {
       //  弹框显示状态
       type: Boolean,
       default: false
-    },
-    outBizType: { // 出库类型 SHOP_CALL_OUT(店内调出)   /  SALES (销售)
-      type: String,
-      default: ''
     }
   },
   data () {
+    const _this = this
     return {
       spinning: false,
       isShow: this.openModal, //  是否打开弹框
-      tableHeight: 0, // 表格高度
-      baseData: null, // 单据详情信息
-      productType: [],
-      categoryOptions: [], // 产品类目列表
-      category: [], // 类目val
+      productType: [], // 产品分类
+      category: [], // 商城类目val
       // 查询条件
       queryParam: {
         productName: '', // 产品名称
-        productCode: '', // 产品编码/原厂编码
+        productCode: '', // 产品编码
+        productOrigCode: '', // 原厂编码
         productBrandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '', //  产品三级分类
-        promoName: '', // 促销名称
-        promoType: undefined, // 促销状态
-        promoState: undefined, // 促销状态
-        categorySn: undefined, // 商城类目
-        shopProductStatus: undefined, // 商城状态
-        shopProductDelFlag: 0, // 促销产品标志
-        promoStateList: ['NOT_RELEASE', 'HAVE_RELEASE', 'IS_CLOSE']// 促销列表只查询这两种状态
+        categorySn: undefined // 商城类目
       },
-      fieldNames: { label: 'categoryName', value: 'categorySn', children: 'shopCategoryList' },
+      subsidyAmount: undefined, // 产品补贴
+      rowSelectionInfo: null, // 已选产品
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商城售价', dataIndex: 'price', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '终端价', dataIndex: 'terminalPrice', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '品牌', dataIndex: 'productBrandName', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', width: '15%', align: 'center', scopedSlots: { customRender: 'productType' } },
+        { title: '包装数', width: '10%', align: 'center', scopedSlots: { customRender: 'baozh' } },
+        { title: '单位', dataIndex: 'unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        const params = this.baseData
-        console.log(params)
-        const queryParams = { outBizType: this.outBizType, productSn: params.productSn }
-        if (this.outBizType == 'SALES') {
-          queryParams.outBizSn = params.salesBillSn
-          queryParams.outBizNo = params.salesBillNo
-        }
-        if (this.outBizType == 'SHOP_CALL_OUT') {
-          queryParams.outBizSn = params.storeCallOutSn
-          queryParams.outBizNo = params.storeCallOutNo
-        }
-        // 仓库仓位
-        queryParams.warehouseSn = params.warehouseSn
-        queryParams.warehouseLocationSn = params.warehouseLocationSn
-        return stockOutDetailList(queryParams).then(res => {
+        const queryParams = Object.assign(parameter, this.queryParam)
+        return queryProductPageList(queryParams).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
-            const no = 0
-            for (var i = 0; i < data.length; i++) {
-              data[i].no = no + i + 1
-              data[i].totalCost = Number(data[i].putCost * data[i].outQty).toFixed(2)
+            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
           }
@@ -177,28 +174,6 @@ export default {
     // 已选数量
     selectTotal () {
       return this.rowSelectionInfo && this.rowSelectionInfo.selectedRows.length
-    },
-    // 列定义
-    columns () {
-      const _this = this
-      const arr = [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'stockBatchNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'putBizTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '商城售价', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '终端价', dataIndex: 'putCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '品牌', dataIndex: 'outQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '产品分类', dataIndex: 'totalCost1', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '包装数', dataIndex: 'totalCost2', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'totalCost3', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ]
-      // 是否有成本价权限
-      if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(5, 0, { title: '成本价', dataIndex: 'putCost1', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(7, 0, { title: '成本小计', dataIndex: 'totalCost6', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-      }
-      return arr
     }
   },
   methods: {
@@ -212,50 +187,41 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    // 计算表格高度
-    setTableH () {
-      this.$nextTick(() => {
-        const searchBoxH = this.$refs.searchBox.offsetHeight
-        this.tableHeight = window.innerHeight - searchBoxH - 235
-      })
-    },
-    // 获取产品类目列表
-    getCategoryList () {
-      const _this = this
-      _this.spinning = true
-      queryExtList({}).then(res => {
-        if (res.status == 200) {
-          this.categoryOptions = res.data || []
-        }
-        _this.spinning = false
-      })
-    },
     // 商城类目
     changeProductsCategory (val) {
       this.queryParam.categorySn = (val[0] && val[1]) ? val[1] : (val[0] && !val[1]) ? val[0] : undefined
     },
-    // 关闭弹框
-    cansel () {
-      this.isShow = false
-      this.baseData = null
-    },
-    // 查询列表
-    getData (row) {
-      this.baseData = row
-      this.$nextTick(() => {
-        this.$refs.table.refresh(true)
-      })
-    },
     // 批量添加
     handlePlAdd () {
-      if (this.selectTotal) {
-        this.$emit('plAdd', this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || [])
-      } else {
+      if (!this.selectTotal) {
         this.$message.info('请选择产品')
+        return
+      }
+      if (!this.subsidyAmount) {
+        this.$message.info('产品补贴不能为空')
+        return
       }
+      const newList = this.rowSelectionInfo.selectedRows.map(item => {
+        item.subsidyAmount = this.subsidyAmount
+        return item
+      })
+      this.$emit('plAdd', newList)
     },
+    //  重置
     resetSearchForm () {
-
+      this.queryParam.productName = ''
+      this.queryParam.productCode = ''
+      this.queryParam.productOrigCode = ''
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.queryParam.categorySn = undefined
+      this.productType = []
+      this.category = []
+      this.rowSelectionInfo = null
+      this.$refs.table.clearSelected()
+      this.$refs.table.refresh()
     }
   },
   watch: {
@@ -263,39 +229,31 @@ export default {
     openModal (newValue, oldValue) {
       this.isShow = newValue
     },
-    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
-      this.setTableH()
-    },
     //  重定义的弹框状态
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
       } else {
-        this.setTableH()
+        this.resetSearchForm()
       }
     }
   }
 }
 </script>
 
-<style lang="less">
-.outIndetail-modal {
+<style lang="less" scoped>
+.subsidyAdd-modal {
 	.ant-drawer-body {
 		padding: 10px 20px;
-    .outIndetail-modal-table{
-      padding: 20px 0 0;
-    }
-    .baseInfo{
-      line-height: 24px;
-      font-size: 14px;
+    .subsidyAdd-modal-table{
+      padding-top: 10px;
     }
 	}
-}
-.table-operator{
-  .subsidyRequired{
-    margin-right: 5px;
-    color:#ED1c24;
+  .table-operator{
+    .subsidyRequired{
+      margin-right: 5px;
+      color:#ED1c24;
+    }
   }
 }
-
 </style>

+ 4 - 4
src/views/salesManagement/onlinePayOrder/detail.vue

@@ -82,7 +82,7 @@
                 总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;
               </template>
               <span v-if="detailData&&detailData.sourceType&&detailData.sourceType==='XPRH_PURCHASE'"> 返券金额:<strong>{{ detailData&&(detailData.totalGiveAmount || detailData.totalGiveAmount==0) ? toThousands(detailData.totalGiveAmount) : '--' }}</strong>;</span>
-              <span>补贴金额:<strong>{{ detailData&&(detailData.totalGiveAmount || detailData.totalGiveAmount==0) ? toThousands(detailData.totalGiveAmount) : '--' }}</strong>;</span>
+              <span>抵扣金额:<strong>{{ detailData&&(detailData.subsidyAmount || detailData.subsidyAmount==0) ? toThousands(detailData.subsidyAmount) : '--' }}</strong>;</span>
             </div>
             <div>
               <hideCellMenus id="onlinePayOrderList-showCellMenus" placeholder="显示" :defHiddenKes="colsArr" v-model="showCell"></hideCellMenus>
@@ -219,8 +219,8 @@ export default {
           checked: false
         },
         {
-          title: '补贴金额',
-          key: 'oosFlagDictValue1',
+          title: '抵扣金额',
+          key: 'subsidyAmount',
           disabled: false,
           checked: false
         },
@@ -256,7 +256,7 @@ export default {
         { title: '单位', dataIndex: 'productOrigUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '售价小计', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
       ]
-      arr.push({ title: '补贴金额', dataIndex: 'oosFlagDictValue1', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      arr.push({ title: '抵扣金额', dataIndex: 'subsidyAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       if (this.detailData && this.detailData.sourceType && this.detailData.sourceType === 'XPRH_PURCHASE') {
         arr.push({ title: '返券金额', dataIndex: 'giveAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }