-
-
-
+ {this.$refs.modeForm.resetFields()}" v-drag :visible.sync="modalFlag" width="30vw">
+
+
+
-
-
+
+
-
-
-
+
+
-
-
-
-
-
+
+
@@ -373,8 +376,10 @@
} from "@/api/base/properties.js"
import Chooselist from '@/views/modules/common/Chooselist'
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
+ import DictDataSelect from "../../sys/dict-data-select.vue";
export default {
components: {
+ DictDataSelect,
Chooselist
},
watch: {
@@ -514,7 +519,7 @@
columnProp: 'active',
headerAlign: "center",
align: "center",
- columnLabel: '在用',
+ columnLabel: '状态',
columnHidden: false,
columnImage: false,
columnSortable: false,
@@ -747,21 +752,21 @@
itemSelections1: [],
itemSelections2: [],
rules:{
- codeNoType:[
+ codeNo:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
- codeDescType:[
+ codeDesc:[
{
required: true,
message: ' ',
trigger: 'change'
}
],
- activeType:[
+ active:[
{
required: true,
message: ' ',
@@ -926,7 +931,7 @@
return false
}
if (this.modalData.active == '' || this.modalData.active == null) {
- this.$alert('选择是否在用!', '错误', {
+ this.$alert('选择状态!', '错误', {
confirmButtonText: '确定'
})
return false
diff --git a/src/views/modules/quotation/sellForQuotation/quotationDetail/billOfMateriel.vue b/src/views/modules/quotation/sellForQuotation/quotationDetail/billOfMateriel.vue
index 0f5bce0..4daca29 100644
--- a/src/views/modules/quotation/sellForQuotation/quotationDetail/billOfMateriel.vue
+++ b/src/views/modules/quotation/sellForQuotation/quotationDetail/billOfMateriel.vue
@@ -275,11 +275,11 @@ export default {
this.$message.warning(data.msg)
}
this.treeLoading = false;
- this.$emit("update:loadingStatus",this.treeLoading)
+ // this.$emit("update:loadingStatus",this.treeLoading)
}).catch((error)=>{
this.$message.error(error)
this.treeLoading = false;
- this.$emit("update:loadingStatus",this.treeLoading)
+ // this.$emit("update:loadingStatus",this.treeLoading)
})
},
changeSelect(val){
@@ -351,10 +351,10 @@ export default {
this.$message.warning(data.msg)
}
this.dataListLoading = false;
- this.$emit("update:loadingStatus",this.dataListLoading)
+ // this.$emit("update:loadingStatus",this.dataListLoading)
}).catch((error)=>{
this.dataListLoading = false;
- this.$emit("update:loadingStatus",this.dataListLoading)
+ // this.$emit("update:loadingStatus",this.dataListLoading)
this.$message.error(error)
})
}else {
@@ -367,11 +367,11 @@ export default {
this.$message.warning(data.msg)
}
this.dataListLoading = false;
- this.$emit("update:loadingStatus",this.dataListLoading)
+ // this.$emit("update:loadingStatus",this.dataListLoading)
}).catch((error)=>{
this.$message.error(error)
this.dataListLoading = false;
- this.$emit("update:loadingStatus",this.dataListLoading)
+ // this.$emit("update:loadingStatus",this.dataListLoading)
})
}
},
@@ -390,10 +390,10 @@ export default {
// 报价数量
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()
+ bomDetail.quoteUnitCost = new Decimal(needNum.mul(unitCost).toFixed(6,Decimal.ROUND_HALF_UP)).toSignificantDigits().toNumber()
}
this.$emit("update:totalCost",this.getQuoteBomCost())
- this.$emit("update:loadingStatus",false)
+ // this.$emit("update:loadingStatus",false)
},
getQuoteBomCost(){
// this.searchQuoteBomList();
diff --git a/src/views/modules/quotation/sellForQuotation/quotationDetail/costPrice.vue b/src/views/modules/quotation/sellForQuotation/quotationDetail/costPrice.vue
index 184b290..4ffa226 100644
--- a/src/views/modules/quotation/sellForQuotation/quotationDetail/costPrice.vue
+++ b/src/views/modules/quotation/sellForQuotation/quotationDetail/costPrice.vue
@@ -32,14 +32,21 @@ export default {
type:Number,
default:0,
},
+ machineCost:{
+ type:Number,
+ default:0,
+ },
+ laborCost:{
+ type:Number,
+ default:0,
+ },
+ manufacturingCost:{
+ type:Number,
+ default:0,
+ }
},
data() {
return {
- machineCost:0,
- fabricateCost:0,
- labourCost: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']}],
@@ -113,23 +120,27 @@ export default {
this.copyDetail.computePartCost = new Decimal(this.bomCost).mul(new Decimal(this.detail.quotationDetailQuantity))
this.copyDetail.adjustPartCost = new Decimal(this.bomCost).mul(new Decimal(this.detail.quotationDetailQuantity))
// 机器成本
- this.copyDetail.computeMachineCost = this.machineCost
- this.copyDetail.adjustMachineCost = this.machineCost
+ this.copyDetail.computeMachineCost = new Decimal(this.machineCost).mul(new Decimal(this.detail.quotationDetailQuantity))
+ this.copyDetail.adjustMachineCost = new Decimal(this.machineCost).mul(new Decimal(this.detail.quotationDetailQuantity))
// 制作费用
- this.copyDetail.computedFabricateCost = this.fabricateCost
- this.copyDetail.adjustFabricateCost = this.fabricateCost
+ this.copyDetail.computedFabricateCost = new Decimal(this.manufacturingCost).mul(new Decimal(this.detail.quotationDetailQuantity))
+ this.copyDetail.adjustFabricateCost = new Decimal(this.manufacturingCost).mul(new Decimal(this.detail.quotationDetailQuantity))
// 人工费用
- this.copyDetail.computeLabourCost = this.labourCost
- this.copyDetail.adjustLabourCost = this.labourCost
+ this.copyDetail.computeLabourCost = new Decimal(this.laborCost).mul(new Decimal(this.detail.quotationDetailQuantity))
+ this.copyDetail.adjustLabourCost = new Decimal(this.laborCost).mul(new Decimal(this.detail.quotationDetailQuantity))
// 工具成本
this.copyDetail.computeToolCost = new Decimal(this.toolCost).mul(new Decimal(this.detail.quotationDetailQuantity))
this.copyDetail.adjustToolCost = new Decimal(this.toolCost).mul(new Decimal(this.detail.quotationDetailQuantity))
// 其他成本
- this.copyDetail.detailOtherCost = new Decimal(this.shippingCost).add(new Decimal(this.packCost)).mul(new Decimal(this.detail.quotationDetailQuantity)).toSignificantDigits().toNumber()
+ this.copyDetail.detailOtherCost = new Decimal(new Decimal(new Decimal(this.shippingCost).add(new Decimal(this.packCost)).mul(new Decimal(this.detail.quotationDetailQuantity))).toFixed(6,Decimal.ROUND_HALF_UP)).toSignificantDigits().toNumber()
// 管理成本
- this.copyDetail.detailManageCost = 0;
+ if (!this.copyDetail.detailManageCost){
+ this.copyDetail.detailManageCost = 0;
+ }
// 利润率
- this.copyDetail.detailProfitRate = 0;
+ if (!this.copyDetail.detailProfitRate){
+ this.copyDetail.detailProfitRate = 0;
+ }
this.computeAllCost();
},
computeAllCost(){
diff --git a/src/views/modules/quotation/sellForQuotation/quotationDetail/quoteRouting.vue b/src/views/modules/quotation/sellForQuotation/quotationDetail/quoteRouting.vue
index 4012860..d51b6b1 100644
--- a/src/views/modules/quotation/sellForQuotation/quotationDetail/quoteRouting.vue
+++ b/src/views/modules/quotation/sellForQuotation/quotationDetail/quoteRouting.vue
@@ -30,6 +30,18 @@ export default {
type:Boolean,
default:false,
},
+ machineCost:{
+ type:Number,
+ default:0,
+ },
+ laborCost:{
+ type:Number,
+ default:0,
+ },
+ manufacturingCost:{
+ type:Number,
+ default:0,
+ }
},
computed:{
RoutingAllSearchFlag:{
@@ -210,6 +222,23 @@ export default {
status: true,
fixed: '',
columnWidth: 200,
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 102003,
+ serialNumber: '102003Table5WorkCenterCost',
+ tableId: "102003Table5",
+ tableName: "报价工艺信息",
+ columnProp: 'workCenterCost',
+ headerAlign: "center",
+ align: "left",
+ columnLabel: '加工中心成本',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ columnWidth: 80,
},{
userId: this.$store.state.user.name,
functionId: 102003,
@@ -354,7 +383,7 @@ export default {
tableName: "报价工艺信息",
columnProp: 'laborClassNo',
headerAlign: "center",
- align: "right",
+ align: "left",
columnLabel: '人员等级',
columnHidden: false,
columnImage: false,
@@ -371,7 +400,7 @@ export default {
tableName: "报价工艺信息",
columnProp: 'setupLaborClassNo',
headerAlign: "center",
- align: "right",
+ align: "left",
columnLabel: '调机人员等级',
columnHidden: false,
columnImage: false,
@@ -380,6 +409,74 @@ export default {
status: true,
fixed: '',
columnWidth: 100,
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 102003,
+ serialNumber: '102003Table5LaborClassCost',
+ tableId: "102003Table5",
+ tableName: "报价工艺信息",
+ columnProp: 'LaborClassCost',
+ headerAlign: "center",
+ align: "left",
+ columnLabel: '人员等级成本',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ columnWidth: 100,
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 102003,
+ serialNumber: '102003Table5SetupLaborClassCost',
+ tableId: "102003Table5",
+ tableName: "报价工艺信息",
+ columnProp: 'setupLaborClassCost',
+ headerAlign: "center",
+ align: "left",
+ columnLabel: '调机人员等级成本',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ columnWidth: 100,
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 102003,
+ serialNumber: '102003Table5MachineCost',
+ tableId: "102003Table5",
+ tableName: "报价工艺信息",
+ columnProp: 'machineCost',
+ headerAlign: "center",
+ align: "right",
+ columnLabel: '单位机器成本',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ columnWidth: 140,
+ },{
+ userId: this.$store.state.user.name,
+ functionId: 102003,
+ serialNumber: '102003Table5LaborCosts',
+ tableId: "102003Table5",
+ tableName: "报价工艺信息",
+ columnProp: 'laborCosts',
+ headerAlign: "center",
+ align: "right",
+ columnLabel: '单位人工成本',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ columnWidth: 140,
},{
userId: this.$store.state.user.name,
functionId: 102003,
@@ -395,8 +492,8 @@ export default {
columnSortable: false,
sortLv: 0,
status: true,
- fixed: '',
- columnWidth: 100,
+ fixed: 'right',
+ columnWidth: 140,
},
],
versionData:{},
@@ -435,44 +532,6 @@ export default {
this.$emit("update:loadingStatus",this.treeLoading)
})
},
- changeSelect(){
- if (this.selectRouting.length === 0){
- this.updateQuoteRoutingList();
- return
- }
- this.$confirm('此操作将更换工艺信息, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.updateQuoteRoutingList();
- }).catch(() => {
- this.selectRouting = JSON.parse(JSON.stringify(this.copyRouting))
- this.$nextTick(()=>{
- this.$refs.tree.setCurrentKey(`${this.selectRouting[0]}-${this.selectRouting[1]}-${this.selectRouting[2]}-${this.selectRouting[3]}-${this.selectRouting[4]}-${this.selectRouting[5]}`)
- })
- });
- },
- updateQuoteRoutingList(){
- let params = {
- site:this.$store.state.user.site,
- testPartNo: this.detail.productNo,
- version:this.selectRouting[0],
- routingType:this.selectRouting[1],
- alternativeNo:this.selectRouting[2],
- quoteDetailId:this.detail.quotationDetailId
- }
- updateQuoteRoutingList(params).then(({data})=>{
- if (data && data.code === 0){
- this.$message.success(data.msg)
- this.searchQuoteRoutingList();
- }else {
- this.$message.warning(data.msg)
- }
- }).catch((error)=>{
- this.$message.error(error)
- })
- },
setSelectRouting(val){
if (val.length === 0){
this.getRoutingTreeStructure();
@@ -514,6 +573,7 @@ export default {
if (data && data.code === 0){
this.routingDetailList = data.rows
this.computedQuoteRoutingCost();
+ this.computedTotalCost();
}else {
this.$message.warning(data.msg)
}
@@ -525,14 +585,82 @@ export default {
})
}
},
+ computedTotalCost(){
+ let machineCost = 0;
+ let laborCost = 0;
+ for (let i = 0; i < this.routingDetailList.length; i++) {
+ let detail = this.routingDetailList[i];
+ machineCost += new Decimal(detail.machineCost).toNumber();
+ laborCost += new Decimal(detail.laborCosts).toNumber();
+ }
+ this.$emit("update:machineCost",machineCost)
+ this.$emit("update:laborCost",laborCost)
+ },
computedQuoteRoutingCost(){
for (let i = 0; i < this.routingDetailList.length; i++) {
this.setRunTimeDesc(i);
let detail = this.routingDetailList[i];
- // detail.machineCost 机器成本
+ this.routingDetailList[i].machineCost = new Decimal(new Decimal(this.getMachineCost(detail)).toFixed(6,Decimal.ROUND_HALF_UP)).toSignificantDigits().toNumber();
+ // detail.manufacturingCosts 制造费用
// detail.laborCosts 人工成本
- detail.laborCosts = new Decimal(detail.laborClassCost)
+ this.routingDetailList[i].laborCosts = new Decimal(new Decimal(this.getLaborCost(detail)).toFixed(6,Decimal.ROUND_HALF_UP)).toSignificantDigits().toNumber();
+ // detail.laborCosts = new Decimal(detail.laborClassCost)
+ this.routingDetailList[i].quoteUnitCost = new Decimal(new Decimal(this.routingDetailList[i].machineCost).add(this.routingDetailList[i].laborCosts).toFixed(6,Decimal.ROUND_HALF_UP)).toSignificantDigits().toNumber()
+ }
+ },
+ getLaborCost(row){
+ let unitTime = 0;// 人工单位生产时间
+ switch (row.runTimeDesc){
+ case "小时":
+ unitTime = row.laborRunFactor;
+ break
+ case "小时/单位":
+ unitTime = row.laborRunFactor;
+ break
+ case "单位/小时":
+ if (row.laborRunFactor !== 0){
+ unitTime = new Decimal(1).div(new Decimal(row.laborRunFactor)).toNumber();
+ }
+ break
+ default:{
+ unitTime = 0;
+ }
+ }
+ let laborNeedTime = new Decimal(unitTime).mul(new Decimal(row.efficiencyFactor).div(new Decimal(100))).toNumber();
+ return new Decimal(new Decimal(row.laborSetupTime)
+ .mul(new Decimal(row.setupLaborClassCost)
+ .mul(new Decimal(row.setupCrewSize).div(this.detail.quotationDetailQuantity))))
+ .add(new Decimal(laborNeedTime)
+ .mul(new Decimal(row.laborClassCost)
+ .mul(row.crewSize))).toNumber()
+ },
+ getManufacturingCosts(row){
+ let unitTime = 0;
+ },
+ getMachineCost(row){
+ // detail.machineCost 机器成本 machRunFactor机器运行速度
+ // 计算单位生产时间
+ let unitTime = 0;
+ switch (row.runTimeDesc){
+ case "小时":
+ unitTime = row.machRunFactor;
+ break
+ case "小时/单位":
+ unitTime = row.machRunFactor;
+ break
+ case "单位/小时":
+ if (row.machRunFactor !== 0){
+ unitTime = new Decimal(1).div(new Decimal(row.machRunFactor)).toNumber();
+ }
+ break
+ default:{
+ unitTime = 0;
+ }
}
+ // 计算 机器需求生产时间
+ let workNeedTime = new Decimal(unitTime).mul(new Decimal(row.efficiencyFactor).div(new Decimal(100))).toNumber();
+ // 单位机器成本
+ return new Decimal(row.workCenterCost).mul(new Decimal(row.machSetupTime)).add(new Decimal(row.workCenterCost).mul(workNeedTime)).toNumber();
},
setRunTimeDesc(i){
switch (this.routingDetailList[i].runTimeCode){
diff --git a/src/views/modules/quotation/sellForQuotation/quoteDetail.vue b/src/views/modules/quotation/sellForQuotation/quoteDetail.vue
index 91728bb..c6809b2 100644
--- a/src/views/modules/quotation/sellForQuotation/quoteDetail.vue
+++ b/src/views/modules/quotation/sellForQuotation/quoteDetail.vue
@@ -61,6 +61,9 @@ export default {
allSearchFlagRouting:false,
BOMCost:0,
ToolCost:0,
+ machineCost:0,
+ laborCost:0,
+ manufacturingCost:0,
packInfoCost:0,
shippingInfoCost:0,
loadingStatus:false,
@@ -1090,7 +1093,7 @@ export default {
-
+
@@ -1100,7 +1103,9 @@ export default {
-
+
@@ -329,9 +329,12 @@
-
+
+
+
+
@@ -614,6 +617,9 @@
+
+
+
@@ -994,9 +1000,12 @@
import {selectTestSoRoutingList} from "../../../api/test/testSoRouting";
import TestAttribute from "./testSoAttribute/testAttribute.vue";
import {partPropertiesList} from "../../../api/base/properties";
+ import TestProperties from "./testAttribute/testProperties.vue";
+ import {getTestPropertiesList} from "../../../api/test/testProperties";
export default {
name:"test",
components: {
+ TestProperties,
TestAttribute,
TestRoutingTable,
TestTable,
@@ -1026,6 +1035,7 @@
attributeList:[],
testSoRoutingList:[],
testSoBomList:[],
+ testPropertiesList:[],
activeTab:'part',
activeTabList:['part'],
clickTestRow:false,
@@ -2029,6 +2039,11 @@
// 刷新列表数据
this.refreshCurrentTabTable()
},
+ dialogTabClick(){
+ // if (this.activeTab === 'attribute') {
+ // this.getTestProperties();
+ // }
+ },
/**
* 当前值发生变化的时候修改
* @param row
@@ -2193,7 +2208,7 @@
nextToDo: row.nextToDo,
updateBy: this.$store.state.user.name
}
- this.activeTabList = ['part','product','process','attribute']
+ this.activeTabList = ['part','product','process','attribute','partAttribute']
this.$nextTick(()=>{
this.$refs.dialogSoBom.clearTable();
})
@@ -2328,7 +2343,7 @@
testInformationSave(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList();
- this.activeTabList = ['part','product','process','attribute']
+ this.activeTabList = ['part','product','process','attribute','partAttribute']
this.activeTab = 'product'
this.modalData.testNo = data.row
// this.modalFlag = false
@@ -2410,6 +2425,7 @@
this.selectTestSoBom()
this.selectTestSoRoutingList()
this.getPartPropertiesList();
+ this.getTestProperties();
}
},
/**
@@ -2949,6 +2965,21 @@
}
})
},
+ getTestProperties(){
+ let params = {
+ site:this.$store.state.user.site,
+ testNo: this.testCurrentRow.testNo
+ }
+ getTestPropertiesList(params).then(({data})=>{
+ if (data && data.code === 0){
+ this.testPropertiesList = data.rows;
+ }else {
+ this.$message.warning(data.msg)
+ }
+ }).catch((error)=>{
+ this.$message.error(error)
+ })
+ },
getPartPropertiesList(){
let params = {
site:this.$store.state.user.site,
diff --git a/src/views/modules/test/testAttribute/testProperties.vue b/src/views/modules/test/testAttribute/testProperties.vue
new file mode 100644
index 0000000..bc813a6
--- /dev/null
+++ b/src/views/modules/test/testAttribute/testProperties.vue
@@ -0,0 +1,321 @@
+
+
+
+
+
+ 刷新属性
+ 编辑
+
+
+
+
+ {{ scope.row[item.columnProp] }}
+
+
+
+
+
+
+
+
+
+
+
{{ scope.row[item.columnProp] }}
+
![]()
+
+
+
+
+
+
+
+ 保存
+ 关闭
+
+
+
+
+
+