|
|
@ -113,60 +113,58 @@ |
|
|
|
<el-button type="primary" size="mini" @click="deleteGoods(scope.row)">删除</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="商品编码" prop="goodsSkuCode" width="150" align="center" /> |
|
|
|
<el-table-column label="商品编码" prop="goodsSkuCode" width="120" align="center" /> |
|
|
|
<el-table-column label="商品名称" prop="goodsSkuTitle" width="150" align="center" /> |
|
|
|
<el-table-column label="商品规格" prop="goodsSkuOwnSpec" width="150" align="center" /> |
|
|
|
<el-table-column label="单位" prop="unit" width="120" align="center" /> |
|
|
|
<el-table-column label="采购数量" align="center" prop="count" width="150"> |
|
|
|
<el-table-column label="规格" prop="goodsSkuOwnSpec" width="120" align="center" /> |
|
|
|
<el-table-column label="单位" prop="unit" width="60" align="center" /> |
|
|
|
<el-table-column label="采购数量" align="center" prop="count" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.count" clearable placeholder="" |
|
|
|
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" @input="calculation(scope.row,'count',$event)" /> |
|
|
|
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" @input="calculation(scope.row,'count')" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="数量(pcs)" prop="pcsCount" align="center" width="150"> |
|
|
|
<el-table-column label="数量(pcs)" prop="pcsCount" align="center" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.pcsCount" clearable placeholder="" |
|
|
|
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column label="数量(pcs)" prop="pcsNum" width="120" align="center" /> --> |
|
|
|
<el-table-column label="吊牌价" prop="tagPrice" width="120" align="center" /> |
|
|
|
<el-table-column label="吊牌价" prop="tagPrice" width="80" align="center" /> |
|
|
|
<!-- <el-table-column label="单价" prop="cost" width="120" align="center" /> --> |
|
|
|
<el-table-column label="单价" align="center" width="150"> |
|
|
|
<el-table-column label="单价" align="center" width="120"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.cost" clearable placeholder="" |
|
|
|
@input="calculation(scope.row,'cost',$event)" |
|
|
|
<el-input v-model="scope.row.cost" clearable placeholder="" @input="calculation(scope.row,'cost')" |
|
|
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="折扣率(%)" align="center" width="150"> |
|
|
|
<el-table-column label="折扣率(%)" align="center" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.discountRate" clearable placeholder="" |
|
|
|
@input="calculation(scope.row,'count',$event)" |
|
|
|
@input="calculation(scope.row,'count')" |
|
|
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="discountPrice" label="折扣单价" width="120" align="center" /> |
|
|
|
<el-table-column prop="shareAmount" label="分摊金额" width="150" align="center" /> |
|
|
|
<el-table-column prop="amount" label="总价" width="120" align="center" /> |
|
|
|
<el-table-column prop="discountPrice" label="折扣单价" width="100" align="center" /> |
|
|
|
<el-table-column prop="shareAmount" label="分摊金额" width="100" align="center" /> |
|
|
|
<el-table-column prop="amount" label="总价" width="100" align="center" /> |
|
|
|
<!-- <el-table-column prop="taxRate" label="税率" width="120" align="center" /> --> |
|
|
|
<el-table-column label="税率(%)" align="center" width="150"> |
|
|
|
<el-table-column label="税率(%)" align="center" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.taxRate" clearable placeholder="" |
|
|
|
@input="calculation(scope.row,'count',$event)" |
|
|
|
<el-input v-model="scope.row.taxRate" clearable placeholder="" @input="calculation(scope.row,'count')" |
|
|
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="unTaxPrice" label="未含税价" width="120" align="center" /> |
|
|
|
<el-table-column prop="taxAmount" label="总税额" width="120" align="center" /> |
|
|
|
<el-table-column prop="unTaxPrice" label="未含税价" width="100" align="center" /> |
|
|
|
<el-table-column prop="taxAmount" label="总税额" width="100" align="center" /> |
|
|
|
<el-table-column prop="unTaxTotalAmount" label="未含总税价" width="120" align="center" /> |
|
|
|
<!-- <el-table-column prop="cycle" label="采购周期" width="120" align="center" /> --> |
|
|
|
<el-table-column label="采购周期" align="center" width="150"> |
|
|
|
<el-table-column label="采购周期" align="center" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.cycle" clearable placeholder="" @input="computeDate(scope.row)" |
|
|
|
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" /> </template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="deliveryDate" label="预计到货日期" width="180" align="center" /> |
|
|
|
<el-table-column prop="deliveryDate" label="预计到货日期" width="120" align="center" /> |
|
|
|
<!-- <el-table-column label="预计到货日期" align="center" min-width="250"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-date-picker v-model="scope.row.deliveryDate" type="date" value-format="yyyy-MM-dd" |
|
|
@ -174,16 +172,16 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> --> |
|
|
|
<!-- <el-table-column prop="manufactureDate" label="生产日期" width="120" align="center" /> --> |
|
|
|
<el-table-column label="生产日期" align="center" min-width="250"> |
|
|
|
<el-table-column label="生产日期" align="center" min-width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-date-picker v-model="scope.row.madeDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" |
|
|
|
@change="manufactureDateChange(scope.row)" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="expireDate" label="过期日期" width="120" align="center" /> |
|
|
|
<el-table-column prop="batchNumber" label="批次号" width="200" align="center" /> |
|
|
|
<el-table-column prop="goodsNum" label="货号" width="120" align="center" /> |
|
|
|
<el-table-column label="备注" align="center" width="150"> |
|
|
|
<el-table-column prop="batchNumber" label="批次号" width="180" align="center" /> |
|
|
|
<el-table-column prop="goodsNum" label="货号" width="100" align="center" /> |
|
|
|
<el-table-column label="备注" align="center" width="120"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.remarks" clearable placeholder="" /> |
|
|
|
</template> |
|
|
@ -201,7 +199,7 @@ |
|
|
|
<div class="span-sty">运费分摊方式</div> |
|
|
|
<el-form-item prop="freightShareTypeValue"> |
|
|
|
<el-select v-model="formobj.purchaseBillAmount.freightShareTypeValue" placeholder="请选择分摊方式" |
|
|
|
class="addinputw addinputInfo" @change="selectFreightShareType"> |
|
|
|
class="addinputw addinputInfo" @change="selectFreightShareType" :disabled="true"> |
|
|
|
<el-option v-for="(item,index ) in shareTypeList" :key="index" :label="item.dictValue" |
|
|
|
:value="item.dictKey" /> |
|
|
|
</el-select> |
|
|
@ -234,7 +232,7 @@ |
|
|
|
<div class="span-sty">其他费用分摊方式</div> |
|
|
|
<el-form-item prop="otherShareTypeValue"> |
|
|
|
<el-select v-model="formobj.purchaseBillAmount.otherShareTypeValue" placeholder="请选择分摊方式" |
|
|
|
class="addinputw addinputInfo" @change="selectOtherShareType"> |
|
|
|
class="addinputw addinputInfo" @change="selectOtherShareType" :disabled="true"> |
|
|
|
<el-option v-for="(item,index ) in shareTypeList" :key="index" :label="item.dictValue" |
|
|
|
:value="item.dictKey" /> |
|
|
|
</el-select> |
|
|
@ -328,11 +326,11 @@ |
|
|
|
"discountAmount": "", |
|
|
|
"payableAmount": "", |
|
|
|
"freight": "", |
|
|
|
"freightShareTypeKey": "", |
|
|
|
"freightShareTypeValue": "", |
|
|
|
"freightShareTypeKey": "002", |
|
|
|
"freightShareTypeValue": "按金额分摊", |
|
|
|
"otherAmount": "", |
|
|
|
"otherShareTypeKey": "", |
|
|
|
"otherShareTypeValue": "", |
|
|
|
"otherShareTypeKey": "002", |
|
|
|
"otherShareTypeValue": "按金额分摊", |
|
|
|
"settleAccountKey": "", |
|
|
|
"settleAccountValue": "", |
|
|
|
"prepayment": "", |
|
|
@ -562,7 +560,7 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
// 清除分摊金额 并反算 |
|
|
|
calculation(row, updateProp, event) { |
|
|
|
calculation(row, updateProp) { |
|
|
|
|
|
|
|
this.formobj.purchaseBillAmount.freight = 0.00 |
|
|
|
this.formobj.purchaseBillAmount.otherAmount = 0.00 |
|
|
@ -639,8 +637,23 @@ |
|
|
|
computeShareAmount() { |
|
|
|
// 分摊金额 = (采购运费+其他费用)*单价*数量/所有商品总价 |
|
|
|
|
|
|
|
var price = Number(this.formobj.purchaseBillAmount.freight) + Number(this.formobj.purchaseBillAmount |
|
|
|
.otherAmount) |
|
|
|
// 001不分摊 不计算 |
|
|
|
// 002按金额分摊 |
|
|
|
// 003按重量分摊 暂未处理 |
|
|
|
|
|
|
|
var freight = this.formobj.purchaseBillAmount.freight // 采购运费 |
|
|
|
var otherAmount = this.formobj.purchaseBillAmount.otherAmount // 其他运费 |
|
|
|
|
|
|
|
freight = this.formobj.purchaseBillAmount.freightShareTypeKey != '002' ? 0 : this.formobj.purchaseBillAmount |
|
|
|
.freight |
|
|
|
|
|
|
|
otherAmount = this.formobj.purchaseBillAmount.otherShareTypeKey != '002' ? 0 : this.formobj.purchaseBillAmount |
|
|
|
.otherAmount |
|
|
|
|
|
|
|
console.log("freight>>>", freight); |
|
|
|
console.log("otherAmount>>>", otherAmount); |
|
|
|
|
|
|
|
var price = Number(freight) + Number(otherAmount) |
|
|
|
|
|
|
|
var all = 0 // 除去最后一个的分摊总和 |
|
|
|
var totalAmount = 0 // 原所有商品总价 |
|
|
@ -677,6 +690,7 @@ |
|
|
|
|
|
|
|
if (Number(item.count) != 0) { |
|
|
|
if (Number(price) == 0) { |
|
|
|
item.cost = (Number(item.cost) - Number(item.shareAmount) / Number(item.count)).toFixed(2) |
|
|
|
item.shareAmount = 0.00 |
|
|
|
} else { |
|
|
|
// 分摊金额 = (采购运费+其他费用)*单价*数量/所有商品总价 |
|
|
@ -822,7 +836,7 @@ |
|
|
|
"cycle": value[i].purchaseCycle != null ? value[i].purchaseCycle : '', |
|
|
|
"deliveryDate": value[i].deliveryDate != null ? value[i].deliveryDate : '', |
|
|
|
"madeDate": value[i].manufactureDate != null ? value[i].manufactureDate : '', |
|
|
|
"shelfLife": value[i].shelfLife != null ? value[i].shelfLife : '', |
|
|
|
"shelfLife": value[i].shelfLife != null ? value[i].shelfLife : 0, |
|
|
|
"expireDate": value[i].overdueDate != null ? value[i].overdueDate : '', |
|
|
|
"batchNumber": value[i].batchNumber != null ? value[i].batchNumber : '', |
|
|
|
"goodsNum": value[i].itemNumber != null ? value[i].itemNumber : '', |
|
|
@ -1054,6 +1068,7 @@ |
|
|
|
console.log('>>>>>>>>>selectFreightShareType', choose) |
|
|
|
this.formobj.purchaseBillAmount.freightShareTypeValue = choose[0].dictValue |
|
|
|
this.formobj.purchaseBillAmount.freightShareTypeKey = choose[0].dictKey |
|
|
|
this.computeShareAmount() |
|
|
|
}, |
|
|
|
selectSettleAccount(val) { |
|
|
|
const choose = this.settlementList.filter((item) => item.dictKey == val) |
|
|
@ -1066,6 +1081,7 @@ |
|
|
|
console.log('>>>>>>>>>selectOtherShareType', choose) |
|
|
|
this.formobj.purchaseBillAmount.otherShareTypeValue = choose[0].dictValue |
|
|
|
this.formobj.purchaseBillAmount.otherShareTypeKey = choose[0].dictKey |
|
|
|
this.computeShareAmount() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|