From 391044ae9db4da7501e7c4231d1c42cdc3d83abb Mon Sep 17 00:00:00 2001 From: zelian_wu Date: Tue, 20 Feb 2024 13:36:16 +0800 Subject: [PATCH] =?UTF-8?q?2024-02-20=20=E6=B5=8B=E8=AF=95=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E4=BA=A7=E5=93=81=E7=BB=93=E6=9E=84,=E5=B7=A5?= =?UTF-8?q?=E8=89=BA=E8=B7=AF=E7=BA=BF,=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/base/properties.js | 2 + src/api/part/umInformation.js | 1 + .../sellForQuotation/quotationDetail.vue | 2 + src/views/modules/test/requestForTest.vue | 49 ++- .../test/testSoAttribute/testAttribute.vue | 354 ++++++++++++++++++ .../modules/test/testSoBom/testTable.vue | 152 +++++--- .../test/testSoRouting/testRoutingTable.vue | 278 +++++++++----- 7 files changed, 673 insertions(+), 165 deletions(-) create mode 100644 src/views/modules/test/testSoAttribute/testAttribute.vue diff --git a/src/api/base/properties.js b/src/api/base/properties.js index c0d469b..cc4bc98 100644 --- a/src/api/base/properties.js +++ b/src/api/base/properties.js @@ -2,6 +2,7 @@ import { createAPI } from "@/utils/httpRequest.js"; export const propertiesItemSearch = data => createAPI(`/properties/propertiesItemSearch`,'post',data) export const propertiesItemList = data => createAPI(`/properties/propertiesItemList`,'get',data) +export const propertiesList = data => createAPI(`/properties/propertiesList`,'get',data) export const propertiesAvailableList = data => createAPI(`/properties/propertiesAvailableList`,'get',data) export const propertiesItemSave = data => createAPI(`/properties/propertiesItemSave`,'post',data) export const propertiesItemEdit = data => createAPI(`/properties/propertiesItemEdit`,'post',data) @@ -12,6 +13,7 @@ export const propertiesModelSave = data => createAPI(`/properties/propertiesMode export const propertiesModelEdit = data => createAPI(`/properties/propertiesModelEdit`,'post',data) export const propertiesModelDelete = data => createAPI(`/properties/propertiesModelDelete`,'post',data) export const searchModalDetails = data => createAPI(`/properties/searchModalDetails`,'post',data) +export const partPropertiesList = data => createAPI(`/properties/partPropertiesList`,'get',data) export const saveModalDetails = data => createAPI(`/properties/saveModalDetails`,'post',data) export const deleteModalDetails = data => createAPI(`/properties/deleteModalDetails`,'post',data) // 多选删除 export const getItemLists = data => createAPI(`/properties/getItemLists`,'post',data) diff --git a/src/api/part/umInformation.js b/src/api/part/umInformation.js index c19458d..a5e6fef 100644 --- a/src/api/part/umInformation.js +++ b/src/api/part/umInformation.js @@ -13,6 +13,7 @@ export const umInformationSearch = data => createAPI(`/plm/umInformation/umInfor * @returns {*} */ export const searchUmInformationList = data =>createAPI(`/plm/umInformation/searchUmInformationList`,'get',data); +export const searchAllUmInformationList = data =>createAPI(`/plm/umInformation/searchAllUmInformationList`,'get',data); /** * 单位信息新增 * @param data diff --git a/src/views/modules/quotation/sellForQuotation/quotationDetail.vue b/src/views/modules/quotation/sellForQuotation/quotationDetail.vue index 118789a..143192e 100644 --- a/src/views/modules/quotation/sellForQuotation/quotationDetail.vue +++ b/src/views/modules/quotation/sellForQuotation/quotationDetail.vue @@ -1350,6 +1350,8 @@ + + diff --git a/src/views/modules/test/requestForTest.vue b/src/views/modules/test/requestForTest.vue index 159e481..cfd023c 100644 --- a/src/views/modules/test/requestForTest.vue +++ b/src/views/modules/test/requestForTest.vue @@ -121,7 +121,7 @@ width="100" label="操作"> @@ -304,11 +304,14 @@ - + + + + @@ -583,11 +586,14 @@ - + + + + @@ -863,7 +869,7 @@ - + @@ -890,7 +896,7 @@ downLoadQuotationFile, // 文件下载 searchProjectInfoList } from '@/api/quotation/quotationInformation.js' - import Chooselist from '@/views/modules/common/Chooselist' + import ChooseList from '@/views/modules/common/Chooselist' import testUploadFile from "./test_upload_file" import DictDataSelect from "../sys/dict-data-select.vue"; import { @@ -902,12 +908,16 @@ import TestTable from "./testSoBom/testTable.vue"; import TestRoutingTable from "./testSoRouting/testRoutingTable.vue"; import {selectTestSoRoutingList} from "../../../api/test/testSoRouting"; + import TestAttribute from "./testSoAttribute/testAttribute.vue"; + import {partPropertiesList} from "../../../api/base/properties"; export default { + name:"test", components: { + TestAttribute, TestRoutingTable, TestTable, DictDataSelect, - Chooselist, + ChooseList, testUploadFile }, watch: { @@ -929,6 +939,7 @@ }, data () { return { + attributeList:[], testSoRoutingList:[], testSoBomList:[], activeTab:'part', @@ -973,7 +984,7 @@ // ======== 数据对象 ======== modalData: { flag: '1', - title: '测试新增', + title: '测试申请', site: this.$store.state.user.site, testNo: '', customerNo: '', @@ -1966,7 +1977,7 @@ updateModal (row) { this.modalData = { flag: '2', - title: '测试编辑', + title: '测试申请', site: row.site, testNo: row.testNo, customerNo: row.customerNo, @@ -2003,7 +2014,7 @@ nextToDo: row.nextToDo, updateBy: this.$store.state.user.name } - this.activeTabList = ['part','product','process'] + this.activeTabList = ['part','product','process','attribute'] this.$nextTick(()=>{ this.$refs.dialogSoBom.clearTable(); }) @@ -2138,7 +2149,7 @@ testInformationSave(this.modalData).then(({data}) => { if (data && data.code === 0) { this.getDataList(); - this.activeTabList = ['part','product','process'] + this.activeTabList = ['part','product','process','attribute'] this.activeTab = 'product' this.modalData.testNo = data.row // this.modalFlag = false @@ -2219,6 +2230,7 @@ if (row){ this.selectTestSoBom() this.selectTestSoRoutingList() + this.getPartPropertiesList(); } }, /** @@ -2583,7 +2595,7 @@ this.$refs.modalForm.resetFields(); this.modalData = { flag: '1', - title: '测试新增', + title: '测试申请', site: this.$store.state.user.site, testNo: '', customerNo: '', @@ -2690,6 +2702,21 @@ } }) }, + getPartPropertiesList(){ + let params = { + site:this.$store.state.user.site, + testPartNo: this.testCurrentRow.testPartNo + } + partPropertiesList(params).then(({data})=>{ + if (data && data.code === 0){ + this.attributeList = data.rows + }else { + this.$message.warning(data.msg) + } + }).catch((error)=>{ + this.$message.error(error) + }) + } } } diff --git a/src/views/modules/test/testSoAttribute/testAttribute.vue b/src/views/modules/test/testSoAttribute/testAttribute.vue new file mode 100644 index 0000000..56ff0cd --- /dev/null +++ b/src/views/modules/test/testSoAttribute/testAttribute.vue @@ -0,0 +1,354 @@ + + + + + diff --git a/src/views/modules/test/testSoBom/testTable.vue b/src/views/modules/test/testSoBom/testTable.vue index 71b1f73..e8b4f8e 100644 --- a/src/views/modules/test/testSoBom/testTable.vue +++ b/src/views/modules/test/testSoBom/testTable.vue @@ -8,6 +8,8 @@ import { } from "../../../../api/test/testSoBom"; import {searchPart, searchPartList} from '@/api/part/partInformation.js'; import numberInput from "../../common/numberInput.vue"; +import {searchAllUmInformationList} from "../../../../api/part/umInformation"; +import {Decimal} from "decimal.js"; export default { name: "testTable", components:{ @@ -20,7 +22,9 @@ export default { }, testNo:{ type:String, - required:true + }, + testNumber:{ + type:[String,Number], }, columnList:{ type: Array, @@ -66,6 +70,7 @@ export default { itemNo:undefined, componentPartNo:undefined, partDesc:undefined, + umId:undefined, assemblyQty:0, fixedScrapQty:0, scrapFactor:0, @@ -208,7 +213,7 @@ export default { columnProp: 'scrapFactor', headerAlign: 'center', align: 'left', - columnLabel: '报废率', + columnLabel: '报废率%', columnHidden: false, columnImage: false, columnSortable: false, @@ -233,27 +238,28 @@ export default { status: true, fixed: '', columnWidth: 100 - },{ - userId: this.$store.state.user.name, - functionId: 102001, - serialNumber: '102001Table3ReserveQty', - tableId: '102001Table3', - tableName: '测试产品结构', - columnProp: 'reserveQty', - 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: 102001, + // serialNumber: '102001Table3ReserveQty', + // tableId: '102001Table3', + // tableName: '测试产品结构', + // columnProp: 'reserveQty', + // 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: 102001, // serialNumber: '102001Table3IssuedDate', // tableId: '102001Table3', // tableName: '测试产品结构', @@ -286,25 +292,28 @@ export default { status: true, fixed: '', columnWidth: 100 - },{ - userId: this.$store.state.user.name, - functionId: 102001, - serialNumber: '102001Table3rmTypeDb', - tableId: '102001Table3', - tableName: '测试产品结构', - columnProp: 'rmTypeDb', - 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: 102001, + // serialNumber: '102001Table3rmTypeDb', + // tableId: '102001Table3', + // tableName: '测试产品结构', + // columnProp: 'rmTypeDb', + // headerAlign: 'center', + // align: 'left', + // columnLabel: '是否主物料', + // columnHidden: false, + // columnImage: false, + // columnSortable: false, + // sortLv: 0, + // status: true, + // fixed: '', + // columnWidth: 100 + // }, + ], saveOrUpdateFlag:false, + umList:[], } }, created() { @@ -331,6 +340,7 @@ export default { dblClickPartTable(row){ this.testSoBom.componentPartNo = row.partNo; this.testSoBom.partDesc = row.partDesc; + this.testSoBom.umId = row.umId; this.partDialogFlag = false; }, testSoBomClickRow(row,column){ @@ -345,6 +355,7 @@ export default { if (row){ this.testSoBom = JSON.parse(JSON.stringify(row)) } + this.getAllUm() this.saveOrUpdateFlag = true }, removeBatchTestSoBom(){ @@ -381,6 +392,8 @@ export default { testNo:undefined, itemNo:undefined, componentPartNo:undefined, + partDesc:undefined, + umId:undefined, assemblyQty:0, fixedScrapQty:0, scrapFactor:0, @@ -416,7 +429,8 @@ export default { this.$message.error(error) }) }, - saveTestSoBomBtn(){ + saveTestSoBomBtn(isClose){ + console.log(isClose) this.$refs.saveForm.validate((validate,objects)=>{ if (validate){ if (this.testSoBom.itemNo !== undefined && this.testSoBom.itemNo !== null && this.testSoBom.itemNo !== ''){ @@ -437,7 +451,9 @@ export default { if (data && data.code === 0){ this.$message.success(data.msg) this.selectTestSoBom() - this.saveOrUpdateFlag = false + if (!isClose){ + this.saveOrUpdateFlag = false + } }else { this.$message.error(data.msg) } @@ -451,6 +467,24 @@ export default { } } }) + }, + getAllUm(){ + let params = { + site:this.$store.state.user.site + } + searchAllUmInformationList(params).then(({data})=>{ + if (data && data.code === 0){ + this.umList = data.rows + }else { + this.$message.warning(data.msg) + } + }).catch((error)=>{ + this.$message.error(error) + }) + }, + computeQuantityRequired(){ + let total = new Decimal(this.testNumber).mul(new Decimal(this.testSoBom.assemblyQty)).div((new Decimal(100).sub(new Decimal(this.testSoBom.scrapFactor))).div(new Decimal(100))) + this.testSoBom.requiredQty = new Decimal(total.toFixed(3,Decimal.ROUND_FLOOR)).toSignificantDigits().toNumber(); } }, @@ -497,42 +531,44 @@ export default { - + - + - + 物料编码 - + + + + + + + + - - - - - - + - + - + @@ -545,16 +581,21 @@ export default { - + - + 是否主物料 + + + + + @@ -563,12 +604,13 @@ export default { - 确 定 + 应 用 + 确 定 取 消 - diff --git a/src/views/modules/test/testSoRouting/testRoutingTable.vue b/src/views/modules/test/testSoRouting/testRoutingTable.vue index 7086988..2208a30 100644 --- a/src/views/modules/test/testSoRouting/testRoutingTable.vue +++ b/src/views/modules/test/testSoRouting/testRoutingTable.vue @@ -6,6 +6,7 @@ import { updateTestSoRouting } from "../../../../api/test/testSoRouting"; import {searchWorkCenter} from "../../../../api/part/workCenter"; +import {Decimal} from "decimal.js"; export default { name:"testRoutingTable", @@ -44,12 +45,14 @@ export default { saveFlag:false, testSoRoutingLabel:{ itemNo:"工序号", + itemDesc:"工序名称", workCenterNo:"加工中心", workCenterDesc:"加工中心名称", workCenterType:"加工中心类别", machSetupTime:"准备时间", factorUnit:'产出单位', machRunFactor:'单位产出量', + efficiency:'效率', requiredTime:'需求时间', requiredQty:'需求数量', reportedQty:'报告数量', @@ -59,6 +62,7 @@ export default { }, testSoRouting:{ itemNo:0, + itemDesc:undefined, site:this.$store.state.user.site, testNo:undefined, workCenterNo:undefined, @@ -67,6 +71,7 @@ export default { machSetupTime:0, factorUnit:'单位/小时', machRunFactor:0, + efficiency:100, requiredTime:0, requiredQty:0, reportedQty:0, @@ -77,12 +82,14 @@ export default { }, testSoRoutingRule:{ itemNo:[{required: true,message: ' ',trigger: ['change','blur']}], + itemDesc:[{required: true,message: ' ',trigger: ['change','blur']}], workCenterNo:[{required: true,message: ' ',trigger: ['change','blur']}], workCenterDesc:[{required: true,message: ' ',trigger: ['change','blur']}], workCenterType:[{required: true,message: ' ',trigger: ['change','blur']}], machSetupTime:[{required: true,message: ' ',trigger: ['change','blur']}], factorUnit:[{required: true,message: ' ',trigger: ['change','blur']}], machRunFactor:[{required: true,message: ' ',trigger: ['change','blur']}], + efficiency:[{required: true,message: ' ',trigger: ['change','blur']}], requiredTime:[{required: true,message: ' ',trigger: ['change','blur']}], requiredQty:[{required: true,message: ' ',trigger: ['change','blur']}], reportedQty:[{required: true,message: ' ',trigger: ['change','blur']}], @@ -109,6 +116,23 @@ export default { status: true, fixed: '', columnWidth: 100 + },{ + userId: this.$store.state.user.name, + functionId: 102001, + serialNumber: '102001Table3ItemDesc', + tableId: '102001Table3', + tableName: '测试工艺路线', + columnProp: 'itemDesc', + headerAlign: 'center', + align: 'center', + columnLabel: '工序号', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 100 }, { userId: this.$store.state.user.name, @@ -203,13 +227,13 @@ export default { { userId: this.$store.state.user.name, functionId: 102001, - serialNumber: '102001Table3FactorUnit', + serialNumber: '102001Table3Efficiency', tableId: '102001Table3', tableName: '测试工艺路线', - columnProp: 'factorUnit', + columnProp: 'efficiency', headerAlign: 'center', align: 'center', - columnLabel: '产出单位', + columnLabel: '效率%', columnHidden: false, columnImage: false, columnSortable: false, @@ -221,85 +245,13 @@ export default { { userId: this.$store.state.user.name, functionId: 102001, - serialNumber: '102001Table3RequiredTime', - tableId: '102001Table3', - tableName: '测试工艺路线', - columnProp: 'requiredTime', - 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: 102001, - serialNumber: '102001Table3RequiredQty', - tableId: '102001Table3', - tableName: '测试工艺路线', - columnProp: 'requiredQty', - 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: 102001, - serialNumber: '102001Table3ReportedQty', - tableId: '102001Table3', - tableName: '测试工艺路线', - columnProp: 'reportedQty', - 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: 102001, - serialNumber: '102001Table3ApproveQty', - tableId: '102001Table3', - tableName: '测试工艺路线', - columnProp: 'approveQty', - 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: 102001, - serialNumber: '102001Table3PlanStartTime', + serialNumber: '102001Table3FactorUnit', tableId: '102001Table3', tableName: '测试工艺路线', - columnProp: 'planStartTime', + columnProp: 'factorUnit', headerAlign: 'center', align: 'center', - columnLabel: '计划开工时间', + columnLabel: '产出单位', columnHidden: false, columnImage: false, columnSortable: false, @@ -311,13 +263,13 @@ export default { { userId: this.$store.state.user.name, functionId: 102001, - serialNumber: '102001Table3PlanFinishTime', + serialNumber: '102001Table3RequiredTime', tableId: '102001Table3', tableName: '测试工艺路线', - columnProp: 'planFinishTime', + columnProp: 'requiredTime', headerAlign: 'center', align: 'center', - columnLabel: '计划完工时间', + columnLabel: '需求时间', columnHidden: false, columnImage: false, columnSortable: false, @@ -326,6 +278,96 @@ export default { fixed: '', columnWidth: 100 }, + // { + // userId: this.$store.state.user.name, + // functionId: 102001, + // serialNumber: '102001Table3RequiredQty', + // tableId: '102001Table3', + // tableName: '测试工艺路线', + // columnProp: 'requiredQty', + // 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: 102001, + // serialNumber: '102001Table3ReportedQty', + // tableId: '102001Table3', + // tableName: '测试工艺路线', + // columnProp: 'reportedQty', + // 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: 102001, + // serialNumber: '102001Table3ApproveQty', + // tableId: '102001Table3', + // tableName: '测试工艺路线', + // columnProp: 'approveQty', + // 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: 102001, + // serialNumber: '102001Table3PlanStartTime', + // tableId: '102001Table3', + // tableName: '测试工艺路线', + // columnProp: 'planStartTime', + // 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: 102001, + // serialNumber: '102001Table3PlanFinishTime', + // tableId: '102001Table3', + // tableName: '测试工艺路线', + // columnProp: 'planFinishTime', + // 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: 102001, @@ -396,6 +438,7 @@ export default { this.$refs.saveForm.resetFields(); this.testSoRouting = { itemNo:0, + itemDesc:undefined, site:this.$store.state.user.site, testNo: this.testNo, workCenterNo:undefined, @@ -404,6 +447,7 @@ export default { machSetupTime:0, factorUnit:'单位/小时', machRunFactor:0, + efficiency:100, requiredTime:0, requiredQty:0, reportedQty:0, @@ -424,13 +468,13 @@ export default { } }) }, - saveTestSoRouting(){ + saveTestSoRouting(isClose){ this.$refs.saveForm.validate((validate,objects)=>{ if (validate){ + this.testSoRouting.planStartTime = this.dayjs(new Date(this.testSoRouting.planStartTime)).format("YYYY-MM-DD HH:mm:ss") + this.testSoRouting.planFinishTime = this.dayjs(new Date(this.testSoRouting.planFinishTime)).format("YYYY-MM-DD HH:mm:ss") if (!this.saveStatus){ // 修改 - this.testSoRouting.planStartTime = this.dayjs(new Date(this.testSoRouting.planStartTime)).format("YYYY-MM-DD HH:mm:ss") - this.testSoRouting.planFinishTime = this.dayjs(new Date(this.testSoRouting.planFinishTime)).format("YYYY-MM-DD HH:mm:ss") updateTestSoRouting(this.testSoRouting).then(({data})=>{ if (data && data.code === 0){ this.selectTestSoRoutingList(); @@ -444,13 +488,13 @@ export default { }) }else { // 新增 - this.testSoRouting.planStartTime = this.dayjs(new Date(this.testSoRouting.planStartTime)).format("YYYY-MM-DD HH:mm:ss") - this.testSoRouting.planFinishTime = this.dayjs(new Date(this.testSoRouting.planFinishTime)).format("YYYY-MM-DD HH:mm:ss") saveTestSoRouting(this.testSoRouting).then(({data})=>{ if (data && data.code === 0){ this.selectTestSoRoutingList(); this.$message.success(data.msg) - this.saveFlag = false + if (!isClose){ + this.saveFlag = false + } }else { this.$message.warning(data.msg) } @@ -495,6 +539,31 @@ export default { this.$message.error(error) }) }).catch(()=>{}) + }, + computeRequiredTime(){ + // 1、计算效率 + let total = new Decimal(this.testSoRouting.efficiency).div(new Decimal(100)) + // 2、计算单位生产时间 + let time = new Decimal(0); + switch (this.testSoRouting.factorUnit){ + case "小时": + time = new Decimal(this.testSoRouting.machRunFactor) + break + case "单位/小时": + if (new Decimal(this.testSoRouting.machRunFactor).toNumber() !== 0){ + time = new Decimal(1).div(new Decimal(this.testSoRouting.machRunFactor)) + } + break + case "小时/单位": + time = new Decimal(this.testSoRouting.machRunFactor).mul(new Decimal(1)) + break + } + total = total.mul(time) + total = Decimal.add(new Decimal(this.testSoRouting.machSetupTime),total) + this.testSoRouting.requiredTime = total; + if (this.testSoRouting.requiredTime.toNumber !== 0){ + this.testSoRouting.requiredTime = new Decimal(total.toFixed(3,Decimal.ROUND_FLOOR)).toSignificantDigits().toNumber(); + } } }, } @@ -547,9 +616,9 @@ export default { - - - + + + @@ -570,14 +639,24 @@ export default { + + + + + - + + + + + + - @@ -589,29 +668,29 @@ export default { - + - + - + - + - + - + - 确 定 + 应 用 + 确 定 取 消