|
@@ -23,15 +23,20 @@
|
|
|
</div>
|
|
|
<el-divider />
|
|
|
<el-scrollbar>
|
|
|
- <div class="body">
|
|
|
+ <div class="body" >
|
|
|
<div
|
|
|
class="info titleText"
|
|
|
style="margin-top:5px;"
|
|
|
v-for="(item, index) in showInfoData"
|
|
|
+ @click="setSelectIndex(index)"
|
|
|
:key="index"
|
|
|
>
|
|
|
-
|
|
|
- {{item.batchNo}} * {{item.num}}
|
|
|
+ <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>
|
|
@@ -45,11 +50,16 @@
|
|
|
<Empty v-if="showInfoData.length == 0" />
|
|
|
</div>
|
|
|
</el-scrollbar>
|
|
|
+ <div class="dialog-footer" style="margin: 0 auto;" v-if="selectIndex != null">
|
|
|
+ <el-button @click="handleClose">取消</el-button>
|
|
|
+ <el-button type="primary" @click="replaceMaterials"> 确定 </el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
+import {batchUpdate} from "@/api/prosteps/wuliaocaiji";
|
|
|
const emits = defineEmits(["update:modelValue"]);
|
|
|
const props = defineProps({
|
|
|
modelValue: {
|
|
@@ -63,10 +73,22 @@ const props = defineProps({
|
|
|
type: Object,
|
|
|
},
|
|
|
});
|
|
|
+const selectIndex = ref(null);
|
|
|
+const setSelectIndex = (index) => {
|
|
|
+ selectIndex.value = index;
|
|
|
+};
|
|
|
const scanCode = ref("");
|
|
|
const handleClose = () => {
|
|
|
+ selectIndex.value = null
|
|
|
emits("update:modelValue", false);
|
|
|
};
|
|
|
+
|
|
|
+const replaceMaterials = () => {
|
|
|
+ batchUpdate(props.showInfoData).then((res)=>{
|
|
|
+ selectIndex.value = null
|
|
|
+ ElMessage.success(res.msg)
|
|
|
+ });
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|