Ver Fonte

接口调试

lilei há 2 anos atrás
pai
commit
2422aa8c04

+ 9 - 0
src/api/salesBillReport.js

@@ -1,5 +1,14 @@
 import { axios } from '@/utils/request'
 
+// 销售明细导出报表
+export const salesDetailExport = (params) => {
+  return axios({
+    url: '/report/salesBillReport/salesDetail',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
 //  开单销售单报表   列表  有分页
 export const salesBillReportList = (params) => {
   const url = `/report/salesBillReport/queryPage/${params.pageNo}/${params.pageSize}`

+ 13 - 0
src/api/salesDetail.js

@@ -80,6 +80,19 @@ export const salesDetailAllStockList = (params) => {
     method: 'post'
   })
 }
+
+// 缺货明细
+export const salesStockoutDetail = (params) => {
+  const url = `/sales/detail/queryPageStock`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
 // 销售列表  分页  带库存
 export const salesDetailStockList = (params) => {
   const url = `/sales/detail/queryPageStock/${params.pageNo}/${params.pageSize}`

+ 9 - 7
src/api/salesReturn.js

@@ -78,18 +78,20 @@ export const salesReturnExport = (params) => {
   })
 }
 
-//  销售退货 统计查询
-export const salesReturnQueryCount = (params) => {
+//  销售退货 分页查询产品
+export const salesReturnList = (params) => {
+  const url = `/salesReturn/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
   return axios({
-    url: '/salesReturn/queryCount',
+    url: url,
     data: params,
     method: 'post'
   })
 }
-
-//  销售退货 分页查询产品
-export const salesReturnList = (params) => {
-  const url = `/salesReturn/queryPage/${params.pageNo}/${params.pageSize}`
+// 销售退货 统计
+export const salesReturnQueryCount = (params) => {
+  const url = `/salesReturn/queryCount`
   delete params.pageNo
   delete params.pageSize
   return axios({

+ 3 - 0
src/utils/mixin.js

@@ -86,6 +86,9 @@ const commonMixin = {
         if (this.spinning !== undefined) {
           this.spinning = a
         }
+        if (this.exportLoading !== undefined){
+          this.exportLoading = a
+        }
       }
     }
   },

+ 92 - 43
src/views/allocationManagement/transferOut/basicInfoModal.vue

@@ -17,46 +17,75 @@
         :label-col="formItemLayout.labelCol"
         :wrapper-col="formItemLayout.wrapperCol"
       >
-        <a-form-model-item label="调往对象" prop="targetType">
-          <a-radio-group v-model="form.targetType" @change="targetTypeChange">
-            <a-radio v-for="(item,index) in targetTypeList" :key="index" :value="item.code">{{ item.dispName }}</a-radio>
-          </a-radio-group>
-        </a-form-model-item>
-        <a-form-model-item label="调往对象名称" :prop="isDealer ? 'targetSn' : 'targetName'">
-          <a-select
-            v-if="isDealer"
-            show-search
-            id="allocateBill-basicInfo-dealerName"
-            v-model="form.targetSn"
-            placeholder="请选择"
-            :filter-option="false"
-            :not-found-content="fetching ? undefined : null"
-            @search="fetchUser"
-            @change="handleChange"
-          >
-            <a-spin v-if="fetching" slot="notFoundContent" size="small" />
-            <a-select-option v-for="item in dealerData" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
-          </a-select>
-          <a-input v-if="!isDealer" v-model.trim="form.targetName" placeholder="请输入调往对象名称(最多30个字符)" allowClear :maxLength="30" />
-        </a-form-model-item>
-        <a-form-model-item label="调拨类型" prop="allocateTypeSn">
-          <a-select id="allocateBill-basicInfo-allocateTypeSn" v-model="form.allocateTypeSn" placeholder="请选择调拨类型" allowClear >
-            <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
-          </a-select>
-        </a-form-model-item>
-        <a-form-model-item label="起止时间" prop="time">
-          <a-range-picker
-            style="width:100%"
-            v-model="form.time"
-            show-time
-            :format="dateFormat"
-            @change="dateChange"
-            @calendarChange="dateCalendarChange"
-            :placeholder="['开始时间', '结束时间']" />
-        </a-form-model-item>
-        <a-form-model-item label="备注" prop="remark">
-          <a-textarea id="allocateBill-basicInfo-remark" :maxLength="120" v-model="form.remark" placeholder="请输入备注(最多120个字符)" allowClear />
-        </a-form-model-item>
+        <a-row :gutter="15">
+          <a-col :md="12" :sm="24">
+            <a-form-model-item label="调往对象" prop="targetType">
+              <a-radio-group v-model="form.targetType" @change="targetTypeChange">
+                <a-radio v-for="(item,index) in targetTypeList" :key="index" :value="item.code">{{ item.dispName }}</a-radio>
+              </a-radio-group>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="12" :sm="24">
+            <a-form-model-item label="调往对象名称" :prop="isDealer ? 'targetSn' : 'targetName'">
+              <a-select
+                v-if="isDealer"
+                show-search
+                id="allocateBill-basicInfo-dealerName"
+                v-model="form.targetSn"
+                placeholder="请选择"
+                :filter-option="false"
+                :not-found-content="fetching ? undefined : null"
+                @search="fetchUser"
+                @change="handleChange"
+              >
+                <a-spin v-if="fetching" slot="notFoundContent" size="small" />
+                <a-select-option v-for="item in dealerData" :key="item.dealerSn" :value="item.dealerSn">{{ item.dealerName }}</a-select-option>
+              </a-select>
+              <a-input v-if="!isDealer" v-model.trim="form.targetName" placeholder="请输入调往对象名称(最多30个字符)" allowClear :maxLength="30" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="12" :sm="24">
+            <a-form-model-item label="费用类型" prop="costTypeSn">
+              <a-select id="allocateBill-basicInfo-costTypeSn" v-model="form.costTypeSn" placeholder="请选择费用类型" allowClear >
+                <a-select-option v-for="item in allocateTypeList" :key="item.costTypeSn" :value="item.costTypeSn">{{ item.name }}</a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="12" :sm="24">
+            <a-form-model-item label="调拨类型" prop="allocateTypeSn">
+              <a-select id="allocateBill-basicInfo-allocateTypeSn" v-model="form.allocateTypeSn" placeholder="请选择调拨类型" allowClear >
+                <a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="12" :sm="24">
+            <a-form-model-item label="费用归属品牌">
+              <ProductBrand id="allocateBill-basicInfo-productBrandSn" v-model="form.productBrandSn" placeholder="请选择费用归属品牌"></ProductBrand>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="12" :sm="24">
+            <a-form-model-item label="费用归属品类">
+              <productTypeAll placeholder="请选择产品分类" @change="changeProductType" v-model="productType" id="allocateBill-basicInfo-productType"></productTypeAll>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="12" :sm="24">
+            <a-form-model-item label="起止时间" prop="time">
+              <a-range-picker
+                style="width:100%"
+                v-model="form.time"
+                show-time
+                :format="dateFormat"
+                @change="dateChange"
+                @calendarChange="dateCalendarChange"
+                :placeholder="['开始时间', '结束时间']" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="12" :sm="24">
+            <a-form-model-item label="备注" prop="remark">
+              <a-textarea id="allocateBill-basicInfo-remark" :maxLength="120" v-model="form.remark" placeholder="请输入备注(最多120个字符)" allowClear />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
       </a-form-model>
       <div class="btn-cont">
         <a-button type="primary" :loading="spinning" id="allocateBill-basicInfo-modal-save" @click="handleSave">保存</a-button>
@@ -75,10 +104,12 @@ import { allocateBillSave } from '@/api/allocateBill'
 import { dealerSubareaScopeList } from '@/api/dealer'
 import { getLookUpData } from '@/api/data'
 import { allocateTypeAllList } from '@/api/allocateType'
+import ProductBrand from '@/views/common/productBrand.js'
+import productTypeAll from '@/views/common/productTypeAll.js'
 export default {
   name: 'TransferOutBasicInfoModal',
   mixins: [commonMixin],
-  components: { VSelect },
+  components: { VSelect, ProductBrand, productTypeAll },
   props: {
     openModal: {
       //  弹框显示状态
@@ -92,14 +123,20 @@ export default {
       isShow: this.openModal, //  是否打开弹框
       spinning: false,
       formItemLayout: {
-        labelCol: { span: 4 },
-        wrapperCol: { span: 20 }
+        labelCol: { span: 6 },
+        wrapperCol: { span: 18 }
       },
+      productType: [],
       form: {
         targetType: 'DEALER',
         targetSn: undefined,
         targetName: '',
+        costTypeSn: undefined,
         allocateTypeSn: undefined,
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
         time: [],
         promoStartDate: '',
         promoEndDate: '',
@@ -108,6 +145,7 @@ export default {
       rules: {
         targetType: [{ required: true, message: '请选择调往对象', trigger: 'change' }],
         targetSn: [{ required: true, message: '请选择调往对象名称', trigger: 'change' }],
+        costTypeSn: [{ required: true, message: '请选择费用类型', trigger: 'change' }],
         targetName: [{ required: true, message: '请输入调往对象名称', trigger: 'blur' }],
         allocateTypeSn: [{ required: true, message: '请选择调拨类型', trigger: 'change' }]
       },
@@ -148,6 +186,12 @@ export default {
     dateCalendarChange (date, dateStrings) {
       this.selectPriceDate = date[0]
     },
+    //  产品分类  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] : ''
+    },
     // 搜索经销商
     fetchUser (value) {
       console.log('fetching user', value)
@@ -235,8 +279,13 @@ export default {
         this.form = {
           targetType: 'DEALER',
           targetSn: undefined,
+          costTypeSn: undefined,
           targetName: '',
           allocateTypeSn: undefined,
+          productBrandSn: undefined, //  产品品牌
+          productTypeSn1: '', //  产品一级分类
+          productTypeSn2: '', //  产品二级分类
+          productTypeSn3: '', //  产品三级分类
           time: [],
           promoStartDate: '',
           promoEndDate: '',

+ 9 - 7
src/views/financialManagement/collectionDetailStatic/list.vue

@@ -27,8 +27,9 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="客户名称">
-                <dealerSubareaScopeList id="collectionDetail-Employee" ref="settleClientName" @change="custChange" />
+              <a-form-item label="付款方">
+                <!-- <dealerSubareaScopeList id="collectionDetail-Employee" ref="settleClientName" @change="custChange" /> -->
+                <a-input id="financialCollectionList-payerNames" v-model.trim="queryParam.payerNames" allowClear placeholder="请输入付款方"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -37,8 +38,8 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="营业执照名称">
-                <a-input id="collectionDetail-licenseName" placeholder="请输入营业执照名称" v-model="queryParam.licenseName"></a-input>
+              <a-form-item label="付款账户">
+                <a-input id="collectionDetail-licenseName" placeholder="请输入付款账户" v-model="queryParam.licenseName"></a-input>
               </a-form-item>
             </a-col>
             <template v-if="advanced">
@@ -54,7 +55,7 @@
                 </a-form-item>
               </a-col>
               <a-col :md="4" :sm="24">
-                <a-form-item label="汇入银行">
+                <a-form-item label="户名/汇入银行">
                   <a-select placeholder="请选择汇入银行" v-model="queryParam.bankName" style="width: 100%">
                     <a-select-option v-for="item in bankNameList" :value="item">
                       {{ item }}
@@ -184,9 +185,10 @@ export default {
         { title: '申请人', dataIndex: 'applyPersonName', align: 'center', width: '5%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '收款事由', dataIndex: 'bookReason', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '收款日期', dataIndex: 'receiptDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'dealerName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '付款方类型', dataIndex: 'dealerName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '付款方', dataIndex: 'dealerName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
         { title: '财务编码', dataIndex: 'kdMidCustomerFnumber', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
-        { title: '营业执照名称', dataIndex: 'licenseName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '付款账户(营业执照)', dataIndex: 'licenseName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
         { title: '订单金额', dataIndex: 'orderAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
         { title: '收款金额', dataIndex: 'receiptAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
         { title: '使用授信', dataIndex: 'useCreditAmount', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },

+ 14 - 7
src/views/salesManagement/salesQuery/detail.vue

@@ -85,7 +85,10 @@
                 <span v-if="$hasPermissions('B_isShowPrice')">待发货金额:<strong>{{ detailData&&(detailData.totalUndispatchAmount || detailData.totalUndispatchAmount==0) ? detailData.totalUndispatchAmount : '--' }}</strong>;</span>
                 <span v-if="isCityPrice">市级总售价:<strong>{{ detailData&&(detailData.totalCityAmount || detailData.totalCityAmount==0) ? detailData.totalCityAmount : '--' }}</strong>;</span>
               </div>
-              <a-checkbox v-model="isCityPrice" v-if="$hasPermissions('B_isShowPrice')"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
+              <div>
+                <a-button v-if="detailData && (detailData.billStatus == 'WAIT_AUDIT' || detailData.billStatus == 'HQ_CHANGE')" type="link" @click="showStockOut=true">缺货明细</a-button>
+                <a-checkbox v-model="isCityPrice" v-if="$hasPermissions('B_isShowPrice')"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
+              </div>
             </div>
           </div>
         </a-alert>
@@ -102,15 +105,15 @@
           bordered>
           <!-- 产品编码 -->
           <template slot="productCode" slot-scope="text, record">
-            <div v-if="(record.promotionFlag == 1) || (Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit'))" class="flexBox">
+            <div v-if="(record.promotionFlag == 1) || (Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&(detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesAudit'))" class="flexBox">
               <div>{{ text }}</div>
               <a-badge count="促" :number-style="{ backgroundColor: '#f90' }" v-if="record.promotionFlag == 1">
               </a-badge>
               <!-- 可审核时才可显示“缺”货产品 -->
-              <a-badge count="缺" v-if="(Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit'))">
+              <a-badge count="缺" v-if="(Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&(detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesAudit'))">
               </a-badge>
             </div>
-            <span v-if="!(record.promotionFlag == 1 || ((Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit'))))">{{ text }}</span>
+            <span v-if="!(record.promotionFlag == 1 || ((Number(record.stockQty) < Number(record.unpushedQty)) && (detailData&&(detailData.billStatus == 'WAIT_AUDIT'||detailData.billStatus == 'HQ_CHANGE')&&$hasPermissions('B_salesAudit'))))">{{ text }}</span>
           </template>
           <!-- 当前库存 -->
           <template slot="stockQty" slot-scope="text, record">
@@ -185,6 +188,8 @@
       @fail="auditOrder('AUDIT_REJECT')" />
     <!-- 审核加下推 -->
     <dsModal ref="dsModal" title="销售单一键审核" :openModal="showDsModal" @close="showDsModal=false" @ok="handleOnceAudit" />
+    <!-- 缺货明细 -->
+    <stockOutDetail :openModal="showStockOut" :detailData="detailData" :salesBillSn="$route.params.sn || bizSn"></stockOutDetail>
   </div>
 </template>
 
@@ -196,12 +201,13 @@ import { STable, VSelect } from '@/components'
 import printModal from './printModal.vue'
 import auditModal from '@/views/common/auditModal.vue'
 import dsModal from '@/views/salesManagement/waitDispatch/dsModal.vue'
+import stockOutDetail from './stockOutDetailModal.vue'
 import { salesDetailBySn, salesDetailPrint, salesDetailExcel, salesDetailTypeExcel, salesWriteAudit, salesWriteAuditPush } from '@/api/sales'
 import { salesDetailAllList, salesDetailAllStockList } from '@/api/salesDetail'
 export default {
   name: 'SalesDetail',
   mixins: [commonMixin],
-  components: { STable, VSelect, printModal, auditModal, dsModal },
+  components: { STable, VSelect, printModal, auditModal, dsModal, stockOutDetail },
   props: {
     bizSn: { //  有值则为弹框,无值则为页面
       type: [Number, String],
@@ -213,12 +219,13 @@ export default {
       spinning: false,
       disabled: false,
       showDsModal: false,
+      showStockOut: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         const params = Object.assign(parameter, { salesBillSn: this.$route.params.sn || this.bizSn })
         let url = salesDetailAllList
-        if (this.detailData && this.detailData.billStatus == 'WAIT_AUDIT' && this.$hasPermissions('B_salesAudit')) { //  审核,需用到库存
+        if (this.detailData && (this.detailData.billStatus == 'WAIT_AUDIT' || this.detailData.billStatus == 'HQ_CHANGE') && this.$hasPermissions('B_salesAudit')) { //  审核,需用到库存
           url = salesDetailAllStockList
         } else { // 非审核
           url = salesDetailAllList
@@ -309,7 +316,7 @@ export default {
           arr.splice(ind + 1, 0, { title: '销售价', dataIndex: 'price', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
         }
       }
-      if (this.detailData && this.detailData.billStatus == 'WAIT_AUDIT' && this.$hasPermissions('B_salesAudit')) { //  审核,需用到库存
+      if (this.detailData && (this.detailData.billStatus == 'WAIT_AUDIT' || this.detailData.billStatus == 'HQ_CHANGE') && this.$hasPermissions('B_salesAudit')) { //  审核,需用到库存
         arr.splice(arr.length - 3, 0, { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '6%', align: 'center' })
       }
       return arr

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

@@ -89,6 +89,15 @@
               <span class="table-page-search-submitButtons">
                 <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
                 <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                <a-button
+                  style="margin-left: 10px"
+                  type="primary"
+                  class="button-warning"
+                  @click="handleExport"
+                  :disabled="disabled"
+                  :loading="exportLoading"
+                  v-if="$hasPermissions('B_actualSalesReport_export')"
+                >导出</a-button>
                 <a @click="advanced=!advanced" style="margin-left: 8px">
                   {{ advanced ? '收起' : '展开' }}
                   <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -238,6 +247,8 @@
         </div>
       </div>
     </commonModal>
+    <!-- 导出提示框 -->
+    <reportModal :visible="showExport" @close="showExport=false"></reportModal>
   </a-card>
 </template>
 
@@ -252,12 +263,15 @@ import { STable, VSelect } from '@/components'
 import commonModal from '@/views/common/commonModal.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
 import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import reportModal from '@/views/common/reportModal.vue'
 import { salesList, salesDel, salesCount } from '@/api/sales'
+import { hdExportExcel } from '@/libs/exportExcel'
 import { findBySalesBillSn, dispatchBatchPrintStatus, queryBySalesBillSn } from '@/api/dispatch'
+import { salesDetailExport } from '@/api/salesBillReport'
 export default {
   name: 'SalesQueryList',
   mixins: [commonMixin],
-  components: { STable, VSelect, chooseCustomModal, dealerSubareaScopeList, rangeDate, subarea, commonModal },
+  components: { STable, VSelect, chooseCustomModal, dealerSubareaScopeList, rangeDate, subarea, commonModal, reportModal },
   data () {
     return {
       spinning: false,
@@ -265,6 +279,8 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 选择客户弹框是否显示
       showTipModal: false, // 备货打印弹框
+      showExport: false,
+      exportLoading: false,
       tableHeight: 0,
       time: [
         moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
@@ -377,6 +393,18 @@ export default {
     }
   },
   methods: {
+    //  导出
+    handleExport () {
+      const _this = this
+      _this.showExport = true
+      const params = _this.queryParam
+      _this.exportLoading = true
+      _this.spinning = true
+      hdExportExcel(salesDetailExport, params, '销售明细', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+      })
+    },
     //  时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]

+ 115 - 0
src/views/salesManagement/salesQuery/stockOutDetailModal.vue

@@ -0,0 +1,115 @@
+<template>
+  <a-modal
+    centered
+    :footer="null"
+    :maskClosable="false"
+    title="销售单缺货明细"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="50%">
+    <a-descriptions size="small" :column="3">
+      <a-descriptions-item label="销售单号" :span="2">
+        {{ detailData&&detailData.salesBillNo || '--' }}
+        <span v-if="detailData&&detailData.salesBillNoSource">(原:{{ detailData&&detailData.salesBillNoSource || '--' }})</span>
+      </a-descriptions-item>
+      <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
+    </a-descriptions>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: 500 }"
+        :showPagination="false"
+        :defaultLoadData="false"
+        bordered>
+      </s-table>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { STable } from '@/components'
+import { salesStockoutDetail } from '@/api/salesDetail'
+export default {
+  name: 'StockOutDetail',
+  components: { STable },
+  props: {
+    openModal: {
+      type: Boolean,
+      default: false
+    },
+    salesBillSn: {
+      type: [Number, String],
+      default: ''
+    },
+    detailData: {
+      type: Object,
+      default: function () {
+        return null
+      }
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal,
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productEntity.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售数量', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '销售价', dataIndex: 'price', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '销售金额', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '缺货数量', dataIndex: 'lackQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '缺货金额', dataIndex: 'lackAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.spinning = true
+        delete parameter.tableId
+        delete parameter.index
+        return salesStockoutDetail({ isOos: 1, salesBillSn: this.salesBillSn }).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.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  watch: {
+    openModal (nVal, oVal) {
+      this.isShow = nVal
+    },
+    isShow (nVal, oVal) {
+      if (!nVal) {
+        this.$emit('close')
+        this.$refs.table.clearTable()
+      } else {
+        this.$nextTick(() => {
+          this.$refs.table.refresh()
+        })
+      }
+    },
+    itemSn (nVal, oVal) {
+
+    }
+  }
+}
+</script>
+
+<style>
+</style>

+ 32 - 11
src/views/salesReturnManagement/salesReturn/list.vue

@@ -91,16 +91,27 @@
             </a-col>
           </a-row>
         </a-form>
-      </div>
-      <!-- 操作按钮 -->
-      <div class="table-operator">
-        <a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesReturnNew')" @click="openModal = true">新增</a-button>
+        <!-- 操作按钮 -->
+        <div class="table-operator">
+          <a-button type="primary" class="button-error" v-if="$hasPermissions('B_salesReturnNew')" @click="openModal = true">新增</a-button>
+        </div>
+        <a-alert type="info" style="margin-bottom:10px">
+          <div slot="message">
+            总单数:{{ countData&&countData.totalRecord||0 }};
+            申请退货数量:{{ countData&&countData.totalQty||0 }};
+            仓库实收数量:{{ countData&&countData.totalReceiveQty||0 }};
+            坏件数量:{{ countData&&countData.totalBadQty||0 }};
+            良品数量:{{ countData&&countData.totalGoodQty||0 }};
+            返库数量:{{ countData&&countData.totalBackStockQty||0 }};
+            实际退货金额:{{ countData&&countData.totalAmount||0 }}元;
+          </div>
+        </a-alert>
       </div>
       <!-- 列表 -->
       <s-table
         class="sTable fixPagination"
         ref="table"
-        :style="{ height: tableHeight+64.5+'px' }"
+        :style="{ height: tableHeight+94.5+'px' }"
         size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
@@ -193,7 +204,7 @@ import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
 import verifyModal from './verifyModal.vue'
 import chooseDepartUserModal from './chooseDepartUserModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { salesReturnList, updateAgain, salesReturnDel, salesReturnSubmit } from '@/api/salesReturn'
+import { salesReturnList, salesReturnQueryCount, updateAgain, salesReturnDel, salesReturnSubmit } from '@/api/salesReturn'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 export default {
@@ -241,7 +252,8 @@ export default {
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        return salesReturnList(Object.assign(parameter, this.queryParam)).then(res => {
+        const params = Object.assign(parameter, this.queryParam)
+        return salesReturnList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -252,13 +264,16 @@ export default {
             this.disabled = false
           }
           this.spinning = false
+          // 统计
+          this.getCount(params)
           return data
         })
       },
       addrProvinceList: [], //  省下拉
       visibleAudit: false,
       auditInfo: null,
-      spinningAudit: false
+      spinningAudit: false,
+      countData: null
     }
   },
   computed: {
@@ -267,23 +282,29 @@ export default {
         { title: '编号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '创建时间', dataIndex: 'createDate', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据来源', dataIndex: 'salesReturnBillSourceDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '是否同步给客户', dataIndex: 'syncFlag', width: '7%', align: 'center', customRender: function (text) { return text ? ['否', '是'][text] : '--' } },
+        { title: '是否同步给客户', dataIndex: 'syncFlag', width: '5%', align: 'center', customRender: function (text) { return text ? ['否', '是'][text] : '--' } },
         { title: '客户采退申请单号', dataIndex: 'purchaseReturnApplyNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '10%', align: 'center' },
-        { title: '客户名称', dataIndex: 'buyerName', width: '10%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户名称', dataIndex: 'buyerName', width: '9%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '申请退货数量', dataIndex: 'totalInitialQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '仓库实收数量', dataIndex: 'totalReceiveQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '坏件数量', dataIndex: 'totalBadQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '良品数量', dataIndex: 'totalGoodQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '返库数量', dataIndex: 'totalBackStockQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '实际退货金额', dataIndex: 'totalAmount', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '审核时间', dataIndex: 'auditTime', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
       return arr
     }
   },
   methods: {
+    getCount (params) {
+      salesReturnQueryCount(params).then(res => {
+        this.countData = res.data
+      })
+    },
     //  创建时间  change
     dateCreateChange (date) {
       this.queryParam.beginDate = date[0]