Browse Source

报价明细

master
zelian_wu 2 years ago
parent
commit
7c2c0a854d
  1. 16
      src/api/quotation/quotationHeader.js
  2. 471
      src/components/quotation/sellForQuotation/quotationDetail.vue
  3. 2
      src/components/quotation/sellForQuotation/quotationExamineAndApprove.vue
  4. 10
      src/views/modules/quotation/sellForQuotation.vue

16
src/api/quotation/quotationHeader.js

@ -20,14 +20,20 @@ export const insertQuotationHeader = (data) => createAPI('/plm/quotationHeader/i
* @param data 请求参数
* @returns {*}
*/
export const searchQuotationTool = (data) => createAPI('/plm/quotationTool/page','get',data);
export const searchQuotationTool = (data) => createAPI('/plm/quotationTool/list','get',data);
/**
* 新增报价工具 记录
* @param data 请求携带参数
* @returns {*}
*/
export const insertQuotationTool = (data) => createAPI('/plm/quotation','post',data);
export const saveQuotationTool = (data) => createAPI('/plm/quotationTool/saveQuotationTool','post',data);
/**
* 删除 报价工具 记录
* @param data
* @returns {*}
*/
export const deleteQuotationTool = (data) => createAPI('/plm/quotationTool/deleteQuotationTool','post',data);
/**
* 分页查询QuotationDetail
@ -41,3 +47,9 @@ export const searchQuotationDetailPageByHeaderId = (data) => createAPI('/plm/quo
* @returns {*}
*/
export const insertQuotationDetail = (data) => createAPI('/plm/quotationDetail/insertQuotationDetail','post',data);
/**
* 修改 QuotationDetail
* @param data
* @returns {*}
*/
export const updateQuotationDetail = (data) => createAPI('/plm/quotationDetail/updateQuotationDetail','post',data);

471
src/components/quotation/sellForQuotation/quotationDetail.vue

@ -2,18 +2,19 @@
<div class="mode-config">
<el-row>
<el-col :span="24">
<el-button type="primary" @click="quotationLeadIntoDetailFlag = true">从询价单导入明细</el-button>
<el-button type="primary" @click="quotationDetailFlag = true">新增报价明细</el-button>
<el-button type="primary">从历史报价明细导入</el-button>
<el-button type="primary" :loading="quotation.quotationHeaderId === undefined">从询价单导入明细</el-button>
<el-button type="primary" :loading="quotation.quotationHeaderId === undefined" @click="quotationLeadIntoDetailFlag = true">新增报价明细</el-button>
<el-button type="primary" :loading="quotation.quotationHeaderId === undefined">从历史报价明细导入</el-button>
</el-col>
<el-col :span="24" style="margin-top: 10px">
<el-table :data="tableData" height="250px" stripe border :header-cell-style="{background:'rgba(23,179,163)',color:'#fff'}">
<el-table-column
label="操作"
fixed
width="60" align="center">
width="90" align="center">
<template slot-scope="scope">
<el-button type="text" style="padding: 0px 10px" size="small">下达</el-button>
<el-link>下达</el-link>
<el-link @click="editQuotationDetail(scope.row)">编辑</el-link>
</template>
</el-table-column>
<el-table-column
@ -123,7 +124,7 @@
width="80" align="center">
</el-table-column>
<el-table-column
label="询价单序号" prop="internalInnquiryNo"
label="询价单序号" prop="internalInquiryNo"
width="80" align="center">
</el-table-column>
<el-table-column
@ -146,34 +147,34 @@
</el-row>
<!--新增报价明细-->
<el-dialog :visible.sync="quotationLeadIntoDetailFlag" title="新增报价明细" width="30%">
<el-form :model="insertQuotationDetailData" label-width="80px" label-position="top" :inline="true">
<el-dialog @open="openInsertQuotationDetail" @close="closeInsertQuotationDetail" :visible.sync="quotationLeadIntoDetailFlag" title="新增报价明细" width="30%">
<el-form :model="insertQuotationDetail" ref="insertQuotationDetailForm" :rules="quotationDetailRules" label-width="80px" label-position="top" :inline="true">
<el-row>
<el-col :span="24">
<el-form-item label="产品编码" style="width: 47%">
<el-input />
<el-form-item label="产品编码" style="width: 47%" prop="productNo">
<el-input v-model="insertQuotationDetail.productNo" clearable/>
</el-form-item>
<el-form-item label="产品名称" style="width: 47%">
<el-input />
<el-form-item label="产品名称" style="width: 47%" prop="productDesc">
<el-input v-model="insertQuotationDetail.productDesc" clearable/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="报价数量" style="width: 47%">
<el-input />
<el-form-item label="报价数量" style="width: 47%" prop="quotationDetailQuantity">
<el-input v-model="insertQuotationDetail.quotationDetailQuantity" clearable/>
</el-form-item>
<el-form-item label="内部询价单号" style="width: 47%">
<el-input />
<el-form-item label="内部询价单号" style="width: 47%" prop="internalInquiryNo">
<el-input v-model="insertQuotationDetail.internalInquiryNo" clearable/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="状态" style="width: 47%">
<el-select style="width: 100%" clearable placeholder="请选择" value="草稿">
<el-form-item label="状态" style="width: 47%" prop="quotationDetailStatus">
<el-select v-model="insertQuotationDetail.quotationDetailStatus" style="width: 100%" clearable placeholder="请选择">
<el-option label="草稿" value="草稿"></el-option>
<el-option label="下达" value="下达"></el-option>
</el-select>
</el-form-item>
<el-form-item label="序号" style="width: 47%">
<el-input />
<el-form-item label="序号" style="width: 47%" prop="itemNo">
<el-input v-model="insertQuotationDetail.itemNo" clearable/>
</el-form-item>
</el-col>
<el-col :span="24">
@ -182,21 +183,21 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" style="display: block;height: 60px">
<el-input type="textarea" :autosize="{minRows: 1, maxRows: 3}"/>
<el-form-item label="备注" style="display: block;height: 60px" prop="remark">
<el-input type="textarea" v-model="insertQuotationDetail.remark" :autosize="{minRows: 1, maxRows: 3}"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer" style="margin-top: 20px">
<el-button @click="quotationLeadIntoDetailFlag = false"> </el-button>
<el-button type="primary" @click="quotationLeadIntoDetailFlag = false"> </el-button>
<el-button type="primary" @click="insertQuotationDetailBtn"> </el-button>
</div>
</el-dialog>
<!--新增-->
<el-dialog @close="closeInsertDialog" :visible.sync="quotationDetailFlag" width="60%" top="2vh">
<el-form :rules="quotationDetailRules" ref="quotationDetailForm" :model="insertQuotationDetailData" label-width="80px" label-position="top" :inline="true">
<el-dialog @open="openQuotationDetailData" @close="closeInsertDialog" :visible.sync="quotationDetailFlag" width="60%" top="2vh">
<el-form :rules="quotationDetailRules" style="margin-top: 5px" ref="quotationDetailForm" :model="quotationDetailData" label-width="80px" label-position="top" :inline="true">
<el-row>
<el-col :span="24">
<el-form-item label="产品编码" prop="productNo">
@ -210,8 +211,8 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="内部询价单号" prop="internalInnquiryNo">
<el-input clearable v-model="quotationDetailData.internalInnquiryNo"/>
<el-form-item label="内部询价单号" prop="internalInquiryNo">
<el-input clearable v-model="quotationDetailData.internalInquiryNo"/>
</el-form-item>
<el-form-item label="状态" prop="quotationDetailStatus">
<el-select v-model="quotationDetailData.quotationDetailStatus" style="width: 100%" clearable placeholder="请选择" value="草稿">
@ -280,22 +281,22 @@
</el-table>
</el-tab-pane>
<el-tab-pane label="工具">
<el-button type="primary" @click="insertQuotationToolFlag = true"> </el-button>
<el-button type="primary" @click="saveQuotationToolFlag = true"> </el-button>
<el-button type="primary">从其他报价单复制</el-button>
<el-table style="margin-top: 5px" :data="quotationToolList" height="400">
<el-table-column label="操作" width="120" align="center">
<template slot-scope="scope">
<el-link style="cursor: pointer">编辑</el-link>
<el-link style="cursor: pointer">删除</el-link>
<el-link style="cursor: pointer" @click="clickEditToolTableBtn(scope.row)">编辑</el-link>
<el-link style="cursor: pointer" @click="clickDeleteToolTableBtn(scope.row)">删除</el-link>
</template>
</el-table-column>
<el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column label="工具编码" align="center"/>
<el-table-column label="工具描述" align="center"/>
<el-table-column label="工具数量" align="center"/>
<el-table-column label="单位成本" align="center"/>
<el-table-column label="预计使用寿命" align="center"/>
<el-table-column label="备注" align="center"/>
<el-table-column width="50" align="center" label="序号" prop="itemNo"/>
<el-table-column label="工具编码" align="center" prop="toolNo"/>
<el-table-column label="工具描述" align="center" prop="toolDescription"/>
<el-table-column label="工具数量" align="center" prop="toolQuantity"/>
<el-table-column label="单位成本" align="center" prop="unitCost"/>
<el-table-column label="预计使用寿命" align="center" prop="expectedServiceLife"/>
<el-table-column label="备注" align="center" prop="remark"/>
</el-table>
</el-tab-pane>
<el-tab-pane label="成品属性">
@ -343,27 +344,27 @@
<el-row>
<el-col :span="4">
<el-form-item label="材料成本:" prop="adjustPartCost">
<el-input v-model="quotationDetailData.adjustPartCost" clearable/>
<el-input v-model="quotationDetailData.adjustPartCost" @input="inputOuterCost" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" :offset="1">
<el-form-item label="机器成本:" prop="adjustMachineCost">
<el-input v-model="quotationDetailData.adjustMachineCost" clearable/>
<el-input v-model="quotationDetailData.adjustMachineCost" @input="inputOuterCost" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" :offset="1">
<el-form-item label="制造费用成本:" prop="adjustFabricateCost">
<el-input v-model="quotationDetailData.adjustFabricateCost" clearable/>
<el-input v-model="quotationDetailData.adjustFabricateCost" @input="inputOuterCost" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" :offset="1">
<el-form-item label="人工成本:" prop="adjustLabourCost">
<el-input v-model="quotationDetailData.adjustLabourCost" clearable/>
<el-input v-model="quotationDetailData.adjustLabourCost" @input="inputOuterCost" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" :offset="1">
<el-form-item label="工具成本:" prop="adjustToolCost">
<el-input v-model="quotationDetailData.adjustToolCost" clearable/>
<el-input v-model="quotationDetailData.adjustToolCost" @input="inputOuterCost" clearable/>
</el-form-item>
</el-col>
</el-row>
@ -376,12 +377,12 @@
<el-row>
<el-col :span="4">
<el-form-item label="管理成本:" prop="detailManageCost">
<el-input v-model="quotationDetailData.detailManageCost" clearable/>
<el-input v-model="quotationDetailData.detailManageCost" @input="inputOuterCost" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" :offset="1">
<el-form-item label="其他成本:" prop="detailOtherCost">
<el-input v-model="quotationDetailData.detailOtherCost" clearable/>
<el-input v-model="quotationDetailData.detailOtherCost" @input="inputOuterCost" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" :offset="1">
@ -399,7 +400,7 @@
<el-row>
<el-col :span="4">
<el-form-item label="利润率%:" prop="detailProfitRate">
<el-input v-model="quotationDetailData.detailProfitRate" />
<el-input v-model="quotationDetailData.detailProfitRate" @input="inputProfitRate" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" :offset="1">
@ -416,25 +417,30 @@
<el-form :rules="rules" ref="priceForm4" :model="quotationDetailData" :inline="true" label-position="top" label-width="120px">
<el-row>
<el-col :span="4">
<el-form-item label="系统计算总金额:" prop="systemComputeAmount">
<el-form-item label="未税总价:" prop="systemComputeAmount">
<el-input v-model="quotationDetailData.systemComputeAmount" disabled/>
</el-form-item>
</el-col>
<el-col :span="4" :offset="1">
<el-form-item label="系统计算价格:" prop="systemComputePrice">
<el-form-item label="含税总价:" prop="systemComputePrice">
<el-input v-model="quotationDetailData.systemComputePrice" disabled/>
</el-form-item>
</el-col>
<el-col :span="4" :offset="1">
<el-form-item label="最终去税价格:" prop="finalUntaxedPrice">
<el-input v-model="quotationDetailData.finalUntaxedPrice" clearable/>
<el-form-item label="未税单价:" prop="finalUntaxedPrice">
<el-input v-model="quotationDetailData.finalUntaxedPrice" disabled clearable/>
</el-form-item>
</el-col>
<el-col :span="4" :offset="1">
<el-form-item label="最终含税价:" prop="finalTaxedPrice">
<el-form-item label="含税价:" prop="finalTaxedPrice">
<el-input v-model="quotationDetailData.finalTaxedPrice" disabled/>
</el-form-item>
</el-col>
<el-col :span="4" :offset="1">
<el-form-item label="税率%:" prop="taxRate">
<el-input v-model="quotationDetailData.taxRate" clearable/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</fieldset>
@ -442,32 +448,32 @@
</el-tabs>
<span slot="footer" class="dialog-footer" style="margin-top: 5px">
<el-button @click=" quotationDetailFlag= false"> </el-button>
<el-button type="primary" @click="quotationDetailFlag = false"> </el-button>
<el-button type="primary" @click="saveQuotationDetail"> </el-button>
</span>
</el-dialog>
<!--quotationTool新增-->
<el-dialog @close="closeQuotationToolDialog" title="新增报价工具" :visible.sync="insertQuotationToolFlag" width="40%" top="10vh">
<el-dialog @close="closeQuotationToolDialog" title="报价工具" :visible.sync="saveQuotationToolFlag" width="40%" top="10vh">
<el-form :rules="quotationToolRules" ref="quotationToolForm" :model="quotationTool" label-position="top" style="height: 260px">
<el-row>
<el-col span="10">
<el-col :span="10">
<el-form-item label="工具编码" prop="toolNo">
<el-input v-model="quotationTool.toolNo" clearable/>
</el-form-item>
</el-col>
<el-col span="10" offset="2">
<el-col :span="10" :offset="2">
<el-form-item label="工具描述" prop="toolDescription">
<el-input v-model="quotationTool.toolDescription" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col span="10">
<el-col :span="10">
<el-form-item label="工具数量" prop="toolQuantity">
<el-input v-model="quotationTool.toolQuantity" clearable/>
</el-form-item>
</el-col>
<el-col span="10" offset="2">
<el-col :span="10" :offset="2">
<el-form-item label="单位成本" prop="unitCost">
<el-input v-model="quotationTool.unitCost" clearable/>
</el-form-item>
@ -479,7 +485,7 @@
<el-input v-model="quotationTool.expectedServiceLife" clearable/>
</el-form-item>
</el-col>
<el-col :span="10" offset="2">
<el-col :span="10" :offset="2">
<el-form-item label="序号" prop="itemNo">
<el-input v-model="quotationTool.itemNo" clearable/>
</el-form-item>
@ -490,18 +496,20 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer" style="margin-top: 5px">
<el-button @click=" insertQuotationToolFlag= false"> </el-button>
<el-button type="primary" @click="insertQuotationToolFlag = false"> </el-button>
<el-button @click=" saveQuotationToolFlag= false"> </el-button>
<el-button type="primary" @click="insertQuotationTool"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
insertQuotationTool,
saveQuotationTool,
searchQuotationTool,
deleteQuotationTool,
searchQuotationDetailPageByHeaderId,
insertQuotationDetail,
updateQuotationDetail,
} from '@/api/quotation/quotationHeader.js';
export default {
props:['quotationHeader'],
@ -518,7 +526,7 @@ export default {
//
quotationDetailFlag:false,
quotationLeadIntoDetailFlag:false,
insertQuotationToolFlag:false,
saveQuotationToolFlag:false,
//
insertQuotationDetailData:{
flag:false,
@ -526,6 +534,7 @@ export default {
activeName:"index",//
materialDataList:[{id:1}],//
quotationTool:{//
quotationToolId:undefined,
site:this.$store.state.user.site,
toolNo:"",
itemNo:undefined,
@ -535,12 +544,28 @@ export default {
expectedServiceLife:undefined,
remark:"",
},
//
insertQuotationDetail:{//
quotationDetailId:undefined,//
quotationHeaderId: undefined,//
site:this.$store.state.user.site,//
productNo:undefined,//
productDesc:undefined,//
quotationDetailQuantity:undefined,//
internalInquiryNo:undefined,//
quotationDetailStatus:"草稿",//
itemNo:undefined,//
taxRate:13,//
remark: undefined,//
},
quotationDetailData:{//
quotationDetailId:undefined,//
quotationHeaderId: undefined,//
site:this.$store.state.user.site,//
productNo:undefined,//
productDesc:undefined,//
quotationDetailQuantity:undefined,//
internalInnquiryNo:undefined,//
internalInquiryNo:undefined,//
quotationDetailStatus:"草稿",//
itemNo:undefined,//
computePartCost:undefined,//
@ -562,20 +587,40 @@ export default {
systemComputePrice:undefined,//
finalUntaxedPrice:undefined,//
finalTaxedPrice:undefined,//
taxRate:13,//
remark: undefined,//
},
//
//
quotationDetailRules:{
productNo:[
{ required: true, message: ' ', trigger: 'change' },
{ required: true, message: ' ', trigger: 'blur' },
],
productDesc:[
{ required: true, message: ' ', trigger: 'change' },
{ required: true, message: ' ', trigger: 'blur' },
],
itemNo:[
{ required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, message: ' ', trigger: 'blur' },
],
quotationDetailStatus:[
{ required: true, message: ' ', trigger: 'change' },
],
internalInquiryNo:[
{ required: true, message: ' ', trigger: 'change' },
{ required: true, message: ' ', trigger: 'blur' },
],
quotationDetailQuantity:[
{ required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur' },
],
},
//
quotationToolRules:{
toolNo:[
{ required: true, message: ' ', trigger: 'change' },
{ required: true, message: ' ', trigger: 'change',label:"工具编号"},
{ required: true, message: ' ', trigger: 'blur' },
],
toolDescription:[
@ -583,16 +628,16 @@ export default {
{ required: true, message: ' ', trigger: 'blur' },
],
toolQuantity:[
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur' },
],
unitCost:[
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur' },
],
expectedServiceLife:[
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur' },
],
itemNo:[
{ required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, message: ' ', trigger: 'change' },
@ -602,42 +647,69 @@ export default {
//
rules: {
detailProfitRate: [
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' },
{ required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, message: ' ', trigger: 'blur' },
],
adjustPartCost: [
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur' },
],
adjustMachineCost: [
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur' },
],
adjustFabricateCost: [
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur' },
],
adjustLabourCost: [
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur' },
],
adjustToolCost: [
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur' },
],
detailManageCost: [
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur' },
],
detailOtherCost: [
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur' },
],
finalUntaxedPrice: [
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^[0-9]+(.[0-9]{2})?$/, message: ' ', trigger: 'blur' },
taxRate: [
{ required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, message: ' ', trigger: 'change' },
{ required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, message: ' ', trigger: 'blur' },
],
}
},
//
quotationDetailColumns:[
{label:"productNo",value:"产品编码"},
{label:"productDesc",value:"产品名称"},
{label:"quotationDetailQuantity",value:"报价数量"},
{label:"internalInquiryNo",value:"内部询价单号"},
{label:"quotationDetailStatus",value:"报价状态"},
{label:"itemNo",value:"序号"},
{label:"adjustPartCost",value:"调整后的材料成本"},
{label:"adjustMachineCost",value:"调整后的机器成本"},
{label:"adjustFabricateCost",value:"调整后的制造费用"},
{label:"adjustLabourCost",value:"调整后人的工成本"},
{label:"adjustToolCost",value:"调整后的工具成本"},
{label:"detailManageCost",value:"管理成本"},
{label:"detailOtherCost",value:"其他成本"},
{label:"detailProfitRate",value:"利润率"},
{label:"finalUntaxedPrice",value:"最终去税价格"},
],
//
quotationToolColumns:[
{label:"toolNo", value:"工具编码",},
{label: "toolDescription", value: "工具描述",},
{label: "toolQuantity", value: "工具数量",},
{label: "unitCost", value: "单位成本",},
{label: "expectedServiceLife", value: "预计使用寿命",},
{label: "itemNo", value: "序号",}
],
}
},
computed:{
@ -651,6 +723,44 @@ export default {
}
},
methods:{
//
saveQuotationDetail(){
//
let flag = true;
this.$refs['quotationDetailForm'].validate((validate,objects)=>{
if (!validate){
flag = false;
this.rulesValidateLabel(objects,this.quotationDetailColumns);
}
});
if (!flag){
return
}
//
for (let i = 1; i <= 4; i++) {
this.$refs['priceForm'+i].validate((validate,objects)=>{
if (!validate){
flag = false;
this.rulesValidateLabel(objects,this.quotationDetailColumns);
}
});
if (!flag){
return
}
}
if (flag){
//
updateQuotationDetail(this.quotationDetailData).then(({data})=>{
if (data.code == 200){
this.quotationDetailFlag = false;
this.initData();
this.$message.success(data.msg);
}else {
this.$message.error(data.msg);
}
})
}
},
initData(){
let params = {
no:this.no,
@ -674,9 +784,20 @@ export default {
this.no = val;
this.initData();
},
//
//
openQuotationDetailData(){
this.initQuotationToolData();
this.initQuotationRoutingData();
this.initQuotationPart();
},
//
closeInsertDialog(){
this.activeName = "index";
//
this.quotationToolList = [];
this.quotationDetailData = {};
this.quotationDetailData.computeToolCost = undefined;
//
for (let i = 1; i <= 4; i++) {
this.$refs['priceForm'+i].resetFields();
}
@ -685,6 +806,176 @@ export default {
//
closeQuotationToolDialog(){
this.$refs['quotationToolForm'].resetFields();
},
//
//
//
//
insertQuotationDetailBtn(){
this.$refs['insertQuotationDetailForm'].validate((validate,objects)=>{
if (validate){
insertQuotationDetail(this.insertQuotationDetail).then(({data})=>{
if (data.code == 200){
this.quotationLeadIntoDetailFlag = false;
//
if (this.insertQuotationDetailData.flag){
this.quotationDetailData = data.data;
this.quotationDetailFlag = true;
}
this.initData();
this.$message.success(data.msg);
}else {
this.$message.error(data.msg);
}
})
}else {
this.rulesValidateLabel(objects,this.quotationDetailColumns);
}
})
},
//
closeInsertQuotationDetail(){
this.$refs['insertQuotationDetailForm'].resetFields();
this.insertQuotationDetailData.flag = false;
},
//
openInsertQuotationDetail(){
this.insertQuotationDetail.quotationHeaderId = this.quotation.quotationHeaderId;
this.insertQuotationDetail.internalInquiryNo = this.quotation.internalInquiryNo;
},
//
editQuotationDetail(row){
this.quotationDetailData = JSON.parse(JSON.stringify(row));
this.quotationDetailFlag = true;
},
//
initQuotationPart(){
let total = 0;
this.quotationDetailData.computePartCost = total;
this.quotationDetailData.adjustPartCost = total;
this.inputProfitRate();
this.inputOuterCost();
},
//
initQuotationRoutingData(){
let total = 0;
this.quotationDetailData.computeMachineCost = total;
this.quotationDetailData.adjustMachineCost = total;
this.quotationDetailData.computeFabricateCost = total;
this.quotationDetailData.adjustFabricateCost = total;
this.quotationDetailData.computeLabourCost = total;
this.quotationDetailData.adjustLabourCost = total;
this.inputProfitRate();
this.inputOuterCost();
},
//
initQuotationToolData(){
let params = {
quotationDetailId:this.quotationDetailData.quotationDetailId,
}
searchQuotationTool(params).then(({data})=>{
if (data.code == 200){
this.quotationToolList = data.data;
let total = this.quotationToolList.reduce((total,currentValue)=>{
return total + currentValue.toolQuantity*currentValue.unitCost;
},0);
this.quotationDetailData.computeToolCost = total;
this.quotationDetailData.adjustToolCost = total;
this.inputProfitRate();
this.inputOuterCost();
}
})
},
// i
insertQuotationTool(){
this.$refs['quotationToolForm'].validate((validate,object)=>{
if (validate){
this.quotationTool.quotationDetailId = this.quotationDetailData.quotationDetailId;
saveQuotationTool(this.quotationTool).then(({data})=>{
if (data.code == 200){
this.saveQuotationToolFlag = false;
this.initQuotationToolData();
this.$message.success(data.msg);
}else {
this.$message.error(data.msg);
}
})
}else {
this.rulesValidateLabel(object,this.quotationToolColumns);
}
})
},
//
clickDeleteToolTableBtn(row){
deleteQuotationTool(row).then(({data})=>{
if (data.code == 200){
this.initQuotationToolData();
this.$message.success(data.msg);
}else {
this.$message.error(data.msg);
}
})
},
//
clickEditToolTableBtn(row){
this.quotationTool = JSON.parse(JSON.stringify(row));
this.saveQuotationToolFlag = true;
},
//
inputProfitRate(){
this.quotationDetailData.detailProfitAmount = 0;
if (this.quotationDetailData.detailProfitRate){
let num = (this.quotationDetailData.detailTotalCost*(this.quotationDetailData.detailProfitRate/100));
Math.round(num* 100) / 100.
num = num.toFixed(2);
this.quotationDetailData.detailProfitAmount = num;
}
//
this.quotationDetailData.systemComputeAmount += (+this.quotationDetailData.detailTotalCost + +this.quotationDetailData.detailProfitAmount);
},
//
inputOuterCost(){
this.quotationDetailData.detailTotalCost = 0;
if (this.quotationDetailData.adjustPartCost){
this.quotationDetailData.detailTotalCost += +this.quotationDetailData.adjustPartCost;
}
if (this.quotationDetailData.adjustLabourCost){
this.quotationDetailData.detailTotalCost += +this.quotationDetailData.adjustLabourCost;
}
if (this.quotationDetailData.adjustFabricateCost){
this.quotationDetailData.detailTotalCost += +this.quotationDetailData.adjustFabricateCost;
}
if (this.quotationDetailData.adjustToolCost){
this.quotationDetailData.detailTotalCost += +this.quotationDetailData.adjustToolCost;
}
if (this.quotationDetailData.adjustMachineCost){
this.quotationDetailData.detailTotalCost += +this.quotationDetailData.adjustMachineCost;
}
if (this.quotationDetailData.detailManageCost){
this.quotationDetailData.detailTotalCost += +this.quotationDetailData.detailManageCost;
}
if (this.quotationDetailData.detailOtherCost){
this.quotationDetailData.detailTotalCost += +this.quotationDetailData.detailOtherCost;
}
//
this.quotationDetailData.systemComputeAmount += (+this.quotationDetailData.detailTotalCost + +this.quotationDetailData.detailProfitAmount);
},
/**
* 校验处理
* @param objects 校验未通过属性
* @param labels 中午字解
*/
rulesValidateLabel(objects,labels){
for (let filed in objects) {
for (let i = 0; i < labels.length; i++) {
let quotationToolColumn = labels[i];
if (quotationToolColumn.label === filed){
this.$message.warning("请填写:"+quotationToolColumn.value);
return
}
}
}
}
},
created() {

2
src/components/quotation/sellForQuotation/quotationExamineAndApprove.vue

@ -5,7 +5,7 @@
</template>
<script>
export default {
name: "quotationExamineAndApprove.vue"
name: "quotationExamineAndApprove"
}
</script>

10
src/views/modules/quotation/sellForQuotation.vue

@ -52,6 +52,7 @@
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="changeDateRange"
placeholder="选择日期">
</el-date-picker>
@ -457,8 +458,13 @@ export default {
},
// change
changeDateRange(){
this.searchData.startDate = this.searchData.dateValue[0];
this.searchData.endDate = this.searchData.dateValue[1];
if (this.searchData.dateValue){
this.searchData.startDate = this.searchData.dateValue[0];
this.searchData.endDate = this.searchData.dateValue[1];
}else {
this.searchData.startDate="";
this.searchData.endDate="";
}
},
//
initData(){

Loading…
Cancel
Save