|
@@ -11,66 +11,25 @@
|
|
|
<div class="bottom-box">
|
|
|
<el-scrollbar style="height: calc(100vh - 300px); margin-top: 10px">
|
|
|
<el-table :data="selectedDeviceList" class="left-selected-devs">
|
|
|
- <el-table-column
|
|
|
- fixed
|
|
|
- prop="deviceNo"
|
|
|
- label="设备编号"
|
|
|
- align="center"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- fixed
|
|
|
- prop="deviceName"
|
|
|
- label="设备名称"
|
|
|
- align="center"
|
|
|
- />
|
|
|
+ <el-table-column fixed prop="deviceNo" label="设备编号" align="center" />
|
|
|
+ <el-table-column fixed prop="deviceName" label="设备名称" align="center" />
|
|
|
|
|
|
<el-table-column label="操作">
|
|
|
<template #default="scope">
|
|
|
- <el-button
|
|
|
- link
|
|
|
- class="btnText"
|
|
|
- type="primary"
|
|
|
- @click="preToStart(scope.row)"
|
|
|
- >
|
|
|
- 开始
|
|
|
- </el-button>
|
|
|
+ <el-button link class="btnText" type="primary" @click="preToStart(scope.row)"> 开始 </el-button>
|
|
|
|
|
|
- <el-button
|
|
|
- link
|
|
|
- class="btnText"
|
|
|
- type="primary"
|
|
|
- @click="preToLook(scope.row)"
|
|
|
- >
|
|
|
- 查看
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- link
|
|
|
- class="btnText"
|
|
|
- type="danger"
|
|
|
- @click="preDel(scope.row)"
|
|
|
- >
|
|
|
- 删除
|
|
|
- </el-button>
|
|
|
+ <el-button link class="btnText" type="primary" @click="preToLook(scope.row)"> 查看 </el-button>
|
|
|
+ <el-button link class="btnText" type="danger" @click="preDel(scope.row)"> 删除 </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</el-scrollbar>
|
|
|
- <div class="tableView-cssj">
|
|
|
- <el-table :data="tableData">
|
|
|
- <el-table-column
|
|
|
- fixed
|
|
|
- prop="parameterName"
|
|
|
- label="测试项目"
|
|
|
- align="center"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- fixed
|
|
|
- prop="deviceCode"
|
|
|
- label="测试设备"
|
|
|
- align="center"
|
|
|
- />
|
|
|
- <el-table-column fixed prop="value" label="测试值" align="center" />
|
|
|
-<!-- <el-table-column prop="flag" align="center" label="是否合格">
|
|
|
+ <div class="tableView-cssj">
|
|
|
+ <el-table :data="tableData">
|
|
|
+ <el-table-column fixed prop="parameterName" label="测试项目" align="center" />
|
|
|
+ <el-table-column fixed prop="deviceCode" label="测试设备" align="center" />
|
|
|
+ <el-table-column fixed prop="value" label="测试值" align="center" />
|
|
|
+ <!-- <el-table-column prop="flag" align="center" label="是否合格">
|
|
|
<template #default="scope">
|
|
|
<span
|
|
|
:class="{
|
|
@@ -83,51 +42,50 @@
|
|
|
</template>
|
|
|
</el-table-column>-->
|
|
|
|
|
|
- <!-- <el-table-column label="操作" fixed="right" width="200">-->
|
|
|
- <!-- <template #default="scope">-->
|
|
|
- <!-- <el-button-->
|
|
|
- <!-- link-->
|
|
|
- <!-- class="btnText"-->
|
|
|
- <!-- type="primary"-->
|
|
|
- <!-- @click="handleEdit(scope.row)"-->
|
|
|
- <!-- >-->
|
|
|
- <!-- 编辑-->
|
|
|
- <!-- </el-button>-->
|
|
|
-
|
|
|
- <!-- <el-popconfirm-->
|
|
|
- <!-- :visible="scope.row.dialogVisible"-->
|
|
|
- <!-- title="您确认删除吗?(此操作不可逆)"-->
|
|
|
- <!-- width="300"-->
|
|
|
- <!-- @cancel="scope.row.dialogVisible = false"-->
|
|
|
- <!-- @confirm="handleDelete(scope.row)"-->
|
|
|
- <!-- >-->
|
|
|
- <!-- <el-button> 取消 </el-button>-->
|
|
|
- <!-- <el-button type="primary"> 确认 </el-button>-->
|
|
|
- <!-- <template #reference>-->
|
|
|
- <!-- <el-button-->
|
|
|
- <!-- link-->
|
|
|
- <!-- class="btnText"-->
|
|
|
- <!-- type="primary"-->
|
|
|
- <!-- @click="scope.row.dialogVisible = true"-->
|
|
|
- <!-- >删除</el-button-->
|
|
|
- <!-- >-->
|
|
|
- <!-- </template>-->
|
|
|
- <!-- </el-popconfirm>-->
|
|
|
- <!-- </template>-->
|
|
|
- <!-- </el-table-column>-->
|
|
|
-
|
|
|
- </el-table>
|
|
|
- <div style="margin-top:25px">
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- :page-size="20"
|
|
|
- :pager-count="8"
|
|
|
- layout="->,prev, pager, next"
|
|
|
- :total="pageTotal"
|
|
|
- @current-change="handlePageChange"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <!-- <el-table-column label="操作" fixed="right" width="200">-->
|
|
|
+ <!-- <template #default="scope">-->
|
|
|
+ <!-- <el-button-->
|
|
|
+ <!-- link-->
|
|
|
+ <!-- class="btnText"-->
|
|
|
+ <!-- type="primary"-->
|
|
|
+ <!-- @click="handleEdit(scope.row)"-->
|
|
|
+ <!-- >-->
|
|
|
+ <!-- 编辑-->
|
|
|
+ <!-- </el-button>-->
|
|
|
+
|
|
|
+ <!-- <el-popconfirm-->
|
|
|
+ <!-- :visible="scope.row.dialogVisible"-->
|
|
|
+ <!-- title="您确认删除吗?(此操作不可逆)"-->
|
|
|
+ <!-- width="300"-->
|
|
|
+ <!-- @cancel="scope.row.dialogVisible = false"-->
|
|
|
+ <!-- @confirm="handleDelete(scope.row)"-->
|
|
|
+ <!-- >-->
|
|
|
+ <!-- <el-button> 取消 </el-button>-->
|
|
|
+ <!-- <el-button type="primary"> 确认 </el-button>-->
|
|
|
+ <!-- <template #reference>-->
|
|
|
+ <!-- <el-button-->
|
|
|
+ <!-- link-->
|
|
|
+ <!-- class="btnText"-->
|
|
|
+ <!-- type="primary"-->
|
|
|
+ <!-- @click="scope.row.dialogVisible = true"-->
|
|
|
+ <!-- >删除</el-button-->
|
|
|
+ <!-- >-->
|
|
|
+ <!-- </template>-->
|
|
|
+ <!-- </el-popconfirm>-->
|
|
|
+ <!-- </template>-->
|
|
|
+ <!-- </el-table-column>-->
|
|
|
+ </el-table>
|
|
|
+ <div style="margin-top: 25px">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ :page-size="20"
|
|
|
+ :pager-count="8"
|
|
|
+ layout="->,prev, pager, next"
|
|
|
+ :total="pageTotal"
|
|
|
+ @current-change="handlePageChange"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
<el-dialog title="编辑测试项" v-model="dialogVisible">
|
|
@@ -141,7 +99,7 @@
|
|
|
<el-form-item label="测试值">
|
|
|
<el-input v-model="editRow.value" />
|
|
|
</el-form-item>
|
|
|
-<!-- <el-form-item label="是否合格">
|
|
|
+ <!-- <el-form-item label="是否合格">
|
|
|
<el-radio v-model="editRow.flag" :label="1">合格</el-radio>
|
|
|
<el-radio v-model="editRow.flag" :label="0">不合格</el-radio>
|
|
|
</el-form-item>-->
|
|
@@ -152,17 +110,15 @@
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <CrudTable
|
|
|
- ref="ctableRef"
|
|
|
- tableTitle="设备绑定"
|
|
|
- :multipleRow="multipleRow"
|
|
|
- tableType="DEVICE"
|
|
|
- @selected-sure="onSelectedFinish"
|
|
|
- />
|
|
|
-
|
|
|
+ <CrudTable
|
|
|
+ ref="ctableRef"
|
|
|
+ tableTitle="设备绑定"
|
|
|
+ :multipleRow="multipleRow"
|
|
|
+ tableType="DEVICE"
|
|
|
+ @selected-sure="onSelectedFinish"
|
|
|
+ />
|
|
|
|
|
|
-
|
|
|
- <el-dialog title="设置时间" v-model="startSettingVisible" append-to-body style="top:20%">
|
|
|
+ <el-dialog title="设置时间" v-model="startSettingVisible" append-to-body style="top: 20%">
|
|
|
<el-date-picker
|
|
|
v-model="startSettingTime"
|
|
|
type="datetimerange"
|
|
@@ -188,7 +144,8 @@ import {
|
|
|
getDeviceList,
|
|
|
getDeviceListPage,
|
|
|
getDataDevice,
|
|
|
- addDataDevice, delDataDevice
|
|
|
+ addDataDevice,
|
|
|
+ delDataDevice,
|
|
|
} from "@/api/prosteps/ceshishuju";
|
|
|
import { useProcessStore } from "@/store";
|
|
|
import { emitter, EventsNames } from "@/utils/common";
|
|
@@ -200,50 +157,41 @@ const onSelectedFinish = (val) => {
|
|
|
if (Object.keys(val).length == 0) {
|
|
|
ElMessage.error("请选择设备,数据不能为空!");
|
|
|
}
|
|
|
- val?.forEach(
|
|
|
- (item,index)=>{
|
|
|
- const dataDevice = ref({});
|
|
|
- dataDevice.value.processId = store.scanInfo.id;
|
|
|
- dataDevice.value.seqNo = store.scanInfo.seqNo;
|
|
|
- dataDevice.value.operationId = store.scanInfo.operationId;
|
|
|
- dataDevice.value.operationName = store.scanInfo.operationName;
|
|
|
- dataDevice.value.workOrderCode = store.scanInfo.workOrderCode;
|
|
|
- dataDevice.value.deviceNo = item.deviceNo;
|
|
|
- dataDevice.value.deviceName = item.deviceName;
|
|
|
- dataDeviceList.value.push(dataDevice.value);
|
|
|
- }
|
|
|
-
|
|
|
- )
|
|
|
- addDataDevice(dataDeviceList.value).then(
|
|
|
- (res)=>{
|
|
|
- if(res.code==='200'){
|
|
|
- const param=ref({processId:store.scanInfo.id});
|
|
|
- getDataDevice(param.value).then(
|
|
|
- (data)=>{
|
|
|
- selectedDeviceList.value = JSON.parse(JSON.stringify(data.data));
|
|
|
- }
|
|
|
- )
|
|
|
- }
|
|
|
- }
|
|
|
- )
|
|
|
-
|
|
|
-}
|
|
|
+ val?.forEach((item, index) => {
|
|
|
+ const dataDevice = ref({});
|
|
|
+ dataDevice.value.processId = store.scanInfo.id;
|
|
|
+ dataDevice.value.seqNo = store.scanInfo.seqNo;
|
|
|
+ dataDevice.value.operationId = store.scanInfo.operationId;
|
|
|
+ dataDevice.value.operationName = store.scanInfo.operationName;
|
|
|
+ dataDevice.value.workOrderCode = store.scanInfo.workOrderCode;
|
|
|
+ dataDevice.value.deviceNo = item.deviceNo;
|
|
|
+ dataDevice.value.deviceName = item.deviceName;
|
|
|
+ dataDeviceList.value.push(dataDevice.value);
|
|
|
+ });
|
|
|
+ addDataDevice(dataDeviceList.value).then((res) => {
|
|
|
+ if (res.code === "200") {
|
|
|
+ const param = ref({ processId: store.scanInfo.id });
|
|
|
+ getDataDevice(param.value).then((data) => {
|
|
|
+ selectedDeviceList.value = JSON.parse(JSON.stringify(data.data));
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
const store = useProcessStore();
|
|
|
const ctableRef = ref({});
|
|
|
const csObj = ref<any>(null);
|
|
|
const startCreat = () => {
|
|
|
- ctableRef.value.startSelect({deviceType : "DDS"});
|
|
|
- ctableRef.value?.mergeOption({
|
|
|
- selection: true,
|
|
|
- reserveSelection: true,
|
|
|
- });
|
|
|
-
|
|
|
+ ctableRef.value.startSelect({ deviceType: "DDS" });
|
|
|
+ ctableRef.value?.mergeOption({
|
|
|
+ selection: true,
|
|
|
+ reserveSelection: true,
|
|
|
+ });
|
|
|
};
|
|
|
const currentPage = ref(1);
|
|
|
-const handlePageChange =(val: number)=>{
|
|
|
- currentPage.value=val;
|
|
|
+const handlePageChange = (val: number) => {
|
|
|
+ currentPage.value = val;
|
|
|
getList();
|
|
|
-}
|
|
|
+};
|
|
|
const tableData = ref<any[]>([]);
|
|
|
|
|
|
const currentRow = ref<any>(null);
|
|
@@ -253,14 +201,14 @@ const handleCurrentChange = (val: any) => {
|
|
|
const pageTotal = ref(0);
|
|
|
const deviceList = ref<any[]>([]);
|
|
|
const getList = () => {
|
|
|
- if(!currentToStartRow||!currentToStartRow.deviceNo){
|
|
|
- tableData.value=[];
|
|
|
+ if (!currentToStartRow || !currentToStartRow.deviceNo) {
|
|
|
+ tableData.value = [];
|
|
|
return;
|
|
|
}
|
|
|
- dataArrayList(store.scanInfo.id,currentToStartRow.deviceNo,currentPage.value.toString()).then((res: any) => {
|
|
|
+ dataArrayList(store.scanInfo.id, currentToStartRow.deviceNo, currentPage.value.toString()).then((res: any) => {
|
|
|
csObj.value = res.data;
|
|
|
tableData.value = JSON.parse(res.data.testData);
|
|
|
- pageTotal.value=res.data.total;
|
|
|
+ pageTotal.value = res.data.total;
|
|
|
console.log(tableData.value, "返回的列表数据");
|
|
|
});
|
|
|
};
|
|
@@ -280,34 +228,31 @@ const handleSelectionAllChange = (vals: any[]) => {
|
|
|
|
|
|
const afterTimeStart = () => {
|
|
|
const testParam = ref({});
|
|
|
- testParam.value.processId=store.scanInfo.id;
|
|
|
+ testParam.value.processId = store.scanInfo.id;
|
|
|
+ testParam.value.operationName = store.scanInfo.operationName;
|
|
|
testParam.value.deviceNo = currentToStartRow.deviceNo;
|
|
|
testParam.value.times = startSettingTime.value;
|
|
|
- startCSSJTesting(testParam.value).then(
|
|
|
- (data) => {
|
|
|
- if (data.code === "200") {
|
|
|
- dialogDevice.value = false;
|
|
|
- startSettingVisible.value = false;
|
|
|
- }
|
|
|
- if (!emitter.all.has(EventsNames.TEST_DATA)) {
|
|
|
- emitter.on(EventsNames.TEST_DATA, (mesaage: any) => {
|
|
|
- console.log("测试数据获取成功");
|
|
|
- getList();
|
|
|
- });
|
|
|
- }
|
|
|
+ startCSSJTesting(testParam.value).then((data) => {
|
|
|
+ if (data.code === "200") {
|
|
|
+ dialogDevice.value = false;
|
|
|
+ startSettingVisible.value = false;
|
|
|
+ }
|
|
|
+ if (!emitter.all.has(EventsNames.TEST_DATA)) {
|
|
|
+ emitter.on(EventsNames.TEST_DATA, (mesaage: any) => {
|
|
|
+ console.log("测试数据获取成功");
|
|
|
+ getList();
|
|
|
+ });
|
|
|
}
|
|
|
- );
|
|
|
+ });
|
|
|
};
|
|
|
onMounted(() => {
|
|
|
getList();
|
|
|
deviceSearch.value.deviceType = "DDS";
|
|
|
getDeviceListPageAll();
|
|
|
- const param=ref({processId:store.scanInfo.id});
|
|
|
- getDataDevice(param.value).then(
|
|
|
- (data)=>{
|
|
|
- selectedDeviceList.value = JSON.parse(JSON.stringify(data.data));
|
|
|
- }
|
|
|
- )
|
|
|
+ const param = ref({ processId: store.scanInfo.id });
|
|
|
+ getDataDevice(param.value).then((data) => {
|
|
|
+ selectedDeviceList.value = JSON.parse(JSON.stringify(data.data));
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
const getDeviceListPageAll = () => {
|
|
@@ -380,21 +325,17 @@ const preToStart = (row) => {
|
|
|
startSettingVisible.value = true;
|
|
|
};
|
|
|
|
|
|
-const preDel = (row) =>{
|
|
|
- delDataDevice({id:row.id}).then(
|
|
|
- (data)=>{
|
|
|
- if(data.code==='200'){
|
|
|
- ElMessage.success("操作成功!");
|
|
|
- const param=ref({processId:store.scanInfo.id});
|
|
|
- getDataDevice(param.value).then(
|
|
|
- (data)=>{
|
|
|
- selectedDeviceList.value = JSON.parse(JSON.stringify(data.data));
|
|
|
- }
|
|
|
- )
|
|
|
- }
|
|
|
+const preDel = (row) => {
|
|
|
+ delDataDevice({ id: row.id }).then((data) => {
|
|
|
+ if (data.code === "200") {
|
|
|
+ ElMessage.success("操作成功!");
|
|
|
+ const param = ref({ processId: store.scanInfo.id });
|
|
|
+ getDataDevice(param.value).then((data) => {
|
|
|
+ selectedDeviceList.value = JSON.parse(JSON.stringify(data.data));
|
|
|
+ });
|
|
|
}
|
|
|
- )
|
|
|
-}
|
|
|
+ });
|
|
|
+};
|
|
|
const preToLook = (row) => {
|
|
|
currentToStartRow = JSON.parse(JSON.stringify(row));
|
|
|
// startSettingVisible.value = true;
|