|
@@ -8,8 +8,8 @@
|
|
<a-icon type="left" />
|
|
<a-icon type="left" />
|
|
返回列表
|
|
返回列表
|
|
</a>
|
|
</a>
|
|
- <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ detailsData&&detailsData.verifyAccountBillNo }}</span>
|
|
|
|
- <span style="margin: 0 10px;color: #666;">客户名称:{{ detailsData && detailsData.supplier && detailsData.dealerName }}</span>
|
|
|
|
|
|
+ <span style="margin: 0 15px;color: #666;font-weight: bold;">单号:{{ detailData&&detailData.verifyAccountBillNo }}</span>
|
|
|
|
+ <span style="margin: 0 10px;color: #666;">客户名称:{{ detailData && detailData.dealerName }}</span>
|
|
<a-button type="link" size="small" class="button-default" @click.stop="handleEditBase" >
|
|
<a-button type="link" size="small" class="button-default" @click.stop="handleEditBase" >
|
|
<a-icon type="edit" /> 编辑备注
|
|
<a-icon type="edit" /> 编辑备注
|
|
</a-button>
|
|
</a-button>
|
|
@@ -26,10 +26,10 @@
|
|
<a-card size="small" :bordered="false" class="salesReturnEdit-cont">
|
|
<a-card size="small" :bordered="false" class="salesReturnEdit-cont">
|
|
<a-alert style="margin-bottom: 10px;" type="info">
|
|
<a-alert style="margin-bottom: 10px;" type="info">
|
|
<div slot="message" class="total-bar">
|
|
<div slot="message" class="total-bar">
|
|
- <div v-if="detailData">
|
|
|
|
- <span>余额:{{ detailData && (detailData.totalAmount || detailData.totalAmount == 0) ? detailData.totalAmount : '--' }};</span>
|
|
|
|
- <span>借方:{{ detailData && (detailData.debitAmount || detailData.debitAmount == 0) ? detailData.debitAmount : '--' }};</span>
|
|
|
|
- <span>贷方:{{ detailData && (detailData.creditorAmount || detailData.creditorAmount == 0) ? detailData.creditorAmount : '--' }};</span>
|
|
|
|
|
|
+ <div v-if="countData">
|
|
|
|
+ <span>余额:{{ countData && (countData.bizAmount || countData.bizAmount == 0) ? countData.bizAmount : '--' }};</span>
|
|
|
|
+ <span>借方:{{ countData && (countData.borrowAmount || countData.borrowAmount == 0) ? countData.borrowAmount : '--' }};</span>
|
|
|
|
+ <span>贷方:{{ countData && (countData.loanAmount || countData.loanAmount == 0) ? countData.loanAmount : '--' }};</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</a-alert>
|
|
</a-alert>
|
|
@@ -122,7 +122,7 @@
|
|
id="salesReturn-handleSubmit">提交</a-button>
|
|
id="salesReturn-handleSubmit">提交</a-button>
|
|
</div>
|
|
</div>
|
|
<!-- 编辑基础信息弹窗 -->
|
|
<!-- 编辑基础信息弹窗 -->
|
|
- <baseModal v-drag :show="openModal" @cancel="openModal=false" @refashData="getBasicsData"></baseModal>
|
|
|
|
|
|
+ <baseModal v-drag :show="openModal" @cancel="openModal=false" :itemSn="verifyAccountBillSn" @refashData="getBasicsData"></baseModal>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -131,16 +131,15 @@ import { commonMixin } from '@/utils/mixin'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import queryPart from './queryPart.vue'
|
|
import queryPart from './queryPart.vue'
|
|
import baseModal from './baseModal.vue'
|
|
import baseModal from './baseModal.vue'
|
|
-import {
|
|
|
|
- sparePartsReturnQueryPage,
|
|
|
|
- queryPageCount,
|
|
|
|
- sparePartsReturnDetailDelete,
|
|
|
|
- sparePartsReturnDetailSave,
|
|
|
|
- sparePartsReturnSubmit,
|
|
|
|
- sparePartsReturnInfo,
|
|
|
|
- sparePartsReturnDetailSaveBatch
|
|
|
|
-} from '@/api/sparePartsReturn'
|
|
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
import rangeDate from '@/views/common/rangeDate.vue'
|
|
|
|
+import {
|
|
|
|
+ verifyAcountBillDetailList,
|
|
|
|
+ verifyAcountBillDetailQueryCount,
|
|
|
|
+ verifyAcountBillDetailDel,
|
|
|
|
+ verifyAcountBillDetailSave,
|
|
|
|
+ verifyAcountBillSubmit,
|
|
|
|
+ verifyAcountBillDetail
|
|
|
|
+} from '@/api/verifyAccount'
|
|
export default {
|
|
export default {
|
|
name: 'AccountStatementEdit',
|
|
name: 'AccountStatementEdit',
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
@@ -164,17 +163,22 @@ export default {
|
|
bizType: undefined
|
|
bizType: undefined
|
|
},
|
|
},
|
|
creatDate: [],
|
|
creatDate: [],
|
|
- verifyAccountBillNo: null,
|
|
|
|
chooseList: [],
|
|
chooseList: [],
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
- return sparePartsReturnQueryPage(Object.assign(parameter, this.productForm)).then(res => {
|
|
|
|
|
|
+ return verifyAcountBillDetailList(Object.assign(parameter, this.productForm)).then(res => {
|
|
let data
|
|
let data
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
data = res.data
|
|
data = res.data
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
data.list[i].no = no + i + 1
|
|
data.list[i].no = no + i + 1
|
|
|
|
+ // 正为借方, 负数为贷方
|
|
|
|
+ if (data.list[i].bizAmount > 0) {
|
|
|
|
+ data.list[i].debitAmount = data.list[i].bizAmount
|
|
|
|
+ } else {
|
|
|
|
+ data.list[i].creditorAmount = data.list[i].bizAmount
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.chooseList = data.list
|
|
this.chooseList = data.list
|
|
@@ -182,10 +186,10 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
openModal: false, // 修改信息弹窗
|
|
openModal: false, // 修改信息弹窗
|
|
- detailData: null, // 统计明细
|
|
|
|
- detailsData: null, // 基础信息数据
|
|
|
|
|
|
+ countData: null, // 统计明细
|
|
|
|
+ detailData: null, // 基础信息数据
|
|
addMoreLoading: false, // 批量添加动画
|
|
addMoreLoading: false, // 批量添加动画
|
|
- grabFlag: undefined
|
|
|
|
|
|
+ verifyAccountBillSn: undefined // 单据sn
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -193,17 +197,17 @@ export default {
|
|
const _this = this
|
|
const _this = this
|
|
const arr = [
|
|
const arr = [
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
- { title: '年', dataIndex: 'bizNo', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '月', dataIndex: 'bizNo', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '日', dataIndex: 'bizNo', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
|
|
+ { title: '年', dataIndex: 'year', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '月', dataIndex: 'month', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '日', dataIndex: 'day', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '业务单号', dataIndex: 'bizNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '业务单号', dataIndex: 'bizNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
- { title: '单据类型', dataIndex: 'product.code', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '业务状态', dataIndex: 'product.name', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '费用/调拨类型', dataIndex: 'product.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '摘要', dataIndex: 'sparePartsBatchNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '客诉索赔编码', dataIndex: 'currentStockQty', width: '8%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
|
|
|
|
- { title: '借方', dataIndex: 'productCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? toThousands(text, 2) : '--') } },
|
|
|
|
- { title: '贷方', dataIndex: 'productCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? toThousands(text, 2) : '--') } },
|
|
|
|
|
|
+ { title: '单据类型', dataIndex: 'bizType', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '业务状态', dataIndex: 'bizStatus', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '费用/调拨类型', dataIndex: 'expenseAllocateType', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '摘要', dataIndex: 'digestInfo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '客诉索赔编码', dataIndex: 'productCode', width: '8%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
|
|
|
|
+ { title: '借方', dataIndex: 'debitAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
|
|
|
|
+ { title: '贷方', dataIndex: 'creditorAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
|
|
{ title: '备注', scopedSlots: { customRender: 'remark' }, width: '15%', align: 'center' },
|
|
{ title: '备注', scopedSlots: { customRender: 'remark' }, width: '15%', align: 'center' },
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
]
|
|
]
|
|
@@ -235,13 +239,13 @@ export default {
|
|
onOk () {
|
|
onOk () {
|
|
_this.delLoading = true
|
|
_this.delLoading = true
|
|
_this.spinning = true
|
|
_this.spinning = true
|
|
- sparePartsReturnDetailDelete({ detailSn: row.sparePartsReturnDetailSn })
|
|
|
|
|
|
+ verifyAcountBillDetailDel({ verifyAccountBillSn: row.verifyAccountBillSn, detailSnList: [row.verifyAccountBillDetailSn] })
|
|
.then(res => {
|
|
.then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
_this.resetTable(false)
|
|
_this.resetTable(false)
|
|
_this.getStatisticsData()
|
|
_this.getStatisticsData()
|
|
_this.getChooseList()
|
|
_this.getChooseList()
|
|
- _this.$refs.partQuery.refreshLength()
|
|
|
|
|
|
+ _this.$refs.partQuery.clearSelected()
|
|
}
|
|
}
|
|
_this.$message.info(res.message)
|
|
_this.$message.info(res.message)
|
|
_this.delLoading = false
|
|
_this.delLoading = false
|
|
@@ -269,7 +273,7 @@ export default {
|
|
this.$refs.rangeDate.resetDate(this.creatDate)
|
|
this.$refs.rangeDate.resetDate(this.creatDate)
|
|
this.$refs.table.refresh(!!flag)
|
|
this.$refs.table.refresh(!!flag)
|
|
},
|
|
},
|
|
- // 添加或修改单据
|
|
|
|
|
|
+ // 单个添加单据
|
|
saveProduct (row) {
|
|
saveProduct (row) {
|
|
if (this.isInster) {
|
|
if (this.isInster) {
|
|
// 防止多次添加产品
|
|
// 防止多次添加产品
|
|
@@ -277,77 +281,37 @@ export default {
|
|
}
|
|
}
|
|
this.isInster = true
|
|
this.isInster = true
|
|
const paramsData = {
|
|
const paramsData = {
|
|
- bookSn: this.bookSn,
|
|
|
|
- verifyAccountBillNo: this.verifyAccountBillNo,
|
|
|
|
- sparePartsDetailSn: row.sparePartsDetailSn,
|
|
|
|
- productSn: row.productSn,
|
|
|
|
- stockDetailSn: row.stockDetailSn,
|
|
|
|
- productCode: row.productCode,
|
|
|
|
- putQty: row.productQty, // 入库数量
|
|
|
|
- returnedQty: row.returnedQty, // 已退数量
|
|
|
|
- qty: row.qty, // 申退数量
|
|
|
|
- cost: row.productCost, // 成本
|
|
|
|
- stockBatchNo: row.sparePartsBatchNo, // 批次号
|
|
|
|
- warehouseSn: row.warehouseSn, // 仓库sn
|
|
|
|
- warehouseLocationSn: row.warehouseLocationSn, // 仓位sn
|
|
|
|
- bizNo: row.bizNo,
|
|
|
|
- sparePartsSn: row.sparePartsSn
|
|
|
|
|
|
+ verifyAccountBillSn: this.detailData.verifyAccountBillSn,
|
|
|
|
+ verifyAccountBillNo: this.detailData.verifyAccountBillNo,
|
|
|
|
+ verifyAccountBizSn: this.detailData.verifyAccountBizSn,
|
|
|
|
+ verifyAccountBillDetailList: [row]
|
|
}
|
|
}
|
|
- this.saveEdit(paramsData)
|
|
|
|
|
|
+ this.saveMore(paramsData)
|
|
},
|
|
},
|
|
|
|
+ // 批量添加
|
|
saveMoreProduct (data) {
|
|
saveMoreProduct (data) {
|
|
if (this.addMoreLoading) {
|
|
if (this.addMoreLoading) {
|
|
// 防止多次添加产品
|
|
// 防止多次添加产品
|
|
return
|
|
return
|
|
}
|
|
}
|
|
this.addMoreLoading = true
|
|
this.addMoreLoading = true
|
|
- var ajax_data = []
|
|
|
|
- data.forEach(item => {
|
|
|
|
- const obj = {
|
|
|
|
- bookSn: this.bookSn,
|
|
|
|
- verifyAccountBillNo: this.verifyAccountBillNo,
|
|
|
|
- sparePartsDetailSn: item.sparePartsDetailSn,
|
|
|
|
- productSn: item.productSn,
|
|
|
|
- stockDetailSn: item.stockDetailSn,
|
|
|
|
- productCode: item.productCode,
|
|
|
|
- putQty: item.productQty, // 入库数量
|
|
|
|
- returnedQty: item.returnedQty, // 已退数量
|
|
|
|
- qty: item.qty, // 申退数量
|
|
|
|
- cost: item.productCost, // 成本
|
|
|
|
- stockBatchNo: item.sparePartsBatchNo, // 批次号
|
|
|
|
- warehouseSn: item.warehouseSn, // 仓库sn
|
|
|
|
- warehouseLocationSn: item.warehouseLocationSn, // 仓位sn
|
|
|
|
- bizNo: item.bizNo,
|
|
|
|
- sparePartsSn: item.sparePartsSn
|
|
|
|
- }
|
|
|
|
- ajax_data.push(obj)
|
|
|
|
- })
|
|
|
|
- this.saveMore(ajax_data)
|
|
|
|
- },
|
|
|
|
- saveEdit (params) {
|
|
|
|
- this.spinning = true
|
|
|
|
- sparePartsReturnDetailSave(params).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.getStatisticsData()
|
|
|
|
- this.$refs.table.refresh(true)
|
|
|
|
- this.getChooseList()
|
|
|
|
- }
|
|
|
|
- this.isInster = false
|
|
|
|
- this.spinning = false
|
|
|
|
- this.addMoreLoading = false
|
|
|
|
- }).catch(err => {
|
|
|
|
- this.isInster = false
|
|
|
|
|
|
+ this.saveMore({
|
|
|
|
+ verifyAccountBillSn: this.detailData.verifyAccountBillSn,
|
|
|
|
+ verifyAccountBillNo: this.detailData.verifyAccountBillNo,
|
|
|
|
+ verifyAccountBizSn: this.detailData.verifyAccountBizSn,
|
|
|
|
+ verifyAccountBillDetailList: data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 添加
|
|
saveMore (params) {
|
|
saveMore (params) {
|
|
this.spinning = true
|
|
this.spinning = true
|
|
- sparePartsReturnDetailSaveBatch(params)
|
|
|
|
|
|
+ verifyAcountBillDetailSave(params)
|
|
.then(res => {
|
|
.then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.getStatisticsData()
|
|
this.getStatisticsData()
|
|
this.getChooseList()
|
|
this.getChooseList()
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
- this.$refs.partQuery.refreshLength()
|
|
|
|
|
|
+ this.$refs.partQuery.clearSelected()
|
|
}
|
|
}
|
|
this.isInster = false
|
|
this.isInster = false
|
|
this.spinning = false
|
|
this.spinning = false
|
|
@@ -359,10 +323,10 @@ export default {
|
|
this.spinning = false
|
|
this.spinning = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 提交采购退货
|
|
|
|
|
|
+ // 提交
|
|
handleSubmit (data) {
|
|
handleSubmit (data) {
|
|
this.spinning = true
|
|
this.spinning = true
|
|
- sparePartsReturnSubmit({ bookSn: this.bookSn, ...data }).then(res => {
|
|
|
|
|
|
+ verifyAcountBillSubmit({ verifyAccountBillSn: this.verifyAccountBillSn, ...data }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.handleBack()
|
|
this.handleBack()
|
|
this.$message.success(res.message)
|
|
this.$message.success(res.message)
|
|
@@ -371,39 +335,26 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
pageInit () {
|
|
pageInit () {
|
|
- this.bookSn = this.$route.query.sn
|
|
|
|
|
|
+ this.verifyAccountBillSn = this.$route.query.sn
|
|
this.getStatisticsData()
|
|
this.getStatisticsData()
|
|
this.getBasicsData()
|
|
this.getBasicsData()
|
|
this.resetSearchForm(true)
|
|
this.resetSearchForm(true)
|
|
},
|
|
},
|
|
getChooseList () {
|
|
getChooseList () {
|
|
- this.$refs.partQuery.pageInit(this.supplierSn, this.bookSn, this.detailsData ? this.detailsData.warehouseSn : undefined, this.detailsData.grabFlag)
|
|
|
|
|
|
+ this.$refs.partQuery.pageInit()
|
|
},
|
|
},
|
|
// 获取页面统计数据
|
|
// 获取页面统计数据
|
|
getStatisticsData () {
|
|
getStatisticsData () {
|
|
this.getBasicsData(true)
|
|
this.getBasicsData(true)
|
|
- queryPageCount({ bookSn: this.bookSn }).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.detailData = res.data
|
|
|
|
- } else {
|
|
|
|
- this.detailData = null
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- this.detailData = null
|
|
|
|
- }
|
|
|
|
|
|
+ verifyAcountBillDetailQueryCount({ verifyAccountBillSn: this.verifyAccountBillSn }).then(res => {
|
|
|
|
+ this.countData = res.data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 获取基础信息
|
|
// 获取基础信息
|
|
getBasicsData (flag) {
|
|
getBasicsData (flag) {
|
|
- sparePartsReturnInfo({ sn: this.bookSn }).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.detailsData = res.data
|
|
|
|
- } else {
|
|
|
|
- this.detailsData = null
|
|
|
|
- }
|
|
|
|
- const _this = this
|
|
|
|
|
|
+ const _this = this
|
|
|
|
+ verifyAcountBillDetail({ sn: this.verifyAccountBillSn }).then(res => {
|
|
|
|
+ this.detailData = res.data
|
|
if (!flag) {
|
|
if (!flag) {
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
_this.getChooseList()
|
|
_this.getChooseList()
|