<script lang="ts" setup>
|
import {Search} from "@element-plus/icons-vue";
|
import {reactive} from "vue";
|
import {useRouter} from "vue-router"
|
const router = useRouter()
|
import type { TableColumnCtx } from 'element-plus'
|
|
// import { ref } from 'vue'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
const dialogFormVisible = ref(false)
|
const add = ref(false)
|
const adda = ref(false)
|
// const value = ref('')
|
import request from "@/utils/request"
|
|
import { ref, onMounted } from "vue";
|
// import http from "@/http/index";
|
const tableDataa = ref([])
|
|
const requestData = {
|
// projectNo:"P24030805",
|
state:100
|
};
|
|
const tableData = reactive([]);
|
// let filterData = ref({
|
// damageDetails: {
|
// state: '',
|
// },
|
|
// })
|
// 发送获取表格数据的请求
|
const fetchTableData = async () => {
|
try {
|
// 发送获取表格数据的请求,并等待响应
|
// const response = await request.post("/loadGlass/optimizeProject/listByState", requestData);
|
const response = await request.get("/loadGlass/up-patten-usage/prioritylist");
|
|
// 检查响应状态
|
if (response.code === 200) {
|
// 更新表格数据
|
console.log('成功获取表格数据:', response.data);
|
tableData.splice(0, tableData.length, ...response.data);
|
} else {
|
// 请求失败,显示错误消息
|
ElMessage.error(response.msg);
|
}
|
} catch (error) {
|
// 处理请求失败的情况
|
ElMessage.error('获取表格数据失败,请重试');
|
}
|
};
|
request.get("/loadGlass/LoadGlass/list").then((res) => {
|
if (res.code == 200) {
|
console.log(res.data);
|
tableDataa.value = res.data
|
} else {
|
ElMessage.warning(res.msg)
|
router.push("/login")
|
}
|
});
|
//定义接收加载表头下拉数据
|
const titleSelectJson = ref({
|
processType: [],
|
|
})
|
const getBasicData = ref({
|
id: '',
|
projectNo: '',
|
})
|
request.post("/loadGlass/optimizeProject/listByState", requestData)
|
.then((res) => {
|
if (res.code == 200) {
|
titleSelectJson.value.processType = res.data;
|
console.log(res.data);
|
} else {
|
ElMessage.warning(res.msg)
|
router.push("/login")
|
}
|
});
|
|
// const billall = () => {
|
// request.post("/loadGlass/optimizeProject/listByState", requestData)
|
// .then((res: any) => {
|
// // if (res.code == 200) {
|
// tableData.value = res.data;
|
// // let self = this
|
// // }
|
// })
|
// .catch((err: any) => {});
|
// }
|
const user = ref('');
|
// 定义表头上传数据
|
let titleUploadData = ref({
|
projectNo:'',
|
})
|
// const billall = {
|
// data () {
|
// return {
|
// form: {
|
// projectNo: '',
|
// },
|
// billall:[],
|
// }
|
// },
|
// methods:{
|
|
// }
|
// }
|
|
|
onMounted(fetchTableData);
|
interface User {
|
id: string
|
name: string
|
amount1: string
|
amount2: string
|
amount3: number
|
}
|
|
interface SpanMethodProps {
|
row: User
|
column: TableColumnCtx<User>
|
rowIndex: number
|
columnIndex: number
|
}
|
|
const objectSpanMethod = ({
|
row,
|
column,
|
rowIndex,
|
columnIndex,
|
}: SpanMethodProps) => {
|
if (columnIndex === 0) {
|
if (rowIndex % 2 === 0) {
|
return {
|
rowspan: 2,
|
colspan: 1,
|
}
|
} else {
|
return {
|
rowspan: 0,
|
colspan: 0,
|
}
|
}
|
}
|
}
|
|
const open = () => {
|
ElMessageBox.confirm(
|
'是否删除该条信息?',
|
'提示',
|
{
|
confirmButtonText: '是',
|
cancelButtonText: '取消',
|
type: 'warning',
|
}
|
)
|
.then(() => {
|
ElMessage({
|
type: 'success',
|
message: '删除成功!',
|
})
|
})
|
.catch(() => {
|
ElMessage({
|
type: 'info',
|
message: '删除失败',
|
})
|
})
|
}
|
const getTableRow = (type) =>{
|
switch (type) {
|
case 'edit' :{
|
//alert('我接收到子组件传送的编辑信息')
|
// router.push({path: '/main/returns/createReturns', query: { ReturnID: 'TH24010101' }})
|
break
|
state: true
|
}
|
case 'delete':{
|
alert('我接收到子组件传送的删除信息')
|
break
|
}
|
}
|
}
|
|
const gridOptions = reactive({
|
border: "full",//表格加边框
|
keepSource: true,//保持源数据
|
align: 'center',//文字居中
|
stripe:true,//斑马纹
|
rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮
|
id: 'OrderList',
|
showFooter: true,//显示脚
|
printConfig: {},
|
importConfig: {},
|
exportConfig: {},
|
scrollY:{ enabled: true },//开启虚拟滚动
|
showOverflow:true,
|
columnConfig: {
|
resizable: true,
|
useKey: true
|
},
|
filterConfig: { //筛选配置项
|
remote: true
|
},
|
customConfig: {
|
storage: true
|
},
|
editConfig: {
|
trigger: 'click',
|
mode: 'row',
|
showStatus: true
|
},
|
data: [
|
{
|
'id': '1',
|
'long': '5',
|
'wide': '1005',
|
'thick': '183.6',
|
}
|
],
|
})
|
</script>
|
|
<template>
|
<div>
|
<div id="dotClass">
|
<div>打标机就绪状态:</div>
|
<i style="margin-top: 2px; background-color: green;width:18px; height:18px; border-radius: 50%; display: block"></i>
|
<el-button style="margin-left: 30px;margin-top: -3px;">手动确认</el-button>
|
|
<div style="margin-left: 70px;">切割机就绪状态:</div>
|
<i style="margin-top: 2px; background-color: #911005 ;width:18px; height:18px; border-radius: 50%; display: block"></i>
|
<el-button style="margin-left: 30px;margin-top: -3px;" >手动确认</el-button>
|
</div>
|
<el-button style="margin-top: 5px;margin-left: 15px;" id="searchButton" type="primary" @click="dialogFormVisible = true">选择工程</el-button>
|
<el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="primary">开始上片</el-button>
|
<el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="warning" >暂停</el-button>
|
<el-button style="margin-top: 5px;margin-left: 20px;" id="searchButton" type="danger" >停止任务</el-button>
|
<el-card style="flex: 1;margin-left: 10px;margin-top: 15px;" v-loading="loading">
|
<div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;">
|
<!-- <el-table
|
height="150"
|
ref="table"
|
:header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"
|
:data="tableData"
|
:span-method="objectSpanMethod"
|
> -->
|
<el-table
|
height="150"
|
ref="table"
|
:header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"
|
:data="tableData"
|
>
|
<el-table-column prop="engineeringId" label="工程号" width="200" align="center"/>
|
<el-table-column prop="width" label="原片宽" align="center"/>
|
<el-table-column prop="height" label="原片长" align="center"/>
|
<el-table-column prop="filmsId" label="膜系" align="center"/>
|
<el-table-column prop="layoutSequence" label="数量" align="center"/>
|
<el-table-column prop="thickness" label="厚度" align="center"/>
|
<el-table-column
|
align="center"
|
label="状态"
|
min-width="80"
|
prop="state"
|
>
|
<!-- <el-tag type="success" v-if="damageDetails.state === 1">就绪</el-tag> -->
|
<!-- <el-tag type="danger" v-if="row.enableState==2">未就绪</el-tag> -->
|
</el-table-column>
|
</el-table>
|
</div>
|
</el-card>
|
<div id="parent">
|
<img src="../../assets/shangpianji.png" alt="" style="max-width: 20%;max-height: 20%;margin-top: 20px;margin-left: 500px;">
|
<!-- <el-button style="margin-top: -830px;margin-left: -40px;" size="mini" id="searchButton" @click="add = true">添加原片</el-button> -->
|
<!-- <el-button style="margin-top: -10px;margin-left: -80px;" size="mini" id="searchButton" @click="adda = true">添加原片</el-button> -->
|
</div>
|
<div style="margin-top: -350px;margin-left: 650px;">
|
<el-table :data="tableDataa" border style="width: 60%"
|
:header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"
|
>
|
<el-table-column prop="patternWidth" align="center" label="宽" min-width="80" />
|
<el-table-column prop="patternHeigth" align="center" label="长" min-width="80" />
|
<el-table-column prop="filmsId" align="center" label="膜系" min-width="80" />
|
<el-table-column prop="number" align="center" label="数量" min-width="80" />
|
<el-table-column fixed="right" label="操作" align="center" width="150">
|
<template #default>
|
<el-button size="mini" type="text" plain @click="add = true">添加</el-button>
|
<el-button size="mini" type="text" plain @click="open">删除</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
</div>
|
|
|
<el-dialog v-model="dialogFormVisible" top="24vh" width="30%" title="工程" >
|
<div style="margin-left: 50px;margin-bottom: 10px;">
|
<el-form-item label="工程号:" :required="true">
|
<el-select v-model="getBasicData.projectNo" clearable placeholder="请选择工程" style="width: 220px"
|
>
|
<el-option
|
v-for="item in titleSelectJson['processType']"
|
:key="item.id"
|
:label="item.projectNo"
|
:value="item.projectNo"
|
/>
|
</el-select>
|
<!-- <el-select
|
clearable
|
placeholder="请选择工程"
|
style="width: 300px"
|
v-model="form.id"
|
>
|
<el-option
|
v-for="item in billall"
|
:key="item.id"
|
:label="item.projectNo"
|
:value="item.projectNo"
|
/>
|
</el-select> -->
|
</el-form-item>
|
</div>
|
<template #footer>
|
<div id="dialog-footer">
|
<el-button type="primary" @click="dialogFormVisible = false">
|
确认
|
</el-button>
|
<el-button @click="dialogFormVisible = false">取消</el-button>
|
</div>
|
</template>
|
</el-dialog>
|
<el-dialog v-model="add" top="23vh" width="45%" title="添加原片" >
|
<div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;">
|
<el-form size="mini" label-width="150px">
|
<el-form label-width="70px" label-position="right">
|
<el-row style="margin-top: -15px;margin-bottom: -2px;">
|
<el-col :span="6">
|
<div id="dt" style="font-size: 15px;">
|
<div>
|
<el-form-item label="长:" :required="true" style="width: 14vw">
|
<el-input autocomplete="off" />
|
</el-form-item></div></div>
|
</el-col>
|
<el-col :span="9">
|
<div id="dta" style="font-size: 15px;">
|
<div>
|
<el-form-item label="宽:" :required="true" style="width: 14vw">
|
<el-input autocomplete="off" />
|
</el-form-item></div>
|
</div>
|
</el-col>
|
</el-row>
|
<el-row style="margin-top: 10px;">
|
<el-col :span="6">
|
<div id="dt" style="font-size: 15px;">
|
<div>
|
<el-form-item label="膜系:" :required="true" style="width: 14vw;">
|
<el-input autocomplete="off" />
|
</el-form-item></div></div>
|
</el-col>
|
<el-col :span="9">
|
<div id="dta" style="font-size: 15px;">
|
<div>
|
<el-form-item label="厚度:" :required="true" style="width: 14vw">
|
<el-input autocomplete="off" />
|
</el-form-item></div></div>
|
</el-col>
|
</el-row>
|
<el-row style="margin-top: 10px;">
|
<el-col :span="6">
|
<div id="dt" style="font-size: 15px;">
|
<div>
|
<el-form-item label="数量:" :required="true" style="width: 14vw;">
|
<el-input autocomplete="off" />
|
</el-form-item></div></div>
|
</el-col>
|
</el-row>
|
</el-form>
|
</el-form>
|
</div>
|
<template #footer>
|
<div id="dialog-footer">
|
<el-button type="primary" @click="getTableRow('edit')">
|
确认
|
</el-button>
|
<el-button @click="add = false">取消</el-button>
|
</div>
|
</template>
|
</el-dialog>
|
<el-dialog v-model="adda" top="23vh" width="45%" title="添加原片" >
|
<div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;">
|
<el-form size="mini" >
|
<el-form label-width="70px" label-position="right">
|
<el-row style="margin-top: -15px;margin-bottom: -2px;">
|
<el-col :span="6">
|
<div id="dt" style="font-size: 15px;">
|
<div>
|
<el-form-item label="长:" :required="true" style="width: 14vw">
|
<el-input autocomplete="off" style="width: 180px" />
|
</el-form-item></div></div>
|
</el-col>
|
<el-col :span="9">
|
<div id="dta" style="font-size: 15px;">
|
<div>
|
<el-form-item label="宽:" :required="true" style="width: 14vw">
|
<el-input autocomplete="off" style="width: 180px" />
|
</el-form-item></div>
|
</div>
|
</el-col>
|
</el-row>
|
<el-row style="margin-top: 10px;">
|
<el-col :span="6">
|
<div id="dt" style="font-size: 15px;">
|
<div>
|
<el-form-item label="膜系:" :required="true" style="width: 14vw;">
|
<el-input autocomplete="off" style="width: 180px" />
|
</el-form-item></div></div>
|
</el-col>
|
<el-col :span="9">
|
<div id="dta" style="font-size: 15px;">
|
<div>
|
<el-form-item label="厚度:" :required="true" style="width: 14vw">
|
<el-input autocomplete="off" style="width: 180px" />
|
</el-form-item></div></div>
|
</el-col>
|
</el-row>
|
<el-row style="margin-top: 10px;">
|
<el-col :span="6">
|
<div id="dt" style="font-size: 15px;">
|
<div>
|
<el-form-item label="数量:" :required="true" style="width: 14vw;">
|
<el-input autocomplete="off" style="width: 180px" />
|
</el-form-item></div></div>
|
</el-col>
|
</el-row>
|
</el-form>
|
</el-form>
|
</div>
|
<template #footer>
|
<div id="dialog-footer">
|
<el-button type="primary" @click="adda = false">
|
确认
|
</el-button>
|
<el-button @click="adda = false">取消</el-button>
|
</div>
|
</template>
|
</el-dialog>
|
</template>
|
|
<style scoped>
|
|
#dt { display:block; float:left;line-height: 20px;margin-left: 100px;}
|
#dta { display:block; float:left;line-height: 20px;margin-left: 80%;}
|
#dialog-footer{
|
text-align: center;
|
margin-top: -15px;
|
}
|
#dotClass {
|
display: flex;
|
margin-left: 20px;
|
size: 50px;
|
margin-top: 20px;
|
margin-bottom: 10px;
|
}
|
#parent{
|
position: relative;
|
width: 1500px;
|
margin-left: -300px
|
}
|
#overlay{
|
position: absolute;
|
z-index: 1;
|
width: 212px;
|
height: 15px;
|
background-color: #529b2e;
|
margin-top: -407px;
|
margin-left: 171px;
|
}
|
#overlaya{
|
position: absolute;
|
z-index: 1;
|
width: 212px;
|
height: 15px;
|
background-color: #529b2e;
|
margin-top: -40px;
|
margin-left: 167px;
|
}
|
|
</style>
|