feat:禅道400/411

This commit is contained in:
shijing 2026-05-29 09:43:33 +08:00
parent 4ae27d8693
commit 0d458be6da
1 changed files with 80 additions and 18 deletions

View File

@ -22,8 +22,8 @@
<el-button type="primary" v-if="!isSubmit&&processType=='20'" @click="check_start">检验</el-button> <el-button type="primary" v-if="!isSubmit&&processType=='20'" @click="check_start">检验</el-button>
<el-button type="primary" v-if="multipleSet" @click="check_set" style="position: absolute;left: 210px;">批量操作</el-button> <el-button type="primary" v-if="multipleSet" @click="check_set" style="position: absolute;left: 210px;">批量操作</el-button>
<el-input v-if="multipleSet" v-model="wprInputText" @change="wprinputChange" style="width:200px;position: absolute;left: 308px;"></el-input> <el-input v-if="multipleSet" v-model="wprInputText" @change="wprinputChange" style="width:200px;position: absolute;left: 308px;"></el-input>
<div style="width:fit-content;position: absolute;right: 40px;display: inline-block;"> <div style="width:fit-content;position: absolute;right: 0;display: inline-block;">
<div style="display: flex;"> <div style="display: flex;align-items: center;gap: 8px;">
<el-link v-if="test_file!==''" :href="test_file" target="_blank">{{ test_file_name }}</el-linK> <el-link v-if="test_file!==''" :href="test_file" target="_blank">{{ test_file_name }}</el-linK>
<scFileImport <scFileImport
v-if="project_code=='tcerp'&&processType=='20'&&!isSubmit" v-if="project_code=='tcerp'&&processType=='20'&&!isSubmit"
@ -32,6 +32,24 @@
:apiObj="$API.common.upload" :apiObj="$API.common.upload"
@success="upSuccess" @success="upSuccess"
></scFileImport><!-- :templateUrl="checkTemplate" --> ></scFileImport><!-- :templateUrl="checkTemplate" -->
<el-popover
v-model:visible="columnSettingVisible"
placement="bottom-end"
:width="200"
trigger="click"
>
<template #reference>
<el-button size="small">列设置</el-button>
</template>
<div class="col-setting-panel">
<div v-for="col in allColumnOptions" :key="col.key" class="col-setting-item">
<el-checkbox
:model-value="isColVisible(col.key)"
@change="toggleColumn(col.key)"
>{{ col.label }}</el-checkbox>
</div>
</div>
</el-popover>
</div> </div>
</div> </div>
</div> </div>
@ -43,14 +61,14 @@
<input type="checkbox" class="checkboxInput" v-model="selectedAll" :value="selectedAll" @change="selectAllChange"> <input type="checkbox" class="checkboxInput" v-model="selectedAll" :value="selectedAll" @change="selectAllChange">
</th> </th>
<th class="w_50 sticky-cell sticky-left-index">序号</th> <th class="w_50 sticky-cell sticky-left-index">序号</th>
<th class="w_140 sticky-cell sticky-left-batch">物料批次</th> <th class="w_140 sticky-cell sticky-left-batch" v-show="isColVisible('batch')">物料批次</th>
<th class="w_140 sticky-cell sticky-left-number">物料编号</th> <th class="w_140 sticky-cell sticky-left-number" v-show="isColVisible('number')">物料编号</th>
<th class="w_150" v-if="route_code=='niuzhuan'">生产设备</th> <th class="w_150" v-if="route_code=='niuzhuan'" v-show="isColVisible('equip')">生产设备</th>
<th class="w_180" v-if="route_code=='niuzhuan'">扭转日期</th> <th class="w_180" v-if="route_code=='niuzhuan'" v-show="isColVisible('time')">扭转日期</th>
<th class="w_150" v-if="mgroupName=='喷码'">工装</th> <th class="w_150" v-if="mgroupName=='喷码'" v-show="isColVisible('tooling')">工装</th>
<th class="w_80" v-for="item in qct_testitems" :key="item.id">{{ item.testitem_name }}</th> <th class="w_80" v-for="item in qct_testitems" :key="item.id" v-show="isColVisible('testitem_'+item.id)">{{ item.testitem_name }}</th>
<th class="w_80" v-for="item in qct_defects" :key="item.id">{{ item.defect_name }}</th> <th class="w_80" v-for="item in qct_defects" :key="item.id" v-show="isColVisible('defect_'+item.id)">{{ item.defect_name }}</th>
<th class="w_80">备注</th> <th class="w_80" v-show="isColVisible('note')">备注</th>
<th class="w_150 sticky-cell sticky-right-action" v-if="!isSubmit">操作</th> <th class="w_150 sticky-cell sticky-right-action" v-if="!isSubmit">操作</th>
</tr> </tr>
</thead> </thead>
@ -62,16 +80,16 @@
<td class="w_50 padding_4 sticky-cell sticky-left-index"> <td class="w_50 padding_4 sticky-cell sticky-left-index">
{{ index + 1 }} {{ index + 1 }}
</td> </td>
<td class="w_140 sticky-cell sticky-left-batch"> <td class="w_140 sticky-cell sticky-left-batch" v-show="isColVisible('batch')">
<input v-if="row.isEdit" v-model="row.mlogb__batch" placeholder="物料批次"> <input v-if="row.isEdit" v-model="row.mlogb__batch" placeholder="物料批次">
<span v-else>{{ row.mlogb__batch }}</span> <span v-else>{{ row.mlogb__batch }}</span>
</td> </td>
<td class="w_140 sticky-cell sticky-left-number"> <td class="w_140 sticky-cell sticky-left-number" v-show="isColVisible('number')">
<input v-if="row.isEdit" v-model="row.number" placeholder="物料编号"> <input v-if="row.isEdit" v-model="row.number" placeholder="物料编号">
<span v-else>{{ row.number }}</span> <span v-else>{{ row.number }}</span>
<span v-if="row.wpr_number_out !== null && row.wpr_number_out !== undefined">{{ row.wpr_number_out }}</span> <span v-if="row.wpr_number_out !== null && row.wpr_number_out !== undefined">{{ row.wpr_number_out }}</span>
</td> </td>
<td class="w_150 " v-if="route_code=='niuzhuan'"> <td class="w_150 " v-if="route_code=='niuzhuan'" v-show="isColVisible('equip')">
<select name="pets" id="pet-select" v-if="row.isEdit" style="width: 100%;" v-model="row.equip" :value="row.equip"> <select name="pets" id="pet-select" v-if="row.isEdit" style="width: 100%;" v-model="row.equip" :value="row.equip">
<option v-for="item in optionsEq" :key="item.id" :value="item.id"> <option v-for="item in optionsEq" :key="item.id" :value="item.id">
{{ item.number }} {{ item.number }}
@ -79,13 +97,13 @@
</select> </select>
<span v-else>{{ row.equip_name }}<span v-if="row.equip_number&&row.equip_number!=null">{{ row.equip_number }}</span></span> <span v-else>{{ row.equip_name }}<span v-if="row.equip_number&&row.equip_number!=null">{{ row.equip_number }}</span></span>
</td> </td>
<td class="w_180 " v-if="route_code=='niuzhuan'"> <td class="w_180 " v-if="route_code=='niuzhuan'" v-show="isColVisible('time')">
<input v-if="row.isEdit" type="datetime-local" id="datetime" v-model="row.work_start_time" @change = "timeChange(row)"> <input v-if="row.isEdit" type="datetime-local" id="datetime" v-model="row.work_start_time" @change = "timeChange(row)">
<div v-else> <div v-else>
<span v-if="row.work_start_time!==null">{{ row.work_start_time}}</span> <span v-if="row.work_start_time!==null">{{ row.work_start_time}}</span>
</div> </div>
</td> </td>
<td class="w_150 " v-if="mgroupName=='喷码'"> <td class="w_150 " v-if="mgroupName=='喷码'" v-show="isColVisible('tooling')">
<select name="tooling" id="tooling-select" v-if="row.isEdit" style="width: 100%;" v-model="row.tooling" :value="row.tooling"> <select name="tooling" id="tooling-select" v-if="row.isEdit" style="width: 100%;" v-model="row.tooling" :value="row.tooling">
<option v-for="item in optionsTooling" :key="item.id" :value="item.id"> <option v-for="item in optionsTooling" :key="item.id" :value="item.id">
{{ item.name }} {{ item.name }}
@ -93,7 +111,7 @@
</select> </select>
<span v-else>{{ getToolingName(row.wpr_pre_info?.tooling) || row.tooling_name }}</span> <span v-else>{{ getToolingName(row.wpr_pre_info?.tooling) || row.tooling_name }}</span>
</td> </td>
<td class="w_80 " v-for="item in qct_testitems" :key="item.id"> <td class="w_80 " v-for="item in qct_testitems" :key="item.id" v-show="isColVisible('testitem_'+item.id)">
<span v-if="!row.isEdit || !item.canEdit">{{ row[item.testitem_name] }}</span> <span v-if="!row.isEdit || !item.canEdit">{{ row[item.testitem_name] }}</span>
<input v-if="item.testitem_field_type == 'input-number' && row.isEdit && item.canEdit" <input v-if="item.testitem_field_type == 'input-number' && row.isEdit && item.canEdit"
type="number" v-model="row[item.testitem_name]" @change="defectCountSun(row)"> type="number" v-model="row[item.testitem_name]" @change="defectCountSun(row)">
@ -110,10 +128,10 @@
<option v-for="item0 in item.testitem_choices" :key="item0" :value="item0">{{ item0 }}</option> <option v-for="item0 in item.testitem_choices" :key="item0" :value="item0">{{ item0 }}</option>
</select> </select>
</td> </td>
<td class="w_80 padding_4 defectBlock" v-for="item in qct_defects" :key="item.id"> <td class="w_80 padding_4 defectBlock" v-for="item in qct_defects" :key="item.id" v-show="isColVisible('defect_'+item.id)">
<input type="checkbox" class="checkboxInput" :disabled="!row.isEdit || !item.canEdit" v-model="row[item.defect_name]" @change="switchChange(row, item,index)"> <input type="checkbox" class="checkboxInput" :disabled="!row.isEdit || !item.canEdit" v-model="row[item.defect_name]" @change="switchChange(row, item,index)">
</td> </td>
<td class="w_80 "> <td class="w_80 " v-show="isColVisible('note')">
<input v-if="row.isEdit" v-model="row.note" placeholder="备注"> <input v-if="row.isEdit" v-model="row.note" placeholder="备注">
<span v-else style="width: 100%;height: 100%;display: inline-block;">{{ row.note }}</span> <span v-else style="width: 100%;height: 100%;display: inline-block;">{{ row.note }}</span>
</td> </td>
@ -407,6 +425,8 @@ export default {
selectedAll:false, selectedAll:false,
checkAll: false, checkAll: false,
hideAdd: false, hideAdd: false,
hiddenColumns: [],
columnSettingVisible: false,
visible: false, visible: false,
isSaveing:false, isSaveing:false,
setVisible:false, setVisible:false,
@ -455,6 +475,29 @@ export default {
}; };
}, },
watch: {}, watch: {},
computed: {
allColumnOptions() {
const cols = [
{ key: 'batch', label: '物料批次' },
{ key: 'number', label: '物料编号' },
];
if (this.route_code === 'niuzhuan') {
cols.push({ key: 'equip', label: '生产设备' });
cols.push({ key: 'time', label: '扭转日期' });
}
if (this.mgroupName === '喷码') {
cols.push({ key: 'tooling', label: '工装' });
}
this.qct_testitems.forEach(item => {
cols.push({ key: 'testitem_' + item.id, label: item.testitem_name });
});
this.qct_defects.forEach(item => {
cols.push({ key: 'defect_' + item.id, label: item.defect_name });
});
cols.push({ key: 'note', label: '备注' });
return cols;
},
},
mounted() { mounted() {
let that = this; let that = this;
if(that.test_file!==''&&that.test_file!==null){ if(that.test_file!==''&&that.test_file!==null){
@ -515,6 +558,17 @@ export default {
} }
}, },
methods: { methods: {
isColVisible(key) {
return !this.hiddenColumns.includes(key);
},
toggleColumn(key) {
const idx = this.hiddenColumns.indexOf(key);
if (idx > -1) {
this.hiddenColumns.splice(idx, 1);
} else {
this.hiddenColumns.push(key);
}
},
refreshfun(){ refreshfun(){
this.getList(); this.getList();
}, },
@ -1417,6 +1471,14 @@ tbody tr:nth-child(odd) .sticky-cell{
.more-menu-btn:hover{ .more-menu-btn:hover{
background: #fef0f0; background: #fef0f0;
} }
.col-setting-panel{
max-height: 300px;
overflow-y: auto;
}
.col-setting-item{
padding: 4px 0;
line-height: 1.6;
}
.btn{ .btn{
margin:0 5px; margin:0 5px;
border: none; border: none;