|
@@ -28,26 +28,36 @@
|
|
|
class="info titleText"
|
|
|
style="margin-top:5px;"
|
|
|
v-for="(item, index) in showInfoData"
|
|
|
- @click="setSelectIndex(index)"
|
|
|
:key="index"
|
|
|
>
|
|
|
- <template v-if="selectIndex == index">
|
|
|
- <ScanCodeInput v-model="item.batchNo" width="50%"/>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- {{item.batchNo}} * {{item.num}}
|
|
|
- </template>
|
|
|
-<!-- <el-form span="24" :inline="true" >
|
|
|
- <el-form-item label="批号" span="12">
|
|
|
- <el-input v-model="item.batchNo"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="数量" span="12">
|
|
|
- <el-input v-model="item.num"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-form>-->
|
|
|
- <span style="margin-right: 10px"></span>
|
|
|
- </div>
|
|
|
- <Empty v-if="showInfoData.length == 0" />
|
|
|
+ <div @click="setSelectIndex(index)" style="float:left;width:95%;height:100%;">
|
|
|
+ <template v-if="selectIndex == index">
|
|
|
+ <div class="describeText" style="height: 35px;" >
|
|
|
+ <div style="width:25%;height:100%;float: left;height: 35px; line-height: 35px;">批次号: </div>
|
|
|
+ <div style="width:70%;height:100%;float: left;margin-top: 2px;"> <ScanCodeInput v-model="item.batchNo" style="height: 33px;line-height: 33px;" /></div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="describeText" v-if="selectIndex == index" style="height: 35px;" >
|
|
|
+ <div style="width:25%;height:100%;float: left;height: 35px;line-height: 35px;">筛选报告: </div>
|
|
|
+ <div style="width:70%;height:100%;float: left;"> <ScanCodeInput v-model="item.bgCode" style="height: 33px;line-height: 33px;" /></div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ 批号: {{item.batchNo}} {{item.bgCode ? '- 包装号: ' + item.bgCode : ''}} * {{item.num}}
|
|
|
+ </template>
|
|
|
+ <span style="margin-right: 10px"></span>
|
|
|
+ </div>
|
|
|
+ <div style="float:left;width:5%;height:100%;">
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ size="small"
|
|
|
+ text
|
|
|
+ @click="deleteItem(index)"
|
|
|
+ >删除</el-button>
|
|
|
+ </div>
|
|
|
+ <Empty v-if="showInfoData.length == 0" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</el-scrollbar>
|
|
|
<div class="dialog-footer" style="margin: 0 auto;" v-if="selectIndex != null">
|
|
@@ -60,7 +70,7 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
import {batchUpdate} from "@/api/prosteps/wuliaocaiji";
|
|
|
-const emits = defineEmits(["update:modelValue"]);
|
|
|
+const emits = defineEmits(["update:modelValue","refreshData"]);
|
|
|
const props = defineProps({
|
|
|
modelValue: {
|
|
|
type: Boolean,
|
|
@@ -77,6 +87,12 @@ const selectIndex = ref(null);
|
|
|
const setSelectIndex = (index) => {
|
|
|
selectIndex.value = index;
|
|
|
};
|
|
|
+const removeIds = ref([])
|
|
|
+const deleteItem = ((index)=>{
|
|
|
+ selectIndex.value = -1;
|
|
|
+ removeIds.value.push(props.showInfoData[index].id)
|
|
|
+ props.showInfoData.splice(index,1)
|
|
|
+})
|
|
|
const scanCode = ref("");
|
|
|
const handleClose = () => {
|
|
|
selectIndex.value = null
|
|
@@ -84,9 +100,11 @@ const handleClose = () => {
|
|
|
};
|
|
|
|
|
|
const replaceMaterials = () => {
|
|
|
- batchUpdate(props.showInfoData).then((res)=>{
|
|
|
+ const params = {removeIds: removeIds.value, recordList: props.showInfoData}
|
|
|
+ batchUpdate(params).then((res)=>{
|
|
|
selectIndex.value = null
|
|
|
ElMessage.success(res.msg)
|
|
|
+ emits("refreshData");
|
|
|
});
|
|
|
};
|
|
|
</script>
|