|
@@ -0,0 +1,284 @@
|
|
|
+<template>
|
|
|
+ <div class="midPopUp" v-if="modelValue">
|
|
|
+ <div class="body">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="14" class="leftView">
|
|
|
+ <div class="btns">
|
|
|
+ <el-button :class="selectedType == 'default' ? 'activeBtn' : ''" @click="setSelectedType('default')"
|
|
|
+ type="primary" plain>全 部</el-button>
|
|
|
+ <el-button :class="selectedType == 'no' ? 'activeBtn' : ''" @click="setSelectedType('no')" type="primary"
|
|
|
+ plain>不符合</el-button>
|
|
|
+ <el-button :class="selectedType == 'yes' ? 'activeBtn' : ''" @click="setSelectedType('yes')" type="primary"
|
|
|
+ plain>符 合</el-button>
|
|
|
+
|
|
|
+ <div class="submitBox">
|
|
|
+ <el-button type="primary" @click="close" v-if="!bingdingStatus" plain>关 闭</el-button>
|
|
|
+ <el-button type="primary" style="background-color: #f9bf5c90" v-if="!bingdingStatus" @click="binding"
|
|
|
+ plain>绑 定</el-button>
|
|
|
+ <el-button @click="cancelBingding" type="primary" v-if="bingdingStatus" plain>取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submit" style="background-color: #f9bf5c90; color: white; border: 0px"
|
|
|
+ v-if="bingdingStatus" plain>确 认</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="selectInfoBox">
|
|
|
+ <el-scrollbar class="scrollbarTop">
|
|
|
+ <div class="scroll">
|
|
|
+ <div class="needMaterialInfo">
|
|
|
+ <div>{{ selectRowData.materialName }}</div>
|
|
|
+ <div>{{ selectRowData.materialCode }}</div>
|
|
|
+ <div>
|
|
|
+ 已装数量:{{
|
|
|
+ selectRowData.completeNum
|
|
|
+ ? selectRowData.completeNum
|
|
|
+ : "-"
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
+ <div>所需总数:{{ selectRowData.totalMaterial }}</div>
|
|
|
+ <div>
|
|
|
+ 还需数量:{{
|
|
|
+ selectRowData.totalMaterial - selectRowData.completeNum
|
|
|
+ }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="selectInfoItem" @click="closeTopItem(item.selectedIndex)" v-for="item in setTopItem">
|
|
|
+ {{ item.name }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ <el-scrollbar class="scrollbar">
|
|
|
+ <template v-for="(item, index) in materialData" @click="setSelectIndex(index)">
|
|
|
+ <div :class="item.selected == true ? 'item active' : 'item'" v-if="itemShowStatus(item)">
|
|
|
+ <div>{{ item.name }}</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <Empty v-if="materialData.length < 1" />
|
|
|
+ </el-scrollbar>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-scrollbar class="infoBox">
|
|
|
+ <el-table class="infoTable" :data="selectIndexInfoData" border>
|
|
|
+ <el-table-column prop="materialName" label="物料名称" width="120" />
|
|
|
+ <el-table-column prop="materialNo" label="物料编号" />
|
|
|
+ <el-table-column prop="num" label="出入库数量" />
|
|
|
+ <el-table-column prop="coordinate" label="储位坐标" />
|
|
|
+
|
|
|
+ <template #empty>
|
|
|
+ <Empty />
|
|
|
+ </template>
|
|
|
+ </el-table>
|
|
|
+ </el-scrollbar>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <Bangding v-model="showStatus" />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts" setup>
|
|
|
+import Bangding from "./bangding.vue";
|
|
|
+const props = defineProps({
|
|
|
+ modelValue: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+});
|
|
|
+const emits = defineEmits(["update:modelValue"]);
|
|
|
+const selectedType = ref("default");
|
|
|
+const materialData = inject("materialData");
|
|
|
+const selectMaterialData = inject("selectMaterialData");
|
|
|
+const selectRowData = inject("selectRowData");
|
|
|
+const showStatus = ref(false);
|
|
|
+const itemShowStatus = (item: any) => {
|
|
|
+ if (selectedType.value == "default") {
|
|
|
+ return true;
|
|
|
+ } else if (selectedType.value == "yes") {
|
|
|
+ if (item.isEnable == 1) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (item.isEnable == 0) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+const bingdingStatus = ref(false);
|
|
|
+const selectIndex = ref(0);
|
|
|
+const setSelectedType = (type: string) => {
|
|
|
+ selectedType.value = type;
|
|
|
+};
|
|
|
+const selectIndexInfoData = computed(() => {
|
|
|
+ if (materialData.value.length > 0) {
|
|
|
+ return materialData.value[selectIndex.value].list;
|
|
|
+ } else {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+});
|
|
|
+const setSelectIndex = (index: number) => {
|
|
|
+ selectIndex.value = index;
|
|
|
+ if (bingdingStatus.value) {
|
|
|
+ if (materialData.value[selectIndex.value].selected == true) {
|
|
|
+ materialData.value[selectIndex.value].selected = false;
|
|
|
+ } else {
|
|
|
+ materialData.value[selectIndex.value].selected = true;
|
|
|
+ }
|
|
|
+ materialData.value[selectIndex.value].selectedIndex = index;
|
|
|
+ }
|
|
|
+};
|
|
|
+const closeTopItem = (index: number) => {
|
|
|
+ materialData.value[index].selected = false;
|
|
|
+};
|
|
|
+const setTopItem = computed(() => {
|
|
|
+ return materialData.value.filter((item) => item.selected == true);
|
|
|
+});
|
|
|
+const close = () => {
|
|
|
+ emits("update:modelValue", false);
|
|
|
+ reset();
|
|
|
+};
|
|
|
+const binding = () => {
|
|
|
+ bingdingStatus.value = true;
|
|
|
+};
|
|
|
+const cancelBingding = () => {
|
|
|
+ bingdingStatus.value = false;
|
|
|
+};
|
|
|
+const submit = () => {
|
|
|
+ showStatus.value = true;
|
|
|
+};
|
|
|
+const reset = () => {
|
|
|
+ selectedType.value = "default";
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+:deep(.el-table__inner-wrapper:before) {
|
|
|
+ width: 0 !important;
|
|
|
+}
|
|
|
+
|
|
|
+.leftView {
|
|
|
+ width: calc(100vw);
|
|
|
+
|
|
|
+ .activeBtn {
|
|
|
+ background-color: #6cc2ff !important;
|
|
|
+ color: white !important;
|
|
|
+ border: 0px !important;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.body {
|
|
|
+ display: flex;
|
|
|
+ flex: 1;
|
|
|
+ height: 100%;
|
|
|
+ width: 100%;
|
|
|
+ padding: 24px;
|
|
|
+
|
|
|
+ .selectInfoBox {
|
|
|
+ width: 100%;
|
|
|
+ height: 160px;
|
|
|
+ border-radius: 16px;
|
|
|
+ background-color: #ffffff60;
|
|
|
+
|
|
|
+ .scrollbarTop {
|
|
|
+ padding: $p10;
|
|
|
+ height: 170px;
|
|
|
+ width: calc(100vw * 7 / 12 - 34px);
|
|
|
+ margin-bottom: $p10;
|
|
|
+
|
|
|
+ .scroll {
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .needMaterialInfo {
|
|
|
+ flex-shrink: 0;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-evenly;
|
|
|
+ width: 200px;
|
|
|
+ height: 140px;
|
|
|
+ border-radius: 16px;
|
|
|
+ background-color: #ffffff60;
|
|
|
+ padding: $p10;
|
|
|
+
|
|
|
+ div {
|
|
|
+ font-size: $p20;
|
|
|
+ line-height: 20px;
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .selectInfoItem {
|
|
|
+ margin-left: $p10;
|
|
|
+ flex-shrink: 0;
|
|
|
+ width: 150px;
|
|
|
+ height: 140px;
|
|
|
+ border-radius: 16px;
|
|
|
+ background-color: #ffffff60;
|
|
|
+ background-image: url("@/assets/images/caijiwancheng.png");
|
|
|
+ background-position: right top;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .infoBox {
|
|
|
+ height: calc(100vh - 48px);
|
|
|
+ width: calc(100vw * 5 / 12 - 48px);
|
|
|
+ border-radius: 16px;
|
|
|
+ background-color: #ffffff60;
|
|
|
+
|
|
|
+ .infoTable {
|
|
|
+ height: calc(100vh - 48px);
|
|
|
+ background-color: white;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .btns {
|
|
|
+ width: 100%;
|
|
|
+ height: 70px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding-bottom: 10px;
|
|
|
+
|
|
|
+ .submitBox {
|
|
|
+ width: 300px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-button {
|
|
|
+ width: 150px;
|
|
|
+ height: 60px;
|
|
|
+ border: 1px solid #00000030;
|
|
|
+ font-size: $f24;
|
|
|
+ color: black;
|
|
|
+ background-color: transparent;
|
|
|
+ border-radius: 16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .scrollbar {
|
|
|
+ height: calc(100vh - 288px);
|
|
|
+ margin-top: $p10;
|
|
|
+
|
|
|
+ .item {
|
|
|
+ width: 190px;
|
|
|
+ height: 180px;
|
|
|
+ border-radius: 16px;
|
|
|
+ background-color: #ffffff60;
|
|
|
+ display: inline-block;
|
|
|
+ margin: $p20;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.active {
|
|
|
+ background-image: url("@/assets/images/caijiwancheng.png");
|
|
|
+ background-position: right top;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+}
|
|
|
+</style>
|