| | |
| | | }) |
| | | const tableDataa = ref([]) |
| | | |
| | | const requestData = { |
| | | // projectNo:"P24030805", |
| | | state:100 |
| | | }; |
| | | |
| | | |
| | | const tableData = reactive([]); |
| | | // let filterData = ref({ |
| | | // damageDetails: { |
| | |
| | | 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 getBasicData = ref({ |
| | | // id: '', |
| | | // projectNo: '', |
| | | // }) |
| | | // const requestData = { |
| | | // // projectNo:"P24030805", |
| | | // state:100 |
| | | // }; |
| | | // 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 requestData = { |
| | | state: 100 |
| | | }; |
| | | // 响应式数据 |
| | | const selectedProjectNo = ref(''); // 当前选中的工程号 |
| | | const options = ref<any[]>([]); // 下拉选项列表 |
| | | |
| | | // 调用接口获取选项数据的函数 |
| | | const fetchOptions = async (queryString: string) => { |
| | | try { |
| | | // 发送请求到后端接口 |
| | | const response = await request.post('/loadGlass/optimizeProject/listByState', { |
| | | ...requestData, |
| | | query: queryString // 将查询字符串作为参数传递 |
| | | }); |
| | | |
| | | if (response.code == 200) { |
| | | titleSelectJson.value.processType = response.data; |
| | | |
| | | // titleSelectJson.value.processType = response.data(item => ({ |
| | | // // options.value = response.data.data.map(item => ({ |
| | | // value: item.projectNo, |
| | | // // label: item.id // 假设后端返回的数据中有 字段作为显示标签 |
| | | // })); |
| | | console.log(response.data); |
| | | |
| | | } else { |
| | | ElMessage.warning(response.data); |
| | | } |
| | | } catch (error) { |
| | | console.error('Error fetching options:', error); |
| | | } |
| | | }; |
| | | |
| | | // 处理用户输入变化的方法 |
| | | const handleInputChange = async (value: string) => { |
| | | if (value) { |
| | | await fetchOptions(value); |
| | | } else { |
| | | options.value = []; // 清空选项列表 |
| | | } |
| | | }; |
| | | |
| | | // 初始化加载数据(如果需要) |
| | | onMounted(() => { |
| | | // 在组件挂载后调用 fetchOptions('') 来加载初始数据(如果需要) |
| | | fetchOptions(''); |
| | | }); |
| | | |
| | | // const billall = () => { |
| | | // request.post("/loadGlass/optimizeProject/listByState", requestData) |
| | | // .then((res: any) => { |
| | |
| | | } |
| | | } |
| | | onMounted(fetchTableData); |
| | | |
| | | |
| | | // const open = () => { |
| | | // ElMessageBox.confirm( |
| | | // '是否删除该条信息?', |
| | |
| | | // 开始上片 |
| | | const handleBind = (row) => { |
| | | // engineeringId.value = row.engineeringId; |
| | | |
| | | |
| | | blind.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | // 暂停 |
| | | const handleBinda = (row) => { |
| | | // engineeringId.value = row.engineeringId; |
| | | |
| | | |
| | | blinda.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | // 停止任务 |
| | | const handleBindb = (row) => { |
| | | // engineeringId.value = row.engineeringId; |
| | | |
| | | |
| | | blindb.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | // 添加 |
| | | const handleBindRack = (row) => { |
| | | workstationId.value = row.workstationId; // 假设rackNumber是架号字段的属性名 |
| | | |
| | | |
| | | add.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | // 删除 |
| | | const handleBindRacka = (row) => { |
| | | workstationId.value = row.workstationId; // 假设rackNumber是架号字段的属性名 |
| | | |
| | | |
| | | adda.value = true; // 打开绑定架子对话框 |
| | | }; |
| | | const gridOptions = reactive({ |
| | |
| | | <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-select |
| | | v-model="selectedProjectNo" |
| | | filterable |
| | | clearable |
| | | placeholder="请选择工程" |
| | | style="width: 220px" |
| | | @input="handleInputChange" |
| | | > |
| | | <el-option |
| | | v-for="item in titleSelectJson['processType']" |
| | | :key="item.id" |
| | | :label="item.projectNo" |
| | | :value="item.projectNo" |
| | | /> |
| | | </el-select> |
| | | <!-- <el-select v-model="getBasicData.projectNo" clearable placeholder="请选择工程" style="width: 220px" |
| | | > |
| | | <el-option |
| | | v-for="item in titleSelectJson['processType']" |
| | |
| | | :label="item.projectNo" |
| | | :value="item.projectNo" |
| | | /> |
| | | </el-select> |
| | | </el-select> --> |
| | | </el-form-item> |
| | | </div> |
| | | <template #footer> |