fix:mlogbw样式调整

This commit is contained in:
shijing 2025-01-21 11:07:06 +08:00
parent dfdecc01bd
commit c5d6e6fcf7
2 changed files with 156 additions and 146 deletions

View File

@ -130,7 +130,9 @@ export default {
font-weight: bold;
color: #008000;
}
#mlogbwList .el-table--default .cell{
padding: 0 5px !important;
}
#table1.el-table,
#table1.el-table tr,
#table1.el-table .el-table__body-wrapper,

View File

@ -2,157 +2,162 @@
<el-drawer
:title="headTitle[mode]"
v-model="visible"
:size="'80%'"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
>
<sc-form-table
hideDelete
:tableHeight="500"
v-model="mlogbwlist"
:addTemplate="addTemplate"
placeholder="暂无数据"
>
<el-table-column prop="number" label="物料编号">
<template #default="scope">
<span v-if="!scope.row.isEdit">{{ scope.row.number }}</span>
<el-input v-if="scope.row.isEdit&&mode == 'outs'" v-model="scope.row.number" placeholder="物料编号"></el-input>
<el-select
v-if="scope.row.isEdit&&mode == 'ins'"
v-model="scope.row.wpr"
placeholder="动态成品"
clearable
style="width: 100%"
@change="optionChange(scope.row)"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.number"
:value="item.id"
<el-container>
<el-main>
<sc-form-table
hideDelete
id="mlogbwList"
v-model="mlogbwlist"
:addTemplate="addTemplate"
placeholder="暂无数据"
>
<el-table-column prop="number" label="物料编号">
<template #default="scope">
<span v-if="!scope.row.isEdit">{{ scope.row.number }}</span>
<el-input v-if="scope.row.isEdit&&mode == 'outs'" v-model="scope.row.number" placeholder="物料编号"></el-input>
<el-select
v-if="scope.row.isEdit&&mode == 'ins'"
v-model="scope.row.wpr"
placeholder="动态成品"
clearable
style="width: 100%"
@change="optionChange(scope.row)"
>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id">
<template #default="scope">
<el-input-number
v-if="item.testitem_field_type=='input-number'"
v-model="scope.row[item.testitem_name]"
:min="0"
:disabled="!scope.row.isEdit"
class="width-100"
controls-position="right"
@change="defectCountSun(scope.row)"
>
</el-input-number>
<el-input-number
v-if="item.testitem_field_type=='input-int'"
v-model="scope.row[item.testitem_name]"
:min="0"
: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
v-for="item in options"
:key="item.id"
:label="item.number"
:value="item.id"
>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id">
<template #default="scope">
<el-input-number
v-if="item.testitem_field_type=='input-number'"
v-model="scope.row[item.testitem_name]"
:min="0"
:disabled="!scope.row.isEdit"
class="width-100"
controls-position="right"
@change="defectCountSun(scope.row)"
>
</el-option>
</el-select>
<el-select
v-if="item.testitem_field_type=='selects-text'"
v-model="scope.row[item.testitem_name]"
clearable
multiple
class="width-100"
:disabled="!scope.row.isEdit"
@change="defectCountSun(scope.row)"
>
<el-option
v-for="item1 in item.testitem_choices"
:key="item1"
:label="item1"
:value="item1"
</el-input-number>
<el-input-number
v-if="item.testitem_field_type=='input-int'"
v-model="scope.row[item.testitem_name]"
:min="0"
:disabled="!scope.row.isEdit"
class="width-100"
controls-position="right"
@change="defectCountSun(scope.row)"
>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="note" :label="item.defect_name" v-for="item in qct_defects" :key="item.id" width="80px">
<template #default="scope">
<el-switch
:disabled="!scope.row.isEdit"
v-model="scope.row[item.defect_name]"
style="--el-switch-on-color: red"
@change="switchChange(scope.row, item)"
></el-switch>
</template>
</el-table-column>
<el-table-column prop="note" label="备注">
<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="120" align="center">
<template #default="scope">
<el-button
v-if="scope.row.isEdit"
text
type="primary"
size="small"
@click="formTableSave(scope.row)"
>保存</el-button
>
<el-button
v-if="scope.row.isEdit"
text
type="primary"
size="small"
@click="formTableCancel(scope.row)"
>取消</el-button
>
<el-button
v-else
text
type="primary"
size="small"
@click="formTableEdit(scope.row)"
>编辑</el-button
>
<el-button
v-if="!scope.row.isEdit"
text
type="danger"
size="small"
@click="formTableDel(scope.row.id)"
>删除</el-button
>
</template>
</el-table-column>
</sc-form-table>
</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-select>
<el-select
v-if="item.testitem_field_type=='selects-text'"
v-model="scope.row[item.testitem_name]"
clearable
multiple
class="width-100"
:disabled="!scope.row.isEdit"
@change="defectCountSun(scope.row)"
>
<el-option
v-for="item1 in item.testitem_choices"
:key="item1"
:label="item1"
:value="item1"
>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="note" :label="item.defect_name" v-for="item in qct_defects" :key="item.id" width="70px">
<template #default="scope">
<el-switch
:disabled="!scope.row.isEdit"
v-model="scope.row[item.defect_name]"
style="--el-switch-on-color: red"
@change="switchChange(scope.row, item)"
></el-switch>
</template>
</el-table-column>
<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="60" align="center">
<template #default="scope">
<el-button
v-if="scope.row.isEdit"
text
type="primary"
size="small"
@click="formTableSave(scope.row)"
>保存</el-button
>
<el-button
v-if="scope.row.isEdit"
text
type="primary"
size="small"
@click="formTableCancel(scope.row)"
>取消</el-button
>
<el-button
v-else
text
type="primary"
size="small"
@click="formTableEdit(scope.row)"
>编辑</el-button
>
<el-button
v-if="!scope.row.isEdit"
text
type="danger"
size="small"
@click="formTableDel(scope.row.id)"
>删除</el-button
>
</template>
</el-table-column>
</sc-form-table>
</el-main>
</el-container>
</el-drawer>
</template>
<script>
@ -475,4 +480,7 @@ export default {
.width-100{
width: 100%;
}
#mlogbwList .el-table--default .cell{
padding: 0 5px !important;
}
</style>