|
@@ -128,10 +128,10 @@
|
|
|
:itemSn="itemSn"
|
|
|
:openModal="openAddModal"
|
|
|
:nowData="detailsData"
|
|
|
- @ok="handleOk"
|
|
|
+ @ok="ahandleAddOk"
|
|
|
@close="openAddModal=false" />
|
|
|
<!-- 导入弹窗 -->
|
|
|
- <importGuideModal :openModal="openGuideModal" :params="{sparePartsSn: $route.params.sn}" @close="openGuideModal=false" @ok="hanldeOk" />
|
|
|
+ <importGuideModal :openModal="openGuideModal" :params="{sparePartsSn: $route.query.sn}" @close="openGuideModal=false" @ok="hanldleImportOk" />
|
|
|
<!-- 编辑基础信息弹窗 -->
|
|
|
<basic-info-modal
|
|
|
v-drag
|
|
@@ -153,7 +153,7 @@ import importGuideModal from './importGuideModal.vue'
|
|
|
|
|
|
// 接口
|
|
|
import { sparePartsPageCount } from '@/api/spareParts'
|
|
|
-import { purchaseDetailPageList, queryDetailCount } from '@/api/purchase'
|
|
|
+import { purchaseDetailPageList, queryDetailCount, purchaseDetailDel, purchaseSubmit, purchaseImportBatchInsert } from '@/api/purchase'
|
|
|
import { getThirdStockQty } from '@/api/salesNew'
|
|
|
export default {
|
|
|
name: 'PurchaseReturnEdit',
|
|
@@ -239,19 +239,19 @@ export default {
|
|
|
return text || '--'
|
|
|
}
|
|
|
},
|
|
|
- { title: '采购数量', align: 'center', width: '13%', scopedSlots: { customRender: 'qty' } },
|
|
|
+ { title: '采购数量', dataIndex: 'productQty', align: 'center', width: '13%', customRender: function (text) { return text || text == 0 ? text : '--' } },
|
|
|
{
|
|
|
title: '第三方库存',
|
|
|
- dataIndex: 'productQty',
|
|
|
+ dataIndex: 'thirdStockQty',
|
|
|
align: 'center',
|
|
|
width: '10%',
|
|
|
customRender: function (text) {
|
|
|
- return text || '--'
|
|
|
+ return text || text == 0 ? text : '--'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
title: '采购单价',
|
|
|
- dataIndex: 'cost',
|
|
|
+ dataIndex: 'productCost',
|
|
|
width: '8%',
|
|
|
align: 'right',
|
|
|
customRender: function (text) {
|
|
@@ -260,7 +260,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
title: '采购金额',
|
|
|
- dataIndex: 'totalCost',
|
|
|
+ dataIndex: 'subtotal',
|
|
|
width: '8%',
|
|
|
align: 'right',
|
|
|
customRender: function (text) {
|
|
@@ -300,8 +300,19 @@ export default {
|
|
|
}
|
|
|
getThirdStockQty(params).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
- this.resetTable(true)
|
|
|
+ this.handleAddOk(true)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 导入产品
|
|
|
+ hanldleImportOk (listCon) {
|
|
|
+ this.spinning = true
|
|
|
+ purchaseImportBatchInsert(listCon).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.$message.success('导入成功')
|
|
|
+ this.handleAddOk()
|
|
|
}
|
|
|
+ this.spinning = false
|
|
|
})
|
|
|
},
|
|
|
// 编辑基础信息
|
|
@@ -322,6 +333,10 @@ export default {
|
|
|
this.itemSn = (row && row.sparePartsDetailSn) ? row.sparePartsDetailSn : null
|
|
|
this.openAddModal = true
|
|
|
},
|
|
|
+ handleAddOk () {
|
|
|
+ this.getBasicsData()
|
|
|
+ this.resetTable()
|
|
|
+ },
|
|
|
// 导入产品
|
|
|
handleImport () {
|
|
|
this.openGuideModal = true
|
|
@@ -339,13 +354,13 @@ export default {
|
|
|
onOk () {
|
|
|
_this.delLoading = true
|
|
|
_this.spinning = true
|
|
|
- sparePartsReturnDetailDelete({ detailSn: row.sparePartsReturnDetailSn })
|
|
|
+ purchaseDetailDel({ sn: row.sparePartsDetailSn })
|
|
|
.then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.resetTable(false)
|
|
|
- _this.getStatisticsData()
|
|
|
- _this.getChooseList()
|
|
|
- _this.$refs.partQuery.refreshLength()
|
|
|
+ _this.getBasicsData()
|
|
|
+ // _this.getChooseList()
|
|
|
+ // _this.$refs.partQuery.refreshLength()
|
|
|
}
|
|
|
_this.$message.info(res.message)
|
|
|
_this.delLoading = false
|
|
@@ -438,10 +453,10 @@ export default {
|
|
|
this.$message.warning('请先添加要退货的产品!')
|
|
|
}
|
|
|
},
|
|
|
- // 提交采购退货
|
|
|
+ // 提交采购入库
|
|
|
handleSubmit (data) {
|
|
|
this.spinning = true
|
|
|
- sparePartsReturnSubmit({ sparePartsReturnSn: this.sparePartsReturnSn, ...data }).then(res => {
|
|
|
+ purchaseSubmit({ sn: this.sparePartsSn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.handleBack()
|
|
|
this.$message.success(res.message)
|