瀏覽代碼

修改bug

chenrui 2 年之前
父節點
當前提交
71767f8187

+ 1 - 1
src/api/reportData.js

@@ -629,7 +629,7 @@ export const sparePartsReturnDetailReportList = (params) => {
 
 // 采购退货明细报表合计
 export const sparePartsReturnDetailReportStat = (params) => {
-  const url = `/sparePartsReturn/detail/queryPageCount`
+  const url = `/report/sparePartsReturn/detail/queryPageCount`
   return axios({
     url: url,
     data: params,

+ 7 - 6
src/views/purchasingManagement/purchaseReturn/list.vue

@@ -63,7 +63,7 @@
       </div>
       <!-- 操作按钮 -->
       <div class="table-operator">
-        <a-button v-if="$hasPermissions('B_sparePartsNew')" id="bulkWarehousingOrderList-add" type="primary" class="button-error" @click="handleAdd">新增</a-button>
+        <a-button v-if="$hasPermissions('B_purchaseReturnAdd')" id="bulkWarehousingOrderList-add" type="primary" class="button-error" @click="handleAdd">新增</a-button>
         <!-- <a-button
           style="margin-left: 10px"
           type="primary"
@@ -87,7 +87,8 @@
         bordered>
         <!-- 采购退货单号 -->
         <template slot="sparePartsReturnNo" slot-scope="text, record">
-          <span class="link-bule" @click="handleDetail(record)">{{ record.sparePartsReturnNo }}</span>
+          <span v-if="$hasPermissions('B_purchaseReturnDetail')" class="link-bule" @click="handleDetail(record)">{{ record.sparePartsReturnNo }}</span>
+          <span>{{ record.sparePartsReturnNo }}</span>
         </template>
         <!-- 操作 -->
         <!-- state 待提交 WAIT_SUBMIT 待审核 WAIT_AUDIT 已完结 FINISH 审核不通过 AUDIT_REJECT -->
@@ -95,7 +96,7 @@
           <a-button
             size="small"
             type="link"
-            v-if="record.state == 'WAIT_SUBMIT'"
+            v-if="$hasPermissions('B_purchaseReturnEdit') && record.state == 'WAIT_SUBMIT'"
             @click="handleEdit(record)"
             class="button-info"
             id="bulkWarehousingOrderList-edit-btn">编辑</a-button>
@@ -104,7 +105,7 @@
             type="link"
             class="button-warning"
             @click="handleSH(record)"
-            v-if="record.state !='WAIT_SUBMIT'"
+            v-if="$hasPermissions('B_purchaseReturnRate') && record.state !='WAIT_SUBMIT'"
             id="allocateBillList-examine-btn">审核进度</a-button>
           <!-- <a-button
             size="small"
@@ -117,13 +118,13 @@
             size="small"
             type="link"
             v-if="record.state == 'AUDIT_REJECT'"
-            @click="handleResubmit(record)"
+            @click="$hasPermissions('B_purchaseReturnSubmit') &&handleResubmit(record)"
             class="button-info"
             id="bulkWarehousingOrderList-edit-btn">再次提交</a-button>
           <a-button
             size="small"
             type="link"
-            v-if="record.state == 'WAIT_SUBMIT'"
+            v-if="$hasPermissions('B_purchaseReturnDel') && record.state == 'WAIT_SUBMIT'"
             @click="handleDel(record)"
             class="button-error"
             id="bulkWarehousingOrderList-del-btn">删除</a-button>

+ 1 - 1
src/views/purchasingManagement/purchaseReturn/purchaseReturnDeatil.vue

@@ -210,7 +210,7 @@ export default {
         { title: '申请退货数量', align: 'center', width: '13%', scopedSlots: { customRender: 'qty' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
-      if (this.$hasPermissions('B_isShowPrice')) {
+      if (this.$hasPermissions('B_isShowCost')) {
         arr.splice(6, 0, { title: '退货单价', dataIndex: 'cost', align: 'center', width: '8%', customRender: function (text) { return text || text == 0 ? toFixedDecimal(text, 2) : '--' } })
         arr.splice(8, 0, { title: '退款金额', dataIndex: 'totalCost', align: 'center', width: '13%', customRender: function (text) { return text || text == 0 ? toFixedDecimal(text, 2) : '--' } })
       }

+ 50 - 58
src/views/reportData/urchaseDetailReturn/detailList.vue

@@ -136,6 +136,21 @@
         :scroll="{ x: 2960 }"
         :defaultLoadData="false"
         bordered>
+        <!-- 附件 -->
+        <template slot="attachmentList" slot-scope="text, record">
+          <span v-if="record.attachmentList && record.attachmentList.length > 0">
+            <a
+              target="_blank"
+              style="color: #00aaff;text-decoration: underline;margin-right: 15px;"
+              :href="item.filePath"
+              v-for="item in record.attachmentList"
+              :key="item.id"
+            >
+              {{ item.fileName }}
+            </a>
+          </span>
+          <span v-else>--</span>
+        </template>
         <template slot="footer">
           <a-row>
             <a-col span="2">合计:</a-col>
@@ -181,7 +196,7 @@ import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import subarea from '@/views/common/subarea.js'
+// import subarea from '@/views/common/subarea.js'
 import supplier from '@/views/common/supplier.js'
 import reportModal from '@/views/common/reportModal.vue'
 import { getArea } from '@/api/data'
@@ -189,11 +204,12 @@ import { productBrandQuery } from '@/api/productBrand'
 import { productTypeQuery } from '@/api/productType'
 import ProductBrand from '@/views/common/productBrand.js'
 import { hdExportExcel } from '@/libs/exportExcel'
-import { reportSalesReturnDetailList, reportSalesReturnDetailCount, reportSalesReturnDetailExport } from '@/api/reportData'
+import { toFixedDecimal } from '@/libs/tools.js'
+import { sparePartsReturnDetailReportList, sparePartsReturnDetailReportStat, sparePartsReturnReportExportDetail } from '@/api/reportData'
 export default {
   name: 'UrchaseDetailReturnList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, supplier, subarea, ProductBrand, reportModal },
+  components: { STable, VSelect, rangeDate, supplier, ProductBrand, reportModal },
   data () {
     return {
       spinning: false,
@@ -221,8 +237,7 @@ export default {
         dealerCitySn: undefined,
         dealerCountySn: undefined
       },
-
-      productType: [],
+      // productType: [],
       rules: {
         'time': [{ required: true, message: '请选择退货完成日期', trigger: 'change' }]
       },
@@ -234,15 +249,11 @@ export default {
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
         delete params.time
-        return reportSalesReturnDetailList(params).then(res => {
+        return sparePartsReturnDetailReportList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
             this.getCount(params)
-            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.spinning = false
@@ -260,47 +271,37 @@ export default {
   computed: {
     columns () {
       const arr = [
-        { title: '采购退货单号', dataIndex: 'subareaNames', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省份', dataIndex: 'dealerProvinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '供应商名称', dataIndex: 'dealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '退货原因', dataIndex: 'returnReason', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '补充说明', dataIndex: 'returnReason', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '附件', dataIndex: 'returnReason', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货完成日期', dataIndex: 'salesReturnDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库单号', dataIndex: 'salesReturnBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'productBrandName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '二级分类', dataIndex: 'productTypeName2', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '采购退货单号', dataIndex: 'sparePartsReturnNo', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省份', dataIndex: 'supplier.provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '供应商名称', dataIndex: 'supplier.supplierName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '退货原因', dataIndex: 'returnReasonDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '补充说明', dataIndex: 'explainInfo', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '附件', width: 100, align: 'center', scopedSlots: { customRender: 'attachmentList' } },
+        { title: '退货完成日期', dataIndex: 'auditDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库单号', dataIndex: 'sparePartsNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'product.productBrandName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '二级分类', dataIndex: 'product.productTypeName2', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品编码', dataIndex: 'productCode', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: 150, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '单位', dataIndex: 'productUnit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '批次号', dataIndex: 'productUnit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库数量', dataIndex: 'receiveQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已退数量', dataIndex: 'badQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '申请退货数量', dataIndex: 'goodQty', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作员', dataIndex: 'goodQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '产品名称', dataIndex: 'product.name', width: 150, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'product.unit', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '批次号', dataIndex: 'stockBatchNo', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库数量', dataIndex: 'putQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '已退数量', dataIndex: 'returnedQty', width: 80, 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: 'submitorName', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
 
-      if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
-        arr.splice(14, 0, { title: '入库单价', dataIndex: 'price', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(18, 0, { title: '退货金额', dataIndex: 'totalPrice', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      if (this.$hasPermissions('B_isShowCost')) {
+        arr.splice(14, 0, { title: '入库单价', dataIndex: 'cost', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? toFixedDecimal(text, 2) : '--') } })
+        arr.splice(18, 0, { title: '退货金额', dataIndex: 'totalCost', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? toFixedDecimal(text, 2) : '--') } })
       }
-      // if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
-      //   const ind = this.$hasPermissions('B_isShowPrice') ? 27 : 20
-      //   arr.splice(ind, 0, { title: '再入库单价', dataIndex: 'cost', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      //   arr.splice(ind + 3, 0, { title: '正常再入库金额', dataIndex: 'totalNormalCost', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      //   arr.splice(ind + 4, 0, { title: '正常退货入库差额', dataIndex: 'totalNormalBalance', width: 110, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-      // }
       return arr
     }
   },
   methods: {
-    // 盘点库存日期
-    handleStock () {
-      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
-    },
     // 总计
     getCount (params) {
-      reportSalesReturnDetailCount(params).then(res => {
+      sparePartsReturnDetailReportStat(params).then(res => {
         if (res.status == 200 && res.data) {
           this.totalData = res.data
         } else {
@@ -328,9 +329,6 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
-    custChange (val) {
-      this.queryParam.dealerSn = val.key
-    },
     //  重置
     resetSearchForm () {
       this.queryParam.time = [
@@ -340,21 +338,20 @@ export default {
       this.$refs.rangeDate.resetDate(this.queryParam.time)
       this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
-      this.queryParam.salesReturnBillNo = ''
+      this.queryParam.sparePartsReturnNo = ''
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
-      this.queryParam.dealerName = ''
-      this.queryParam.dealerLevel = undefined
+      this.queryParam.supplierSn = ''
+      this.queryParam.returnReason = undefined
       this.queryParam.productBrandTypeSn = undefined
       this.queryParam.productBrandSn = undefined
-      this.queryParam.productTypeSn1 = ''
-      this.queryParam.productTypeSn2 = ''
-      this.queryParam.productTypeSn3 = ''
-      this.queryParam.subareaSn = undefined
+      // this.queryParam.productTypeSn1 = ''
+      // this.queryParam.productTypeSn2 = ''
+      // this.queryParam.productTypeSn3 = ''
       this.queryParam.dealerProvinceSn = undefined
       this.queryParam.dealerCitySn = undefined
       this.queryParam.dealerCountySn = undefined
-      this.productType = []
+      // this.productType = []
       this.totalData = null
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
@@ -368,7 +365,7 @@ export default {
           _this.showExport = true
           _this.exportLoading = true
           _this.spinning = true
-          hdExportExcel(reportSalesReturnDetailExport, params, '销售退货明细报表', function () {
+          hdExportExcel(sparePartsReturnReportExportDetail, params, '采购退货明细报表', function () {
             _this.exportLoading = false
             _this.spinning = false
           })
@@ -377,11 +374,6 @@ export default {
         }
       })
     },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
     //  产品分类  change
     changeProductType (val, opt) {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''

+ 37 - 100
src/views/reportData/urchaseReturn/list.vue

@@ -63,16 +63,27 @@
         :columns="columns"
         :data="loadData"
         :scroll="{ x: 1740 }"
-        :defaultLoadData="true"
+        :defaultLoadData="false"
         bordered>
+        <!-- 附件 -->
+        <template slot="attachmentList" slot-scope="text, record">
+          <span v-if="record.attachmentList && record.attachmentList.length > 0">
+            <a
+              target="_blank"
+              style="color: #00aaff;text-decoration: underline;margin-right: 15px;"
+              :href="item.filePath"
+              v-for="item in record.attachmentList"
+              :key="item.id"
+            >
+              {{ item.fileName }}
+            </a>
+          </span>
+          <span v-else>--</span>
+        </template>
         <template slot="footer">
           <a-row :gutter="15">
-            <!-- <a-col :md="4" :sm="24">总数量:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</a-col>
-            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">入库单据量:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? totalData.totalAmount : '--' }}</a-col>
-            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">供应商数量:{{ (totalData && (totalData.totalRealAmount || totalData.totalRealAmount==0)) ? totalData.totalRealAmount : '--' }}</a-col>
-            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">入库数量:{{ (totalData && (totalData.totalWholesalePrice2 || totalData.totalWholesalePrice2==0)) ? totalData.totalWholesalePrice2 : '--' }}</a-col> -->
-            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">申请退货数量:{{ (totalData && (totalData.totalWholesalePrice1 || totalData.totalWholesalePrice1==0)) ? totalData.totalWholesalePrice1 : '--' }}</a-col>
-            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">退货金额:{{ (totalData && (totalData.totalWholesalePrice3 || totalData.totalWholesalePrice3==0)) ? totalData.totalWholesalePrice3 : '--' }}</a-col>
+            <a-col :md="4" :sm="24">申请退货数量:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">退货金额:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? totalData.totalCost : '--' }}</a-col>
           </a-row>
         </template>
       </s-table>
@@ -87,21 +98,19 @@ import { commonMixin } from '@/utils/mixin'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import subarea from '@/views/common/subarea.js'
 import supplier from '@/views/common/supplier.js'
-import reportModal from '@/views/common/reportModal.vue'
-import { getArea } from '@/api/data'
 import { hdExportExcel } from '@/libs/exportExcel'
+import { toFixedDecimal } from '@/libs/tools.js'
+import reportModal from '@/views/common/reportModal.vue'
 import { sparePartsReturnReportList, sparePartsReturnReportStat, sparePartsReturnReportExport } from '@/api/reportData'
 export default {
   name: 'UrchaseReturn',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate, subarea, supplier, reportModal },
+  components: { STable, VSelect, rangeDate, supplier, reportModal },
   data () {
     return {
       spinning: false,
       exportLoading: false,
-      advanced: true, // 高级搜索 展开/关闭
       tableHeight: 0,
       showExport: false,
       queryParam: { //  查询条件
@@ -130,38 +139,30 @@ export default {
           if (res.status == 200) {
             data = res.data
             this.getCount(params)
-            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.spinning = false
           return data
         })
       },
-      totalData: null,
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [] //  区下拉
+      totalData: null
     }
   },
   computed: {
     columns () {
       const arr = [
-        { title: '采购退货单号', dataIndex: 'salesReturnBillNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '退货完成日期', dataIndex: 'salesReturnDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '供应商名称', dataIndex: 'dealerName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '退货原因', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '补充说明', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '附件', dataIndex: 'dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '入库数量', dataIndex: 'totalQty', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '申请退货数量', dataIndex: 'totalBadQty', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作员', dataIndex: 'operatorName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
+        { title: '采购退货单号', dataIndex: 'sparePartsReturnNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '退货完成日期', dataIndex: 'auditDate', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '供应商名称', dataIndex: 'supplierName', width: 120, align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '退货原因', dataIndex: 'returnReasonDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '补充说明', dataIndex: 'explainInfo', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '附件', width: 120, align: 'center', scopedSlots: { customRender: 'attachmentList' } },
+        { title: '入库数量', dataIndex: 'totalPutQty', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '申请退货数量', dataIndex: 'totalQty', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '操作员', dataIndex: 'submitorName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
       ]
       if (this.$hasPermissions('B_isShowPrice')) { //  售价权限
-        arr.splice(7, 0, { title: '入库单价', dataIndex: 'totalAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
-        arr.splice(10, 0, { title: '退货金额', dataIndex: 'totalRealAmount', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(8, 0, { title: '退货金额', dataIndex: 'totalCost', width: 90, align: 'center', customRender: function (text) { return ((text || text == 0) ? toFixedDecimal(text, 2) : '--') } })
       }
       return arr
     }
@@ -176,7 +177,7 @@ export default {
           _this.showExport = true
           _this.exportLoading = true
           _this.spinning = true
-          hdExportExcel(sparePartsReturnReportExport, params, '销售退货单报表', function () {
+          hdExportExcel(sparePartsReturnReportExport, params, '采购退货单报表', function () {
             _this.exportLoading = false
             _this.spinning = false
           })
@@ -185,14 +186,11 @@ export default {
         }
       })
     },
-    // 盘点库存日期
-    handleStock () {
-      this.$message.info('无盘点区间的起始/终止时间,请自行选择日期区间查询!')
-    },
     // 总计
     getCount (params) {
       sparePartsReturnReportStat(params).then(res => {
         if (res.status == 200 && res.data) {
+          res.data.totalCost = res.data && (res.data.totalCost || res.data.totalCost == 0) ? toFixedDecimal(res.data.totalCost, 2) : '--'
           this.totalData = res.data
         } else {
           this.totalData = null
@@ -219,9 +217,6 @@ export default {
       this.queryParam.beginDate = date[0] || ''
       this.queryParam.endDate = date[1] || ''
     },
-    custChange (val) {
-      this.queryParam.dealerSn = val.key
-    },
     //  重置
     resetSearchForm () {
       this.queryParam.time = [
@@ -231,80 +226,22 @@ export default {
       this.$refs.rangeDate.resetDate(this.queryParam.time)
       this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
       this.queryParam.endDate = getDate.getCurrMonthDays().endtime
-      this.queryParam.salesReturnBillNo = ''
-      this.queryParam.subareaSn = undefined
-      this.queryParam.dealerSn = undefined
-      this.queryParam.dealerLevel = undefined
-      this.queryParam.dealerProvinceSn = undefined
-      this.queryParam.dealerCitySn = undefined
-      this.queryParam.dealerCountySn = undefined
-      if (this.advanced) {
-        this.$refs.custList.resetForm()
-      }
+      this.queryParam.sparePartsReturnNo = ''
+      this.queryParam.supplierSn = undefined
+      this.queryParam.returnReason = undefined
       this.totalData = null
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
-    },
-    // 获取城市列表
-    getCityList (val) {
-      this.addrCityList = []
-      this.addrDistrictList = []
-      this.queryParam.dealerCitySn = undefined
-      this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('city', val)
-      }
-    },
-    // 获取区县列表
-    getAreaList (val) {
-      this.addrDistrictList = []
-      this.queryParam.dealerCountySn = undefined
-      if (val) {
-        this.getArea('district', val)
-      }
-    },
-    //  省/市/区
-    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 = []
-          }
-        }
-      })
-    },
-    pageInit () {
-      this.getArea('province')
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
       this.resetSearchForm()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.pageInit()
       this.resetSearchForm()
     }
   },