| | |
| | | <script setup> |
| | | import {onMounted, reactive, ref, watch} from "vue"; |
| | | import {nextTick, onMounted, reactive, ref, watch} from "vue"; |
| | | import {useI18n} from "vue-i18n"; |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import request from "@/utils/request"; |
| | |
| | | |
| | | const {t} = useI18n() |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | const username = userStore.user.userId |
| | | let rowClickIndex = ref(null) |
| | | |
| | | let props = defineProps({ |
| | |
| | | |
| | | |
| | | onMounted(() => { |
| | | console.log(userStore.user); |
| | | getProjectId(); |
| | | selectGlassType(); |
| | | |
| | |
| | | selectFlowCardList(); |
| | | } |
| | | } |
| | | }); |
| | | }, { flush: 'post' }); |
| | | |
| | | |
| | | const gridOptions = reactive({ |
| | |
| | | }) |
| | | } |
| | | |
| | | const getUpdateFlowCardList = async (projectNumber,type,thickness) => { |
| | | radio.value=1 |
| | | const getUpdateFlowCardList = async (projectNumber, type, thickness) => { |
| | | // 重置状态 |
| | | radio.value = 1; |
| | | isButtonDisabledAdd.value = true; |
| | | isButtonDisabledUpdate.value = false; |
| | | |
| | | // 清空现有数据 |
| | | if (xGrid.value) { |
| | | xGrid.value.loadData([]); |
| | | } |
| | | |
| | | // 强制更新表单字段 |
| | | oddNumbers.value = projectNumber; |
| | | projectNmae.value = ''; // 先清空工程名称 |
| | | |
| | | // 构造正确的膜系值 |
| | | const glassTypeValue = `${thickness}mm${type}`; |
| | | optionVal.value = glassTypeValue; |
| | | |
| | | request.post(`/glassOptimize/getUpdateFlowCardList/${type}/${thickness}/${radio.value}/${projectNumber}`).then((res) => { |
| | | if (res.code == 200) { |
| | | oddNumbers.value=projectNumber |
| | | optionVal.value=thickness+"mm"+type |
| | | isButtonDisabledAdd.value=true |
| | | isButtonDisabledUpdate.value=false |
| | | xGrid.value.loadData(deepClone(res.data.data)) |
| | | xGrid.value.getTableData().fullData.forEach(item => { |
| | | if(item.occupyState===0){ |
| | | xGrid.value.setCheckboxRow(item, true); |
| | | // 更新工程编号 |
| | | oddNumbers.value = projectNumber; |
| | | |
| | | // 更新工程名称(如果后端返回) |
| | | if (res.data.projectName) { |
| | | projectNmae.value = res.data.projectName; |
| | | } |
| | | |
| | | // 确保膜系选择正确 |
| | | optionVal.value = glassTypeValue; |
| | | |
| | | isButtonDisabledAdd.value = true; |
| | | isButtonDisabledUpdate.value = false; |
| | | |
| | | // 使用 $nextTick 确保DOM更新后再加载数据 |
| | | nextTick(() => { |
| | | if (xGrid.value) { |
| | | xGrid.value.loadData(deepClone(res.data.data)); |
| | | // 设置选中状态 |
| | | nextTick(() => { |
| | | const tableData = xGrid.value.getTableData().fullData; |
| | | tableData.forEach(item => { |
| | | if(item.occupyState === 0){ |
| | | xGrid.value.setCheckboxRow(item, true); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | }) |
| | | }); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | ElMessage.warning(res.msg); |
| | | } |
| | | }) |
| | | } |
| | | }).catch(error => { |
| | | ElMessage.error('获取流程卡数据失败'); |
| | | console.error(error); |
| | | }); |
| | | }; |
| | | |
| | | //创建工程 |
| | | const addProject = (type) => { |
| | |
| | | ElMessage.error(t('order.msg.pleaseCancelTheFilteringFirst')) |
| | | return |
| | | } |
| | | if (selectRecords.length == 0) { |
| | | ElMessage.warning(t('reportingWorks.selectProcessCardData')) |
| | | return; |
| | | } |
| | | // if (selectRecords.length == 0) { |
| | | // ElMessage.warning(t('reportingWorks.selectProcessCardData')) |
| | | // return; |
| | | // } |
| | | |
| | | let projectData = ref({ |
| | | projectdetail: selectRecords, |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | watch(optionVal, (newVal, oldVal) => { |
| | | if (newVal) { |
| | | // 当膜系改变时,更新工程名称为当前膜系值 |
| | | projectNmae.value = newVal; |
| | | |
| | | // 当膜系改变时,自动刷新数据 |
| | | selectFlowCardList(); |
| | | } |
| | | }, { flush: 'post' }); |
| | | |
| | | const handleRowClassName = ({ row, rowIndex }) => { |
| | | if (row.patch_state === 1) { |
| | | return 'high-score'; |
| | |
| | | </template> |
| | | |
| | | <template #toolbar_buttons> |
| | | <h1>膜系筛选:</h1> |
| | | <h2>膜系筛选:</h2> |
| | | <el-select v-model="optionVal" clearable default-value="default_city" placeholder="选择膜系" |
| | | style="width: 120px"> |
| | | <el-option |