Browse Source

20240815

java8
qiezi 1 year ago
parent
commit
b717364b98
  1. 13
      src/api/quote/quoteDetail.js
  2. 7
      src/api/quote/quoteDetailTool.js
  3. 56
      src/views/modules/quote/detail/primary/quoteDetailBom.vue
  4. 323
      src/views/modules/quote/detail/primary/quoteDetailCost.vue
  5. 363
      src/views/modules/quote/detail/primary/quoteDetailTool.vue
  6. 759
      src/views/modules/quote/detail/quoteDetail.vue
  7. 100
      src/views/modules/quote/index.vue

13
src/api/quote/quoteDetail.js

@ -0,0 +1,13 @@
import {createAPI} from "../../utils/httpRequest";
export const queryQuoteDetail = (data) => createAPI(`/quote/detail`,'post',data)
export const queryQuoteDetailByPage = (data) => createAPI(`/quote/detail/${data.no}/${data.size}`,'post',data)
export const saveQuoteDetail = (data) => createAPI(`/quote/detail/save`,'post',data)
export const updateQuoteDetail = (data) => createAPI(`/quote/detail/update`,'post',data)
export const deleteQuoteDetail = (data) => createAPI(`/quote/detail/remove/${data.id}`,'post',data)
export const queryQuoteDetailAllCost = (data) => createAPI(`/quote/detail/cost`,'post',data)

7
src/api/quote/quoteDetailTool.js

@ -0,0 +1,7 @@
import {createAPI} from "../../utils/httpRequest";
export const queryToolList = (data) => createAPI('/quote/detail/tool/list', 'post', data)
export const queryQuoteDetailTool = (data) =>createAPI(`/quote/detail/tool`,'post',data)
export const removeQuoteDetailTool = (data) => createAPI(`quote/detail/tool/remove/${data.id}`,'post',data)
export const saveQuoteDetailTool = (data) => createAPI(`quote/detail/tool/save`,'post',data)
export const updateQuoteDetailTool = (data) => createAPI(`quote/detail/tool/update`,'post',data)

56
src/views/modules/quote/detail/primary/quoteDetailBom.vue

@ -0,0 +1,56 @@
<script>
export default {
name: "quoteDetailBom",
props:{
quoteDetail:{
type:Object,
required:true
},
},
model:{
prop: "quoteDetail",
event: "update"
},
data(){
return{
isAllBom:false,
}
},
methods:{
handleQueryQuoteDetailBom(){
console.log(this.quoteDetail.id)
},
},
created() {
if (this.quoteDetail && this.quoteDetail.id){
this.handleQueryQuoteDetailBom();
}
},
watch:{
'quoteDetail.id'(newVal,oldVal){
this.handleQueryQuoteDetailBom();
},
}
}
</script>
<template>
<div>
<div style="margin-bottom: 10px">
<el-link style="margin-right: 20px">切换版本</el-link>
<el-checkbox v-model="isAllBom">全级BOM结构</el-checkbox>
</div>
<el-container>
<el-aside width="300px">
</el-aside>
<el-main style="padding: 0">
</el-main>
</el-container>
</div>
</template>
<style scoped>
</style>

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

@ -0,0 +1,323 @@
<script>
import {queryQuoteDetailAllCost} from "../../../../../api/quote/quoteDetail";
export default {
name: "quoteDetailCost",
props: {
quoteDetail: {
type: Object,
required: true
},
},
model: {
prop: "quoteDetail",
event: "update",
},
data(){
return {
rules:{
adjustPartCost: [
{ required: true, message: "请输入材料成本", trigger: ["blur","change"] }
],
adjustMachineCost: [
{ required: true, message: "请输入机器成本", trigger: ["blur","change"] }
],
adjustFabricateCost: [
{ required: true, message: "请输入制造费用成本", trigger: ["blur","change"] }
],
adjustLabourCost: [
{ required: true, message: "请输入人工成本", trigger: ["blur","change"] }
],
adjustToolCost: [
{ required: true, message: "请输入工具成本", trigger: ["blur","change"] }
],
manageCost: [
{ required: true, message: "请输入管理成本", trigger: ["blur","change"] }
],
otherCost: [
{ required: true, message: "请输入其他成本", trigger: ["blur","change"] }
],
profitRate: [
{ required: true, message: "请输入利润率", trigger: ["blur","change"] }
],
taxRate: [
{ required: true, message: "请输入税率", trigger: ["blur","change"] }
],
},
}
},
methods:{
computeTotalCost(){
this.quoteDetail.totalCost =
this.quoteDetail.adjustPartCost +
this.quoteDetail.adjustMachineCost +
this.quoteDetail.adjustFabricateCost +
this.quoteDetail.adjustLabourCost +
this.quoteDetail.adjustToolCost +
this.quoteDetail.manageCost +
this.quoteDetail.otherCost;
this.computeProfitAmount();
},
computeProfitAmount(){
this.quoteDetail.profitAmount =
this.quoteDetail.totalCost * (this.quoteDetail.profitRate / 100);
this.computeTaxCost();
},
computeTaxCost(){
this.quoteDetail.totalPrice =
this.quoteDetail.totalCost + this.quoteDetail.profitAmount;
this.quoteDetail.unitPrice =
this.quoteDetail.totalPrice / this.quoteDetail.qty;
this.quoteDetail.taxTotalPrice =
this.quoteDetail.totalPrice + this.quoteDetail.totalPrice * (this.quoteDetail.taxRate / 100);
this.quoteDetail.taxUnitPrice =
this.quoteDetail.taxTotalPrice / this.quoteDetail.qty;
},
handleQueryAllCost(){
let params = {
...this.quoteDetail
}
queryQuoteDetailAllCost(params).then(({data})=>{
if (data && data.code === 0){
this.quoteDetail.toolCost = data.row.toolCost;
this.quoteDetail.adjustToolCost = data.row.toolCost;
}else {
this.$message.warning(data.msg);
}
}).catch((error)=>{
this.$message.error(error);
})
}
},
watch:{
'quoteDetail.adjustPartCost'(newValue, oldValue){
if (newValue === undefined || newValue === null){
this.quoteDetail.adjustPartCost = 0;
}
this.computeTotalCost();
},
'quoteDetail.adjustMachineCost'(newValue, oldValue){
if (newValue === undefined || newValue === null){
this.quoteDetail.adjustMachineCost = 0;
}
this.computeTotalCost();
},
'quoteDetail.adjustFabricateCost'(newValue, oldValue){
if (newValue === undefined || newValue === null){
this.quoteDetail.adjustFabricateCost = 0;
}
this.computeTotalCost();
},
'quoteDetail.adjustLabourCost'(newValue, oldValue){
if (newValue === undefined || newValue === null){
this.quoteDetail.adjustLabourCost = 0;
}
this.computeTotalCost();
},
'quoteDetail.adjustToolCost'(newValue, oldValue){
if (newValue === undefined || newValue === null){
this.quoteDetail.adjustToolCost = 0;
}
this.computeTotalCost();
},
'quoteDetail.manageCost'(newValue, oldValue){
if (newValue === undefined || newValue === null){
this.quoteDetail.manageCost = 0;
}
this.computeTotalCost();
},
'quoteDetail.otherCost'(newValue, oldValue){
if (newValue === undefined || newValue === null){
this.quoteDetail.otherCost = 0;
}
this.computeTotalCost();
},
'quoteDetail.profitRate'(newValue, oldValue){
if (newValue === undefined || newValue === null){
this.quoteDetail.profitRate = 0;
}
this.computeProfitAmount();
},
'quoteDetail.taxRate'(newValue, oldValue){
if (newValue === undefined || newValue === null){
this.quoteDetail.taxRate = 0;
}
this.computeTaxCost();
},
}
}
</script>
<template>
<div>
<el-button type="primary" @click="handleQueryAllCost"> </el-button>
<!--系统自动计算结果-->
<el-form :model="quoteDetail" 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=" 10">
<el-col :span="4">
<el-form-item label="材料成本:" prop="partCost" :show-message="false">
<el-input-number style="width: 100%; " :controls="false"
v-model="quoteDetail.partCost" :precision="4" disabled/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="机器成本:" prop="machineCost" :show-message="false">
<el-input-number style="width: 100%; " :controls="false"
v-model="quoteDetail.machineCost" :precision="4" disabled/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="制造费用成本:" prop="fabricateCost" :show-message="false">
<el-input-number style="width: 100%; " :controls="false"
v-model="quoteDetail.fabricateCost" :precision="4" disabled/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="人工成本:" prop="labourCost" :show-message="false">
<el-input-number style="width: 100%;" :controls="false"
v-model="quoteDetail.labourCost" :precision="4" disabled/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="工具成本:" prop="toolCost" :show-message="false">
<el-input-number style="width: 100%;" :controls="false"
v-model="quoteDetail.toolCost" :precision="4" 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=" 10">
<el-col :span="4">
<el-form-item label="材料成本:" prop="adjustPartCost" :show-message="false">
<el-input-number style="width: 100%;" :controls="false"
v-model="quoteDetail.adjustPartCost" :step="0" :precision="4" :min="0"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="机器成本:" prop="adjustMachineCost" :show-message="false">
<el-input-number style="width: 100%;" :controls="false"
v-model="quoteDetail.adjustMachineCost" :step="0" :precision="4" :min="0"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="制造费用成本:" prop="adjustFabricateCost" :show-message="false">
<el-input-number style="width: 100%;" :controls="false"
v-model="quoteDetail.adjustFabricateCost" :step="0" :precision="4" :min="0"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="人工成本:" prop="adjustLabourCost" :show-message="false">
<el-input-number style="width: 100%;" :controls="false"
v-model="quoteDetail.adjustLabourCost" :step="0" :precision="4" :min="0"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="工具成本:" prop="adjustToolCost" :show-message="false">
<el-input-number style="width: 100%;" :controls="false"
v-model="quoteDetail.adjustToolCost" :step="0" :precision="4" :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=" 10">
<el-col :span="4">
<el-form-item label="管理成本:" prop="manageCost" :show-message="false">
<el-input-number style="width: 100%;" :controls="false"
v-model="quoteDetail.manageCost" :step="0" :precision="4" :min="0"/>
</el-form-item>
</el-col>
<!-- <el-col :span="4">-->
<!-- <el-form-item label="包装成本:">-->
<!-- <el-input-number style="width: 100%;" :controls="false"-->
<!-- v-model="copyPackCost" :step="0" :precision="4" :min="0" disabled/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="4">-->
<!-- <el-form-item label="运输成本:">-->
<!-- <el-input-number style="width: 100%; " :controls="false"-->
<!-- v-model="copyShippingCost" :step="0" :precision="4" :min="0" disabled/>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="4">
<el-form-item label="其他成本:" prop="otherCost" :show-message="false">
<el-input-number style="width: 100%; " :controls="false"
v-model="quoteDetail.otherCost" :step="0" :precision="4" :min="0"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="总成本:" prop="totalCost" :show-message="false">
<el-input-number style="width: 100%;" :controls="false"
v-model="quoteDetail.totalCost" :step="0" :precision="4" :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=" 10">
<el-col :span="4">
<el-form-item label="利润率%:" prop="profitRate" :show-message="false">
<el-input-number style="width: 100%;" :controls="false"
v-model="quoteDetail.profitRate" :step="0" :min="0"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="利润额:" prop="profitAmount" :show-message="false">
<el-input-number style="width: 100%;" :controls="false"
v-model="quoteDetail.profitAmount" :step="0" :precision="4" :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=" 10">
<el-col :span="4">
<el-form-item label="未税总额:" prop="totalPrice" :show-message="false">
<el-input-number style="width: 100%;" :controls="false"
v-model="quoteDetail.totalPrice" :step="0" :precision="4" :min="0" disabled/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="未税单价:" prop="unitPrice" :show-message="false">
<el-input-number style="width: 100%;" :controls="false"
v-model="quoteDetail.unitPrice" :step="0" :min="0" :precision="6" disabled/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="税率%:" prop="taxRate" :show-message="false">
<el-input-number style="width: 100%;" :controls="false"
v-model="quoteDetail.taxRate" :step="0" :min="0"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="含税总额:" prop="taxTotalPrice" :show-message="false">
<el-input-number style="width: 100%;" :controls="false"
v-model="quoteDetail.taxTotalPrice" :step="0" :precision="4" :min="0" disabled/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="含税单价:" prop="taxUnitPrice" :show-message="false">
<el-input-number style="width: 100%;" :controls="false"
v-model="quoteDetail.taxUnitPrice" :step="0" :precision="6" :min="0" disabled/>
</el-form-item>
</el-col>
</el-row>
</fieldset>
</el-form>
</div>
</template>
<style scoped>
</style>

363
src/views/modules/quote/detail/primary/quoteDetailTool.vue

@ -0,0 +1,363 @@
<script>
import {
queryQuoteDetailTool,
queryToolList,
removeQuoteDetailTool,
saveQuoteDetailTool, updateQuoteDetailTool
} from "../../../../../api/quote/quoteDetailTool";
export default {
name: "quoteDetailTool",
props:{
quoteDetail:{
type: Object,
required: true
},
},
model:{
prop:"quoteDetail",
event:"update",
},
data(){
return{
queryLoading:false,
dataList:[],
tool:{
toolNo:"",
toolDesc:"",
toolQty:1,
unitCost:0,
expectedServiceLife:0,
quoteUnitCost:0,
remark:""
},
saveTool:{
},
saveVisible:false,
saveLoading:false,
toolVisible:false,
toolRules:{
toolNo: [
{ required: true, message: '请输入工具编码', trigger: ['blur','change'] }
],
toolDesc: [
{ required: true, message: '请输入工具描述', trigger: ['blur','change'] }
],
toolQty: [
{ required: true, message: '请输入工具数量', trigger: ['blur','change'] }
],
unitCost: [
{ required: true, message: '请输入单位成本', trigger: ['blur','change'] }
],
expectedServiceLife: [
{ required: true, message: '请输入预计使用寿命', trigger: ['blur','change'] }
],
quoteUnitCost: [
{ required: true, message: '请输入单位报价成本', trigger: ['blur','change'] }
]
},
toolList:[],
queryTool:{
toolNo: "",
toolDesc: "",
},
}
},
methods:{
handleQueryQuoteDetailTool(){
let params = {
quoteDetailId: this.quoteDetail.id
}
this.queryLoading = true
queryQuoteDetailTool(params).then(({data})=>{
if (data && data.code === 0){
this.dataList = data.rows;
}else {
this.$message.warning(data.msg)
}
this.queryLoading = false
}).catch((error)=>{
this.$message.error(error)
this.queryLoading = false
})
},
handleSave(row){
if (row){
this.saveTool = {...row};
}else {
this.saveTool = {...this.tool};
}
this.saveVisible = true;
},
handleRemove(row){
this.$alert("确定删除该工具吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
let params = {
id: row.id
}
removeQuoteDetailTool(params).then(({data})=>{
if (data && data.code === 0){
this.$message.success("删除成功")
this.handleQueryQuoteDetailTool();
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
}).catch(() => {});
},
computedQuoteUnitCost(){
let quoteUnitCost = this.saveTool.unitCost * this.saveTool.toolQty;
if (isNaN(quoteUnitCost)){
this.saveTool.quoteUnitCost = 0;
return
}
this.saveTool.quoteUnitCost = quoteUnitCost/this.saveTool.expectedServiceLife;
},
handleQueryToolList(flag){
let params = {
site:this.quoteDetail.site,
toolNo:this.queryTool.toolNo,
toolDesc:this.queryTool.toolDesc,
}
queryToolList(params).then(({data})=>{
if (data && data.code === 0){
this.toolList = data.rows;
if (flag){
if (this.toolList.length === 1){
this.handleToolDblClick(this.toolList[0])
}
}
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.$message.error(error)
})
},
handleToolDblClick(row){
this.saveTool.toolNo = row.toolNo;
this.saveTool.toolDesc = row.toolDesc;
this.saveTool.unitCost = row.unitCost;
this.toolVisible = false
},
handleToolNoBlur(){
this.queryTool.toolNo = this.saveTool.toolNo
this.handleQueryToolList(true)
},
handleSaveOrUpdate(){
this.$refs.saveToolForm.validate((valid,obj) => {
if (valid){
if (this.saveTool.id){
this.handleUpdateTool();
}else {
this.handleSaveTool();
}
}else {
let i = 1;
for (let key in obj) {
this.$message.error(obj[key][0].message);
if (i === 1){
return
}
i++;
}
}
})
},
handleUpdateTool(){
let params ={
...this.saveTool,
updateBy:this.$store.state.user.name,
}
this.saveLoading = true
updateQuoteDetailTool(params).then(({data})=>{
this.saveLoading = false
if (data && data.code === 0){
this.$message.success(data.msg)
this.handleQueryQuoteDetailTool();
this.saveVisible = false
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.saveLoading = false
this.$message.error(error)
})
},
handleSaveTool(){
let params = {
...this.saveTool,
createBy: this.$store.state.user.name,
quoteDetailId: this.quoteDetail.id,
quoteId: this.quoteDetail.quoteId,
quoteNo:this.quoteDetail.quoteNo,
site: this.quoteDetail.site,
buNo: this.quoteDetail.buNo,
versionNo:this.quoteDetail.versionNo,
quoteDetailItemNo:this.quoteDetail.itemNo,
}
if (isNaN(this.saveTool.quoteUnitCost)){
params.quoteUnitCost = 0;
}
this.saveLoading = true
saveQuoteDetailTool(params).then(({data})=>{
this.saveLoading = false
if (data && data.code === 0){
this.$message.success(data.msg)
this.handleQueryQuoteDetailTool()
this.saveVisible = false
}else {
this.$message.warning(data.msg)
}
}).catch((error)=>{
this.saveLoading = false
this.$message.error(error)
})
},
},
created() {
if (this.quoteDetail && this.quoteDetail.id){
this.handleQueryQuoteDetailTool();
}
},
watch:{
'quoteDetail.id'(newVal,oldVal){
this.handleQueryQuoteDetailTool();
},
'saveTool.toolQty'(newVal, oldVal){
this.computedQuoteUnitCost();
},
'saveTool.unitCost'(newVal,oldVal){
this.computedQuoteUnitCost();
},
'saveTool.expectedServiceLife'(newVal,oldVal){
this.computedQuoteUnitCost();
},
'toolVisible'(newVal,oldVal){
if (newVal){
this.queryTool={
toolNo: this.saveTool.toolNo,
toolDesc: "",
}
this.handleQueryToolList();
}
}
},
}
</script>
<template>
<div>
<el-button type="primary" @click="handleSave(null)">新增</el-button>
<el-table :data="dataList" v-loading="queryLoading" :height="420" border style="width: 100%;margin-top: 5px" >
<el-table-column label="工具编码" align="left" header-align="center" width="120" prop="toolNo"></el-table-column>
<el-table-column label="工具描述" align="left" header-align="center" width="180" prop="toolDesc"></el-table-column>
<el-table-column label="工具数量" align="right" header-align="center" width="100" prop="toolQty"></el-table-column>
<el-table-column label="单位成本" align="right" header-align="center" prop="unitCost"></el-table-column>
<el-table-column label="预计使用寿命" align="right" header-align="center" prop="expectedServiceLife"></el-table-column>
<el-table-column label="单位报价成本" align="right" header-align="center" prop="quoteUnitCost"></el-table-column>
<el-table-column label="备注" align="left" header-align="center" prop="remark"></el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<a @click="handleSave(scope.row)">编辑</a>
<a @click="handleRemove(scope.row)">删除</a>
</template>
</el-table-column>
</el-table>
<el-dialog title="工具信息" :visible.sync="saveVisible" v-drag width="600px" append-to-body :close-on-click-modal="false">
<el-form :model="saveTool" label-position="top" :rules="toolRules" ref="saveToolForm">
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="工具编码" prop="toolNo" :show-message="false">
<span slot="label">
<a @click="toolVisible = true">工具编码</a>
</span>
<el-input v-model="saveTool.toolNo" @blur="handleToolNoBlur"></el-input>
</el-form-item>
</el-col>
<el-col :span="16">
<el-form-item label="工具描述" prop="toolDesc" :show-message="false">
<el-input v-model="saveTool.toolDesc" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="工具数量" prop="toolQty" :show-message="false">
<el-input-number style="width: 100%" :controls="false" :step="0" :precision="0" v-model="saveTool.toolQty"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="预计使用寿命" prop="expectedServiceLife" :show-message="false">
<el-input-number style="width: 100%" :controls="false" :step="0" :precision="0" v-model="saveTool.expectedServiceLife"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="单位成本" prop="unitCost" :show-message="false">
<el-input-number style="width: 100%" :controls="false" :step="0" :precision="4" v-model="saveTool.unitCost"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单位报价成本" prop="quoteUnitCost" :show-message="false">
<el-input-number style="width: 100%" :controls="false" disabled :step="0" :precision="4" v-model="saveTool.quoteUnitCost"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark" class="auto" :show-message="false">
<el-input type="textarea" v-model="saveTool.remark" :autosize="{minRows: 3, maxRows: 3}"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" :loading="saveLoading" @click="handleSaveOrUpdate"> </el-button>
<el-button @click="saveVisible = false"> </el-button>
</div>
</el-dialog>
<el-dialog title="工具列表" v-drag :visible.sync="toolVisible" width="600px" append-to-body :close-on-click-modal="false">
<el-form :model="queryTool" label-position="top">
<el-row :gutter="10">
<el-col :span="6">
<el-form-item label="工具编码" prop="toolNo" :show-message="false">
<el-input v-model="queryTool.toolNo"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="工具描述" prop="toolDesc" :show-message="false">
<el-input v-model="queryTool.toolDesc"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label=" " :show-message="false">
<el-button type="primary" @click="handleQueryToolList(null)">查询</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table :data="toolList" :height="300" border style="width: 100%;margin-top: 5px" @row-dblclick="handleToolDblClick">
<el-table-column label="工具编码" align="left" header-align="center" min-width="120" prop="toolNo"></el-table-column>
<el-table-column label="工具描述" align="left" header-align="center" min-width="180" prop="toolDesc"></el-table-column>
</el-table>
</el-dialog>
</div>
</template>
<style scoped>
.el-table /deep/ .cell{
height: auto;
line-height: 1.5;
}
.auto /deep/ .el-form-item__content{
height: auto;
line-height: 1.5;
}
</style>

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

@ -1,10 +1,19 @@
<script> <script>
import ProjectPartTable from "../../../../components/selector/table/projectPartTable.vue"; import ProjectPartTable from "../../../../components/selector/table/projectPartTable.vue";
import {queryProjectPart} from "../../../../api/project/projectPart"; import {queryProjectPart} from "../../../../api/project/projectPart";
import {
deleteQuoteDetail,
queryQuoteDetail,
saveQuoteDetail,
updateQuoteDetail
} from "../../../../api/quote/quoteDetail";
import QuoteDetailCost from "./primary/quoteDetailCost.vue";
import QuoteDetailTool from "./primary/quoteDetailTool.vue";
import QuoteDetailBom from "./primary/quoteDetailBom.vue";
export default { export default {
name: "quoteDetail", name: "quoteDetail",
components: {ProjectPartTable},
components: {QuoteDetailBom, QuoteDetailTool, QuoteDetailCost, ProjectPartTable},
props:{ props:{
quote:{ quote:{
type:Object, type:Object,
@ -14,7 +23,6 @@ export default {
type:Number, type:Number,
default:300 default:300
}, },
}, },
data(){ data(){
return{ return{
@ -25,6 +33,27 @@ export default {
projectNo:'', projectNo:'',
projectDesc:'', projectDesc:'',
qty:null, qty:null,
quoteCount:1,
partCost:0,
adjustPartCost:0,
labourCost:0,
adjustLabourCost:0,
fabricateCost:0,
adjustFabricateCost:0,
toolCost:0,
adjustToolCost:0,
machineCost:0,
adjustMachineCost:0,
otherCost:0,
manageCost:0,
totalCost:0,
profitRate:0,
profitAmount:0,
totalPrice:0,
unitPrice:0,
taxRate:13,
taxTotalPrice:0,
taxUnitPrice:0,
remark:'', remark:'',
}, },
saveQuoteDetail:{ saveQuoteDetail:{
@ -32,19 +61,554 @@ export default {
}, },
dataList:[], dataList:[],
saveLoading:false, saveLoading:false,
queryLoading:false,
saveVisible:false, saveVisible:false,
saveQuoteDetailRules:{ saveQuoteDetailRules:{
partNo: [{required: true, message: '请输入物料编码', trigger: ['blur','change']}], partNo: [{required: true, message: '请输入物料编码', trigger: ['blur','change']}],
partDesc: [{required: true, message: '请输入物料名称', trigger: ['blur','change']}], partDesc: [{required: true, message: '请输入物料名称', trigger: ['blur','change']}],
qty: [{required: true, message: '请输入数量', trigger: ['blur','change']}], qty: [{required: true, message: '请输入数量', trigger: ['blur','change']}],
}, },
columns: [
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2PartNo',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'partNo',
headerAlign: 'center',
align: 'left',
columnLabel: '物料编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 200
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2PartDesc',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'partDesc',
headerAlign: 'center',
align: 'left',
columnLabel: '物料名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 200
},
{
userId: this.$store.state.user.name,
functionId: 5011,
serialNumber: '5011Table2Qty',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'qty',
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: 5011,
serialNumber: '5011Table2PartCost',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'partCost',
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: 5011,
serialNumber: '5011Table2MachineCost',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'machineCost',
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: 5011,
serialNumber: '5011Table2LabourCost',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'labourCost',
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: 5011,
serialNumber: '5011Table2FabricateCost',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'fabricateCost',
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: 5011,
serialNumber: '5011Table2tToolCost',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'toolCost',
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: 5011,
serialNumber: '5011Table2AdjustPartCost',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'adjustPartCost',
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: 5011,
serialNumber: '5011Table2AdjustMachineCost',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'adjustMachineCost',
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: 5011,
serialNumber: '5011Table2AdjustLabourCost',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'adjustLabourCost',
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: 5011,
serialNumber: '5011Table2AdjustFabricateCost',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'adjustFabricateCost',
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: 5011,
serialNumber: '5011Table2AdjustToolCost',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'adjustToolCost',
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: 5011,
serialNumber: '5011Table2OtherCost',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'otherCost',
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: 5011,
serialNumber: '5011Table2ManageCost',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'manageCost',
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: 5011,
serialNumber: '5011Table2TotalCost',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'totalCost',
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: 5011,
serialNumber: '5011Table2ProfitRate',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'profitRate',
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: 5011,
serialNumber: '5011Table2ProfitAmount',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'profitAmount',
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: 5011,
serialNumber: '5011Table2UnitPrice',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'unitPrice',
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: 5011,
serialNumber: '5011Table2TotalPrice',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'totalPrice',
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: 5011,
serialNumber: '5011Table2TaxRate',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'taxRate',
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: 5011,
serialNumber: '5011Table2TaxUnitPrice',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'taxUnitPrice',
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: 5011,
serialNumber: '5011Table2TaxTotalPrice',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'taxTotalPrice',
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: 5011,
serialNumber: '5011Table2Status',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'status',
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: 5011,
serialNumber: '5011Table2CreateBy',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'createBy',
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: 5011,
serialNumber: '5011Table2CreateDate',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'createDate',
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: 5011,
serialNumber: '5011Table2UpdateBy',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'updateBy',
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: 5011,
serialNumber: '5011Table2UpdateDate',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'updateDate',
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: 5011,
serialNumber: '5011Table2Remark',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'remark',
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: 5011,
serialNumber: '5011Table2InternalInquiryNo',
tableId: '5011Table2',
tableName: '报价详情信息表',
columnProp: 'internalInquiryNo',
headerAlign: 'center',
align: 'left',
columnLabel: '询价单号',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
],
projectPartVisible:false, projectPartVisible:false,
activeName:'bom',
} }
}, },
methods:{ methods:{
handleSaveQuoteDetail(row){ handleSaveQuoteDetail(row){
this.$nextTick(()=>{ this.$nextTick(()=>{
this.$refs.saveQuoteDetailForm.clearValidate();
if (this.$refs.handleSaveQuoteDetailClick){
this.$refs.saveQuoteDetailForm.clearValidate();
}
}) })
if (row){ if (row){
this.saveQuoteDetail = { this.saveQuoteDetail = {
@ -63,9 +627,33 @@ export default {
this.saveQuoteDetail.projectNo = this.quote.projectNo this.saveQuoteDetail.projectNo = this.quote.projectNo
}) })
} }
this.activeName = 'bom';
this.saveVisible = true; this.saveVisible = true;
}, },
handleDeleteQuoteDetail(row){
this.$alert('确认删除该条报价明细吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let params = {
id: row.id,
}
deleteQuoteDetail(params).then(({data}) => {
if (data && data.code === 0) {
this.$message.success(data.msg);
this.handleQueryQuoteDetail();
} else {
this.$message.warning(data.msg);
}
}).catch((error) => {
this.$message.error(error);
})
}).catch(() => {
})
},
handleDblClick(row){ handleDblClick(row){
this.saveQuoteDetail.partId = row.id;
this.saveQuoteDetail.partNo = row.partNo; this.saveQuoteDetail.partNo = row.partNo;
this.saveQuoteDetail.partDesc = row.partDesc; this.saveQuoteDetail.partDesc = row.partDesc;
this.projectPartVisible = false; this.projectPartVisible = false;
@ -78,8 +666,10 @@ export default {
queryProjectPart(params).then(({data})=>{ queryProjectPart(params).then(({data})=>{
if (data && data.code === 0){ if (data && data.code === 0){
if (data.rows.length === 1){ if (data.rows.length === 1){
this.saveQuoteDetail.partId = data.rows[0].id;
this.saveQuoteDetail.partDesc = data.rows[0].partDesc; this.saveQuoteDetail.partDesc = data.rows[0].partDesc;
}else { }else {
this.saveQuoteDetail.partId = undefined;
this.saveQuoteDetail.partDesc = ''; this.saveQuoteDetail.partDesc = '';
} }
}else { }else {
@ -89,7 +679,96 @@ export default {
this.$message.error(error); this.$message.error(error);
}) })
}, },
handleQueryQuoteDetail(){
let params = {
quoteId: this.quote.id,
}
this.queryLoading = true;
queryQuoteDetail(params).then(({data})=>{
if (data && data.code === 0){
this.dataList = data.rows
}else {
this.$message.warning(data.msg);
}
this.queryLoading = false;
}).catch((error)=>{
this.$message.error(error);
this.queryLoading = false;
})
},
handleSaveQuoteDetailClick(){
this.$refs.saveQuoteDetailForm.validate((valid,obj) => {
if (valid){
if (this.saveQuoteDetail.id){
this.handleUpdate();
}else {
this.handleSave();
}
}else {
}
})
},
handleSave(){
let params = {
...this.saveQuoteDetail,
quoteId: this.quote.id,
quoteNo:this.quote.quoteNo,
site:this.quote.site,
buNo:this.quote.buNo,
versionNo:this.quote.versionNo,
createBy:this.saveQuoteDetail.createBy,
active:'Y',
status:'草稿',
}
this.saveLoading = true;
saveQuoteDetail(params).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg);
this.handleQueryQuoteDetail();
if (this.saveQuoteDetail.isDetail){
this.saveQuoteDetail = {
...data.row,
}
}else {
this.saveVisible = false;
}
}else {
this.$message.warning(data.msg);
}
this.saveLoading = false
}).catch((error)=>{
this.$message.error(error);
this.saveLoading = false
})
},
handleUpdate(){
let params = {
...this.saveQuoteDetail,
updateBy:this.$store.state.user.name,
}
updateQuoteDetail(params).then(({data})=>{
if (data && data.code === 0){
this.$message.success(data.msg);
this.handleQueryQuoteDetail();
this.saveVisible = false;
}else {
this.$message.warning(data.msg);
}
}).catch((error)=>{
this.$message.error(error);
})
},
}, },
watch:{
quote(newVal,oldVal){
if (newVal.id){
this.handleQueryQuoteDetail();
}else {
this.dataList = [];
}
},
}
} }
</script> </script>
@ -97,18 +776,40 @@ export default {
<div> <div>
<el-button type="primary" @click="handleSaveQuoteDetail(null)">新增</el-button> <el-button type="primary" @click="handleSaveQuoteDetail(null)">新增</el-button>
<el-table border :data="dataList" style="width: 100%;margin-top: 5px" :height="height">
<el-table v-loading="queryLoading" border :data="dataList" style="width: 100%;margin-top: 5px" :height="height">
<el-table-column type="index" width="55" align="center" label="序号"></el-table-column>
<el-table-column
v-for="(item,index) in columns" :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-column label="操作" fixed="right" align="center" width="120">
<template slot-scope="scope">
<a type="text" @click="handleSaveQuoteDetail(scope.row)">编辑</a>
<a type="text" @click="handleDeleteQuoteDetail(scope.row)">删除</a>
</template>
</el-table-column>
</el-table> </el-table>
<el-dialog :title="`报价明细`" v-drag :visible.sync="saveVisible" :width="`${saveQuoteDetail.id?1200:600}px`" modal-append-to-body :close-on-click-modal="false">
<el-dialog :title="`报价明细`" top="10vh" v-drag :visible.sync="saveVisible" append-to-body :width="`${saveQuoteDetail.id?1200:600}px`" :close-on-click-modal="false">
<el-form :model="saveQuoteDetail" ref="saveQuoteDetailForm" :rules="saveQuoteDetailRules" label-position="top" v-if="!saveQuoteDetail.id"> <el-form :model="saveQuoteDetail" ref="saveQuoteDetailForm" :rules="saveQuoteDetailRules" label-position="top" v-if="!saveQuoteDetail.id">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="物料名称" prop="partNo" :show-message="false"> <el-form-item label="物料名称" prop="partNo" :show-message="false">
<span slot="label"> <span slot="label">
<a @click="projectPartVisible = true">物料名称</a> <a @click="projectPartVisible = true">物料名称</a>
</span>
</span>
<el-input v-model="saveQuoteDetail.partNo" @blur="handlePartNoBlur"></el-input> <el-input v-model="saveQuoteDetail.partNo" @blur="handlePartNoBlur"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -131,13 +832,53 @@ export default {
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注" class="auto" :show-message="false"> <el-form-item label="备注" class="auto" :show-message="false">
<el-input type="textarea" v-model="saveQuoteDetail.remark"></el-input>
<el-input type="textarea" v-model="saveQuoteDetail.remark" :autosize="{minRows: 3, maxRows: 3}"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<el-form v-else :model="saveQuoteDetail" ref="saveQuoteDetailForm" :rules="saveQuoteDetailRules" label-position="top">
<el-row :gutter="20">
<el-col :span="4">
<el-form-item label="物料名称" prop="partNo" :show-message="false">
<el-input v-model="saveQuoteDetail.partNo" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="物料描述" prop="partDesc" :show-message="false">
<el-input v-model="saveQuoteDetail.partDesc" disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="报价数量" prop="qty" :show-message="false">
<el-input-number v-model="saveQuoteDetail.qty" style="width: 100%;" :controls="false" disabled></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="备注" class="auto" :show-message="false">
<el-input type="textarea" resize="none" :autosize="{minRows: 3, maxRows: 3}" v-model="saveQuoteDetail.remark" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-tabs v-model="activeName" v-if="saveQuoteDetail.id">
<el-tab-pane label="材料" name="bom">
<quote-detail-bom v-if="saveVisible" v-model:quoteDetail="saveQuoteDetail"></quote-detail-bom>
</el-tab-pane>
<el-tab-pane label="工艺" name="routing"></el-tab-pane>
<el-tab-pane label="工具" name="tool">
<quote-detail-tool v-if="saveVisible" v-model:quoteDetail="saveQuoteDetail"></quote-detail-tool>
</el-tab-pane>
<el-tab-pane label="其他成本" name="other"></el-tab-pane>
<el-tab-pane label="成本&价格" name="cost">
<quote-detail-cost v-model:quoteDetail="saveQuoteDetail"></quote-detail-cost>
</el-tab-pane>
</el-tabs>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" > </el-button>
<el-button type="primary" :loading="saveLoading" @click="handleSaveQuoteDetailClick"> </el-button>
<el-button @click="saveVisible = false"> </el-button> <el-button @click="saveVisible = false"> </el-button>
</div> </div>
</el-dialog> </el-dialog>

100
src/views/modules/quote/index.vue

@ -392,9 +392,19 @@ export default {
}, },
customerVisible:false, customerVisible:false,
projectVisible:false, projectVisible:false,
quoterVisible:false,
purchaseVisible:false,
currentQuote:{ currentQuote:{
}
},
userVisible:false,
userTitle:'人员信息',
user:{
username:'',
userDisplay:'',
active:'',
},
userDataList:[],
} }
}, },
methods:{ methods:{
@ -411,6 +421,8 @@ export default {
this.total = data.total this.total = data.total
if (this.total > 0){ if (this.total > 0){
this.currentQuote = {...this.dataList[0]} this.currentQuote = {...this.dataList[0]}
}else {
this.currentQuote = {}
} }
}else { }else {
this.$message.error(data.message) this.$message.error(data.message)
@ -607,6 +619,29 @@ export default {
}, },
handleRowClick(row){ handleRowClick(row){
this.currentQuote = {...row} this.currentQuote = {...row}
},
userDblClick(row){
if (this.quoterVisible){
this.saveQuote.quoter = row.username
this.quoterVisible = false
}else if (this.purchaseVisible){
this.saveQuote.purchase = row.username
this.purchaseVisible = false
}
},
handleQuoterClick(){
this.userTitle = '报价专员'
this.user.username = this.saveQuote.quoter
this.user.userDisplay = ''
this.user.active = ''
this.userVisible = true
},
handlePurchaseClick(){
this.userTitle = '采购专员'
this.user.username = this.saveQuote.purchase
this.user.userDisplay = ''
this.user.active = ''
this.userVisible = true
} }
}, },
created() { created() {
@ -721,11 +756,17 @@ export default {
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="报价专员" prop="quoter" :show-message="false"> <el-form-item label="报价专员" prop="quoter" :show-message="false">
<span slot="label">
<a @click="handleQuoterClick" >报价专员</a>
</span>
<el-input v-model="saveQuote.quoter"></el-input> <el-input v-model="saveQuote.quoter"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="采购专员" prop="purchase" :show-message="false"> <el-form-item label="采购专员" prop="purchase" :show-message="false">
<span slot="label">
<a @click="handlePurchaseClick" >采购专员</a>
</span>
<el-input v-model="saveQuote.purchase"></el-input> <el-input v-model="saveQuote.purchase"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -742,6 +783,63 @@ export default {
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :title="userTitle" v-drag :visible.sync="userVisible" width="500px" modal-append-to-body :close-on-click-modal="false">
<el-form :model="user" label-position="top">
<el-row :gutter="10">
<el-col :span="6">
<el-form-item label="用户账号" prop="name">
<el-input v-model="user.username"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="用户名" prop="name">
<el-input v-model="user.userDisplay"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="是否在用">
<el-select filterable v-model="user.active" style="width: 100%">
<el-option label="全部" value=""></el-option>
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label=" ">
<el-button type="primary">查询</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-table
:height="300"
:data="userDataList"
stripe
highlight-current-row
border
@row-dblclick="userDblClick"
style="width: 100%;">
<el-table-column
prop="username"
header-align="center"
align="center"
label="用户账号">
</el-table-column>
<el-table-column
prop="userDisplay"
header-align="center"
align="center"
label="用户名">
</el-table-column>
<el-table-column
prop="active"
header-align="center"
align="center"
label="是否在用">
</el-table-column>
</el-table>
</el-dialog>
<customer-table ref="customerTable" v-if="saveVisible" v-model="customerVisible" :height="300" @dblclick="customerDblClick" :customer-no="saveQuote.customerNo"></customer-table> <customer-table ref="customerTable" v-if="saveVisible" v-model="customerVisible" :height="300" @dblclick="customerDblClick" :customer-no="saveQuote.customerNo"></customer-table>
<project-table ref="projectTable" v-if="saveVisible" v-model="projectVisible" :height="300" @dblclick="projectDblClick" :customer-no="saveQuote.customerNo" :project-no="saveQuote.projectNo" :bu-id="saveQuote.buId"></project-table> <project-table ref="projectTable" v-if="saveVisible" v-model="projectVisible" :height="300" @dblclick="projectDblClick" :customer-no="saveQuote.customerNo" :project-no="saveQuote.projectNo" :bu-id="saveQuote.buId"></project-table>
</div> </div>

Loading…
Cancel
Save