|
@@ -18,7 +18,7 @@
|
|
|
v-for="(box, index) in merterielBoxes"
|
|
|
:key="index"
|
|
|
class="suit-box"
|
|
|
- @click="testClick"
|
|
|
+ @click="clickItem(box)"
|
|
|
>
|
|
|
<div>
|
|
|
<div class="suit-title">{{ box?.materialName }}</div>
|
|
@@ -35,13 +35,21 @@
|
|
|
</div>
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
|
+ <ChangeCount
|
|
|
+ ref="changeCountRef"
|
|
|
+ description="双面胶黑色"
|
|
|
+ title="叫料数量"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { accessoriesList } from "@/api/process/callMateriel";
|
|
|
+import { accessoriesList, sporadicCallItem } from "@/api/process/callMateriel";
|
|
|
import { useDictionaryStore } from "@/store/modules/dictionary";
|
|
|
+import ChangeCount from "@/components/CommonDialogs/ChangeCount.vue";
|
|
|
+import { useProcessStore } from "@/store/modules/processView";
|
|
|
|
|
|
+const processStore = useProcessStore();
|
|
|
const dictStore = useDictionaryStore();
|
|
|
const leftTrees = ref<any[]>([]);
|
|
|
const leftTreeIndex = ref(0);
|
|
@@ -51,13 +59,11 @@ const changeRightEl = (row: any, index: number) => {
|
|
|
leftTreeIndex.value = index;
|
|
|
accessoriesDataList(index);
|
|
|
};
|
|
|
-const testClick = () => {
|
|
|
- console.log("here---in");
|
|
|
-};
|
|
|
+
|
|
|
const cacheDataMap = ref(new Map());
|
|
|
-const accessoriesDataList = (index: number) => {
|
|
|
+const accessoriesDataList = (index: number, cache: boolean = true) => {
|
|
|
//对结果进行缓存 不频繁请求接口
|
|
|
- if (cacheDataMap.value.has(index)) {
|
|
|
+ if (cacheDataMap.value.has(index) && cache) {
|
|
|
merterielBoxes.value = cacheDataMap.value.get(index);
|
|
|
return;
|
|
|
}
|
|
@@ -87,6 +93,26 @@ onMounted(() => {
|
|
|
accessoriesDataList(0);
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+// =========叫料数量
|
|
|
+const changeCountRef = ref<InstanceType<typeof ChangeCount>>();
|
|
|
+const clickItem = (box: any) => {
|
|
|
+ changeCountRef.value?.showDialog(box.totalNum, (value: number) => {
|
|
|
+ sporadicCallItem({
|
|
|
+ materials: [
|
|
|
+ {
|
|
|
+ materialName: box.materialName,
|
|
|
+ num: value,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ processId: processStore.scanInfo.id,
|
|
|
+ workOrderCode: processStore.odersData.workOrderCode,
|
|
|
+ }).then(() => {
|
|
|
+ ElMessage.success("叫料成功");
|
|
|
+ accessoriesDataList(leftTreeIndex.value, false);
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|