|
@@ -1,38 +1,77 @@
|
|
|
<template>
|
|
|
<div class="midPopUp" @click="emits('update:modelValue', false)" v-if="modelValue">
|
|
|
<div class="container" @click.stop>
|
|
|
- <div class="operatorBox">
|
|
|
+ <div :class="lcDisabled ? 'operatorBox disableOp' : 'operatorBox'" @click="lastOpCall">
|
|
|
<div>
|
|
|
<div class="titleText">流程叫料</div>
|
|
|
<div class="describeText">(向上一流程工序呼叫流程物料)</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="operatorBox" @click="opeateCall">
|
|
|
+ <div :class="gxDisabled ? 'operatorBox disableOp' : 'operatorBox'" @click="opeateCall">
|
|
|
<div>
|
|
|
<div class="titleText">工序叫料</div>
|
|
|
<div class="describeText">(向本工序呼叫涉及物料)</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-
|
|
|
-const porps = defineProps({
|
|
|
+import { useProcessStore } from "@/store";
|
|
|
+import { emitter, EventsNames } from "@/utils/common";
|
|
|
+import { callItems } from "@/api/process";
|
|
|
+const store = useProcessStore();
|
|
|
+const router = useRouter();
|
|
|
+const props = defineProps({
|
|
|
modelValue: {
|
|
|
type: Boolean,
|
|
|
default: false,
|
|
|
},
|
|
|
});
|
|
|
-const emits = defineEmits(["update:modelValue",'opeatecall']);
|
|
|
+const emits = defineEmits(["update:modelValue"]);
|
|
|
+const gxDisabled = ref(false);
|
|
|
+const lcDisabled = ref(false);
|
|
|
const callBoxStatus = ref(false);
|
|
|
+//工序叫料
|
|
|
const opeateCall = () => {
|
|
|
- emits("opeatecall");
|
|
|
+ if (gxDisabled.value) return;
|
|
|
+ router.push({ name: "call-materiel" });
|
|
|
emits("update:modelValue", false);
|
|
|
};
|
|
|
+const callLast = async () => {
|
|
|
+ const { data } = await callItems({
|
|
|
+ operationId,
|
|
|
+ seqNo,
|
|
|
+ });
|
|
|
+};
|
|
|
+//流程叫料
|
|
|
+const lastOpCall = () => {
|
|
|
+ if (lcDisabled.value) return;
|
|
|
+};
|
|
|
+//监听工序index等
|
|
|
+emitter.on(EventsNames.PROCESS_STEPOBJ, (data: any) => {
|
|
|
+ if (data.index == null) {
|
|
|
+ lcDisabled.value = true;
|
|
|
+ gxDisabled.value = true;
|
|
|
+ } else {
|
|
|
+ if (data.lastStatus == false) {
|
|
|
+ lcDisabled.value = true;
|
|
|
+ } else {
|
|
|
+ lcDisabled.value = false;
|
|
|
+ }
|
|
|
+ gxDisabled.value = false;
|
|
|
+ }
|
|
|
+});
|
|
|
+watch(
|
|
|
+ () => props.modelValue,
|
|
|
+ () => {
|
|
|
+ if (store.useSeqNo == "") {
|
|
|
+ lcDisabled.value = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+);
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -50,6 +89,17 @@ const opeateCall = () => {
|
|
|
flex-wrap: nowrap;
|
|
|
padding: 24px;
|
|
|
|
|
|
+ .disableOp {
|
|
|
+ opacity: 0.6;
|
|
|
+ background-color: red !important;
|
|
|
+ color: white;
|
|
|
+ cursor: not-allowed !important;
|
|
|
+
|
|
|
+ .describeText {
|
|
|
+ color: white;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.operatorBox {
|
|
|
width: 50%;
|
|
|
height: 100%;
|