|
@@ -2,7 +2,9 @@
|
|
<div class="body">
|
|
<div class="body">
|
|
<div class="steps" v-for="(item, index) in opsArray" :key="index" @click="boxClick(item, index)">
|
|
<div class="steps" v-for="(item, index) in opsArray" :key="index" @click="boxClick(item, index)">
|
|
<div :class="selectStepIndex == index
|
|
<div :class="selectStepIndex == index
|
|
- ? 'stepBox stepBoxHover'
|
|
|
|
|
|
+ ? item.exists == true
|
|
|
|
+ ? 'stepBox stepBoxHover'
|
|
|
|
+ : 'stepBox stepExistsHover'
|
|
: item.opComplete
|
|
: item.opComplete
|
|
? 'stepBox stepBoxDisabled'
|
|
? 'stepBox stepBoxDisabled'
|
|
: 'stepBox'
|
|
: 'stepBox'
|
|
@@ -34,6 +36,9 @@
|
|
{{ item.completeNum }}
|
|
{{ item.completeNum }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div v-if="item.exists != true && selectStepIndex == index" class="existsText">
|
|
|
|
+ 注:该工位在计划上未分配此工序任务!
|
|
|
|
+ </div>
|
|
<div class="line" v-if="index != opsArray.length - 1"></div>
|
|
<div class="line" v-if="index != opsArray.length - 1"></div>
|
|
</div>
|
|
</div>
|
|
<el-empty v-if="!opsArray" description="暂无数据" />
|
|
<el-empty v-if="!opsArray" description="暂无数据" />
|
|
@@ -42,11 +47,24 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
import { useProcessStore } from "@/store";
|
|
import { useProcessStore } from "@/store";
|
|
|
|
+import { emitter, EventsNames } from "@/utils/common";
|
|
const store = useProcessStore();
|
|
const store = useProcessStore();
|
|
const props = defineProps<{
|
|
const props = defineProps<{
|
|
opsArray?: object;
|
|
opsArray?: object;
|
|
}>();
|
|
}>();
|
|
-const selectStepIndex = ref(0);
|
|
|
|
|
|
+//步骤显示index
|
|
|
|
+const selectStepIndex = ref(null);
|
|
|
|
+const emitFnc = () => {
|
|
|
|
+ emitter.emit(EventsNames.PROCESS_STEPOBJ, {
|
|
|
|
+ index: selectStepIndex.value,
|
|
|
|
+ lastStatus:
|
|
|
|
+ selectStepIndex.value == null || selectStepIndex.value == 0
|
|
|
|
+ ? false
|
|
|
|
+ : props.opsArray[selectStepIndex.value - 1].opComplete == false
|
|
|
|
+ ? true
|
|
|
|
+ : false,
|
|
|
|
+ });
|
|
|
|
+};
|
|
const setStepIndex = () => {
|
|
const setStepIndex = () => {
|
|
for (let i = 0; i < props.opsArray.length; i++) {
|
|
for (let i = 0; i < props.opsArray.length; i++) {
|
|
if (props.opsArray[i].opComplete == false) {
|
|
if (props.opsArray[i].opComplete == false) {
|
|
@@ -61,16 +79,27 @@ const boxClick = (item, index) => {
|
|
store.processInfo.operationCode = item.operationCode;
|
|
store.processInfo.operationCode = item.operationCode;
|
|
store.processInfo.operationName = item.operationName;
|
|
store.processInfo.operationName = item.operationName;
|
|
selectStepIndex.value = index;
|
|
selectStepIndex.value = index;
|
|
|
|
+ emitFnc();
|
|
};
|
|
};
|
|
watch(
|
|
watch(
|
|
() => props.opsArray,
|
|
() => props.opsArray,
|
|
() => {
|
|
() => {
|
|
if (props.opsArray.length > 0) {
|
|
if (props.opsArray.length > 0) {
|
|
|
|
+ selectStepIndex.value = null;
|
|
setStepIndex();
|
|
setStepIndex();
|
|
- boxClick(props.opsArray[selectStepIndex.value], selectStepIndex.value);
|
|
|
|
|
|
+ if (selectStepIndex.value !== null) {
|
|
|
|
+ boxClick(props.opsArray[selectStepIndex.value], selectStepIndex.value);
|
|
|
|
+ } else {
|
|
|
|
+ emitFnc();
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ selectStepIndex.value = null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
);
|
|
);
|
|
|
|
+onBeforeUnmount(() => {
|
|
|
|
+ emitter.off(EventsNames.PROCESS_STEPOBJ);
|
|
|
|
+});
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -78,6 +107,13 @@ watch(
|
|
width: 100%;
|
|
width: 100%;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+.existsText {
|
|
|
|
+ margin-left: 40px;
|
|
|
|
+ font-size: $f16;
|
|
|
|
+ font-weight: 500;
|
|
|
|
+ color: red;
|
|
|
|
+}
|
|
|
|
+
|
|
.stepBox {
|
|
.stepBox {
|
|
display: flex;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
@@ -93,6 +129,10 @@ watch(
|
|
background-color: $select-hover;
|
|
background-color: $select-hover;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+.stepExistsHover {
|
|
|
|
+ background-color: red;
|
|
|
|
+}
|
|
|
|
+
|
|
.stepBoxDisabled {
|
|
.stepBoxDisabled {
|
|
background-color: grey;
|
|
background-color: grey;
|
|
}
|
|
}
|