|
|
@ -4,7 +4,6 @@ |
|
|
|
<div class="tab-header webtop"> |
|
|
|
<div>{{ viewTitle }}</div> |
|
|
|
<div> |
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="selectionList()">选择原单</el-button> |
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">保存</el-button> |
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="submit()">提交</el-button> |
|
|
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|
|
@ -32,103 +31,34 @@ |
|
|
|
<el-form-item><el-input class="addinputInfo" style="width: 80%" v-model="formobj.remarks" clearable placeholder="" /></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<div class="title">原单信息</div> |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">单据编号</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ formobj.sourceBillNo }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">单据日期</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ originalmessage.createTime }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">采购人</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ originalmessage.purchaserName }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">采购类型</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ originalmessage.purchaseTypeValue }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">采购原因</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ originalmessage.purchaseReasonValue }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">付款方式</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ originalmessage.payTypeValue }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">供应商</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ originalmessage.supplierName }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">是否开发票</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ originalmessage.isInvoicing }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div v-show="originalmessage.isInvoicing == '是'"> |
|
|
|
<div class="span-sty">发票类型(税率)</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ originalmessage.billType }}({{ originalmessage.taxRate }})</span></el-form-item> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="24"> |
|
|
|
<div class="span-sty">备注</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ originalmessage.remarks }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<div class="title">款项情况</div> |
|
|
|
<el-row> |
|
|
|
<el-col :span="6"> |
|
|
|
<div class="span-sty">采购金额</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ originalmessage.amountCount }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<div class="span-sty">运费</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ originalmessage.freight }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<div class="span-sty">优惠金额</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ originalmessage.discountAmount }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<div class="span-sty">误差调整</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ originalmessage.errorAmount }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="6"> |
|
|
|
<div class="span-sty">应付金额</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ yfTotal }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<div class="span-sty"><span class="icon">*</span>已付金额</div> |
|
|
|
<el-form-item><el-input class="addinputInfo" style="width: 40%" v-model="formobj.paidAmount" @keyup.native="formobj.paidAmount = getNumber(formobj.paidAmount, 2)" clearable placeholder="" /></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<div class="span-sty">欠款</div> |
|
|
|
<el-form-item><span class="addinputInfo">{{ qkTotal }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<div class="title titleOne"> |
|
|
|
<div>商品列表</div> |
|
|
|
<el-button type="primary" size="mini" class="btntopblueline" @click="fullyWithdraw">整单全退</el-button> |
|
|
|
<el-button type="primary" size="mini" class="btntopblueline" @click="selectionList()">选择库存商品</el-button> |
|
|
|
</div> |
|
|
|
<el-table :key="tableKey" :data="formobj.pmsPurchasebackDetailList" :index="index" border style="width: 100%"> |
|
|
|
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/> |
|
|
|
<el-table-column fixed label="操作" align="center" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="danger" size="small" @click="handleDelete(scope.$index)">删除</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="goodsID" label="商品ID" align="center" width="150" /> |
|
|
|
<el-table-column prop="goodsSpuName" label="商品名称" align="center" width="300" /> |
|
|
|
<el-table-column prop="goodsSkuCode" label="图号" align="center" width="150" /> |
|
|
|
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" width="150" /> |
|
|
|
<el-table-column prop="unit" label="单位" align="center" width="100" /> |
|
|
|
<el-table-column prop="count" label="采购数量" align="center" width="100" /> |
|
|
|
<el-table-column prop="taxPrice" v-if="originalmessage.isInvoicing == '是'" label="含税单价" align="center" width="150" /> |
|
|
|
<el-table-column prop="taxPrice" v-else label="不含税单价" align="center" width="150" /> |
|
|
|
<el-table-column prop="supplierName" label="供应商" align="center" width="150" /> |
|
|
|
<el-table-column prop="manufacturerName" label="厂家" align="center" width="150" /> |
|
|
|
<el-table-column prop="warehouseName" label="仓库" align="center" width="100" /> |
|
|
|
<el-table-column prop="warehouseArea" label="库区" align="center" width="100" /> |
|
|
|
<el-table-column prop="warehouseRackCode" label="库位" align="center" width="100" /> |
|
|
|
<el-table-column label="厂家订单号" align="center" width="160"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span class="bluezi" @click="toInfo(scope.row)">{{ scope.row.manufactorBillNo }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="count" label="库存数量" align="center" width="100" /> |
|
|
|
<el-table-column prop="taxPrice" label="采购单价" align="center" width="150" /> |
|
|
|
<el-table-column prop="amount" label="采购金额" align="center" width="140" /> |
|
|
|
<el-table-column prop="returnedCount" label="已退数量" align="center" width="140" /> |
|
|
|
<el-table-column label="退货数量" align="center" min-width="100"> |
|
|
@ -159,6 +89,8 @@ |
|
|
|
</div> |
|
|
|
<!-- 选择商品 --> |
|
|
|
<originalorder v-show="viewState == 2" ref="divYd" @backData="backData" @doback="resetState" /> |
|
|
|
<!-- 查看采购订单 --> |
|
|
|
<procurementInfo v-show="viewState == 3" ref="divCG" @doback="resetState" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
@ -166,11 +98,13 @@ |
|
|
|
import req from '@/api/purchase/purchasereturn' |
|
|
|
import { getOrgSidByPath } from '@/api/Common/dictcommons' |
|
|
|
import originalorder from './relation/originalorder' |
|
|
|
import procurementInfo from '../procurement/procurementInfo' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'PurchaseReturnAdd', |
|
|
|
components: { |
|
|
|
originalorder |
|
|
|
originalorder, |
|
|
|
procurementInfo |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -184,8 +118,6 @@ export default { |
|
|
|
remarks: '', |
|
|
|
createBySid: '', |
|
|
|
createByName: '', |
|
|
|
sourceBillSid: '', |
|
|
|
sourceBillNo: '', |
|
|
|
billNo: '', |
|
|
|
backErrorAmount: '', |
|
|
|
backFreight: '', |
|
|
@ -210,22 +142,6 @@ export default { |
|
|
|
createOrgName: '', |
|
|
|
pmsPurchasebackDetailList: [] |
|
|
|
}, |
|
|
|
originalmessage: { |
|
|
|
createTime: '', |
|
|
|
purchaserName: '', |
|
|
|
purchaseTypeValue: '', |
|
|
|
purchaseReasonValue: '', |
|
|
|
payTypeValue: '', |
|
|
|
supplierName: '', |
|
|
|
isInvoicing: '', |
|
|
|
billType: '', |
|
|
|
taxRate: '', |
|
|
|
remarks: '', |
|
|
|
freight: '', |
|
|
|
amountCount: '', |
|
|
|
discountAmount: '', |
|
|
|
errorAmount: '' |
|
|
|
}, |
|
|
|
rules: {} |
|
|
|
} |
|
|
|
}, |
|
|
@ -248,7 +164,7 @@ export default { |
|
|
|
if (this.formobj.pmsPurchasebackDetailList.length > 0) { |
|
|
|
this.formobj.pmsPurchasebackDetailList.forEach((e) => { |
|
|
|
if (e.goodsSpuName !== '') { |
|
|
|
th = Math.round((parseFloat(th) + parseFloat(e.backAmount === null ? '0' : e.backAmotun !== '' ? e.backAmotun : '0')) * 100) / 100 |
|
|
|
th = Math.round((parseFloat(th) + parseFloat(e.backAmount === null ? '0' : e.backAmount !== '' ? e.backAmount : '0')) * 100) / 100 |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
@ -258,18 +174,6 @@ export default { |
|
|
|
let ys = '0' |
|
|
|
ys = Math.round((parseFloat(ys) + parseFloat(this.thTotal) - parseFloat(this.formobj.backFreight !== '' ? this.formobj.backFreight : '0') - parseFloat(this.formobj.backDiscountAmount !== '' ? this.formobj.backDiscountAmount : '0') - parseFloat(this.formobj.deductDebts !== '' ? this.formobj.deductDebts : '0') + parseFloat(this.formobj.backErrorAmount !== '' ? this.formobj.backErrorAmount : '0')) * 100) / 100 |
|
|
|
return ys |
|
|
|
}, |
|
|
|
// 应付金额 = 应付金额 - 退货单合计(退货金额 - 优惠 + 误差调整) - 运费 - 抵扣欠款 |
|
|
|
yfTotal() { |
|
|
|
let yf = '0' |
|
|
|
yf = Math.round((parseFloat(yf) + parseFloat(this.formobj.payableAmount === '' ? '0' : this.formobj.payableAmount) - (parseFloat(this.thTotal) - parseFloat(this.formobj.backDiscountAmount !== '' ? this.formobj.backDiscountAmount : '0') + parseFloat(this.formobj.backErrorAmount !== '' ? this.formobj.backErrorAmount : '0')) - parseFloat(this.formobj.backFreight !== '' ? this.formobj.backFreight : '0') - parseFloat(this.formobj.deductDebts !== '' ? this.formobj.deductDebts : '0')) * 100) / 100 |
|
|
|
return yf |
|
|
|
}, |
|
|
|
// 欠款 = 应付金额 - 已付金额 |
|
|
|
qkTotal() { |
|
|
|
let qk = '0' |
|
|
|
qk = Math.round((parseFloat(this.yfTotal) - parseFloat(this.formobj.paidAmount === '' ? '0' : this.formobj.paidAmount)) * 100) / 100 |
|
|
|
return qk |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
@ -310,7 +214,6 @@ export default { |
|
|
|
if (res.success) { |
|
|
|
this.formobj = res.data |
|
|
|
this.formobj.instanceId = res.data.procInstId |
|
|
|
this.originalmessage = this.formobj.pmsPurchaseChoiceBillDetailsVo |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
@ -334,74 +237,64 @@ export default { |
|
|
|
}, |
|
|
|
selectionList() { |
|
|
|
this.viewState = 2 |
|
|
|
this.$refs['divYd'].showData(this.formobj.createOrgSid) |
|
|
|
this.$refs['divYd'].showData(this.formobj.deptSid) |
|
|
|
}, |
|
|
|
backData(value) { |
|
|
|
this.viewState = 1 |
|
|
|
this.formobj.sourceBillNo = value.billNo |
|
|
|
this.formobj.sourceBillSid = value.sid |
|
|
|
this.formobj.payableAmount = value.payableAmount |
|
|
|
const aa = [] |
|
|
|
if (value.pmsPurchaseBillDetailList.length > 0) { |
|
|
|
value.pmsPurchaseBillDetailList.forEach((e) => { |
|
|
|
if (value.length > 0) { |
|
|
|
value.forEach((e) => { |
|
|
|
aa.push({ |
|
|
|
sid: '', |
|
|
|
billSid: '', |
|
|
|
goodsID: e.goodsID, |
|
|
|
goodsSpuSid: e.goodsSpuSid, |
|
|
|
goodsSpuName: e.goodsSpuName, |
|
|
|
goodsSkuSid: e.goodsSkuSid, |
|
|
|
goodsSkuTitle: e.goodsSkuTitle, |
|
|
|
goodsSkuCode: e.goodsSkuCode, |
|
|
|
goodsSkuOwnSpec: e.goodsSkuOwnSpec, |
|
|
|
unit: e.unit, |
|
|
|
supplierName: e.supplierName, |
|
|
|
supplierSid: e.supplierSid, |
|
|
|
manufacturerName: e.manufacturerName, |
|
|
|
manufacturerSid: e.manufacturerSid, |
|
|
|
warehouseSid: e.warehouseSid, |
|
|
|
warehouseName: e.warehouseName, |
|
|
|
warehouseArea: e.warehouseArea, |
|
|
|
warehouseAreaSid: e.warehouseSid, |
|
|
|
warehouseRackCode: e.warehouseRackCode, |
|
|
|
warehouseRackSid: e.warehouseRackSid, |
|
|
|
manufactorBillNo: e.manufactorBillNo, |
|
|
|
manufactorBillSid: e.manufactorBillSid, |
|
|
|
count: e.count, |
|
|
|
taxPrice: e.cost, |
|
|
|
amount: e.amount, |
|
|
|
unit: e.unit, |
|
|
|
warehouseSid: '', |
|
|
|
warehouseName: '', |
|
|
|
returnedCount: e.returnedCount, |
|
|
|
backCount: '', |
|
|
|
taxAmount: '', |
|
|
|
taxPrice: e.taxPrice, |
|
|
|
backAmount: '' |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
this.formobj.pmsPurchasebackDetailList = aa |
|
|
|
this.originalmessage.createTime = value.createTime |
|
|
|
this.originalmessage.purchaserName = value.purchaserName |
|
|
|
this.originalmessage.purchaseTypeValue = value.purchaseTypeValue |
|
|
|
this.originalmessage.purchaseReasonValue = value.purchaseReasonValue |
|
|
|
this.originalmessage.payTypeValue = value.payTypeValue |
|
|
|
this.originalmessage.supplierName = value.supplierName |
|
|
|
this.originalmessage.isInvoicing = value.isInvoicing |
|
|
|
this.originalmessage.billType = value.billType |
|
|
|
this.originalmessage.taxRate = value.taxRate |
|
|
|
this.originalmessage.amountCount = value.amountCount |
|
|
|
this.originalmessage.freight = value.freight |
|
|
|
this.originalmessage.discountAmount = value.discountAmount |
|
|
|
this.originalmessage.errorAmount = value.errorAmount |
|
|
|
}, |
|
|
|
handleDelete(index) { |
|
|
|
this.formobj.pmsPurchasebackDetailList.splice(index, 1) |
|
|
|
}, |
|
|
|
resetState() { |
|
|
|
this.viewState = 1 |
|
|
|
}, |
|
|
|
fullyWithdraw() { |
|
|
|
if (this.formobj.pmsPurchasebackDetailList.length > 0) { |
|
|
|
this.formobj.pmsPurchasebackDetailList.forEach((e) => { |
|
|
|
if (e.goodsSpuName !== '') { |
|
|
|
// 计算退货数量 = 采购数量 - 已退数量 |
|
|
|
e.backCount = Math.round((parseFloat(e.count) - parseFloat(e.returnedCount !== '' ? e.returnedCount : '0')) * 100) / 100 |
|
|
|
// 计算退货金额 |
|
|
|
e.backAmount = Math.round((parseFloat(e.backCount) * parseFloat(e.taxPrice)) * 100) / 100 |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 计算退货金额 |
|
|
|
backAmountInput(row) { |
|
|
|
if (row.goodsSpuName !== '') { |
|
|
|
row.backAmount = Math.round((parseFloat(row.taxPrice !== '' ? row.taxPrice : '0') * parseFloat(row.backCount !== '' ? row.backCount : '0')) * 100) / 100 |
|
|
|
} |
|
|
|
}, |
|
|
|
toInfo(row) { |
|
|
|
this.viewState = 3 |
|
|
|
this.$refs['divCG'].showInfo({ sid: row.manufactorBillSid }) |
|
|
|
}, |
|
|
|
saveOrUpdate() { |
|
|
|
this.$refs['form_obj'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
@ -449,8 +342,6 @@ export default { |
|
|
|
remarks: '', |
|
|
|
createBySid: '', |
|
|
|
createByName: '', |
|
|
|
sourceBillSid: '', |
|
|
|
sourceBillNo: '', |
|
|
|
billNo: '', |
|
|
|
backErrorAmount: '', |
|
|
|
backFreight: '', |
|
|
@ -489,10 +380,6 @@ export default { |
|
|
|
.addinputInfo { |
|
|
|
margin-left: 120px !important; |
|
|
|
} |
|
|
|
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw { |
|
|
|
margin-left: 120px !important; |
|
|
|
width: calc(100% - 115px); |
|
|
|
} |
|
|
|
.titleOne { |
|
|
|
padding: 7px; |
|
|
|
display: flex; |
|
|
|