chenrui 1 年間 前
コミット
4f48aadff7

+ 1 - 2
src/views/purchasingManagement/bulkWarehousingOrder/detailModal.vue

@@ -60,8 +60,7 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import { getOperationalPrecision } from '@/libs/tools.js'
-import { sparePartsDetailList, sparePartsPageCount } from '@/api/spareParts'
-import { queryDetailCount } from '@/api/purchase'
+import { sparePartsDetailList, sparePartsPageCount, queryDetailCount } from '@/api/spareParts'
 export default {
   name: 'BulkWarehousingOrderDetailModal',
   mixins: [commonMixin],

+ 2 - 3
src/views/purchasingManagement/bulkWarehousingOrder/edit.vue

@@ -121,8 +121,7 @@ import { STable, VSelect } from '@/components'
 import { getOperationalPrecision } from '@/libs/tools.js'
 import sparePartsProductModal from './productModal.vue'
 import ImportGuideModal from './importGuideModal.vue'
-import { sparePartsDetailList, sparePartsPageCount, sparePartsDeleteDetail, sparePartsDetailBatchInsert } from '@/api/spareParts'
-import { queryDetailCount } from '@/api/purchase'
+import { sparePartsDetailList, sparePartsPageCount, sparePartsDeleteDetail, sparePartsDetailBatchInsert, queryDetailCount } from '@/api/spareParts'
 export default {
   name: 'BulkWarehousingOrderEdit',
   mixins: [commonMixin],
@@ -219,7 +218,7 @@ export default {
           sparePartsDeleteDetail({ sn: row.sparePartsDetailSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
-              _this.$refs.table.refresh()
+              _this.$refs.table.refresh(true)
               _this.spinning = false
             } else {
               _this.spinning = false

+ 2 - 3
src/views/purchasingManagement/purchaseReceipt/detailModal.vue

@@ -83,8 +83,7 @@ import { STable, VSelect } from '@/components'
 import uniqueCodeModal from './uniqueCodeModal.vue'
 
 // 接口
-import { sparePartsPageCount } from '@/api/spareParts'
-import { purchaseDetailPageList, queryDetailCount } from '@/api/purchase'
+import { purchaseDetailPageList, queryDetailCount, purchaseDetailPageCount } from '@/api/purchase'
 
 export default {
   name: 'DetailModal',
@@ -176,7 +175,7 @@ export default {
     },
     // 统计
     getDetailCount (params) {
-      sparePartsPageCount({ sparePartsSn: this.itemSn }).then(res => {
+      purchaseDetailPageCount({ sparePartsSn: this.itemSn }).then(res => {
         if (res.status == 200) {
           this.statisticsObj = res.data
         } else {

+ 14 - 11
src/views/purchasingManagement/purchaseReceipt/edit.vue

@@ -140,8 +140,7 @@ import basicInfoModal from './basicInfoModal.vue'
 import importGuideModal from './importGuideModal.vue'
 
 // 接口
-import { sparePartsPageCount } from '@/api/spareParts'
-import { purchaseDetailPageList, queryDetailCount, purchaseDetailDel, purchaseSubmit, purchaseImportBatchInsert } from '@/api/purchase'
+import { purchaseDetailPageList, queryDetailCount, purchaseDetailDel, purchaseSubmit, purchaseImportBatchInsert, purchaseDetailPageCount } from '@/api/purchase'
 import { getThirdStockQty } from '@/api/salesNew'
 export default {
   name: 'PurchaseReturnEdit',
@@ -174,8 +173,9 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.productForm.sparePartsSn = this.sparePartsSn
+        const parames = Object.assign(parameter, this.productForm)
         // 获取列表数据  有分页
-        return purchaseDetailPageList(Object.assign(parameter, this.productForm)).then(res => {
+        return purchaseDetailPageList(parames).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
@@ -184,6 +184,10 @@ export default {
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
             }
+            // 获取统计数据
+            this.getStatisticsData(parames)
+            // 获取基础信息
+            this.getBasicsData()
           }
           return data
         })
@@ -207,7 +211,11 @@ export default {
       ]
       if (this.$hasPermissions('M_purchaseReceiptEdit_costPrice')) {
         arr.splice(6, 0, { title: '采购单价', dataIndex: 'productCost', width: '8%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } })
-        arr.splice(7, 0, { title: '采购金额', dataIndex: 'subtotal', width: '8%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } })
+        if (this.detailsData && this.detailsData.supplierName) {
+          arr.splice(7, 0, { title: '采购金额', dataIndex: 'subtotal', width: '8%', align: 'right', customRender: function (text) { return text || text == 0 ? _this.toThousands(text, 2) : '--' } })
+        } else {
+          arr.splice(7, 0, { title: '采购金额', dataIndex: 'subtotal', width: '8%', align: 'right', customRender: function (text) { return text || '--' } })
+        }
       }
       return arr
     }
@@ -291,7 +299,6 @@ export default {
     // 刷新列表  更新操作时间
     resetTable () {
       this.itemSn = undefined
-      this.getBasicsData()
       this.$refs.table.refresh(true)
     },
     //  重置
@@ -314,17 +321,13 @@ export default {
     // 初始化
     pageInit () {
       this.sparePartsSn = this.$route.query.sn
-      // 获取统计数据
-      this.getStatisticsData()
-      // 获取基础信息
-      this.getBasicsData()
       this.$nextTick(() => {
         this.resetSearchForm()
       })
     },
     // 获取页面统计数据
-    getStatisticsData () {
-      sparePartsPageCount({ sparePartsSn: this.sparePartsSn }).then(res => {
+    getStatisticsData (ajaxData) {
+      purchaseDetailPageCount(ajaxData).then(res => {
         if (res.status == 200) {
           if (res.data) {
             this.statisticsObj = res.data