|
|
|
@ -78,7 +78,13 @@ |
|
|
|
width="180" |
|
|
|
label="Action"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-link style="cursor: pointer" @click="openQuoteDialog(scope.row)">报价</el-link> |
|
|
|
<el-link |
|
|
|
v-if="scope.row.status === '待报价'" |
|
|
|
style="cursor: pointer" |
|
|
|
@click="openQuoteDialog(scope.row)"> |
|
|
|
报价 |
|
|
|
</el-link> |
|
|
|
<!-- <el-link style="cursor: pointer" @click="openQuoteDialog(scope.row)">报价</el-link> --> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
@ -123,19 +129,20 @@ |
|
|
|
|
|
|
|
<!-- 基础信息 --> |
|
|
|
<div class="form-section"> |
|
|
|
<div class="section-title">基础信息</div> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="物料编码" prop="partNo"> |
|
|
|
<el-input v-model="quoteForm.partNo" :disabled="true" placeholder="物料编码"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-col :span="18"> |
|
|
|
<el-form-item label="物料名称" prop="partDesc"> |
|
|
|
<el-input v-model="quoteForm.partDesc" :disabled="true" placeholder="物料名称"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
</el-row> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="18"> |
|
|
|
<el-form-item label="规格型号" prop="spec"> |
|
|
|
<el-input v-model="quoteForm.spec" :disabled="true" placeholder="规格型号"></el-input> |
|
|
|
</el-form-item> |
|
|
|
@ -147,67 +154,62 @@ |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row :gutter="20"> |
|
|
|
|
|
|
|
<el-col :span="18"> |
|
|
|
<el-form-item label="其他要求" prop="otherCondition"> |
|
|
|
<el-input v-model="quoteForm.otherCondition" type="text" :disabled="true" :rows="1" placeholder="其他要求"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="计量单位" prop="umid"> |
|
|
|
<el-input v-model="quoteForm.umid" :disabled="true" placeholder="计量单位"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 费用信息 --> |
|
|
|
<div class="form-section"> |
|
|
|
<div class="section-title">费用信息</div> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="材料费用" prop="materialCost"> |
|
|
|
<el-input-number v-model="quoteForm.materialCost" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|
|
|
<el-input-number v-model="quoteForm.materialCost" @change="calculatePrice" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="加工费" prop="produceFee"> |
|
|
|
<el-input-number v-model="quoteForm.produceFee" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|
|
|
<el-input-number v-model="quoteForm.produceFee" @change="calculatePrice" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="表面处理费" prop="surfaceFee"> |
|
|
|
<el-input-number v-model="quoteForm.surfaceFee" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|
|
|
<el-input-number v-model="quoteForm.surfaceFee" @change="calculatePrice" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="利润" prop="profit"> |
|
|
|
<el-input-number v-model="quoteForm.profit" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|
|
|
<el-input-number v-model="quoteForm.profit" @change="calculatePrice" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<!-- 价格信息 --> |
|
|
|
<div class="form-section"> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="模具费" prop="mouldFee"> |
|
|
|
<el-input-number v-model="quoteForm.mouldFee" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="附加费用" prop="additionalCost"> |
|
|
|
<el-input-number v-model="quoteForm.additionalCost" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|
|
|
<el-form-item label="未税单价" prop="price"> |
|
|
|
<el-input-number v-model="quoteForm.price" :disabled="true" :precision="4" :min="0" style="width: 100%" @change="calculateTax"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="运费" prop="freight"> |
|
|
|
<el-input-number v-model="quoteForm.freight" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|
|
|
<el-form-item label="税率(%)" prop="taxRate"> |
|
|
|
<el-input-number v-model="quoteForm.taxRate" :disabled="true" :precision="2" :min="0" :max="100" style="width: 100%" @change="calculateTax"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="采购周期(天)" prop="purchaseCycle"> |
|
|
|
<el-input-number v-model="quoteForm.purchaseCycle" :min="0" :precision="0" style="width: 100%"></el-input-number> |
|
|
|
<el-form-item label="含税单价" prop="tax"> |
|
|
|
<el-input-number v-model="quoteForm.tax" :disabled="true" :precision="4" :min="0" style="width: 100%"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row :gutter="20"> |
|
|
|
|
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="关税" prop="duty"> |
|
|
|
<el-input-number v-model="quoteForm.duty" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|
|
|
@ -215,24 +217,25 @@ |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 价格信息 --> |
|
|
|
<div class="form-section"> |
|
|
|
<div class="section-title">价格信息</div> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="未税单价" prop="price"> |
|
|
|
<el-input-number v-model="quoteForm.price" :precision="4" :min="0" style="width: 100%" @change="calculateTax"></el-input-number> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="采购周期(天)" prop="purchaseCycle"> |
|
|
|
<el-input-number v-model="quoteForm.purchaseCycle" :min="0" :precision="0" style="width: 100%"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="税率(%)" prop="taxRate"> |
|
|
|
<el-input-number v-model="quoteForm.taxRate" :precision="2" :min="0" :max="100" style="width: 100%" @change="calculateTax"></el-input-number> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="模具费" prop="mouldFee"> |
|
|
|
<el-input-number v-model="quoteForm.mouldFee" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="含税单价" prop="tax"> |
|
|
|
<el-input-number v-model="quoteForm.tax" :precision="4" :min="0" style="width: 100%"></el-input-number> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="附加费用" prop="additionalCost"> |
|
|
|
<el-input-number v-model="quoteForm.additionalCost" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="运费" prop="freight"> |
|
|
|
<el-input-number v-model="quoteForm.freight" :precision="2" :min="0" style="width: 100%"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
@ -240,18 +243,10 @@ |
|
|
|
|
|
|
|
<!-- 其他信息 --> |
|
|
|
<div class="form-section"> |
|
|
|
<div class="section-title">其他信息</div> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="其他要求" prop="otherCondition"> |
|
|
|
<el-input v-model="quoteForm.otherCondition" type="textarea" :rows="1" placeholder="其他要求"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="特殊要求" prop="remark2"> |
|
|
|
<el-input v-model="quoteForm.remark2" type="textarea" :rows="1" placeholder="请输入特殊要求"></el-input> |
|
|
|
<el-input v-model="quoteForm.remark2" type="textarea" :disabled="true" :rows="1" placeholder="请输入特殊要求"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
@ -456,47 +451,44 @@ export default { |
|
|
|
this.currentRow = row ? JSON.parse(JSON.stringify(row)) : { site: '', orderNo: '', itemNo: '' } |
|
|
|
this.refreshCurrentTabTable() |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
tabClick() { |
|
|
|
this.refreshCurrentTabTable() |
|
|
|
}, |
|
|
|
refreshCurrentTabTable() { |
|
|
|
if (!this.currentRow || !this.currentRow.orderNo) { |
|
|
|
if (this.activeName === 'quotationList') { |
|
|
|
if (this.$refs.quotationList) { |
|
|
|
this.$refs.quotationList.init({ orderNo: '', itemNo: '', height: this.tabHeight }) |
|
|
|
if (this.currentRow === '' || this.currentRow === null) { |
|
|
|
this.currentRow = {site: '', orderNo: ''} |
|
|
|
} |
|
|
|
} else if (this.activeName === 'attachments') { |
|
|
|
if (this.$refs.attachments) { |
|
|
|
this.$refs.attachments.init({ |
|
|
|
orderRef1: this.$store.state.user.site, |
|
|
|
orderRef2: this.searchData.orderNo, |
|
|
|
orderRef3: this.searchData.partNo, |
|
|
|
orderReftype: 'purQuotationDetail', |
|
|
|
height: this.tabHeight |
|
|
|
}) |
|
|
|
if (this.activeName === 'quotationList') { |
|
|
|
this.refreshQuotationList() |
|
|
|
} |
|
|
|
if (this.activeName === 'attachments') { |
|
|
|
this.refreshAttachments() |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.activeName === 'quotationList') { |
|
|
|
if (this.$refs.quotationList) { |
|
|
|
this.$refs.quotationList.init({ |
|
|
|
}, |
|
|
|
|
|
|
|
refreshQuotationList(){ |
|
|
|
let inData = { |
|
|
|
site: this.currentRow.site, |
|
|
|
orderNo: this.currentRow.orderNo, |
|
|
|
itemNo: this.currentRow.itemNo, |
|
|
|
partNo: this.currentRow.partNo, |
|
|
|
type: 'add', |
|
|
|
height: this.tabHeight |
|
|
|
}) |
|
|
|
} |
|
|
|
} else if (this.activeName === 'attachments') { |
|
|
|
if (this.$refs.attachments) { |
|
|
|
this.$refs.attachments.init({ |
|
|
|
this.$refs.quotationList.init(inData) |
|
|
|
}, |
|
|
|
|
|
|
|
refreshAttachments () { |
|
|
|
let inData = { |
|
|
|
orderRef1: this.currentRow.site, |
|
|
|
orderRef2: this.currentRow.orderNo, |
|
|
|
orderRef3: this.currentRow.partNo, |
|
|
|
orderReftype: 'purQuotationDetail', |
|
|
|
height: this.tabHeight |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
this.$refs.attachments.init(inData) |
|
|
|
}, |
|
|
|
// 打开报价对话框 |
|
|
|
openQuoteDialog(row) { |
|
|
|
@ -539,16 +531,27 @@ export default { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
createdBy: this.$store.state.user.name |
|
|
|
} |
|
|
|
// 计算含税单价 |
|
|
|
this.calculateTax() |
|
|
|
// 计算含税单价: |
|
|
|
this.calculatePrice() |
|
|
|
// this.calculateTax() |
|
|
|
this.quoteDialogVisible = true |
|
|
|
}, |
|
|
|
|
|
|
|
calculatePrice(){ |
|
|
|
//未税单价=材料成本+加工费+表面费用+利润 |
|
|
|
this.quoteForm.price = this.quoteForm.materialCost + this.quoteForm.produceFee + |
|
|
|
this.quoteForm.surfaceFee + this.quoteForm.profit |
|
|
|
this.calculateTax() |
|
|
|
|
|
|
|
}, |
|
|
|
// 计算含税单价 |
|
|
|
calculateTax() { |
|
|
|
//含税单价=未税单价*(1+税率) |
|
|
|
if (this.quoteForm.price && this.quoteForm.taxRate) { |
|
|
|
this.quoteForm.tax = this.quoteForm.price * (1 + this.quoteForm.taxRate / 100) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 提交报价 |
|
|
|
submitQuote() { |
|
|
|
this.$refs.quoteForm.validate((valid) => { |
|
|
|
@ -618,7 +621,6 @@ export default { |
|
|
|
.dialog-content { |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
|
|
|
|
/* 产品表单样式 */ |
|
|
|
.part-form { |
|
|
|
width: 100%; |
|
|
|
@ -642,10 +644,6 @@ export default { |
|
|
|
/* 表单分组样式 */ |
|
|
|
.form-section { |
|
|
|
margin-bottom: 5px; |
|
|
|
font-size: 12px; |
|
|
|
font-weight: 600; |
|
|
|
color: #409EFF; |
|
|
|
margin: 5px 0 5px 0; |
|
|
|
} |
|
|
|
|
|
|
|
.form-section:last-child { |
|
|
|
|