fix:检验添加批量操作
This commit is contained in:
parent
cbdc512cee
commit
9a370048ce
|
@ -356,6 +356,7 @@
|
||||||
ref="checkDialogSingle"
|
ref="checkDialogSingle"
|
||||||
:mlogb="mlogb"
|
:mlogb="mlogb"
|
||||||
:wm = "wm"
|
:wm = "wm"
|
||||||
|
:mgroup="mgroup"
|
||||||
:isSubmit="isSubmit"
|
:isSubmit="isSubmit"
|
||||||
:batchNumber="batchNumber"
|
:batchNumber="batchNumber"
|
||||||
:handle_user="handle_user"
|
:handle_user="handle_user"
|
||||||
|
|
|
@ -7,160 +7,342 @@
|
||||||
@closed="$emit('closed')"
|
@closed="$emit('closed')"
|
||||||
>
|
>
|
||||||
<el-container>
|
<el-container>
|
||||||
|
<el-header v-if="descriptionVisible">
|
||||||
|
<div style="display: flex;align-items: center;justify-content: space-between;width: 100%;">
|
||||||
|
<div>检验人:{{setForm.test_user_name}}</div>
|
||||||
|
<div>检验设备:{{setForm.equipment_name}}</div>
|
||||||
|
<div>缺陷项:
|
||||||
|
<span v-for="(item1,index1) in defectlists" :key="item1.id">{{ item1.defect_name }}
|
||||||
|
<span v-if="index1 < defectlists.length-1">、</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div>检测项:
|
||||||
|
<span v-for="(item2,index2) in testitemlists" :key="item2.id">{{ item2.testitem_name }}
|
||||||
|
<span v-if="index2 < testitemlists.length-1">、</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-header>
|
||||||
<el-main id="mlogbwMain">
|
<el-main id="mlogbwMain">
|
||||||
|
<el-button type="primary" @click="check_start" style="position: absolute;top: 20px;left: 150px;">检验</el-button>
|
||||||
|
<el-button type="primary" v-if="setForm.equipment!=''" @click="check_set" style="position: absolute;top: 20px;left: 210px;">批量操作</el-button>
|
||||||
<sc-form-table
|
<sc-form-table
|
||||||
hideDelete
|
hideDelete
|
||||||
id="mlogbwlist"
|
id="mlogbwlist"
|
||||||
:tableHeight="tableHeight"
|
:tableHeight="tableHeight"
|
||||||
v-model="mlogbwlist"
|
v-model="mlogbwlist"
|
||||||
:addTemplate="addTemplate"
|
:addTemplate="addTemplate"
|
||||||
placeholder="暂无数据"
|
placeholder="暂无数据"
|
||||||
>
|
:hideAdd="hideAdd"
|
||||||
<el-table-column prop="number" label="物料编号" fixed min-width="120px">
|
>
|
||||||
<template #default="scope">
|
<el-table-column prop="number" label="物料编号" fixed min-width="120px">
|
||||||
<span v-if="!scope.row.isEdit">{{ scope.row.number }}</span>
|
<template #default="scope">
|
||||||
<el-input v-if="scope.row.isEdit&&mode == 'outs'" v-model="scope.row.number" placeholder="物料编号"></el-input>
|
<span v-if="!scope.row.isEdit">{{ scope.row.number }}</span>
|
||||||
<el-select
|
<el-input v-if="scope.row.isEdit&&mode == 'outs'" v-model="scope.row.number" placeholder="物料编号"></el-input>
|
||||||
v-if="scope.row.isEdit&&mode == 'ins'"
|
<el-select
|
||||||
v-model="scope.row.wpr"
|
v-if="scope.row.isEdit&&mode == 'ins'"
|
||||||
placeholder="动态成品"
|
v-model="scope.row.wpr"
|
||||||
clearable
|
placeholder="动态成品"
|
||||||
style="width: 100%"
|
clearable
|
||||||
@change="optionChange(scope.row)"
|
style="width: 100%"
|
||||||
>
|
@change="optionChange(scope.row)"
|
||||||
<el-option
|
|
||||||
v-for="item in options"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.number"
|
|
||||||
:value="item.id"
|
|
||||||
>
|
>
|
||||||
</el-option>
|
<el-option
|
||||||
</el-select>
|
v-for="item in options"
|
||||||
</template>
|
:key="item.id"
|
||||||
</el-table-column>
|
:label="item.number"
|
||||||
<el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id" width="150px">
|
:value="item.id"
|
||||||
<template #default="scope">
|
>
|
||||||
<el-input-number
|
</el-option>
|
||||||
v-if="item.testitem_field_type=='input-number'"
|
</el-select>
|
||||||
v-model="scope.row[item.testitem_name]"
|
</template>
|
||||||
:min="0"
|
</el-table-column>
|
||||||
:disabled="!scope.row.isEdit"
|
<el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id" width="150px">
|
||||||
class="width-100"
|
<template #default="scope">
|
||||||
controls-position="right"
|
<el-input-number
|
||||||
@change="defectCountSun(scope.row)"
|
v-if="item.testitem_field_type=='input-number'"
|
||||||
>
|
v-model="scope.row[item.testitem_name]"
|
||||||
</el-input-number>
|
:min="0"
|
||||||
<el-input-number
|
:disabled="!scope.row.isEdit||!item.canEdit"
|
||||||
v-if="item.testitem_field_type=='input-int'"
|
class="width-100"
|
||||||
v-model="scope.row[item.testitem_name]"
|
controls-position="right"
|
||||||
:min="0"
|
@change="defectCountSun(scope.row)"
|
||||||
:disabled="!scope.row.isEdit"
|
|
||||||
class="width-100"
|
|
||||||
controls-position="right"
|
|
||||||
@change="defectCountSun(scope.row)"
|
|
||||||
>
|
|
||||||
</el-input-number>
|
|
||||||
<el-input
|
|
||||||
v-if="item.testitem_field_type=='input-text'"
|
|
||||||
v-model="scope.row[item.testitem_name]"
|
|
||||||
class="width-100"
|
|
||||||
:disabled="!scope.row.isEdit"
|
|
||||||
@change="defectCountSun(scope.row)"
|
|
||||||
>
|
|
||||||
</el-input>
|
|
||||||
<el-select
|
|
||||||
v-if="item.testitem_field_type=='select-text'"
|
|
||||||
v-model="scope.row[item.testitem_name]"
|
|
||||||
clearable
|
|
||||||
class="width-100"
|
|
||||||
:disabled="!scope.row.isEdit"
|
|
||||||
@change="defectCountSun(scope.row)"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item0 in item.testitem_choices"
|
|
||||||
:key="item0"
|
|
||||||
:label="item0"
|
|
||||||
:value="item0"
|
|
||||||
>
|
>
|
||||||
</el-option>
|
</el-input-number>
|
||||||
</el-select>
|
<el-input-number
|
||||||
<el-select
|
v-if="item.testitem_field_type=='input-int'"
|
||||||
v-if="item.testitem_field_type=='selects-text'"
|
v-model="scope.row[item.testitem_name]"
|
||||||
v-model="scope.row[item.testitem_name]"
|
:min="0"
|
||||||
clearable
|
:disabled="!scope.row.isEdit||!item.canEdit"
|
||||||
multiple
|
class="width-100"
|
||||||
class="width-100"
|
controls-position="right"
|
||||||
:disabled="!scope.row.isEdit"
|
@change="defectCountSun(scope.row)"
|
||||||
@change="defectCountSun(scope.row)"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item1 in item.testitem_choices"
|
|
||||||
:key="item1"
|
|
||||||
:label="item1"
|
|
||||||
:value="item1"
|
|
||||||
>
|
>
|
||||||
</el-option>
|
</el-input-number>
|
||||||
</el-select>
|
<el-input
|
||||||
</template>
|
v-if="item.testitem_field_type=='input-text'"
|
||||||
</el-table-column>
|
v-model="scope.row[item.testitem_name]"
|
||||||
<el-table-column prop="note" :label="item.defect_name" v-for="item in qct_defects" :key="item.id" width="80px">
|
class="width-100"
|
||||||
<template #default="scope">
|
:disabled="!scope.row.isEdit||!item.canEdit"
|
||||||
<el-switch
|
@change="defectCountSun(scope.row)"
|
||||||
:disabled="!scope.row.isEdit"
|
>
|
||||||
v-model="scope.row[item.defect_name]"
|
</el-input>
|
||||||
style="--el-switch-on-color: red"
|
<el-select
|
||||||
@change="switchChange(scope.row, item)"
|
v-if="item.testitem_field_type=='select-text'"
|
||||||
></el-switch>
|
v-model="scope.row[item.testitem_name]"
|
||||||
</template>
|
clearable
|
||||||
</el-table-column>
|
class="width-100"
|
||||||
<el-table-column prop="note" label="备注" width="80px">
|
:disabled="!scope.row.isEdit||!item.canEdit"
|
||||||
<template #default="scope">
|
@change="defectCountSun(scope.row)"
|
||||||
<span v-if="!scope.row.isEdit">{{ scope.row.note }}</span>
|
>
|
||||||
<el-input v-else v-model="scope.row.note" placeholder="备注"></el-input>
|
<el-option
|
||||||
</template>
|
v-for="item0 in item.testitem_choices"
|
||||||
</el-table-column>
|
:key="item0"
|
||||||
<el-table-column prop="open" label="操作" width="90" align="center" fixed="right" v-if="!isSubmit">
|
:label="item0"
|
||||||
<template #default="scope">
|
:value="item0"
|
||||||
<el-link
|
>
|
||||||
v-if="scope.row.isEdit"
|
</el-option>
|
||||||
type="primary"
|
</el-select>
|
||||||
size="small"
|
<el-select
|
||||||
@click="formTableSave(scope.row)"
|
v-if="item.testitem_field_type=='selects-text'"
|
||||||
>保存</el-link
|
v-model="scope.row[item.testitem_name]"
|
||||||
>
|
clearable
|
||||||
<el-link
|
multiple
|
||||||
v-if="scope.row.isEdit"
|
class="width-100"
|
||||||
type="danger"
|
:disabled="!scope.row.isEdit||!item.canEdit"
|
||||||
size="small"
|
@change="defectCountSun(scope.row)"
|
||||||
style="margin-left: 5px;"
|
>
|
||||||
@click="formTableCancel(scope.row)"
|
<el-option
|
||||||
>取消</el-link
|
v-for="item1 in item.testitem_choices"
|
||||||
>
|
:key="item1"
|
||||||
<el-link
|
:label="item1"
|
||||||
v-else
|
:value="item1"
|
||||||
type="primary"
|
>
|
||||||
size="small"
|
</el-option>
|
||||||
@click="formTableEdit(scope.row)"
|
</el-select>
|
||||||
>编辑</el-link
|
</template>
|
||||||
>
|
</el-table-column>
|
||||||
<el-link
|
<el-table-column prop="note" :label="item.defect_name" v-for="item in qct_defects" :key="item.id" width="120px">
|
||||||
v-if="!scope.row.isEdit"
|
<template #default="scope">
|
||||||
type="danger"
|
<el-switch
|
||||||
size="small"
|
:disabled="!scope.row.isEdit||!item.canEdit"
|
||||||
style="margin-left: 5px;"
|
v-model="scope.row[item.defect_name]"
|
||||||
@click="formTableDel(scope.row.id)"
|
style="--el-switch-on-color: red"
|
||||||
>删除</el-link
|
@change="switchChange(scope.row, item)"
|
||||||
>
|
></el-switch>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</sc-form-table>
|
<el-table-column prop="note" label="备注" width="80px">
|
||||||
|
<template #default="scope">
|
||||||
|
<span v-if="!scope.row.isEdit">{{ scope.row.note }}</span>
|
||||||
|
<el-input v-else v-model="scope.row.note" placeholder="备注"></el-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="open" label="操作" width="90" align="center" fixed="right" v-if="!isSubmit">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-link
|
||||||
|
v-if="scope.row.isEdit"
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="formTableSave(scope.row)"
|
||||||
|
>保存</el-link
|
||||||
|
>
|
||||||
|
<el-link
|
||||||
|
v-if="scope.row.isEdit"
|
||||||
|
type="danger"
|
||||||
|
size="small"
|
||||||
|
style="margin-left: 5px;"
|
||||||
|
@click="formTableCancel(scope.row)"
|
||||||
|
>取消</el-link
|
||||||
|
>
|
||||||
|
<el-link
|
||||||
|
v-else
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="formTableEdit(scope.row)"
|
||||||
|
>编辑</el-link
|
||||||
|
>
|
||||||
|
<el-link
|
||||||
|
v-if="!scope.row.isEdit"
|
||||||
|
type="danger"
|
||||||
|
size="small"
|
||||||
|
style="margin-left: 5px;"
|
||||||
|
@click="formTableDel(scope.row.id)"
|
||||||
|
>删除</el-link
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</sc-form-table>
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
|
<el-dialog
|
||||||
|
title="检验"
|
||||||
|
v-model="checkVisible"
|
||||||
|
destroy-on-close
|
||||||
|
>
|
||||||
|
<el-container>
|
||||||
|
<el-main>
|
||||||
|
<el-form
|
||||||
|
ref="dialogForm"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
label-width="80px"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-col :md="12" :sm="12" :xs="24">
|
||||||
|
<el-form-item label="操作人" prop="test_user">
|
||||||
|
<ehsSelect
|
||||||
|
v-model="form.test_user"
|
||||||
|
:showName="test_user_name"
|
||||||
|
:apiObj="this.$API.system.user.list"
|
||||||
|
:params="{ depts: dept }"
|
||||||
|
style="width: 100%"
|
||||||
|
@change="userChange"
|
||||||
|
></ehsSelect>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="12" :xs="24">
|
||||||
|
<el-form-item label="设备" prop="equipment">
|
||||||
|
<el-select
|
||||||
|
v-model="form.equipment"
|
||||||
|
placeholder="设备"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
style="width: 100%"
|
||||||
|
@change="equipmentChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in equipmentOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
>
|
||||||
|
<span style="float:left">{{item.name}}</span>
|
||||||
|
<span style="float:right">{{item.number}}</span>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="12" :xs="24">
|
||||||
|
<el-form-item label="检测项">
|
||||||
|
<el-select
|
||||||
|
v-model="form.testitemids"
|
||||||
|
placeholder="检测项"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
multiple
|
||||||
|
style="width: 100%"
|
||||||
|
@change="testitemidsChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in qct_testitems"
|
||||||
|
:key="item.testitem"
|
||||||
|
:label="item.testitem_name"
|
||||||
|
:value="item.testitem"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="12" :xs="24">
|
||||||
|
<el-form-item label="缺陷项">
|
||||||
|
<el-select
|
||||||
|
v-model="form.defectids"
|
||||||
|
placeholder="缺陷项"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
multiple
|
||||||
|
style="width: 100%"
|
||||||
|
@change="defectidsChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in qct_defects"
|
||||||
|
:key="item.defect"
|
||||||
|
:label="item.defect_name"
|
||||||
|
:value="item.defect"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<el-footer>
|
||||||
|
<el-button type="primary" :loading="isSaveing" @click.stop="checkSetting" save>确定</el-button>
|
||||||
|
<el-button @click="saveCancel">取消</el-button>
|
||||||
|
</el-footer>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</el-dialog>
|
||||||
|
<el-dialog
|
||||||
|
title="检验"
|
||||||
|
v-model="setVisible"
|
||||||
|
destroy-on-close
|
||||||
|
>
|
||||||
|
<el-container>
|
||||||
|
<el-main>
|
||||||
|
<el-form
|
||||||
|
ref="dialogForm"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
label-width="150px"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-col v-for="item in testitemlists" :key="item.id">
|
||||||
|
<el-form-item :label="item.testitem_name">
|
||||||
|
<el-input v-model="item.value"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col v-for="item2 in defectlists" :key="item2.id">
|
||||||
|
<el-form-item :label="item2.defect_name">
|
||||||
|
<el-input v-model="item2.value"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col>
|
||||||
|
<!-- 扫描物料的number 根据number对比list里的物料-->
|
||||||
|
<el-form-item label="检测物料">
|
||||||
|
<el-input v-model="wprNumber" @change="wprChange(wprNumber)"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<el-row>
|
||||||
|
<el-table :data="selectWpr" border>
|
||||||
|
<el-table-column prop="number" label="物料编号"></el-table-column>
|
||||||
|
<el-table-column v-for="item in testitemlists" :key="item.id" :label="item.testitem_name">
|
||||||
|
{{ item.value }}
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column v-for="item2 in defectlists" :key="item2.id" :label="item2.defect_name">
|
||||||
|
{{ item2.value }}
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="90" align="center" fixed="right">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-link type="danger" size="small" @click="selectWprDel(scope.row)">删除</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-row>
|
||||||
|
<el-footer>
|
||||||
|
<el-button type="primary" :loading="isSaveing" @click.stop="saveSetting" save>保存</el-button>
|
||||||
|
<el-button @click="saveCancel">取消</el-button>
|
||||||
|
</el-footer>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</el-dialog>
|
||||||
|
<!-- <check-drawer
|
||||||
|
v-if="drawerVisible"
|
||||||
|
ref="saveDialog"
|
||||||
|
:defects="qct_defects"
|
||||||
|
:testitems="qct_testitems"
|
||||||
|
:mlogbwlist="mlogbwlist"
|
||||||
|
@success="handleSaveSuccess"
|
||||||
|
@closed="saveMlogbInClose"
|
||||||
|
>
|
||||||
|
</check-drawer> -->
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import checkDrawer from "./mlogbw_check_form.vue";
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
mlogb: {
|
mlogb: {
|
||||||
|
@ -183,11 +365,18 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: "",
|
default: "",
|
||||||
},
|
},
|
||||||
|
mgroup:{
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
isSubmit:{
|
isSubmit:{
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
components: {
|
||||||
|
checkDrawer
|
||||||
|
},
|
||||||
emits: ["success", "closed"],
|
emits: ["success", "closed"],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -198,21 +387,49 @@ export default {
|
||||||
},
|
},
|
||||||
mode:'ins',
|
mode:'ins',
|
||||||
//表单数据
|
//表单数据
|
||||||
form: {},
|
form: {
|
||||||
|
test_user:"",
|
||||||
|
equipment:"",
|
||||||
|
equipment_name:"",
|
||||||
|
testitemids : [],
|
||||||
|
defectids : [],
|
||||||
|
},
|
||||||
|
test_user_name:"",
|
||||||
qct:"",
|
qct:"",
|
||||||
mgroup: "",
|
values:"",
|
||||||
|
wprNumber:"",
|
||||||
params: {mlogb:'',page:0},
|
params: {mlogb:'',page:0},
|
||||||
|
hideAdd: true,
|
||||||
visible: false,
|
visible: false,
|
||||||
|
setVisible:false,
|
||||||
|
checkVisible:false,
|
||||||
|
descriptionVisible:false,
|
||||||
options:[],
|
options:[],
|
||||||
qct_defects:[],
|
qct_defects:[],
|
||||||
qct_testitems:[],
|
qct_testitems:[],
|
||||||
mlogbwlist:[],
|
mlogbwlist:[],
|
||||||
|
equipmentOptions:[],
|
||||||
addTemplate:{
|
addTemplate:{
|
||||||
mlogb: "",
|
mlogb: "",
|
||||||
number: "",
|
number: "",
|
||||||
note: "",
|
note: "",
|
||||||
isEdit: true,
|
isEdit: true,
|
||||||
},
|
},
|
||||||
|
setForm:{
|
||||||
|
test_user:"",
|
||||||
|
equipment:"",
|
||||||
|
equipment_name:"",
|
||||||
|
testitemids : [],
|
||||||
|
defectids : [],
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
test_user: [{ required: true, message: "请选择操作人" }],
|
||||||
|
equipment:[{ required: true, message: "请选择设备" }],
|
||||||
|
|
||||||
|
},
|
||||||
|
defectlists:[],
|
||||||
|
testitemlists:[],
|
||||||
|
selectWpr:[],
|
||||||
tableHeight:500,
|
tableHeight:500,
|
||||||
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
||||||
printer_name:localStorage.getItem("printer_name")
|
printer_name:localStorage.getItem("printer_name")
|
||||||
|
@ -220,6 +437,7 @@ export default {
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
that.hideAdd = that.isSubmit;
|
||||||
that.addTemplate.number = that.batchNumber;
|
that.addTemplate.number = that.batchNumber;
|
||||||
that.params.mlogb = that.addTemplate.mlogb = that.mlogb;
|
that.params.mlogb = that.addTemplate.mlogb = that.mlogb;
|
||||||
},
|
},
|
||||||
|
@ -231,11 +449,17 @@ export default {
|
||||||
that.getOptions();
|
that.getOptions();
|
||||||
that.getdefects();
|
that.getdefects();
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
this.tableHeight = document.getElementById('mlogbwMain').clientHeight-20;
|
// this.tableHeight = document.getElementById('mlogbwMain').clientHeight-20;
|
||||||
},500)
|
// },500)
|
||||||
|
|
||||||
},
|
},
|
||||||
|
getEquipments(){
|
||||||
|
let that = this;
|
||||||
|
that.$API.em.equipment.list.req({page:0}).then((res) => {
|
||||||
|
that.equipmentOptions = res;
|
||||||
|
})
|
||||||
|
},
|
||||||
getdefects(){
|
getdefects(){
|
||||||
let that = this;
|
let that = this;
|
||||||
if(that.qct!==null&&that.qct!==''){
|
if(that.qct!==null&&that.qct!==''){
|
||||||
|
@ -281,7 +505,6 @@ export default {
|
||||||
console.log('item',item);
|
console.log('item',item);
|
||||||
let index = that.mlogbwlist.indexOf(row);
|
let index = that.mlogbwlist.indexOf(row);
|
||||||
that.mlogbwlist[index].number = item.number;
|
that.mlogbwlist[index].number = item.number;
|
||||||
// that.mlogbwlist[index].wpr = item.id;
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -294,6 +517,7 @@ export default {
|
||||||
let obj = {};
|
let obj = {};
|
||||||
obj = Object.assign({},item);
|
obj = Object.assign({},item);
|
||||||
obj.isEdit = false;
|
obj.isEdit = false;
|
||||||
|
obj.canEdit = false;
|
||||||
if(that.qct!=null&&that.qct!=''&&item.ftest!=null){
|
if(that.qct!=null&&that.qct!=''&&item.ftest!=null){
|
||||||
if(item.ftest.ftestdefects!==undefined&&item.ftest.ftestdefects!==''&&item.ftest.ftestdefects!==null&&item.ftest.ftestdefects.length>0){
|
if(item.ftest.ftestdefects!==undefined&&item.ftest.ftestdefects!==''&&item.ftest.ftestdefects!==null&&item.ftest.ftestdefects.length>0){
|
||||||
item.ftest.ftestdefects.forEach((item1) => {
|
item.ftest.ftestdefects.forEach((item1) => {
|
||||||
|
@ -319,7 +543,6 @@ export default {
|
||||||
}
|
}
|
||||||
that.mlogbwlist.push(obj);
|
that.mlogbwlist.push(obj);
|
||||||
})
|
})
|
||||||
console.log('mlogbwlistmlogbwlist',that.mlogbwlist);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -398,6 +621,7 @@ export default {
|
||||||
formTableEdit(row) {
|
formTableEdit(row) {
|
||||||
this.mlogbwlist.forEach((item, index) => {
|
this.mlogbwlist.forEach((item, index) => {
|
||||||
if (item.id == row.id) {
|
if (item.id == row.id) {
|
||||||
|
console.log('row',row);
|
||||||
this.mlogbwlist[index].isEdit = true;
|
this.mlogbwlist[index].isEdit = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -485,6 +709,171 @@ export default {
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
userChange(val){
|
||||||
|
let that = this;
|
||||||
|
this.$API.system.user.item.req(val).then((res) => {
|
||||||
|
that.setForm.test_user_name = res.name;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
equipmentChange(){
|
||||||
|
let that = this;
|
||||||
|
that.equipmentOptions.forEach(item => {
|
||||||
|
if(item.id == that.form.equipment){
|
||||||
|
that.form.equipment_name = item.name;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
testitemidsChange(){
|
||||||
|
let that = this;
|
||||||
|
that.testitemlists = [];
|
||||||
|
that.qct_testitems.forEach(item => {
|
||||||
|
if(that.form.testitemids.indexOf(item.testitem) > -1){
|
||||||
|
item.canEdit = true;
|
||||||
|
item.value=null;
|
||||||
|
that.testitemlists.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
defectidsChange(){
|
||||||
|
let that = this;
|
||||||
|
that.defectlists = [];
|
||||||
|
that.qct_defects.forEach(item => {
|
||||||
|
if(that.form.defectids.indexOf(item.defect) > -1){
|
||||||
|
item.canEdit = true;
|
||||||
|
item.value=null;
|
||||||
|
that.defectlists.push(item);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
check_start(){
|
||||||
|
this.checkVisible=true;
|
||||||
|
this.getEquipments();
|
||||||
|
},
|
||||||
|
checkSetting(){
|
||||||
|
let that = this;
|
||||||
|
this.$refs.dialogForm.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
Object.assign(that.setForm,that.form);
|
||||||
|
this.form = {};
|
||||||
|
that.mlogbwlist.forEach(item => {
|
||||||
|
if(item.ftest!==null){
|
||||||
|
item.ftest.ftestdefects.forEach(defect => {
|
||||||
|
if(that.setForm.defectids.indexOf(defect.defect) > -1){
|
||||||
|
defect.test_user = that.setForm.test_user;
|
||||||
|
// defect.test_equip = that.setForm.equipment;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
item.ftest.ftestitems.forEach(testitem => {
|
||||||
|
if(that.setForm.testitemids.indexOf(testitem.testitem) > -1){
|
||||||
|
testitem.test_user = that.setForm.test_user;
|
||||||
|
testitem.test_equip = that.setForm.equipment;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
let ftest = {};
|
||||||
|
ftest.ftestitems = [];
|
||||||
|
ftest.ftestdefects = [];
|
||||||
|
ftest.qct = that.qct;
|
||||||
|
ftest.test_date = that.handle_date;
|
||||||
|
ftest.test_user = that.handle_user;
|
||||||
|
that.qct_defects.forEach((item0) => {
|
||||||
|
let itemObj = {};
|
||||||
|
itemObj.defect = item0.defect;
|
||||||
|
itemObj.has = false;
|
||||||
|
if(that.setForm.defectids.indexOf(item0.defect) > -1){
|
||||||
|
itemObj.test_user = that.setForm.test_user;
|
||||||
|
// itemObj.test_equip = that.setForm.equipment;
|
||||||
|
}else{
|
||||||
|
itemObj.test_user = that.handle_user;
|
||||||
|
}
|
||||||
|
ftest.ftestdefects.push(itemObj);
|
||||||
|
})
|
||||||
|
that.qct_testitems.forEach((item1) => {
|
||||||
|
let itemObj1 = {};
|
||||||
|
itemObj1.testitem = item1.testitem;
|
||||||
|
itemObj1.addto_wpr = item1.addto_wpr;
|
||||||
|
itemObj1.test_val_json = "";
|
||||||
|
if(that.setForm.testitemids.indexOf(item1.testitem) > -1){
|
||||||
|
itemObj1.test_user = that.setForm.test_user;
|
||||||
|
itemObj1.test_equip = that.setForm.equipment;
|
||||||
|
}else{
|
||||||
|
itemObj1.test_user = that.handle_user;
|
||||||
|
}
|
||||||
|
ftest.ftestitems.push(itemObj1);
|
||||||
|
})
|
||||||
|
item.ftest = ftest;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
that.$API.wpm.mlogbw.update.req("bulk",that.mlogbwlist).then((res) => {
|
||||||
|
console.log('blukres',res);
|
||||||
|
that.checkVisible = false;
|
||||||
|
that.descriptionVisible = true;
|
||||||
|
that.getList();
|
||||||
|
}).catch((err) => {
|
||||||
|
return err;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
saveCancel(){
|
||||||
|
this.form = {};
|
||||||
|
this.form.test_user = "";
|
||||||
|
this.form.equipment = "";
|
||||||
|
this.form.testitemids = [];
|
||||||
|
this.form.defectids = [];
|
||||||
|
this.checkVisible = false;
|
||||||
|
},
|
||||||
|
check_set(){
|
||||||
|
this.setVisible=true;
|
||||||
|
},
|
||||||
|
wprChange(wprNumber){
|
||||||
|
let that = this;
|
||||||
|
that.mlogbwlist.forEach(item => {
|
||||||
|
if(item.number == wprNumber){
|
||||||
|
that.selectWpr.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
selectWprDel(row){
|
||||||
|
let that = this;
|
||||||
|
that.selectWpr.forEach((item,index) => {
|
||||||
|
if(item.number == row.number){
|
||||||
|
that.selectWpr.splice(index,1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
saveSetting(){
|
||||||
|
let that = this;
|
||||||
|
this.$refs.dialogForm.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
that.selectWpr.forEach(item => {
|
||||||
|
item.ftest.ftestdefects.forEach(defect => {
|
||||||
|
let defectindex = that.setForm.defectids.indexOf(defect.defect);
|
||||||
|
if(defectindex > -1){
|
||||||
|
defect.has = that.defectlists[defectindex].value;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
item.ftest.ftestitems.forEach(testitem => {
|
||||||
|
let testitemindex = that.setForm.testitemids.indexOf(testitem.testitem);
|
||||||
|
if( testitemindex > -1){
|
||||||
|
console.log('that.testitemlists[testitemindex].value',that.testitemlists[testitemindex].value)
|
||||||
|
testitem.test_val_json = that.testitemlists[testitemindex].value;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
console.log('that.selectWpr',that.selectWpr);
|
||||||
|
that.$API.wpm.mlogbw.update.req("bulk",that.selectWpr).then((res) => {
|
||||||
|
console.log('blukres',res);
|
||||||
|
that.setVisible = false;
|
||||||
|
that.descriptionVisible = false;
|
||||||
|
that.setForm = {};
|
||||||
|
that.getList();
|
||||||
|
}).catch((err) => {
|
||||||
|
return err;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -0,0 +1,193 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
title="检验"
|
||||||
|
v-model="visible"
|
||||||
|
destroy-on-close
|
||||||
|
@closed="$emit('closed')"
|
||||||
|
>
|
||||||
|
<el-container>
|
||||||
|
<el-main id="mlogbwMain">
|
||||||
|
<el-form
|
||||||
|
ref="dialogForm"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
label-width="80px"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-col :md="12" :sm="12" :xs="24">
|
||||||
|
<el-form-item label="操作人">
|
||||||
|
<ehsSelect
|
||||||
|
v-model="form.handle_user"
|
||||||
|
:showName="form.handle_user_name"
|
||||||
|
:apiObj="this.$API.system.user.list"
|
||||||
|
:params="{ depts: dept }"
|
||||||
|
style="width: 100%"
|
||||||
|
></ehsSelect>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="12" :xs="24">
|
||||||
|
<el-form-item label="设备">
|
||||||
|
<el-select
|
||||||
|
v-model="form.equipment"
|
||||||
|
placeholder="设备"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.id"
|
||||||
|
>
|
||||||
|
<span style="float:left">{{item.name}}</span>
|
||||||
|
<span style="float:right">{{item.number}}</span>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="12" :xs="24">
|
||||||
|
<el-form-item label="检测项">
|
||||||
|
<el-select
|
||||||
|
v-model="form.testitemlist"
|
||||||
|
placeholder="检测项"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
multiple
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in testitems"
|
||||||
|
:key="item.testitem"
|
||||||
|
:label="item.testitem_name"
|
||||||
|
:value="item.testitem"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :md="12" :sm="12" :xs="24">
|
||||||
|
<el-form-item label="缺陷项">
|
||||||
|
<el-select
|
||||||
|
v-model="form.defectlist"
|
||||||
|
placeholder="缺陷项"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
multiple
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in defects"
|
||||||
|
:key="item.defect"
|
||||||
|
:label="item.defect_name"
|
||||||
|
:value="item.defect"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button type="primary" :loading="isSaveing" @click="submit">
|
||||||
|
保存
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="visible = false">取消</el-button>
|
||||||
|
</template>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
defects: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
},
|
||||||
|
mlogbwlist: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
},
|
||||||
|
testitems:{
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
emits: ["success", "closed"],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
//表单数据
|
||||||
|
form: {},
|
||||||
|
qct:"",
|
||||||
|
mgroup: "",
|
||||||
|
params: {mlogb:'',page:0},
|
||||||
|
hideAdd: true,
|
||||||
|
visible: false,
|
||||||
|
options:[],
|
||||||
|
qct_defects:[],
|
||||||
|
qct_testitems:[],
|
||||||
|
mlogbwlists:[],
|
||||||
|
tableHeight:500,
|
||||||
|
apiObjPrint:this.$API.cm.labelmat.fromWm,
|
||||||
|
printer_name:localStorage.getItem("printer_name")
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open(qct = '') {
|
||||||
|
let that = this;
|
||||||
|
that.qct = qct;
|
||||||
|
that.getDefects();//缺陷项
|
||||||
|
// that.getUsers();//人员
|
||||||
|
// that.getEquipment();//设备
|
||||||
|
that.visible = true;
|
||||||
|
console.log('this.defects',this.defects)
|
||||||
|
console.log('this.testitems',this.testitems)
|
||||||
|
console.log('this.mlogbwlist',this.mlogbwlist)
|
||||||
|
// setTimeout(() => {
|
||||||
|
// that.tableHeight = document.getElementById('mlogbwMain').clientHeight-20;
|
||||||
|
// },500)
|
||||||
|
|
||||||
|
},
|
||||||
|
getDefects(){
|
||||||
|
let that = this;
|
||||||
|
if(that.qct!==null&&that.qct!==''){
|
||||||
|
that.$API.qm.qct.item.req(that.qct).then((res) => {
|
||||||
|
that.qct_defects = [];
|
||||||
|
that.qct_defects = res.qct_defects;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getEquipment() {
|
||||||
|
let that = this;
|
||||||
|
this.$API.em.equipment.list.req({ page: 0, type: 10,mgroup:that.mgroup}).then((res) => {
|
||||||
|
res.forEach((item) => {
|
||||||
|
let obj = {};
|
||||||
|
Object.assign(obj, item);
|
||||||
|
obj.label = item.name+'-'+item.number;
|
||||||
|
that.options.push(obj);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//表单提交方法
|
||||||
|
mlogbSubmit() {
|
||||||
|
let that = this;
|
||||||
|
that.$API.wpm.mlogb.submit.req(that.mlogb).then((res) => {
|
||||||
|
that.isSaveing = false;
|
||||||
|
that.visible = false;
|
||||||
|
that.$message.success("操作成功");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.width-100{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue