Browse Source

2024-03-14 报价修改

master
zelian_wu 2 years ago
parent
commit
d95ac535ad
  1. 1
      src/api/base/site.js
  2. 7
      src/api/quotation/quoteOfBom.js
  3. 3
      src/api/quotation/quoteOfRouting.js
  4. 14
      src/views/modules/base/factoryInformation.vue
  5. 517
      src/views/modules/quotation/sellForQuotation.vue
  6. 379
      src/views/modules/quotation/sellForQuotation/quotationDetail/billOfMateriel.vue
  7. 341
      src/views/modules/quotation/sellForQuotation/quotationDetail/costPrice.vue
  8. 206
      src/views/modules/quotation/sellForQuotation/quotationDetail/propertyTemplates.vue
  9. 73
      src/views/modules/quotation/sellForQuotation/quotationDetail/quoteRouting.vue
  10. 532
      src/views/modules/quotation/sellForQuotation/quotationDetail/toolQuotation.vue
  11. 604
      src/views/modules/quotation/sellForQuotation/quoteDetail.vue

1
src/api/base/site.js

@ -8,6 +8,7 @@ export const getCompanyData = data => createAPI(`/base/getCompanyData`,'post',da
// 保存修改工厂信息数据
export const siteSave = data => createAPI(`/base/siteSave`,'post',data)
export const siteList = data => createAPI(`/base/site/list`,'post',data)
//------------物料分类部分----------------
// 获取工厂信息数据

7
src/api/quotation/quoteOfBom.js

@ -0,0 +1,7 @@
import {createAPI} from "../../utils/httpRequest";
export const getBomTreeStructure = (data)=>createAPI(`/quote/bom/tree/list`,'get',data);
export const updateQuoteBomList = (data)=>createAPI(`/quote/bom/update`,'post',data);
export const searchQuoteBomList = (data)=>createAPI(`/quote/bom/list`,'post',data);
export const searchQuoteBomHeader = (data)=>createAPI(`/quote/bom/header`,'get',data);

3
src/api/quotation/quoteOfRouting.js

@ -0,0 +1,3 @@
import {createAPI} from "../../utils/httpRequest";
export const getBomTreeStructure = (data)=>createAPI(`/quote/routing/tree/list`,'get',data);

14
src/views/modules/base/factoryInformation.vue

@ -184,6 +184,7 @@ import {
getTableUserListLanguage,
} from "@/api/table.js"
import Chooselist from '@/views/modules/common/Chooselist'
import {siteList} from "../../../api/base/site";
var functionId = '100001002';
@ -959,7 +960,18 @@ export default {
})
},
getSiteDataDemo(params){
this.$message.success("这里是Site")
params.no = 1
params.size = 1
// this.$message.success(params)
siteList(params).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg)
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
}
},
created() {

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

@ -1,104 +1,67 @@
<template>
<template xmlns="http://www.w3.org/1999/html">
<div class="mode-config">
<el-form label-position="top" :model="searchData">
<el-row :gutter="18">
<el-col :span="2">
<el-form-item label="客户编码">
<el-input v-model="searchData.customerNo" clearable />
</el-form-item>
</el-col>
<el-col :span="2">
<el-form-item label="客户名称">
<el-input v-model="searchData.customerName" clearable />
</el-form-item>
</el-col>
<el-col :span="2">
<el-form-item label="跟单员">
<el-input v-model="searchData.trackerName" clearable/>
</el-form-item>
</el-col>
<el-col :span="2">
<el-form-item label="报价单号">
<el-input v-model="searchData.quotationNo" clearable />
</el-form-item>
</el-col>
<el-col :span="2">
<el-form-item label="客户询价单号">
<el-input v-model="searchData.customerInquiryNo" clearable />
</el-form-item>
</el-col>
<el-col :span="2">
<el-form-item label="内部询价单号">
<el-input v-model="searchData.internalInquiryNo" clearable/>
</el-form-item>
</el-col>
<el-col :span="2">
<el-form-item label="状态">
<el-select v-model="searchData.quotationStatus">
<el-option label="全部" value=""></el-option>
<el-option label="草稿" value="草稿"></el-option>
<el-option label="下达" value="下达"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="18">
<el-col :span="2">
<el-form-item label="项目编码">
<el-input v-model="searchData.projectId" clearable />
</el-form-item>
</el-col>
<el-col :span="2">
<el-form-item label="项目名称">
<el-input v-model="searchData.projectName" clearable/>
</el-form-item>
</el-col>
<el-col :span="2">
<el-form-item label="报价专员">
<el-input v-model="searchData.quoterName" size="large" clearable/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-row>
<el-col :span="11">
<el-form-item label="开始日期">
<el-date-picker
value-format="yyyy-MM-dd"
style="width: 100%"
v-model="searchData.startDate"
type="date"
placeholder="开始日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="2">
<el-form-item label=" ">
<svg t="1701739447362" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8471" id="mx_n_1701739447363" width="20" height="20"><path d="M524.288 804.864l444.416-294.912-444.416-294.912v143.36H81.92V655.36h442.368v149.504z m0 0" p-id="8472"></path></svg>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="结束日期">
<el-date-picker
value-format="yyyy-MM-dd"
style="width: 100%"
v-model="searchData.endDate"
type="date"
placeholder="结束日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="4">
<el-form-item label=" ">
<el-button plain type="primary" @click="initDataBtn" @keyup.enter.native="initDataBtn"> </el-button>
<el-button type="primary" @click="insertDiaLogFlag = true"> </el-button>
</el-form-item>
</el-col>
</el-row>
<el-form label-position="top" :inline="true" :model="searchData">
<el-form-item label="客户编码">
<el-input v-model="searchData.customerNo" clearable />
</el-form-item>
<el-form-item label="客户名称">
<el-input v-model="searchData.customerName" clearable />
</el-form-item>
<el-form-item label="跟单员">
<el-input v-model="searchData.trackerName" clearable/>
</el-form-item>
<el-form-item label="报价单号">
<el-input v-model="searchData.quotationNo" clearable />
</el-form-item>
<el-form-item label="客户询价单号">
<el-input v-model="searchData.customerInquiryNo" clearable />
</el-form-item>
<el-form-item label="内部询价单号">
<el-input v-model="searchData.internalInquiryNo" clearable/>
</el-form-item>
<br/>
<el-form-item label="项目编码">
<el-input v-model="searchData.projectId" clearable />
</el-form-item>
<el-form-item label="项目名称">
<el-input v-model="searchData.projectName" clearable/>
</el-form-item>
<el-form-item label="报价专员">
<el-input v-model="searchData.quoterName" clearable/>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="searchData.quotationStatus">
<el-option label="全部" value=""></el-option>
<el-option label="草稿" value="草稿"></el-option>
<el-option label="下达" value="下达"></el-option>
</el-select>
</el-form-item>
<el-form-item label="开始日期">
<el-date-picker
value-format="yyyy-MM-dd"
v-model="searchData.startDate"
style="width: 140px"
type="date"
placeholder="开始日期">
</el-date-picker>
</el-form-item>
<el-form-item label=" " style="width: 0px;margin-right: 0px">
<label style="margin-left: -10px;font-size: 12px">&#10142</label>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker
value-format="yyyy-MM-dd"
style="width: 140px"
v-model="searchData.endDate"
type="date"
placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label=" ">
<el-button plain type="primary" @click="initDataBtn" @keyup.enter.native="initDataBtn"> </el-button>
<el-button type="primary" @click="insertDiaLogFlag = true"> </el-button>
</el-form-item>
</el-form>
<!-- 表格 和上述搜索框对应 -->
<el-table :data="tableData" v-loading="initQuotationHeaderLoading" element-loading-text = "数据正在加载中"
element-loading-spinner = "el-icon-loading" @row-click="rowClickQuotation" stripe border style="width: 100%;margin-top: 12px" :height="height">
<el-table-column
@ -114,86 +77,20 @@
</template>
</el-table-column>
<el-table-column
align="center"
prop="quotationNo"
label="报价单号"
show-overflow-tooltip>
<template slot-scope="{row,$index}">
{{row.quotationNo+'-'+row.versionCode}}
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed===''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope" >
<span v-if="!item.columnHidden"> {{ `${scope.row[item.columnProp]}${index === 0?("-"+scope.row['versionCode']):''}` }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
align="center"
prop="quotationDate"
label="报价日期"
show-overflow-tooltip>
</el-table-column>
<el-table-column
align="center"
prop="customerNo"
show-overflow-tooltip
label="客户编码">
</el-table-column>
<el-table-column
align="left"
prop="customerName"
show-overflow-tooltip
label="客户名称">
</el-table-column>
<el-table-column
align="center"
prop="projectId"
show-overflow-tooltip
label="项目编码">
</el-table-column>
<el-table-column
align="left"
prop="projectName"
show-overflow-tooltip
label="项目名称">
</el-table-column>
<el-table-column
align="left"
prop="quoterName"
show-overflow-tooltip
label="报价专员">
</el-table-column>
<el-table-column
align="left"
prop="trackerName"
show-overflow-tooltip
label="跟单员">
</el-table-column>
<el-table-column
align="left"
prop="currency"
show-overflow-tooltip
label="货币">
</el-table-column>
<el-table-column
align="center"
prop="quotationStatus"
show-overflow-tooltip
label="状态">
</el-table-column>
<el-table-column
align="left"
prop="remark"
show-overflow-tooltip
label="备注">
</el-table-column>
<el-table-column
align="center"
prop="customerInquiryNo"
show-overflow-tooltip
label="客户询价单号">
</el-table-column>
<el-table-column
align="center"
prop="internalInquiryNo"
show-overflow-tooltip
label="内部询价单号">
</el-table-column>
</el-table>
<!-- 分页插件 -->
<el-pagination style="margin-top: 0px"
@ -207,10 +104,13 @@
</el-pagination>
<!-- 标签页 -->
<el-tabs v-model="activeTabName" @tab-click="handleClickTab"
style="box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);border: 2px;min-height: 440px;margin-top: 5px;padding: 5px">
<el-tab-pane label="报价明细" name="quotation_detail">
style="box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);border: 2px;min-height: 440px;margin-top: 5px;">
<el-tab-pane label="报价明细" name="quotation_detail" v-if="false">
<quotation-detail :quotation-header="quotationHeader"></quotation-detail>
</el-tab-pane>
<el-tab-pane label="报价明细" name="quote_detail">
<quote-detail :header="quotationHeader"></quote-detail>
</el-tab-pane>
<el-tab-pane label="报价审批" name="quotation_examine_and_approve">
<quotation-examine-and-approve></quotation-examine-and-approve>
</el-tab-pane>
@ -226,8 +126,8 @@
</el-tabs>
<!-- 新增弹框 -->
<el-dialog title="新增报价" v-drag @close="closeInsertDialog" :close-on-click-modal="false" v-drag :visible.sync="insertDiaLogFlag" width="40%">
<el-form :rules="rules" label-position="top" ref="insertQuotationForm" :model="insertData"
<el-dialog title="新增报价" @close="closeInsertDialog" :close-on-click-modal="false" v-drag :visible.sync="insertDiaLogFlag" width="40%">
<el-form :rules="rules" :inline-message="true" label-position="top" ref="insertQuotationForm" :model="insertData"
label-width="120px">
<el-row>
<el-col :span="8">
@ -245,35 +145,35 @@
<el-row>
<el-col :span="8">
<el-form-item prop="customerNo" label="客户编码">
<span slot="label" style="" v-if="insertData.internalInquiryNo ==''" @click="getBaseList(102,1)"><a herf="#">客户编码</a></span>
<el-input v-model="insertData.customerNo" :disabled="insertData.internalInquiryNo !=''" placeholder="请输入内容" clearable />
<span slot="label" style="" v-if="insertData.internalInquiryNo ===''" @click="getBaseList(102,1)"><a herf="#">客户编码</a></span>
<el-input v-model="insertData.customerNo" :disabled="insertData.internalInquiryNo !==''" placeholder="请输入内容" clearable />
</el-form-item>
</el-col>
<el-col :span="12" :offset="2">
<el-form-item prop="customerName" label="客户名称">
<span slot="label" style="" v-if="insertData.internalInquiryNo ==''" @click="getBaseList(102,1)"><a herf="#">客户名称</a></span>
<el-input v-model="insertData.customerName" :disabled="insertData.internalInquiryNo !=''" placeholder="请输入内容" clearable/>
<span slot="label" style="" v-if="insertData.internalInquiryNo ===''" @click="getBaseList(102,1)"><a herf="#">客户名称</a></span>
<el-input v-model="insertData.customerName" :disabled="insertData.internalInquiryNo !==''" placeholder="请输入内容" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item prop="projectId" label="项目编码">
<span slot="label" style="" v-if="insertData.internalInquiryNo ==''" @click="getBaseList(104,1)"><a herf="#">项目编码</a></span>
<el-input v-model="insertData.projectId" :disabled="insertData.internalInquiryNo !=''" placeholder="请输入内容" clearable />
<span slot="label" style="" v-if="insertData.internalInquiryNo ===''" @click="getBaseList(104,1)"><a herf="#">项目编码</a></span>
<el-input v-model="insertData.projectId" :disabled="insertData.internalInquiryNo !==''" placeholder="请输入内容" clearable />
</el-form-item>
</el-col>
<el-col :span="12" :offset="2">
<el-form-item prop="projectName" label="项目名称">
<span slot="label" style="" v-if="insertData.internalInquiryNo ==''" @click="getBaseList(104,1)"><a herf="#">项目名称</a></span>
<el-input v-model="insertData.projectName" :disabled="insertData.internalInquiryNo !=''" placeholder="请输入内容" clearable />
<span slot="label" style="" v-if="insertData.internalInquiryNo ===''" @click="getBaseList(104,1)"><a herf="#">项目名称</a></span>
<el-input v-model="insertData.projectName" :disabled="insertData.internalInquiryNo !==''" placeholder="请输入内容" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="货币" prop="currency">
<el-input v-model="insertData.currency" :disabled="insertData.internalInquiryNo !=''" placeholder="请输入内容" clearable />
<el-input v-model="insertData.currency" :disabled="insertData.internalInquiryNo !==''" placeholder="请输入内容" clearable />
</el-form-item>
</el-col>
<el-col :span="12" :offset="2">
@ -301,8 +201,8 @@
<el-col :span="12" :offset="2">
<el-form-item label="跟单员">
<!-- <el-form-item prop="tracker" label="跟单员">-->
<span slot="label" style="" v-if="insertData.internalInquiryNo ==''" @click="getBaseList(103,1)"><a herf="#">跟单员</a></span>
<el-input v-model="insertData.trackerName" :disabled="insertData.internalInquiryNo !=''" @clear="clearTracker" placeholder="请输入内容" clearable />
<span slot="label" style="" v-if="insertData.internalInquiryNo ===''" @click="getBaseList(103,1)"><a herf="#">跟单员</a></span>
<el-input v-model="insertData.trackerName" :disabled="insertData.internalInquiryNo !==''" @clear="clearTracker" placeholder="请输入内容" clearable />
</el-form-item>
</el-col>
</el-row>
@ -321,7 +221,7 @@
</el-dialog>
<!--询价单号选择弹框-->
<el-dialog title="内部询价单号" v-drag
<el-dialog title="内部询价单号"
@close="closeQuotationNoDialog"
@open="openQuotationNoDialog"
:visible.sync="quotationNoDialogFlag"
@ -375,8 +275,10 @@ import {
import {
searchQuotationByQuotationNo,
} from '@/api/quotation/quotationInformation.js';
import QuoteDetail from "./sellForQuotation/quoteDetail.vue";
export default {
components:{
QuoteDetail,
Chooselist,
quotationDetail,
quotationExamineAndApprove,
@ -386,7 +288,6 @@ export default {
},
data () {
return {
searchFlag:false,
//
searchData:{
site:this.$store.state.user.site,//
@ -402,6 +303,222 @@ export default {
dateValue:[],//
},
tableData: [],//
columnList: [
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table5QuotationNo',
tableId: '101002001Table5',
tableName: '报价信息表',
columnProp: 'quotationNo',
headerAlign: 'center',
align: 'center',
columnLabel: '报价单号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table5QuotationDate',
tableId: '101002001Table5',
tableName: '报价信息表',
columnProp: 'quotationDate',
headerAlign: 'center',
align: 'center',
columnLabel: '报价日期',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table5CustomerNo',
tableId: '101002001Table5',
tableName: '报价信息表',
columnProp: 'customerNo',
headerAlign: 'center',
align: 'center',
columnLabel: '客户编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table5CustomerName',
tableId: '101002001Table5',
tableName: '报价信息表',
columnProp: 'customerName',
headerAlign: 'center',
align: 'center',
columnLabel: '客户名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table5ProjectId',
tableId: '101002001Table5',
tableName: '报价信息表',
columnProp: 'projectId',
headerAlign: 'center',
align: 'center',
columnLabel: '项目编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table5ProjectName',
tableId: '101002001Table5',
tableName: '报价信息表',
columnProp: 'projectName',
headerAlign: 'center',
align: 'center',
columnLabel: '项目名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table5QuoterName',
tableId: '101002001Table5',
tableName: '报价信息表',
columnProp: 'quoterName',
headerAlign: 'center',
align: 'center',
columnLabel: '销售员',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table5TrackerName',
tableId: '101002001Table5',
tableName: '报价信息表',
columnProp: 'trackerName',
headerAlign: 'center',
align: 'center',
columnLabel: '跟单员',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table5Currency',
tableId: '101002001Table5',
tableName: '报价信息表',
columnProp: 'currency',
headerAlign: 'center',
align: 'center',
columnLabel: '货币',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table5QuotationStatus',
tableId: '101002001Table5',
tableName: '报价信息表',
columnProp: 'quotationStatus',
headerAlign: 'center',
align: 'center',
columnLabel: '状态',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001CustomerInquiryNo',
tableId: '101002001Table5',
tableName: '报价信息表',
columnProp: 'customerInquiryNo',
headerAlign: 'center',
align: 'center',
columnLabel: '客户报价单号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001InternalInquiryNo',
tableId: '101002001Table5',
tableName: '报价信息表',
columnProp: 'internalInquiryNo',
headerAlign: 'center',
align: 'center',
columnLabel: '内部报价单号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
],
initQuotationHeaderLoading:false,//
//
no:1,//
@ -517,20 +634,10 @@ export default {
methods: {
// quotation
rowClickQuotation(row,column,event){
if (column.label != '操作'){
if (column.label !== '操作'){
this.quotationHeader = row;
}
},
// change
changeDateRange(){
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="";
}
},
//
initDataBtn(){
this.$route.params.ids = null;

379
src/views/modules/quotation/sellForQuotation/quotationDetail/billOfMateriel.vue

@ -0,0 +1,379 @@
<script>
import {getBomTreeStructure, searchQuoteBomList, updateQuoteBomList} from '../../../../../api/quotation/quoteOfBom'
import {Decimal} from "decimal.js";
export default {
name:'billOfMateriel',
props:{
detail:{
type:Object,
request:true,
},
height:{
type:Number,
default:400,
}
},
data(){
return{
treeLoading:false,
bomTreeStructure:[],
bomProps:{
label:'label',
value:'value',
children:'list'
},
dataListLoading:false,
bomDetailList:[],
selectBom:[],
copyBom:[],
columnDetailList:[
{
userId: this.$store.state.user.name,
functionId: 101009001,
serialNumber: '101009001Table9LineSequence',
tableId: "101002001Table9",
tableName: "报价材料信息",
columnProp: 'lineSequence',
headerAlign: "center",
align: "center",
columnLabel: '序号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 50,
},{
userId: this.$store.state.user.name,
functionId: 101009001,
serialNumber: '101009001Table9ComponentPart',
tableId: "101002001Table9",
tableName: "报价材料信息",
columnProp: 'componentPart',
headerAlign: "center",
align: "center",
columnLabel: '物料编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},{
userId: this.$store.state.user.name,
functionId: 101009001,
serialNumber: '101009001Table9ComponentPartDesc',
tableId: "101002001Table9",
tableName: "报价材料信息",
columnProp: 'componentPartDesc',
headerAlign: "center",
align: "left",
columnLabel: '物料名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 140,
},{
userId: this.$store.state.user.name,
functionId: 101009001,
serialNumber: '101009001Table9QtyPerAssembly',
tableId: "101002001Table9",
tableName: "报价材料信息",
columnProp: 'qtyPerAssembly',
headerAlign: "center",
align: "right",
columnLabel: '单位用量',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 90,
},{
userId: this.$store.state.user.name,
functionId: 101009001,
serialNumber: '101009001Table9ComponentScrap',
tableId: "101002001Table9",
tableName: "报价材料信息",
columnProp: 'componentScrap',
headerAlign: "center",
align: "right",
columnLabel: '调机用量',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 90,
},{
userId: this.$store.state.user.name,
functionId: 101009001,
serialNumber: '101009001Table9ShrinkageFactor',
tableId: "101002001Table9",
tableName: "报价材料信息",
columnProp: 'shrinkageFactor',
headerAlign: "center",
align: "right",
columnLabel: '损耗率%',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 90,
},{
userId: this.$store.state.user.name,
functionId: 101009001,
serialNumber: '101009001Table9PrintUnitName',
tableId: "101002001Table9",
tableName: "报价材料信息",
columnProp: 'printUnitName',
headerAlign: "center",
align: "center",
columnLabel: '单位',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 90,
},{
userId: this.$store.state.user.name,
functionId: 101009001,
serialNumber: '101009001Table9NoteText',
tableId: "101002001Table9",
tableName: "报价材料信息",
columnProp: 'noteText',
headerAlign: "center",
align: "center",
columnLabel: '备注',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 90,
},{
userId: this.$store.state.user.name,
functionId: 101009001,
serialNumber: '101009001Table9UnitCost',
tableId: "101002001Table9",
tableName: "报价材料信息",
columnProp: 'unitCost',
headerAlign: "center",
align: "right",
columnLabel: '单位成本',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 90,
},{
userId: this.$store.state.user.name,
functionId: 101009001,
serialNumber: '101009001Table9QuoteUnitCost',
tableId: "101002001Table9",
tableName: "报价材料信息",
columnProp: 'quoteUnitCost',
headerAlign: "center",
align: "right",
columnLabel: '单位报价成本',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: 'right',
columnWidth: 90,
},
],
}
},
methods:{
getInventoryPartBom(){
//
let params = {
site:this.detail.site,
testPartNo:this.detail.productNo
}
this.treeLoading = true
getBomTreeStructure(params).then(({data})=>{
if (data && data.code === 0){
this.bomTreeStructure = data.rows;
this.$nextTick(()=>{
this.$refs.tree.setCurrentKey(`${this.selectBom[0]}-${this.selectBom[1]}-${this.selectBom[2]}`)
})
}else {
this.$message.warning(data.msg)
}
this.treeLoading = false;
}).catch((error)=>{
this.$message.error(error)
this.treeLoading = false;
})
},
changeSelect(val){
if (this.selectBom.length === 0){
this.updateQuoteBomList();
return
}
this.$confirm('此操作将更换材料信息, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.updateQuoteBomList();
}).catch(() => {
this.selectBom = JSON.parse(JSON.stringify(this.copyBom))
this.$nextTick(()=>{
this.$refs.tree.setCurrentKey(`${this.selectBom[0]}-${this.selectBom[1]}-${this.selectBom[2]}`)
})
});
},
updateQuoteBomList(){
let params = {
site:this.$store.state.user.site,
testPartNo: this.detail.productNo,
version:this.selectBom[0],
bomType:this.selectBom[1],
alternativeNo:this.selectBom[2],
quoteDetailId:this.detail.quotationDetailId
}
updateQuoteBomList(params).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg)
this.searchQuoteBomList();
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
},
setSelectBom(val){
if (val.length === 0){
this.getInventoryPartBom();
return
}
this.selectBom = JSON.parse(JSON.stringify(val))
this.getInventoryPartBom();
this.searchQuoteBomList();
},
searchQuoteBomList(){
let params = {
site:this.$store.state.user.site,
testPartNo: this.detail.productNo,
version:this.selectBom[0],
bomType:this.selectBom[1],
alternativeNo:this.selectBom[2],
quoteDetailId:this.detail.quotationDetailId
}
this.dataListLoading = true;
searchQuoteBomList(params).then(({data})=>{
if (data && data.code === 0){
this.bomDetailList = data.rows
this.computedQuoteBomCost();
}else {
this.$message.warning(data.msg)
}
this.dataListLoading = false;
}).catch((error)=>{
this.dataListLoading = false;
this.$message.error(error)
})
},
computedQuoteBomCost(){
for (let i = 0; i < this.bomDetailList.length; i++) {
let bomDetail = this.bomDetailList[i]
//
let unitCost = new Decimal(bomDetail.unitCost);
//
let componentScrap = new Decimal(bomDetail.componentScrap)
//
let qtyPerAssembly = new Decimal(bomDetail.qtyPerAssembly)
//
let shrinkageFactor = new Decimal(bomDetail.shrinkageFactor)
//
let num = new Decimal(this.detail.quotationDetailQuantity)
let needNum = componentScrap.div(num).add(qtyPerAssembly.mul(new Decimal(100).sub(shrinkageFactor)).div(new Decimal(100)))
bomDetail.quoteUnitCost = new Decimal(needNum.mul(unitCost).toFixed(16,Decimal.ROUND_HALF_UP)).toSignificantDigits().toNumber()
}
},
getQuoteBomCost(){
this.searchQuoteBomList();
return this.bomDetailList.reduce((total, currentValue) => {
return total + new Decimal(currentValue.quoteUnitCost).toNumber();
}, 0)
},
nodeClick(val){
if (val.list){
this.$nextTick(()=>{
this.$refs.tree.setCurrentKey(`${this.selectBom[0]}-${this.selectBom[1]}-${this.selectBom[2]}`)
})
return
}
let arr = val.value.split('-');
arr[0] = parseInt(arr[0])
this.copyBom = JSON.parse(JSON.stringify(this.selectBom))
this.selectBom = JSON.parse(JSON.stringify(arr))
if (this.copyBom[0] !== this.selectBom[0] || this.copyBom[1] !== this.selectBom[1] || this.copyBom[2] !== this.selectBom[2]){
this.changeSelect()
}
}
}
}
</script>
<template>
<div>
<el-container>
<el-aside width="24%" style="padding: 0;" :style="{height: height}" v-loading="treeLoading">
<el-tree :data="bomTreeStructure"
:props="bomProps"
@node-click="nodeClick"
node-key="value" style="height: 100%"
default-expand-all
:current-node-key="`${selectBom[0]}-${selectBom[1]}-${selectBom[2]}`"
highlight-current ref="tree"
></el-tree>
</el-aside>
<el-main style="padding: 0">
<el-table :data="bomDetailList" :height="height"
stripe border element-loading-text = "数据正在加载中"
v-loading="dataListLoading" style="margin-top: 10px">
<el-table-column
v-for="(item,index) in columnDetailList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed===''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
</el-main>
</el-container>
</div>
</template>
<style scoped>
</style>

341
src/views/modules/quotation/sellForQuotation/quotationDetail/costPrice.vue

@ -0,0 +1,341 @@
<script>
import {Decimal} from "decimal.js";
export default {
name: "costPrice",
props: {
detail: {
type: Object,
request: true
},
height: {
type: Number,
default: 400,
},
},
data() {
return {
bomCost:0,
machineCost:0,
fabricateCost:0,
labourCost:0,
toolCost:0,
packCost:0,
shippingCost:0,
rules: {
detailProfitRate: [{required: true, pattern:/^[1-9]\d{0,14}(\.\d{1,16})?$|^0(\.\d{1,16})?$/, message: ' ', trigger: ['change','blur']}],
adjustPartCost: [{required: true, pattern:/^[1-9]\d{0,14}(\.\d{1,16})?$|^0(\.\d{1,16})?$/, message: ' ', trigger: ['change','blur']}],
adjustMachineCost: [{required: true,pattern:/^[1-9]\d{0,14}(\.\d{1,16})?$|^0(\.\d{1,16})?$/, message: ' ', trigger: ['change','blur']}],
adjustFabricateCost: [{required: true,pattern:/^[1-9]\d{0,14}(\.\d{1,16})?$|^0(\.\d{1,16})?$/, message: ' ', trigger: ['change','blur']}],
adjustLabourCost: [{required: true,pattern:/^[1-9]\d{0,14}(\.\d{1,16})?$|^0(\.\d{1,16})?$/, message: ' ', trigger: ['change','blur']}],
adjustToolCost: [{required: true,pattern:/^[1-9]\d{0,14}(\.\d{1,16})?$|^0(\.\d{1,16})?$/, message: ' ', trigger: ['change','blur']}],
detailManageCost: [{required: true,pattern:/^[1-9]\d{0,14}(\.\d{1,16})?$|^0(\.\d{1,16})?$/, message: ' ', trigger: ['change','blur']}],
detailOtherCost: [{required: true,pattern:/^[1-9]\d{0,14}(\.\d{1,16})?$|^0(\.\d{1,16})?$/, message: ' ', trigger: ['change','blur']}],
taxRate: [{required: true, message: ' ', trigger: ['change','blur']}],
},
quotationDetailColumns: [
{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: "最终去税价格"},
],
}
},
computed: {
copyDetail: {
get() {
return this.detail
},
set(val) {
}
}
},
methods:{
ruleCostForm(){
let flag = false;
this.$refs.costForm.validate((validate,objects)=>{
if (!validate){
this.rulesValidateLabel(objects, this.quotationDetailColumns);
}
flag = validate;
})
return flag;
},
restCostForm(){
this.$refs.costForm.resetFields();
},
getQuotationDetail(){
return JSON.parse(JSON.stringify(this.copyDetail));
},
rulesValidateLabel(objects, labels) {
for (let filed in objects) {
console.log(filed)
for (let i = 0; i < labels.length; i++) {
let quotationToolColumn = labels[i];
if (quotationToolColumn.label === filed) {
this.$message.warning(quotationToolColumn.value+"为空或填写不正确");
return
}
}
}
},
setCost(bomCost,machineCost,fabricateCost,labourCost,toolCost,packCost,shippingCost){
this.bomCost = bomCost;
this.machineCost = machineCost;
this.fabricateCost = fabricateCost;
this.labourCost = labourCost;
this.toolCost = toolCost;
this.packCost = packCost;
this.shippingCost = shippingCost;
},
computeCost(){
// this.$message.success(`${this.bomCost},${this.machineCost},${this.fabricateCost},${this.labourCost},${this.toolCost},${this.packCost},${this.shippingCost}`)
//
this.copyDetail.computePartCost = this.bomCost
this.copyDetail.adjustPartCost = this.bomCost
//
this.copyDetail.computeMachineCost = this.machineCost
this.copyDetail.adjustMachineCost = this.machineCost
//
this.copyDetail.computedFabricateCost = this.fabricateCost
this.copyDetail.adjustFabricateCost = this.fabricateCost
//
this.copyDetail.computeLabourCost = this.labourCost
this.copyDetail.adjustLabourCost = this.labourCost
//
this.copyDetail.computeToolCost = this.toolCost
this.copyDetail.adjustToolCost = this.toolCost
//
this.copyDetail.detailOtherCost = new Decimal(this.shippingCost).add(new Decimal(this.packCost)).toSignificantDigits().toNumber()
//
this.copyDetail.detailManageCost = 0;
//
this.copyDetail.detailProfitRate = 0;
this.computeAllCost();
},
computeAllCost(){
this.computedTotalCost();//
this.computedAmountOfProfitCost();//
this.computedUntaxedCost();//
this.computedTaxedCost();//
},
//
computedTotalCost(){
this.copyDetail.detailTotalCost = new Decimal(this.copyDetail.adjustPartCost)
.add(new Decimal(this.copyDetail.adjustMachineCost))
.add(new Decimal(this.copyDetail.adjustFabricateCost))
.add(new Decimal(this.copyDetail.adjustLabourCost))
.add(new Decimal(this.copyDetail.adjustToolCost))
.add(new Decimal(this.copyDetail.detailManageCost))
.add(new Decimal(this.copyDetail.detailOtherCost)).toSignificantDigits().toNumber()
},
computedAmountOfProfitCost(){
this.copyDetail.detailProfitAmount = new Decimal(this.copyDetail.detailTotalCost)
.mul(
this.copyDetail.detailProfitRate===0
?new Decimal(this.copyDetail.detailProfitRate)
:new Decimal(this.copyDetail.detailProfitRate).div(new Decimal(100))
).toSignificantDigits().toNumber()
},
computedUntaxedCost(){
this.copyDetail.systemComputeAmount =
new Decimal(this.copyDetail.detailTotalCost)
.add(new Decimal(this.copyDetail.detailProfitAmount)).toSignificantDigits().toNumber();
this.copyDetail.finalUntaxedPrice =
new Decimal(this.copyDetail.systemComputeAmount)
.div(new Decimal(this.copyDetail.quotationDetailQuantity)).toSignificantDigits().toNumber();
},
computedTaxedCost(){
this.copyDetail.systemComputePrice =
new Decimal(this.copyDetail.systemComputeAmount)
.add(new Decimal(this.copyDetail.systemComputeAmount)
.mul(
this.copyDetail.taxRate===0
?new Decimal(this.copyDetail.taxRate)
:new Decimal(this.copyDetail.taxRate).div(new Decimal(100))
)
).toSignificantDigits().toNumber();
this.copyDetail.finalTaxedPrice =
new Decimal(this.copyDetail.systemComputePrice)
.div(new Decimal(this.copyDetail.quotationDetailQuantity)).toSignificantDigits().toNumber();
}
}
}
</script>
<template>
<div>
<div>
<el-button type="primary" @click="computeCost"> </el-button>
</div>
<!--系统自动计算结果-->
<el-form :model="copyDetail" ref="costForm" :rules="rules" label-position="top" label-width="120px">
<fieldset
style="height:80px;margin-top: 2px;border-color: rgb(255,255,255);">
<legend>系统自动计算结果(料工费/工具)</legend>
<el-row :gutter="20">
<el-col :span="4">
<el-form-item label="材料成本:" prop="computePartCost">
<el-input-number style="width: 100%;margin-top: -5px;" :controls="false"
v-model="copyDetail.computePartCost" disabled/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="机器成本:" prop="computeMachineCost">
<el-input-number style="width: 100%;margin-top: -5px;" :controls="false"
v-model="copyDetail.computeMachineCost" disabled/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="制造费用成本:" prop="computeFabricateCost">
<el-input-number style="width: 100%;margin-top: -5px;" :controls="false"
v-model="copyDetail.computeFabricateCost" disabled/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="人工成本:" prop="computeLabourCost">
<el-input-number style="width: 100%;margin-top: -5px;" :controls="false"
v-model="copyDetail.computeLabourCost" disabled/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="工具成本:" prop="computeToolCost">
<el-input-number style="width: 100%;margin-top: -5px;" :controls="false"
v-model="copyDetail.computeToolCost" disabled/>
</el-form-item>
</el-col>
</el-row>
</fieldset>
<fieldset
style="height:80px;margin-top: 5px;border-color: rgb(255,255,255);">
<legend>调整后成本(料工费/工具)</legend>
<el-row :gutter="20">
<el-col :span="4">
<el-form-item label="材料成本:" prop="adjustPartCost">
<el-input-number style="width: 100%;margin-top: -5px;" :controls="false" @blur="computeAllCost"
v-model="copyDetail.adjustPartCost" :min="0"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="机器成本:" prop="adjustMachineCost">
<el-input-number style="width: 100%;margin-top: -5px;" :controls="false" @blur="computeAllCost"
v-model="copyDetail.adjustMachineCost" :min="0"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="制造费用成本:" prop="adjustFabricateCost">
<el-input-number style="width: 100%;margin-top: -5px;" :controls="false" @blur="computeAllCost"
v-model="copyDetail.adjustFabricateCost" :min="0"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="人工成本:" prop="adjustLabourCost">
<el-input-number style="width: 100%;margin-top: -5px;" :controls="false" @blur="computeAllCost"
v-model="copyDetail.adjustLabourCost" :min="0"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="工具成本:" prop="adjustToolCost">
<el-input-number style="width: 100%;margin-top: -5px;" :controls="false" @blur="computeAllCost"
v-model="copyDetail.adjustToolCost" :min="0"/>
</el-form-item>
</el-col>
</el-row>
</fieldset>
<fieldset
style="height:80px;margin-top: 5px;border-color: rgb(255,255,255)">
<legend>其他成本</legend>
<el-row :gutter="20">
<el-col :span="4">
<el-form-item label="管理成本:" prop="detailManageCost">
<el-input-number style="width: 100%;margin-top: -5px;" :controls="false" @blur="computeAllCost"
v-model="copyDetail.detailManageCost" :min="0"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="其他成本:" prop="detailOtherCost">
<el-input-number style="width: 100%;margin-top: -5px;" :controls="false" @blur="computeAllCost"
v-model="copyDetail.detailOtherCost" :min="0"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="总成本:" prop="detailTotalCost">
<el-input-number style="width: 100%;margin-top: -5px;" :controls="false"
v-model="copyDetail.detailTotalCost" :min="0" disabled/>
</el-form-item>
</el-col>
</el-row>
</fieldset>
<fieldset style="height:80px;margin-top: 5px;border-color: rgb(255,255,255);">
<legend>利润</legend>
<el-row :gutter="20">
<el-col :span="4">
<el-form-item label="利润率%:" prop="detailProfitRate">
<el-input-number style="width: 100%;margin-top: -5px;" :controls="false" @blur="computeAllCost"
v-model="copyDetail.detailProfitRate" :min="0"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="利润额:" prop="detailProfitAmount">
<el-input-number style="width: 100%;margin-top: -5px;" :controls="false"
v-model="copyDetail.detailProfitAmount" :min="0" disabled/>
</el-form-item>
</el-col>
</el-row>
</fieldset>
<fieldset style="height:80px;margin-top: 5px;border-color: rgb(255,255,255);">
<legend>最终价格</legend>
<el-row :gutter="20">
<el-col :span="4">
<el-form-item label="未税总额:" prop="systemComputeAmount">
<el-input-number style="width: 100%;margin-top: -5px;" :controls="false"
v-model="copyDetail.systemComputeAmount" :min="0" disabled/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="未税单价:" prop="finalUntaxedPrice">
<el-input-number style="width: 100%;margin-top: -5px;" :controls="false"
v-model="copyDetail.finalUntaxedPrice" :min="0" disabled/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="税率%:" prop="taxRate">
<el-input-number style="width: 100%;margin-top: -5px;" :controls="false" @blur="computeAllCost"
v-model="copyDetail.taxRate" :min="0"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="含税总额:" prop="systemComputePrice">
<el-input-number style="width: 100%;margin-top: -5px;" :controls="false"
v-model="copyDetail.systemComputePrice" :min="0" disabled/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="含税单价:" prop="finalTaxedPrice">
<el-input-number style="width: 100%;margin-top: -5px;" :controls="false"
v-model="copyDetail.finalTaxedPrice" :min="0" disabled/>
</el-form-item>
</el-col>
</el-row>
</fieldset>
</el-form>
</div>
</template>
<style scoped>
.el-input-number /deep/ .el-input__inner {
text-align: right;
padding-right: 5px !important;
}
</style>

206
src/views/modules/quotation/sellForQuotation/quotationDetail/propertyTemplates.vue

@ -0,0 +1,206 @@
<script>
import {getItemModal} from "../../../../../api/base/properties";
import {Decimal} from "decimal.js";
export default {
name: "propertyTemplates",
props:{
detail:{
type:Object,
request:true,
},
height:{
type:Number,
default:400,
}
},
data(){
return{
propertyTemplatesItemList:[],//item
dataListLoading:false,
columnDetailList: [
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table9PropertiesItemID',
tableId: "101002001Table9",
tableName: "物料属性项目表",
columnProp: 'propertiesItemNo',
headerAlign: "center",
align: "left",
columnLabel: '属性编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 90,
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table9PropertiesItemDesc',
tableId: "101002001Table9",
tableName: "物料属性项目表",
columnProp: 'itemDesc',
headerAlign: "center",
align: "left",
columnLabel: '属性名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 90,
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001Table9ValueType',
tableId: "101002001Table9",
tableName: "物料属性项目表",
columnProp: 'valueType',
headerAlign: "center",
align: "center",
columnLabel: '属性类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 70,
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001TableValueChooseFlag',
tableId: "101002001Table",
tableName: "common",
columnProp: 'textValue',
headerAlign: "center",
align: "center",
columnLabel: '文本值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 70,
},
{
userId: this.$store.state.user.name,
functionId: 101002001,
serialNumber: '101002001TableValueChooseFlag',
tableId: "101002001Table",
tableName: "common",
columnProp: 'numValue',
headerAlign: "center",
align: "center",
columnLabel: '数字值',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 70,
},
],
}
},
created() {
// this.getPropertyTemplatesItem();
},
methods:{
getPackInfoCost(){
let boxOfBags = this.propertyTemplatesItemList.find((item)=>item.propertiesItemNo.toUpperCase() === 'PACK-BAGS/BOX');
let boxCost = this.propertyTemplatesItemList.find((item)=>item.propertiesItemNo.toUpperCase() === 'PACK-BOX-COST');
let packOtherCost = this.propertyTemplatesItemList.find((item)=>item.propertiesItemNo.toUpperCase() === 'PACK-OTHER-COST');
let numOfBag = this.propertyTemplatesItemList.find((item)=>item.propertiesItemNo.toUpperCase() === 'PACK-PCS/PE-BAG');
let bagCost = this.propertyTemplatesItemList.find((item)=>item.propertiesItemNo.toUpperCase() === 'PACK-PE-BAG-COST');
if (!boxCost || !boxOfBags || !numOfBag || !bagCost){
// this.$message.warning("")
return 0;
}
if (boxCost.numValue === null || boxCost.numValue === undefined || boxOfBags.numValue === null || boxOfBags.numValue === undefined
|| numOfBag.numValue === null || numOfBag.numValue === undefined || bagCost.numValue === null || bagCost.numValue === undefined){
// this.$message.warning("")
return 0;
}
let num1 = new Decimal(bagCost.numValue).div(new Decimal(numOfBag.numValue));
let num2 = new Decimal(boxCost.numValue).div(new Decimal(boxOfBags.numValue));
return num1.add(num2).toSignificantDigits().toNumber()
},
getShippingInfoCost(){
let shippingCost = this.propertyTemplatesItemList.find((item)=>item.propertiesItemNo.toUpperCase() === 'SHIPPING-COST');
let shippingDeliverQuantity = this.propertyTemplatesItemList.find((item)=>item.propertiesItemNo.toUpperCase() === 'SHIPPING-DELIVER-QUANTITY');
let shippingOtherCost = this.propertyTemplatesItemList.find((item)=>item.propertiesItemNo.toUpperCase() === 'SHIPPING-OTHER-COST');
if (!shippingCost || !shippingDeliverQuantity){
// this.$message.warning("/")
return 0;
}
if (shippingCost.numValue === null || shippingCost.numValue === undefined || shippingDeliverQuantity.numValue === null || shippingDeliverQuantity.numValue === undefined){
// this.$message.warning("/")
return 0;
}
return new Decimal(shippingCost.numValue).div(new Decimal(shippingDeliverQuantity.numValue)).toSignificantDigits().toNumber()
},
getPropertyTemplatesItem(){
let params = {
site:this.$store.state.user.site,
partNo:this.detail.productNo
}
this.dataListLoading = true
getItemModal(params).then(({data})=>{
if (data && data.code === 0){
this.propertyTemplatesItemList = data.rows;
}else {
this.$message.warning(data.msg)
}
this.dataListLoading = false
}).catch((error)=>{
this.$message.error(error)
this.dataListLoading = false
})
}
}
}
</script>
<template>
<div>
<div>
<el-button type="primary" @click="getPropertyTemplatesItem">刷新属性</el-button>
</div>
<el-table
:height="height"
:data="propertyTemplatesItemList"
border element-loading-text = "数据正在加载中"
v-loading="dataListLoading"
style="width: 100%;margin-top: 5px">
<el-table-column
v-for="(item,index) in columnDetailList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed===''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
</div>
</template>
<style scoped>
</style>

73
src/views/modules/quotation/sellForQuotation/quotationDetail/quoteRouting.vue

@ -0,0 +1,73 @@
<script>
import {getBomTreeStructure} from "../../../../../api/quotation/quoteOfRouting";
export default {
name: "quoteRouting",
props:{
detail:{
type:Object,
request:true,
},
height:{
type:Number,
default:400,
}
},
data(){
return{
treeLoading:false,
routingTreeStructure:[],
routingProps:{
label:'label',
value:'value',
children:'list'
},
selectRouting:[],
}
},
methods:{
nodeClick(val){
},
getBomTreeStructure(){
let params = {
site:this.detail.site,
testPartNo:this.detail.productNo
}
getBomTreeStructure(params).then(({data})=>{
if (data && data.code === 0){
this.routingTreeStructure = data.rows
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
}
}
}
</script>
<template>
<div>
{{detail}}
<el-container>
<el-aside width="24%" style="padding: 0;" :style="{height: height}" v-loading="treeLoading">
<el-tree :data="routingTreeStructure"
:props="routingProps"
@node-click="nodeClick"
node-key="value" style="height: 100%"
default-expand-all
highlight-current ref="tree"
></el-tree>
</el-aside>
<el-main style="padding: 0">
</el-main>
</el-container>
</div>
</template>
<style scoped>
</style>

532
src/views/modules/quotation/sellForQuotation/quotationDetail/toolQuotation.vue

@ -0,0 +1,532 @@
<script>
import {
batchDeleteQuotationTool,
deleteQuotationTool, saveQuotationTool,
searchQuotationTool
} from "../../../../../api/quotation/quotationHeader";
import {Decimal} from "decimal.js";
import {searchTool, searchToolHeader} from "../../../../../api/part/toolHeader";
export default {
name:'toolQuotation',
props:{
detail:{
type:Object,
request:true,
},
height:{
type:Number,
default:400,
}
},
data(){
const validateToolNo = (rule, value, callback) => {
if (this.saveQuotationToolFlag !== true){
return;
}
if (value === '' || value === null || value === undefined){
callback(new Error(' '))
return
}
if (value === '*'){
callback();
return;
}
this.toolHeader.toolNo = value;
searchTool(this.toolHeader).then(({data})=>{
if (data.code === 200) {
if (data.data.length === 1){
callback()
return
}
}
this.toolHeader.toolNo = null;
this.$message.error("工具编码不存在!")
callback(new Error(' '))
}).catch((error)=>{
this.toolHeader.toolNo = null;
callback(new Error(' '))
})
};
return{
saveQuotationToolFlag:false,
quotationToolList:[],
initQuotationToolLoading:false,
toolHeaderDialogFlag:false,
selectionQuotationToolList:[],
saveQuotationToolLoading:false,
selectionToolHeaderList:[],
toolHeaderList:[],
quotationTool: {
quotationToolId: undefined,
site: this.$store.state.user.site,
toolNo: "",
toolDescription: "",
toolQuantity: 1,
unitCost: 1,
quotationUnitCost:0,
expectedServiceLife: 1,
remark: "",
},
//
toolHeader:{
site:this.$store.state.user.site,
toolNo:undefined,//
toolDescription:undefined,//
},
//
quotationToolRules: {
toolNo: [{required: true, validator:validateToolNo,message:" ", trigger: 'change'}],
toolDescription: [{required: true, message: ' ', trigger: ['change','blur']}],
toolQuantity: [{required: true,pattern:/^[1-9]\d{0,14}(\.\d{1,16})?$|^0(\.\d{1,16})?$/, message: ' ', trigger: ['change','blur']}],
unitCost: [{required: true,pattern:/^[1-9]\d{0,14}(\.\d{1,16})?$|^0(\.\d{1,16})?$/, message: ' ', trigger: ['change','blur']}],
expectedServiceLife: [{required: true,pattern:/^[1-9]\d{0,14}(\.\d{1,16})?$|^0(\.\d{1,16})?$/, message: ' ', trigger: ['change','blur']}],
},
//
quotationToolColumns: [
{label: "toolNo", value: "工具编码",},
{label: "toolDescription", value: "工具描述",},
{label: "toolQuantity", value: "工具数量",},
{label: "unitCost", value: "单位成本",},
{label: "itemNo", value: "序号",},
{label: "expectedServiceLife", value: "预计使用寿命",},
],
columnList: [
{
userId: this.$store.state.user.name,
functionId: 101008001,
serialNumber: '101002001ToolNo',
tableId: '101002001Table5',
tableName: '工具信息表',
columnProp: 'toolNo',
headerAlign: 'center',
align: 'center',
columnLabel: '工具编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: 101008001,
serialNumber: '101002001ToolDescription',
tableId: '101002001Table5',
tableName: '工具信息表',
columnProp: 'toolDescription',
headerAlign: 'center',
align: 'left',
columnLabel: '工具描述',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: 101008001,
serialNumber: '101002001ToolQuantity',
tableId: '101002001Table5',
tableName: '工具信息表',
columnProp: 'toolQuantity',
headerAlign: 'center',
align: 'right',
columnLabel: '工具数量',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100
},{
userId: this.$store.state.user.name,
functionId: 101008001,
serialNumber: '101002001UnitCost',
tableId: '101002001Table5',
tableName: '工具信息表',
columnProp: 'unitCost',
headerAlign: 'center',
align: 'right',
columnLabel: '单位成本',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: 101008001,
serialNumber: '101002001ExpectedServiceLife',
tableId: '101002001Table5',
tableName: '工具信息表',
columnProp: 'expectedServiceLife',
headerAlign: 'center',
align: 'right',
columnLabel: '预计使用寿命',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: 101008001,
serialNumber: '101002001QuotationUnitCost',
tableId: '101002001Table5',
tableName: '工具信息表',
columnProp: 'quotationUnitCost',
headerAlign: 'center',
align: 'right',
columnLabel: '单位报价成本',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},{
userId: this.$store.state.user.name,
functionId: 101008001,
serialNumber: '101002001Remark',
tableId: '101002001Table5',
tableName: '工具信息表',
columnProp: 'remark',
headerAlign: 'center',
align: 'left',
columnLabel: '备注',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
],
}
},
created() {
// this.initQuotationToolData();
},
methods:{
getQuotationToolList(){
this.initQuotationToolData();
//
return this.quotationToolList.reduce((total, currentValue) => {
return total + new Decimal(currentValue.quotationUnitCost).toNumber();
}, 0);
},
initQuotationToolData() {
let params = {
quotationDetailId: this.detail.quotationDetailId,
}
this.initQuotationToolLoading = true;
searchQuotationTool(params).then(({data}) => {
this.initQuotationToolLoading = false;
if (data && data.code === 200) {
this.quotationToolList = data.data;
}
}).catch((error)=>{
this.initQuotationToolLoading = false;
})
},
handleSelectionChangeQuotationToolTable(selection){
this.selectionQuotationToolList = selection;
},
clickEditToolTableBtn(row){
this.quotationTool = JSON.parse(JSON.stringify(row));
this.saveQuotationToolFlag= true;
},
clickDeleteToolTableBtn(row){
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteQuotationTool(row).then(({data})=>{
if (data.code === 200){
this.initQuotationToolData();
this.$message.success(data.msg);
}else {
this.$message.error(data.msg);
}
})
})
},
deleteSelectionQuotationTool(){
if (this.selectionQuotationToolList.length === 0) {
this.$message.warning("请选择要删除的工具记录")
return;
}
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
batchDeleteQuotationTool(this.selectionQuotationToolList).then(({data})=>{
if (data.code === 200){
this.initQuotationToolData();
this.$message.success(data.msg);
}else {
this.$message.error(data.msg);
}
})
})
},
//
closeQuotationToolDialog() {
this.$refs['quotationToolForm'].resetFields();
this.quotationTool = {
quotationToolId: undefined,
site: this.$store.state.user.site,
toolNo: "",
toolDescription: "",
toolQuantity: 1,
unitCost: 1,
quotationUnitCost: 0,
expectedServiceLife: 1,
remark: "",
};
if (this.selectionToolHeaderList.length > 0){
this.$refs.toolHeaderForm.resetFields();
}
this.selectionQuotationToolList = [];
if (this.$refs.toolHeaderTable) {
this.$refs.toolHeaderTable.clearSelection();
}
},
openQuotationToolDialog(){
this.computeToolQuotationUnitCost(this.quotationTool);
},
computeToolQuotationUnitCost(row){
// = * / 使寿
if (!row.expectedServiceLife || row.expectedServiceLife <= 0){
this.quotationTool.expectedServiceLife = 1;
}
if (!row.toolQuantity || row.toolQuantity <= 0){
this.quotationTool.toolQuantity = 1;
}
if (!row.unitCost || row.unitCost < 0){
this.quotationTool.unitCost = 0;
}
if (!row.expectedServiceLife || !row.toolQuantity || !row.unitCost){
row.quotationUnitCost = 0;
return
}
row.quotationUnitCost = new Decimal(new Decimal(row.unitCost).mul(new Decimal(row.toolQuantity)).div(new Decimal(row.expectedServiceLife)).toFixed(16,Decimal.ROUND_HALF_UP)).toSignificantDigits().toNumber();
},
saveQuotationTool() {
this.$refs['quotationToolForm'].validate((validate, object) => {
if (validate) {
this.saveQuotationToolLoading = true;
this.quotationTool.quotationDetailId = this.detail.quotationDetailId;
this.insertQuotationToolData();
} else {
this.rulesValidateLabel(object, this.quotationToolColumns);//
}
})
},
insertQuotationToolData(){
saveQuotationTool(this.quotationTool).then(({data}) => {
this.saveQuotationToolLoading = false;
if (data.code === 200) {
this.initQuotationToolData();
this.$message.success(data.msg);
this.saveQuotationToolFlag = false;//
} else {
this.$message.error(data.msg);
}
}).catch((error)=>{
this.saveQuotationToolLoading = false;
})
},
//
openToolHeaderDialog(){
if (this.selectionToolHeaderList.length > 0) {
this.$refs.quotationToolForm.resetFields();
}
},
initToolHeader(){
searchToolHeader(this.toolHeader).then(({data})=>{
if (data.code === 200) {
this.toolHeaderList = data.data;
this.toolHeaderList = this.toolHeaderList.map(item =>{
let utilObj = {
toolNo:item.toolId,
toolDescription:item.toolDescription,
unitCost:item.standardCost,
}
return utilObj;
})
}
})
},
handleSelectionChangeToolHeaderTable(selection){
this.selectionToolHeaderList = selection;
},
dblclickToolHeader(row){
row = JSON.parse(JSON.stringify(row));
this.quotationTool.toolNo = row.toolNo;
this.quotationTool.toolDescription = row.toolDescription;
this.quotationTool.unitCost = row.unitCost ? row.unitCost : 0;
this.computeToolQuotationUnitCost(this.quotationTool)
this.toolHeaderDialogFlag= false;
},
//
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
}
}
}
},
},
}
</script>
<template>
<div>
<div>
<el-button type="primary" @click="saveQuotationToolFlag = true"> </el-button>
<el-button type="primary" @click="deleteSelectionQuotationTool"> </el-button>
</div>
<el-table style="margin-top: 5px" ref="quotationToolTable"
v-loading="initQuotationToolLoading"
element-loading-text = "数据正在加载中"
@selection-change="handleSelectionChangeQuotationToolTable"
:data="quotationToolList" :height="height" stripe border>
<el-table-column
type="selection"
align="center"
width="55">
</el-table-column>
<el-table-column label="操作" width="120" align="center" >
<template slot-scope="{row,$index}">
<el-link style="cursor: pointer" @click="clickEditToolTableBtn(row)">编辑</el-link>
<el-link style="cursor: pointer" @click="clickDeleteToolTableBtn(row)">删除</el-link>
</template>
</el-table-column>
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed===''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope" >
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp]}}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
<el-dialog title="报价工具" v-drag
@close="closeQuotationToolDialog"
@open="openQuotationToolDialog"
:visible.sync="saveQuotationToolFlag" width="40%"
top="15vh" append-to-body>
<el-form :rules="quotationToolRules" ref="quotationToolForm" :model="quotationTool" label-position="top"
style="height: 260px">
<el-row>
<el-col :span="8">
<el-form-item label="工具编码" prop="toolNo">
<span slot="label" @click="toolHeaderDialogFlag = true" style="cursor: pointer"><a>工具编码</a></span>
<el-input v-model="quotationTool.toolNo" clearable/>
</el-form-item>
</el-col>
<el-col :span="12" :offset="2">
<el-form-item label="工具描述" prop="toolDescription">
<el-input v-model="quotationTool.toolDescription" :disabled="quotationTool.toolNo !== '*'" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="工具数量" prop="toolQuantity">
<div class="right">
<el-input class="inlineNumber" @input="computeToolQuotationUnitCost(quotationTool)" v-model="quotationTool.toolQuantity" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/>
</div>
</el-form-item>
</el-col>
<el-col :span="12" :offset="2">
<el-form-item label="预计使用寿命" prop="expectedServiceLife">
<div class="right">
<el-input class="inlineNumber" @input="computeToolQuotationUnitCost(quotationTool)" v-model="quotationTool.expectedServiceLife" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/>
</div>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="单位成本" prop="unitCost">
<div class="right">
<el-input class="inlineNumber" @input="computeToolQuotationUnitCost(quotationTool)" v-model="quotationTool.unitCost" :disabled="quotationTool.toolNo !== '*'" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/>
</div>
</el-form-item>
</el-col>
<el-col :span="12" :offset="2">
<el-form-item label="单位报价成本" prop="unitCost">
<div class="right">
<el-input class="inlineNumber" v-model="quotationTool.quotationUnitCost" disabled onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/>
</div>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注" prop="remark" style="height: 90px">
<el-input v-model="quotationTool.remark" resize="none" type="textarea" :autosize="{minRows: 3, maxRows: 3}" style="width: 93%"/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer" style="margin-top: 5px">
<el-button type="primary" :loading="saveQuotationToolLoading" @click="saveQuotationTool"> </el-button>
<el-button @click="saveQuotationToolFlag= false"> </el-button>
</span>
</el-dialog>
<!--tool列表-->
<el-dialog v-drag title="工具信息"
@open="openToolHeaderDialog"
width="40%" top="15vh" append-to-body
:visible.sync="toolHeaderDialogFlag">
<!--搜索条件-->
<el-form :model="toolHeader" ref="toolHeaderForm" :inline="true" label-position="top">
<el-form-item label="工具编号" prop="toolNo">
<el-input v-model="toolHeader.toolNo" clearable/>
</el-form-item>
<el-form-item label="工具描述" prop="toolDescription">
<el-input v-model="toolHeader.toolDescription" clearable/>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="initToolHeader"> </el-button>
</el-form-item>
</el-form>
<!--筛选的数据-->
<el-table :data="toolHeaderList" ref="toolHeaderTable" :style="{marginTop:'10px'}"
height="300px" stripe border @selection-change="handleSelectionChangeToolHeaderTable"
@row-dblclick="dblclickToolHeader">
<el-table-column label="工具编号" prop="toolNo"/>
<el-table-column label="工具描述" prop="toolDescription"/>
</el-table>
</el-dialog>
</div>
</template>
<style scoped>
</style>

604
src/views/modules/quotation/sellForQuotation/quoteDetail.vue
File diff suppressed because it is too large
View File

Loading…
Cancel
Save