This commit is contained in:
ChenQiuYu 2025-05-26 11:49:04 +08:00
parent 36833e0cf3
commit 0d70e1a7d0
1 changed files with 21 additions and 28 deletions

View File

@ -16,33 +16,27 @@
</div> </div>
<div style="padding: 0 24px;flex: 1; min-height: 0;"> <div style="padding: 0 24px;flex: 1; min-height: 0;">
<div class="list"> <div class="list">
<table class="table" style="border-spacing: 0"> <el-table :data="tableData" :header-cell-style="{backgroundColor: '#F1F5FB'}">
<thead style="background:#F1F5FB"> <el-table-column label="选择" width="60">
<tr class="table-title" style="background: #f1f5fb"> <template #default="scope">
<th>选择</th> <input class="blue-radio" type="radio" :value="scope.row.id" v-model="selected" @click="closeModal"/>
<th>发药项目</th> </template>
<th>产品标识码</th> </el-table-column>
<th>系统处理</th> <el-table-column prop="name" label="发药项目" show-overflow-tooltip/>
</tr> <el-table-column prop="idCode" label="产品标识码" width="140" show-overflow-tooltip>
</thead> <template #default="scope">
<tbody class="table-body" style="height: 52px"> <IdCodeListShow :idCodeList="scope.row.idCode" v-if="scope.row.idCode && scope.row.idCode.length > 0"/>
<tr v-for="(item,index) in tableData"> <div v-else>未关联</div>
<td> </template>
<input class="blue-radio" type="radio" :value="item.id" v-model="selected" @click="closeModal"/> </el-table-column>
</td> <el-table-column label="系统处理" width="160" show-overflow-tooltip>
<td>{{ item.name }}</td> <template #default="scope">
<td> <div v-if="selected === scope.row.id">
<IdCodeListShow :idCodeList="item.idCode" v-if="item.idCode && item.idCode.length > 0"/>
<div v-else>未关联</div>
</td>
<td style="width: 300px;">
<template v-if="selected === item.id">
关联产品标识码采集追溯码自动识别商品 关联产品标识码采集追溯码自动识别商品
</template> </div>
</td> </template>
</tr> </el-table-column>
</tbody> </el-table>
</table>
</div> </div>
</div> </div>
</div> </div>
@ -93,7 +87,6 @@ const addIdCode = () => {
} }
let idCode = traceabilityCode.value.slice(0, 7); let idCode = traceabilityCode.value.slice(0, 7);
post("goods/goods/addIdCode", {goodsId: selected.value, idCode: idCode}).then((res: any) => { post("goods/goods/addIdCode", {goodsId: selected.value, idCode: idCode}).then((res: any) => {
show.value = false;
for (let subItem of tableData.value) { for (let subItem of tableData.value) {
if (subItem.id === selected.value) { if (subItem.id === selected.value) {
if (subItem.idCode == null) { if (subItem.idCode == null) {
@ -102,6 +95,7 @@ const addIdCode = () => {
subItem.idCode?.push(idCode); subItem.idCode?.push(idCode);
break break
} }
close()
} }
}) })
const selectedItem = tableData.value.find((item: any) => item.id === selected.value); const selectedItem = tableData.value.find((item: any) => item.id === selected.value);
@ -109,7 +103,6 @@ const addIdCode = () => {
return return
} }
addTraceabilityCodeDo(selectedItem) addTraceabilityCodeDo(selectedItem)
} }
const emit = defineEmits(["addIdCode", "addTraceabilityCode"]) const emit = defineEmits(["addIdCode", "addTraceabilityCode"])