|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<div class="csTitle-header">
|
|
|
- <el-button type="primary" @click="startTesting">选择设备</el-button>
|
|
|
+ <el-button type="primary" @click="startCreat">选择设备</el-button>
|
|
|
<span>产品编码: {{ csObj?.materialName }}</span>
|
|
|
<span>产品名称: {{ csObj?.materialCode }}</span>
|
|
|
<span>测试人员: {{ csObj?.creator }}</span>
|
|
@@ -43,6 +43,14 @@
|
|
|
>
|
|
|
查看
|
|
|
</el-button>
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ class="btnText"
|
|
|
+ type="danger"
|
|
|
+ @click="preDel(scope.row)"
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -62,7 +70,7 @@
|
|
|
align="center"
|
|
|
/>
|
|
|
<el-table-column fixed prop="value" label="测试值" align="center" />
|
|
|
- <el-table-column prop="flag" align="center" label="是否合格">
|
|
|
+<!-- <el-table-column prop="flag" align="center" label="是否合格">
|
|
|
<template #default="scope">
|
|
|
<span
|
|
|
:class="{
|
|
@@ -73,7 +81,7 @@
|
|
|
{{ scope.row.flag == 1 ? "合格" : "不合格" }}
|
|
|
</span>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column>-->
|
|
|
|
|
|
<!-- <el-table-column label="操作" fixed="right" width="200">-->
|
|
|
<!-- <template #default="scope">-->
|
|
@@ -121,49 +129,28 @@
|
|
|
<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>
|
|
|
+ </el-form-item>-->
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
<el-button @click="handleDialogCancel">取 消</el-button>
|
|
|
<el-button type="primary" @click="handleDialogConfirm">确 定</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
- <el-dialog title="设备列表" v-model="dialogDevice" append-to-body>
|
|
|
- <el-table
|
|
|
- :data="deviceList"
|
|
|
- style="width: 100%; height: calc(100vh - 400px); margin-bottom: 10px"
|
|
|
- ref="singleTableRef"
|
|
|
- row-key="id"
|
|
|
- highlight-current-row
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- @selection-change="handleSelectionAllChange"
|
|
|
- >
|
|
|
- <el-table-column type="selection" width="50" />
|
|
|
- <el-table-column prop="id" label="id" width="180" v-if="false" />
|
|
|
- <el-table-column prop="deviceNo" label="设备编号" />
|
|
|
- <el-table-column prop="deviceName" label="设备名称" />
|
|
|
- </el-table>
|
|
|
- <el-pagination
|
|
|
- v-model:current-page="currentPageAll"
|
|
|
- v-model:page-size="pageSizeAll"
|
|
|
- layout="total, prev, pager, next"
|
|
|
- :total="totalAll"
|
|
|
- background
|
|
|
- @size-change="sizeChangeAll"
|
|
|
- @current-change="currentChangeAll"
|
|
|
- />
|
|
|
- <template #footer>
|
|
|
- <el-button @click="dialogDevice = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="dialogDevice = false"
|
|
|
- >确 定</el-button
|
|
|
- >
|
|
|
- </template>
|
|
|
- </el-dialog>
|
|
|
|
|
|
- <el-dialog title="设置时间" v-model="startSettingVisible" append-to-body>
|
|
|
+ <CrudTable
|
|
|
+ ref="ctableRef"
|
|
|
+ tableTitle="设备绑定"
|
|
|
+ :multipleRow="multipleRow"
|
|
|
+ tableType="DEVICE"
|
|
|
+ @selected-sure="onSelectedFinish"
|
|
|
+ />
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <el-dialog title="设置时间" v-model="startSettingVisible" append-to-body style="top:20%">
|
|
|
<el-date-picker
|
|
|
v-model="startSettingTime"
|
|
|
type="datetimerange"
|
|
@@ -188,14 +175,58 @@ import {
|
|
|
startCSSJTesting,
|
|
|
getDeviceList,
|
|
|
getDeviceListPage,
|
|
|
+ getDataDevice,
|
|
|
+ addDataDevice, delDataDevice
|
|
|
} from "@/api/prosteps/ceshishuju";
|
|
|
import { useProcessStore } from "@/store";
|
|
|
import { emitter, EventsNames } from "@/utils/common";
|
|
|
+import { useCrud } from "@/hooks/userCrud";
|
|
|
+const multipleRow = ref(true);
|
|
|
|
|
|
-const store = useProcessStore();
|
|
|
+const dataDeviceList = ref([]);
|
|
|
+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));
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
|
|
|
+}
|
|
|
+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,
|
|
|
+ });
|
|
|
|
|
|
+};
|
|
|
const tableData = ref<any[]>([]);
|
|
|
|
|
|
const currentRow = ref<any>(null);
|
|
@@ -204,7 +235,11 @@ const handleCurrentChange = (val: any) => {
|
|
|
};
|
|
|
const deviceList = ref<any[]>([]);
|
|
|
const getList = () => {
|
|
|
- dataArrayList(store.scanInfo.id).then((res: any) => {
|
|
|
+ if(!currentToStartRow||!currentToStartRow.deviceNo){
|
|
|
+ tableData.value=[];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ dataArrayList(store.scanInfo.id,currentToStartRow.deviceNo).then((res: any) => {
|
|
|
csObj.value = res.data;
|
|
|
tableData.value = JSON.parse(res.data.testData);
|
|
|
console.log(tableData.value, "返回的列表数据");
|
|
@@ -224,16 +259,16 @@ const handleSelectionAllChange = (vals: any[]) => {
|
|
|
selectedDeviceList.value = JSON.parse(JSON.stringify(vals));
|
|
|
};
|
|
|
|
|
|
-const dialogConfirm = () => {
|
|
|
- console.log(currentRow);
|
|
|
- if (!currentRow || !currentRow.value || !currentRow.value.deviceNo) {
|
|
|
- ElMessage.error("未选择设备!");
|
|
|
- return;
|
|
|
- }
|
|
|
- startCSSJTesting(store.scanInfo.id, currentRow.value.deviceNo).then(
|
|
|
+const afterTimeStart = () => {
|
|
|
+ const testParam = ref({});
|
|
|
+ testParam.value.processId=store.scanInfo.id;
|
|
|
+ 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) => {
|
|
@@ -248,6 +283,12 @@ 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 getDeviceListPageAll = () => {
|
|
@@ -319,16 +360,30 @@ const preToStart = (row) => {
|
|
|
currentToStartRow = JSON.parse(JSON.stringify(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 preToLook = (row) => {
|
|
|
- // currentToStartRow = JSON.parse(JSON.stringify(row));
|
|
|
+ currentToStartRow = JSON.parse(JSON.stringify(row));
|
|
|
// startSettingVisible.value = true;
|
|
|
+ getList();
|
|
|
};
|
|
|
|
|
|
const startSettingVisible = ref(false);
|
|
|
const startSettingTime = ref<any>(null);
|
|
|
-const afterTimeStart = () => {
|
|
|
- console.log(startSettingTime.value);
|
|
|
-};
|
|
|
const afterTimeCancel = () => {
|
|
|
startSettingVisible.value = false;
|
|
|
};
|
|
@@ -351,7 +406,7 @@ const afterTimeCancel = () => {
|
|
|
}
|
|
|
|
|
|
.left-selected-devs {
|
|
|
- width: 400px;
|
|
|
+ width: 450px;
|
|
|
background-color: #fff;
|
|
|
border-radius: 16px;
|
|
|
height: calc(100vh - 300px);
|