This commit is contained in:
TianyangZhang 2026-05-22 15:35:57 +08:00
commit 5c5a8525aa
1 changed files with 29 additions and 10 deletions

View File

@ -4,28 +4,31 @@
v-model="visible" v-model="visible"
:size="'70%'" :size="'70%'"
destroy-on-close destroy-on-close
:close-on-click-modal="false"
@closed="$emit('closed')"
> >
<template #header> <template #header>
<h4>关联产品</h4> <h4>关联产品</h4>
<el-button v-if="mode=='out'" type="primary" @click="wprNumberChange">发货编号</el-button> <el-button v-if="mode=='out'" type="primary" @click="wprNumberChange">发货编号</el-button>
<el-button v-if="mode=='out'" type="warning" @click="wprNumberClear">清空编号</el-button> <el-button v-if="mode=='out'" type="warning" @click="wprNumberClear">清空编号</el-button>
<el-button v-if="mgroupName=='喷码'" type="primary" @click="openSplit">拆批</el-button> <el-button v-if="mgroupName=='喷码'" type="warning" @click="openSplit">拆批</el-button>
<el-button <el-button
v-if="mgroupName=='喷码'" v-if="mgroupName=='喷码'"
type="warning" type="success"
:disabled="selectedRows.length === 0" :disabled="selectedRows.length === 0"
:loading="batchCoderLoading" :loading="batchCoderLoading"
@click="batchSendToCoder" @click="batchSendToCoder"
>批量喷数字码</el-button> >批量喷数字码</el-button>
<el-button <el-button
v-if="mgroupName=='喷码'" v-if="mgroupName=='喷码'"
type="warning" type="primary"
:disabled="selectedRows.length === 0" :disabled="selectedRows.length === 0"
:loading="batchCoderLoading2" :loading="batchCoderLoading2"
@click="batchSendToCoder2" @click="batchSendToCoder2"
>批量喷二维码</el-button> >批量喷二维码</el-button>
<span style="margin: 5px;">已选:{{ selectedRows.length }}</span>
<el-input <el-input
style="margin-right: 5px;width: 200px;" style="margin-right: 5px;width: 150px;"
v-model="search" v-model="search"
placeholder="编号" placeholder="编号"
clearable clearable
@ -36,9 +39,10 @@
icon="el-icon-search" icon="el-icon-search"
@click="handleWprQuery" @click="handleWprQuery"
></el-button> ></el-button>
<el-button type="danger" @click="visible = false">关闭</el-button>
</template> </template>
<template #default> <template #default>
<el-table ref="wprTable" id="wprTable" :data="wprList" :height="wprTableHeight" border highlight-current-row @selection-change="handleSelectionChange"> <el-table ref="wprTable" id="wprTable" :data="wprList" :height="wprTableHeight" border highlight-current-row :row-class-name="getRowClass" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50"></el-table-column> <el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="序号" type="index" width="50"></el-table-column> <el-table-column label="序号" type="index" width="50"></el-table-column>
<el-table-column label="产品编号" prop="number" min-width="100px" ></el-table-column> <el-table-column label="产品编号" prop="number" min-width="100px" ></el-table-column>
@ -62,7 +66,7 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="工装" min-width="80px"> <el-table-column label="工装" min-width="80px" v-if="mgroupName=='喷码'">
<template #default="scope"> <template #default="scope">
<el-select <el-select
v-model="scope.row.tooling" v-model="scope.row.tooling"
@ -85,13 +89,13 @@
label="操作" label="操作"
fixed="right" fixed="right"
align="center" align="center"
:width="mgroupName=='喷码'?280:160" :width="mgroupName=='喷码'?220:160"
> >
<template #default="scope"> <template #default="scope">
<el-button v-if="mode=='ins'&&mgroupName=='毛坯检测后打码'" @click="QRCode(scope.row)" type="success">二维码</el-button> <el-button v-if="mode=='ins'&&mgroupName=='毛坯检测后打码'" @click="QRCode(scope.row)" type="success">二维码</el-button>
<el-button @click="printMaterial(scope.row)" type="primary">打签</el-button> <el-button @click="printMaterial(scope.row)" type="primary" v-if="mode=='ins'&&mgroupName!=='喷码'">打签</el-button>
<el-button @click="sendToCoder(scope.row,'coder_field')" type="warning" v-if="mode=='ins'&&mgroupName=='喷码'" :loading="!!coderLoadingIds[scope.row.id]" :disabled="!!coderLoadingIds[scope.row.id]">喷数字码</el-button> <el-button @click="sendToCoder(scope.row,'coder_field')" type="success" v-if="mode=='ins'&&mgroupName=='喷码'" :loading="!!coderLoadingIds[scope.row.id]" :disabled="!!coderLoadingIds[scope.row.id]">喷数字码</el-button>
<el-button @click="sendToCoder(scope.row,'coder_field2')" type="warning" v-if="mode=='ins'&&mgroupName=='喷码'" :loading="!!coderLoadingIds[scope.row.id]" :disabled="!!coderLoadingIds[scope.row.id]">喷二维码</el-button> <el-button @click="sendToCoder(scope.row,'coder_field2')" type="primary" v-if="mode=='ins'&&mgroupName=='喷码'" :loading="!!coderLoadingIds[scope.row.id]" :disabled="!!coderLoadingIds[scope.row.id]">喷二维码</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -313,6 +317,7 @@ export default {
that.$refs.wprTable.setCurrentRow(that.wprList[0]); that.$refs.wprTable.setCurrentRow(that.wprList[0]);
that.$refs.wprTable.toggleRowSelection(that.wprList[0], true); that.$refs.wprTable.toggleRowSelection(that.wprList[0], true);
that.$refs.wprTable.scrollTo({ top: 0 }); that.$refs.wprTable.scrollTo({ top: 0 });
that.search = ""; //
}); });
} }
}, },
@ -476,6 +481,9 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => {
}; };
that.$refs.splitDialog.open("add", data, 20, that.selectedRows); that.$refs.splitDialog.open("add", data, 20, that.selectedRows);
}, },
getRowClass({ row }) {
return this.selectedRows.some(r => r.id === row.id) ? 'row-selected' : '';
},
// //
handleSaveSuccess() { handleSaveSuccess() {
this.$refs.tables.refresh(); this.$refs.tables.refresh();
@ -483,3 +491,14 @@ that.$API.wpm.prints.req(printer_ip, obj).then((response) => {
}, },
}; };
</script> </script>
<style scoped>
:deep(.row-selected) {
background-color: #ecf5ff !important;
}
:deep(.row-selected:hover > td) {
background-color: #d9ecff !important;
}
:deep(.row-selected > td) {
background-color: #ecf5ff !important;
}
</style>