|
@@ -1,15 +1,15 @@
|
|
|
<template>
|
|
|
<div class="stepsViewScroll">
|
|
|
- <div class="recordBox" v-for="item in 7">
|
|
|
+ <div class="recordBox" v-for="(item, index) in checkListData" :key="index">
|
|
|
<div class="leftMsg">
|
|
|
<div class="msgHeader">
|
|
|
- <div class="titleText">外围尺寸</div>
|
|
|
- <div class="describeText">单位:cm</div>
|
|
|
+ <div class="titleText">{{ item.checkName }}</div>
|
|
|
+ <div class="describeText">单位:{{ item.unit }}</div>
|
|
|
</div>
|
|
|
<div class="msgFooter">
|
|
|
- <div class="describeText">单位:cm</div>
|
|
|
- <div class="describeText">单位:cm</div>
|
|
|
- <div class="describeText">单位:cm</div>
|
|
|
+ <div class="describeText">标准值:{{ item.standard }}</div>
|
|
|
+ <div class="describeText">上限值:{{ item.upper }}</div>
|
|
|
+ <div class="describeText">下限值:{{ item.lower }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="rightOperate">
|
|
@@ -18,10 +18,12 @@
|
|
|
<div class="operate">
|
|
|
<div class="describeText operateText">结果</div>
|
|
|
<div class="operateBox">
|
|
|
- <div class="operateBtn" :style="setBoxStatus('qualified')">
|
|
|
+ <div class="operateBtn" @click="hege(index)"
|
|
|
+ :style="item.result == '1' ? setBoxStatus('1') : setBoxStatus('')">
|
|
|
合格
|
|
|
</div>
|
|
|
- <div class="operateBtn" :style="setBoxStatus('unqualified')">
|
|
|
+ <div class="operateBtn" @click="buhege(index)"
|
|
|
+ :style="item.result == '2' ? setBoxStatus('2') : setBoxStatus('')">
|
|
|
不合格
|
|
|
</div>
|
|
|
</div>
|
|
@@ -32,22 +34,68 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
+import { checkList, checkUpdate } from "@/api/prosteps/dianjian";
|
|
|
+import { useProcessStore } from "@/store";
|
|
|
defineOptions({ name: "Dianjian" });
|
|
|
+const checkListData = ref([]);
|
|
|
+const store = useProcessStore();
|
|
|
+const getCheckList = async () => {
|
|
|
+ // const { data } = await checkList({
|
|
|
+ // operationId: Number(store.odersData.operationId),
|
|
|
+ // processId: Number(store.scanInfo.id),
|
|
|
+ // pageSize: 9999,
|
|
|
+ // pageNo: 1,
|
|
|
+ // });
|
|
|
+ const { data } = await checkList({
|
|
|
+ operationId: 2,
|
|
|
+ processId: 15,
|
|
|
+ pageSize: 9999,
|
|
|
+ pageNo: 1,
|
|
|
+ });
|
|
|
+ checkListData.value = data;
|
|
|
+};
|
|
|
+const updateCheck = async (item, res) => {
|
|
|
+ // const {data} = await checkUpdate({
|
|
|
+ // id: 2,
|
|
|
+ // operationCheckId: 15,
|
|
|
+ // operator: 9999,
|
|
|
+ // processId: 1,
|
|
|
+ // result:,
|
|
|
+ // sortNum:,
|
|
|
+ // stepInstanceId:''
|
|
|
+ // });
|
|
|
+ await checkUpdate({
|
|
|
+ id: item.id,
|
|
|
+ result: res,
|
|
|
+ }).then(() => {
|
|
|
+ ElMessage.success("操作成功");
|
|
|
+ item.result = res;
|
|
|
+ });
|
|
|
+};
|
|
|
const setBoxStatus = (status: string) => {
|
|
|
let style = "";
|
|
|
switch (status) {
|
|
|
- case "qualified":
|
|
|
+ case "1":
|
|
|
style = "background-color: #64BB5C;color: white;";
|
|
|
break;
|
|
|
- case "unqualified":
|
|
|
+ case "2":
|
|
|
style = "background-color: #E84026;color: white;";
|
|
|
break;
|
|
|
default:
|
|
|
- style = "background-color: #00000015;color: white;";
|
|
|
+ style = "background-color: #00000015;color: black;";
|
|
|
break;
|
|
|
}
|
|
|
return style;
|
|
|
};
|
|
|
+const hege = async (index) => {
|
|
|
+ updateCheck(checkListData.value[index], "1");
|
|
|
+};
|
|
|
+const buhege = async (index) => {
|
|
|
+ updateCheck(checkListData.value[index], "2");
|
|
|
+};
|
|
|
+onMounted(() => {
|
|
|
+ getCheckList();
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -63,7 +111,7 @@ const setBoxStatus = (status: string) => {
|
|
|
}
|
|
|
|
|
|
.recordBox {
|
|
|
- width: 600px;
|
|
|
+ min-width: 600px;
|
|
|
height: 210px;
|
|
|
background-color: white;
|
|
|
border-radius: 16px;
|