|
@@ -8,8 +8,8 @@
|
|
|
<a-icon type="left" />
|
|
|
返回列表
|
|
|
</a>
|
|
|
- <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ detailsData&&detailsData.sparePartsReturnNo }}</span>
|
|
|
- <span style="margin: 0 10px;color: #666;">供应商:{{ detailsData && detailsData.supplier && detailsData.supplier.supplierName }}</span>
|
|
|
+ <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ detailsData&&detailsData.sparePartsNo }}</span>
|
|
|
+ <span style="margin: 0 10px;color: #666;">供应商:{{ detailsData&&detailsData.supplierName ||'--' }}</span>
|
|
|
<a-button type="link" size="small" id="purchaseReceiptEdit-showDetail-btn" class="button-default" @click="showDetail=!showDetail">
|
|
|
<a-icon :type="showDetail ? 'eye-invisible' : 'eye'"/> {{ showDetail?'隐藏':'查看' }}信息
|
|
|
</a-button>
|
|
@@ -18,19 +18,19 @@
|
|
|
<a-card size="small" :bordered="false" class="purchaseReceiptEdit-cont" v-show="showDetail">
|
|
|
<div slot="title">
|
|
|
<span>基础信息</span>
|
|
|
- <div style="cursor:pointer;color: #00aaff;float:right;" id="purchaseReceiptEdit-btn" @click.stop="handleEditBase" >
|
|
|
+ <div style="cursor:pointer;color: #00aaff;float:right;" id="purchaseReceiptEdit-btn" @click.stop="handleEditBase" v-if="!detailsData&&detailsData.supplierName">
|
|
|
<a-icon type="edit" /> 编辑基础信息
|
|
|
</div>
|
|
|
</div>
|
|
|
<a-descriptions size="small" :column="4" style="margin-bottom: 10px;">
|
|
|
- <a-descriptions-item label="客户名称">{{ (detailsData && detailsData.sparePartsReturnNo) || '--' }}</a-descriptions-item>
|
|
|
- <a-descriptions-item label="收货地址">{{ (detailsData && detailsData.sparePartsReturnNo) || '--' }}</a-descriptions-item>
|
|
|
- <a-descriptions-item label="收货人">{{ (detailsData && detailsData.supplier && detailsData.supplier.supplierName) || '--' }}</a-descriptions-item>
|
|
|
- <a-descriptions-item label="收货电话">{{ (detailsData && detailsData.returnReasonDictValue) || '--' }}</a-descriptions-item>
|
|
|
- <a-descriptions-item label="业务状态">{{ detailsData&&detailsData.warehouseName || '--' }}</a-descriptions-item>
|
|
|
- <a-descriptions-item label="备注">{{ detailsData&&detailsData.grabFlag =='0'?'否':'是' }}</a-descriptions-item>
|
|
|
- <a-descriptions-item label="关联单号">{{ (detailsData && detailsData.explainInfo) || '--' }}</a-descriptions-item>
|
|
|
- <a-descriptions-item label="销售类型">{{ (detailsData && detailsData.explainInfo) || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="客户名称">{{ (detailsData && detailsData.dealerName) || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="收货地址">{{ (detailsData && detailsData.shippingAddr) || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="收货人">{{ (detailsData &&detailsData.consigneeName) || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="收货电话">{{ (detailsData && detailsData.consigneeTel) || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="业务状态">{{ detailsData&&detailsData.stateDictValue || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="备注">{{ detailsData&&detailsData.bizRemark || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="关联单号">{{ (detailsData && detailsData.lockBizNo) || '--' }}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="销售类型">{{ (detailsData && detailsData.purchaseFlowType)?detailsData.purchaseFlowType==='DIRECT'?'直购':'平台购':'--' }}</a-descriptions-item>
|
|
|
</a-descriptions>
|
|
|
</a-card>
|
|
|
<a-card size="small" :bordered="false" class="purchaseReceiptEdit-cont">
|
|
@@ -53,7 +53,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="showBtn">
|
|
|
- <a-button id="purchaseReceiptEdit-add" type="primary" class="button-warning" @click="handleAdd">新增产品</a-button>
|
|
|
+ <a-button id="purchaseReceiptEdit-add" type="primary" class="button-warning" @click="handleAddEdit">新增产品</a-button>
|
|
|
<a-button id="purchaseReceiptEdit-ex" class="button-warning" @click="handleImport">导入产品</a-button>
|
|
|
<a-button
|
|
|
v-if="$hasPermissions('B_sparePartsBatchAudit')"
|
|
@@ -64,8 +64,8 @@
|
|
|
@click="handleThirdQty">第三方库存</a-button>
|
|
|
<a-alert type="info">
|
|
|
<div slot="message" class="total-bar">
|
|
|
- <span>采购数量:{{ statisticsObj && (statisticsObj.qty || statisticsObj.qty == 0) ? statisticsObj.qty : '--' }};</span>
|
|
|
- <span v-if="$hasPermissions('B_purchaseReturnEdit_costPrice')">采购金额:{{ statisticsObj && statisticsObj.totalCost || statisticsObj.totalCost == 0 ? statisticsObj.totalCost : '--' }};</span>
|
|
|
+ <span>采购数量:{{ statisticsObj && (statisticsObj.productTotalQty || statisticsObj.productTotalQty == 0) ? statisticsObj.productTotalQty : '--' }};</span>
|
|
|
+ <span v-if="$hasPermissions('B_purchaseReturnEdit_costPrice')">采购金额:{{ statisticsObj && statisticsObj.productTotalCost || statisticsObj.productTotalCost == 0 ? statisticsObj.productTotalCost : '--' }};</span>
|
|
|
</div>
|
|
|
</a-alert>
|
|
|
</div>
|
|
@@ -79,7 +79,7 @@
|
|
|
:defaultLoadData="false"
|
|
|
bordered>
|
|
|
<!--申请退货数量 -->
|
|
|
- <template slot="qty" slot-scope="text, record">
|
|
|
+ <!-- <template slot="qty" slot-scope="text, record">
|
|
|
<a-input-number
|
|
|
id="purchaseReceiptEdit-qty"
|
|
|
size="small"
|
|
@@ -91,14 +91,14 @@
|
|
|
style="width: 100%;"
|
|
|
@blur="e => onCellBlur(e.target.value, record)"
|
|
|
/>
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
<a-button
|
|
|
size="small"
|
|
|
type="link"
|
|
|
v-if="$hasPermissions('B_purchaseReturnEdit')"
|
|
|
- @click="handleEdit(record)"
|
|
|
+ @click="handleAddEdit(record)"
|
|
|
class="button-info"
|
|
|
id="purchaseReceiptEdit-edit-btn">编辑</a-button>
|
|
|
<a-button
|
|
@@ -123,11 +123,23 @@
|
|
|
id="purchaseReceiptEdit-submit">提交</a-button>
|
|
|
</div>
|
|
|
<!-- 新增弹窗-->
|
|
|
- <add-modal v-drag :openModal="openAddModal" @ok="handleOk" @close="openAddModal=false" />
|
|
|
+ <add-modal
|
|
|
+ v-drag
|
|
|
+ :itemSn="itemSn"
|
|
|
+ :openModal="openAddModal"
|
|
|
+ :nowData="detailsData"
|
|
|
+ @ok="handleOk"
|
|
|
+ @close="openAddModal=false" />
|
|
|
<!-- 导入弹窗 -->
|
|
|
<importGuideModal :openModal="openGuideModal" :params="{sparePartsSn: $route.params.sn}" @close="openGuideModal=false" @ok="hanldeOk" />
|
|
|
<!-- 编辑基础信息弹窗 -->
|
|
|
- <basic-info-modal v-drag :openModal="openBasicInfoModal" :itemSn="sparePartsReturnSn" @ok="getBasicsData" @close="openBasicInfoModal = false" />
|
|
|
+ <basic-info-modal
|
|
|
+ v-drag
|
|
|
+ :openModal="openBasicInfoModal"
|
|
|
+ :itemData="itemObj"
|
|
|
+ :itemSn="sparePartsSn"
|
|
|
+ @ok="getBasicsData"
|
|
|
+ @close="openBasicInfoModal = false" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -140,15 +152,8 @@ import basicInfoModal from './basicInfoModal.vue'
|
|
|
import importGuideModal from './importGuideModal.vue'
|
|
|
|
|
|
// 接口
|
|
|
-import {
|
|
|
- sparePartsReturnQueryPage,
|
|
|
- queryPageCount,
|
|
|
- sparePartsReturnDetailDelete,
|
|
|
- sparePartsReturnDetailSave,
|
|
|
- sparePartsReturnSubmit,
|
|
|
- sparePartsReturnInfo,
|
|
|
- sparePartsReturnDetailSaveBatch
|
|
|
-} from '@/api/sparePartsReturn'
|
|
|
+import { sparePartsPageCount } from '@/api/spareParts'
|
|
|
+import { purchaseDetailPageList, queryDetailCount } from '@/api/purchase'
|
|
|
import { getThirdStockQty } from '@/api/salesNew'
|
|
|
export default {
|
|
|
name: 'PurchaseReturnEdit',
|
|
@@ -166,6 +171,7 @@ export default {
|
|
|
|
|
|
isInster: false, // 是否正在添加产品
|
|
|
addMoreLoading: false, // 防止多次添加 加载状态
|
|
|
+ loading: false,
|
|
|
|
|
|
// 查询参数
|
|
|
productForm: {
|
|
@@ -174,14 +180,15 @@ export default {
|
|
|
},
|
|
|
statisticsObj: null, // 统计明细
|
|
|
|
|
|
- sparePartsReturnSn: null,
|
|
|
+ sparePartsSn: null, // 采购入库sn
|
|
|
+ itemObj: null, // 基础信息弹窗信息
|
|
|
sparePartsReturnNo: null,
|
|
|
chooseList: [],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
- this.productForm.sparePartsReturnSn = this.sparePartsReturnSn
|
|
|
+ this.productForm.sparePartsSn = this.sparePartsSn
|
|
|
// 获取列表数据 有分页
|
|
|
- return sparePartsReturnQueryPage(Object.assign(parameter, this.productForm)).then(res => {
|
|
|
+ return purchaseDetailPageList(Object.assign(parameter, this.productForm)).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
|
data = res.data
|
|
@@ -195,7 +202,6 @@ export default {
|
|
|
return data
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
grabFlag: undefined // 备注
|
|
|
}
|
|
|
},
|
|
@@ -207,7 +213,7 @@ export default {
|
|
|
{ title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
|
|
|
{
|
|
|
title: '产品编码',
|
|
|
- dataIndex: 'product.code',
|
|
|
+ dataIndex: 'productCode',
|
|
|
width: '18%',
|
|
|
align: 'center',
|
|
|
customRender: function (text) {
|
|
@@ -216,7 +222,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
title: '产品名称',
|
|
|
- dataIndex: 'product.name',
|
|
|
+ dataIndex: 'productName',
|
|
|
width: '25%',
|
|
|
align: 'left',
|
|
|
customRender: function (text) {
|
|
@@ -226,7 +232,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
title: '单位',
|
|
|
- dataIndex: 'product.unit',
|
|
|
+ dataIndex: 'unit',
|
|
|
align: 'center',
|
|
|
width: '6%',
|
|
|
customRender: function (text) {
|
|
@@ -235,8 +241,8 @@ export default {
|
|
|
},
|
|
|
{ title: '采购数量', align: 'center', width: '13%', scopedSlots: { customRender: 'qty' } },
|
|
|
{
|
|
|
- title: '库存数量',
|
|
|
- dataIndex: 'stockBatchNo',
|
|
|
+ title: '第三方库存',
|
|
|
+ dataIndex: 'productQty',
|
|
|
align: 'center',
|
|
|
width: '10%',
|
|
|
customRender: function (text) {
|
|
@@ -263,26 +269,26 @@ export default {
|
|
|
},
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
|
]
|
|
|
- if (this.$hasPermissions('B_purchaseReturnEdit_costPrice')) {
|
|
|
- arr.splice(6, 0, {
|
|
|
- title: '退货单价',
|
|
|
- dataIndex: 'cost',
|
|
|
- width: '8%',
|
|
|
- align: 'right',
|
|
|
- customRender: function (text) {
|
|
|
- return text || text == 0 ? _this.toThousands(text, 2) : '--'
|
|
|
- }
|
|
|
- })
|
|
|
- arr.splice(8, 0, {
|
|
|
- title: '采购金额',
|
|
|
- dataIndex: 'totalCost',
|
|
|
- width: '8%',
|
|
|
- align: 'right',
|
|
|
- customRender: function (text) {
|
|
|
- return text || text == 0 ? _this.toThousands(text, 2) : '--'
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ // if (this.$hasPermissions('B_purchaseReturnEdit_costPrice')) {
|
|
|
+ // arr.splice(6, 0, {
|
|
|
+ // title: '退货单价',
|
|
|
+ // dataIndex: 'cost',
|
|
|
+ // width: '8%',
|
|
|
+ // align: 'right',
|
|
|
+ // customRender: function (text) {
|
|
|
+ // return text || text == 0 ? _this.toThousands(text, 2) : '--'
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // arr.splice(8, 0, {
|
|
|
+ // title: '采购金额',
|
|
|
+ // dataIndex: 'totalCost',
|
|
|
+ // width: '8%',
|
|
|
+ // align: 'right',
|
|
|
+ // customRender: function (text) {
|
|
|
+ // return text || text == 0 ? _this.toThousands(text, 2) : '--'
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
return arr
|
|
|
}
|
|
|
},
|
|
@@ -294,20 +300,26 @@ export default {
|
|
|
}
|
|
|
getThirdStockQty(params).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
-
|
|
|
+ this.resetTable(true)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
// 编辑基础信息
|
|
|
handleEditBase () {
|
|
|
+ this.itemObj = { dealerName: this.detailsData.dealerName, lockBizNo: this.detailsData.lockBizNo, bizRemark: this.detailsData.bizRemark }
|
|
|
this.openBasicInfoModal = true
|
|
|
},
|
|
|
// 返回
|
|
|
handleBack () {
|
|
|
this.$router.push({ name: 'purchaseReceiptList', query: { closeLastOldTab: true } })
|
|
|
},
|
|
|
- // 新增产品
|
|
|
- handleAdd () {
|
|
|
+ // 新增/编辑产品
|
|
|
+ handleAddEdit (row) {
|
|
|
+ if (this.detailsData && !this.detailsData.supplierName) {
|
|
|
+ this.$message.warning('供应商不能为空,请先变价基础信息!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.itemSn = (row && row.sparePartsDetailSn) ? row.sparePartsDetailSn : null
|
|
|
this.openAddModal = true
|
|
|
},
|
|
|
// 导入产品
|
|
@@ -350,10 +362,10 @@ export default {
|
|
|
this.$refs.table.refresh(flag)
|
|
|
},
|
|
|
// 重置
|
|
|
- resetSearchForm (flag) {
|
|
|
+ resetSearchForm () {
|
|
|
this.productForm.productName = ''
|
|
|
this.productForm.productCode = ''
|
|
|
- this.$refs.table.refresh(!!flag)
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
},
|
|
|
saveMoreProduct (data) {
|
|
|
if (this.addMoreLoading) {
|
|
@@ -439,46 +451,36 @@ export default {
|
|
|
},
|
|
|
// 初始化
|
|
|
pageInit () {
|
|
|
- this.supplierSn = this.$route.query.sn
|
|
|
- this.sparePartsReturnSn = this.$route.query.returnSn
|
|
|
- this.sparePartsReturnNo = this.$route.query.no
|
|
|
+ this.sparePartsSn = this.$route.query.sn
|
|
|
this.getStatisticsData()
|
|
|
this.getBasicsData()
|
|
|
- this.resetSearchForm(true)
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.resetSearchForm()
|
|
|
+ })
|
|
|
},
|
|
|
getChooseList () {
|
|
|
this.$refs.partQuery.pageInit(this.supplierSn, this.sparePartsReturnSn, this.detailsData ? this.detailsData.warehouseSn : undefined, this.detailsData.grabFlag)
|
|
|
},
|
|
|
// 获取页面统计数据
|
|
|
getStatisticsData () {
|
|
|
- this.getBasicsData(true)
|
|
|
- queryPageCount({ sparePartsReturnSn: this.sparePartsReturnSn }).then(res => {
|
|
|
+ sparePartsPageCount({ sparePartsSn: this.sparePartsSn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
if (res.data) {
|
|
|
- res.data.totalCost = res.data && (res.data.totalCost || res.data.totalCost == 0) ? this.toThousands(res.data.totalCost, 2) : '--'
|
|
|
this.statisticsObj = res.data
|
|
|
} else {
|
|
|
this.statisticsObj = null
|
|
|
}
|
|
|
- } else {
|
|
|
- this.statisticsObj = null
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
// 获取基础信息
|
|
|
- getBasicsData (flag) {
|
|
|
- sparePartsReturnInfo({ sn: this.sparePartsReturnSn }).then(res => {
|
|
|
+ getBasicsData () {
|
|
|
+ queryDetailCount({ sn: this.sparePartsSn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.detailsData = res.data
|
|
|
} else {
|
|
|
this.detailsData = null
|
|
|
}
|
|
|
- const _this = this
|
|
|
- if (!flag) {
|
|
|
- this.$nextTick(() => {
|
|
|
- _this.getChooseList()
|
|
|
- })
|
|
|
- }
|
|
|
})
|
|
|
}
|
|
|
},
|