Просмотр исходного кода

Merge branch 'develop_yh15' of jianguan-web/qpls-md-html into pre-release

李磊 2 лет назад
Родитель
Сommit
f605a6fd39
76 измененных файлов с 5545 добавлено и 462 удалено
  1. BIN
      public/templ/产品信息管理(箭冠)自定义报价导入模板.xlsx
  2. BIN
      public/templ/库存预警产品导入模板.xlsx
  3. 1 1
      public/version.json
  4. 15 0
      src/App.vue
  5. 1 1
      src/api/allocLinkageOut.js
  6. 34 0
      src/api/product.js
  7. 1 1
      src/api/purchaseDetail.js
  8. 1 1
      src/api/sales.js
  9. 10 1
      src/api/salesDetail.js
  10. 1 1
      src/api/salesReturn.js
  11. 1 1
      src/api/sparePartsPur.js
  12. 9 1
      src/api/sparePartsRet.js
  13. 85 11
      src/components/index.less
  14. 1 1
      src/components/tools/UserMenu.vue
  15. 58 1
      src/config/router.config.js
  16. 1 0
      src/store/modules/app.js
  17. 0 5
      src/store/modules/shoppingCart.js
  18. 18 1
      src/utils/mixin.js
  19. 22 8
      src/utils/request.js
  20. 18 11
      src/views/allocationManagement/chainTransferIn/list.vue
  21. 10 3
      src/views/allocationManagement/chainTransferOut/edit.vue
  22. 7 0
      src/views/allocationManagement/chainTransferOut/list.vue
  23. 11 4
      src/views/allocationManagement/storeTransferOut/list.vue
  24. 12 3
      src/views/allocationManagement/warehouseAllocation/edit.vue
  25. 17 10
      src/views/allocationManagement/warehouseAllocation/list.vue
  26. 34 3
      src/views/bulkManagement/bulkReturnGoods/edit.vue
  27. 34 3
      src/views/bulkManagement/bulkReturnGoods/grabEdit.vue
  28. 7 4
      src/views/bulkManagement/bulkWarehousingOrder/edit.vue
  29. 1 1
      src/views/chainReportData/chainCustomerReport/list.vue
  30. 9 6
      src/views/chainReportData/chainSalesDetailReport/list.vue
  31. 6 3
      src/views/chainReportData/chainSalesReport/list.vue
  32. 3 1
      src/views/common/printPanel.vue
  33. 2 14
      src/views/common/shopingCatModal.vue
  34. 2 2
      src/views/inventoryManagement/inventoryChecking/selfDisk.vue
  35. 3 3
      src/views/inventoryManagement/inventoryWarning/chooseImportModal.vue
  36. 3 3
      src/views/inventoryManagement/inventoryWarning/importGuideModal.vue
  37. 3 3
      src/views/inventoryManagement/inventoryWarning/list.vue
  38. 1 1
      src/views/notice/detailModal.vue
  39. 208 0
      src/views/productManagement/productInfoJg/chooseImportModal.vue
  40. 185 0
      src/views/productManagement/productInfoJg/importGuideModal.vue
  41. 56 43
      src/views/productManagement/productInfoJg/list.vue
  42. 9 21
      src/views/purchasingManagement/purchaseOrderNew/chooseProductModal.vue
  43. 76 84
      src/views/purchasingManagement/purchaseOrderNew/detail.vue
  44. 18 99
      src/views/purchasingManagement/purchaseOrderNew/edit.vue
  45. 4 19
      src/views/purchasingManagement/purchaseOrderNew/list.vue
  46. 2 14
      src/views/purchasingManagement/purchaseOrderNew/outStockModal.vue
  47. 3 3
      src/views/purchasingManagement/purchaseReturn/edit.vue
  48. 4 2
      src/views/purchasingManagement/purchaseReturnApplyForm/edit.vue
  49. 3 3
      src/views/purchasingManagement/purchaseReturnOutSync/edit.vue
  50. 3 3
      src/views/purchasingManagement/purchaseReturnOutSync/grapEdit.vue
  51. 2 1
      src/views/reportData/bulkReturnReport/detailList.vue
  52. 2 1
      src/views/reportData/bulkReturnReport/list.vue
  53. 2 2
      src/views/reportData/customerReport/list.vue
  54. 9 6
      src/views/reportData/salesDetailReport/list.vue
  55. 6 3
      src/views/reportData/salesReport/list.vue
  56. 3 3
      src/views/reportData/stockImportReport/detailList.vue
  57. 1 1
      src/views/reportData/stockImportReport/list.vue
  58. 2 0
      src/views/reportData/storeReceivedSendStorageReport/list.vue
  59. 1 1
      src/views/salesManagement/salesQuery/carInfoModal.vue
  60. 1 1
      src/views/salesManagement/salesQuery/chooseShelfProduct.vue
  61. 3 29
      src/views/salesManagement/salesQuery/edit.vue
  62. 2 1
      src/views/salesManagement/salesQuery/list.vue
  63. 1 1
      src/views/salesManagement/salesQuery/productSalesRecordModal.vue
  64. 121 0
      src/views/salesManagement/salesQueryNew/carInfoModal.vue
  65. 579 0
      src/views/salesManagement/salesQueryNew/chooseCustomModal.vue
  66. 202 0
      src/views/salesManagement/salesQueryNew/chooseImportModal.vue
  67. 644 0
      src/views/salesManagement/salesQueryNew/chooseProductModal.vue
  68. 447 0
      src/views/salesManagement/salesQueryNew/chooseShelfProduct.vue
  69. 340 0
      src/views/salesManagement/salesQueryNew/detail.vue
  70. 990 0
      src/views/salesManagement/salesQueryNew/edit.vue
  71. 196 0
      src/views/salesManagement/salesQueryNew/importGuideModal.vue
  72. 605 0
      src/views/salesManagement/salesQueryNew/list.vue
  73. 173 0
      src/views/salesManagement/salesQueryNew/outInDetialModal.vue
  74. 190 0
      src/views/salesManagement/salesQueryNew/productSalesRecordModal.vue
  75. 6 5
      src/views/salesManagement/salesReturn/salesReturnEdit.vue
  76. 4 3
      src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue

BIN
public/templ/产品信息管理(箭冠)自定义报价导入模板.xlsx


BIN
public/templ/库存预警产品导入模板.xlsx


+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1677831278024
+  "version": 1678928091781
 }

+ 15 - 0
src/App.vue

@@ -32,6 +32,8 @@ export default {
     }
     // 在页面刷新时将store保存到sessionStorage里
     window.addEventListener('beforeunload', () => {
+      this.$store.state.app.isNewTab = true
+      this.$store.state.app.updateList = false
       sessionStorage.setItem('store', JSON.stringify(this.$store.state))
     })
     // 按F5 刷新页面
@@ -40,6 +42,19 @@ export default {
         window.location.reload()
       }
     })
+    window.addEventListener('visibilitychange',()=>{
+      this.$store.state.app.visibilityState = document.visibilityState == 'visible'
+    })
+    window.addEventListener('focus',(e)=>{
+      if(!this.$store.state.app.visibilityState){
+        this.$store.state.app.visibilityState = true
+      }
+    })
+    window.addEventListener('blur',(e)=>{
+      if(this.$store.state.app.visibilityState){
+        this.$store.state.app.visibilityState = false
+      }
+    })
     this.$message.config({
       top: `100px`,
       duration: 3,

+ 1 - 1
src/api/allocLinkageOut.js

@@ -88,7 +88,7 @@ export const allocLinkageOutDetailDel = (params) => {
     method: 'get'
   })
 }
-//  连锁调拨调出  详情  整单删除
+//  连锁调拨调出  详情  清空列表
 export const allocLinkageOutDetailDelAll = (params) => {
   return axios({
     url: `/allocLinkageOut/detail/deleteAll/${params.sn}`,

+ 34 - 0
src/api/product.js

@@ -85,3 +85,37 @@ export const settingPrice = params => {
     method: 'post'
   })
 }
+// 产品信息(箭冠)列表导出
+export const productExportPrice = params => {
+  return axios.request({
+    url: `/product/exportPrice`,
+    method: 'post',
+    data: params,
+    responseType: 'blob'
+  })
+}
+// 产品信息(箭冠)获取导入数据
+export const productImportPrice = params => {
+  return axios({
+    url: '/product/importPrice',
+    data: params,
+    method: 'post'
+  })
+}
+// 产品信息(箭冠)导入
+export const productImportPriceInsertBatch = (params) => {
+  return axios({
+    url: '/product/importPrice/insertBatch',
+    data: params,
+    method: 'post'
+  })
+}
+// 导出错误项
+export const productExportError = (params) => {
+  return axios({
+    url: '/product/importPrice/exportError',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 1 - 1
src/api/purchaseDetail.js

@@ -26,7 +26,7 @@ export const purchaseDetailDel = (params) => {
     method: 'get'
   })
 }
-//  采购详情 整单删除
+//  采购详情 清空列表
 export const purchaseDetailDelAll = (params) => {
   return axios({
     url: `/purchaseDetail/deleteAll/${params.id}`,

+ 1 - 1
src/api/sales.js

@@ -110,7 +110,7 @@ export const salesSave = (params) => {
 //  销售 删除
 export const salesDel = (params) => {
   return axios({
-    url: `/sales/delete/${params.id}`,
+    url: `/sales/delete`,
     data: params,
     method: 'post'
   })

+ 10 - 1
src/api/salesDetail.js

@@ -11,6 +11,15 @@ export const salesDetailList = (params) => {
     method: 'post'
   })
 }
+
+// 查询已经添加的产品sn数组
+export const queryCheckedList = (params) => {
+  return axios({
+    url: `/salesDetail/queryProductSnListBySalesBillSn/${params.salesBillSn}`,
+    method: 'post'
+  })
+}
+
 //  销售详情 新增配件
 export const salesDetailInsert = (params) => {
   return axios({
@@ -50,7 +59,7 @@ export const salesDetailDel = (params) => {
     method: 'get'
   })
 }
-//  销售详情 整单删除
+//  销售详情 清空列表
 export const salesDetailDelAll = (params) => {
   return axios({
     url: `/salesDetail/deleteBySalesBillSn/${params.salesBillSn}`,

+ 1 - 1
src/api/salesReturn.js

@@ -23,7 +23,7 @@ export const salesReturnDetailDel = (params) => {
   })
 }
 
-//  销售退货明细 整单删除
+//  销售退货明细 清空列表
 export const salesReturnDelAll = (params) => {
   return axios({
     url: `/salesReturn/detail/deleteAll/${params.sn}`,

+ 1 - 1
src/api/sparePartsPur.js

@@ -50,7 +50,7 @@ export const sparePartsPurDel = (params) => {
     method: 'get'
   })
 }
-// 整单删除
+// 清空列表
 export const sparePartsPurDeleteAll = (params) => {
   return axios({
     url: `/sparePartsPur/detail/deleteAll/${params.sn}`,

+ 9 - 1
src/api/sparePartsRet.js

@@ -137,4 +137,12 @@ export const sparePartsRetDetailExport = params => {
     method: 'get',
     responseType: 'blob'
   })
-}
+}
+// 散件退货 清空列表
+export const sparePartsRetDetailClear = (params) => {
+  return axios({
+    url: '/sparePartsRet/detail/clear',
+    data: params,
+    method: 'post'
+  })
+}

+ 85 - 11
src/components/index.less

@@ -305,17 +305,6 @@
       margin-right: 8px;
       margin-left: 0;
     }
-    .alert-message{
-      strong{
-        color: #f12929;
-      }
-    }
-    .action-buttons{
-      button {
-        margin-right: 8px;
-        margin-left: 0;
-      }
-    }
   }
   .table-operator-nobor{
     padding: 0 0 10px 0;
@@ -334,6 +323,91 @@
     padding: 7px 0 4px;
     box-shadow: 0 0 20px #dcdee2;
   }
+  .jg-page-wrap,.jg-drawer-wrap{
+    .table-page-search-wrapper{
+      margin-bottom: 6px;
+      .ant-form.ant-form-inline .ant-form-item .ant-input, .ant-form.ant-form-inline .ant-form-item .ant-select-selection{
+        border:0;
+        box-shadow: none !important;
+      }
+      .ant-form.ant-form-inline .ant-form-item{
+        border:1px solid #dadada;
+        border-radius: 3px;
+        overflow: hidden;
+        margin-bottom: 10px!important;
+        .ant-form-item-label{
+          padding-left: 11px;
+          padding-right: 0!important;
+        }
+      }
+    }
+  }
+  .jg-page-wrap{
+    .table-operator{
+      .alert-message{
+        strong{
+          color: #f12929;
+        }
+      }
+      .action-buttons{
+        button {
+          margin-right: 8px;
+          margin-left: 0;
+        }
+      }
+    }
+    .header-bar{
+      margin-bottom: 6px;
+      .sub-title{
+        font-size: 12px;
+        color: #808695;
+        margin-left: 10px;
+      }
+      .billno{
+        margin: 0;
+        font-size: 16px;
+        font-weight: 600;
+        display: inline-block;
+        vertical-align: middle;
+        color: #333;
+      }
+    }
+    .choosedList-cont{
+      .baseInfo-bar{
+        padding:10px 10px 0 10px;
+        border-bottom:6px solid #f0f0f0;
+        .ant-descriptions-title{
+          margin-bottom: 10px;
+        }
+      }
+      .choosed-table{
+        padding:10px;
+        .ant-input-number-sm input{
+          text-align: center;
+        }
+      }
+      .footer-bar{
+        position:absolute;
+        width:100%;
+        bottom:0;
+        display:flex;
+        justify-content: flex-end;
+        align-items: center;
+        padding: 8px;
+        border-top: 1px solid #eee;
+        background-color: #fff;
+        > div{
+          &:first-child{
+            padding: 0 15px;
+            strong{
+              color: #ed1c24;
+              font-size: 18px;
+            }
+          }
+        }
+      }
+    }
+  }
 }
 // 确认框居中
 .confirm-center{

+ 1 - 1
src/components/tools/UserMenu.vue

@@ -19,7 +19,7 @@
       <!-- 通知 -->
       <notice-icon class="action"/>
       <!-- 皮肤设置 -->
-      <a-popover trigger="click" title="系统设置">
+      <a-popover title="系统设置">
         <div slot="content" :style="{width: fontSize == 'large' ? '340px' : '300px'}">
           <a-form-model :label-col="{ span: 9 }" :wrapper-col="{ span: 15 }">
             <a-form-model-item label="主题">

+ 58 - 1
src/config/router.config.js

@@ -76,7 +76,6 @@ export const asyncRouterMap = [
                 meta: {
                   title: '购物车',
                   icon: 'contacts',
-                  replaceTab: true,
                   hidden: true
                 }
               }
@@ -153,6 +152,64 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/salesManagement/salesQueryNew',
+            redirect: '/salesManagement/salesQueryNew/list',
+            name: 'salesQueryNew',
+            component: BlankLayout,
+            meta: {
+              title: '销售单(新版)',
+              icon: 'monitor',
+              permission: 'M_salesQueryList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'salesNewList',
+                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesQueryNew/list.vue'),
+                meta: {
+                  title: '销售单列表(新版)',
+                  icon: 'monitor',
+                  hidden: true,
+                  permission: 'M_salesQueryList'
+                }
+              },
+              {
+                path: 'detail/:sn',
+                name: 'salesNewDetail',
+                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesQueryNew/detail.vue'),
+                meta: {
+                  title: '销售单详情(新版)',
+                  icon: 'monitor',
+                  hidden: true,
+                  permission: 'B_salesDetail'
+                }
+              },
+              {
+                path: 'add/:id/:sn/:priceType',
+                name: 'salesNewAdd',
+                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesQueryNew/edit.vue'),
+                meta: {
+                  title: '新增销售单(新版)',
+                  icon: 'monitor',
+                  hidden: true,
+                  permission: 'B_salesNews'
+                }
+              },
+              {
+                path: 'edit/:id/:sn/:priceType',
+                name: 'salesNewEdit',
+                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/salesQueryNew/edit.vue'),
+                meta: {
+                  title: '编辑销售单(新版)',
+                  icon: 'monitor',
+                  hidden: true,
+                  permission: 'B_salesEdit'
+                }
+              }
+            ]
+          },
           {
             path: '/salesManagement/urgentItemsOffset',
             redirect: '/salesManagement/urgentItemsOffset/list',

+ 1 - 0
src/store/modules/app.js

@@ -34,6 +34,7 @@ const app = {
     closeTabPages: [], // 已关闭的页面
     isNewSubTab: false,
     updateList: false,
+    visibilityState: false,
     loadingStatus: false,
     winHeight: 0 ,//  窗口高度
     isLastDayForMonth: false, // 是否是当月最后一天

+ 0 - 5
src/store/modules/shoppingCart.js

@@ -3,11 +3,6 @@ export default {
   state: {
     cartCount: 0,
   },
-  getters: {
-    cartCount: state => {
-      return () => state.cartCount
-    },
-  },
   mutations: {
     setCartCount (state, count) {
       state.cartCount = count

+ 18 - 1
src/utils/mixin.js

@@ -79,7 +79,8 @@ const AppDeviceEnquire = {
 const commonMixin = {
   data(){
     return {
-      toThousands
+      toThousands,
+      isActiveComp: false
     }
   },
   watch: {
@@ -92,8 +93,24 @@ const commonMixin = {
           this.spinning = a
         }
       }
+    },
+    '$store.state.app.visibilityState':function(a,b){
+      if(a && this.isActiveComp){
+        if(this.$refs.table){
+          // this.$refs.table.refresh()
+        }
+        if(this.$refs.chooseTable){
+          // this.$refs.chooseTable.refresh()
+        }
+      }
     }
   },
+  activated(){
+    this.isActiveComp = true
+  },
+  deactivated(){
+    this.isActiveComp = false
+  },
   methods: {
     getIsHomeNav () {
       const data = sessionStorage.getItem('isHomeNav')

+ 22 - 8
src/utils/request.js

@@ -89,12 +89,13 @@ service.interceptors.request.use(config => {
   }
   config.retry = 3
   config.retryDelay = 1000
-  // store.commit('SET_loadingStatus', true)
+  store.commit('SET_loadingStatus', true)
   return config
 }, err)
 
 // response interceptor
 service.interceptors.response.use((response) => {
+  console.log(response)
   const et = sessionStorage.getItem('errorTips')
   // 无权限或登录超时
   if ((response.data.status == '1001' || response.data.status == '1099') && !et) {
@@ -113,14 +114,27 @@ service.interceptors.response.use((response) => {
       }
     })
   } else if (response.data.status != 200 && response.data.status && response.data.errCode != 'VALIDATE_STOCK_LACK') {
-    // 其它业务错误提示
-    notification.destroy()
-    notification.error({
-      message: '提示',
-      description: response.data.message
-    })
+    // 单据不存在
+    if(response.data.message.indexOf('不存在')>=0 || response.data.message.indexOf('单据已删除')>=0){
+      modal.destroyAll()
+      modal.error({
+        title: '提示',
+        content: response.data.message,
+        onOk () {
+           window.history.go(-1)
+        }
+      })
+    }else{
+      // 其它业务错误提示
+      notification.destroy()
+      notification.error({
+        message: '提示',
+        description: response.data.message
+      })
+    }
+    store.commit('SET_loadingStatus', false)
   }
-  // store.commit('SET_loadingStatus', false)
+  
   return response.data
 }, err)
 

+ 18 - 11
src/views/allocationManagement/chainTransferIn/list.vue

@@ -11,22 +11,27 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="调出对象">
-                <getTenantList id="chainTransferInList-outTenantSn" v-model="queryParam.outTenantSn"></getTenantList>
+              <a-form-item label="连锁调入单号">
+                <a-input id="chainTransferInList-allocationLinkagePutNo" v-model.trim="queryParam.allocationLinkagePutNo" allowClear placeholder="请输入连锁调入单号"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="调拨产品类型">
-                <v-select
-                  v-model="queryParam.allocationType"
-                  ref="allocationType"
-                  id="chainTransferInList-allocationType"
-                  code="ALLOCATION_LINKAGE_PRODUCT_TYPE"
-                  placeholder="请选择调拨产品类型"
-                  allowClear></v-select>
+              <a-form-item label="调出对象">
+                <getTenantList id="chainTransferInList-outTenantSn" v-model="queryParam.outTenantSn"></getTenantList>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="调拨产品类型">
+                  <v-select
+                    v-model="queryParam.allocationType"
+                    ref="allocationType"
+                    id="chainTransferInList-allocationType"
+                    code="ALLOCATION_LINKAGE_PRODUCT_TYPE"
+                    placeholder="请选择调拨产品类型"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="业务状态">
                   <v-select
@@ -150,7 +155,8 @@ export default {
       queryParam: { //  查询条件
         beginDate: '',
         endDate: '',
-        outTenantSn: undefined, //  调出对象
+        allocationLinkagePutNo: undefined, // 连锁调入单号
+        outTenantSn: undefined, //  调入对象
         allocationType: undefined, //  调拨产品类型
         state: undefined, //  业务状态
         settleState: undefined
@@ -229,6 +235,7 @@ export default {
       this.$refs.rangeDate.resetDate()
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
+      this.queryParam.allocationLinkagePutNo = undefined
       this.queryParam.outTenantSn = undefined
       this.queryParam.allocationType = undefined
       this.queryParam.state = undefined

+ 10 - 3
src/views/allocationManagement/chainTransferOut/edit.vue

@@ -140,7 +140,14 @@
               </a-col>
               <a-col :span="7" style="text-align: right;">
                 <!-- <a-button size="small" style="margin-left: 8px" id="chainTransferOutEdit-import-btn">导入明细</a-button> -->
-                <a-button size="small" type="danger" style="margin-left: 8px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
+                <a-button
+                  size="small"
+                  type="primary"
+                  ghost
+                  style="margin-left: 8px"
+                  :disabled="localDataSource.length==0"
+                  @click.stop="handleDel('', 'all')"
+                  id="chainTransferOutEdit-del-all-btn">清空列表</a-button>
               </a-col>
             </a-row>
             <!-- 列表 -->
@@ -369,13 +376,13 @@ export default {
     //  删除
     handleDel (row, isAll) {
       const _this = this
-      const content = isAll ? '删除后不可恢复,确定要进行整单删除吗?' : '删除后不可恢复,确定要进行删除吗?'
+      const content = isAll ? '删除后不可恢复,确定要清空列表吗?' : '删除后不可恢复,确定要进行删除吗?'
       this.$confirm({
         title: '提示',
         content: content,
         centered: true,
         onOk () {
-          if (isAll) { //  整单删除
+          if (isAll) { //  清空列表
             _this.spinning = true
             allocLinkageOutDetailDelAll({ sn: _this.$route.params.sn }).then(res => {
               if (res.status == 200) {

+ 7 - 0
src/views/allocationManagement/chainTransferOut/list.vue

@@ -21,6 +21,11 @@
               </a-form-item>
             </a-col>
             <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="连锁调出单号">
+                  <a-input id="chainTransferOutList-allocationLinkageOutNo" v-model.trim="queryParam.allocationLinkageOutNo" allowClear placeholder="请输入连锁调出单号"/>
+                </a-form-item>
+              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="调往对象">
                   <getTenantList id="chainTransferOutList-putTenantSn" type="out" placeholder="请选择调往对象" v-model="queryParam.putTenantSn"></getTenantList>
@@ -184,6 +189,7 @@ export default {
         auditEndDate: '',
         outWarehouseBeginDate: '',
         outWarehouseEndDate: '',
+        allocationLinkageOutNo: undefined, //  连锁调出单号
         putTenantSn: undefined, //  调往对象
         allocationType: undefined, //  调出产品类型
         state: undefined, //  业务状态
@@ -282,6 +288,7 @@ export default {
       this.queryParam.outWarehouseBeginDate = ''
       this.queryParam.outWarehouseEndDate = ''
 
+      this.queryParam.allocationLinkageOutNo = undefined
       this.queryParam.putTenantSn = undefined
       this.queryParam.allocationType = undefined
       this.queryParam.state = undefined

+ 11 - 4
src/views/allocationManagement/storeTransferOut/list.vue

@@ -21,11 +21,16 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="调往对象名称">
-                <custList id="storeTransferOutList-putPersonName" ref="custList" @change="custChange"></custList>
+              <a-form-item label="店内调出单号">
+                <a-input id="storeTransferOutList-storeCallOutNo" v-model.trim="queryParam.storeCallOutNo" allowClear placeholder="请输入店内调出单号"/>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="调往对象名称">
+                  <custList id="storeTransferOutList-putPersonName" ref="custList" @change="custChange"></custList>
+                </a-form-item>
+              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="调拨类型">
                   <a-select id="storeTransferOutList-callOutType" v-model="queryParam.callOutType" placeholder="请选择调拨类型" allowClear >
@@ -185,6 +190,7 @@ export default {
         outWarehouseEndDate: '',
         customerNameCurrent: undefined, //  调往对象
         customerSnCurrent: undefined,
+        storeCallOutNo: undefined, // 店内调出单号
         callOutType: undefined, //  调拨类型
         state: undefined, //  业务状态
         settleState: undefined //  财务状态
@@ -223,7 +229,7 @@ export default {
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '店内调出单号', scopedSlots: { customRender: 'storeCallOutNo' }, width: '14%', align: 'center' },
-        { title: '调往对象名称', width: '16%', align: 'center', customRender: function (text, record) { return (record.putPersonType == 'CUSTOMER' ? record.customerNameCurrent: record.putPersonName) || '--' }, ellipsis: true },
+        { title: '调往对象名称', width: '16%', align: 'center', customRender: function (text, record) { return (record.putPersonType == 'CUSTOMER' ? record.customerNameCurrent : record.putPersonName) || '--' }, ellipsis: true },
         { title: '调拨类型', dataIndex: 'callOutTypeName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '总款数', dataIndex: 'productTotalCategory', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总数量', dataIndex: 'productTotalQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -295,10 +301,11 @@ export default {
       this.$refs.custList.resetForm()
       this.queryParam.customerSnCurrent = undefined
       this.queryParam.customerNameCurrent = undefined
+      this.queryParam.storeCallOutNo = undefined
       this.queryParam.callOutType = undefined
       this.queryParam.state = undefined
       this.queryParam.settleState = undefined
-      
+
       if (!flag) {
         this.setIsHomeNav(this.$route.name, null)
       }

+ 12 - 3
src/views/allocationManagement/warehouseAllocation/edit.vue

@@ -149,7 +149,14 @@
               <a-col :span="6">
                 <div style="margin-top: 4px;text-align: right;">
                   <!-- <a-button size="small" style="margin-left: 8px" id="chainTransferOutEdit-import-btn">导入明细</a-button> -->
-                  <a-button size="small" type="danger" style="margin-left: 8px" @click.stop="handleDel('', 'all')" id="warehouseAllocationEdit-del-all-btn">整单删除</a-button>
+                  <a-button
+                    size="small"
+                    type="danger"
+                    style="margin-left: 8px"
+                    @click.stop="handleDel('', 'all')"
+                    ghost
+                    :disabled="chooseLoadDataSource.length==0"
+                    id="warehouseAllocationEdit-del-all-btn">清空列表</a-button>
                 </div>
               </a-col>
             </a-row>
@@ -251,6 +258,7 @@ export default {
       productType: [],
       warehousePutLocData: [], //  调入仓位  下拉数据
       warehouseOutLocData: [], //  调出仓位  下拉数据
+      chooseLoadDataSource: [],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -282,6 +290,7 @@ export default {
             data.list[i].allocationCost = data.list[i].totalAllocationCost / data.list[i].allocationQty
           }
           this.chooseDisabled = false
+          this.chooseLoadDataSource = data.list
           return data
         })
       },
@@ -423,14 +432,14 @@ export default {
     //  删除
     handleDel (row, isAll) {
       const _this = this
-      const content = isAll ? '删除后不可恢复,确定要进行整单删除吗?' : '删除后不可恢复,确定要进行删除吗?'
+      const content = isAll ? '删除后不可恢复,确定要清空列表吗?' : '删除后不可恢复,确定要进行删除吗?'
       this.$confirm({
         title: '提示',
         content: content,
         centered: true,
         onOk () {
           let params
-          if (isAll) { //  整单删除
+          if (isAll) { //  清空列表
             params = { allocationWarehouseSn: _this.$route.params.sn }
           } else { //  单个删除
             params = {

+ 17 - 10
src/views/allocationManagement/warehouseAllocation/list.vue

@@ -10,22 +10,27 @@
                 <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
-            <a-col :md="4" :sm="24">
-              <a-form-item label="调出仓库">
-                <a-select id="warehouseAllocation-basicInfo-outWarehouseSn" allowClear placeholder="请选择调出仓库" v-model="queryParam.outWarehouseSn">
-                  <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">{{ item.name }}</a-select-option>
-                </a-select>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="单号">
+                <a-input id="warehousingAuditList-allocationWarehouseNo" v-model.trim="queryParam.allocationWarehouseNo" allowClear placeholder="请输入单号"/>
               </a-form-item>
             </a-col>
-            <a-col :md="4" :sm="24">
-              <a-form-item label="调仓库">
-                <a-select id="warehouseAllocation-basicInfo-putWarehouseSn" allowClear placeholder="请选择调入仓库" v-model="queryParam.putWarehouseSn">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="调仓库">
+                <a-select id="warehouseAllocation-basicInfo-outWarehouseSn" allowClear placeholder="请选择调出仓库" v-model="queryParam.outWarehouseSn">
                   <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">{{ item.name }}</a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
-              <a-col :md="4" :sm="24">
+              <a-col :md="6" :sm="24">
+                <a-form-item label="调入仓库">
+                  <a-select id="warehouseAllocation-basicInfo-putWarehouseSn" allowClear placeholder="请选择调入仓库" v-model="queryParam.putWarehouseSn">
+                    <a-select-option v-for="(item, index) in warehouseList" :key="index" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
                 <a-form-item label="业务状态">
                   <v-select
                     v-model="queryParam.state"
@@ -148,7 +153,8 @@ export default {
         endDate: getDate.getCurrMonthDays().endtime,
         outWarehouseSn: undefined, //  调出仓库
         putWarehouseSn: undefined, //  调入仓库
-        state: undefined //  审核状态
+        state: undefined, //  审核状态
+        allocationWarehouseNo: undefined// 单号
       },
       disabled: false, //  查询、重置按钮是否可操作
       // 加载数据方法 必须为 Promise 对象
@@ -237,6 +243,7 @@ export default {
       this.queryParam.outWarehouseSn = undefined
       this.queryParam.putWarehouseSn = undefined
       this.queryParam.state = undefined
+      this.queryParam.allocationWarehouseNo = undefined
       if (!flag) {
         this.setIsHomeNav(this.$route.name, null)
       }

+ 34 - 3
src/views/bulkManagement/bulkReturnGoods/edit.vue

@@ -136,7 +136,14 @@
               </a-form>
             </div>
           </a-col>
-          <a-col :span="7" style="text-align: right;"></a-col>
+          <a-col :span="7" style="text-align: right;">
+            <a-button
+              class="button-error"
+              type="primary"
+              @click="bulkReturnGoodsDelAll"
+              :loading="delLoading"
+              ghost>清空列表 </a-button>
+          </a-col>
         </a-row>
         <!-- 列表 -->
         <s-table
@@ -209,7 +216,8 @@ import {
   sparePartsRetDetailDel,
   sparePartsRetSubmit,
   sparePartsRetDetailPrint,
-  sparePartsRetDetailExport } from '@/api/sparePartsRet'
+  sparePartsRetDetailExport,
+  sparePartsRetDetailClear } from '@/api/sparePartsRet'
 export default {
   name: 'BulkReturnGoodsEdit',
   components: { STable, VSelect, Print },
@@ -289,7 +297,8 @@ export default {
       },
       localDataSource: [],
       productTotal: null, //  合计
-      warehouseList: [] // 仓库列表
+      warehouseList: [], // 仓库列表
+      delLoading: false
     }
   },
   methods: {
@@ -402,6 +411,28 @@ export default {
         }
       })
     },
+    // 清空列表
+    bulkReturnGoodsDelAll () {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要清空已选产品列表吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          sparePartsRetDetailClear({ sparePartsReturnSn: _this.$route.params.sn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.$refs.chooseTable.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
     //  提交
     handleSubmit () {
       const _this = this

+ 34 - 3
src/views/bulkManagement/bulkReturnGoods/grabEdit.vue

@@ -119,7 +119,14 @@
               </a-form>
             </div>
           </a-col>
-          <a-col :span="7" style="text-align: right;"></a-col>
+          <a-col :span="7" style="text-align: right;">
+            <a-button
+              class="button-error"
+              type="primary"
+              @click="bulkReturnGoodsDelAll"
+              :loading="delLoading"
+              ghost>清空列表 </a-button>
+          </a-col>
         </a-row>
         <!-- 列表 -->
         <s-table
@@ -192,7 +199,8 @@ import {
   sparePartsRetDetailDel,
   sparePartsRetSubmit,
   sparePartsRetDetailPrint,
-  sparePartsRetDetailExport } from '@/api/sparePartsRet'
+  sparePartsRetDetailExport,
+  sparePartsRetDetailClear } from '@/api/sparePartsRet'
 export default {
   name: 'BulkReturnGoodsgrabEdit',
   components: { STable, VSelect, Print },
@@ -273,7 +281,8 @@ export default {
       },
       localDataSource: [],
       productTotal: null, //  合计
-      warehouseList: [] // 仓库列表
+      warehouseList: [], // 仓库列表
+      delLoading: false
     }
   },
   methods: {
@@ -387,6 +396,28 @@ export default {
         }
       })
     },
+    // 清空列表
+    bulkReturnGoodsDelAll () {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要清空已选产品列表吗',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          sparePartsRetDetailClear({ sparePartsReturnSn: _this.$route.params.sn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.$refs.chooseTable.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
     //  提交
     handleSubmit () {
       const _this = this

+ 7 - 4
src/views/bulkManagement/bulkWarehousingOrder/edit.vue

@@ -196,10 +196,13 @@
                         :loading="delLoading"
                         id="bulkWarehousingOrderEdit-del-all">导入产品</a-button>
                       <a-button
-                        type="link"
+                        type="primary"
+                        ghost
+                        :disabled="chooseLoadDataSource.length==0"
+                        style="margin-left: 10px"
                         @click="delBulkOrder"
                         :loading="delLoading"
-                        id="bulkWarehousingOrderEdit-del-all">整单删除</a-button>
+                        id="bulkWarehousingOrderEdit-del-all">清空列表</a-button>
                     </a-col>
                   </a-row>
                 </a-form>
@@ -655,12 +658,12 @@ export default {
         }
       })
     },
-    // 整单删除
+    // 清空列表
     delBulkOrder () {
       const _this = this
       this.$confirm({
         title: '提示',
-        content: '删除后不可恢复,确认删除所有已选产品吗?',
+        content: '确认要清空已选产品列表吗?',
         centered: true,
         closable: true,
         onOk () {

+ 1 - 1
src/views/chainReportData/chainCustomerReport/list.vue

@@ -210,7 +210,7 @@ export default {
         { title: '连锁门店', dataIndex: 'dealerName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '客户名称', dataIndex: 'salesTargetName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, sorter: true },
         { title: '客户类型', dataIndex: 'customerTypeName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '交易金额', dataIndex: 'totalAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') }, sorter: true }
+        { title: '交易金额', dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') }, sorter: true }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
         arr.splice(5, 0, { title: '毛利', dataIndex: 'totalGrossProfit', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })

+ 9 - 6
src/views/chainReportData/chainSalesDetailReport/list.vue

@@ -143,13 +143,14 @@
     <!-- 合计 -->
     <a-alert type="info" style="margin-bottom:10px">
       <div class="ftext" slot="message">
-        产品总数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
+        产品总数量:<strong>{{ (totalData && (totalData.productQty || totalData.productQty==0)) ? totalData.productQty : '--' }}</strong>;
         <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
           总成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? toThousands(totalData.totalCost) : '--' }}</strong>;
         </div>
-        总售价:<strong>{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? toThousands(totalData.totalPrice) : '--' }}</strong>;
+        总售价:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</strong>;
+        折后总售价:<strong>{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? toThousands(totalData.discountedAmount) : '--' }}</strong>;
         <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
-          总毛利:<strong>{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? toThousands(totalData.totalProfit) : '--' }}</strong>。
+          总毛利:<strong>{{ (totalData && (totalData.grossProfit || totalData.grossProfit==0)) ? toThousands(totalData.grossProfit) : '--' }}</strong>。
         </div>
       </div>
     </a-alert>
@@ -269,13 +270,15 @@ export default {
         { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '数量', dataIndex: 'productQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '成本', dataIndex: 'productCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'productPrice', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '总售价', dataIndex: 'totalAmount', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '折扣金额', dataIndex: 'discountAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '折后总售价', dataIndex: 'discountedAmount', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         // { title: '毛利', dataIndex: 'productProfit', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '审核时间', dataIndex: 'salesAuditDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(8, 0, { title: '成本', dataIndex: 'productCost', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(10, 0, { title: '毛利', dataIndex: 'productProfit', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(8, 0, { title: '成本', dataIndex: 'totalCost', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(12, 0, { title: '毛利', dataIndex: 'grossProfit', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }

+ 6 - 3
src/views/chainReportData/chainSalesReport/list.vue

@@ -114,7 +114,8 @@
         <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
           总成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? toThousands(totalData.totalCost) : '--' }}</strong>;
         </div>
-        总售价:<strong>{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? toThousands(totalData.totalPrice) : '--' }}</strong>;
+        总售价:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</strong>;
+        折后总售价:<strong>{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? toThousands(totalData.discountedAmount) : '--' }}</strong>;
         <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
           总毛利:<strong>{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? toThousands(totalData.totalProfit) : '--' }}</strong>。
         </div>
@@ -215,14 +216,16 @@ export default {
         { title: '款数', dataIndex: 'totalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '成本', dataIndex: 'totalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'totalPrice', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '总售价', dataIndex: 'totalAmount', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '折扣金额', dataIndex: 'discountAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '折后总售价', dataIndex: 'discountedAmount', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         // { title: '毛利', dataIndex: 'totalProfit', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '业务员', dataIndex: 'salesManName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '审核时间', dataIndex: 'salesAuditDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
         arr.splice(6, 0, { title: '成本', dataIndex: 'totalCost', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(8, 0, { title: '毛利', dataIndex: 'totalProfit', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(10, 0, { title: '毛利', dataIndex: 'totalProfit', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }

+ 3 - 1
src/views/common/printPanel.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="print-page-header">
-        <a-popover :placement="position">
+        <a-popover :placement="position" v-model="hovered" trigger="hover">
             <template slot="content">
                 <div style="padding:10px;">
                     <span>打印方式:</span>
@@ -73,6 +73,7 @@
     },
     data () {
       return {
+        hovered: false,
         printerType: 'NEEDLE' // 打印机类型
       }
     },
@@ -80,6 +81,7 @@
       handlePrint (type) {
         this.$store.dispatch('TogglePrintSettingType', this.printerType)
         this.$emit('handlePrint', type, this.printerType)
+        // this.hovered = false
       }
     }
   }

+ 2 - 14
src/views/common/shopingCatModal.vue

@@ -7,7 +7,7 @@
     :get-container="false"
     :wrap-style="{ position: 'absolute' }"
     @close="onClose"
-    wrapClassName="shopingCat-drawer">
+    wrapClassName="shopingCat-drawer jg-drawer-wrap">
      <div slot="title">
        <strong>{{title}}</strong>
        <span style="color: #ed1c24;;margin-left:10px;font-size: 12px;">注意:仅可添加本供应商有经销权且总部已上线的产品</span>
@@ -84,18 +84,6 @@ export default {
       height: 100%;
     }
   }
-  .table-page-search-wrapper{
-    .ant-form.ant-form-inline .ant-form-item .ant-input, .ant-form.ant-form-inline .ant-form-item .ant-select-selection{
-      border:0;
-    }
-    .ant-form.ant-form-inline .ant-form-item{
-      border:1px solid #dadada;
-      border-radius: 3px;
-      .ant-form-item-label{
-        padding-left: 11px;
-        padding-right: 0!important;
-      }
-    }
-  }
+  
 }
 </style>

+ 2 - 2
src/views/inventoryManagement/inventoryChecking/selfDisk.vue

@@ -178,7 +178,7 @@
               class="button-error"
               style="margin-left: 5px"
               @click.stop="handleDel('', 'all')"
-              id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
+              id="chainTransferOutEdit-del-all-btn">清空列表</a-button>
           </a-col>
         </a-row>
         <!-- 列表 -->
@@ -461,7 +461,7 @@ export default {
         }
         content = '删除后不可恢复,确定要进行批量删除吗?'
       } else if (isAll == 'all') { // 全部
-        content = '删除后不可恢复,确定要进行整单删除吗?'
+        content = '删除后不可恢复,确定要清空列表吗?'
       } else { // 单个
         content = '删除后不可恢复,确定要进行删除吗?'
       }

+ 3 - 3
src/views/inventoryManagement/inventoryWarning/chooseImportModal.vue

@@ -100,14 +100,14 @@ export default {
         { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: '26%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '在途数(个)', dataIndex: 'inTransit', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '在途数(个)', dataIndex: 'inTransit', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '最大库存数(个)', dataIndex: 'upperLimit', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '最小库存数(个)', dataIndex: 'lowerLimit', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ],
       nowUnColumns: [ //  不可导入
         { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '在途数(个)', dataIndex: 'inTransit', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '在途数(个)', dataIndex: 'inTransit', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '最大库存数(个)', dataIndex: 'upperLimit', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '最小库存数(个)', dataIndex: 'lowerLimit', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '错误原因', scopedSlots: { customRender: 'errorMsg' }, width: '10%', align: 'center' }
@@ -147,7 +147,7 @@ export default {
       } else {
         this.spinning = true
         stockWarnBatchImport(this.loadData).then(res => {
-          if(res.status == 200){
+          if (res.status == 200) {
             this.$emit('ok', this.loadData)
             this.isShow = false
           }

+ 3 - 3
src/views/inventoryManagement/inventoryWarning/importGuideModal.vue

@@ -15,7 +15,7 @@
             <span>1</span>准备导入
           </div>
           <ul>
-            <li>1)导入的Excel文件中必须包含名称为“产品编码”、"在途数(个)”、“最大库存数(个)”、“最小库存数(个)”的列,且名称必须相同,其他列可自定义,不影响数据导入</li>
+            <li>1)导入的Excel文件中必须包含名称为“产品编码”、“最大库存数(个)”、“最小库存数(个)”的列,且名称必须相同,其他列可自定义,不影响数据导入</li>
             <li><a :href="templUrl"><a-icon type="download" />下载导入模板</a></li>
           </ul>
         </div>
@@ -85,7 +85,7 @@ export default {
       uploadParams: {
         savePathType: 'local'
       },
-      templUrl: location.protocol + '//' +location.host + '/templ/库存预警产品导入模板.xlsx'
+      templUrl: location.protocol + '//' + location.host + '/templ/库存预警产品导入模板.xlsx'
     }
   },
   methods: {
@@ -116,7 +116,7 @@ export default {
     handleClose () {
       this.openImportModal = false
       this.isShow = false
-    },
+    }
   },
   watch: {
     //  父页面传过来的弹框状态

+ 3 - 3
src/views/inventoryManagement/inventoryWarning/list.vue

@@ -107,7 +107,7 @@
           <span v-else>--</span>
         </template>
         <!-- 在途数 -->
-        <template slot="inTransit" slot-scope="text, record" >
+        <!-- <template slot="inTransit" slot-scope="text, record" >
           <div>
             <a-input-number
               id="inventoryWarningList-inTransit"
@@ -120,7 +120,7 @@
               @change="numChange(record)"
               placeholder="请输入在途数" />
           </div>
-        </template>
+        </template> -->
         <!-- 最大库存数 -->
         <template slot="upperLimit" slot-scope="text, record" >
           <div>
@@ -216,7 +216,7 @@ export default {
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品品牌', dataIndex: 'brandName', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 120, align: 'center' },
-        { title: '在途数(个)', scopedSlots: { customRender: 'inTransit' }, width: 80, align: 'center' },
+        { title: '在途数(个)', dataIndex: 'inTransit', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总库存数(个)', dataIndex: 'currentStockQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '最大库存数(个)', scopedSlots: { customRender: 'upperLimit' }, width: 100, align: 'center' },
         { title: '最小库存数(个)', scopedSlots: { customRender: 'lowerLimit' }, width: 100, align: 'center' },

+ 1 - 1
src/views/notice/detailModal.vue

@@ -7,7 +7,7 @@
     title="公告详情"
     v-model="isShow"
     @cancel="isShow=false"
-    :width="800">
+    width="80%">
     <div v-if="detailsData">
       <a-descriptions bordered size="small" :column="2">
         <a-descriptions-item label="类别">{{ typeDictValue }}</a-descriptions-item>

+ 208 - 0
src/views/productManagement/productInfoJg/chooseImportModal.vue

@@ -0,0 +1,208 @@
+<template>
+  <a-modal
+    centered
+    class="chooseImport-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="导入"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="900">
+    <div class="chooseImport-con">
+      <!-- 可导入数据 -->
+      <p class="">可导入数据{{ loadData.length }}条</p>
+      <a-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.shelfSn"
+        :columns="nowColumns"
+        :dataSource="loadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <a-divider />
+      <!-- 不可导入数据 -->
+      <p class="red">不可导入数据{{ unLoadData.length }}条</p>
+      <a-table
+        class="sTable unTable"
+        ref="unTable"
+        size="small"
+        :rowKey="(record) => record.errorDesc"
+        :columns="nowUnColumns"
+        :dataSource="unLoadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+        <!-- <template slot="errorMsg" slot-scope="text,record">
+          <a-popover placement="topRight">
+            <template slot="content">
+              <p v-for="d in record.importErrorMsgSet" v-if="d">{{ d }};</p>
+            </template>
+            <a-button type="link">
+              查看
+            </a-button>
+          </a-popover>
+        </template> -->
+      </a-table>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="chooseImport-submit"
+          size="large"
+          :class="loadData.length==0?'button-grey':'button-primary'"
+          @click="handleSubmit"
+          style="padding: 0 40px;">确认导入</a-button>
+        <a-button
+          id="chooseImport-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"
+          size="large"
+          class="button-error"
+          @click="handleError"
+          style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { productImportPrice, productExportError, productImportPriceInsertBatch } from '@/api/product'
+import { hdExportExcel } from '@/libs/exportExcel'
+export default {
+  name: 'ChooseImportModal',
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    paramsData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    const _this = this
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      nowColumns: [ //  可导入
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '26%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        // { title: '在途数(个)', dataIndex: 'inTransit', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '自定义终端价', dataIndex: 'terminalPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '自定义车主价', dataIndex: 'carOwnersPrice', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+      ],
+      nowUnColumns: [ //  不可导入
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '在途数(个)', dataIndex: 'inTransit', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '自定义终端价', dataIndex: 'terminalPrice', width: '10%', align: 'right', customRender: function (text) { return (text ? parseInt(text) ? _this.toThousands(text) : text : '--') } },
+        { title: '自定义车主价', dataIndex: 'carOwnersPrice', width: '10%', align: 'right', customRender: function (text) { return (text ? parseInt(text) ? _this.toThousands(text) : text : '--') } },
+        { title: '备注', dataIndex: 'errorMsg', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
+        // scopedSlots: { customRender: 'errorMsg' },
+      ],
+      loadData: [],
+      unLoadData: [],
+      loading: false
+    }
+  },
+  methods: {
+    getData () {
+      const _this = this
+      this.loading = true
+      productImportPrice(this.paramsData).then(res => {
+        this.loading = false
+        if (res.status == 200) {
+          if (res.data.rightList && res.data.rightList.length > 0) {
+            res.data.rightList.map((item, index) => {
+              item.no = index + 1
+            })
+          }
+          if (res.data.errorList && res.data.errorList.length > 0) {
+            res.data.errorList.map((item, index) => {
+              item.no = index + 1
+              item.importErrorMsgSet = item.errorMsg ? item.errorMsg.split(';') : []
+            })
+          }
+          _this.loadData = res.data.rightList || []
+          _this.unLoadData = res.data.errorList || []
+        }
+      })
+    },
+    // 确认导入
+    handleSubmit () {
+      if (this.loadData.length == 0) {
+        this.$message.warning('暂无可导入产品!')
+      } else {
+        this.spinning = true
+        productImportPriceInsertBatch(this.loadData).then(res => {
+          if (res.status == 200) {
+            this.$emit('ok', this.loadData)
+            this.isShow = false
+          }
+          this.spinning = false
+        })
+      }
+    },
+    // 导出错误项
+    handleError () {
+      const _this = this
+      if (_this.unLoadData.length < 1) {
+        _this.$message.info('暂无可导出错误项~')
+        return
+      }
+      _this.spinning = true
+      hdExportExcel(productExportError, _this.unLoadData, '库存预警产品导入错误项', function () {
+        _this.spinning = false
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.loadData = []
+        this.unLoadData = []
+      } else {
+        this.getData()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseImport-modal{
+    .chooseImport-con{
+      .red{
+        color: #f30;
+      }
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel,.button-error{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 185 - 0
src/views/productManagement/productInfoJg/importGuideModal.vue

@@ -0,0 +1,185 @@
+<template>
+  <a-modal
+    centered
+    class="importGuide-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="导入产品"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="750">
+    <div class="importGuide-con">
+      <div class="explain-con">
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>1</span>准备导入
+          </div>
+          <ul>
+            <li>1)导入的Excel文件中必须包含名称为“产品编码”、“自定义终端价”、“自定义车主价”的列,且名称必须相同,其他列可自定义,不影响数据导入</li>
+            <li>2)如果导入的产品已经存在,则按照更新处理</li>
+            <li><a :href="templUrl"><a-icon type="download" />下载导入模板</a></li>
+          </ul>
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>2</span>上传数据文件
+          </div>
+          <p>目前支持的文件类型*.xls,*.xlsx.</p>
+          <div style="overflow: hidden;padding-left: 23px;">
+            <Upload
+              id="importGuide-attachList"
+              ref="importUpload"
+              :maxNums="1"
+              fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
+              uploadType="import"
+              :action="attachAction"
+              :uploadParams="uploadParams"
+              upText="选择导入文件"
+              @change="changeImport"></Upload>
+          </div>
+        </div>
+      </div>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="importGuide-nextStep"
+          size="large"
+          class="button-primary"
+          @click="handlerNextStep"
+          style="padding: 0 60px;">下一步</a-button>
+        <a-button
+          id="importGuide-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+    <!-- 导入 -->
+    <chooseImportModal :openModal="openImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
+  </a-modal>
+</template>
+
+<script>
+import ChooseImportModal from './chooseImportModal.vue'
+import { Upload } from '@/components'
+export default {
+  name: 'ImportGuideModal',
+  components: { ChooseImportModal, Upload },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    params: {
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      openImportModal: false, //  导入
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
+      paramsData: null,
+      uploadParams: {
+        savePathType: 'local'
+      },
+      templUrl: location.protocol + '//' + location.host + '/templ/产品信息管理(箭冠)自定义报价导入模板.xlsx'
+    }
+  },
+  methods: {
+    // 下一步
+    handlerNextStep () {
+      if (this.paramsData) {
+        this.openImportModal = true
+      } else {
+        this.$message.warning('添加文件后再进行下一步操作!')
+      }
+    },
+    // 上传文件  change
+    changeImport (file) {
+      if (file) {
+        this.paramsData = {
+          path: file
+        }
+      }
+    },
+    // 导入
+    hanldeOk (obj) {
+      if (obj && obj.length > 0) {
+        this.$emit('ok', obj)
+        this.isShow = false
+      }
+    },
+    // 关闭
+    handleClose () {
+      this.openImportModal = false
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.paramsData = null
+        this.$refs.importUpload.setFileList('')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .importGuide-modal{
+    .importGuide-con{
+      .explain-con{
+        .explain-item{
+          margin-bottom: 10px;
+          .explain-tit{
+            font-weight: bold;
+            span{
+              display: inline-block;
+              width: 18px;
+              height: 18px;
+              line-height: 16px;
+              text-align: center;
+              margin-right: 5px;
+              border-radius: 50%;
+              border: 1px solid rgba(0, 0, 0, 0.3);
+            }
+          }
+          p{
+            margin: 8px 0;
+            padding-left: 23px;
+          }
+          ul{
+            list-style: none;
+            padding: 0;
+            padding-left: 23px;
+            margin: 0;
+            li{
+              line-height: 26px;
+            }
+          }
+        }
+        #importGuide-attachList{
+          width: 100%;
+        }
+      }
+      .btn-con{
+        margin: 10px 0 20px;
+        text-align: center;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 56 - 43
src/views/productManagement/productInfoJg/list.vue

@@ -51,7 +51,7 @@
     <!-- 操作按钮 -->
     <div class="table-operator" v-if="$hasPermissions('B_JgProduct_enable')">
       <a-row :gutter="16">
-        <a-col class="gutter-row" :span="12">
+        <a-col class="gutter-row" :span="8">
           <a-dropdown>
             <a-menu slot="overlay" @click="handleMenuClick">
               <a-menu-item key="1"> 批量启用</a-menu-item>
@@ -61,46 +61,37 @@
           </a-dropdown>
           <span v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys">已选 {{ rowSelectionInfo.selectedRowKeys.length }} 项</span>
         </a-col>
-        <a-col class="gutter-row" :span="12">
-          <div class="setTableList">
-            <a-checkbox v-model="isTerminalPrice">
-              自定义终端价
-            </a-checkbox>
-            <a-checkbox v-model="isCarOwnersPrice">
-              自定义车主价
-            </a-checkbox>
-          </div>
-          <!-- <div class="setTableList">
-            <span @click="iconShowFlag=!iconShowFlag">列表显示配置</span>
-            <a-icon :type="iconShowFlag?'up':'down'" :style="{ color: '#d5d5d5' }" @click="iconShowFlag=!iconShowFlag"/>
-            <div class="setTableList-box" v-show="iconShowFlag">
-              <a-checkbox-group @change="onChangeList" :value="chooseShowList">
-                <div>
-                  <a-checkbox value="A">
-                    省级价
+        <a-col class="gutter-row " :span="16" style="text-align: right;">
+          <a-popover trigger="hover" placement="bottom">
+            <template slot="content">
+              <div class="setTableList">
+                <p>
+                  <a-checkbox v-model="isTerminalPrice">
+                    自定义终端价
                   </a-checkbox>
-                </div>
-                <div><a-checkbox value="B">
-                  市级建议价
-                </a-checkbox></div>
-                <div><a-checkbox value="C">
-                  特约建议价
-                </a-checkbox></div>
-                <div><a-checkbox value="D">
-                  建议终端价
-                </a-checkbox></div>
-                <div> <a-checkbox value="E">
-                  建议车主价
-                </a-checkbox></div>
-                <div> <a-checkbox value="F">
-                  自定义终端价
-                </a-checkbox></div>
-                <div><a-checkbox value="G">
+                </p>
+                <a-checkbox v-model="isCarOwnersPrice">
                   自定义车主价
-                </a-checkbox></div>
-              </a-checkbox-group>
-            </div>
-          </div> -->
+                </a-checkbox>
+              </div>
+            </template>
+            <a-button type="link" class="button-default">
+              <a-icon type="setting" />
+              显示
+            </a-button>
+          </a-popover>
+          <a-divider type="vertical" style="margin:5px 0;"/>
+          <a-dropdown>
+            <a-menu slot="overlay" @click="handleActions">
+              <a-menu-item key="2">
+                <a-icon type="export" />自定义报价导出
+              </a-menu-item>
+              <a-menu-item key="1">
+                <a-icon type="import" />自定义报价导入
+              </a-menu-item>
+            </a-menu>
+            <a-button type="link" class="button-default"> <a-icon type="unordered-list" />  更多</a-button>
+          </a-dropdown>
         </a-col>
       </a-row>
     </div>
@@ -160,6 +151,8 @@
           id="productInfoList-price-btn">自定义报价</a-button>
       </template>
     </s-table>
+    <!-- 导入产品 -->
+    <importGuideModal :openModal="openGuideModal" @close="openGuideModal=false" @ok="resetSearchForm" />
     <!-- 自定义报价弹窗 -->
     <editPriceModal :openModal="openEditPriceModal" :itemId="itemId" @ok="searchForm" @close="openEditPriceModal=false"></editPriceModal>
   </a-card>
@@ -167,15 +160,16 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { productList, getCurrentDealer, productUpdate } from '@/api/product'
+import { productList, getCurrentDealer, productUpdate, productExportPrice } from '@/api/product'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
 import { STable, VSelect } from '@/components'
-// import { downloadExcel } from '@/libs/JGPrint.js'
+import { downloadExcel } from '@/libs/JGPrint.js'
 import editPriceModal from './editPriceModal.vue'
+import importGuideModal from './importGuideModal.vue'
 export default {
   name: 'ProductJgList',
-  components: { STable, VSelect, ProductType, ProductBrand, editPriceModal },
+  components: { STable, VSelect, ProductType, ProductBrand, editPriceModal, importGuideModal },
   mixins: [commonMixin],
   data () {
     return {
@@ -194,6 +188,7 @@ export default {
         onlineFalg: '',
         enabledFlag: '1'
       },
+      openGuideModal: false,
       isTerminalPrice: false,
       isCarOwnersPrice: false,
       openEditPriceModal: false, // 自定义报价弹窗
@@ -396,6 +391,25 @@ export default {
       this.$nextTick(() => {
         _this.openEditPriceModal = true
       })
+    },
+    // 导入导出
+    handleActions (e) {
+      if (e.key == 1) {
+        this.openGuideModal = true
+      } else {
+        this.handleExport()
+      }
+    },
+    handleExport () {
+      const _this = this
+      const params = _this.queryParam
+      _this.exportLoading = true
+      _this.spinning = true
+      productExportPrice(params).then(res => {
+        downloadExcel(res, '产品信息管理(箭冠)')
+        _this.exportLoading = false
+        _this.spinning = false
+      })
     }
   },
   watch: {
@@ -408,7 +422,6 @@ export default {
     '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
       this.setTableH()
     }
-
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用

+ 9 - 21
src/views/purchasingManagement/purchaseOrderNew/chooseProductModal.vue

@@ -8,7 +8,7 @@
     :get-container="false"
     :wrap-style="{ position: 'absolute' }"
     @close="onClose"
-    wrapClassName="chooseProduct-drawer">
+    wrapClassName="chooseProduct-drawer jg-drawer-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="chooseProduct-drawer-box">
         <!-- 搜索条件 -->
@@ -144,7 +144,7 @@ export default {
     },
     width: {
       type: [String, Number],
-      default: '70%'
+      default: '80%'
     },
     zIndex: {
       type: Number,
@@ -216,12 +216,12 @@ export default {
       return this.queryParam.code || this.queryParam.name || this.queryParam.productBrandSn || this.queryParam.productTypeSn1
     },
     tableWidth () {
-      let w = 1100
+      let w = 1410
       if (this.isDealerUp) {
-        w = 1200
+        w = 1510
       }
       if (this.$hasPermissions('M_ShowAllCost')) {
-        w = this.isDealerUp ? 1200 : 1100
+        w = this.isDealerUp ? 1510 : 1410
       }
       return w
     },
@@ -230,7 +230,9 @@ export default {
       const arr = [
         { title: '产品编码', scopedSlots: { customRender: 'code' }, width: '150px', align: 'center', fixed: 'left' },
         { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        // { title: '原厂编码', dataIndex: 'origCode', width: '14%', align: 'center', customRender: function (text) { return text && text != ' ' ? text : '--' } },
+        { title: '原厂编码', dataIndex: 'origCode', width: '150px', align: 'center', customRender: function (text) { return text && text != ' ' ? text : '--' } },
+        { title: '在途数', dataIndex: 'transitQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '可用库存', dataIndex: 'currentStockQty', width: '80px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '产品图片', scopedSlots: { customRender: 'imageUrl' }, width: '80px', align: 'center' },
         { title: '单位', dataIndex: 'unit', width: '60px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '包装数', scopedSlots: { customRender: 'baozh' }, width: '60px', align: 'center' },
@@ -244,9 +246,8 @@ export default {
         arr.splice(2, 0, { title: '产品来源', dataIndex: 'sysFlagDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } })
       }
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(this.isDealerUp ? 3 : 2, 0, { title: '成本价', dataIndex: 'purchasePrice', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
+        arr.splice(this.isDealerUp ? 4 : 3, 0, { title: '成本价', dataIndex: 'purchasePrice', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
       }
-
       return arr
     }
   },
@@ -325,18 +326,5 @@ export default {
       text-align: center;
     }
   }
-  .table-page-search-wrapper{
-      .ant-form.ant-form-inline .ant-form-item .ant-input, .ant-form.ant-form-inline .ant-form-item .ant-select-selection{
-        border:0;
-      }
-      .ant-form.ant-form-inline .ant-form-item{
-        border:1px solid #dadada;
-        border-radius: 3px;
-        .ant-form-item-label{
-          padding-left: 11px;
-          padding-right: 0!important;
-        }
-      }
-    }
 }
 </style>

+ 76 - 84
src/views/purchasingManagement/purchaseOrderNew/detail.vue

@@ -1,37 +1,37 @@
 <template>
-  <div class="purchaseOrderDetail-wrap">
+  <div class="jg-page-wrap purchaseOrderDetail-wrap">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-page-header :ghost="false" :backIcon="false" class="purchaseOrderDetail-cont" :style="{ padding: !outBizSn ? '16px 24px' : '0px 24px' }">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <span class="billno">单号:{{ detail&&detail.purchaseBillNo }}</span>
-        <a-tag color="blue" v-if="detail&&detail.billStatusDictValue">{{ detail&&detail.billStatusDictValue }}</a-tag>
-        <a-tag color="orange" v-if="detail&&detail.financialStatusDictValue">{{ detail&&detail.financialStatusDictValue }}</a-tag>
-        <span v-if="detail&&detail.purchaseBillNoSource" style="font-size: 14px;margin: 0 10px;">(原:{{ detail&&detail.purchaseBillNoSource }})</span>
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <span class="billno">单号:{{ detail&&detail.purchaseBillNo }}</span>
+          <a-tag color="blue" v-if="detail&&detail.billStatusDictValue">{{ detail&&detail.billStatusDictValue }}</a-tag>
+          <a-tag color="orange" v-if="detail&&detail.financialStatusDictValue">{{ detail&&detail.financialStatusDictValue }}</a-tag>
+          <span v-if="detail&&detail.purchaseBillNoSource" style="font-size: 14px;margin: 0 10px;">(原:{{ detail&&detail.purchaseBillNoSource }})</span>
 
-        <a-button type="link" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo" style="margin-left:10px;vertical-align:middle;">
-          <a-icon :type="isShowBisiceInfo ? 'eye-invisible' : 'eye'"/>
-          查看信息
-        </a-button>
-        <a-button id="purchaseNewOrderEdit-back-btn" type="link" @click="handleBack" class="button-default"> <a-icon type="rollback" /> 返回列表</a-button>
-      </template>
-      <!-- 操作区,位于 title 行的行尾 -->
-      <template slot="extra">
-        <div style="margin-top: 5px;">
-          <PrintPanel position="bottomRight" v-if="$hasPermissions('B_purchasePrint')" :disabled="localDataSource.length==0" @handlePrint="handlePrint">
-            <a-button
-            slot="extendButtons"
-            key="4"
-            v-if="$hasPermissions('B_purchaseExportProduct') && (detail&&(detail.billStatus=='AUDIT_PASS' || detail.billStatus=='CANCEL' || detail.billStatus=='WAIT_PUT_WAREHOUSE' || detail.billStatus=='WAIT_PUT_WAREHOUSE_AUDIT' || detail.billStatus=='FINISH'))"
-            type="primary"
-            class="button-info"
-            id="purchaseOrderDetail-export-btn"
-            :disabled="localDataSource.length==0"
-            @click="handleExportProduct()">导出审核订单产品</a-button>
-          </PrintPanel>
-        </div>
-      </template>
-    </a-page-header>
+          <a-button type="link" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo" style="margin-left:10px;vertical-align:middle;">
+            <a-icon :type="isShowBisiceInfo ? 'eye-invisible' : 'eye'"/>
+            查看信息
+          </a-button>
+          <a-button id="purchaseNewOrderEdit-back-btn" type="link" @click="handleBack" class="button-default"> <a-icon type="rollback" /> 返回列表</a-button>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra">
+          <div style="margin-top: 5px;">
+            <PrintPanel position="bottomRight" v-if="$hasPermissions('B_purchasePrint')" :disabled="localDataSource.length==0" @handlePrint="handlePrint">
+              <a-button
+                slot="extendButtons"
+                key="4"
+                v-if="$hasPermissions('B_purchaseExportProduct') && (detail&&(detail.billStatus=='AUDIT_PASS' || detail.billStatus=='CANCEL' || detail.billStatus=='WAIT_PUT_WAREHOUSE' || detail.billStatus=='WAIT_PUT_WAREHOUSE_AUDIT' || detail.billStatus=='FINISH'))"
+                type="primary"
+                class="button-info"
+                id="purchaseOrderDetail-export-btn"
+                :disabled="localDataSource.length==0"
+                @click="handleExportProduct()">导出审核订单产品</a-button>
+            </PrintPanel>
+          </div>
+        </template>
+      </a-page-header>
 
       <!-- 基础信息 -->
       <a-card size="small" :bordered="false" class="purchaseOrderDetail-cont" v-show="isShowBisiceInfo">
@@ -55,39 +55,39 @@
       </a-card>
       <!-- 产品详情 -->
       <a-card size="small" :bordered="false" class="purchaseOrderDetail-cont">
-          <!-- <div slot="title" style="font-size:14px;"><strong>产品详情</strong></div> -->
-            <!-- 总计 -->
-            <div class="alert-message">
-              产品款数:<strong>{{ detail && (detail.totalCategory || detail.totalCategory==0) ? detail.totalCategory : '--' }}</strong>,
-              采购数量合计:<strong>{{ detail && (detail.totalQty || detail.totalQty==0) ? detail.totalQty : '--' }}</strong>,
-              审核订单数量:<strong>{{ detail && (detail.totalPushedQty || detail.totalPushedQty==0) ? detail.totalPushedQty : '--' }}</strong>,
-              已取消数量:<strong>{{ detail && (detail.totalCancelQty || detail.totalCancelQty==0) ? detail.totalCancelQty : '--' }}</strong>,
-              <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
-                采购金额合计:<strong>{{ detail && (detail.discountedAmount || detail.discountedAmount==0) ? toThousands(detail.discountedAmount,2) : '--' }}</strong>,
-                审核订单金额:<strong>{{ detail && (detail.totalPushedAmount || detail.totalPushedAmount==0) ? toThousands(detail.totalPushedAmount,2) : '--' }}</strong>,
-                已取消金额:<strong>{{ detail && (detail.totalCancelAmount || detail.totalCancelAmount==0) ? toThousands(detail.totalCancelAmount,2) : '--' }}</strong>
-              </div>
-            </div>
-            <!-- 列表 -->
-            <s-table
-              class="sTable"
-              ref="table"
-              size="small"
-              :rowKey="(record) => record.id"
-              :columns="columns"
-              :data="loadData"
-              :defaultLoadData="false"
-              bordered>
-              <!-- 采购数量 -->
-              <template slot="origqty" slot-scope="text, record">
-                <div>{{ text }}</div>
-                <div v-if="record.origqty">原采购数量:{{ record.origqty }}</div>
-              </template>
-              <!-- 已取消数量 -->
-              <template slot="outOfStockNum" slot-scope="text, record">
-                <span>{{ record.outOfStockNum }}</span>
-              </template>
-            </s-table>
+        <!-- <div slot="title" style="font-size:14px;"><strong>产品详情</strong></div> -->
+        <!-- 总计 -->
+        <div class="alert-message">
+          产品款数:<strong>{{ detail && (detail.totalCategory || detail.totalCategory==0) ? detail.totalCategory : '--' }}</strong>,
+          采购数量合计:<strong>{{ detail && (detail.totalQty || detail.totalQty==0) ? detail.totalQty : '--' }}</strong>,
+          审核订单数量:<strong>{{ detail && (detail.totalPushedQty || detail.totalPushedQty==0) ? detail.totalPushedQty : '--' }}</strong>,
+          已取消数量:<strong>{{ detail && (detail.totalCancelQty || detail.totalCancelQty==0) ? detail.totalCancelQty : '--' }}</strong>,
+          <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
+            采购金额合计:<strong>{{ detail && (detail.discountedAmount || detail.discountedAmount==0) ? toThousands(detail.discountedAmount,2) : '--' }}</strong>,
+            审核订单金额:<strong>{{ detail && (detail.totalPushedAmount || detail.totalPushedAmount==0) ? toThousands(detail.totalPushedAmount,2) : '--' }}</strong>,
+            已取消金额:<strong>{{ detail && (detail.totalCancelAmount || detail.totalCancelAmount==0) ? toThousands(detail.totalCancelAmount,2) : '--' }}</strong>
+          </div>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 采购数量 -->
+          <template slot="origqty" slot-scope="text, record">
+            <div>{{ text }}</div>
+            <div v-if="record.origqty">原采购数量:{{ record.origqty }}</div>
+          </template>
+          <!-- 已取消数量 -->
+          <template slot="outOfStockNum" slot-scope="text, record">
+            <span>{{ record.outOfStockNum }}</span>
+          </template>
+        </s-table>
       </a-card>
     </a-spin>
   </div>
@@ -138,7 +138,7 @@ export default {
   },
   computed: {
     columns () {
-      let _this=this
+      const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -153,9 +153,9 @@ export default {
         { title: '已取消数量', dataIndex: 'cancelQty', width: '7%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(5, 0, { title: '采购单价', dataIndex: 'discountedPrice', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text,2) : '--') } })
-        arr.splice(6, 0, { title: '采购金额', dataIndex: 'discountedAmount', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text,2) : '--') } })
-        arr.splice(8, 0, { title: '审核订单金额', dataIndex: 'pushedAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text,2) : '--') } })
+        arr.splice(5, 0, { title: '采购单价', dataIndex: 'discountedPrice', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
+        arr.splice(6, 0, { title: '采购金额', dataIndex: 'discountedAmount', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
+        arr.splice(8, 0, { title: '审核订单金额', dataIndex: 'pushedAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
       }
       return arr
     }
@@ -236,30 +236,22 @@ export default {
 }
 </script>
 
-<style lang="less">
+<style lang="less" scoped>
   .purchaseOrderDetail-wrap{
     .billno{
-      margin: 0 10px 0 0;
-      font-size: 16px;
-      font-weight: 600;
-      display: inline-block;
+      margin-right: 10px !important;
+    }
+    .ant-tag-blue,.ant-tag-orange{
       vertical-align: middle;
-      color: #333;
     }
     .purchaseOrderDetail-cont{
       margin-bottom: 10px;
-      .timeline-box{
-        margin-top: 30px;
-        .auxiliary-txt{
-          color: #808695;
-        }
-      }
-    }
-    .alert-message{
-      margin-bottom: 10px;
-      strong{
-        color: #f12929;
+      .alert-message{
+         margin-bottom: 10px;
       }
+     /deep/ .ant-descriptions-title{
+          margin-bottom: 10px;
+        }
     }
   }
 </style>

+ 18 - 99
src/views/purchasingManagement/purchaseOrderNew/edit.vue

@@ -1,6 +1,6 @@
 <template>
-  <div v-if="showPage" class="purchaseNewOrderEdit-wrap">
-    <a-page-header :ghost="false" :backIcon="false" class="purchaseNewOrderEdit-cont">
+  <div v-if="showPage" class="jg-page-wrap purchaseNewOrderEdit-wrap">
+    <a-page-header :ghost="false" :backIcon="false" class="header-bar">
       <!-- 自定义的二级文字标题 -->
       <template slot="subTitle">
         <p class="billno">单号:{{ detail&&detail.purchaseBillNo }}</p>
@@ -13,7 +13,7 @@
       <!-- 操作区,位于 title 行的行尾 -->
       <template slot="extra">
         <div style="margin-top: 5px;">
-          <PrintPanel v-if="$hasPermissions('B_purchasePrint')" :disabled="localDataSource.length==0" @handlePrint="handlePrint"></PrintPanel>
+          <PrintPanel ref="printBox" v-if="$hasPermissions('B_purchasePrint')" :disabled="localDataSource.length==0" @handlePrint="handlePrint"></PrintPanel>
           <a-divider type="vertical" v-if="detail&&detail.totalCategory" />
           <a-button type="link" v-if="detail&&detail.totalCategory" @click="showSearch=!showSearch" :class="showSearch?'button-error':'button-default'"> <a-icon type="search" /> 筛选</a-button>
           <a-divider type="vertical" v-if="detail&&detail.totalCategory" />
@@ -40,7 +40,7 @@
     <!-- 产品列表 -->
     <div ref="tableSearch" class="choosedList-cont">
       <!-- 基础信息 -->
-      <div style="padding:10px 10px 0 10px;border-bottom:6px solid #f0f0f0;" v-if="isShowBisiceInfo">
+      <div class="baseInfo-bar" v-if="isShowBisiceInfo">
         <a-descriptions size="small">
           <div slot="title">基础信息</div>
           <a-descriptions-item label="供应商">
@@ -65,7 +65,7 @@
         </a-descriptions>
       </div>
       <!-- 已选产品 -->
-      <div id="purchaseTable">
+      <div class="purchaseTable">
         <div class="choosed-table" v-if="detail&&detail.totalCategory">
           <!-- 搜索条件 -->
           <div class="table-page-search-wrapper" v-if="showSearch">
@@ -127,15 +127,15 @@
         </div>
       </div>
       <!-- 底部栏 -->
-      <div class="footer-cont" v-if="detail&&detail.totalCategory">
+      <div class="footer-bar" v-if="detail&&detail.totalCategory">
         <!-- 总计 -->
         <div>
-          <span style="color:#666;">
-            共计 {{ detail && (detail.totalCategory || detail.totalCategory==0) ? detail.totalCategory : '--' }} 款
-            {{ detail && (detail.totalQty || detail.totalQty==0) ? detail.totalQty : '--' }} 件产品 
-          </span>
+          <div style="display: inline-block;">
+            产品总款数:<span style="color:#666">{{ detail && (detail.totalCategory || detail.totalCategory==0) ? detail.totalCategory : '--' }}</span>,
+            采购总数量:<span style="color:#666">{{ detail && (detail.totalQty || detail.totalQty==0) ? detail.totalQty : '--' }}</span>
+          </div>
           <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
-            合计: <strong>{{ detail && (detail.discountedAmount || detail.discountedAmount==0) ?toThousands(detail.discountedAmount, 2) : '--' }}</strong>
+            采购金额合计: <strong>{{ detail && (detail.discountedAmount || detail.discountedAmount==0) ?toThousands(detail.discountedAmount, 2) : '--' }}</strong>
           </div>
         </div>
         <div>
@@ -147,7 +147,6 @@
             :loading="subLoading"
             @click="handleSubmit"
             style="padding: 0 60px;">提交</a-button>
-            <!-- <a-button id="purchaseNewOrderEdit-back-btn" type="link" @click="handleBack" class="button-default"> <a-icon type="rollback" /> 返回列表</a-button> -->
         </div>
       </div>
     </div>
@@ -267,7 +266,8 @@ export default {
       const arr = [
         { title: '序号', key: "a", field: 'no', width: '5%', align: 'center', operationColumn: false },
         { title: '产品编码',key: "b", field: 'productCode', width: '10%', align: 'center', operationColumn: false},
-        { title: '产品名称',key: "c", field: 'productName', width: '35%', align: 'center', operationColumn: false,ellipsis: {showTitle: true} },
+        { title: '产品名称',key: "c", field: 'productName', width: '25%', align: 'center', operationColumn: false,ellipsis: {showTitle: true} },
+        { title: '可用库存',key: "j", field: 'currentStockQty', width: '10%', align: 'center', operationColumn: false},
         { title: '采购数量',key: "d", width: '10%', align: 'center', operationColumn: false, 
         renderBodyCell: ({ row, column, rowIndex }, h) => {
             return <qtyComp row={row} column={column} rowIndex={rowIndex} that={_this} />
@@ -279,7 +279,7 @@ export default {
         }}
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(3, 0, { title: '采购单价',key: "h", field: 'discountedPriceText', width: '10%', align: 'right', operationColumn: false})
+        arr.splice(4, 0, { title: '采购单价',key: "h", field: 'discountedPriceText', width: '10%', align: 'right', operationColumn: false})
         arr.splice(6, 0, { title: '采购金额',key: "i", field: 'discountedAmountText', width: '10%', align: 'right', operationColumn: false})
       }
       return arr
@@ -314,6 +314,7 @@ export default {
             row.productUnit = row.dealerProductEntity.unit || '--'
             row.discountedPriceText = (row.discountedPrice||row.discountedPrice==0)?this.toThousands(row.discountedPrice, 2):'--'
             row.discountedAmountText = (row.discountedAmount||row.discountedAmount==0)?this.toThousands(row.discountedAmount, 2):'--'
+            row.currentStockQty = (row.currentStockQty||row.currentStockQty==0)?row.currentStockQty:'--'
           }
           this.localDataSource = data.list
           this.disabled = false
@@ -505,6 +506,7 @@ export default {
       // 打印或导出
       hdPrint(printerType, type, url, params, '采购单', function () {
         _this.$store.state.app.printLoading = false
+        _this.$refs.printBox.hovered = false
       })
     },
     //  返回列表
@@ -560,95 +562,12 @@ export default {
     position: relative;
     height: 100%;
     box-sizing: border-box;
-    .ant-descriptions-title{
-      margin-bottom: 10px;
-    }
-    .billno{
-      margin: 0;
-      font-size: 16px;
-      font-weight: 600;
-      display: inline-block;
-      vertical-align: middle;
-      color: #333;
-    }
+    
     .choosedList-cont{
       position: relative;
       background-color: #fff;
       height: calc(100% - 60px);
-      .chooseBox-title{
-        display:flex;
-        justify-content: space-between;
-        align-items: center;
-        border-top: 1px solid #eee;
-        border-bottom: 1px solid #eee;
-        padding: 8px 0;
-        .actions-button{
-          button{
-            margin-left: 10px;
-            margin-right: 10px;
-          }
-        }
-        .import-btn{
-          margin-left: 15px;
-        }
-        .sub-title{
-          font-size: 14px;
-          color: #333;
-          margin-left: 10px;
-          font-weight:bold;
-        }
-        .tag-txt{
-          font-size: 12px;
-          color: #ed1c24;
-          margin: 0 15px;
-        }
-      }
-      .choosed-table{
-        padding:10px;
-      }
-      .footer-cont{
-        position:absolute;
-        width:100%;
-        bottom:0;
-        display:flex;
-        justify-content: flex-end;
-        align-items: center;
-        padding: 8px;
-        border-top: 1px solid #eee;
-        > div{
-          &:first-child{
-            padding: 0 15px;
-            strong{
-              color: #ed1c24;
-              font-size: 18px;
-            }
-          }
-        }
-      }
-      .ant-input-number-sm input{
-        text-align: center;
-      }
-    }
-    .purchaseNewOrderEdit-cont{
-      margin-bottom: 6px;
-      .sub-title{
-        font-size: 12px;
-        color: #808695;
-        margin-left: 10px;
-      }
-    }
-    .table-page-search-wrapper{
-      .ant-form.ant-form-inline .ant-form-item .ant-input, .ant-form.ant-form-inline .ant-form-item .ant-select-selection{
-        border:0;
-      }
-      .ant-form.ant-form-inline .ant-form-item{
-        border:1px solid #dadada;
-        border-radius: 3px;
-        .ant-form-item-label{
-          padding-left: 11px;
-          padding-right: 0!important;
-        }
-      }
     }
+     
   }
 </style>

+ 4 - 19
src/views/purchasingManagement/purchaseOrderNew/list.vue

@@ -1,8 +1,8 @@
 <template>
-  <div class="purchaseNewOrderList-wrap">
-    <a-card size="small" :bordered="false" style="margin-bottom: 6px;">
+  <div class="purchaseNewOrderList-wrap jg-page-wrap">
+    <a-card size="small" :bordered="false" class="table-page-search-wrapper">
         <!-- 搜索条件 -->
-      <div ref="tableSearch" class="table-page-search-wrapper">
+      <div ref="tableSearch">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row type="flex" justify="start" :gutter="15">
             <a-col flex="350px">
@@ -386,20 +386,5 @@ export default {
 }
 </script>
 <style lang="less">
-  .purchaseNewOrderList-wrap{
-    .table-page-search-wrapper{
-      .ant-form.ant-form-inline .ant-form-item .ant-input, .ant-form.ant-form-inline .ant-form-item .ant-select-selection{
-        border:0;
-      }
-      .ant-form.ant-form-inline .ant-form-item{
-        border:1px solid #dadada;
-        border-radius: 3px;
-        overflow: hidden;
-        .ant-form-item-label{
-          padding-left: 11px;
-          padding-right: 0!important;
-        }
-      }
-    }
-  }
+   
 </style>

+ 2 - 14
src/views/purchasingManagement/purchaseOrderNew/outStockModal.vue

@@ -11,7 +11,7 @@
     wrapClassName="outStock-modal"
   >
     <a-spin :spinning="spinning" tip="Loading...">
-      <div class="outStock-con">
+      <div class="outStock-con jg-drawer-wrap">
         <div>
           <div ref="searchBox" class="table-page-search-wrapper">
             <a-form layout="inline" @keyup.enter.native="searchForm">
@@ -306,18 +306,6 @@ export default {
         padding: 10px 0;
       }
     }
-    .table-page-search-wrapper{
-      .ant-form.ant-form-inline .ant-form-item .ant-input, .ant-form.ant-form-inline .ant-form-item .ant-select-selection{
-        border:0;
-      }
-      .ant-form.ant-form-inline .ant-form-item{
-        border:1px solid #dadada;
-        border-radius: 3px;
-        .ant-form-item-label{
-          padding-left: 11px;
-          padding-right: 0!important;
-        }
-      }
-    }
+   
   }
 </style>

+ 3 - 3
src/views/purchasingManagement/purchaseReturn/edit.vue

@@ -102,7 +102,7 @@
                 class="button-error"
                 id="purchaseReturnEdit-delAll-btn"
                 @click.stop="handleDel('', 'all')"
-                style="margin-right: 10px;float: right;">整单删除</a-button>
+                style="margin-right: 10px;float: right;">清空列表</a-button>
             </template>
             <!-- 列表 -->
             <s-table
@@ -330,13 +330,13 @@ export default {
     //  删除
     handleDel (row, isAll) {
       const _this = this
-      const content = isAll ? '删除后不可恢复,确定要进行整单删除吗?' : '删除后不可恢复,确定要进行删除吗?'
+      const content = isAll ? '删除后不可恢复,确定要清空列表吗?' : '删除后不可恢复,确定要进行删除吗?'
       this.$confirm({
         title: '提示',
         content: content,
         centered: true,
         onOk () {
-          if (isAll) { //  整单删除
+          if (isAll) { //  清空列表
             _this.spinning = true
             purchaseReturnDelAll({ purchaseReturnSn: _this.$route.params.sn }).then(res => {
               if (res.status == 200) {

+ 4 - 2
src/views/purchasingManagement/purchaseReturnApplyForm/edit.vue

@@ -137,10 +137,12 @@
                 >产品导入</a-button>
                 <a-button
                   type="primary"
+                  ghost
                   class="button-error"
                   id="purchaseReturnEdit-delAll-btn"
+                  :disabled="dataSource.length == 0"
                   @click.stop="handleDel('', 'all')"
-                >整单删除</a-button>
+                >清空列表</a-button>
               </div>
             </div>
             <!-- 列表 -->
@@ -428,7 +430,7 @@ export default {
         this.$message.info('没有可删除的产品')
         return
       }
-      const content = isAll ? '删除后不可恢复,确定要进行整单删除吗?' : '删除后不可恢复,确定要进行删除吗?'
+      const content = isAll ? '确定要清空已选产品列表吗?' : '删除后不可恢复,确定要进行删除吗?'
       this.$confirm({
         title: '提示',
         content: content,

+ 3 - 3
src/views/purchasingManagement/purchaseReturnOutSync/edit.vue

@@ -114,7 +114,7 @@
                 class="button-error"
                 id="purchaseReturnEdit-delAll-btn"
                 @click.stop="handleDel('', 'all')"
-                style="margin-right: 10px;float: right;">整单删除</a-button> -->
+                style="margin-right: 10px;float: right;">清空列表</a-button> -->
             </template>
             <!-- 总计 -->
             <a-alert type="info" style="margin-bottom:10px">
@@ -404,13 +404,13 @@ export default {
     //  删除
     handleDel (row, isAll) {
       const _this = this
-      const content = isAll ? '删除后不可恢复,确定要进行整单删除吗?' : '删除后不可恢复,确定要进行删除吗?'
+      const content = isAll ? '删除后不可恢复,确定要清空列表吗?' : '删除后不可恢复,确定要进行删除吗?'
       this.$confirm({
         title: '提示',
         content: content,
         centered: true,
         onOk () {
-          if (isAll) { //  整单删除
+          if (isAll) { //  清空列表
             _this.spinning = true
             purchaseReturnDelAll({ purchaseReturnSn: _this.$route.params.sn }).then(res => {
               if (res.status == 200) {

+ 3 - 3
src/views/purchasingManagement/purchaseReturnOutSync/grapEdit.vue

@@ -104,7 +104,7 @@
                 class="button-error"
                 id="purchaseReturnEdit-delAll-btn"
                 @click.stop="handleDel('', 'all')"
-                style="margin-right: 10px;float: right;">整单删除</a-button> -->
+                style="margin-right: 10px;float: right;">清空列表</a-button> -->
             </template>
             <!-- 总计 -->
             <a-alert type="info" style="margin-bottom:10px">
@@ -394,13 +394,13 @@ export default {
     //  删除
     handleDel (row, isAll) {
       const _this = this
-      const content = isAll ? '删除后不可恢复,确定要进行整单删除吗?' : '删除后不可恢复,确定要进行删除吗?'
+      const content = isAll ? '删除后不可恢复,确定要清空列表吗?' : '删除后不可恢复,确定要进行删除吗?'
       this.$confirm({
         title: '提示',
         content: content,
         centered: true,
         onOk () {
-          if (isAll) { //  整单删除
+          if (isAll) { //  清空列表
             _this.spinning = true
             purchaseReturnDelAll({ purchaseReturnSn: _this.$route.params.sn }).then(res => {
               if (res.status == 200) {

+ 2 - 1
src/views/reportData/bulkReturnReport/detailList.vue

@@ -183,11 +183,12 @@ export default {
         { title: '产品名称', dataIndex: 'productEntity.name', width: '14%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '数量', dataIndex: 'purchaseQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货价', dataIndex: 'productTotalPrice', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         // { title: '成本', dataIndex: 'purchaseTotalCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '审核时间', dataIndex: 'auditTime', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(7, 0, { title: '成本', dataIndex: 'purchaseTotalCost', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(8, 0, { title: '成本', dataIndex: 'purchaseTotalCost', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }

+ 2 - 1
src/views/reportData/bulkReturnReport/list.vue

@@ -141,11 +141,12 @@ export default {
         { title: '供应商', dataIndex: 'supplierName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '款数', dataIndex: 'productTotalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '数量', dataIndex: 'productTotalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '退货价', dataIndex: 'productTotalPrice', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         // { title: '成本', dataIndex: 'productTotalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '审核时间', dataIndex: 'auditTime', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(5, 0, { title: '成本', dataIndex: 'productTotalCost', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(6, 0, { title: '成本', dataIndex: 'productTotalCost', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }

+ 2 - 2
src/views/reportData/customerReport/list.vue

@@ -81,7 +81,7 @@
       <!-- 合计 -->
       <a-alert type="info" style="margin-bottom:10px">
         <div class="ftext" slot="message">
-          总交易金额:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</strong>;
+          总交易金额:<strong>{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? toThousands(totalData.discountedAmount) : '--' }}</strong>;
           <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
             总毛利:<strong>{{ (totalData && totalData.totalGrossProfit) ? toThousands(totalData.totalGrossProfit) : '--' }}</strong>;
             总毛利率:<strong>{{ (totalData && totalData.percentage) ? totalData.percentage+'%' : '--' }}</strong>;
@@ -192,7 +192,7 @@ export default {
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '客户名称', dataIndex: 'salesTargetName', width: '35%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true, sorter: true },
         { title: '客户类型', dataIndex: 'customerTypeName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '交易金额', dataIndex: 'totalAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') }, sorter: true }
+        { title: '交易金额', dataIndex: 'discountedAmount', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') }, sorter: true }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
         arr.splice(4, 0, { title: '毛利', dataIndex: 'totalGrossProfit', width: '15%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })

+ 9 - 6
src/views/reportData/salesDetailReport/list.vue

@@ -148,13 +148,14 @@
     <!-- 合计 -->
     <a-alert type="info" style="margin-bottom:10px">
       <div class="ftext" slot="message">
-        产品总数量:<strong>{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</strong>;
+        产品总数量:<strong>{{ (totalData && (totalData.productQty || totalData.productQty==0)) ? totalData.productQty : '--' }}</strong>;
         <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
           总成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? toThousands(totalData.totalCost) : '--' }}</strong>;
         </div>
-        总售价:<strong>{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? toThousands(totalData.totalPrice) : '--' }}</strong>;
+        总售价:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</strong>;
+        折后总售价:<strong>{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? toThousands(totalData.discountedAmount) : '--' }}</strong>;
         <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
-          总毛利:<strong>{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? toThousands(totalData.totalProfit) : '--' }}</strong>。
+          总毛利:<strong>{{ (totalData && (totalData.grossProfit || totalData.grossProfit==0)) ? toThousands(totalData.grossProfit) : '--' }}</strong>。
         </div>
       </div>
     </a-alert>
@@ -275,13 +276,15 @@ export default {
         { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '数量', dataIndex: 'productQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '成本', dataIndex: 'productCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'productPrice', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '总售价', dataIndex: 'totalAmount', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '折扣金额', dataIndex: 'discountAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '折后总售价', dataIndex: 'discountedAmount', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         // { title: '毛利', dataIndex: 'productProfit', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '审核时间', dataIndex: 'salesAuditDate', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(8, 0, { title: '成本', dataIndex: 'productCost', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(10, 0, { title: '毛利', dataIndex: 'productProfit', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(8, 0, { title: '成本', dataIndex: 'totalCost', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(12, 0, { title: '毛利', dataIndex: 'grossProfit', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }

+ 6 - 3
src/views/reportData/salesReport/list.vue

@@ -119,7 +119,8 @@
         <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
           总成本:<strong>{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? toThousands(totalData.totalCost) : '--' }}</strong>;
         </div>
-        总售价:<strong>{{ (totalData && (totalData.totalPrice || totalData.totalPrice==0)) ? toThousands(totalData.totalPrice) : '--' }}</strong>;
+        总售价:<strong>{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</strong>;
+        折后总售价:<strong>{{ (totalData && (totalData.discountedAmount || totalData.discountedAmount==0)) ? toThousands(totalData.discountedAmount) : '--' }}</strong>;
         <div style="display: inline-block;" v-if="$hasPermissions('M_ShowAllCost')">
           总毛利:<strong>{{ (totalData && (totalData.totalProfit || totalData.totalProfit==0)) ? toThousands(totalData.totalProfit) : '--' }}</strong>。
         </div>
@@ -225,14 +226,16 @@ export default {
         { title: '款数', dataIndex: 'totalCategory', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '数量', dataIndex: 'totalQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '成本', dataIndex: 'totalCost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'totalPrice', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '总售价', dataIndex: 'totalAmount', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '折扣金额', dataIndex: 'discountAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '折后总售价', dataIndex: 'discountedAmount', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         // { title: '毛利', dataIndex: 'totalProfit', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '业务员', dataIndex: 'salesManName', width: '11%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '审核时间', dataIndex: 'salesAuditDate', width: '13%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
         arr.splice(6, 0, { title: '成本', dataIndex: 'totalCost', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(8, 0, { title: '毛利', dataIndex: 'totalProfit', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(10, 0, { title: '毛利', dataIndex: 'totalProfit', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }

+ 3 - 3
src/views/reportData/stockImportReport/detailList.vue

@@ -14,8 +14,8 @@
         @keyup.enter.native="handleSearch" >
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
-            <a-form-model-item label="库存导入单号">
-              <a-input v-model.trim="queryParam.stockImportNo" allowClear placeholder="请输入库存导入单号"/>
+            <a-form-model-item label="导入单号">
+              <a-input v-model.trim="queryParam.stockImportNo" allowClear placeholder="请输入导入单号"/>
             </a-form-model-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -184,7 +184,7 @@ export default {
       const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '库存导入单号', dataIndex: 'stockImportNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '导入单号', dataIndex: 'stockImportNo', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '导入类型', dataIndex: 'importTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '供应商', dataIndex: 'supplierName', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品编码', dataIndex: 'productCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },

+ 1 - 1
src/views/reportData/stockImportReport/list.vue

@@ -119,7 +119,7 @@ export default {
       const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '库存导入单号', dataIndex: 'stockImportNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '导入单号', dataIndex: 'stockImportNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '导入类型', dataIndex: 'importTypeDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '款数', dataIndex: 'productTotalCategory', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '数量', dataIndex: 'productTotalQty', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },

+ 2 - 0
src/views/reportData/storeReceivedSendStorageReport/list.vue

@@ -46,6 +46,7 @@
         class="sTable"
         ref="table"
         size="small"
+        rowKeyName="no"
         :rowKey="(record) => record.no"
         :columns="columns"
         :data="loadData"
@@ -226,6 +227,7 @@ export default {
                 { no: 8, beginDetail: null, beginAmount: null, putDetail: '散件导入', putAmount: res.data.putSparePartsImportAmount, outDetail: null, outAmount: null, endDetail: null, endAmount: null },
                 { no: 9, beginDetail: null, beginAmount: null, putDetail: null, putAmount: null, outDetail: '店内调出', outAmount: res.data.outShopCallOutAmount, endDetail: null, endAmount: null },
                 { no: 10, beginDetail: null, beginAmount: null, putDetail: null, putAmount: null, outDetail: '急件冲减', outAmount: res.data.outDispatchDeductAmount, endDetail: null, endAmount: null },
+                { no: 11, beginDetail: null, beginAmount: null, putDetail: '货架调回', putAmount: res.data.putShelfRecallAmount, outDetail: '货架补货', outAmount: res.data.outShelfReplenishAmount, endDetail: null, endAmount: null },
                 { no: '成本合计', beginDetail: ' ', beginAmount: res.data.beginAmount, putDetail: ' ', putAmount: res.data.putAmount, outDetail: ' ', outAmount: res.data.outAmount, endDetail: '月末余额', endAmount: res.data.endAmount }
               ]
             } else {

+ 1 - 1
src/views/salesManagement/salesQuery/carInfoModal.vue

@@ -35,7 +35,7 @@
           <a-divider style="margin: 12px 0;" />
         </div>
         <a-descriptions bordered :column="2" size="small" v-if="infoData&&infoData.params" class="head-info-main">
-          <a-descriptions-item v-for="item in infoData.params" :label="item.type_name+':'">{{ item.value || '--' }}</a-descriptions-item>
+          <a-descriptions-item v-for="item in infoData.params" :key="item.type_name" :label="item.type_name+':'">{{ item.value || '--' }}</a-descriptions-item>
         </a-descriptions>
         <div class="btn-cont"><a-button id="carInfoDetail-modal-back" @click="isShow = false">返回</a-button></div>
       </div>

+ 1 - 1
src/views/salesManagement/salesQuery/chooseShelfProduct.vue

@@ -372,7 +372,7 @@ export default {
       this.$refs.table.refresh(true)
     },
     reload () {
-      // this.$refs.table.clearSelected()
+      this.$refs.table.clearSelected()
       this.$refs.table.refresh()
     },
     // ---------- 全部产品----------

+ 3 - 29
src/views/salesManagement/salesQuery/edit.vue

@@ -114,9 +114,10 @@
                 <a-button
                   type="primary"
                   ghost
+                  :disabled="dataSource.length==0"
                   @click="delSalerOrder"
                   :loading="delLoading"
-                  id="salesEdit-del-all">整单删除</a-button>
+                  id="salesEdit-del-all">清空列表</a-button>
               </div>
             </a-col>
           </a-row>
@@ -508,7 +509,7 @@ export default {
       const _this = this
       this.$confirm({
         title: '提示',
-        content: '确认删除该销售单吗?',
+        content: '确认要清空已选产品列表吗?',
         centered: true,
         closable: true,
         onOk () {
@@ -516,35 +517,8 @@ export default {
           salesDel({ id: _this.orderId }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
-              _this.handleBack()
-            }
-            _this.spinning = false
-          })
-        }
-      })
-    },
-    // 删除已选产品
-    delSalerDetailAll () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确认要整单删除吗?',
-        centered: true,
-        closable: true,
-        onOk () {
-          _this.delLoading = true
-          _this.spinning = true
-          salesDetailDelAll({ salesBillSn: _this.detailData.salesBillSn }).then(res => {
-            if (res.status == 200) {
               _this.resetSearchForm(true)
-              _this.productForm = {
-                productName: '',
-                productCode: '',
-                orderBy: 'sales_bill_detail.CREATE_DATE desc'
-              }
             }
-            _this.$message.info(res.message)
-            _this.delLoading = false
             _this.spinning = false
           })
         }

+ 2 - 1
src/views/salesManagement/salesQuery/list.vue

@@ -294,6 +294,7 @@ export default {
         { title: '总款数', dataIndex: 'totalCategory', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总数量', dataIndex: 'totalQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '总售价', dataIndex: 'totalAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '折扣金额', dataIndex: 'discountAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '折后总售价', dataIndex: 'discountedAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
         { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -439,7 +440,7 @@ export default {
         closable: true,
         onOk () {
           _this.spinning = true
-          salesDel({ id: row.id }).then(res => {
+          salesDel({ id: row.id, mainFlag: 1 }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()

+ 1 - 1
src/views/salesManagement/salesQuery/productSalesRecordModal.vue

@@ -12,8 +12,8 @@
       :width="960">
       <div>
         <div style="padding: 0 0 10px 0;line-height: 24px;" v-if="baseData">
-          <div>产品名称:{{ baseData.productName }}</div>
           <div>产品编码:{{ baseData.productCode }}</div>
+          <div>产品名称:{{ baseData.productName }}</div>
         </div>
         <a-tabs size="small" type="card" v-model="curTab" @change="callback">
           <a-tab-pane key="1" tab="当前客户">

+ 121 - 0
src/views/salesManagement/salesQueryNew/carInfoModal.vue

@@ -0,0 +1,121 @@
+<template>
+  <div v-if="isShow">
+    <a-modal
+      centered
+      class="carInfoDetail-modal"
+      :footer="null"
+      :maskClosable="false"
+      v-model="isShow"
+      @cancel="isShow=false"
+      :width="800">
+      <div>
+        <div class="head-info-con">
+          <p class="head-info-title">车型信息</p>
+          <a-divider style="margin: 12px 0;" />
+        </div>
+        <a-descriptions bordered :column="2" size="small" class="head-info-main">
+          <a-descriptions-item label="车型信息:">{{ infoData&&infoData.text || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="品牌:">{{ infoData&&infoData.brand_name || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="车型:">{{ infoData&&infoData.model_name || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="品牌LOGO:">
+            <img :src="infoData&&infoData.icon?infoData.icon:defImg" width="30" height="30" style="border-radius: 50%;" />
+          </a-descriptions-item>
+          <a-descriptions-item label="排量:">{{ infoData&&infoData.sub_name || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="年款:">{{ infoData&&infoData.year || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="车型图:">
+            <div v-if="infoData&&infoData.images.length>0">
+              <img :src="infoData.images[0] || defImg" width="30" height="30" class="imageUrl" @click="inited(infoData.images)" />
+            </div>
+            <span v-else>--</span>
+          </a-descriptions-item>
+          <a-descriptions-item label="车系:">{{ infoData&&infoData.series_name || '--' }}</a-descriptions-item>
+        </a-descriptions>
+        <div class="head-info-con" v-if="infoData&&infoData.params">
+          <p class="head-info-title">配置信息</p>
+          <a-divider style="margin: 12px 0;" />
+        </div>
+        <a-descriptions bordered :column="2" size="small" v-if="infoData&&infoData.params" class="head-info-main">
+          <a-descriptions-item v-for="item in infoData.params" :key="item.type_name" :label="item.type_name+':'">{{ item.value || '--' }}</a-descriptions-item>
+        </a-descriptions>
+        <div class="btn-cont"><a-button id="carInfoDetail-modal-back" @click="isShow = false">返回</a-button></div>
+      </div>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import defImg from '@/assets/def_img@2x.png'
+export default {
+  name: 'CarInfoDetailModal',
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    infoData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      defImg
+    }
+  },
+  methods: {
+    inited (viewer) {
+      if (viewer) {
+        const imageUrl = []
+        viewer.map(item => {
+          imageUrl.push(item)
+        })
+        this.$viewerApi({
+          images: imageUrl
+        })
+      }
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .carInfoDetail-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .ant-descriptions-item-label.ant-descriptions-item-colon{
+      width: 117px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+    .head-info-con{
+      .head-info-title{
+        font-size: 16px;
+        margin: 0;
+      }
+    }
+    .head-info-main{
+      margin-bottom: 20px;
+    }
+    .imageUrl{
+      cursor: pointer;
+    }
+  }
+</style>

+ 579 - 0
src/views/salesManagement/salesQueryNew/chooseCustomModal.vue

@@ -0,0 +1,579 @@
+<template>
+  <div v-if="opened">
+    <a-modal
+      v-model="opened"
+      :title="title"
+      centered
+      :maskClosable="false"
+      :confirmLoading="confirmLoading"
+      :width="960"
+      :footer="null"
+      @cancel="cancel"
+    >
+      <a-spin :spinning="spinning" tip="Loading...">
+        <a-form-model
+          id="chooseCustom-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-row :gutter="15">
+            <a-col :span="16">
+              <a-form-model-item label="客户名称" prop="buyerSn" :labelCol="{ span: 3 }" :wrapperCol="{ span: 20 }">
+                <selectCust ref="custList" :isValidateEnabled="true" id="chooseCustom-buyerSn" @change="custChange" v-model="form.buyerSn"></selectCust>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="8" v-if="$hasPermissions('B_customer_customerInfo_add')">
+              <a-form-model-item :labelCol="{ span: 0 }" :wrapperCol="{ span: 24 }">
+                <a-button type="primary" class="button-primary" @click="openNewCust" icon="plus">新增</a-button>
+                (点击新增按钮新增客户)
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="15">
+            <a-col :span="24">
+              <a-form-model-item label="客户地址" required style="margin: 0;" :labelCol="{ span: 2 }" :wrapperCol="{ span: 22 }">
+                <a-row :gutter="15">
+                  <!-- 客户地址 -->
+                  <a-col span="8">
+                    <a-form-model-item prop="shippingAddressProvinceSn">
+                      <a-select id="chooseCustom-provinceSn" allowClear @change="getCityList" v-model="form.shippingAddressProvinceSn" placeholder="请选择省">
+                        <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-model-item>
+                  </a-col>
+                  <a-col span="8">
+                    <a-form-model-item prop="shippingAddressCitySn">
+                      <a-select id="chooseCustom-citySn" allowClear @change="getAreaList" v-model="form.shippingAddressCitySn" placeholder="请选择市">
+                        <a-select-option v-for="item in addrCityList" :value="item.areaSn" :key="item.areaSn + 'b'">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-model-item>
+                  </a-col>
+                  <a-col span="8">
+                    <a-form-model-item prop="shippingAddressCountySn">
+                      <a-select id="chooseCustom-countySn" allowClear @change="areaCharged" v-model="form.shippingAddressCountySn" placeholder="请选择区/县">
+                        <a-select-option v-for="item in addrDistrictList" :value="item.areaSn" :key="item.areaSn + 'c'">{{ item.name }}</a-select-option>
+                      </a-select>
+                    </a-form-model-item>
+                  </a-col>
+                </a-row>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-model-item label="详细地址" prop="shippingAddress" :labelCol="{ span: 2 }" :wrapperCol="{ span: 22 }">
+                <a-input
+                  id="chooseCustom-shippingAddress"
+                  :maxLength="60"
+                  v-model.trim="form.shippingAddress"
+                  placeholder="请输入详细地址(最多60个字符)"
+                  allowClear />
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="15">
+            <a-col :span="8">
+              <a-form-model-item label="联系人" prop="consigneeName">
+                <a-input
+                  id="chooseCustom-consigneeName"
+                  :maxLength="30"
+                  v-model.trim="form.consigneeName"
+                  placeholder="请输入联系人(最多30个字符)"
+                  allowClear />
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="8">
+              <a-form-model-item label="联系电话" prop="consigneeTel">
+                <a-input
+                  id="chooseCustom-consigneeTel"
+                  :maxLength="15"
+                  v-model.trim="form.consigneeTel"
+                  placeholder="请输入联系电话(最多15个字符)"
+                  allowClear />
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="8">
+              <a-form-model-item label="联系手机" prop="consigneeMobile">
+                <a-input
+                  id="chooseCustom-consigneeMobile"
+                  :maxLength="11"
+                  v-model.trim="form.consigneeMobile"
+                  placeholder="请输入联系电话(最多11个字符)"
+                  allowClear />
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="15">
+            <a-col :span="8">
+              <a-form-model-item label="价格类型" prop="priceType">
+                <a-row :gutter="15">
+                  <a-col :span="20">
+                    <v-select
+                      code="PRICE_TYPE"
+                      :disabled="priceTypeDisabled"
+                      id="chooseCustom-priceType"
+                      v-model="form.priceType"
+                      @change="changePriceType"
+                      allowClear
+                      placeholder="请选择价格类型" ></v-select>
+                  </a-col>
+                  <a-col :span="4">
+                    <a-popover>
+                      <template slot="content">(选择后在当前工单不可修改)</template>
+                      <a-icon type="question-circle" />
+                    </a-popover>
+                  </a-col>
+                </a-row>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="8">
+              <a-form-model-item label="收款方式" prop="settleStyleSn">
+                <settleStyle
+                  v-model="form.settleStyleSn"
+                  placeholder="请选择收款方式">
+                </settleStyle>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="8">
+              <a-form-model-item label="配送方式" prop="dispatchType">
+                <v-select code="DISPATCH_TYPE" id="chooseCustom-dispatchType" v-model="form.dispatchType" allowClear placeholder="请选择配送方式"></v-select>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="15">
+            <a-col :span="8">
+              <a-form-model-item label="业务员" prop="salesManSn">
+                <a-select id="chooseCustom-salesManSn" allowClear @change="salesManChange" v-model="form.salesManSn" placeholder="请选择业务员">
+                  <a-select-option v-for="item in userList" :value="item.employeeSn" :key="item.id + 'c'">{{ item.name }}</a-select-option>
+                </a-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="8">
+              <a-form-model-item label="铺货出库" prop="distributionFlag">
+                <v-select code="FLAG" id="chooseCustom-distributionFlag" v-model="form.distributionFlag" allowClear placeholder="请选择是否铺货出库"></v-select>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="15">
+            <a-col :span="8">
+              <a-form-model-item label="备注" prop="remarks">
+                <a-input
+                  id="chooseCustom-remarks"
+                  type="textarea"
+                  :maxLength="100"
+                  v-model.trim="form.remarks"
+                  placeholder="请输入备注(最多100个字符)"
+                  allowClear />
+              </a-form-model-item>
+            </a-col>
+            <a-col :span="8">
+              <a-form-model-item label="开单人">{{ $store.state.user.info.userNameCN }}</a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+            <a-button type="primary" size="large" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
+            <a-button @click="cancel" size="large" style="margin-left: 15px" id="chooseCustom-btn-back">取消</a-button>
+          </a-form-model-item>
+        </a-form-model>
+        <!-- 新增客户 -->
+        <a-modal
+          v-model="isNewCust"
+          title="新增客户"
+          centered
+          :width="960"
+          :maskClosable="false"
+          @cancel="cancelNewCust"
+          :footer="null"
+        >
+          <CustomerManagementEdit ref="newCust" model="modal" @ok="newCustFun"></CustomerManagementEdit>
+        </a-modal>
+      </a-spin>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import { getArea } from '@/api/data'
+import { custFindById, updateByCustomerSn } from '@/api/customer'
+import { salesSave } from '@/api/sales'
+import { employeeAllList } from '@/api/salesman'
+import settleStyle from '@/views/common/settleStyle'
+import { VSelect } from '@/components'
+import selectCust from '@/views/common/selectCust.vue'
+import CustomerManagementEdit from '@/views/customerManagement/customerInfo/edit.vue'
+export default {
+  name: 'ChooseCustomModal',
+  components: { VSelect, CustomerManagementEdit, selectCust, settleStyle },
+  props: {
+    show: [Boolean],
+    distributionFlag: {
+      type: [String, Number],
+      default: '0'
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      opened: this.show,
+      title: '选择客户',
+      confirmLoading: false,
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 18 }
+      },
+      buyerSnBak: '', // 更改前客户sn备份
+      priceTypeBak: '', // 更改前客户价格类型备份
+      form: {
+        buyerName: '', // 客户名称
+        buyerSn: undefined, // 客户sn
+        consigneeTel: '', //  联系电话
+        consigneeMobile: '',
+        consigneeName: '', //  联系人
+        shippingAddressProvinceSn: undefined, //  省
+        shippingAddressProvinceName: '',
+        shippingAddressCitySn: undefined, // 市
+        shippingAddressCityName: '',
+        shippingAddressCountySn: undefined, // 区
+        shippingAddressCountyName: '',
+        shippingAddress: '', //  详细地址
+        fax: '', //  客户传真
+        dispatchType: undefined, //  配送方式
+        satelliteFlag: 0, //  是否卫星仓客户
+        priceType: undefined, //  价格类型
+        settleStyleSn: undefined, //  收款方式
+        salesManSn: undefined, //  业务员
+        salesManName: '',
+        distributionFlag: undefined, // 铺货出库
+        salesTragetType: 'CUSTOMER',
+        remarks: '' //  备注
+      },
+      rules: {
+        buyerSn: [
+          { required: true, message: '请选择客户', trigger: ['change', 'blur'] }
+        ],
+        consigneeMobile: [{ required: false, pattern: /^\d{11}$/, message: '请输入正确的手机号', trigger: 'blur' }],
+        shippingAddressProvinceSn: [
+          { required: true, message: '请选择省', trigger: 'change' }
+        ],
+        shippingAddressCitySn: [
+          { required: true, message: '请选择市', trigger: 'change' }
+        ],
+        shippingAddressCountySn: [
+          { required: true, message: '请选择区/县', trigger: 'change' }
+        ],
+        priceType: [
+          { required: true, message: '请选择价格类型', trigger: ['change', 'blur'] }
+        ],
+        settleStyleSn: [
+          { required: true, message: '请选择收款方式', trigger: ['change', 'blur'] }
+        ],
+        distributionFlag: [
+          { required: true, message: '请选择是否铺货出库', trigger: 'change' }
+        ]
+        // salesManSn: [
+        //   { required: true, message: '请选择业务员', trigger: 'change' }
+        // ]
+      },
+      addrProvinceList: [], //  省下拉
+      addrCityList: [], //  市下拉
+      addrDistrictList: [], //  区下拉
+      userList: [], // 业务员 下拉
+      custId: undefined, // 客户id
+      isEdit: false, //  是否编辑状态
+      priceTypeDisabled: false, // 价格类型可编辑
+      isChangeCust: false, // 是否更换客户
+      interId: null,
+      isNewCust: false // 是否新增客户
+    }
+  },
+  methods: {
+    changePriceType (v) {
+      this.form.priceType = v
+      this.$refs.ruleForm.clearValidate('priceType')
+    },
+    openNewCust () {
+      this.isNewCust = true
+      setTimeout(() => {
+        this.$refs.newCust.getBaseData()
+      }, 500)
+    },
+    // 新建客户
+    newCustFun (data) {
+      console.log(data, this.isEdit)
+      this.isNewCust = false
+      // 更新客户信息
+      this.$refs.custList.setData({ key: data.customerSn, label: data.customerName, row: data })
+      this.custChange({ key: data.customerSn, label: data.customerName, row: data })
+    },
+    // 业务员
+    salesManChange (employeeSn) {
+      if (employeeSn) {
+        this.form.salesManName = this.userList.find(item => item.employeeSn == employeeSn).name
+      } else {
+        this.form.salesManName = ''
+      }
+    },
+    // 客户 change
+    custChange (obj) {
+      const _this = this
+      if (obj && obj.key) {
+        const cust = obj.row
+        this.form.buyerSn = cust.customerSn
+        // 编辑
+        if (this.isEdit) {
+          this.$confirm({
+            title: '提示',
+            content: '更换客户后信息需要重新完善,确认要更换吗?',
+            centered: true,
+            onOk () {
+              _this.custId = cust.id
+              _this.form.buyerName = cust.customerName
+              _this.priceTypeDisabled = false
+              _this.getDetail()
+            },
+            onCancel () {
+              _this.form.buyerSn = _this.buyerSnBak
+            }
+          })
+        } else {
+          _this.custId = cust.id
+          _this.form.buyerName = cust.customerName
+          _this.getDetail()
+        }
+      } else {
+        this.$refs.ruleForm.resetFields()
+        this.$refs.custList.resetForm()
+      }
+    },
+    // 编辑客户信息
+    editCust (data) {
+      console.log(data)
+      this.title = '编辑客户信息'
+      this.isEdit = true
+      this.priceTypeDisabled = true
+      if (data.shippingAddressProvinceSn) { this.getArea('city', data.shippingAddressProvinceSn) }
+      if (data.shippingAddressCitySn) { this.getArea('district', data.shippingAddressCitySn) }
+      this.form = Object.assign(this.form, data)
+      this.form.buyerName = data.buyerNameCurrent || data.buyerName
+      this.buyerSnBak = this.form.buyerSn
+      this.priceTypeBak = this.form.priceType
+      this.$nextTick(() => {
+        this.$refs.custList.setData({ key: data.buyerSn, label: data.buyerNameCurrent || data.buyerName, row: data })
+      })
+    },
+    //  获取详情
+    getDetail () {
+      this.spinning = true
+      custFindById({ id: this.custId }).then(res => {
+        const data = res.data
+        console.log(res)
+        if (res.status == 200 && data) {
+          if (data.provinceSn) { this.getArea('city', data.provinceSn) }
+          if (data.citySn) { this.getArea('district', data.citySn) }
+          this.form = Object.assign(this.form, {
+            buyerName: data.customerName, // 客户名称
+            buyerSn: data.customerSn, // 客户sn
+            consigneeTel: data.contactTel, //  联系电话
+            consigneeMobile: data.contactMobile,
+            consigneeName: data.contactName, //  联系人
+            shippingAddressProvinceSn: data.provinceSn, //  省
+            shippingAddressProvinceName: data.provinceName,
+            shippingAddressCitySn: data.citySn, // 市
+            shippingAddressCityName: data.cityName,
+            shippingAddressCountySn: data.countySn, // 区
+            shippingAddressCountyName: data.countyName,
+            shippingAddress: data.customerAddr, //  详细地址
+            fax: data.fax, //  客户传真
+            dispatchType: data.dispatchType, //  配送方式
+            satelliteFlag: data.satelliteFlag, //  是否卫星仓客户
+            priceType: data.priceType, //  价格类型
+            settleStyleSn: data.settleStyleSn //  收款方式
+          })
+          // this.buyerSnBak = this.form.buyerSn
+          // this.priceTypeBak = this.form.priceType
+        } else {
+          this.$message.error('获取客户信息失败')
+          this.$refs.ruleForm.resetFields()
+        }
+        this.$refs.ruleForm.clearValidate()
+        this.spinning = false
+      })
+    },
+    // 保存客户信息
+    handleSaveCust () {
+      const params = {
+        customerName: this.form.buyerName,
+        customerSn: this.form.buyerSn,
+        contactTel: this.form.consigneeTel, //  联系电话
+        contactMobile: this.form.consigneeMobile,
+        contactName: this.form.consigneeName, //  联系人
+        provinceSn: this.form.shippingAddressProvinceSn, //  省
+        provinceName: this.form.shippingAddressProvinceName,
+        citySn: this.form.shippingAddressCitySn, // 市
+        cityName: this.form.shippingAddressCityName,
+        countySn: this.form.shippingAddressCountySn, // 区
+        countyName: this.form.shippingAddressCountyName,
+        customerAddr: this.form.shippingAddress, //  详细地址
+        dispatchType: this.form.dispatchType, //  配送方式
+        priceType: this.form.priceType, //  价格类型
+        settleStyleSn: this.form.settleStyleSn //  收款方式
+      }
+      this.spinning = true
+      updateByCustomerSn(params).then(res => {
+        this.spinning = false
+        if (res.status == 200) {
+          // 保存销售单
+          this.salesSaveFun()
+          this.spinning = false
+        } else {
+          this.spinning = false
+        }
+      })
+    },
+    //  保存
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      console.log(_this.form, '------save')
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          // 如果价格类型改变,提示
+          if (_this.priceTypeBak != _this.form.priceType && this.isEdit) {
+            this.$confirm({
+              title: '提示',
+              content: '价格类型变更,确认提交吗?',
+              centered: true,
+              onOk () {
+                // 保存客户信息
+                _this.handleSaveCust()
+              }
+            })
+          } else {
+            // 保存客户信息
+            _this.handleSaveCust()
+          }
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    // 新建或编辑销售单
+    salesSaveFun () {
+      const _this = this
+      const form = this.form
+      _this.spinning = true
+      salesSave(form).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$emit('ok', res.data)
+          if (_this.form.id) {
+            _this.$emit('updateData', form.priceType)
+          }
+          _this.cancel()
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    cancel () {
+      this.opened = false
+      this.$emit('cancel')
+      this.$refs.ruleForm.resetFields()
+      this.$refs.custList.resetForm()
+    },
+    cancelNewCust () {
+      this.isNewCust = false
+      this.$refs.newCust.getBaseData()
+    },
+    // 获取业务员列表数据
+    getUserAllList () {
+      employeeAllList({}).then(res => {
+        if (res.status == 200) {
+          this.userList = res.data || []
+        } else {
+          this.userList = []
+        }
+      })
+    },
+    // 获取城市列表
+    getCityList (val) {
+      this.addrCityList = []
+      this.addrDistrictList = []
+      this.form.shippingAddressCitySn = undefined
+      this.form.shippingAddressCityName = ''
+      this.form.shippingAddressCountySn = undefined
+      this.form.shippingAddressCountyName = ''
+      if (val) {
+        this.getArea('city', val)
+        this.form.shippingAddressProvinceName = this.addrProvinceList.find(item => item.areaSn == val).name
+      } else {
+        this.form.shippingAddressProvinceName = ''
+      }
+    },
+    // 获取区县列表
+    getAreaList (val) {
+      this.addrDistrictList = []
+      this.form.shippingAddressCountySn = undefined
+      this.form.shippingAddressCountyName = ''
+      if (val) {
+        this.getArea('district', val)
+        this.form.shippingAddressCityName = this.addrCityList.find(item => item.areaSn == val).name
+      } else {
+        this.form.shippingAddressCityName = ''
+      }
+    },
+    // 区县变更
+    areaCharged (val) {
+      if (val) {
+        this.form.shippingAddressCountyName = this.addrDistrictList.find(item => item.areaSn == val).name
+      } else {
+        this.form.shippingAddressCountyName = ''
+      }
+    },
+    //  省/市/区
+    getArea (leve, sn) {
+      let params
+      if (leve == 'province') {
+        params = { type: '2' }
+      } else {
+        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
+      }
+      getArea(params).then(res => {
+        if (res.status == 200) {
+          if (leve == 'province') {
+            this.addrProvinceList = res.data || []
+          } else if (leve == 'city') {
+            this.addrCityList = res.data || []
+          } else if (leve == 'district') {
+            this.addrDistrictList = res.data || []
+          }
+        } else {
+          if (leve == 'province') {
+            this.addrProvinceList = []
+          } else if (leve == 'city') {
+            this.addrCityList = []
+          } else if (leve == 'district') {
+            this.addrDistrictList = []
+          }
+        }
+      })
+    }
+  },
+  watch: {
+    show (newValue, oldValue) {
+      this.opened = newValue
+      if (newValue) {
+        this.getArea('province')
+        this.getUserAllList()
+      }
+    },
+    distributionFlag (newValue, oldValue) {
+      console.log(newValue, oldValue)
+      this.form.distributionFlag = newValue.toString()
+    }
+  }
+}
+</script>

+ 202 - 0
src/views/salesManagement/salesQueryNew/chooseImportModal.vue

@@ -0,0 +1,202 @@
+<template>
+  <a-modal
+    centered
+    class="chooseImport-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="确认导入"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="80%">
+    <div class="chooseImport-con">
+      <!-- 可导入数据 -->
+      <p class="">可导入数据{{ loadData.length }}条</p>
+      <a-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.allocateSn"
+        :columns="nowColumns"
+        :dataSource="loadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <a-divider />
+      <!-- 不可导入数据 -->
+      <p class="red">不可导入数据{{ unLoadData.length }}条</p>
+      <a-table
+        class="unTable"
+        ref="unTable"
+        size="small"
+        :rowKey="(record) => record.errorDesc"
+        :columns="nowUnColumns"
+        :dataSource="unLoadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+        <template slot="errorMsg" slot-scope="text,record">
+          <a-popover placement="topRight">
+            <template slot="content">
+              <p v-for="d in record.importErrorMsgSet">{{ d }}</p>
+            </template>
+            <a-button type="link">
+              查看
+            </a-button>
+          </a-popover>
+        </template>
+      </a-table>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="chooseImport-submit"
+          size="large"
+          :class="loadData.length==0?'button-grey':'button-primary'"
+          @click="handleSubmit"
+          style="padding: 0 40px;">确认导入</a-button>
+        <a-button
+          id="chooseImport-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"
+          size="large"
+          class="button-error"
+          @click="handleError"
+          style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+import { salesDetailFailExcel } from '@/api/salesDetail'
+export default {
+  name: 'ChooseImportModal',
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    paramsData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    const _this = this
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      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: 'importQty', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'importProductUnit', align: 'center', width: '15%', customRender: function (text) { return 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) ? _this.toThousands(text) : '--') } },
+        { title: '数量', dataIndex: 'importQty', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '错误说明', scopedSlots: { customRender: 'errorMsg' }, width: '10%', align: 'center' }
+      ],
+      unLoadData: [],
+      loading: false
+    }
+  },
+  methods: {
+    getData () {
+      const paramsData = JSON.parse(JSON.stringify(this.paramsData))
+      this.loadData = paramsData.rightList || []
+      this.unLoadData = paramsData.errorList || []
+      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
+      })
+    },
+    // 确认导入
+    handleSubmit () {
+      if (this.paramsData.rightList.length == 0) {
+        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
+      }
+    },
+    // 导出
+    handleError () {
+      const _this = this
+      if (_this.paramsData.errorList.length < 1) {
+        _this.$message.info('暂无可导出错误项~')
+        return
+      }
+      _this.spinning = true
+      hdExportExcel(salesDetailFailExcel, _this.paramsData.errorList, '销售产品导出错误项', function () {
+        _this.spinning = false
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.loadData = []
+        this.unLoadData = []
+      } else {
+        this.getData()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseImport-modal{
+    .chooseImport-con{
+      .red{
+        color: #f30;
+      }
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel,.button-error{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 644 - 0
src/views/salesManagement/salesQueryNew/chooseProductModal.vue

@@ -0,0 +1,644 @@
+<template>
+  <a-drawer
+    :zIndex="zIndex"
+    :title="title"
+    placement="right"
+    :visible="visible"
+    :width="width"
+    :get-container="false"
+    :wrap-style="{ position: 'absolute' }"
+    @close="onClose"
+    wrapClassName="chooseProduct-drawer jg-drawer-wrap">
+    <a-spin :spinning="spinning||newLoading" tip="Loading...">
+    <!-- 搜索条件 -->
+    <div ref="searchBox" class="table-page-search-wrapper">
+      <a-form-model
+        ref="ruleForm"
+        class="form-model-con"
+        layout="inline"
+        :rules="rules"
+        :model="queryParam"
+        @keyup.enter.native="$refs.table.refresh(true)" >
+        <a-row type="flex" :gutter="5">
+          <a-col flex="1">
+            <a-form-model-item label="产品编码">
+              <a-input id="productInfoList-code" ref="searchProductCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col flex="1">
+            <a-form-model-item label="产品名称">
+              <a-input id="productInfoList-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col flex="1">
+            <a-form-model-item label="原厂编码">
+              <a-input id="productInfoList-origCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col flex="1">
+            <a-form-model-item label="产品品牌">
+              <ProductBrand id="productInfoList-productBrandSn" v-model="queryParam.brandSn"></ProductBrand>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row type="flex" :gutter="5">
+          <a-col flex="1.5">
+            <a-form-model-item label="产品分类">
+              <ProductType id="productInfoList-productType" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
+            </a-form-model-item>
+          </a-col>
+          <a-col flex="1.5">
+              <a-form-model-item label="仓库">
+                <a-select
+                  placeholder="请选择仓库"
+                  id="productInfoList-warehouseSn"
+                  allowClear
+                  v-model="queryParam.warehouseSn"
+                  :showSearch="true"
+                  option-filter-prop="children"
+                  :filter-option="filterOption">
+                  <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
+                </a-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col flex="2" v-if="$hasPermissions('B_salerVinFindProduct')">
+              <a-form-model-item label="车架号(VIN)" prop="vinCode">
+                <a-input id="productInfoList-vinCode" v-model.trim="queryParam.vinCode" allowClear placeholder="请输入车架号(VIN)">
+                  <a-icon @click="uploadFun" :type="vinLoading?'loading':'camera'" slot="addonAfter" :style="{ fontSize: '18px', verticalAlign: 'bottom' }" />
+                </a-input>
+                <input type="file" id="filed" accept="image/jpeg,image/png" hidden="" @change="filePreview">
+              </a-form-model-item>
+            </a-col>
+            <a-col flex="200px">
+              <a-form-item label="是否有库存">
+                <a-select @change="handleHasQty" allowClear :value="queryParam.existStockFlag" placeholder="请选择是否">
+                  <a-select-option value="1">
+                    是
+                  </a-select-option>
+                  <a-select-option value="0">
+                    否
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+          <a-col flex="auto">
+            <a-button type="primary" @click="searchForm()" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" id="productInfoList-reset">重置</a-button>
+          </a-col>
+        </a-row>
+      </a-form-model>
+
+      <div v-if="hasVaild&&showTable" class="vinInfo-box">
+        <div>
+          <div class="vinInfo-error" v-if="vinInfoData&&!vinInfoData.vinInfo">
+            <a-icon type="exclamation-circle" theme="filled" :style="{ color: '#E70012', fontSize: '15px', verticalAlign: 'sub', marginRight: '3px' }" />抱歉!暂未找到匹配VIN码的车型!
+          </div>
+          <div v-if="vinInfoData&&vinInfoData.vinInfo" @click="openCarInfoModal=true">
+            <div style="display: flex;justify-content: space-between;align-items: center;" @click="openCarInfoModal=true">
+              <div>
+                <img :src="vinInfoData.vinInfo && vinInfoData.vinInfo.icon?(vinInfoData.vinInfo.icon+'?x-oss-process=image/resize,h_30,m_lfit'):defImg" width="30" height="30" class="imageUrl" style="border-radius: 50%;vertical-align: middle;margin-right: 3px;" />
+                <span style="vertical-align: middle;">{{ vinInfoData.vinInfo.text }}</span>
+              </div>
+              <div style="color: #f90;cursor: pointer;">
+                <span>查看更多</span> >
+              </div>
+            </div>
+          </div>
+        </div>
+        <div>
+          <a-dropdown v-model="showCell">
+            <a class="ant-dropdown-link" @click="e => e.preventDefault()">
+              <a-icon type="setting" /> 显示
+            </a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a-checkbox v-model="cost" v-if="$hasPermissions('M_ShowAllCost')" id="salesQuery-cost">成本价</a-checkbox>
+              </a-menu-item>
+              <a-menu-item>
+                <a-checkbox v-model="cityPrice" id="salesQuery-cityPrice">市级价</a-checkbox>
+              </a-menu-item>
+              <a-menu-item>
+                <a-checkbox v-model="tyuePrice" v-if="$store.state.user.isShowSpecialPrice==1" id="salesQuery-tyuePrice">特约价</a-checkbox>
+              </a-menu-item>
+              <a-menu-item>
+                <a-checkbox v-model="zdPrice" id="salesQuery-zdPrice">终端价</a-checkbox>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </div>
+      </div>
+    </div>
+     
+    <!-- 列表 -->
+    <s-table
+      v-if="hasVaild&&showTable"
+      class="sTable"
+      ref="table"
+      size="small"
+      :rowKey="(record) => record.no"
+      rowKeyName="no"
+      :columns="columns"
+      :data="loadData"
+      @dblclick="handleClickRow"
+      :pageSize="30"
+      :scroll="{ y: tableHeight, x: tableWidth }"
+      bordered>
+      <div slot="costTitle">
+        <a-tooltip placement="top">
+          <template slot="title">
+            产品所在仓库仓位的最近一次入库成本,不包含盘盈入库和仓库调拨入库。
+          </template>
+          <span style="margin-right: 5px;">参考成本价</span> <a-icon type="question-circle" />
+        </a-tooltip>
+      </div>
+      <!-- 售价 -->
+      <template slot="salePrice" slot-scope="text, record">
+        <div style="display: flex;align-items: center;" @dblclick.stop>
+          <a-input-number
+            size="small"
+            v-model="record.price"
+            :precision="2"
+            :min="0"
+            :max="999999"
+            style="width: 100%;"
+            placeholder="请输入" />
+          <span style="color: red;margin: 0 2px;font-size: 14px;" v-if="record.origSalePriceFlag == 1">原</span>
+          <span v-else>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
+        </div>
+      </template>
+      <!-- 销售数量 -->
+      <template slot="nums" slot-scope="text, record">
+        <div @dblclick.stop>
+          <a-input-number
+            size="small"
+            v-model="record.salesNums"
+            :precision="0"
+            :min="0"
+            :max="999999"
+            style="width: 100%;"
+            placeholder="请输入" />
+        </div>
+      </template>
+      <!-- 操作 -->
+      <template slot="action" slot-scope="text, record">
+          <span style="color:#999;" v-if="hasChecked(record)">已添加</span>
+          <a-button
+          size="small"
+          type="link"
+          class="button-primary"
+          @click="handleAdd(record)"
+          v-else
+          id="productInfoList-edit-btn">添加</a-button>
+        <a-button
+          size="small"
+          type="link"
+          class="button-primary"
+          @click="handleDetail(record)"
+          id="productInfoList-detail-btn"
+          style="margin-left: 5px;">销售记录</a-button>
+      </template>
+    </s-table>
+    <div style="padding-top: 30px;" v-else>
+      <a-empty
+        :image="simpleImage"
+        :image-style="{
+          height: '60px',
+        }"
+      >
+        <span style="color:red" slot="description">请输入查询条件</span>
+      </a-empty>
+    </div>
+    
+    <!-- 查看车辆信息 -->
+    <car-info-modal ref="carInfoModal" :openModal="openCarInfoModal" :infoData="vinInfoData&&vinInfoData.vinInfo" @close="openCarInfoModal=false" />
+    </a-spin>
+  </a-drawer>
+</template>
+
+<script>
+import { Empty } from 'ant-design-vue'
+import { commonMixin } from '@/utils/mixin'
+import { querySumByProductLocation } from '@/api/stock'
+import { warehouseAllList } from '@/api/warehouse'
+import carInfoModal from './carInfoModal.vue'
+import ProductType from '../../common/productType.js'
+import ProductBrand from '../../common/productBrand.js'
+import { STable, VSelect, Upload } from '@/components'
+import { supperCodeByVin, vinCodeParse } from '@/api/sales'
+import defImg from '@/assets/def_img@2x.png'
+export default {
+  mixins: [commonMixin],
+  components: { STable, VSelect, Upload, carInfoModal, ProductType, ProductBrand },
+  props: {
+    showModal: {
+      type: Boolean,
+      default: false
+    },
+    width: {
+      type: [String, Number],
+      default: '80%'
+    },
+    zIndex: {
+      type: Number,
+      default: 100
+    },
+    newLoading: {
+      type: Boolean
+    },
+    checkedList: {
+      type: Array,
+      default:() => []
+    }
+  },
+  watch: {
+    showModal (newValue, oldValue) {
+      this.visible = newValue
+      if (newValue) {
+        this.$refs.searchProductCode.focus()
+        this.setTableH()
+      }
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  data () {
+    return {
+      showCell:false,
+      spinning: false,
+      showTable: false,
+      visible: this.showModal,
+      title: '添加产品',
+      tableHeight: 0,
+      tableWidth: 1760,
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
+      advanced: false, // 高级搜索 展开/关闭
+      vinLoading: false,
+      productType: [],
+      defImg,
+      queryParam: { //  查询条件
+        customerSn: '',
+        salesBillSn: '',
+        salePriceType: '',
+        productCode: '', //  产品编码
+        productName: '', //  产品名称
+        productOrigCode: '', //  原厂编码
+        vinCode: '',
+        productCodeList: undefined, //  车架号
+        brandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
+        warehouseSn: undefined, //  仓库、
+        enableFlag: '1',
+        existStockFlag: undefined
+      },
+      priceType: '',
+      buyerSn: '',
+      rules: {
+        vinCode: [ { len: 17, message: '请输入正确的车架号(VIN)', trigger: 'change' } ]
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      warehouseList: [], // 仓库列表
+      vinInfoData: null,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        const _this = this
+        _this.queryParam.salePriceType = _this.priceType
+        _this.queryParam.customerSn = _this.buyerSn
+        // 排序
+        if (parameter.sortField == 'productCode') {
+          parameter.sortField = 'code'
+          parameter.sortAlias = 'product '
+        }
+        if (parameter.sortField == 'brandName') {
+          parameter.sortField = 'firstChar'
+          parameter.sortAlias = 'brand'
+        }
+        if (parameter.sortField == 'warehouseName') {
+          parameter.sortField = 'warehouseSn'
+          parameter.sortAlias = 'sd'
+        }
+        const params = Object.assign(parameter, _this.queryParam)
+        if (_this.queryParam.vinCode && _this.queryParam.vinCode.length == 17 && !this.onlyList) { //  输入vin,查出vin码信息后请求列表数据
+          _this.disabled = true
+          return supperCodeByVin({ vin: _this.queryParam.vinCode }).then(res => {
+            if (res.status == 200) {
+              _this.vinInfoData = res.data
+              params.productCodeList = res.data.partCodeList || []
+              return _this.getList(params)
+            } else {
+              _this.vinInfoData = null
+              _this.$refs.table.localLoading = false
+              _this.$refs.table.clearTable()
+            }
+          })
+        } else if (_this.queryParam.vinCode && _this.queryParam.vinCode.length < 17 && !this.onlyList) { // 输入vin,但vin码不符合标准,不查vin码信息,不请求列表数据
+          _this.$refs.table.localLoading = false
+          _this.$refs.table.clearTable()
+        } else if (this.onlyList) {
+          _this.disabled = true
+          if (_this.queryParam.vinCode && _this.vinInfoData) {
+            return _this.getList(Object.assign(params, { productCodeList: _this.vinInfoData.partCodeList }))
+          } else {
+            return _this.getList(params)
+          }
+        } else { //  未输入vin码信息,只查列表数据
+          _this.disabled = true
+          return _this.getList(params)
+        }
+      },
+      openModal: false, //  查看客户详情  弹框
+      cost: false, // 成本价
+      cityPrice: false, // 城市价
+      tyuePrice: false, // 特约价
+      zdPrice: false, // 终端价
+      openCarInfoModal: false,
+      onlyList: false
+    }
+  },
+  computed: {
+    hasVaild () {
+      return this.queryParam.productCode || this.queryParam.productName || this.queryParam.brandSn || this.queryParam.productTypeSn1 || this.queryParam.warehouseSn || this.queryParam.existStockFlag || this.queryParam.vinCode
+    },
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '产品编码', dataIndex: 'productCode', width: '150px', align: 'center', sorter: true, customRender: function (text) { return text || '--' }, fixed: 'left' },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '150px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'brandName', width: '120px', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+      ]
+      if (this.cost) {
+        this.tableWidth += 100
+        arr.push({ slots: { title: 'costTitle' }, dataIndex: 'putCost', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }else{
+        this.tableWidth -= 100
+      }
+      if (this.cityPrice) {
+        this.tableWidth += 80
+        arr.push({ title: '市级价', dataIndex: 'dealerProduct.cityPrice', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }else{
+        this.tableWidth -= 80
+      }
+      if (this.tyuePrice) {
+        this.tableWidth += 80
+        arr.push({ title: '特约价', dataIndex: 'dealerProduct.specialPrice', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }else{
+        this.tableWidth -= 80
+      }
+      if (this.zdPrice) {
+        this.tableWidth += 80
+        arr.push({ title: '终端价', dataIndex: 'dealerProduct.terminalPrice', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }else{
+        this.tableWidth -= 80
+      }
+
+      return arr.concat([
+        { title: '仓库', dataIndex: 'warehouseName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'unit', width: '60px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '库存数量', dataIndex: 'currentQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') }, fixed: 'right' },
+        { title: '售价', dataIndex: 'salePrice', scopedSlots: { customRender: 'salePrice' }, width: '120px', align: 'center', fixed: 'right' },
+        { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: '100px', align: 'center', fixed: 'right' },
+        { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: '120px', align: 'center', fixed: 'right' }
+      ])
+    }
+  },
+  created () {
+    // 仓库
+    if (this.warehouseList.length == 0) {
+      this.getWarehouse()
+    }
+  },
+  methods: {
+    hasChecked(item){
+      return this.checkedList.includes(item.productSn)
+    },
+    // 查询
+    searchForm () {
+      if (this.hasVaild) {
+        this.showTable = true
+        if (this.$refs.table) {
+          this.$refs.table.refresh(true)
+        }
+      } else {
+        this.showTable = false
+        this.$message.info('请输入查询条件')
+      }
+    },
+    getList (params) {
+      const _this = this
+      return querySumByProductLocation(params).then(res => {
+        let data
+        this.onlyList = false
+        if (res.status == 200) {
+          data = res.data
+          data.list = data.list.filter(item => item != null)
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = data.list[i].productSn + '_' + (no + i + 1)
+            data.list[i].salesNums = 1
+            data.list[i].currentQty = data.list[i].currentQty || 0
+            data.list[i].price = data.list[i].origSalePriceFlag == 0 ? data.list[i].lastSalePrice : data.list[i].origSalePriceFlag == 1 ? data.list[i].salePrice : data.list[i].selfSaleprice
+            data.list[i].productOrigCode = data.list[i].productOrigCode ? data.list[i].productOrigCode.trim() : ''
+          }
+          if (!params.vinCode) {
+            _this.vinInfoData = null
+          }
+        } else {
+          data = {
+            list: [],
+            pageNo: 1,
+            pageSize: 10
+          }
+        }
+        _this.disabled = false
+        console.log(data)
+        return data
+      })
+    },
+    // vin  change
+    vinCodeChange (e) {
+      if (e.target.value.length == 17) {
+        supperCodeByVin({ vin: e.target.value }).then(res => {
+          if (res.status == 200) {
+            this.queryParam.productCodeList = res.data
+          } else {
+            this.queryParam.productCodeList = undefined
+          }
+        })
+      } else {
+        this.queryParam.productCodeList = undefined
+      }
+    },
+    // 双击列表
+    handleClickRow (record) {
+      if(!this.hasChecked(record)){
+        this.$emit('add', record)
+      }
+    },
+    //  重置
+    resetSearchForm (flag) {
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.productOrigCode = ''
+      this.queryParam.brandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.queryParam.warehouseSn = undefined
+      this.queryParam.productCodeList = undefined
+      this.queryParam.existStockFlag = undefined
+      this.queryParam.vinCode = ''
+      this.productType = []
+      this.$refs.ruleForm.resetFields()
+      this.vinInfoData = null
+      this.showTable = false
+
+      if(!flag){
+        this.$refs.table.refresh(true)
+      }
+    },
+    pageInit (buyerSn, priceType, salesBillSn) {
+      this.priceType = priceType || ''
+      this.buyerSn = buyerSn || ''
+      this.queryParam.salesBillSn = salesBillSn || ''
+    },
+    // 刷新当前页面
+    resetCurForm () {
+      this.$refs.table.refresh()
+    },
+    // 清空数据
+    clearTable () {
+      this.vinInfoData = null
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
+    },
+    filterOption (input, option) {
+      return (
+        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      )
+    },
+    // 选择配件
+    handleAdd (row) {
+      const _this = this
+      console.log(row.price, row.lastSalePrice, row.salePrice, row.lastSalePrice < row.salePrice)
+      if (row.lastSalePrice && (row.price < row.salePrice)) {
+        _this.$confirm({
+          title: '提示',
+          content: '售价低于定价,是否仍继续添加?',
+          centered: true,
+          closable: true,
+          onOk () {
+            _this.$emit('add', row)
+          }
+        })
+      } else {
+        _this.$emit('add', row)
+      }
+    },
+    // 销售记录
+    handleDetail (row) {
+      this.$emit('viewRecord',row)
+    },
+    uploadFun () {
+      document.getElementById('filed').click()
+    },
+    filePreview (e) {
+      const _this = this
+      var files = e.target.files[0]
+      const formData = new FormData()
+      formData.append('savePathType', 'local')
+      formData.append('file', files)
+      this.vinLoading = true
+      vinCodeParse(formData).then(res => {
+        if (res.type == 'application/json') {
+          var reader = new FileReader()
+          reader.addEventListener('loadend', function () {
+            const obj = JSON.parse(reader.result)
+            if (obj.status == 200) {
+              _this.queryParam.vinCode = obj.data || ''
+              // 移除表单项的校验结果
+              _this.$refs.ruleForm.clearValidate('vinCode')
+            } else {
+              _this.$notification.error({
+                message: '提示',
+                description: obj.message
+              })
+            }
+            _this.vinLoading = false
+            document.getElementById('filed').value = ''
+          })
+          reader.readAsText(res)
+        } else {
+          _this.vinLoading = false
+        }
+      })
+    },
+    // 仓库
+    getWarehouse () {
+      warehouseAllList({}).then(res => {
+        if (res.status == 200) {
+          this.warehouseList = res.data
+        } else {
+          this.warehouseList = []
+        }
+      })
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    // 查看是否有库存、
+    handleHasQty (val) {
+      this.queryParam.existStockFlag = val
+    },
+    onClose () {
+      this.resetSearchForm(true)
+      this.$emit('close')
+    },
+    setTableH () {
+      this.$nextTick(() => {
+        const searchBoxH = this.$refs.searchBox.offsetHeight
+        this.tableHeight = window.innerHeight - searchBoxH - 245
+      })
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.chooseProduct-drawer {
+  .ant-drawer-header{
+    padding: 13px 20px;
+  }
+  .ant-drawer-body {
+    padding: 15px 20px;
+    height: calc(100% - 50px);
+    display: flex;
+    flex-direction: column;
+    overflow: auto;
+    > div {
+      height: 100%;
+    }
+    .noStock{
+      text-decoration: line-through;
+      color: red;
+    }
+    .ant-input-number-sm input{
+      text-align: center;
+    }
+    .vinInfo-box{
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      .vinInfo-error{
+        color: red;
+      }
+    }
+  }
+}
+</style>

+ 447 - 0
src/views/salesManagement/salesQueryNew/chooseShelfProduct.vue

@@ -0,0 +1,447 @@
+<template>
+  <a-drawer
+    :zIndex="zIndex"
+    :title="mtitle"
+    placement="right"
+    :visible="isShow"
+    :width="width"
+    :get-container="false"
+    :wrap-style="{ position: 'absolute' }"
+    @close="isShow = false"
+    wrapClassName="chooseShelf-modal jg-drawer-wrap"
+     >
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-tabs type="card">
+        <a-tab-pane :defaultActiveKey="curTab" v-model="curTab" :key="1" tab="待补货产品">
+          <!-- 搜索条件 -->
+          <div ref="searchBox" class="table-page-search-wrapper">
+            <a-form-model
+              ref="ruleForm"
+              class="form-model-con"
+              layout="inline"
+              :model="queryParam"
+              @keyup.enter.native="$refs.table.refresh(true)" >
+              <a-row type="flex" :gutter="5">
+                <a-col flex="250px">
+                  <a-form-model-item label="产品编码">
+                    <a-input id="chooseShelf-code" ref="searchProductCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+                  </a-form-model-item>
+                </a-col>
+                <a-col flex="250px">
+                  <a-form-model-item label="产品名称">
+                    <a-input id="chooseShelf-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+                  </a-form-model-item>
+                </a-col>
+                <a-col flex="250px">
+                  <a-form-model-item label="产品分类">
+                    <ProductType id="chooseShelf-productType" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
+                  </a-form-model-item>
+                </a-col>
+                <a-col flex="370px">
+                  <a-form-model-item label="库存情况">
+                    <a-select v-model.trim="queryParam.stockStateList" mode="multiple" :options="options" placeholder="请选择库存情况" />
+                  </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-col>
+              </a-row>
+            </a-form-model>
+            <div class="table-operator">
+              <div>
+                <a-button type="primary" @click="handlePlAdd">批量添加</a-button>
+                <span style="margin-left: 10px;" v-if="selectTotal">已选{{ selectTotal }}项</span>
+              </div>
+              <div>
+                <a-icon type="info-circle" />
+                此界面仅显示货架上需要补货的产品
+              </div>
+            </div>
+          </div>
+          <div class="chooseShelf-modal-table">
+            <!-- 列表 -->
+            <s-table
+              class="sTable"
+              ref="table"
+              size="small"
+              :rowKey="(record) => record.id"
+              :row-selection="{columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.includeFlag == 1 } })}"
+              @rowSelection="rowSelectionFun"
+              :columns="columns"
+              :data="loadData"
+              :scroll="{ y: tableHeight }"
+              :showPagination="false"
+              bordered>
+              <!-- 售价 -->
+              <template slot="salePrice" slot-scope="text, record">
+                <div style="display: flex;align-items: center;" @dblclick.stop>
+                  <a-input-number
+                    size="small"
+                    v-model="record.price"
+                    :precision="2"
+                    :min="0"
+                    :max="999999"
+                    style="width: 100%;"
+                    placeholder="请输入" />
+                  <span style="color: red;margin: 0 2px;font-size: 14px;" v-if="record.origSalePriceFlag == 1">原</span>
+                  <span v-else>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
+                </div>
+              </template>
+              <!-- 销售数量 -->
+              <template slot="nums" slot-scope="text, record">
+                <div @dblclick.stop>
+                  <a-input-number
+                    size="small"
+                    v-model="record.salesNums"
+                    :precision="0"
+                    :min="0"
+                    :max="999999"
+                    style="width: 100%;"
+                    placeholder="请输入" />
+                </div>
+              </template>
+              <!-- 操作 -->
+              <template slot="action" slot-scope="text, record">
+                <a-button
+                  size="small"
+                  type="link"
+                  class="button-primary"
+                  @click.stop="handleAdd(record)"
+                  v-if="record.includeFlag != 1"
+                  id="productInfoList-edit-btn">添加</a-button>
+                <span style="color:#999;" v-else>已添加</span>
+                <a-button
+                  size="small"
+                  type="link"
+                  class="button-primary"
+                  @click.stop="handleDetail(record)"
+                  id="productInfoList-detail-btn"
+                  style="margin-left: 5px;">销售记录</a-button>
+              </template>
+            </s-table>
+          </div>
+        </a-tab-pane>
+        <a-tab-pane :key="2" tab="全部货架产品">
+          <!-- 搜索条件 -->
+          <div ref="searchBox1" class="table-page-search-wrapper">
+            <a-form-model
+              ref="ruleForm1"
+              class="form-model-con"
+              layout="inline"
+              :model="queryParam1"
+              @keyup.enter.native="$refs.table1.refresh(true)" >
+              <a-row :gutter="15">
+                <a-col :md="6" :sm="24">
+                  <a-form-model-item label="产品编码">
+                    <a-input id="chooseShelf-code1" v-model.trim="queryParam1.productCode" allowClear placeholder="请输入产品编码"/>
+                  </a-form-model-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-model-item label="产品名称">
+                    <a-input id="chooseShelf-name1" v-model.trim="queryParam1.productName" allowClear placeholder="请输入产品名称"/>
+                  </a-form-model-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-model-item label="产品分类">
+                    <ProductType id="chooseShelf-productType1" :isDealer="true" @change="changeProductType1" v-model="productType1"></ProductType>
+                  </a-form-model-item>
+                </a-col>
+                <a-col :md="6" :sm="12" style="margin-bottom: 10px;">
+                  <a-button type="primary" @click="$refs.table1.refresh(true)" id="chooseShelf-refresh">查询</a-button>
+                  <a-button style="margin-left: 5px" @click="resetSearchForm1" id="chooseShelf-reset">重置</a-button>
+                </a-col>
+              </a-row>
+            </a-form-model>
+          </div>
+          <div class="chooseShelf-modal-table">
+            <!-- 列表 -->
+            <s-table
+              class="sTable"
+              ref="table1"
+              size="small"
+              :rowKey="(record) => record.id"
+              :columns="columns1"
+              :data="loadData1"
+              :scroll="{ y: tableHeight }"
+              :showPagination="false"
+              bordered>
+            </s-table>
+          </div>
+        </a-tab-pane>
+      </a-tabs>
+    </a-spin>
+  </a-drawer>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable } from '@/components'
+import ProductType from '../../common/productType.js'
+import { queryWaitReplenish, queryShelfProduct } from '@/api/shelfReplenish'
+export default {
+  name: 'OutinDetailModal',
+  components: { STable, ProductType },
+  mixins: [commonMixin],
+  props: {
+    openModal: {
+      //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    baseData: {
+      type: Object,
+      default: function () {
+        return null
+      }
+    },
+    width: {
+      type: [String, Number],
+      default: '80%'
+    },
+    zIndex: {
+      type: Number,
+      default: 100
+    },
+  },
+  data () {
+    return {
+      spinning: false,
+      advanced: false,
+      isShow: this.openModal, //  是否打开弹框
+      options: [
+        { label: '库存充足', value: 'stockEnough' },
+        { label: '部分缺货', value: 'portionStockout' },
+        { label: '全部缺货', value: 'allStockout' }
+      ],
+      curTab: 1,
+      tableHeight:0,
+      productType: [],
+      queryParam: {
+        productCode: '', //  产品编码
+        productName: '', //  产品名称
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
+        stockStateList: []
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        this.queryParam.shelfSn = this.baseData.shelfSn
+        this.queryParam.customerSn = this.baseData.customerSn
+        this.queryParam.salePriceType = this.baseData.salePriceType
+        this.queryParam.salesBillSn = this.baseData.salesBillSn
+
+        return queryWaitReplenish(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = 0
+            for (var i = 0; i < data.length; i++) {
+              data[i] = data[i].shelfProductApi
+              data[i].no = no + i + 1
+              data[i].salesNums = data[i].replenishBillWaitQty
+              data[i].putCost = data[i].cost
+            }
+          }
+          this.spinning = false
+          this.setTableH()
+          return data
+        })
+      },
+      rowSelectionInfo: null,
+      // -------- 全部产品 --------
+      productType1: [],
+      queryParam1: {
+        productCode: '', //  产品编码
+        productName: '', //  产品名称
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '' //  产品三级分类
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData1: parameter => {
+        this.spinning = true
+        this.queryParam1.shelfSn = this.baseData.shelfSn
+        this.queryParam1.customerSn = this.baseData.customerSn
+        this.queryParam1.salePriceType = this.baseData.salePriceType
+        this.queryParam1.salesBillSn = this.baseData.salesBillSn
+        return queryShelfProduct(Object.assign(parameter, this.queryParam1)).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
+            }
+          }
+          this.spinning = false
+          this.setTableH()
+          return data
+        })
+      }
+    }
+  },
+  computed: {
+    mtitle () {
+      return '货架产品' + (this.baseData && this.baseData.shelfName ? this.baseData.shelfName : '')
+    },
+    selectTotal () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRows.length
+    },
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '最大库容', dataIndex: 'maxQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '货架库存', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '补货在途', dataIndex: 'replenishBillQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调回在途', dataIndex: 'recallBillQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '待补货数量', dataIndex: 'replenishBillWaitQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '门店库存数量', dataIndex: 'qplsStockQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '售价', dataIndex: 'price', scopedSlots: { customRender: 'salePrice' }, width: '8%', align: 'center' },
+        { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: '8%', align: 'center' },
+        { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ]
+      return arr
+    },
+    columns1 () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '25%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '最大库容', dataIndex: 'maxQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '货架库存', dataIndex: 'qty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '补货在途', dataIndex: 'replenishBillQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '调回在途', dataIndex: 'recallBillQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    cansel () {
+      this.isShow = false
+    },
+    // 销售记录
+    handleDetail (row) {
+      this.$emit('viewRecord',row)
+    },
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    // 添加
+    handleAdd (row) {
+      const clist = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
+      const blist = this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys || []
+      const i = clist.findIndex(item => item.id == row.id)
+      const k = blist.findIndex(item => item == row.id)
+      console.log(i, k)
+      if (i >= 0) {
+        clist.splice(i, 1)
+      }
+      if (k >= 0) {
+        blist.splice(k, 1)
+      }
+      this.$emit('add', row)
+    },
+    // 批量添加
+    handlePlAdd () {
+      if (this.selectTotal) {
+        this.$emit('plAdd', this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || [])
+      } else {
+        this.$message.info('请选择产品')
+      }
+    },
+    resetSearchForm () {
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.productType = []
+      this.queryParam.stockStateList = []
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearSelected()
+      this.$refs.table.refresh(true)
+    },
+    reload () {
+      this.$refs.table.clearSelected()
+      this.$refs.table.refresh()
+    },
+    // ---------- 全部产品----------
+    //  产品分类  change
+    changeProductType1 (val, opt) {
+      this.queryParam1.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam1.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam1.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    resetSearchForm1 () {
+      this.queryParam1.productCode = ''
+      this.queryParam1.productName = ''
+      this.queryParam1.productTypeSn1 = ''
+      this.queryParam1.productTypeSn2 = ''
+      this.queryParam1.productTypeSn3 = ''
+      this.productType1 = []
+      this.$refs.ruleForm1.resetFields()
+      this.$refs.table1.refresh(true)
+    },
+    setTableH () {
+      this.$nextTick(() => {
+        this.tableHeight = window.innerHeight - (this.curTab == 1 ? this.$refs.searchBox.offsetHeight : this.$refs.searchBox1.offsetHeight) - 255 
+      })
+    }
+  },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    },
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      } else {
+        this.$nextTick(() => {
+          this.curTab = 1
+        })
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.chooseShelf-modal {
+	.ant-drawer-body {
+		padding: 5px;
+    .table-operator{
+        padding:5px 0;
+        display:flex;
+        justify-content: space-between;
+        align-items: center;
+      }
+    .chooseShelf-modal-table{
+      padding: 0 20px 10px;
+    }
+    .table-page-search-wrapper{
+      padding: 5px 20px 0;
+    }
+	}
+}
+</style>

+ 340 - 0
src/views/salesManagement/salesQueryNew/detail.vue

@@ -0,0 +1,340 @@
+<template>
+  <div v-if="showPage" class="jg-page-wrap salesDetail-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="salesDetail-cont" :style="{ padding: !outBizSn ? '16px 24px' : '0px 24px' }">
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle" v-if="!outBizSn && detailData">
+          <span class="billno">单号:{{ detailData.salesBillNo ||'--' }}</span>
+          <a-tag color="green" v-if="detailData.billStatusDictValue">{{ detailData.billStatusDictValue }}</a-tag>
+          <a-tag color="orange" v-if="detailData.financialStatusDictValue">{{ detailData.financialStatusDictValue }}</a-tag>
+          <a-button type="link" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo" style="margin-left:10px;vertical-align:middle;">
+            <a-icon :type="isShowBisiceInfo ? 'eye-invisible' : 'eye'"/>
+            查看信息
+          </a-button>
+          <a-button id="purchaseNewOrderEdit-back-btn" type="link" @click="handleBack" class="button-default"> <a-icon type="rollback" /> 返回列表</a-button>
+        </template>
+        <!-- 操作区,位于 title 行的行尾 -->
+        <template slot="extra" v-if="outBizSn ? $hasPermissions('B_outboundOrderDetail') : $hasPermissions('B_salesPrint')">
+          <div style="margin-top: 5px;">
+            <PrintPanel ref="printBox" position="bottomRight" :disabled="localDataSource.length==0" @handlePrint="handlePrint">
+              <div style="padding:10px;" slot="extendCons">
+                <a-checkbox v-model="printAllName" :checked="printAllName" id="salesQuery-printAllName">打印完整产品名称</a-checkbox>
+                <a-checkbox v-model="printOrgCode" :checked="printOrgCode" id="salesQuery-printOrgCode">打印原厂编码</a-checkbox>
+              </div>
+            </PrintPanel>
+          </div>
+        </template>
+      </a-page-header>
+    <div class="sales-detail-body">
+      <!-- 基础信息 -->
+      <a-card size="small" :bordered="false" class="salesDetail-cont" v-show="isShowBisiceInfo">
+        <a-descriptions size="small" :column="3">
+          <div slot="title">基础信息</div>
+          <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerNameCurrent?detailData.buyerName?detailData.buyerName==detailData.buyerNameCurrent?detailData.buyerNameCurrent:detailData.buyerNameCurrent+'('+detailData.buyerName+')':detailData.buyerNameCurrent:'--' }}</a-descriptions-item>
+          <a-descriptions-item label="客户地址" :span="2">
+            <div v-if="detailData&&(detailData.shippingAddressProvinceName || detailData.shippingAddressCityName || detailData.shippingAddressCountyName || detailData.shippingAddress)">
+              {{ detailData&&detailData.shippingAddressProvinceName || '' }}
+              {{ detailData&&detailData.shippingAddressCityName || '' }}
+              {{ detailData&&detailData.shippingAddressCountyName || '' }}
+              {{ detailData&&detailData.shippingAddress || '' }}
+            </div>
+            <span v-else>--</span>
+          </a-descriptions-item>
+          <a-descriptions-item label="收款方式">{{ detailData&&detailData.settleStyleSnDictValue || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="联系电话">{{ detailData&&detailData.consigneeTel || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="备注">{{ detailData&&detailData.remarks || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="销售单号">{{ detailData&&detailData.salesBillNo || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="制单人">{{ detailData&&detailData.operatorName || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="业务员">{{ detailData&&detailData.salesManName || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="来源">{{ detailData&&detailData.sourceTypeDictValue || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="下级采购单号" v-if="detailData&&detailData.sourceType=='PURCHASE'">{{ detailData&&detailData.purchaseBillNo || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="业务状态">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
+          <a-descriptions-item label="财务状态">{{ detailData&&detailData.financialStatusDictValue || '--' }}</a-descriptions-item>
+        </a-descriptions>
+      </a-card>
+      <a-card size="small" :bordered="false" class="pages-wrap">
+        <!-- alert -->
+        <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom:10px;">
+          <div>
+            总款数:<strong>{{ detailData&&(detailData.totalCategory || detailData.totalCategory==0) ? detailData.totalCategory : '--' }}</strong>;
+            总数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
+            总赠品数量:<strong>{{ detailData&&(detailData.giftQty || detailData.giftQty==0) ? detailData.giftQty : '--' }}</strong>;
+            急件总款数:<strong>{{ detailData&&(detailData.oosCategory || detailData.oosCategory==0) ? detailData.oosCategory : '--' }}</strong>;
+            急件总数量:<strong>{{ detailData&&(detailData.oosQty || detailData.oosQty==0) ? detailData.oosQty : '--' }}</strong>;<br/>
+            总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</strong>;
+            <template v-if="showCost">
+              总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</strong>;
+              总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</strong>;
+            </template>
+            折后总售价:<strong>{{ detailData&&(detailData.discountedAmount || detailData.discountedAmount==0) ? toThousands(detailData.discountedAmount) : '--' }}</strong>;
+            折扣:<strong>{{ detailData&&(detailData.discountRate || detailData.discountRate==0) ? detailData.discountRate+'%' : '--' }}</strong>;
+            折扣金额:<strong>{{ detailData&&(detailData.discountAmount || detailData.discountAmount==0) ? toThousands(detailData.discountAmount) : '--' }}</strong>;
+          </div>
+          <div>
+            <a-checkbox v-model="showCost" v-if="$hasPermissions('M_ShowAllCost')" id="salesQuery-cost">成本价</a-checkbox>
+          </div>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :defaultLoadData="false"
+          bordered>
+          <div slot="costTitle">
+            <a-tooltip placement="top">
+              <template slot="title">
+                系统中不同批次的产品,成本价可能不同,此值是按照实际出库批次的成本计算得到。
+              </template>
+              <span style="margin-right: 5px;">实际总成本</span> <a-icon type="question-circle" />
+            </a-tooltip>
+          </div>
+          <!-- 产品编码 -->
+          <template slot="productCode" slot-scope="text, record">
+            <div v-if="detailData">
+              <div v-if="isOwerEdit">
+                <a-badge count="急" v-if="record.oosFlag == 1">
+                  <div style="padding-right: 15px;">{{ text }}</div>
+                </a-badge>
+                <span v-else>{{ text }}</span>
+              </div>
+              <div v-else>
+                <a-badge count="急" v-if="isAudit&&record.oosFlag == 1">
+                  <div style="padding-right: 15px;">{{ text }}</div>
+                </a-badge>
+                <a-badge count="缺" v-else-if="!isAudit&&(!record.currentStockQty || record.currentStockQty < record.qty)">
+                  <div style="padding-right: 15px;">{{ text }}</div>
+                </a-badge>
+                <span v-else>{{ text }}</span>
+              </div>
+            </div>
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button size="small" type="link" v-if="record.oosFlag == 0" class="button-primary" @click="handleViewDetail(record)">出库明细</a-button>
+            <span v-else>--</span>
+          </template>
+        </s-table>
+      </a-card>
+    </div>
+    </a-spin>
+     <!-- 出入库明细 -->
+     <outInDetialModal ref="outInDetialModal" outBizType="SALES" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { getOperationalPrecision } from '@/libs/tools.js'
+import { STable, VSelect } from '@/components'
+import { salesDetailBySn, salesDetailPrint, salesDetailExport } from '@/api/sales'
+import { salesDetailList } from '@/api/salesDetail'
+import outInDetialModal from './outInDetialModal.vue'
+import PrintPanel from '@/views/common/printPanel.vue'
+import { hdPrint } from '@/libs/JGPrint'
+export default {
+  name: 'SalesDetail',
+  components: { STable, VSelect, PrintPanel, outInDetialModal },
+  mixins: [commonMixin],
+  props: {
+    outBizSn: { //  有值则为弹框,无值则为页面
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      showPage: false,
+      spinning: false,
+      disabled: false,
+      showCost: false,
+      printOrgCode: false, // 打印原创编码
+      printAllName: false, // 打印全部名称
+      showOutInModal: false,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        return salesDetailList(Object.assign(parameter, { orderBy: "sales_bill_detail.CREATE_DATE desc", salesBillSn: this.outBizSn || this.$route.params.sn })).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              const productCode = (data.list[i].productEntity && data.list[i].productEntity.code) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.code)
+              const productName = (data.list[i].productEntity && data.list[i].productEntity.name) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.name)
+              const productOrigCode = (data.list[i].productEntity && data.list[i].productEntity.origCode) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.origCode) || '--'
+              const productOrigUnit = (data.list[i].productEntity && data.list[i].productEntity.unit) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.unit)
+              data.list[i].productCode = productCode || '--'
+              data.list[i].productName = productName || '--'
+              data.list[i].productOrigCode = productOrigCode || '--'
+              data.list[i].productOrigUnit = productOrigUnit || '--'
+              data.list[i].warehouseName = data.list[i].warehouseEntity && data.list[i].warehouseEntity.name || '--'
+              data.list[i].warehouseLocationName = data.list[i].warehouseLocationEntity && data.list[i].warehouseLocationEntity.name || '--'
+              // 售价小计  由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
+              data.list[i].salePriceSubtotal = getOperationalPrecision(data.list[i].price, data.list[i].qty)
+            }
+            this.localDataSource = data.list
+            this.disabled = false
+          }
+          return data
+        })
+      },
+      localDataSource: [],
+      detailData: null, //  详情数据
+      isShowBisiceInfo: false// 显示基础内容
+    }
+  },
+  computed: {
+    // 是否自建单据
+    isOwerEdit () {
+      return this.detailData && this.detailData.sourceType == 'SALES'
+    },
+    // 是否审核通过
+    isAudit () {
+      return this.detailData ? (this.detailData.billStatus == 'WAIT_OUT_WAREHOUSE' || this.detailData.billStatus == 'FINISH') : false
+    },
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '11%', scopedSlots: { customRender: 'productCode' }, align: 'center' },
+        { title: '产品名称', dataIndex: 'productName', width: '11%', align: 'center', customRender: function (text) { return text || '--' },ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '9%', align: 'center', customRender: function (text) { return text && text != ' ' ? text : '--' } },
+        { title: '售价', dataIndex: 'price', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '折后售价', dataIndex: 'discountedPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '销售数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { 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) : '--') } },
+        { title: '折后小计', dataIndex: 'discountedAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '折扣金额', dataIndex: 'discountAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        // { title: '仓库', dataIndex: 'warehouseName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { title: '仓位', dataIndex: 'warehouseLocationName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '是否急件', dataIndex: 'oosFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
+      ]
+      // 实际总成本
+      if (this.showCost) {
+        arr.splice(11, 0, { slots: { title: 'costTitle' }, dataIndex: 'totalCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      } else {
+        arr.splice(11, 1)
+      }
+      // 下级创建,不显示仓库仓位
+      if (!this.isOwerEdit) {
+        arr.splice(this.showCost ? 12 : 11, 0, { title: '库存数量', dataIndex: 'currentStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      } else {
+        arr.splice(this.showCost ? 12 : 11, 0, { title: '仓库', dataIndex: 'warehouseName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } })
+        arr.splice(this.showCost ? 13 : 12, 0, { title: '仓位', dataIndex: 'warehouseLocationName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    // 打印预览/快捷打印
+    handlePrint (type, printerType) {
+      const _this = this
+      _this.$store.state.app.printLoading = true
+      let url = salesDetailPrint
+      const params = { sn: this.outBizSn || this.$route.params.sn, printOrgCode: this.printOrgCode ? 1 : 0, printAllName: this.printAllName ? 1 : 0 }
+      if (type == 'export') { //  导出
+        url = salesDetailExport
+      }
+      // 打印或导出
+      hdPrint(printerType, type, url, params, '销售单', function () {
+        _this.$store.state.app.printLoading = false
+      })
+    },
+    //  返回
+    handleBack () {
+      this.$router.push({ name: 'salesNewList' })
+    },
+    // 编辑
+    // handleEdit () {
+    //   const row = this.detailData
+    //   this.$router.push({ name: 'salesNewEdit', params: { id: row.id, sn: row.salesBillSn, priceType: row.priceType } })
+    // },
+    //  详情
+    getDetail () {
+      salesDetailBySn({ salesBillSn: this.outBizSn || this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.detailData = res.data
+        } else {
+          this.detailData = null
+        }
+      })
+    },
+    // 出入库明细
+    handleViewDetail (row) {
+      this.showOutInModal = true
+      this.$refs.outInDetialModal.getData(row)
+    },
+    pageInit () {
+      const vm = this
+      vm.$nextTick(() => {
+        vm.spinning = false
+        vm.disabled = false
+        // 是否默认打印原厂编码
+        vm.printOrgCode = localStorage.getItem('printOrgCode-' + this.$store.state.user.info.orgId) == 'true'
+        vm.printAllName = localStorage.getItem('printAllName-' + this.$store.state.user.info.orgId) == 'true'
+        vm.$refs.table.refresh(true)
+        vm.getDetail()
+      })
+    }
+  },
+  watch: {
+    printOrgCode (newValue, oldValue) {
+      localStorage.setItem('printOrgCode-' + this.$store.state.user.info.orgId, newValue)
+    },
+    printAllName (newValue, oldValue) {
+      localStorage.setItem('printAllName-' + this.$store.state.user.info.orgId, newValue)
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab || this.outBizSn) { // 页签刷新时调用
+      this.showPage = true
+      this.pageInit()
+    }
+  },
+  activated () {
+    this.showPage = true
+    this.pageInit()
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+    })
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .salesDetail-wrap{
+    position: relative;
+    height: 100%;
+    .billno{
+      font-size: 16px;
+      font-weight: 600;
+      display: inline-block;
+      vertical-align: middle;
+      color: #333;
+      margin-right: 15px;
+    }
+    .ant-tag-green,.ant-tag-orange{
+      vertical-align: middle;
+    }
+    .salesDetail-cont{
+      margin-bottom: 10px;
+      /deep/ .ant-descriptions-title{
+          margin-bottom: 10px;
+        }
+    }
+    .pages-wrap{
+        strong{
+          color:#f12929;
+        }
+    }
+    
+  }
+</style>

+ 990 - 0
src/views/salesManagement/salesQueryNew/edit.vue

@@ -0,0 +1,990 @@
+<template>
+  <div v-if="showPage" class="jg-page-wrap salesEdit-news-wrap">
+    <a-page-header :ghost="false" :backIcon="false" class="header-bar">
+      <!-- 自定义的二级文字标题 -->
+      <template slot="subTitle">
+        <a class="billno" style="margin-right:15px;">单号:{{ detailData&&detailData.salesBillNo || '--' }}</a>
+        <a-tag color="green" v-if="detailData.billStatusDictValue">{{ detailData.billStatusDictValue }}</a-tag>
+        <a-tag color="orange" v-if="detailData.financialStatusDictValue">{{ detailData.financialStatusDictValue }}</a-tag>
+        <!-- <span style="margin-left:10px;color: #666;">客户名称:{{ detailData&&detailData.buyerNameCurrent?detailData.buyerName?detailData.buyerNameCurrent==detailData.buyerName?detailData.buyerNameCurrent:detailData.buyerNameCurrent+'('+detailData.buyerName+')':detailData.buyerNameCurrent:'--' }}</span> -->
+        <a-button
+          id="salesEdit-edit-btn"
+          type="link"
+          style="margin-left:10px"
+          v-if="detailData&&detailData.salesTragetType != 'DEALER'"
+          size="small"
+          @click="handleEdit"
+          key="0"><a-icon type="edit" /> 编辑</a-button>
+        <a-button id="purchaseNewOrderEdit-back-btn" type="link" @click="handleBack" class="button-default"> <a-icon type="rollback" /> 返回列表</a-button>
+      </template>
+      <!-- 操作区,位于 title 行的行尾 -->
+      <template slot="extra" v-if="$hasPermissions('B_salesPrint')">
+        <div style="margin-top: 5px;">
+          <PrintPanel ref="printBox" :disabled="dataSource.length==0" @handlePrint="handlePrint">
+            <div style="padding:10px;" slot="extendCons">
+              <a-checkbox v-model="printAllName" :checked="printAllName" id="salesQuery-printAllName">打印完整产品名称</a-checkbox>
+              <a-checkbox v-model="printOrgCode" :checked="printOrgCode" id="salesQuery-printOrgCode">打印原厂编码</a-checkbox>
+            </div>
+          </PrintPanel>
+          <a-divider type="vertical" v-if="detailData&&detailData.totalCategory" />
+          <a-button type="link" v-if="detailData&&detailData.totalCategory" @click="showSearch=!showSearch" :class="showSearch?'button-error':'button-default'"> <a-icon type="search" /> 筛选</a-button>
+          <a-divider type="vertical" v-if="detailData&&detailData.totalCategory" />
+          <a-button v-if="detailData&&detailData.totalCategory" id="salesNewOrderEdit-add-btn" type="link" @click="openChooseProduct=true"><a-icon type="plus" />添加产品</a-button>
+          <a-divider type="vertical" v-if="detailData&&detailData.totalCategory" />
+          <a-dropdown v-model="showCell" v-if="$hasPermissions('M_ShowAllCost')&&detailData&&detailData.totalCategory">
+            <a-button type="link" class="button-default"> <a-icon type="setting" />  显示</a-button>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a-checkbox v-model="isCosts" id="salesQuery-edit-cost">成本价</a-checkbox>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+          <a-divider type="vertical" v-if="$hasPermissions('M_ShowAllCost')"/>
+          <a-dropdown>
+            <a-menu slot="overlay" @click="handleActions">
+              <a-menu-item key="4">
+                <a-icon type="import" />导入产品
+              </a-menu-item>
+              <a-menu-item key="3" v-if="shelfInfo&&shelfInfo.state=='ENABLE'">
+                <a-icon type="hdd"/>货架产品
+              </a-menu-item>
+              <a-menu-item key="2">
+                <a-icon type="close-square"/>清空列表
+              </a-menu-item>
+              <a-menu-item key="1">
+                <a-icon type="rest" style="font-size: 14px;" />{{ isOwerEdit?'删除急件':'删除缺货' }}
+              </a-menu-item>
+            </a-menu>
+            <a-button type="link" class="button-default"> <a-icon type="unordered-list" />  更多</a-button>
+          </a-dropdown>
+        </div>
+      </template>
+    </a-page-header>
+    <!-- 已选产品 -->
+    <div class="choosedList-cont">
+      <div class="choosed-table" v-if="detailData&&detailData.totalCategory">
+        <!-- 搜索条件 -->
+        <div class="table-page-search-wrapper" style="margin-bottom:0;" v-if="showSearch">
+          <a-form-model :model="productForm" ref="ruleForm" layout="inline" @keyup.enter.native="$refs.table.refresh(true)" >
+            <a-row :gutter="10">
+              <a-col :md="5" :sm="24">
+                <a-form-model-item label="产品编码">
+                  <a-input v-model.trim="productForm.productCode" allowClear placeholder="输入产品编码" />
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="5" :sm="24">
+                <a-form-model-item label="产品名称">
+                  <a-input v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="4" :sm="24" v-if="isOwerEdit">
+                <a-form-item label="是否为急件">
+                  <a-select allowClear v-model="productForm.oosFlag" placeholder="请选择是否">
+                    <a-select-option value="1">
+                      是
+                    </a-select-option>
+                    <a-select-option value="0">
+                      否
+                    </a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+              <!-- <a-col :md="4" :sm="24" v-else>
+                <a-form-item label="是否为缺货">
+                  <a-select allowClear v-model="productForm.oosFlag" placeholder="请选择是否">
+                    <a-select-option value="1">
+                      是
+                    </a-select-option>
+                    <a-select-option value="0">
+                      否
+                    </a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col> -->
+              <a-col :md="4" :sm="24">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesEdit-refresh">查询</a-button>
+                <a-button style="margin-left: 5px" @click="resetForm" id="salesEdit-reset">重置</a-button>
+              </a-col>
+            </a-row>
+          </a-form-model>
+        </div>
+        <div class="discount-box">
+
+        </div>
+        <!-- 已选配件列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          :pageSize="30"
+          bordered>
+          <div slot="costTitle">
+            <a-tooltip placement="top">
+              <template slot="title">
+                系统中不同批次的产品,成本价可能不同,此值是按照实际出库批次的成本计算得到。
+              </template>
+              <span style="margin-right: 5px;">实际总成本</span> <a-icon type="question-circle" />
+            </a-tooltip>
+          </div>
+          <!-- 产品名称 -->
+          <template slot="productName" slot-scope="text, record">
+            <a-tag color="blue" v-if="record.shelfPlaceCode">{{ record.shelfPlaceCode }}</a-tag>
+            <span>{{ text }}</span>
+          </template>
+          <!-- 产品编码 -->
+          <template slot="productCode" slot-scope="text, record">
+            <div v-if="detailData">
+              <div v-if="isOwerEdit">
+                <a-badge count="急" v-if="record.oosFlag == 1">
+                  <div style="padding-right: 15px;">{{ text }}</div>
+                </a-badge>
+                <span v-else>{{ text }}</span>
+              </div>
+              <div v-else>
+                <a-badge count="急" v-if="isAudit&&record.oosFlag == 1">
+                  <div style="padding-right: 15px;">{{ text }}</div>
+                </a-badge>
+                <a-badge count="缺" v-else-if="!isAudit&&(!record.currentStockQty || record.currentStockQty < record.qty)">
+                  <div style="padding-right: 15px;">{{ text }}</div>
+                </a-badge>
+                <span v-else>{{ text }}</span>
+              </div>
+            </div>
+          </template>
+          <!-- 售价 -->
+          <template slot="price" slot-scope="text, record">
+            <div style="display:flex;align-items: center;" :class="record.cost > record.price?'redBg-row':''">
+              <div v-if="record.cost > record.price">
+                <a-tooltip placement="top">
+                  <template slot="title">
+                    售价低于成本价
+                  </template>
+                  <a-icon type="warning" />
+                </a-tooltip>
+              </div>
+              <a-input-number
+                size="small"
+                v-model="record.price"
+                :precision="2"
+                :min="0"
+                :max="999999"
+                placeholder="请输入"
+                @blur="e => priceBlur(e.target.value, record)"
+                style="flex-grow: 1;margin-left: 3px;text-align: right;"
+              />
+            </div>
+          </template>
+          <!-- 销售数量 -->
+          <template slot="salesNums" slot-scope="text, record">
+            <a-input-number
+              id="salesEdit-salesNums"
+              size="small"
+              v-model="record.qty"
+              :precision="0"
+              :min="1"
+              :max="999999"
+              placeholder="请输入"
+              @blur="e => qtyBlur(e.target.value, record)"
+              style="width: 100%;" />
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button size="small" v-if="record.oosFlag == 0" type="link" class="button-primary" @click="handleViewDetail(record)">出库明细</a-button>
+            <a-button
+              size="small"
+              type="link"
+              :loading="delLoading"
+              class="button-error"
+              @click="handleDel(record)"
+              id="productInfoList-Del">删除</a-button>
+          </template>
+        </s-table>
+      </div>
+      <div class="choosed-table" v-else>
+        <div v-if="!spinning&&detailData.totalCategory==0">
+          <a-empty
+            :image="simpleImage"
+            :image-style="{
+              height: '60px',
+            }"
+          >
+            <span slot="description"> 暂无产品 </span>
+            <a-button type="primary" class="button-error" @click="openChooseProduct=true"><a-icon type="plus" />立即添加产品</a-button>
+          </a-empty>
+        </div>
+        <div style="text-align: center;padding: 30px 50px;" v-if="spinning">
+          <a-spin :spinning="spinning" tip="Loading..."></a-spin>
+        </div>
+      </div>
+
+      <!-- 底部栏 -->
+      <div class="footer-bar" v-if="detailData&&detailData.totalCategory">
+        <!-- 总计 -->
+        <div v-if="detailData" class="total-bar">
+          <div>
+            总款数:<span>{{ detailData&&(detailData.totalCategory || detailData.totalCategory==0) ? detailData.totalCategory : '--' }}</span>,
+            总数量:<span>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</span>,
+            赠品总数量:<span>{{ detailData&&(detailData.giftQty || detailData.giftQty==0) ? detailData.giftQty : '--' }}</span>,
+            <template v-if="isCosts">
+              总成本价:<span class="red">{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? toThousands(detailData.totalCost) : '--' }}</span>,
+              毛利:<span class="red">{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? toThousands(detailData.grossProfit) : '--' }}</span>,
+            </template>
+            <div style="display: inline-block;">
+              总售价:<span class="red">{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? toThousands(detailData.totalAmount) : '--' }}</span>
+            </div>
+          </div>
+          <div>
+            <div style="display: inline-block;">
+              折扣金额:
+              <a-input-number
+                id="discount"
+                size="small"
+                v-model.trim="detailData.discountAmount"
+                @blur="salesDiscount"
+                :min="0"
+                :precision="2"
+                :max="999999"/>
+              折扣:<span class="red">{{ detailData&&(detailData.discountRate || detailData.discountRate==0) ? detailData.discountRate+'%' : '--' }}</span>,
+            </div>
+            <div class="totalPrice" style="display: inline-block;padding:0;">
+              折后合计:<strong>{{ detailData&&(detailData.discountedAmount || detailData.discountedAmount==0) ? toThousands(detailData.discountedAmount) : '--' }}</strong>
+            </div>
+          </div>
+        </div>
+        <div>
+          <a-dropdown>
+            <a-menu slot="overlay">
+              <a-menu-item key="1"> <a-checkbox :value="0" :checked="tbForm.indexOf('AUDIT')>=0" @change="(e)=>{tbFormChange(e,0)}" id="salesQuery-tbsh">同步审核</a-checkbox> </a-menu-item>
+              <a-menu-item key="2"> <a-checkbox :value="1" :checked="tbForm.indexOf('STOCK_OUT')>=0" @change="(e)=>{tbFormChange(e,1)}" id="salesQuery-tbck">同步出库</a-checkbox> </a-menu-item>
+              <a-menu-item key="3"> <a-checkbox :value="2" :checked="tbForm.indexOf('SETTLE')>=0" @change="(e)=>{tbFormChange(e,2)}" id="salesQuery-tbsk">同步收款</a-checkbox></a-menu-item>
+            </a-menu>
+            <a-button style="margin-left: 8px" size="large"> 选择同步操作 <a-icon type="down" /> </a-button>
+          </a-dropdown>
+        </div>
+        <div>
+          <a-button
+            type="primary"
+            id="salesEdit-handleSubmit"
+            size="large"
+            class="button-primary"
+            :loading="spinning"
+            @click="enableFundAccount && tbForm.length == 3 ? handleSettleAcountPay(null,0) : handleSubmit({})"
+            style="padding: 0 60px;">提交</a-button>
+        </div>
+      </div>
+    </div>
+    <!-- 选择客户弹框 -->
+    <choose-custom-modal ref="custModal" :show="openModal" @updateData="updateData" @cancel="openModal=false" />
+    <!-- 导入产品 -->
+    <importGuideModal
+      :openModal="openGuideModal"
+      :params="{salesBillSn: $route.params.sn, salesBillNo:detailData?detailData.salesBillNo:''}"
+      @close="openGuideModal=false"
+      @ok="hanldeImprotOk"></importGuideModal>
+    <!-- 收付款弹框 -->
+    <settleModal ref="settleModal" @ok="settleAcountPay" :openModal="openSettleModal" @close="openSettleModal=false"></settleModal>
+    <!-- 出库明细 -->
+    <outInDetialModal ref="outInDetialModal" outBizType="SALES" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
+    <!-- 销售记录 -->
+    <product-salesRecord-modal ref="salseRecord" :openModal="openSalesRecordModal" @close="openSalesRecordModal=false" />
+    <!-- 添加产品 -->
+    <chooseProductModal
+      ref="partQuery"
+      :newLoading="isInster"
+      :showModal="openChooseProduct"
+      :checkedList="checkedProductList"
+      @viewRecord="hanldSalesRecord"
+      @close="openChooseProduct=false"
+      @add="insterProduct"
+    ></chooseProductModal>
+    <!-- 选择货架产品 -->
+    <chooseShelfProduct
+      v-if="showShelfModal"
+      ref="chooseShelfProduct"
+      @viewRecord="hanldSalesRecord"
+      @add="insterProduct"
+      @plAdd="plInsterProduct"
+      :baseData="shelfInfo"
+      :openModal="showShelfModal"
+      @close="showShelfModal=false"></chooseShelfProduct>
+  </div>
+</template>
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { mapActions } from 'vuex'
+import { Empty } from 'ant-design-vue'
+import { STable, VSelect } from '@/components'
+import chooseProductModal from './chooseProductModal.vue'
+import chooseCustomModal from './chooseCustomModal.vue'
+import importGuideModal from './importGuideModal.vue'
+import settleModal from '@/views/financialManagement/settleModal/settleModal.vue'
+import productSalesRecordModal from './productSalesRecordModal.vue'
+import { stockByProductSn } from '@/api/stock'
+import { queryByCustomerSn } from '@/api/shelf'
+import { salesDetail, salesWriteSubmit, salesWriteDiscount, salesDetailPrint, salesDetailExport, salesDel } from '@/api/sales'
+import { salesDetailList, salesDetailInsert, salesDetailInsertBatch, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll, salesDetailInsertImport, queryCheckedList } from '@/api/salesDetail'
+import outInDetialModal from './outInDetialModal.vue'
+import chooseShelfProduct from './chooseShelfProduct.vue'
+import PrintPanel from '@/views/common/printPanel.vue'
+import { hdPrint } from '@/libs/JGPrint'
+export default {
+  name: 'SalesEdit',
+  components: { STable, VSelect, chooseProductModal, chooseCustomModal, PrintPanel, importGuideModal, settleModal, outInDetialModal, chooseShelfProduct, productSalesRecordModal },
+  mixins: [commonMixin],
+  data () {
+    return {
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
+      tableHeight: 0,
+      showOutInModal: false, // 出入库明细
+      showCell: false,
+      showPage: false,
+      spinning: false,
+      showSearch: false,
+      openChooseProduct: false,
+      orderId: null, // 销售单id
+      salesBillSn: null, // 销售单sn
+      disabled: false, //  查询、重置按钮是否可操作
+      isInster: false, // 是否正在添加产品
+      openModal: false, // 客户弹框
+      openSalesRecordModal: false, // 销售记录
+      openGuideModal: false, // 导入产品弹框
+      openSettleModal: false, // 打开收款弹框
+      enableFundAccount: false, // 是否开启资金账户管理
+      showShelfModal: false, // 货架产品弹框
+      checkedProductList: [], // 已选所有产品
+      delLoading: false,
+      detailData: { discountAmount: 0, id: null, salesBillSn: '' }, // 订单基础数据
+      dataSource: [],
+      productForm: {
+        productName: '',
+        productCode: '',
+        oosFlag: undefined,
+        orderBy: 'sales_bill_detail.CREATE_DATE desc'
+      },
+      tbForm: [], // 同步操作
+      printOrgCode: false, // 打印原创编码
+      printAllName: false, // 打印全部名称
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        this.productForm.salesBillSn = this.$route.params.sn
+        this.getChoosedList({ salesBillSn: this.$route.params.sn })
+        return salesDetailList(Object.assign(parameter, this.productForm)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              data.list[i].qtyBackups = data.list[i].qty
+              data.list[i].priceBackups = data.list[i].price
+            }
+            this.disabled = false
+            this.dataSource = data.list || []
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      printerType: 'NEEDLE', //  打印机类型
+      isCosts: false, // 是否显示成本价
+      shelfInfo: null, // 是否有货架
+      discountAmountBak: null
+    }
+  },
+  computed: {
+    // 是否自建单据
+    isOwerEdit () {
+      return this.detailData && this.detailData.sourceType == 'SALES'
+    },
+    // 是否审核通过
+    isAudit () {
+      return this.detailData && (this.detailData.billStatus == 'WAIT_OUT_WAREHOUSE' || this.detailData.billStatus == 'FINISH')
+    },
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '13%', scopedSlots: { customRender: 'productCode' }, align: 'center' },
+        { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '13%', align: 'center', scopedSlots: { customRender: 'productName' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'dealerProductEntity.productBrandName', width: '8%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        // { title: '仓库', dataIndex: 'warehouseEntity.name', width: '8%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
+        // { title: '仓位', dataIndex: 'warehouseLocationEntity.name', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '售价', dataIndex: 'price', scopedSlots: { customRender: 'price' }, width: '7%', align: 'center' },
+        { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '7%', align: 'center' },
+        { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '售价小计', dataIndex: 'totalAmount', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '折后小计', dataIndex: 'discountedAmount', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ]
+      // 下级创建,不显示仓库仓位
+      if (!this.isOwerEdit) {
+        arr.splice(7, 0, { title: '库存数量', dataIndex: 'currentStockQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      } else {
+        arr.splice(5, 0, { title: '仓库', dataIndex: 'warehouseEntity.name', width: '8%', align: 'center', sorter: true, customRender: function (text) { return text || '--' } })
+        arr.splice(6, 0, { title: '仓位', dataIndex: 'warehouseLocationEntity.name', width: '8%', align: 'center', customRender: function (text) { return text || '--' } })
+      }
+      // 实际总成本
+      if (this.isCosts) {
+        arr.splice(!this.isOwerEdit ? 11 : 12, 0, { slots: { title: 'costTitle' }, dataIndex: 'totalCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    ...mapActions(['GetSettleAccountState']),
+    handleActions (e) {
+      if (e.key == 4) {
+        this.openGuideModal = true
+      }
+      if (e.key == 3) {
+        this.showShelfModal = true
+      }
+      if (e.key == 2) { // 清空列表
+        this.delSalerOrder()
+      }
+      if (e.key == 1) { // 删除急件
+        this.delSalerOrder(this.isOwerEdit ? 1 : 2)
+      }
+    },
+    // 打印预览/快捷打印
+    handlePrint (type, printerType) {
+      const _this = this
+      _this.$store.state.app.printLoading = true
+      let url = salesDetailPrint
+      const params = { sn: this.outBizSn || this.$route.params.sn, printOrgCode: this.printOrgCode ? 1 : 0, printAllName: this.printAllName ? 1 : 0 }
+      if (type == 'export') { //  导出
+        url = salesDetailExport
+      }
+      // 打印或导出
+      hdPrint(printerType, type, url, params, '销售单', function () {
+        _this.$store.state.app.printLoading = false
+        _this.$refs.printBox.hovered = false
+      })
+    },
+    tbFormChange (e, val) {
+      this.tbForm = []
+      const tbTypes = ['AUDIT', 'STOCK_OUT', 'SETTLE']
+      if (e.target.checked) {
+        for (let i = val; i >= 0; i--) {
+          this.tbForm.push(tbTypes[i])
+        }
+      } else {
+        this.tbForm = []
+      }
+    },
+    // 编辑客户信息
+    handleEdit () {
+      this.openModal = true
+      this.$refs.custModal.editCust(this.detailData)
+    },
+    // 查看销售记录
+    hanldSalesRecord (row) {
+      console.log(row)
+      this.openSalesRecordModal = true
+      this.$refs.salseRecord.getDetail(this.detailData.buyerSn, row.productSn, row)
+    },
+    // 查询已选所以产品
+    getChoosedList (params) {
+      this.isInster = true
+      queryCheckedList(params).then(res => {
+        this.checkedProductList = res.data || []
+        this.isInster = false
+      })
+    },
+    // 更新产品列表
+    updateData (priceType) {
+      // 价格类型变更
+      if (priceType != this.$route.params.priceType) {
+        this.getOrderDetail(true)
+        this.$router.push({ name: 'salesNewEdit', params: { id: this.orderId, sn: this.salesBillSn, priceType: priceType } })
+      } else {
+        this.getOrderDetail(true)
+      }
+    },
+    // 非下级创建的单据,修改数量时校验库存
+    validStock (val, record) {
+      const _this = this
+      this.spinning = true
+      //  校验库存
+      stockByProductSn({ productSn: record.productSn }).then(res => {
+        if (res.status == 200) {
+          if (res.data && (!res.data.currentStockQty || val <= res.data.currentStockQty)) {
+            _this.changeQty(record)
+          } else {
+            this.$confirm({
+              title: '提示',
+              content: '库存不足,确认添加为急件吗?',
+              centered: true,
+              closable: true,
+              onOk () {
+                _this.changeQty(record)
+              },
+              onCancel () {
+                record.qty = record.qtyBackups
+                _this.spinning = false
+              }
+            })
+          }
+        } else {
+          this.spinning = false
+          record.qty = record.qtyBackups
+        }
+      })
+    },
+    // 修改已选产品数量
+    changeQty (record) {
+      salesDetailUpdateQty({
+        id: record.id,
+        salesBillSn: record.salesBillSn,
+        productSn: record.productSn,
+        salesBillDetailSn: record.salesBillDetailSn,
+        qty: record.qty,
+        price: record.price
+      }).then(res => {
+        this.getOrderDetail(false, true)
+        if (res.status == 200) {
+          this.$message.info(res.message)
+        }
+        this.spinning = false
+      })
+    },
+    // 已选产品 销售数量 input 输入框 blur
+    qtyBlur (val, record) {
+      this.dataSource = record || []
+      if (val && val != record.qtyBackups) {
+        // 自建的单据,修改数量时校验库存
+        if (this.isOwerEdit) {
+          this.validStock(val, record)
+        } else {
+          this.changeQty(record)
+        }
+      } else {
+        record.qty = record.qtyBackups
+      }
+    },
+    // 已选产品 售价 input 输入框 blur
+    priceBlur (val, record) {
+      this.dataSource = record || []
+      //  光标移出,值发生改变再调用编辑接口
+      if (val && val != record.priceBackups) {
+        this.spinning = true
+        salesDetailUpdatePrice({
+          id: record.id,
+          salesBillSn: record.salesBillSn,
+          productSn: record.productSn,
+          salesBillDetailSn: record.salesBillDetailSn,
+          qty: record.qty,
+          price: record.price
+        }).then(res => {
+          this.getOrderDetail(false, true)
+          if (res.status == 200) {
+            this.$message.info(res.message)
+            this.spinning = false
+          } else {
+            this.spinning = false
+          }
+        })
+      } else {
+        record.price = record.priceBackups
+      }
+    },
+    // 重置列表
+    resetForm () {
+      this.productForm = {
+        productName: '',
+        productCode: '',
+        oosFlag: undefined,
+        orderBy: 'sales_bill_detail.CREATE_DATE desc'
+      }
+      this.$nextTick(() => {
+        this.$refs.table.refresh()
+      })
+    },
+    //  返回
+    handleBack () {
+      this.$router.push({ name: 'salesNewList' })
+    },
+    // 打折
+    salesDiscount () {
+      if (this.discountAmountBak == this.detailData.discountAmount) {
+        return false
+      }
+      this.spinning = true
+      salesWriteDiscount({
+        discountAmount: this.detailData.discountAmount || 0,
+        salesBillSn: this.detailData.salesBillSn,
+        id: this.detailData.id
+      }).then(res => {
+        if (res.status == 200) {
+          this.getOrderDetail(true)
+        } else {
+          this.spinning = false
+        }
+      })
+    },
+    // 清空已选产品
+    delSalerOrder (flag) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: !flag ? '确认要清空已选产品列表吗?' : (flag == 1 ? '确认要删除所有急件吗?删除后不可恢复。' : '确认要删除所有缺货吗?删除后不可恢复。'),
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.spinning = true
+          const params = { id: _this.orderId, oosFlag: !flag ? undefined : 1 }
+          salesDel(params).then(res => {
+            if (res.status == 200) {
+              _this.getOrderDetail(true)
+              if (!flag) {
+                _this.dataSource = []
+              }
+              _this.$message.success(res.message)
+            }
+            _this.spinning = false
+          })
+        }
+      })
+    },
+    // 出入库明细
+    handleViewDetail (row) {
+      this.showOutInModal = true
+      this.$refs.outInDetialModal.getData(row)
+    },
+    // 删除产品
+    handleDel (row) {
+      row
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要删除吗?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.delLoading = true
+          _this.spinning = true
+          salesDetailDel({ id: row.id }).then(res => {
+            if (res.status == 200) {
+              _this.getOrderDetail(false, true)
+            }
+            _this.$message.info(res.message)
+            _this.delLoading = false
+            _this.spinning = false
+          })
+        }
+      })
+    },
+    // 添加产品
+    insterProduct (row) {
+      // 防止多次添加产品
+      if (this.isInster) { return }
+      const _this = this
+      // 自建的单据显示库存不足时
+      if (row.currentQty < row.salesNums && this.isOwerEdit) {
+        _this.$confirm({
+          title: '提示',
+          content: '库存不足,确认添加为急件吗?',
+          centered: true,
+          closable: true,
+          onOk () {
+            _this.isPutCostDyPrice(row)
+          }
+        })
+      } else {
+        _this.isPutCostDyPrice(row)
+      }
+    },
+    // 判断售价低于成本价
+    isPutCostDyPrice (row) {
+      const _this = this
+      if (row.putCost > row.price) {
+        // 销售价低于成本价
+        _this.$confirm({
+          title: '提示',
+          content: '售价低于成本价,确认要添加吗?',
+          centered: true,
+          closable: true,
+          onOk () {
+            _this.saveNewProduct(row)
+          }
+        })
+      } else {
+        _this.saveNewProduct(row)
+      }
+    },
+    // 保存添加的产品到销售列表
+    saveNewProduct (row) {
+      this.$message.loading('正在添加产品...', 1)
+      this.isInster = true
+      // this.spinning = true
+      salesDetailInsert({
+        buyerSn: this.detailData.buyerSn,
+        productSn: row.productSn,
+        cost: row.putCost,
+        // productCode: row.productCode,
+        // productOrigCode: row.productOrigCode,
+        price: row.price,
+        qty: row.salesNums,
+        salesBillSn: this.detailData.salesBillSn,
+        salesBillNo: this.detailData.salesBillNo,
+        warehouseSn: row.warehouseSn,
+        warehouseLocationSn: row.warehouseLocationSn,
+        stockSn: row.stockSn
+      }).then(res => {
+        if (res.status == 200) {
+          this.getOrderDetail(true)
+          if (this.showShelfModal) {
+            this.$refs.chooseShelfProduct.reload()
+          }
+        } else {
+          if (res.errCode == 'VALID_F_00001') {
+            this.productForm = {
+              productName: '',
+              productCode: row.productCode || '',
+              orderBy: 'sales_bill_detail.CREATE_DATE desc'
+            }
+            this.showSearch = true
+            this.$refs.table.refresh(true)
+          }
+          this.isInster = false
+        }
+        // this.spinning = false
+      })
+    },
+    // 批量添加接口
+    plInsterProduct (list) {
+      const params = []
+      list.map(item => {
+        params.push({
+          buyerSn: this.detailData.buyerSn,
+          productSn: item.productSn,
+          cost: item.putCost,
+          price: item.price,
+          qty: item.salesNums,
+          salesBillSn: this.detailData.salesBillSn,
+          salesBillNo: this.detailData.salesBillNo,
+          stockSn: item.stockSn
+        })
+      })
+      this.$message.loading('正在批量添加产品...', 1)
+      salesDetailInsertBatch(params).then(res => {
+        if (res.status == 200) {
+          this.getOrderDetail(true)
+          if (this.showShelfModal) {
+            this.$refs.chooseShelfProduct.reload()
+          }
+        }
+      })
+    },
+    //  销售单详情
+    getOrderDetail (flag, resetTable) {
+      const vm = this
+      vm.spinning = true
+      salesDetail({ id: vm.$route.params.id }).then(res => {
+        if (res.status == 200) {
+          vm.detailData = res.data
+          vm.discountAmountBak = vm.detailData.discountAmount
+          if(res.data.delFlag == 1){
+            vm.$message.info("该销售单已删除")
+            vm.handleBack()
+            return false
+          }
+          if (flag) {
+            const buyerSn = (vm.detailData && vm.detailData.buyerSn && vm.detailData.sourceType && vm.detailData.sourceType == 'PURCHASE') ? '' : vm.detailData.buyerSn
+            const priceType = vm.$route.params.priceType
+            vm.$refs.partQuery.pageInit(buyerSn, priceType, vm.salesBillSn)
+            if (vm.detailData.totalCategory) {
+              vm.resetForm()
+            } else {
+              vm.spinning = false
+              vm.checkedProductList = []
+            }
+            // 查询关联的客户货架信息
+            if (vm.detailData && vm.detailData.buyerSn) {
+              vm.getShelfQueryByCustomer()
+            }
+          } else {
+            if (resetTable) {
+              vm.$refs.table.refresh()
+            } else {
+              vm.spinning = false
+            }
+          }
+        }
+      })
+    },
+    // 查询关联的客户货架信息
+    getShelfQueryByCustomer () {
+      queryByCustomerSn({ sn: this.detailData.buyerSn }).then(res => {
+        if (res.data) {
+          this.shelfInfo = Object.assign(res.data, { salePriceType: this.$route.params.priceType, salesBillSn: this.salesBillSn })
+        } else {
+          this.shelfInfo = null
+        }
+      })
+    },
+    // 提交销售单
+    handleSubmit (params) {
+      this.spinning = true
+      const submitTypes = this.tbForm.join(',')
+      salesWriteSubmit({ id: this.orderId, submitTypes: submitTypes, ...params }).then(res => {
+        console.log(res)
+        if (res.status == 200) {
+          this.handleBack()
+          this.$message.success(res.message)
+          this.spinning = false
+        } else {
+          this.spinning = false
+        }
+      })
+    },
+    // 开启结算账户功能收款, type:0 单条收款,1 批量收款
+    handleSettleAcountPay (row, type) {
+      this.openSettleModal = true
+      const data = {
+        totalAmount: this.detailData.discountedAmount,
+        settleClientName: '',
+        title: '收款',
+        type,
+        row
+      }
+      this.$nextTick(() => {
+        this.$refs.settleModal.setData(data)
+      })
+    },
+    // 去收款
+    settleAcountPay (form, data) {
+      const params = {}
+      // 资金管理开启
+      if (this.enableFundAccount) {
+        params.settleStyleSn = form.settleStyleSn
+        params.settleAccountSn = form.settleAccountSn
+      }
+      this.spinning = true
+      this.handleSubmit(params)
+    },
+    // 确认导入明细
+    hanldeImprotOk (obj) {
+      this.spinning = true
+      salesDetailInsertImport(obj).then(res => {
+        if (res.status == 200) {
+          this.getOrderDetail(true)
+        }
+        this.spinning = false
+      })
+    },
+    setTableH () {
+      this.tableHeight = window.innerHeight - (this.showSearch ? 42 : 0) - 300
+    },
+    pageInit () {
+      const vm = this
+      vm.$nextTick(() => {
+        vm.setTableH()
+        vm.orderId = vm.$route.params.id
+        vm.salesBillSn = vm.$route.params.sn
+        // 是否默认打印原厂编码
+        vm.printOrgCode = localStorage.getItem('printOrgCode-' + this.$store.state.user.info.orgId) == 'true'
+        vm.printAllName = localStorage.getItem('printAllName-' + this.$store.state.user.info.orgId) == 'true'
+        vm.getOrderDetail(true)
+      })
+    }
+  },
+  watch: {
+    printOrgCode (newValue, oldValue) {
+      localStorage.setItem('printOrgCode-' + this.$store.state.user.info.orgId, newValue)
+    },
+    printAllName (newValue, oldValue) {
+      localStorage.setItem('printAllName-' + this.$store.state.user.info.orgId, newValue)
+    },
+    showSearch (newValue, oldValue) {
+      this.setTableH()
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    this.showPage = true
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    this.showPage = true
+    // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
+    if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
+      this.pageInit()
+    }
+    // 结算账户状态查询
+    if (this.$hasPermissions('M_fundAccountList') && this.$hasPermissions('B_fundAccountEnable')) {
+    	this.GetSettleAccountState().then(res => {
+    	  if (res.status == 200) {
+    		this.enableFundAccount = res.data.functionEnableFlag == 1
+    	  }
+    	})
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style lang="less">
+  .salesEdit-news-wrap{
+    position: relative;
+    height: 100%;
+    box-sizing: border-box;
+
+    .choosedList-cont{
+      position: relative;
+      background-color: #fff;
+      height: calc(100% - 60px);
+      .choosed-table{
+        position: relative;
+      }
+      .redBg-row{
+        color: #f5452e;
+        input{
+          color: #f5452e;
+        }
+      }
+      .discount-box{
+        position: absolute;
+        left: 15px;
+        bottom: 15px;
+        .red{
+          color: #f5452e;
+          font-size: 14px;
+        }
+      }
+    }
+    .total-bar{
+      > div{
+        text-align: right;
+        &:first-child{
+          span{
+            color: #666;
+          }
+          .red{
+            color: #f5452e;
+            font-size: 14px;
+          }
+        }
+        &:last-child{
+          display: flex;
+          align-items: center;
+          justify-content: flex-end;
+        }
+      }
+    }
+  }
+</style>

+ 196 - 0
src/views/salesManagement/salesQueryNew/importGuideModal.vue

@@ -0,0 +1,196 @@
+<template>
+  <a-modal
+    centered
+    class="importGuide-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="导入产品"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="800">
+    <div class="importGuide-con">
+      <div class="explain-con">
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>1</span>准备导入
+          </div>
+          <ul>
+            <li>1) 导入的Excel文件中必须包含名为“产品编码”、“仓库”、“仓位”、“售价”、“数量”的列,且名称必须相同,其它列可自定义,不影响数据导入</li>
+            <li>2) 如果导入的产品已经存在,则不会导入该行</li>
+            <li>
+              <a :href="filePath" style="margin: 5px 0 0;display: block;">
+                <a-icon type="download" style="padding-right: 5px;" />下载导入模板
+              </a>
+            </li>
+          </ul>
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>2</span>上传数据文件
+          </div>
+          <p>目前支持的文件类型*.xls,*.xlsx.</p>
+          <div style="overflow: hidden;padding-left: 23px;">
+            <Upload
+              id="importGuide-attachList"
+              ref="importUpload"
+              :maxNums="1"
+              fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
+              uploadType="attach"
+              :action="attachAction"
+              :uploadParams="uploadParams"
+              upText="选择导入文件"
+              @remove="resetSearchForm"
+              @change="changeImport"></Upload>
+          </div>
+        </div>
+      </div>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="importGuide-nextStep"
+          size="large"
+          class="button-primary"
+          @click="handlerNextStep"
+          style="padding: 0 60px;">下一步</a-button>
+        <a-button
+          id="importGuide-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+    <!-- 导入 -->
+    <chooseImportModal :openModal="openImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
+  </a-modal>
+</template>
+
+<script>
+import ChooseImportModal from './chooseImportModal.vue'
+import { Upload } from '@/components'
+export default {
+  name: 'ImportGuideModal',
+  components: { ChooseImportModal, Upload },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    params: {
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      openImportModal: false, //  导入
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/salesDetail/importDetail',
+      paramsData: null,
+      uploadParams: {
+        savePathType: 'local',
+        salesBillSn: this.params.salesBillSn
+      },
+      filePath: location.protocol + '//' +location.host + '/templ/销售单产品明细导入模板.xlsx'
+    }
+  },
+  methods: {
+    // 清空数据
+    resetSearchForm () {
+      this.$refs.importUpload.setFileList() //  清空导入文件
+      this.paramsData = null //  清空上传数据
+    },
+    // 下一步
+    handlerNextStep () {
+      if (this.paramsData) {
+        this.openImportModal = true
+      } else {
+        this.$message.warning('添加文件后再进行下一步操作!')
+      }
+    },
+    // 上传文件  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 {
+        this.paramsData = null
+      }
+    },
+    // 导入
+    hanldeOk (obj) {
+      if (obj && obj.length > 0) {
+        this.$emit('ok', obj)
+        this.isShow = false
+      }
+    },
+    // 关闭
+    handleClose () {
+      this.openImportModal = false
+      this.isShow = false
+    },
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetSearchForm()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .importGuide-modal{
+    .importGuide-con{
+      .explain-con{
+        .explain-item{
+          margin-bottom: 10px;
+          .explain-tit{
+            font-weight: bold;
+            span{
+              display: inline-block;
+              width: 18px;
+              height: 18px;
+              line-height: 16px;
+              text-align: center;
+              margin-right: 5px;
+              border-radius: 50%;
+              border: 1px solid rgba(0, 0, 0, 0.3);
+            }
+          }
+          p{
+            margin: 8px 0;
+            padding-left: 23px;
+          }
+          ul{
+            list-style: none;
+            padding: 0;
+            padding-left: 23px;
+            margin: 0;
+            li{
+              line-height: 26px;
+            }
+          }
+        }
+        #importGuide-attachList{
+          width: 100%;
+        }
+      }
+      .btn-con{
+        margin: 10px 0 20px;
+        text-align: center;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 605 - 0
src/views/salesManagement/salesQueryNew/list.vue

@@ -0,0 +1,605 @@
+<template>
+  <div class="jg-page-wrap salesManagementList-wrap">
+    <a-card size="small" :bordered="false" class="table-page-search-wrapper">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch">
+        <a-form layout="inline" @keyup.enter.native="searchForm">
+          <a-row type="flex" justify="start" :gutter="15">
+            <a-col :span="6">
+              <a-form-item label="创建时间">
+                <rangeDate :allowClear="isByCustQuery" :hasDisabledAreaTime="false" ref="rangeDate" :value="time" @change="dateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :span="6">
+              <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}" :required="isByCustQuery">
+                <custList ref="custList" @change="custChange"></custList>
+              </a-form-item>
+            </a-col>
+            <a-col :span="6" v-if="advanced">
+                <a-form-item label="收款方式">
+                  <v-select
+                    code="SETTLE_STYLE"
+                    id="salesManagementList-settleStyleSn"
+                    v-model="queryParam.settleStyleSn"
+                    allowClear
+                    placeholder="请选择收款方式"
+                  ></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :span="6" v-if="advanced">
+                <a-form-item label="业务状态">
+                  <v-select
+                    v-model="queryParam.billStatus"
+                    ref="billStatus"
+                    id="salesManagementList-billStatus"
+                    code="SALES_BILL_STATUS"
+                    placeholder="请选择业务状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+            <a-col :span="6">
+              <a-form-item label="审核时间">
+                <rangeDate ref="auditRangeDate" v-model="auditTime" @change="auditDateChange" />
+              </a-form-item>
+            </a-col>
+              <a-col :span="6">
+              <a-form-item label="销售单号">
+                <a-input id="salesManagementList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :span="6" v-if="advanced">
+                <a-form-item label="单据来源">
+                  <v-select
+                    v-model="queryParam.sourceType"
+                    ref="sourceType"
+                    id="salesManagementList-sourceType"
+                    code="SALES_SOURCE"
+                    placeholder="请选择单据来源"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :span="6" v-if="advanced">
+                <a-form-item label="财务状态">
+                  <v-select
+                    v-model="queryParam.financialStatus"
+                    ref="financialStatus"
+                    id="salesManagementList-financialStatus"
+                    code="FINANCIAL_RECEIVE_STATUS"
+                    placeholder="请选择财务状态"
+                    allowClear></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :span="6" v-if="advanced">
+                <a-form-item label="出库时间">
+                  <rangeDate ref="outWareRangeDate" v-model="outWareTime" @change="outWareDateChange" />
+                </a-form-item>
+              </a-col>
+              <a-col :span="6" v-if="advanced">
+              <a-form-item label="采购单号">
+                <a-input id="salesManagementList-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" allowClear placeholder="请输入采购单号"/>
+              </a-form-item>
+            </a-col>
+              <a-col :span="6" v-if="advanced">
+                <a-form-model-item label="铺货出库">
+                  <v-select code="FLAG" id="salesManagementList-distributionFlag" v-model="queryParam.distributionFlag" allowClear placeholder="请选择是否铺货出库"></v-select>
+                </a-form-model-item>
+              </a-col>
+            <a-col :span="24" style="display:flex;align-items: center;">
+              <div style="text-align:left;width:50%;">
+                <a-checkbox v-model="isByCustQuery" id="sales-byCustQuery">按客户查询</a-checkbox>
+                <a-popover placement="right">
+                  <template slot="content">
+                    使用此查询时,时间可清空,必须选择一个客户
+                  </template>
+                  <a-icon type="question-circle" />
+                </a-popover>
+              </div>
+              <div style="text-align:left;margin-left: -120px;width:50%;">
+                <a-button type="primary" :disabled="disabled" @click="searchForm">查询</a-button>
+                <a-button style="margin-left: 5px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                <a-button
+                  type="primary"
+                  v-if="$hasPermissions('B_salesExport')"
+                  class="button-warning"
+                  @click="handleExport"
+                  :disabled="disabled"
+                  :loading="exportLoading"
+                  id="salesManagementList-export">导出</a-button>
+                <a @click="advanced=!advanced" style="margin-left: 5px">
+                  {{ advanced ? '收起' : '展开' }}
+                  <a-icon :type="advanced ? 'up' : 'down'"/>
+                </a>
+              </div>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+    </a-card>
+
+    <a-card size="small" :bordered="false">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 操作按钮 -->
+        <div class="table-operator" style="display:flex;align-items:center;justify-content: space-between;">
+          <div class="alert-message">
+            销售单数合计:<strong>{{ totalData&&(totalData.totalRecord || totalData.totalRecord==0) ? totalData.totalRecord : '--' }}</strong>;
+            销售款数合计:<strong>{{ totalData&&(totalData.totalCategory || totalData.totalCategory==0) ? totalData.totalCategory : '--' }}</strong>;
+            销售数量合计:<strong>{{ totalData&&(totalData.totalQty || totalData.totalQty==0) ? totalData.totalQty : '--' }}</strong>;
+            销售金额合计:<strong>{{ totalData&&(totalData.totalAmount || totalData.totalAmount==0) ? toThousands(totalData.totalAmount) : '--' }}</strong>;
+          </div>
+          <div class="action-buttons">
+            <a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesNews')" @click="handleAdd(0)"><a-icon type="plus" /> 新增(零售)</a-button>
+            <a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesNews')" @click="handleAdd(1)"><a-icon type="plus" /> 新增(铺货)</a-button>
+          </div>
+        </div>
+
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+84+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y:tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 销售单号 -->
+          <template slot="salesBillNo" slot-scope="text, record">
+            <span class="table-td-link" v-if="$hasPermissions('B_salesDetail')" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
+            <span v-else>{{ record.salesBillNo }}</span>
+            <a-badge count="改" :offset="[10,0]" v-if="record.billStatus=='SUPERIOR_CHANGE'"></a-badge>
+          </template>
+          <!-- 审核 -->
+          <template slot="audit" slot-scope="text, record">
+            <stateIcon :title="record.billStatusDictValue" v-if="record.billStatus!='AUDIT_REJECT'" :state="record.billStatus == 'WAIT_OUT_WAREHOUSE'||record.billStatus == 'FINISH'?'1':'2'"></stateIcon>
+            <stateIcon :title="record.billStatusDictValue" v-else :state="0"></stateIcon>
+          </template>
+          <!-- 急件 -->
+          <template slot="oosFlag" slot-scope="text, record">
+            <stateIcon :state="record.oosFlag==1?'1':'2'"></stateIcon>
+          </template>
+          <!-- 出库 -->
+          <template slot="waitOut" slot-scope="text, record">
+            <stateIcon :state="record.billStatus == 'FINISH'?'1':'2'"></stateIcon>
+          </template>
+          <!-- 收款 -->
+          <template slot="financial" slot-scope="text, record">
+            <stateIcon :title="record.financialStatusDictValue" :state="record.financialStatus == 'FINISH'?'1':'2'"></stateIcon>
+          </template>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              class="button-primary"
+              v-if="record.billStatus == 'WAIT_AUDIT' && $hasPermissions('B_salesAudit')"
+              @click="handleEexamine(record)"
+            >审核</a-button>
+            <a-button
+              size="small"
+              type="link"
+              v-if="record.billStatus == 'WAIT_OUT_WAREHOUSE' && $hasPermissions('B_salesStockOut')"
+              class="button-primary"
+              @click="handleSend(record)"
+            >出库</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-primary"
+              v-if="((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && $hasPermissions('B_salesEdit')"
+              @click="handleEdit(record)"
+            >
+              编辑
+            </a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-error"
+              v-if="((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING') && record.billStatus != 'FINISH') && $hasPermissions('B_salesDel')"
+              @click="handleDel(record)"
+            >
+              删除
+            </a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-primary"
+              v-if="(record.sourceType == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesEdit')"
+              @click="handleEdit(record)"
+            >
+              改单
+            </a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-error"
+              v-if="(record.sourceType == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesDel')"
+              @click="handleDel(record, 'cancel')"
+            >
+              取消
+            </a-button>
+            <span v-if="!(record.billStatus == 'WAIT_AUDIT' && $hasPermissions('B_salesAudit')) && !(record.billStatus == 'WAIT_OUT_WAREHOUSE' && $hasPermissions('B_salesStockOut')) && !(((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING') && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT_SUBMIT' || record.billStatus == 'AUDIT_REJECT')) && $hasPermissions('B_salesEdit')) && !(((record.sourceType == 'SATELLITE' || record.sourceType == 'SALES' || record.sourceType == 'TEMPORARY_DISPATCHING') && record.billStatus != 'FINISH') && $hasPermissions('B_salesDel')) && !((record.sourceType == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesEdit')) && !((record.sourceType == 'PURCHASE' && (record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'SUPERIOR_CHANGE')) && $hasPermissions('B_salesDel'))">--</span>
+          </template>
+        </s-table>
+      </a-spin>
+      <!-- 选择客户弹框 -->
+      <choose-custom-modal :show="openModal" :distributionFlag="distributionFlag" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal>
+      <!-- 审核 -->
+      <auditModal :openModal="visibleAudit" :spinning="spinningAudit" @close="visibleAudit=false" @ok="auditOrder('WAIT_OUT_WAREHOUSE')" @fail="auditOrder('AUDIT_REJECT')" />
+    </a-card>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import getDate from '@/libs/getDate.js'
+import { STable, VSelect } from '@/components'
+import chooseCustomModal from './chooseCustomModal.vue'
+import auditModal from '@/views/common/auditModal.vue'
+import { salesList, salesDel, salesWriteAudit, salesWriteStockOut, salesCount, salesExport } from '@/api/sales'
+import rangeDate from '@/views/common/rangeDate.vue'
+import custList from '@/views/common/custList.vue'
+import { downloadExcel } from '@/libs/JGPrint.js'
+import stateIcon from '@/views/common/stateIcon'
+import moment from 'moment'
+export default {
+  name: 'SalesList',
+  components: { STable, VSelect, chooseCustomModal, rangeDate, auditModal, custList, stateIcon },
+  mixins: [commonMixin],
+  data () {
+    const _this = this
+    return {
+      spinning: false,
+      tableHeight: 0,
+      advanced: true, // 高级搜索 展开/关闭
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出loading
+      openModal: false, // 选择客户弹框是否显示
+      isByCustQuery: false, // 是否按客户查询
+      time: [
+        getDate.getMonthDays(12).starttime,
+        getDate.getMonthDays(12).endtime
+      ],
+      auditTime: [],
+      outWareTime: [],
+      // 查询参数
+      queryParam: {
+        beginDate: getDate.getMonthDays(12).starttime,
+        endDate: getDate.getMonthDays(12).endtime,
+        auditBeginDate: '',
+        auditEndDate: '',
+        outWarehouseBeginDate: '',
+        outWarehouseEndDate: '',
+        buyerNameCurrent: undefined, //  客户名称
+        buyerSn: undefined,
+        salesBillNo: '', //  销售单号
+        purchaseBillNo: '', //  采购单号
+        payType: undefined, //  支付方式
+        settleStyleSn: undefined, //  收款方式
+        billStatus: undefined, //  业务状态
+        financialStatus: undefined, //  财务状态
+        sourceType: undefined,
+        distributionFlag: undefined
+      },
+      totalData: {
+        totalAmount: 0,
+        totalCategory: 0,
+        totalQty: 0,
+        totalRecord: 0
+      },
+      selType: '0', // 0零售 1铺货
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
+        { title: '来源', dataIndex: 'sourceTypeDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, width: '9%', align: 'center' },
+        { title: '客户名称', dataIndex: 'buyerNameCurrent', align: 'center', width: '15%', customRender: function (text) { return text || '--' } },
+        { title: '总款数', dataIndex: 'totalCategory', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总数量', dataIndex: 'totalQty', align: 'center', width: '5%', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '总售价', dataIndex: 'totalAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '折扣金额', dataIndex: 'discountAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '折后总售价', dataIndex: 'discountedAmount', align: 'right', width: '5%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '收款方式', dataIndex: 'settleStyleSnDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核时间', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'billStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '2%', align: 'center' },
+        { title: '急件', scopedSlots: { customRender: 'oosFlag' }, width: '2%', align: 'center' },
+        { title: '出库', scopedSlots: { customRender: 'waitOut' }, width: '2%', align: 'center' },
+        { title: '收款', scopedSlots: { customRender: 'financial' }, width: '2%', align: 'center' },
+        // { title: '财务状态', dataIndex: 'financialStatusDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        // 查询总计
+        salesCount(Object.assign(parameter, this.queryParam)).then(res => {
+          console.log(res, 'res')
+          this.totalData = Object.assign(this.totalData, res.data || {})
+        })
+        return salesList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          console.log(res, 'res')
+          this.spinning = false
+          return data
+        })
+      },
+      visibleAudit: false,
+      auditInfo: null,
+      spinningAudit: false,
+      distributionFlag: '0'
+    }
+  },
+  methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    auditDateChange (date) {
+      this.auditTime = date
+      this.queryParam.auditBeginDate = date[0]
+      this.queryParam.auditEndDate = date[1]
+    },
+    outWareDateChange (date) {
+      this.outWareTime = date
+      this.queryParam.outWarehouseBeginDate = date[0]
+      this.queryParam.outWarehouseEndDate = date[1]
+    },
+    custChange (v, row) {
+      console.log(v, row)
+      if (row && row.customerSn) {
+        this.queryParam.buyerSn = row.customerSn
+        this.queryParam.buyerNameCurrent = undefined
+      } else {
+        this.queryParam.buyerNameCurrent = v
+        this.queryParam.buyerSn = undefined
+      }
+    },
+    // 新增
+    handleAdd (flag) {
+      this.openModal = true
+      this.distributionFlag = flag
+    },
+    //  审核
+    handleEexamine (row) {
+      this.auditInfo = row
+      this.visibleAudit = true
+    },
+    auditOrder (billStatus) {
+      this.spinningAudit = true
+      salesWriteAudit({
+        id: this.auditInfo.id,
+        billStatus: billStatus
+      }).then(res => {
+        if (res.status == 200) {
+          this.visibleAudit = false
+          this.$message.success(res.message)
+          this.$refs.table.refresh()
+          this.spinningAudit = false
+        } else {
+          this.visibleAudit = false
+          this.spinningAudit = false
+        }
+      })
+    },
+    //  出库
+    handleSend (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要出库吗?',
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.spinning = true
+          salesWriteStockOut({
+            salesBillSn: row.salesBillSn
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    // 详情
+    handleDetail (row) {
+      this.$router.push({ name: 'salesNewDetail', params: { sn: row.salesBillSn } })
+    },
+    // 编辑
+    handleEdit (row) {
+      this.$router.push({ name: 'salesNewEdit', params: { id: row.id, sn: row.salesBillSn, priceType: row.priceType } })
+    },
+    // 选择客户成功
+    chooseCustomOk (data) {
+      this.$router.push({ name: 'salesNewAdd', params: { id: data.id, sn: data.salesBillSn, priceType: data.priceType } })
+    },
+    // 删除
+    handleDel (row, type) {
+      const _this = this
+      let content = '确认要删除吗?'
+      if (type == 'cancel') {
+        content = '确认要取消吗?'
+      }
+      this.$confirm({
+        title: '提示',
+        content: <div><div style='font-size:16px;margin-bottom:10px;'>{content}</div><div>销售单号:{row.salesBillNo}</div><div>客户名称:{row.buyerNameCurrent}</div></div>,
+        centered: true,
+        closable: true,
+        onOk () {
+          _this.spinning = true
+          salesDel({ id: row.id, mainFlag: 1 }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    searchForm (flag) {
+      if (!this.isByCustQuery) {
+        const a = moment(this.queryParam.beginDate)
+        const b = moment(this.queryParam.endDate)
+        if (b.diff(a, 'days') > 730) {
+          this.$message.info('最多只能选择2年的时间区间')
+          return false
+        }
+        this.$refs.table.refresh(!flag)
+      } else {
+        if (this.queryParam.buyerSn) {
+          this.$refs.table.refresh(!flag)
+        } else {
+          this.$message.info('请选择客户')
+          return false
+        }
+      }
+    },
+    // 重置
+    resetSearchForm () {
+      this.resetData()
+      this.$refs.table.refresh(true)
+    },
+    // 重置数据
+    resetData (flag) {
+      this.$refs.rangeDate.resetDate(flag ? '' : this.time)
+      this.queryParam.beginDate = flag ? '' : getDate.getMonthDays(12).starttime
+      this.queryParam.endDate = flag ? '' : getDate.getMonthDays(12).endtime
+
+      this.queryParam.auditBeginDate = ''
+      this.queryParam.auditEndDate = ''
+      this.queryParam.outWarehouseBeginDate = ''
+      this.queryParam.outWarehouseEndDate = ''
+      this.auditTime = []
+      this.outWareTime = []
+      if (this.advanced) {
+        this.$refs.auditRangeDate.resetDate('')
+        this.$refs.outWareRangeDate.resetDate('')
+      }
+
+      this.queryParam.buyerNameCurrent = undefined
+      this.queryParam.buyerSn = undefined
+      this.queryParam.salesBillNo = ''
+      this.queryParam.purchaseBillNo = ''
+      this.queryParam.payType = undefined
+      this.queryParam.settleStyleSn = undefined
+      this.queryParam.billStatus = undefined
+      this.queryParam.financialStatus = undefined
+      this.queryParam.sourceType = undefined
+      this.queryParam.distributionFlag = undefined
+      this.$refs.custList.resetForm()
+      if (!flag) {
+        this.setIsHomeNav(this.$route.name, null)
+      }
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      const params = this.queryParam
+      this.exportLoading = true
+      _this.spinning = true
+      salesExport(params).then(res => {
+        this.exportLoading = false
+        _this.spinning = false
+        if (res.type == 'application/json') {
+          var reader = new FileReader()
+          reader.addEventListener('loadend', function () {
+            const obj = JSON.parse(reader.result)
+            _this.$notification.error({
+              message: '提示',
+              description: obj.message
+            })
+          })
+          reader.readAsText(res)
+        } else {
+          downloadExcel(res, '销售列表')
+        }
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 267
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+      // 是否打开的页签
+      const a = this.$store.state.app.isNewTab
+      // 是否要刷新列表
+      const b = this.$store.state.app.updateList
+      // 是否从首页点击进入
+      const isHomeNav = this.getIsHomeNav()[this.$route.name]
+      console.log(a, b)
+
+      // 从首页进入,判断式新建还式待办查询
+      if (isHomeNav) {
+        // 新增
+        if (isHomeNav.type == 'new') {
+          this.resetSearchForm()
+          this.openModal = true
+        }
+        // 待办
+        if (isHomeNav.type == 'todo') {
+          this.resetData(true)
+          this.queryParam = Object.assign(this.queryParam, isHomeNav.pageParams)
+          this.$refs.rangeDate.resetDate([this.queryParam.beginDate, this.queryParam.endDate])
+          this.$refs.table.refresh(true)
+        }
+      } else {
+        // 如果是新页签打开,则重置当前页面
+        if (a && !b) {
+          this.resetSearchForm()
+        }
+      }
+      // 仅刷新列表,不重置页面
+      if (b || a == b) {
+        this.$refs.table.refresh()
+      }
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    },
+    isByCustQuery (newValue, oldValue) {
+      if (!newValue) {
+        this.resetSearchForm()
+      }
+    }
+  },
+  activated () {
+    this.pageInit()
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+    })
+  }
+}
+</script>

+ 173 - 0
src/views/salesManagement/salesQueryNew/outInDetialModal.vue

@@ -0,0 +1,173 @@
+<template>
+    <a-drawer
+    :zIndex="1010"
+    title="出库明细"
+    placement="right"
+    :visible="isShow"
+    width="80%"
+    :get-container="false"
+    :wrap-style="{ position: 'absolute' }"
+    @close="isShow = false"
+    wrapClassName="outIndetail-modal jg-drawer-wrap"
+     >
+    <a-spin :spinning="spinning" tip="Loading..." v-if="isShow">
+      <div class="baseInfo" ref="searchBox" v-if="baseData">
+        <div>
+          <span>产品编码:{{ baseData.dealerProductEntity ? baseData.dealerProductEntity.code : baseData.productCode }}</span>
+        </div>
+        <div>
+          <span>产品名称:{{ baseData.dealerProductEntity ? baseData.dealerProductEntity.name : baseData.productName }}</span>
+        </div>
+      </div>
+      <div class="outIndetail-modal-table">
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          :showPagination="false"
+          bordered>
+        </s-table>
+      </div>
+    </a-spin>
+  </a-drawer>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable } from '@/components'
+import { stockOutDetailList } from '@/api/stockOut'
+export default {
+  name: 'OutinDetailModal',
+  components: { STable },
+  mixins: [commonMixin],
+  props: {
+    openModal: {
+      //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    outBizType: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      tableHeight: 0,
+      baseData: null,
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        // outBizType = SHOP_CALL_OUT(店内调出)   /  SALES (销售)
+        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 => {
+          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)
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  computed: {
+    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: 'totalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(5, 0, { title: '成本价', dataIndex: 'putCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ?  _this.toThousands(text) : '--') } })
+        arr.splice(7, 0, { title: '成本小计', dataIndex: 'totalCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ?  _this.toThousands(text) : '--') } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    setTableH () {
+      this.$nextTick(() => {
+        const searchBoxH = this.$refs.searchBox.offsetHeight
+        this.tableHeight = window.innerHeight - searchBoxH - 235
+      })
+    },
+    cansel () {
+      this.isShow = false
+      this.baseData = null
+    },
+    getData (row) {
+      this.baseData = row
+      this.$nextTick(() => {
+        this.$refs.table.refresh(true)
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    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()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.outIndetail-modal {
+	.ant-drawer-body {
+		padding: 10px 20px;
+    .outIndetail-modal-table{
+      padding: 20px 0 0;
+    }
+    .baseInfo{
+      line-height: 24px;
+      font-size: 14px;
+    }
+	}
+}
+</style>

+ 190 - 0
src/views/salesManagement/salesQueryNew/productSalesRecordModal.vue

@@ -0,0 +1,190 @@
+<template>
+  <a-drawer
+      placement="right"
+      :title="modalTit"
+      :visible="isShow"
+      :get-container="false"
+      :wrap-style="{ position: 'absolute' }"
+      @close="isShow=false"
+      :z-index="150"
+      wrapClassName="salesRecord-modal jg-drawer-wrap"
+      width="70%">
+      <div v-if="isShow">
+        <div ref="searchBox">
+          <div style="padding: 0 0 10px 0;line-height: 24px;" v-if="baseData">
+            <div style="flex:1">产品编码:{{ baseData.productCode }}</div>
+            <div style="flex:1">产品名称:{{ baseData.productName }}</div>
+          </div>
+          <a-tabs size="small" type="card" v-model="curTab" @change="callback">
+            <a-tab-pane key="1" tab="当前客户">
+            </a-tab-pane>
+            <a-tab-pane key="2" tab="全部客户">
+            </a-tab-pane>
+          </a-tabs>
+        </div>
+        <!-- 表格 -->
+        <a-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :scroll="{ y: tableHeight }"
+          :columns="columns"
+          :dataSource="list"
+          :loading="loading"
+          :pagination="false"
+          bordered>
+        </a-table>
+        <!-- 分页 -->
+        <tablePagination
+          ref="tablePagination"
+          :total="paginationProps.total"
+          :current="paginationProps.current"
+          :pageSize="paginationProps.pageSize"
+          @changePageSize="changePageSize"
+          @changePage="changePage" />
+      </div>
+    </a-drawer>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { salesRecordlList } from '@/api/salesDetail.js'
+import { STable } from '@/components'
+import tablePagination from '@/views/common/tablePagination.vue'
+export default {
+  name: 'SalesRecordModal',
+  mixins: [commonMixin],
+  components: { STable, tablePagination },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  computed: {
+    modalTit () {
+      return '销售记录'
+    }
+  },
+  data () {
+    const _this = this
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      tableHeight: 0,
+      buyerSn: null,
+      queryParam: {
+        productSn: null
+      },
+      // 表头
+      columns: [
+        { title: '销售时间', dataIndex: 'salesBillEntity.createDate', width: 250, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售价', dataIndex: 'price', width: 150, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '销售数量', dataIndex: 'qty', width: 150, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '客户名称', dataIndex: 'salesBillEntity.buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+      ],
+      list: [],
+      loading: false,
+      curTab: '1',
+      paginationProps: {
+        total: 0, //  分页总条数
+        current: 1,
+        pageSize: 20
+      },
+      baseData: null
+    }
+  },
+  methods: {
+    setTableH () {
+      this.$nextTick(() => {
+        const searchBoxH = this.$refs.searchBox.offsetHeight
+        this.tableHeight = window.innerHeight - searchBoxH - 235
+      })
+    },
+    //  获取详情
+    getDetail (buyerSn, productSn, row) {
+      this.buyerSn = buyerSn
+      if (this.curTab == 1) {
+        this.queryParam.buyerSn = buyerSn
+      } else {
+        delete this.queryParam.buyerSn
+      }
+      this.queryParam.productSn = productSn
+      this.handelSearch(1)
+      this.baseData = row
+    },
+    // 查询列表
+    handelSearch (pageNo) {
+      this.paginationProps.current = pageNo || this.paginationProps.current
+      const params = {
+        pageNo: this.paginationProps.current,
+        pageSize: this.paginationProps.pageSize
+      }
+      // 开始查询
+      this.loading = true
+      salesRecordlList({ ...params, ...this.queryParam }).then(res => {
+        this.loading = false
+        if (res.status == 200) {
+          const data = res.data
+          this.paginationProps.total = Number(res.data.count) || 0
+          this.paginationProps.current = data.pageNo
+          this.list = data.list
+        } else {
+          this.paginationProps.total = 0
+          this.paginationProps.current = 1
+          this.paginationProps.pageSize = 20
+          this.list = []
+        }
+        this.setTableH()
+      })
+    },
+    //  分页  一页多少条change
+    changePageSize (current, pageSize) {
+      this.paginationProps.current = current
+      this.paginationProps.pageSize = pageSize
+      this.handelSearch()
+    },
+    //  分页 页码change
+    changePage (current) {
+      this.paginationProps.current = current
+      this.handelSearch()
+    },
+    callback (key) {
+      this.curTab = key
+      this.getDetail(this.buyerSn, this.queryParam.productSn, this.baseData)
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.paginationProps.total = 0
+        this.paginationProps.current = 1
+        this.paginationProps.pageSize = 20
+        this.curTab = '1'
+        this.list = []
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .salesRecord-modal{
+    .ant-drawer-body {
+      padding: 10px;
+    }
+  }
+</style>

+ 6 - 5
src/views/salesManagement/salesReturn/salesReturnEdit.vue

@@ -83,9 +83,10 @@
                   type="primary"
                   ghost
                   @click="salesReturnDelAll"
+                  :disabled="chooseLoadData.length==0"
                   :loading="delLoading"
                   style="margin-left: 10px"
-                  id="salesReturn-del-all">整单删除</a-button>
+                  id="salesReturn-del-all">清空列表</a-button>
               </div>
             </a-col>
           </a-row>
@@ -391,12 +392,12 @@ export default {
         }
       })
     },
-    // 整单删除
+    // 清空列表
     salesReturnDelAll () {
       const _this = this
       this.$confirm({
         title: '提示',
-        content: '确认要整单删除吗?',
+        content: '确认要清空已选产品列表吗?',
         centered: true,
         closable: true,
         onOk () {
@@ -439,7 +440,7 @@ export default {
     resetSearchForm (flag) {
       this.$refs.table.refresh(!!flag)
       if (flag) {
-        this.getOrderDetail()
+        this.getOrderDetail(true)
       }
     },
     // 添加或修改产品
@@ -479,7 +480,7 @@ export default {
       salesReturnSaveProduct(params).then(res => {
         this.resetSearchForm(type == 'edit')
         if (type == 'new') {
-          this.getOrderDetail()
+          this.getOrderDetail(true)
         }
         this.isInster = false
         this.spinning = false

+ 4 - 3
src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue

@@ -83,10 +83,11 @@
                 <a-button
                   type="primary"
                   ghost
+                  :disabled="chooseLoadData.length==0"
                   @click="salesReturnDelAll"
                   :loading="delLoading"
                   style="margin-left: 10px"
-                  id="salesReturn-del-all">整单删除</a-button>
+                  id="salesReturn-del-all">清空列表</a-button>
               </div>
             </a-col>
           </a-row>
@@ -377,12 +378,12 @@ export default {
         }
       })
     },
-    // 整单删除
+    // 清空列表
     salesReturnDelAll () {
       const _this = this
       this.$confirm({
         title: '提示',
-        content: '确认要整单删除吗?',
+        content: '确认要清空已选产品列表吗?',
         centered: true,
         closable: true,
         onOk () {