|
|
@@ -161,7 +161,7 @@
|
|
|
<term :qualityParam="qualityParam" ref="qualityParamRef"></term>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="生产节拍" name="生产节拍">
|
|
|
- <el-form label-width="100px" ref="form" :model="beatParam">
|
|
|
+ <el-form label-width="140px" ref="form" :model="beatParam">
|
|
|
<el-row>
|
|
|
<el-col :span="16" label-width="100px">
|
|
|
<el-form-item label="节拍生产数量" prop="beatNum">
|
|
|
@@ -175,12 +175,14 @@
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="8" label-width="100px">
|
|
|
+
|
|
|
<el-form-item label="单位" prop="beatUnit">
|
|
|
<el-select
|
|
|
v-if="!isView"
|
|
|
v-model="beatParam.beatUnit"
|
|
|
filterable
|
|
|
class="ele-block"
|
|
|
+ disabled
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in dictList"
|
|
|
@@ -193,40 +195,12 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="16" label-width="100px">
|
|
|
- <el-form-item label="对应物料数量" prop="materielNum">
|
|
|
- <el-input
|
|
|
- v-if="!isView"
|
|
|
- placeholder=""
|
|
|
- v-model="beatParam.materielNum"
|
|
|
- ></el-input>
|
|
|
- <div v-else>{{ beatParam.materielNum }}</div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- <el-col :span="8" label-width="100px">
|
|
|
- <el-form-item label="单位" prop="materielUnit">
|
|
|
- <el-select
|
|
|
- v-if="!isView"
|
|
|
- v-model="beatParam.materielUnit"
|
|
|
- filterable
|
|
|
- class="ele-block"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in dictList"
|
|
|
- :key="item.value"
|
|
|
- :value="item.value"
|
|
|
- :label="item.label"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- <div v-else>{{ beatParam.materielUnit }}</div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="16" label-width="100px">
|
|
|
- <el-form-item label="节拍时间" prop="beatTime">
|
|
|
+ <el-form-item label="生产时长" prop="beatTime">
|
|
|
<el-input
|
|
|
v-if="!isView"
|
|
|
placeholder=""
|
|
|
@@ -243,6 +217,7 @@
|
|
|
v-model="beatParam.beatTimeUnit"
|
|
|
filterable
|
|
|
class="ele-block"
|
|
|
+ disabled
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in dictList"
|
|
|
@@ -257,7 +232,7 @@
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="16" label-width="100px">
|
|
|
- <el-form-item label="节拍准备时长" prop="name">
|
|
|
+ <el-form-item label="准备时长" prop="name">
|
|
|
<el-input
|
|
|
v-if="!isView"
|
|
|
placeholder=""
|
|
|
@@ -274,6 +249,7 @@
|
|
|
v-model="beatParam.beatPrepareUnit"
|
|
|
filterable
|
|
|
class="ele-block"
|
|
|
+ disabled
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in dictList"
|
|
|
@@ -287,8 +263,8 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
- <el-col :span="16" label-width="100px">
|
|
|
- <el-form-item label="节拍休息时长" prop="name">
|
|
|
+ <el-col :span="16" label-width="140px">
|
|
|
+ <el-form-item label="下道工序间隔时长" prop="name">
|
|
|
<el-input
|
|
|
v-if="!isView"
|
|
|
placeholder=""
|
|
|
@@ -305,6 +281,7 @@
|
|
|
v-model="beatParam.beatRestUnit"
|
|
|
filterable
|
|
|
class="ele-block"
|
|
|
+ disabled
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in dictList"
|
|
|
@@ -317,92 +294,26 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="24" label-width="100px">
|
|
|
- <el-form-item label="备注" prop="remark">
|
|
|
- <el-input
|
|
|
- v-if="!isView"
|
|
|
- placeholder=""
|
|
|
- v-model="beatParam.remark"
|
|
|
- type="textarea"
|
|
|
- :rows="4"
|
|
|
- ></el-input>
|
|
|
- <div v-else>{{ beatParam.remark }}</div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="8" label-width="100px">
|
|
|
- <el-form-item label="添加人" prop="name">
|
|
|
- <el-input
|
|
|
- v-if="!isView"
|
|
|
- placeholder=""
|
|
|
- disabled
|
|
|
- v-model="beatParam.createName"
|
|
|
- ></el-input>
|
|
|
- <div v-else>{{ beatParam.createName }}</div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="8" label-width="100px">
|
|
|
- <el-form-item label="添加时间" prop="name">
|
|
|
- <el-input
|
|
|
- v-if="!isView"
|
|
|
- placeholder=""
|
|
|
- disabled
|
|
|
- v-model="beatParam.createTime"
|
|
|
- ></el-input>
|
|
|
- <div v-else>{{ beatParam.createTime }}</div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="8" label-width="100px">
|
|
|
- <el-form-item label="修改人" prop="name">
|
|
|
- <el-input
|
|
|
- v-if="!isView"
|
|
|
- placeholder=""
|
|
|
- disabled
|
|
|
- v-model="beatParam.updateName"
|
|
|
- ></el-input>
|
|
|
- <div v-else>{{ beatParam.updateName }}</div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
|
|
|
- <el-col :span="8" label-width="100px">
|
|
|
- <el-form-item label="最后修改时间" prop="name">
|
|
|
- <el-input
|
|
|
- v-if="!isView"
|
|
|
- placeholder=""
|
|
|
- disabled
|
|
|
- v-model="beatParam.updateTime"
|
|
|
- ></el-input>
|
|
|
- <div v-else>{{ beatParam.updateTime }}</div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="标准工时" name="标准工时">
|
|
|
- <el-form label-width="100px" ref="form" :model="normalHours">
|
|
|
<el-row>
|
|
|
<el-col :span="16" label-width="100px">
|
|
|
<el-form-item label="标准时长" prop="type">
|
|
|
<el-input
|
|
|
v-if="!isView"
|
|
|
placeholder="标准时长"
|
|
|
- v-model="normalHours.time"
|
|
|
+ v-model="beatParam.time"
|
|
|
></el-input>
|
|
|
- <div v-else>{{ normalHours.time }}</div>
|
|
|
+ <div v-else>{{ beatParam.time }}</div>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8" label-width="100px">
|
|
|
<el-form-item label="单位" prop="type">
|
|
|
<el-select
|
|
|
v-if="!isView"
|
|
|
- v-model="normalHours.unit"
|
|
|
+ v-model="beatParam.unit"
|
|
|
filterable
|
|
|
class="ele-block"
|
|
|
+ disabled
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in dictList"
|
|
|
@@ -411,26 +322,28 @@
|
|
|
:label="item.label"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
- <div v-else>{{ normalHours.unit }}</div>
|
|
|
+ <div v-else>{{ beatParam.unit }}</div>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+
|
|
|
<el-row>
|
|
|
<el-col :span="24" label-width="100px">
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
<el-input
|
|
|
v-if="!isView"
|
|
|
placeholder=""
|
|
|
- v-model="normalHours.remark"
|
|
|
+ v-model="beatParam.remark"
|
|
|
type="textarea"
|
|
|
:rows="4"
|
|
|
></el-input>
|
|
|
- <div v-else>{{ normalHours.remark }}</div>
|
|
|
+ <div v-else>{{ beatParam.remark }}</div>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
</el-tab-pane>
|
|
|
+
|
|
|
<el-tab-pane label="材料定额" name="材料定额">
|
|
|
<ele-pro-table
|
|
|
ref="materialTable"
|
|
|
@@ -440,14 +353,23 @@
|
|
|
:immediate="true"
|
|
|
>
|
|
|
<!-- 表头工具栏 -->
|
|
|
- <template v-slot:toolbar>
|
|
|
- <el-button type="primary" v-if="!isView" @click="add">添加</el-button>
|
|
|
+ <template v-slot:toolbar>
|
|
|
+ <el-button type="primary" v-if="!isView" @click="add"
|
|
|
+ >添加</el-button
|
|
|
+ >
|
|
|
<div class="toolbar_box">
|
|
|
<div
|
|
|
><span>基本数量</span>
|
|
|
- <el-input placeholder="请输入" :disabled="isView" v-model.number="baseCount">
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入"
|
|
|
+ :disabled="isView"
|
|
|
+ v-model.number="baseCount"
|
|
|
+ >
|
|
|
</el-input>
|
|
|
- <DictSelection dictName="计量单位" :disabled="isView" v-model="baseCountUnit"
|
|
|
+ <DictSelection
|
|
|
+ dictName="计量单位"
|
|
|
+ :disabled="isView"
|
|
|
+ v-model="baseCountUnit"
|
|
|
/></div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -518,11 +440,7 @@
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:bomArtFiles="{ row }">
|
|
|
- <fileUpload
|
|
|
- v-model="row.bomArtFiles"
|
|
|
- type="add"
|
|
|
- size="mini"
|
|
|
- />
|
|
|
+ <fileUpload v-model="row.bomArtFiles" type="add" size="mini" />
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:remark="{ row }">
|
|
|
@@ -635,11 +553,7 @@
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:bomArtFiles="{ row }">
|
|
|
- <fileUpload
|
|
|
- v-model="row.bomArtFiles"
|
|
|
- type="add"
|
|
|
- size="mini"
|
|
|
- />
|
|
|
+ <fileUpload v-model="row.bomArtFiles" type="add" size="mini" />
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:remark="{ row }">
|
|
|
@@ -662,11 +576,17 @@
|
|
|
>
|
|
|
<!-- 表头工具栏 -->
|
|
|
<template v-slot:toolbar>
|
|
|
- <el-button type="primary" v-if="!isView" @click="add">添加</el-button>
|
|
|
+ <el-button type="primary" v-if="!isView" @click="add"
|
|
|
+ >添加</el-button
|
|
|
+ >
|
|
|
<div class="toolbar_box">
|
|
|
<div
|
|
|
><span>基本数量</span>
|
|
|
- <el-input placeholder="请输入" :disabled="isView" v-model.number="baseCount2">
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入"
|
|
|
+ :disabled="isView"
|
|
|
+ v-model.number="baseCount2"
|
|
|
+ >
|
|
|
</el-input>
|
|
|
<DictSelection dictName="计量单位" v-model="baseCountUnit2"
|
|
|
/></div>
|
|
|
@@ -740,11 +660,7 @@
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:bomArtFiles="{ row }">
|
|
|
- <fileUpload
|
|
|
- v-model="row.bomArtFiles"
|
|
|
- type="add"
|
|
|
- size="mini"
|
|
|
- />
|
|
|
+ <fileUpload v-model="row.bomArtFiles" type="add" size="mini" />
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:remark="{ row }">
|
|
|
@@ -798,9 +714,7 @@
|
|
|
<el-link type="primary" @click="handleDel(row, $index)"
|
|
|
>删除</el-link
|
|
|
>
|
|
|
- <el-link type="primary" @click="fileDetails(row)"
|
|
|
- >详情</el-link
|
|
|
- >
|
|
|
+ <el-link type="primary" @click="fileDetails(row)">详情</el-link>
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
</el-tab-pane>
|
|
|
@@ -842,7 +756,7 @@
|
|
|
|
|
|
<fileIndex v-if="fileShow" @close="fileClose"></fileIndex>
|
|
|
|
|
|
- <fileBrowse ref="browseRef"></fileBrowse>
|
|
|
+ <fileBrowse ref="browseRef"></fileBrowse>
|
|
|
|
|
|
<div class="btns">
|
|
|
<el-button
|
|
|
@@ -877,7 +791,7 @@
|
|
|
import standardOutput from './standardOutput.vue';
|
|
|
import term from '../qualityTesting/term';
|
|
|
import fileIndex from '../file/index.vue';
|
|
|
- import fileBrowse from '../file/fileBrowse.vue'
|
|
|
+ import fileBrowse from '../file/fileBrowse.vue';
|
|
|
export default {
|
|
|
components: {
|
|
|
userSearch,
|
|
|
@@ -1225,8 +1139,14 @@
|
|
|
treeData: {},
|
|
|
currentIndex: 0,
|
|
|
tableData: {},
|
|
|
- beatParam: {},
|
|
|
- normalHours: {},
|
|
|
+ beatParam: {
|
|
|
+ beatUnit: '秒',
|
|
|
+ beatTimeUnit: '秒',
|
|
|
+ beatRestUnit: '秒',
|
|
|
+ unit: '秒',
|
|
|
+ beatPrepareUnit: '秒'
|
|
|
+ },
|
|
|
+
|
|
|
qualityParam: [],
|
|
|
qualityPointParam: [],
|
|
|
|
|
|
@@ -1242,28 +1162,25 @@
|
|
|
this.fileShow = true;
|
|
|
},
|
|
|
fileClose(val) {
|
|
|
-
|
|
|
if (val == false) {
|
|
|
this.fileShow = false;
|
|
|
} else {
|
|
|
this.fileShow = false;
|
|
|
|
|
|
this.$refs.fileTable.setData([
|
|
|
- ...val,
|
|
|
- ...this.$refs.fileTable.getData()
|
|
|
- ]);
|
|
|
- this.$set(
|
|
|
- this.tableData.taskParam[this.currentIndex],
|
|
|
- 'fileParam',
|
|
|
- this.$refs.fileTable.getData()
|
|
|
- );
|
|
|
-
|
|
|
-
|
|
|
+ ...val,
|
|
|
+ ...this.$refs.fileTable.getData()
|
|
|
+ ]);
|
|
|
+ this.$set(
|
|
|
+ this.tableData.taskParam[this.currentIndex],
|
|
|
+ 'fileParam',
|
|
|
+ this.$refs.fileTable.getData()
|
|
|
+ );
|
|
|
}
|
|
|
},
|
|
|
|
|
|
fileDetails(row) {
|
|
|
- this.$refs.browseRef.setFileUrl(row)
|
|
|
+ this.$refs.browseRef.setFileUrl(row);
|
|
|
},
|
|
|
addJob() {
|
|
|
this.$refs.jobRef.open();
|
|
|
@@ -1362,11 +1279,9 @@
|
|
|
this.tableData.taskParam[this.currentIndex][type].splice(index, 1);
|
|
|
},
|
|
|
addProductList(list) {
|
|
|
-
|
|
|
let subCode = 0;
|
|
|
let array = [];
|
|
|
list.map((item, index) => {
|
|
|
-
|
|
|
let max = '';
|
|
|
if (
|
|
|
this.tableData.taskParam[this.currentIndex]['materialQuota']
|
|
|
@@ -1380,7 +1295,7 @@
|
|
|
) +
|
|
|
10 * ++index +
|
|
|
'';
|
|
|
-
|
|
|
+
|
|
|
if (max.length < 4) {
|
|
|
max = new Array(4 - max.length).fill('0').join('') + max;
|
|
|
}
|
|
|
@@ -1390,17 +1305,17 @@
|
|
|
max = new Array(4 - max.length).fill('0').join('') + max;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
|
|
|
- console.log('item', this.isValueANumber(item.specification))
|
|
|
-
|
|
|
-
|
|
|
- if(item.categoryLevelPathIdParent == 8 && this.isValueANumber(this.baseCount) && this.isValueANumber(item.specification) ) {
|
|
|
- let num = this.baseCount / item.specification;
|
|
|
- item.count = num == 'Infinity' ? '' : num.toFixed(3)
|
|
|
- }
|
|
|
-
|
|
|
+ console.log('item', this.isValueANumber(item.specification));
|
|
|
|
|
|
+ if (
|
|
|
+ item.categoryLevelPathIdParent == 8 &&
|
|
|
+ this.isValueANumber(this.baseCount) &&
|
|
|
+ this.isValueANumber(item.specification)
|
|
|
+ ) {
|
|
|
+ let num = this.baseCount / item.specification;
|
|
|
+ item.count = num == 'Infinity' ? '' : num.toFixed(3);
|
|
|
+ }
|
|
|
|
|
|
subCode = max.substring(0, max.length - 1) + '0';
|
|
|
array.push({
|
|
|
@@ -1410,46 +1325,47 @@
|
|
|
categoryCode: item.categoryCode,
|
|
|
isReworkBom: 0,
|
|
|
brandNum: item.brandNum,
|
|
|
- count: item.count || '',
|
|
|
+ count: item.count || '',
|
|
|
modelType: item.modelType,
|
|
|
unit: item.measuringUnit,
|
|
|
bomArtFiles: [],
|
|
|
remark: '',
|
|
|
specification: item.specification,
|
|
|
rootCategoryLevelId: item.categoryLevelPathIdParent,
|
|
|
- extInfo:item.extInfo,
|
|
|
-
|
|
|
-
|
|
|
+ extInfo: item.extInfo
|
|
|
});
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
this.tableData.taskParam[this.currentIndex].materialQuota =
|
|
|
this.tableData.taskParam[this.currentIndex].materialQuota.concat(
|
|
|
array
|
|
|
);
|
|
|
-
|
|
|
+
|
|
|
this.$refs.materialTable.setData(
|
|
|
this.tableData.taskParam[this.currentIndex].materialQuota
|
|
|
);
|
|
|
},
|
|
|
|
|
|
-
|
|
|
- isValueANumber(variable) {
|
|
|
- if (variable === undefined || variable === null) {
|
|
|
- return false; // 变量没有值
|
|
|
- }
|
|
|
- if (typeof variable === 'number') {
|
|
|
- return true; // 基本类型的数字
|
|
|
- }
|
|
|
- if (typeof variable === 'string' && !isNaN(variable) && !variable.includes('.') || (variable.includes('.') && !variable.endsWith('.'))) {
|
|
|
- // 字符串类型的数字(注意:这个正则表达式判断较为简单,可能需要根据实际情况调整)
|
|
|
- // 或者使用 Number.isFinite(parseFloat(variable)) 来代替这部分逻辑,但要注意性能开销和边缘情况
|
|
|
- const num = Number(variable);
|
|
|
- return !isNaN(num) && isFinite(num);
|
|
|
- }
|
|
|
- return false; // 其他类型
|
|
|
-},
|
|
|
-
|
|
|
+ isValueANumber(variable) {
|
|
|
+ if (variable === undefined || variable === null) {
|
|
|
+ return false; // 变量没有值
|
|
|
+ }
|
|
|
+ if (typeof variable === 'number') {
|
|
|
+ return true; // 基本类型的数字
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ (typeof variable === 'string' &&
|
|
|
+ !isNaN(variable) &&
|
|
|
+ !variable.includes('.')) ||
|
|
|
+ (variable.includes('.') && !variable.endsWith('.'))
|
|
|
+ ) {
|
|
|
+ // 字符串类型的数字(注意:这个正则表达式判断较为简单,可能需要根据实际情况调整)
|
|
|
+ // 或者使用 Number.isFinite(parseFloat(variable)) 来代替这部分逻辑,但要注意性能开销和边缘情况
|
|
|
+ const num = Number(variable);
|
|
|
+ return !isNaN(num) && isFinite(num);
|
|
|
+ }
|
|
|
+ return false; // 其他类型
|
|
|
+ },
|
|
|
|
|
|
add() {
|
|
|
let subCode = '0010';
|
|
|
@@ -1512,12 +1428,17 @@
|
|
|
this.qualityParam =
|
|
|
this.tableData.taskParam[this.currentIndex].qualityParam || [];
|
|
|
} else if (this.activeName === '生产节拍') {
|
|
|
- console.log(this.tableData.taskParam[this.currentIndex].beatParam);
|
|
|
+
|
|
|
this.beatParam =
|
|
|
- this.tableData.taskParam[this.currentIndex].beatParam || {};
|
|
|
- } else if (this.activeName === '标准工时') {
|
|
|
- this.normalHours =
|
|
|
- this.tableData.taskParam[this.currentIndex].normalHours || {};
|
|
|
+ this.tableData.taskParam[this.currentIndex].beatParam || this.beatParam;
|
|
|
+
|
|
|
+ this.beatParam.beatUnit = '秒'
|
|
|
+ this.beatParam.beatTimeUnit = '秒'
|
|
|
+ this.beatParam.unit = '秒'
|
|
|
+ this.beatParam.beatRestUnit = '秒'
|
|
|
+ this.beatParam.beatPrepareUnit = '秒'
|
|
|
+
|
|
|
+
|
|
|
} else if (this.activeName === '材料定额') {
|
|
|
this.$refs.materialTable.setData(
|
|
|
this.tableData.taskParam[this.currentIndex].materialQuota || []
|
|
|
@@ -1698,8 +1619,7 @@
|
|
|
this.tableData.taskParam[this.currentIndex].beatParam =
|
|
|
this.beatParam;
|
|
|
// 保存标准工时
|
|
|
- this.tableData.taskParam[this.currentIndex].normalHours =
|
|
|
- this.normalHours;
|
|
|
+
|
|
|
// 保存材料定额
|
|
|
this.tableData.taskParam[this.currentIndex].baseCount =
|
|
|
this.baseCount;
|