|
@@ -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
|