|
|
@@ -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" style="width: 800px; margin: auto;">
|
|
|
<el-row>
|
|
|
<el-col :span="16" label-width="100px">
|
|
|
<el-form-item label="节拍生产数量" prop="beatNum">
|
|
|
@@ -175,12 +175,15 @@
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="8" label-width="100px">
|
|
|
- <el-form-item label="单位" prop="beatUnit">
|
|
|
+
|
|
|
+ <el-form-item label="单位:" prop="unit">
|
|
|
<el-select
|
|
|
v-if="!isView"
|
|
|
- v-model="beatParam.beatUnit"
|
|
|
+ v-model="beatParam.unit"
|
|
|
filterable
|
|
|
class="ele-block"
|
|
|
+ @change="changeUnit"
|
|
|
+
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in dictList"
|
|
|
@@ -189,248 +192,115 @@
|
|
|
:label="item.label"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
- <div v-else>{{ beatParam.beatUnit }}</div>
|
|
|
+ <div v-else>{{ beatParam.unit }}</div>
|
|
|
</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-input
|
|
|
- v-if="!isView"
|
|
|
- placeholder=""
|
|
|
- v-model="beatParam.beatTime"
|
|
|
- ></el-input>
|
|
|
- <div v-else>{{ beatParam.beatTime }}</div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
+ <el-form-item label="生产时长" prop="newBeatTime">
|
|
|
|
|
|
- <el-col :span="8" label-width="100px">
|
|
|
- <el-form-item label="单位" prop="beatTimeUnit">
|
|
|
- <el-select
|
|
|
- v-if="!isView"
|
|
|
- v-model="beatParam.beatTimeUnit"
|
|
|
- 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.beatTimeUnit }}</div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="16" label-width="100px">
|
|
|
- <el-form-item label="节拍准备时长" prop="name">
|
|
|
+
|
|
|
<el-input
|
|
|
v-if="!isView"
|
|
|
placeholder=""
|
|
|
- v-model="beatParam.beatPrepareTime"
|
|
|
+ v-model="beatParam.newBeatTime"
|
|
|
+ @blur="convertVal(beatParam.newBeatTime, 'beatTime')"
|
|
|
+ oninput="value = value.replace(/[^\d.]/g, '')"
|
|
|
+
|
|
|
></el-input>
|
|
|
- <div v-else>{{ beatParam.beatPrepareTime }}</div>
|
|
|
+
|
|
|
+ <div v-else>{{ beatParam.newBeatTime }}</div>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="8" label-width="100px">
|
|
|
- <el-form-item label="单位" prop="beatPrepareUnit">
|
|
|
- <el-select
|
|
|
- v-if="!isView"
|
|
|
- v-model="beatParam.beatPrepareUnit"
|
|
|
- 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.beatPrepareUnit }}</div>
|
|
|
+ <el-form-item label="单位:" prop="">
|
|
|
+ <div >{{ beatParam.unit }}</div>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="16" label-width="100px">
|
|
|
- <el-form-item label="节拍休息时长" prop="name">
|
|
|
+ <el-form-item label="准备时长" prop="newBeatPrepareTime">
|
|
|
<el-input
|
|
|
v-if="!isView"
|
|
|
placeholder=""
|
|
|
- v-model="beatParam.beatRestTime"
|
|
|
+ v-model="beatParam.newBeatPrepareTime"
|
|
|
+ @blur="convertVal(beatParam.newBeatPrepareTime, 'beatPrepareTime')"
|
|
|
+ oninput="value = value.replace(/[^\d.]/g, '')"
|
|
|
></el-input>
|
|
|
- <div v-else>{{ beatParam.beatRestTime }}</div>
|
|
|
+ <div v-else>{{ beatParam.newBeatPrepareTime }}</div>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="8" label-width="100px">
|
|
|
- <el-form-item label="单位" prop="beatRestUnit">
|
|
|
- <el-select
|
|
|
- v-if="!isView"
|
|
|
- v-model="beatParam.beatRestUnit"
|
|
|
- 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.beatRestUnit }}</div>
|
|
|
+ <el-form-item label="单位:" prop="">
|
|
|
+ <div>{{ 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-col :span="16" label-width="140px">
|
|
|
+ <el-form-item label="下道工序间隔时长" prop="newBeatRestTime">
|
|
|
<el-input
|
|
|
v-if="!isView"
|
|
|
placeholder=""
|
|
|
- v-model="beatParam.remark"
|
|
|
- type="textarea"
|
|
|
- :rows="4"
|
|
|
+ v-model="beatParam.newBeatRestTime"
|
|
|
+ @blur="convertVal(beatParam.newBeatRestTime, 'beatRestTime')"
|
|
|
+ oninput="value = value.replace(/[^\d.]/g, '')"
|
|
|
></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>
|
|
|
+ <div v-else>{{ beatParam.newBeatRestTime }}</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 label="单位:" prop="beatRestUnit">
|
|
|
+ <div >{{ beatParam.unit }}</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-form-item label="标准时长" prop="newTime">
|
|
|
<el-input
|
|
|
v-if="!isView"
|
|
|
placeholder="标准时长"
|
|
|
- v-model="normalHours.time"
|
|
|
+ v-model="beatParam.newTime"
|
|
|
+ @blur="convertVal(beatParam.newTime, 'time')"
|
|
|
+ oninput="value = value.replace(/[^\d.]/g, '')"
|
|
|
></el-input>
|
|
|
- <div v-else>{{ normalHours.time }}</div>
|
|
|
+ <div v-else>{{ beatParam.newTime }}</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"
|
|
|
- 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>{{ normalHours.unit }}</div>
|
|
|
+ <el-form-item label="单位:" prop="">
|
|
|
+ <div >{{ 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,21 +310,34 @@
|
|
|
:immediate="true"
|
|
|
>
|
|
|
<!-- 表头工具栏 -->
|
|
|
- <template v-if="!isView" v-slot:toolbar>
|
|
|
- <el-button type="primary" @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="请输入" v-model.number="baseCount">
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入"
|
|
|
+ :disabled="isView"
|
|
|
+ v-model.number="baseCount"
|
|
|
+ >
|
|
|
</el-input>
|
|
|
- <DictSelection dictName="计量单位" v-model="baseCountUnit"
|
|
|
+ <DictSelection
|
|
|
+ dictName="计量单位"
|
|
|
+ :disabled="isView"
|
|
|
+ v-model="baseCountUnit"
|
|
|
/></div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template v-slot:action="{ row, $index }">
|
|
|
- <el-link type="primary" @click="handleDel(row, $index)"
|
|
|
+ <el-link type="danger" @click="handleDel(row, $index)"
|
|
|
>删除</el-link
|
|
|
>
|
|
|
+ <el-link type="primary" @click="handSubstitution(row)"
|
|
|
+ >替代料</el-link
|
|
|
+ >
|
|
|
+
|
|
|
</template>
|
|
|
<template v-slot:subCode="{ row }">
|
|
|
<div v-if="isView">{{ row.subCode }}</div>
|
|
|
@@ -507,7 +390,7 @@
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:categoryName="{ row, $index }">
|
|
|
- <div v-if="isView">{{ row.categoryName }}</div>
|
|
|
+ <el-link type="primary" :underline="false" @click="handSubstitution(row)" v-if="isView" >{{ row.categoryName }}</el-link>
|
|
|
<div v-else
|
|
|
><el-input
|
|
|
:value="row.categoryName"
|
|
|
@@ -518,11 +401,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,116 +514,7 @@
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:bomArtFiles="{ row }">
|
|
|
- <fileUpload
|
|
|
- v-model="row.bomArtFiles"
|
|
|
- type="add"
|
|
|
- size="mini"
|
|
|
- />
|
|
|
- </template>
|
|
|
-
|
|
|
- <template v-slot:remark="{ row }">
|
|
|
- <div v-if="isView">{{ row.remark }}</div>
|
|
|
- <el-input
|
|
|
- v-else
|
|
|
- v-model="row.remark"
|
|
|
- placeholder="请输入"
|
|
|
- ></el-input>
|
|
|
- </template>
|
|
|
- </ele-pro-table>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="替代料" name="替代料">
|
|
|
- <ele-pro-table
|
|
|
- ref="replaceMaterialTable"
|
|
|
- :columns="columns1"
|
|
|
- :datasource="datasource"
|
|
|
- :need-page="false"
|
|
|
- :immediate="true"
|
|
|
- >
|
|
|
- <!-- 表头工具栏 -->
|
|
|
- <template v-if="!isView" v-slot:toolbar>
|
|
|
- <el-button type="primary" @click="add">添加</el-button>
|
|
|
- <div class="toolbar_box">
|
|
|
- <div
|
|
|
- ><span>基本数量</span>
|
|
|
- <el-input placeholder="请输入" v-model.number="baseCount2">
|
|
|
- </el-input>
|
|
|
- <DictSelection dictName="计量单位" v-model="baseCountUnit2"
|
|
|
- /></div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
-
|
|
|
- <template v-slot:action="{ row, $index }">
|
|
|
- <el-link type="primary" @click="handleDel(row, $index)"
|
|
|
- >删除</el-link
|
|
|
- >
|
|
|
- </template>
|
|
|
- <template v-slot:subCode="{ row }">
|
|
|
- <div v-if="isView">{{ row.subCode }}</div>
|
|
|
- <el-input
|
|
|
- v-else
|
|
|
- v-model="row.subCode"
|
|
|
- placeholder="请输入"
|
|
|
- ></el-input>
|
|
|
- </template>
|
|
|
-
|
|
|
- <template v-slot:isReworkBom="{ row }">
|
|
|
- <div v-if="isView">{{ isReworkBom[row.isReworkBom] }}</div>
|
|
|
- <div v-else>
|
|
|
- <el-select v-model="row.isReworkBom">
|
|
|
- <el-option
|
|
|
- v-for="item in isReworkBomList"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
-
|
|
|
- <template v-slot:unit="{ row }">
|
|
|
- <div v-if="isView">{{ row.unit }}</div>
|
|
|
- <div v-else>
|
|
|
- <DictSelection
|
|
|
- dictName="计量单位"
|
|
|
- v-model="row.unit"
|
|
|
- ></DictSelection>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
-
|
|
|
- <template v-slot:count="{ row }">
|
|
|
- <div v-if="isView">{{ row.count }}</div>
|
|
|
- <el-input
|
|
|
- v-else
|
|
|
- v-model="row.count"
|
|
|
- placeholder="请输入"
|
|
|
- @input="
|
|
|
- (value) =>
|
|
|
- (row.count = value.replace(
|
|
|
- /^(-)*(\d+)\.(\d\d\d\d\d\d).*$/,
|
|
|
- '$1$2.$3'
|
|
|
- ))
|
|
|
- "
|
|
|
- ></el-input>
|
|
|
- </template>
|
|
|
-
|
|
|
- <template v-slot:categoryName="{ row, $index }">
|
|
|
- <div v-if="isView">{{ row.categoryName }}</div>
|
|
|
- <div v-else
|
|
|
- ><el-input
|
|
|
- :value="row.categoryName"
|
|
|
- placeholder="请选择"
|
|
|
- @click.native="categorySelect(row, $index)"
|
|
|
- ></el-input
|
|
|
- ></div>
|
|
|
- </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 }">
|
|
|
@@ -757,6 +527,7 @@
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
</el-tab-pane>
|
|
|
+
|
|
|
<el-tab-pane label="工种" name="工种">
|
|
|
<ele-pro-table
|
|
|
ref="jobTable"
|
|
|
@@ -798,9 +569,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 +611,9 @@
|
|
|
|
|
|
<fileIndex v-if="fileShow" @close="fileClose"></fileIndex>
|
|
|
|
|
|
- <fileBrowse ref="browseRef"></fileBrowse>
|
|
|
+ <fileBrowse ref="browseRef"></fileBrowse>
|
|
|
+
|
|
|
+ <replaceMaterialPop ref="replaceMaterialRef" @selected="replaceSelected" :isView="isView"></replaceMaterialPop>
|
|
|
|
|
|
<div class="btns">
|
|
|
<el-button
|
|
|
@@ -877,7 +648,8 @@
|
|
|
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';
|
|
|
+ import replaceMaterialPop from './replaceMaterialPop.vue';
|
|
|
export default {
|
|
|
components: {
|
|
|
userSearch,
|
|
|
@@ -889,7 +661,8 @@
|
|
|
standardOutput,
|
|
|
term,
|
|
|
fileIndex,
|
|
|
- fileBrowse
|
|
|
+ fileBrowse,
|
|
|
+ replaceMaterialPop
|
|
|
},
|
|
|
mixins: [dictMixins],
|
|
|
data() {
|
|
|
@@ -1225,8 +998,17 @@
|
|
|
treeData: {},
|
|
|
currentIndex: 0,
|
|
|
tableData: {},
|
|
|
- beatParam: {},
|
|
|
- normalHours: {},
|
|
|
+ beatParam: {
|
|
|
+ newTime: '',
|
|
|
+ time: '',
|
|
|
+ newBeatPrepareTime:'',
|
|
|
+ beatPrepareTime: '',
|
|
|
+ newBeatTime: '',
|
|
|
+ beatTime: '',
|
|
|
+ newBeatRestTime: '',
|
|
|
+ beatRestTime: '',
|
|
|
+ },
|
|
|
+
|
|
|
qualityParam: [],
|
|
|
qualityPointParam: [],
|
|
|
|
|
|
@@ -1242,28 +1024,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();
|
|
|
@@ -1285,9 +1064,7 @@
|
|
|
type = 'materialQuota';
|
|
|
} else if (this.activeName === '制造资源') {
|
|
|
type = 'resource';
|
|
|
- } else if (this.activeName === '替代料') {
|
|
|
- type = 'replaceMaterial';
|
|
|
- }
|
|
|
+ }
|
|
|
if (title == '选择物料') {
|
|
|
this.$set(
|
|
|
this.tableData.taskParam[this.currentIndex][type][idx],
|
|
|
@@ -1347,8 +1124,6 @@
|
|
|
type = 'materialQuota';
|
|
|
} else if (this.activeName === '制造资源') {
|
|
|
type = 'resource';
|
|
|
- } else if (this.activeName === '替代料') {
|
|
|
- type = 'replaceMaterial';
|
|
|
} else if (this.activeName === '工种') {
|
|
|
type = 'aptitudeParam';
|
|
|
} else if (this.activeName === '工艺文件') {
|
|
|
@@ -1362,11 +1137,9 @@
|
|
|
this.tableData.taskParam[this.currentIndex][type].splice(index, 1);
|
|
|
},
|
|
|
addProductList(list) {
|
|
|
- console.log(list, 8888);
|
|
|
let subCode = 0;
|
|
|
let array = [];
|
|
|
list.map((item, index) => {
|
|
|
-
|
|
|
let max = '';
|
|
|
if (
|
|
|
this.tableData.taskParam[this.currentIndex]['materialQuota']
|
|
|
@@ -1380,7 +1153,7 @@
|
|
|
) +
|
|
|
10 * ++index +
|
|
|
'';
|
|
|
- console.log(max);
|
|
|
+
|
|
|
if (max.length < 4) {
|
|
|
max = new Array(4 - max.length).fill('0').join('') + max;
|
|
|
}
|
|
|
@@ -1391,8 +1164,16 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ 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({
|
|
|
@@ -1402,28 +1183,63 @@
|
|
|
categoryCode: item.categoryCode,
|
|
|
isReworkBom: 0,
|
|
|
brandNum: item.brandNum,
|
|
|
- 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
|
|
|
- );
|
|
|
-
|
|
|
+
|
|
|
+ let _arr = this.tableData.taskParam[this.currentIndex].materialQuota.concat(
|
|
|
+ array
|
|
|
+ );
|
|
|
+ let uniqueArray = []
|
|
|
+
|
|
|
+ uniqueArray = _arr.reduce((acc, current) => {
|
|
|
+ const existing = acc.find(item => item.id === current.id);
|
|
|
+ if (!existing) {
|
|
|
+ acc.push(current);
|
|
|
+ }
|
|
|
+ return acc;
|
|
|
+ }, []);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ this.tableData.taskParam[this.currentIndex].materialQuota = uniqueArray
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
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; // 其他类型
|
|
|
+ },
|
|
|
+
|
|
|
add() {
|
|
|
let subCode = '0010';
|
|
|
let type = '';
|
|
|
@@ -1438,8 +1254,6 @@
|
|
|
return;
|
|
|
} else if (this.activeName === '制造资源') {
|
|
|
type = 'resource';
|
|
|
- } else if (this.activeName === '替代料') {
|
|
|
- type = 'replaceMaterial';
|
|
|
}
|
|
|
console.log(this.tableData.taskParam[this.currentIndex]);
|
|
|
if (this.tableData.taskParam[this.currentIndex][type].length) {
|
|
|
@@ -1485,12 +1299,11 @@
|
|
|
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;
|
|
|
+
|
|
|
+
|
|
|
} else if (this.activeName === '材料定额') {
|
|
|
this.$refs.materialTable.setData(
|
|
|
this.tableData.taskParam[this.currentIndex].materialQuota || []
|
|
|
@@ -1499,10 +1312,6 @@
|
|
|
this.$refs.resourceTable.setData(
|
|
|
this.tableData.taskParam[this.currentIndex].resource || []
|
|
|
);
|
|
|
- } else if (this.activeName === '替代料') {
|
|
|
- this.$refs.replaceMaterialTable.setData(
|
|
|
- this.tableData.taskParam[this.currentIndex].replaceMaterial || []
|
|
|
- );
|
|
|
} else if (this.activeName === '工种') {
|
|
|
if (
|
|
|
JSON.stringify(
|
|
|
@@ -1671,8 +1480,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;
|
|
|
@@ -1714,8 +1522,81 @@
|
|
|
acc.push({ value, label: value }); // 将 { value, label } 格式的对象添加到数组中
|
|
|
return acc;
|
|
|
}, []); // 初始值为空数组 []
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ convertToSeconds(time) {
|
|
|
+ switch (this.beatParam.unit) {
|
|
|
+ case '秒':
|
|
|
+ return time;
|
|
|
+ case '分钟':
|
|
|
+ return time * 60;
|
|
|
+ case '小时':
|
|
|
+ return time * 3600;
|
|
|
+ case '天':
|
|
|
+ return time * 86400; // 24小时 * 60分钟 * 60秒
|
|
|
+ case '月':
|
|
|
+ // 近似值,一个月按30天计算
|
|
|
+ return time * 86400 * 30;
|
|
|
+ case '年':
|
|
|
+ // 近似值,一年按365天计算
|
|
|
+ return time * 86400 * 365;
|
|
|
+ case '毫秒':
|
|
|
+ return time / 1000;
|
|
|
+ case '微秒':
|
|
|
+ return time / 1000000;
|
|
|
+ default:
|
|
|
+ this.$message.error('不支持的时间单位: ' + unit);
|
|
|
}
|
|
|
+},
|
|
|
+
|
|
|
+convertVal(val, name) {
|
|
|
+ if(!this.beatParam.unit) {
|
|
|
+ return this.$message.error('请选择时间单位');
|
|
|
+ }
|
|
|
+
|
|
|
+ const isNumeric = /^\d*(\.\d+)?$/.test(val);
|
|
|
+ if(isNumeric) {
|
|
|
+ this.beatParam[name] = this.convertToSeconds(val);
|
|
|
+ } else {
|
|
|
+ this.$message.error('请输入数字');
|
|
|
+ this.beatParam[name] = ''
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+changeUnit() {
|
|
|
+ this.beatParam.newTime = '';
|
|
|
+ this.beatParam.time = '';
|
|
|
+ this.beatParam.newBeatPrepareTime = '';
|
|
|
+ this.beatParam.beatPrepareTime = '';
|
|
|
+ this.beatParam.newBeatTime = '';
|
|
|
+ this.beatParam.beatTime = '';
|
|
|
+ this.beatParam.newBeatRestTime = '';
|
|
|
+ this.beatParam.beatRestTime = '';
|
|
|
+
|
|
|
+},
|
|
|
+
|
|
|
+handSubstitution(row) {
|
|
|
+ this.$refs.replaceMaterialRef.open(row);
|
|
|
+},
|
|
|
+replaceSelected(id, list) {
|
|
|
+
|
|
|
+ let _arr = []
|
|
|
+ _arr = this.tableData.taskParam[this.currentIndex].materialQuota
|
|
|
+ _arr.forEach(item => {
|
|
|
+ if(item.id === id) {
|
|
|
+ item.replaceMaterial = list;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.tableData.taskParam[this.currentIndex].materialQuota = _arr
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
|