Browse Source

2024-12-16

master
qiezi 1 year ago
parent
commit
02a81544c0
  1. 2
      src/views/modules/quotation/toBeQuoted.vue
  2. 102
      src/views/modules/quote/detail/primary/quoteDetailCost.vue
  3. 10
      src/views/modules/quote/detail/quoteDetail.vue

2
src/views/modules/quotation/toBeQuoted.vue

@ -605,7 +605,7 @@ export default {
this.saveBatchQuotationLoading = true; this.saveBatchQuotationLoading = true;
batchSaveQuote(list).then(({data})=>{ batchSaveQuote(list).then(({data})=>{
this.saveBatchQuotationLoading = false; this.saveBatchQuotationLoading = false;
if (data.code === 0){
if (data && data.code === 0){
this.$message.success(data.msg); this.$message.success(data.msg);
this.quoteVisible = false; this.quoteVisible = false;
this.$refs.quotationTable.clearSelection(); this.$refs.quotationTable.clearSelection();

102
src/views/modules/quote/detail/primary/quoteDetailCost.vue

@ -37,11 +37,17 @@ export default {
adjustToolCost: [ adjustToolCost: [
{ required: true, message: "请输入工具成本", trigger: ["blur","change"] } { required: true, message: "请输入工具成本", trigger: ["blur","change"] }
], ],
adjustTestCost: [
{ required: true, message: "请输入测试成本", trigger: ["blur","change"] }
],
adjustElseCost: [
{ required: true, message: "请输入其他成本", trigger: ["blur","change"] }
],
manageCost: [ manageCost: [
{ required: true, message: "请输入管理成本", trigger: ["blur","change"] } { required: true, message: "请输入管理成本", trigger: ["blur","change"] }
], ],
otherCost: [ otherCost: [
{ required: true, message: "请输入其他成本", trigger: ["blur","change"] }
{ required: true, message: "请输入包装&运输成本", trigger: ["blur","change"] }
], ],
profitRate: [ profitRate: [
{ required: true, message: "请输入利润率", trigger: ["blur","change"] } { required: true, message: "请输入利润率", trigger: ["blur","change"] }
@ -65,7 +71,7 @@ export default {
tagNo:undefined, tagNo:undefined,
type:undefined, type:undefined,
allCheckedLabel:['工具','测试','其他','包装','运输'],
allCheckedLabel:['工具','测试','其他','包装&运输'],
// selectionChecked:[], // selectionChecked:[],
checkAll:false, checkAll:false,
@ -96,9 +102,19 @@ export default {
this.quoteDetail.adjustMachineCost + this.quoteDetail.adjustMachineCost +
this.quoteDetail.adjustFabricateCost + this.quoteDetail.adjustFabricateCost +
this.quoteDetail.adjustLabourCost + this.quoteDetail.adjustLabourCost +
this.quoteDetail.adjustToolCost +
this.quoteDetail.manageCost +
this.quoteDetail.otherCost;
this.quoteDetail.manageCost;
if (this.selectionChecked.includes('其他')){
this.quoteDetail.totalCost += this.quoteDetail.adjustElseCost;
}
if (this.selectionChecked.includes('工具')){
this.quoteDetail.totalCost += this.quoteDetail.adjustToolCost;
}
if (this.selectionChecked.includes('测试')){
this.quoteDetail.totalCost += this.quoteDetail.adjustTestCost;
}
if (this.selectionChecked.includes('包装&运输')){
this.quoteDetail.totalCost += this.quoteDetail.otherCost;
}
this.computeCurrencyTotalCost(); this.computeCurrencyTotalCost();
this.computeProfitAmount(); this.computeProfitAmount();
}, },
@ -109,9 +125,19 @@ export default {
this.quoteDetail.adjustMachineCost + this.quoteDetail.adjustMachineCost +
this.quoteDetail.adjustFabricateCost + this.quoteDetail.adjustFabricateCost +
this.quoteDetail.adjustLabourCost + this.quoteDetail.adjustLabourCost +
this.quoteDetail.adjustToolCost +
this.quoteDetail.manageCost +
this.quoteDetail.otherCost;
this.quoteDetail.manageCost;
if (this.selectionChecked.includes('其他')){
this.quoteDetail.quoteTotalCost += this.quoteDetail.adjustElseCost;
}
if (this.selectionChecked.includes('工具')){
this.quoteDetail.quoteTotalCost += this.quoteDetail.adjustToolCost;
}
if (this.selectionChecked.includes('测试')){
this.quoteDetail.quoteTotalCost += this.quoteDetail.adjustTestCost;
}
if (this.selectionChecked.includes('包装&运输')){
this.quoteDetail.quoteTotalCost += this.quoteDetail.otherCost;
}
this.computeQuoteCurrencyTotalCost(); this.computeQuoteCurrencyTotalCost();
this.computeQuoteProfitAmount(); this.computeQuoteProfitAmount();
}, },
@ -164,6 +190,10 @@ export default {
this.quoteDetail.adjustFabricateCost = data.row.manufactureCost; this.quoteDetail.adjustFabricateCost = data.row.manufactureCost;
this.quoteDetail.toolCost = data.row.toolCost; this.quoteDetail.toolCost = data.row.toolCost;
this.quoteDetail.adjustToolCost = data.row.toolCost; this.quoteDetail.adjustToolCost = data.row.toolCost;
this.quoteDetail.testCost = data.row.testCost;
this.quoteDetail.adjustTestCost = data.row.testCost;
this.quoteDetail.elseCost = data.row.elseCost;
this.quoteDetail.adjustElseCost = data.row.elseCost;
this.quoteDetail.packCost = data.row.packCost; this.quoteDetail.packCost = data.row.packCost;
this.quoteDetail.shippingCost = data.row.shippingCost; this.quoteDetail.shippingCost = data.row.shippingCost;
this.quoteDetail.otherCost = data.row.otherCost; this.quoteDetail.otherCost = data.row.otherCost;
@ -239,6 +269,20 @@ export default {
this.computeTotalCost(); this.computeTotalCost();
this.computeQuoteTotalCost(); this.computeQuoteTotalCost();
}, },
'quoteDetail.adjustTestCost'(newValue, oldValue){
if (newValue === undefined || newValue === null){
this.quoteDetail.adjustTestCost = 0;
}
this.computeTotalCost();
this.computeQuoteTotalCost();
},
'quoteDetail.adjustElseCost'(newValue, oldValue){
if (newValue === undefined || newValue === null){
this.quoteDetail.adjustElseCost = 0;
}
this.computeTotalCost();
this.computeQuoteTotalCost();
},
'quoteDetail.manageCost'(newValue, oldValue){ 'quoteDetail.manageCost'(newValue, oldValue){
if (newValue === undefined || newValue === null){ if (newValue === undefined || newValue === null){
this.quoteDetail.manageCost = 0; this.quoteDetail.manageCost = 0;
@ -319,12 +363,15 @@ export default {
}else { }else {
this.checkAll = false; this.checkAll = false;
} }
}
},
}, },
computed:{ computed:{
selectionChecked:{ selectionChecked:{
set(newVal){ set(newVal){
this.selection = newVal.join(',') this.selection = newVal.join(',')
this.quoteDetail.calculatedItems = this.selection;
this.computeTotalCost();
this.computeQuoteTotalCost();
}, },
get(){ get(){
if (this.selection === '' || this.selection === undefined || this.selection === null){ if (this.selection === '' || this.selection === undefined || this.selection === null){
@ -335,6 +382,9 @@ export default {
} }
}, },
mounted() { mounted() {
if (this.quoteDetail.calculatedItems){
this.selection = this.quoteDetail.calculatedItems;
}
this.$nextTick(()=>{ this.$nextTick(()=>{
this.computeProfitAmount() this.computeProfitAmount()
this.computeQuoteProfitAmount() this.computeQuoteProfitAmount()
@ -345,11 +395,7 @@ export default {
<template> <template>
<div> <div>
<el-row :gutter="10">
<el-col :span="2">
<el-button :loading="computeLoading" style="width: 80px" type="primary" :disabled="quoteDetail.status === '下达'" @click="handleQueryAllCost"> </el-button>
</el-col>
<el-col :span="2">
<el-button :loading="computeLoading" style="margin-right: 10px" type="primary" :disabled="quoteDetail.status === '下达'" @click="handleQueryAllCost"> </el-button>
<el-popover <el-popover
placement="bottom-start" placement="bottom-start"
width="100" width="100"
@ -364,8 +410,6 @@ export default {
</el-checkbox-group> </el-checkbox-group>
<a slot="reference">计入材料成本</a> <a slot="reference">计入材料成本</a>
</el-popover> </el-popover>
</el-col>
</el-row>
<!-- <el-select v-model="showQuoteCost">--> <!-- <el-select v-model="showQuoteCost">-->
<!-- <el-option label="报价成本" :value="true"></el-option>--> <!-- <el-option label="报价成本" :value="true"></el-option>-->
@ -410,6 +454,18 @@ export default {
v-model="quoteDetail.toolCost" :precision="4" disabled/> v-model="quoteDetail.toolCost" :precision="4" disabled/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4">
<el-form-item label="测试成本:" prop="testCost" :show-message="false">
<el-input-number style="width: 100%;" :controls="false"
v-model="quoteDetail.testCost" :precision="4" disabled/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="其他成本:" prop="elseCost" :show-message="false">
<el-input-number style="width: 100%;" :controls="false"
v-model="quoteDetail.elseCost" :precision="4" disabled/>
</el-form-item>
</el-col>
</el-row> </el-row>
</fieldset> </fieldset>
<fieldset <fieldset
@ -446,6 +502,18 @@ export default {
v-model="quoteDetail.adjustToolCost" :disabled="quoteDetail.status === '下达'" :step="0" :precision="4" :min="0"/> v-model="quoteDetail.adjustToolCost" :disabled="quoteDetail.status === '下达'" :step="0" :precision="4" :min="0"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4">
<el-form-item label="测试成本:" prop="adjustTestCost" :show-message="false">
<el-input-number style="width: 100%;" :controls="false"
v-model="quoteDetail.adjustTestCost" :disabled="quoteDetail.status === '下达'" :step="0" :precision="4" :min="0"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="其他成本:" prop="adjustElseost" :show-message="false">
<el-input-number style="width: 100%;" :controls="false"
v-model="quoteDetail.adjustElseCost" :disabled="quoteDetail.status === '下达'" :step="0" :precision="4" :min="0"/>
</el-form-item>
</el-col>
</el-row> </el-row>
</fieldset> </fieldset>
<fieldset style="margin-top: 5px;border: 1px solid #777;" v-if="isShowOtherCost"> <fieldset style="margin-top: 5px;border: 1px solid #777;" v-if="isShowOtherCost">
@ -470,7 +538,7 @@ export default {
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="其他成本:" prop="otherCost" :show-message="false">
<el-form-item label="包装&运输:" prop="otherCost" :show-message="false">
<el-input-number style="width: 100%; " :controls="false" <el-input-number style="width: 100%; " :controls="false"
v-model="quoteDetail.otherCost" :disabled="quoteDetail.status === '下达'" :step="0" :precision="4" :min="0"/> v-model="quoteDetail.otherCost" :disabled="quoteDetail.status === '下达'" :step="0" :precision="4" :min="0"/>
</el-form-item> </el-form-item>

10
src/views/modules/quote/detail/quoteDetail.vue

@ -89,7 +89,13 @@ export default {
currencyTotalCost2:0, currencyTotalCost2:0,
quoteCurrencyTotalCost1:0, quoteCurrencyTotalCost1:0,
quoteCurrencyTotalCost2:0, quoteCurrencyTotalCost2:0,
moq:'Standard 250K',
// moq:'Standard 250K',
moq:'',
calculatedItems:'工具,测试,其他,包装&运输',
testCost:0,
adjustTestCost:0,
elseCost:0,
adjustElseCost:0,
remark:'', remark:'',
}, },
saveQuoteDetail:{ saveQuoteDetail:{
@ -760,7 +766,7 @@ export default {
<el-tab-pane label="其他" name="other"> <el-tab-pane label="其他" name="other">
<quote-detail-other v-if="saveVisible" v-model:quoteDetail="saveQuoteDetail"></quote-detail-other> <quote-detail-other v-if="saveVisible" v-model:quoteDetail="saveQuoteDetail"></quote-detail-other>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="运输&包装" name="otherCost">
<el-tab-pane label="包装&运输" name="otherCost">
<quote-detail-other-cost v-if="saveVisible" v-model:quoteDetail="saveQuoteDetail"></quote-detail-other-cost> <quote-detail-other-cost v-if="saveVisible" v-model:quoteDetail="saveQuoteDetail"></quote-detail-other-cost>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="成本&价格" name="cost"> <el-tab-pane label="成本&价格" name="cost">

Loading…
Cancel
Save