Ver Fonte

对接销售缺货、缺货统计(按客户)、缺货统计(按产品)

chenrui há 4 anos atrás
pai
commit
abd652d9ba

+ 92 - 0
src/api/oos.js

@@ -0,0 +1,92 @@
+import { axios } from '@/utils/request'
+
+//  缺货  列表  分页
+export const oosList = (params) => {
+  const url = `/oos/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+//  缺货  详情
+export const oosDetail = (params) => {
+  const url = `/oos/findBySn/${params.sn}`
+  return axios({
+    url: url,
+    method: 'get'
+  })
+}
+//  缺货  详情  列表  分页
+export const oosDetailList = (params) => {
+  const url = `/oos/detail/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 缺货统计  按客户  列表  分页
+export const oosBuyerList = (params) => {
+  const url = `/oos/detail/queryPageByBuyer/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 缺货统计  按客户  合计  本页
+export const oosBuyerDetailPageCount = (params) => {
+  const url = `/oos/detail/queryPageCountByBuyer/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 缺货统计  按客户  合计
+export const oosBuyerDetailCount = (params) => {
+  return axios({
+    url: '/oos/detail/queryAllCountByBuyer',
+    data: params,
+    method: 'post'
+  })
+}
+// 缺货统计  按产品  列表  分页
+export const oosProductList = (params) => {
+  const url = `/oos/detail/queryPageByProduct/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 缺货统计  按产品  合计  本页
+export const oosProductDetailPageCount = (params) => {
+  const url = `/oos/detail/queryPageCountByProduct/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 缺货统计  按产品  合计
+export const oosProductDetailCount = (params) => {
+  return axios({
+    url: '/oos/detail/queryAllCountByProduct',
+    data: params,
+    method: 'post'
+  })
+}

+ 75 - 86
src/config/router.config.js

@@ -903,93 +903,82 @@ export const asyncRouterMap = [
                 }
               }
             ]
+          },
+          {
+            path: '/salesManagement/backorder',
+            redirect: '/salesManagement/backorder/list',
+            name: 'backorder',
+            component: RouteView,
+            meta: {
+              title: '销售缺货列表',
+              icon: 'exception'
+              // permission: 'M_goodsManage_list'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'backorderList',
+                component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/backorder/list.vue'),
+                meta: {
+                  title: '缺货单列表',
+                  icon: 'exception',
+                  hidden: true
+                  // permission: 'M_goodsManage_list'
+                }
+              }
+            ]
+          },
+          {
+            path: '/salesManagement/shortageStatisticsC',
+            redirect: '/salesManagement/shortageStatisticsC/list',
+            name: 'shortageStatisticsC',
+            component: RouteView,
+            meta: {
+              title: '缺货统计(按客户)',
+              icon: 'sketch'
+              // permission: 'M_goodsManage_list'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'shortageStatisticsCList',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/salesManagement/shortageStatisticsC/list.vue'),
+                meta: {
+                  title: '缺货统计列表',
+                  icon: 'sketch',
+                  hidden: true
+                  // permission: 'M_goodsManage_list'
+                }
+              }
+            ]
+          },
+          {
+            path: '/salesManagement/shortageStatisticsP',
+            redirect: '/salesManagement/shortageStatisticsP/list',
+            name: 'shortageStatisticsP',
+            component: RouteView,
+            meta: {
+              title: '缺货统计(按产品)',
+              icon: 'sketch'
+              // permission: 'M_goodsManage_list'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'shortageStatisticsPList',
+                component: () => import(/* webpackChunkName: "shop" */ '@/views/salesManagement/shortageStatisticsP/list.vue'),
+                meta: {
+                  title: '缺货统计列表',
+                  icon: 'sketch',
+                  hidden: true
+                  // permission: 'M_goodsManage_list'
+                }
+              }
+            ]
           }
-          // {
-          //   path: '/salesManagement/backorder',
-          //   redirect: '/salesManagement/backorder/list',
-          //   name: 'backorder',
-          //   component: RouteView,
-          //   meta: {
-          //     title: '销售缺货列表',
-          //     icon: 'exception'
-          //     // permission: 'M_goodsManage_list'
-          //   },
-          //   hideChildrenInMenu: true,
-          //   children: [
-          //     {
-          //       path: 'list',
-          //       name: 'backorderList',
-          //       component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/backorder/list.vue'),
-          //       meta: {
-          //         title: '缺货单列表',
-          //         icon: 'exception',
-          //         hidden: true
-          //         // permission: 'M_goodsManage_list'
-          //       }
-          //     },
-          //     {
-          //       path: 'detail/:id',
-          //       name: 'backorderDetail',
-          //       component: () => import(/* webpackChunkName: "salesManagement" */ '@/views/salesManagement/backorder/detail.vue'),
-          //       meta: {
-          //         title: '缺货单详情',
-          //         icon: 'exception',
-          //         hidden: true
-          //         // permission: 'M_goodsManage_list'
-          //       }
-          //     }
-          //   ]
-          // },
-          // {
-          //   path: '/salesManagement/shortageStatisticsC',
-          //   redirect: '/salesManagement/shortageStatisticsC/list',
-          //   name: 'shortageStatisticsC',
-          //   component: RouteView,
-          //   meta: {
-          //     title: '缺货统计(按客户)',
-          //     icon: 'sketch'
-          //     // permission: 'M_goodsManage_list'
-          //   },
-          //   hideChildrenInMenu: true,
-          //   children: [
-          //     {
-          //       path: 'list',
-          //       name: 'shortageStatisticsCList',
-          //       component: () => import(/* webpackChunkName: "shop" */ '@/views/salesManagement/shortageStatisticsC/list.vue'),
-          //       meta: {
-          //         title: '缺货统计列表',
-          //         icon: 'sketch',
-          //         hidden: true
-          //         // permission: 'M_goodsManage_list'
-          //       }
-          //     }
-          //   ]
-          // },
-          // {
-          //   path: '/salesManagement/shortageStatisticsP',
-          //   redirect: '/salesManagement/shortageStatisticsP/list',
-          //   name: 'shortageStatisticsP',
-          //   component: RouteView,
-          //   meta: {
-          //     title: '缺货统计(按产品)',
-          //     icon: 'sketch'
-          //     // permission: 'M_goodsManage_list'
-          //   },
-          //   hideChildrenInMenu: true,
-          //   children: [
-          //     {
-          //       path: 'list',
-          //       name: 'shortageStatisticsPList',
-          //       component: () => import(/* webpackChunkName: "shop" */ '@/views/salesManagement/shortageStatisticsP/list.vue'),
-          //       meta: {
-          //         title: '缺货统计列表',
-          //         icon: 'sketch',
-          //         hidden: true
-          //         // permission: 'M_goodsManage_list'
-          //       }
-          //     }
-          //   ]
-          // }
         ]
       },
       // 库存管理

+ 1 - 1
src/views/allocationManagement/transferOut/list.vue

@@ -236,7 +236,7 @@ export default {
         okText: '审核通过',
         cancelText: '审核不通过',
         onOk () {
-          _this.auditOrder(row.allocateSn, 'FINISH')
+          _this.auditOrder(row.allocateSn, 'WAIT_OUT_WAREHOUSE')
         },
         onCancel (e) {
           if (!e.triggerCancel) {

+ 0 - 128
src/views/salesManagement/backorder/detail.vue

@@ -1,128 +0,0 @@
-<template>
-  <div class="backorderDetail-wrap">
-    <a-page-header :ghost="false" @back="handleBack" class="backorderDetail-back">
-      <!-- 自定义的二级文字标题 -->
-      <template slot="subTitle">
-        <a id="backorderDetail-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
-      </template>
-    </a-page-header>
-    <a-card size="small" :bordered="false" class="backorderDetail-cont">
-      <a-collapse :activeKey="['1']">
-        <a-collapse-panel key="1" header="基础信息">
-          <a-descriptions :column="3">
-            <a-descriptions-item label="客户名称">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="客户地址">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="支付方式">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="收款方式">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="联系手机">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="联系电话">箭冠营销中心</a-descriptions-item>
-            <a-descriptions-item label="销售单号">箭冠营销中心</a-descriptions-item>
-          </a-descriptions>
-        </a-collapse-panel>
-      </a-collapse>
-    </a-card>
-    <a-card size="small" :bordered="false" class="backorderDetail-cont">
-      <!-- 总计 -->
-      <a-alert type="info" showIcon style="margin-bottom:15px">
-        <div slot="message">缺货总款数:<strong>1</strong>,缺货总数量:<strong>1</strong>,缺货总售价:<strong>0</strong></div>
-      </a-alert>
-      <!-- 列表 -->
-      <s-table
-        class="sTable"
-        ref="table"
-        size="default"
-        :rowKey="(record) => record.id"
-        :columns="columns"
-        :data="loadData"
-        :scroll="{ x: 960 }"
-        bordered></s-table>
-    </a-card>
-  </div>
-</template>
-
-<script>
-import { STable, VSelect } from '@/components'
-export default {
-  components: { STable, VSelect },
-  data () {
-    return {
-      queryParam: {
-
-      },
-      disabled: false, //  查询、重置按钮是否可操作
-      brandData: [], //  产品品牌  下拉数据
-      typeData: [], //  产品类别  下拉数据
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
-        { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center' },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '售价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '缺货数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productOrigUnit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '售价小计', dataIndex: 'salePriceSubtotal', width: 100, align: 'center' }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
-        //   const data = res.data
-        //   const no = (data.pageNo - 1) * data.pageSize
-        //   for (var i = 0; i < data.list.length; i++) {
-        //     data.list[i].no = no + i + 1
-        //   }
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
-            ],
-            count: 10
-          }
-          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
-          resolve(data)
-        })
-      }
-    }
-  },
-  methods: {
-    //  重置
-    resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
-      this.$refs.table.refresh(true)
-    },
-    //  提交
-    handleSubmit () {},
-    //  返回列表
-    handleBack () {
-      this.$router.push({ path: '/salesManagement/backorder/list' })
-    }
-  }
-}
-</script>
-
-<style lang="less">
-  .backorderDetail-wrap{
-    .backorderDetail-back{
-      margin-bottom: 10px;
-    }
-    .backorderDetail-cont{
-      margin-bottom: 10px;
-    }
-  }
-</style>

+ 131 - 0
src/views/salesManagement/backorder/detailModal.vue

@@ -0,0 +1,131 @@
+<template>
+  <a-modal
+    centered
+    class="backorderDetail-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="详情"
+    v-model="isShow"
+    @cancle="isShow=false"
+    :width="1000">
+    <!-- 基础信息 -->
+    <a-card size="small" :bordered="false" class="backorderDetail-cont">
+      <a-collapse :activeKey="['1']">
+        <a-collapse-panel key="1" header="基础信息">
+          <a-descriptions size="small" :column="2">
+            <a-descriptions-item label="销售单号">{{ detailData&&detailData.salesBillNo || '--' }}</a-descriptions-item>
+          </a-descriptions>
+        </a-collapse-panel>
+      </a-collapse>
+    </a-card>
+    <a-card size="small" :bordered="false" class="backorderDetail-cont">
+      <!-- alert -->
+      <a-alert type="info" showIcon style="margin-bottom:10px">
+        <div slot="message">
+          缺货总款数:<strong>{{ (detailData&&detailData.totalCategory)||detailData.totalCategory==0 ? detailData.totalCategory : '--' }}</strong>,
+          缺货总数量:<strong>{{ (detailData&&detailData.totalQty)||detailData.totalQty==0 ? detailData.totalQty : '--' }}</strong>,
+          缺货总售价:<strong>{{ (detailData&&detailData.totalAmount)||detailData.totalAmount==0 ? detailData.totalAmount : '--' }}</strong></div>
+      </a-alert>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ x: 1040, y: 500 }"
+        bordered>
+      </s-table>
+    </a-card>
+  </a-modal>
+</template>
+
+<script>
+import { STable } from '@/components'
+import { oosDetail, oosDetailList } from '@/api/oos'
+export default {
+  name: 'BackorderDetailModal',
+  components: { STable },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: [Number, String],
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      detailData: null, //  详情数据
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '缺货数量', dataIndex: 'qty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '缺货金额', dataIndex: 'totalAmount', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        return oosDetailList(Object.assign(parameter, this.queryParam, { sn: this.itemSn })).then(res => {
+          const data = res.data
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+          }
+          this.disabled = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    //  获取详情
+    getDetail () {
+      oosDetail({ sn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          this.detailData = res.data
+        } else {
+          this.detailData = null
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    },
+    itemSn (newValue, oldValue) {
+      if (this.isShow && newValue) {
+        this.getDetail()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .backorderDetail-modal{
+    .ant-modal-body {
+      padding: 10px 10px 20px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 41 - 50
src/views/salesManagement/backorder/list.vue

@@ -5,7 +5,7 @@
       <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
-            <a-form-item label="审核时间">
+            <a-form-item label="创建时间">
               <a-range-picker
                 style="width:100%"
                 id="backorderList-creatTime"
@@ -18,7 +18,7 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="客户名称">
-              <custList id="backorderList-bundleName" defValKey="customerSn" v-model="queryParam.buyerSn"></custList>
+              <custList ref="custList" id="backorderList-buyerSn" @change="custChange"></custList>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -36,28 +36,31 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 1120 }"
+      :scroll="{ x: 1120, y: tableHeight }"
       bordered>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
         <a-button size="small" type="link" @click="handleDetail(record)" id="backorderList-detail-btn">详情</a-button>
       </template>
     </s-table>
+    <!-- 详情 -->
+    <backorder-detail-modal :openModal="openModal" :itemSn="itemSn" @close="closeModal" />
   </a-card>
 </template>
 
 <script>
-// import { getProvince, getCityByPro, getDistrictByCity } from '@/api/data'
+import moment from 'moment'
 import custList from '@/views/common/custList.vue'
 import { STable, VSelect } from '@/components'
+import backorderDetailModal from './detailModal.vue'
+import { oosList } from '@/api/oos'
 export default {
-  components: { STable, VSelect, custList },
+  components: { STable, VSelect, custList, backorderDetailModal },
   data () {
     return {
-      advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0, // 表格高度
       queryParam: { //  查询条件
-        bundleName: '', //  供应商名称
-        state: undefined //  状态
+        buyerSn: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
       dateFormat: 'YYYY-MM-DD',
@@ -65,8 +68,8 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
-        { title: '销售单号', dataIndex: 'salesBillNo', width: 140, align: 'center' },
-        { title: '客户名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '销售单号', dataIndex: 'salesBillNo', align: 'center' },
+        { title: '客户名称', dataIndex: 'dealerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '缺货款数', dataIndex: 'totalCategory', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '缺货数量', dataIndex: 'totalQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '缺货金额', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -75,33 +78,29 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
-        //   const data = res.data
-        //   const no = (data.pageNo - 1) * data.pageSize
-        //   for (var i = 0; i < data.list.length; i++) {
-        //     data.list[i].no = no + i + 1
-        //   }
-        //   this.disabled = false
-        //   return data
-        // })
-        const _this = this
-        return new Promise(function (resolve, reject) {
-          const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: [
-              { id: '1', productNum: 'jgqp11111111111', productName: '产品1', productOldNum: 'jgqp111123545', productBrand: '箭冠品牌', productType: '产品分类1', inventoryNum: '5', inventoryMoney: '122' }
-            ]
-          }
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 380
+        }
+        // 时间
+        if (this.time && this.time.length > 0) {
+          this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)
+          this.queryParam.endDate = moment(this.time[1]).format(this.dateFormat)
+        } else {
+          this.queryParam.beginDate = undefined
+          this.queryParam.endDate = undefined
+        }
+        return oosList(Object.assign(parameter, this.queryParam)).then(res => {
+          const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
           }
-          _this.disabled = false
-          resolve(data)
+          this.disabled = false
+          return data
         })
       },
-      brandData: []
+      openModal: false,
+      itemSn: ''
     }
   },
   methods: {
@@ -109,33 +108,25 @@ export default {
     disabledDate (date, dateStrings) {
       return date && date.valueOf() > Date.now()
     },
-    filterOption (input, option) {
-    	return (
-    		option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-    	)
+    custChange (obj) {
+      this.queryParam.buyerSn = obj.key
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
+      this.queryParam.buyerSn = undefined
+      this.time = []
       this.$refs.table.refresh(true)
     },
+    // 关闭
+    closeModal () {
+      this.itemSn = ''
+      this.openModal = false
+    },
     //  详情
     handleDetail (row) {
-      this.$router.push({ path: `/salesManagement/backorder/detail/${row.id}` })
+      this.itemSn = row.oosBillSn
+      this.openModal = true
     }
   }
 }
 </script>
-
-<style lang="less">
-  .backorderList-wrap{
-    .sTable{
-      margin-top: 20px;
-    }
-  }
-</style>

+ 1 - 1
src/views/salesManagement/outboundOrder/list.vue

@@ -72,7 +72,7 @@
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
-      :scroll="{ x: 1710 }"
+      :scroll="{ x: 1710, y: tableHeight }"
       bordered>
       <!-- 单号 -->
       <template slot="stockOutNo" slot-scope="text, record">

+ 274 - 3
src/views/salesManagement/shortageStatisticsC/list.vue

@@ -1,8 +1,279 @@
 <template>
+  <a-card size="small" :bordered="false" class="shortageStatisticsCList-wrap">
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-item label="创建时间">
+              <a-range-picker
+                style="width:100%"
+                id="shortageStatisticsCList-creatTime"
+                :disabledDate="disabledDate"
+                v-model="time"
+                :format="dateFormat"
+                :placeholder="['开始时间', '结束时间']" />
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品名称">
+              <a-input id="shortageStatisticsCList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品编码">
+              <a-input id="shortageStatisticsCList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="客户名称">
+                <custList ref="custList" id="shortageStatisticsCList-buyerSn" @change="custChange"></custList>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="区域">
+                <subarea id="shortageStatisticsCList-subarea" v-model="queryParam.subareaSn"></subarea>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品分类">
+                <a-cascader
+                  @change="changeProductType"
+                  expand-trigger="hover"
+                  change-on-select
+                  :options="productTypeList"
+                  :fieldNames="{ label: 'productTypeName', value: 'id', children: 'children' }"
+                  id="shortageStatisticsCList-productType"
+                  placeholder="请选择产品分类"
+                  allowClear
+                  v-model="productType" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="销售单号">
+                <a-input id="shortageStatisticsCList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
+              </a-form-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24">
+            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shortageStatisticsCList-refresh">查询</a-button>
+            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="shortageStatisticsCList-reset">重置</a-button>
+            <a-button
+              style="margin-left: 8px"
+              type="danger"
+              @click="handleExport"
+              :disabled="disabled"
+              :loading="exportLoading"
+              id="shortageStatisticsCList-export">导出</a-button>
+            <a @click="advanced=!advanced" style="margin-left: 8px">
+              {{ advanced ? '收起' : '展开' }}
+              <a-icon :type="advanced ? 'up' : 'down'"/>
+            </a>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- alert -->
+    <a-alert type="info" showIcon style="margin-bottom:10px">
+      <div slot="message">
+        <div>
+          总客户数:<strong>{{ productTotal ? ((productTotal.totalBuyerQty || productTotal.totalBuyerQty==0) ? productTotal.totalBuyerQty : '--') : '--' }}</strong>,
+          总单数:<strong>{{ productTotal ? ((productTotal.totalRecord || productTotal.totalRecord==0) ? productTotal.totalRecord : '--') : '--' }}</strong>,
+          缺货总款数:<strong>{{ productTotal ? ((productTotal.totalCategory || productTotal.totalCategory==0) ? productTotal.totalCategory : '--') : '--' }}</strong>,
+          缺货总数量:<strong>{{ productTotal ? ((productTotal.totalQty || productTotal.totalQty==0) ? productTotal.totalQty : '--') : '--' }}</strong>,
+          缺货总金额(¥):<strong>{{ productTotal ? ((productTotal.totalAmount || productTotal.totalAmount==0) ? productTotal.totalAmount : '--') : '--' }}</strong>
+        </div>
+        <div>
+          本页客户数:<strong>{{ currentTotal ? ((currentTotal.totalBuyerQty || currentTotal.totalBuyerQty==0) ? currentTotal.totalBuyerQty : '--') : '--' }}</strong>,
+          本页总单数:<strong>{{ currentTotal ? ((currentTotal.totalRecord || currentTotal.totalRecord==0) ? currentTotal.totalRecord : '--') : '--' }}</strong>,
+          本页缺货总款数:<strong>{{ currentTotal ? ((currentTotal.totalCategory || currentTotal.totalCategory==0) ? currentTotal.totalCategory : '--') : '--' }}</strong>,
+          本页缺货总数量:<strong>{{ currentTotal ? ((currentTotal.totalQty || currentTotal.totalQty==0) ? currentTotal.totalQty : '--') : '--' }}</strong>,
+          本页缺货总金额(¥):<strong>{{ currentTotal ? ((currentTotal.totalAmount || currentTotal.totalAmount==0) ? currentTotal.totalAmount : '--') : '--' }}</strong>
+        </div>
+      </div></a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      :scroll="{ x: 1120, y: tableHeight }"
+      bordered>
+      <!-- 单号 -->
+      <template slot="salesBillNo" slot-scope="text, record">
+        <span style="color: #ed1c24;cursor: pointer;" @click="handleDetail(record)">{{ record.salesBillNo }}</span>
+      </template>
+    </s-table>
+  </a-card>
 </template>
 
 <script>
+import moment from 'moment'
+import getDate from '@/libs/getDate.js'
+import { STable, VSelect } from '@/components'
+import custList from '@/views/common/custList.vue'
+import subarea from '@/views/common/subarea.js'
+import { productTypeQuery } from '@/api/productType'
+import { oosBuyerList, oosBuyerDetailCount, oosBuyerDetailPageCount } from '@/api/oos'
+export default {
+  components: { STable, VSelect, custList, subarea },
+  data () {
+    return {
+      advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        buyerSn: undefined,
+        subareaSn: undefined, //  区域
+        productName: '',
+        productCode: '',
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
+        salesBillNo: ''
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false, // 导出loading
+      dateFormat: 'YYYY-MM-DD',
+      time: [
+        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+      ], //  创建时间
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
+        { title: '销售单号', scopedSlots: { customRender: 'salesBillNo' }, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '缺货数量', dataIndex: 'qty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '客户名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 380
+        }
+        // 时间
+        if (this.time && this.time.length > 0) {
+          this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)
+          this.queryParam.endDate = moment(this.time[1]).format(this.dateFormat)
+        } else {
+          this.queryParam.beginDate = undefined
+          this.queryParam.endDate = undefined
+        }
+        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
+        const params = Object.assign(parameter, this.queryParam) //  无分页
+        return oosBuyerList(params).then(res => {
+          const data = res.data
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+          }
+          this.disabled = false
+          this.getCount(params)
+          this.getCurrentCount(paramsPage)
+          return data
+        })
+      },
+      productType: [],
+      productTypeList: [], //  分类下拉数据
+      productTotal: null,
+      currentTotal: null
+    }
+  },
+  methods: {
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf() > Date.now()
+    },
+    custChange (obj) {
+      this.queryParam.buyerSn = obj.key
+    },
+    // 合计
+    getCount (params) {
+      oosBuyerDetailCount(params).then(res => {
+        if (res.status == 200) {
+          this.productTotal = res.data
+        } else {
+          this.productTotal = null
+        }
+      })
+    },
+    // 本页合计
+    getCurrentCount (params) {
+      oosBuyerDetailPageCount(params).then(res => {
+        if (res.status == 200) {
+          this.currentTotal = res.data
+        } else {
+          this.currentTotal = null
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.buyerSn = undefined
+      this.queryParam.subareaSn = undefined
+      this.queryParam.productName = ''
+      this.queryParam.productCode = ''
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.queryParam.salesBillNo = ''
+      this.productType = []
+      this.time = [
+        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+      ]
+      this.$refs.table.refresh(true)
+    },
+    // 详情
+    handleDetail (row) {
+      this.$router.push({ name: 'salesDetail', params: { sn: row.salesBillSn } })
+    },
+    //  导出
+    handleExport () {
+      // this.exportLoading = true
+      // customerBundleExportDelay({}).then(res => {
+      //   this.exportLoading = false
+      //   this.download(res)
+      // })
+    },
+    download (data) {
+      if (!data) { return }
+      const url = window.URL.createObjectURL(new Blob([data]))
+      const link = document.createElement('a')
+      link.style.display = 'none'
+      link.href = url
+      const a = moment().format('YYYYMMDDHHmmss')
+      const fname = '未完成单据_盘点' + a
+      link.setAttribute('download', fname + '.xlsx')
+      document.body.appendChild(link)
+      link.click()
+    },
+    //  产品分类  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] : ''
+    },
+    //  产品分类  列表
+    getProductType () {
+      productTypeQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productTypeList = res.data
+        } else {
+          this.productTypeList = []
+        }
+      })
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+      vm.getProductType()
+    })
+  }
+}
 </script>
-
-<style>
-</style>

+ 175 - 3
src/views/salesManagement/shortageStatisticsP/list.vue

@@ -1,8 +1,180 @@
 <template>
+  <a-card size="small" :bordered="false" class="shortageStatisticsPList-wrap">
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-item label="创建时间">
+              <a-range-picker
+                style="width:100%"
+                id="shortageStatisticsPList-creatTime"
+                :disabledDate="disabledDate"
+                v-model="time"
+                :format="dateFormat"
+                :placeholder="['开始时间', '结束时间']" />
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品编码">
+              <a-input id="shortageStatisticsPList-productCode" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品名称">
+              <a-input id="shortageStatisticsPList-productName" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+            </a-form-item>
+          </a-col>
+          <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="原厂编码">
+                <a-input id="shortageStatisticsPList-productOrigCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
+              </a-form-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24">
+            <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="shortageStatisticsPList-refresh">查询</a-button>
+            <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="shortageStatisticsPList-reset">重置</a-button>
+            <a @click="advanced=!advanced" style="margin-left: 8px">
+              {{ advanced ? '收起' : '展开' }}
+              <a-icon :type="advanced ? 'up' : 'down'"/>
+            </a>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- alert -->
+    <a-alert type="info" showIcon style="margin:10px 0">
+      <div slot="message">
+        <div>
+          总缺货数量:<strong>{{ productTotal ? ((productTotal.totalQty || productTotal.totalQty==0) ? productTotal.totalQty : '--') : '--' }}</strong>,
+          总缺货金额(¥):<strong>{{ productTotal ? ((productTotal.totalAmount || productTotal.totalAmount==0) ? productTotal.totalAmount : '--') : '--' }}</strong>
+        </div>
+        <div>
+          本页缺货数量:<strong>{{ currentTotal ? ((currentTotal.totalQty || currentTotal.totalQty==0) ? currentTotal.totalQty : '--') : '--' }}</strong>,
+          本页缺货金额(¥):<strong>{{ currentTotal ? ((currentTotal.totalAmount || currentTotal.totalAmount==0) ? currentTotal.totalAmount : '--') : '--' }}</strong>
+        </div>
+      </div></a-alert>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="default"
+      :rowKey="(record) => record.id"
+      :columns="columns"
+      :data="loadData"
+      :scroll="{ x: 1280, y: tableHeight }"
+      bordered>
+    </s-table>
+  </a-card>
 </template>
 
 <script>
+import moment from 'moment'
+import getDate from '@/libs/getDate.js'
+import { STable, VSelect } from '@/components'
+import { oosProductList, oosProductDetailCount, oosProductDetailPageCount } from '@/api/oos'
+export default {
+  components: { STable, VSelect },
+  data () {
+    return {
+      advanced: false, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      queryParam: { //  查询条件
+        productName: '',
+        productCode: '',
+        productOrigCode: ''
+      },
+      disabled: false, //  查询、重置按钮是否可操作
+      dateFormat: 'YYYY-MM-DD',
+      time: [
+        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+      ], //  创建时间
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '缺货数量', dataIndex: 'qty', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '缺货金额', dataIndex: 'totalAmount', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '客户名称', dataIndex: 'buyerName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        if (this.tableHeight == 0) {
+          this.tableHeight = window.innerHeight - 380
+        }
+        // 时间
+        if (this.time && this.time.length > 0) {
+          this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)
+          this.queryParam.endDate = moment(this.time[1]).format(this.dateFormat)
+        } else {
+          this.queryParam.beginDate = undefined
+          this.queryParam.endDate = undefined
+        }
+        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
+        const params = Object.assign(parameter, this.queryParam) //  无分页
+        return oosProductList(params).then(res => {
+          const data = res.data
+          const no = (data.pageNo - 1) * data.pageSize
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+          }
+          this.disabled = false
+          this.getCount(params)
+          this.getCurrentCount(paramsPage)
+          return data
+        })
+      },
+      productType: [],
+      productTypeList: [], //  分类下拉数据
+      productTotal: null,
+      currentTotal: null
+    }
+  },
+  methods: {
+    // 不可选日期
+    disabledDate (date, dateStrings) {
+      return date && date.valueOf() > Date.now()
+    },
+    // 合计
+    getCount (params) {
+      oosProductDetailCount(params).then(res => {
+        if (res.status == 200) {
+          this.productTotal = res.data
+        } else {
+          this.productTotal = null
+        }
+      })
+    },
+    // 本页合计
+    getCurrentCount (params) {
+      oosProductDetailPageCount(params).then(res => {
+        if (res.status == 200) {
+          this.currentTotal = res.data
+        } else {
+          this.currentTotal = null
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.productName = ''
+      this.queryParam.productCode = ''
+      this.queryParam.productOrigCode = ''
+      this.time = [
+        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+      ]
+      this.$refs.table.refresh(true)
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {
+    })
+  }
+}
 </script>
-
-<style>
-</style>