From af1c9e588f1de0240390648f9bb56aa486870aff Mon Sep 17 00:00:00 2001 From: chengxiangling <291105840@qq.com> Date: 星期五, 16 五月 2025 17:40:18 +0800 Subject: [PATCH] 提交高度修改; --- src/views/basicData/processRouteDataPreparate/index.vue | 418 ++++++++++++++++++++++++++++++++++++----------------------- 1 files changed, 256 insertions(+), 162 deletions(-) diff --git a/src/views/basicData/processRouteDataPreparate/index.vue b/src/views/basicData/processRouteDataPreparate/index.vue index f30c099..f05d3f8 100644 --- a/src/views/basicData/processRouteDataPreparate/index.vue +++ b/src/views/basicData/processRouteDataPreparate/index.vue @@ -1,64 +1,90 @@ <template> <div class="app-container"> - <el-row :gutter="20"> - <el-form - :model="queryParams" - ref="queryRef" - :rules="rules" - :inline="true" - v-show="showSearch" - :label-width="locale === 'zh' ? '90px' : '120px'" - > - <el-row :gutter="20"> - <el-col :span="6"> - <el-form-item :label="$t('plan.query.itemNumber')" prop="itemCode"> - <el-input - style="width: 240px" - v-model="queryParams.itemCode" - :placeholder="`${$t('common.common.placeholder')}${$t( - 'plan.query.itemNumber' - )}`" - clearable - @keyup.enter="handleQuery" - /> - </el-form-item> - </el-col> - <el-col :span="18" style="text-align: right"> - <el-form-item> - <el-button type="primary" icon="Search" @click="handleQuery">{{ - $t("common.common.query") - }}</el-button> - <el-button icon="Refresh" @click="resetQuery">{{ - $t("common.common.reset") - }}</el-button> - </el-form-item> - </el-col> - </el-row> - </el-form> - </el-row> + <el-form + :model="queryParams" + ref="queryRef" + :rules="rules" + :inline="true" + v-show="showSearch" + label-position="left" + > + <el-row type="flex" justify="left" :gutter="20"> + <el-col :span="locale === 'zh' ? 5 : 8"> + <el-form-item :label="$t('plan.query.itemNumber')" :label-width="locale === 'zh' ? '50px' : '110px'" prop="itemCode"> + <el-input + :style="{ width: locale === 'zh' ? '140px' : '220px' }" + v-model="queryParams.itemCode" + :placeholder="`${$t('common.common.placeholder')}${$t( + 'plan.query.itemNumber' + )}`" + clearable + @keyup.enter="handleQuery" + /> + </el-form-item> + </el-col> + <el-col :span="locale === 'zh' ? 7 : 10"> + <el-form-item + :label="$t('plan.table.applicableFactories')" + :label-width="locale === 'zh' ? '70px' : '150px'" + prop="orgCode" + > + <el-select + clearable + v-model="queryParams.orgCode" + :style="{ width: locale === 'zh' ? '180px' : '280px' }" + :placeholder="`${$t('common.common.placeholder')}${$t( + 'plan.table.applicableFactories' + )}`" + > + <el-option + v-for="plant in plantList" + :key="plant.id" + :label="plant.plantName" + :value="plant.plantCode" + > + </el-option> + </el-select> + </el-form-item> + </el-col> + <!-- <el-col :span="locale === 'zh' ? 11 : 6" style="text-align: right"> + <el-form-item class="column-with-margin"> + <el-button type="primary" icon="Search" @click="handleQuery">{{ + $t("common.common.query") + }}</el-button> + <el-button icon="Refresh" @click="resetQuery">{{ + $t("common.common.reset") + }}</el-button> + </el-form-item> + </el-col> --> + </el-row> + </el-form> <el-row :gutter="10" class="mb8"> <el-col :span="1.5"> <el-button type="success" plain icon="Refresh" + :disabled="loadingRefresh" @click="handleRefresh" - v-hasPermi="['apsPartRouteStat:edit']" + v-hasPermi="['Aps:ApsStandardProcessRouteHeader:refreshProcessRouteData']" >{{ $t("common.common.update") }}</el-button > </el-col> <right-toolbar v-model:showSearch="showSearch" - @queryTable="getList" + @queryTable="handleQuery" + @resetTable="resetQuery" ></right-toolbar> </el-row> <HxlhTable style="width: 100%" :columns="columns" - :data="planList" + :data="processRouteList" :loading="loading" :height="height" + :virtualYConfig="virtualYConfig" + :showOverflow="true" @on-checkbox="handleCheckboxChange" :page="page" @changePageNo="changePageNo" @@ -71,68 +97,75 @@ type="primary" link @click="handleCheckView(row)" - v-hasPermi="['aps:calendar:update']" - >鏌ョ湅</el-button + v-hasPermi="['Aps:ApsStandardProcessRouteLine:list']" + >{{ $t("common.common.view") }}</el-button > </template> </HxlhTable> - <el-dialog :title="title" v-model="openDialog" width="900px" append-to-body> + <el-dialog + :title="$t('common.common.viewDetails')" + v-model="openDialog" + width="900px" + style="height: 400px; overflow: hidden" + append-to-body + > <HxlhTable style="width: 100%" :columns="subGridOptions" :data="subList" :loading="loading" - :height="heightSub" - @on-checkbox="handleCheckboxChange" - :page="page" - @changePageNo="changePageNo" - @changePageSize="changePageSize" + :height="'280px;'" > </HxlhTable> + <template #footer> + <span class="dialog-footer"> + <el-button @click="openDialog = false">{{ + $t("common.common.close") + }}</el-button> + </span> + </template> </el-dialog> </div> </template> -<script setup name="ApsPlatePlan"> +<script setup name="ProcessRouteDataPreparate"> +import { listAll_plant } from "@/api/basicData/plant"; import { - listPlan, - examplePlan, - confirmPart, -} from "@/api/mainPlan/apsPlatePlan.js"; -import { listProcessRoute } from "@/api/basicData/processRoute.js"; + apsStandardProcessRouteHeaderList, + apsStandardProcessRouteLineList, + apsRefreshProcessRouteDataList +} from "@/api/basicData/processRoute.js"; +import { listAll_shop } from "@/api/basicData/shop"; import HxlhTable from "@/components/HxlhTable/index.vue"; import { ref } from "vue"; import { getToken } from "@/utils/auth.js"; -import { ElMessage } from "element-plus"; +// import { ElMessage } from "element-plus"; import { useI18n } from "vue-i18n"; //瑕佸湪js涓娇鐢ㄥ浗闄呭寲 const { t, locale } = useI18n(); const { proxy } = getCurrentInstance(); +const virtualYConfig = { + enabled: true, + gt: 0, + threshold: 50, +}; // 鍒嗛〉灞炴�� const page = ref({ total: 0, current: 1, size: 10, }); -const { - aps_is_suspended, - aps_document_status, - aps_account, - aps_business_type, -} = proxy.useDict( - "aps_is_suspended", - "aps_document_status", - "aps_account", - "aps_business_type" -); - -const planList = ref([]); +const plantList = ref([]); +const shopList = ref([]); +const processRouteList = ref([]); +const subGridOptions = ref([]); const subList = ref([]); -const loading = ref(true); +const loading = ref(false); +const loadingRefresh = ref(false); const showSearch = ref(true); const single = ref(true); const total = ref(0); -const height = ref(document.documentElement.clientHeight - 270 + "px;"); +const height = ref(document.documentElement.clientHeight - 220 + "px;"); const heightSub = ref(document.documentElement.clientHeight - 320 + "px;"); // 琛ㄦ牸閰嶇疆 const columns = ref([]); @@ -142,20 +175,10 @@ queryParams: { pageNum: 1, pageSize: 10, - customer: null, - documentNumber: null, itemCode: null, }, rules: { - itemCode: [ - { - required: true, - message: `${t("common.common.placeholder")}${t( - "plan.query.itemNumber" - )}`, - trigger: "blur", - }, - ], + itemCode: [], }, }); @@ -163,6 +186,17 @@ watch( locale, (newLocale) => { + rules.value = { + itemCode: [ + { + required: true, + message: `${t("common.common.placeholder")}${t( + "plan.query.itemNumber" + )}`, + trigger: "blur", + }, + ], + }; columns.value = [ // { // field: "expand", @@ -173,44 +207,148 @@ // }, // { type: "checkbox", width: 60, align: "center" }, { - title: t("basic.table.processRouteVersion"), - field: "mainPartNumber", + title: t("basic.table.processRouteID"), + field: "routeId", }, { title: t("basic.table.processRouteVersion"), - field: "businessType", + field: "version", }, { title: t("plan.table.itemNumber"), - field: "documentNumber", + field: "itemCode", }, { title: t("basic.table.effectiveDate"), - field: "requirementType", + field: "startDate", }, { title: t("basic.table.expiringDate"), - field: "documentStatus", + field: "endDate", }, { title: t("basic.table.integrationDate"), - field: "itemNumber", + field: "createTime", }, { title: t("basic.table.applicableFactories"), - field: "drawingNo", + field: "orgCode", + formatter: ({ cellValue, row, column }) => { + if (cellValue) { + for (let i = 0; i < plantList.value.length; i++) { + if (cellValue === plantList.value[i].plantCode) { + return plantList.value[i].plantName; + } + } + } + }, }, { - title: "鎿嶄綔", + title: t("common.common.operate"), width: 100, fixed: "right", slots: { default: "buttons" }, align: "center", }, ]; + subGridOptions.value = [ + { + title: t("basic.table.processRouteID"), + field: "routeId", + width: 150, + align: "center", + }, + { + title: t("basic.table.operationSequence"), + field: "routeNum", + width: 150, + align: "center", + }, + { + title: t("plan.table.processName"), + field: "routeName", + width: 150, + align: "center", + }, + { + title: t("basic.table.effectiveDate"), + field: "startDate", + width: 230, + align: "center", + }, + { + title: t("basic.table.expiringDate"), + field: "endDate", + width: 230, + align: "center", + }, + { + title: t("basic.table.integrationDate"), + field: "createTime", + width: 230, + align: "center", + }, + { + title: t("basic.table.applicableFactories"), + field: "orgCode", + width: 90, + align: "center", + formatter: ({ cellValue, row, column }) => { + if (cellValue) { + for (let i = 0; i < plantList.value.length; i++) { + if (cellValue === plantList.value[i].plantCode) { + return plantList.value[i].plantName; + } + } + } + }, + }, + { + title: t("basic.table.applicableWorkshop"), + field: "shopCode", + width: 90, + align: "center", + formatter: ({ cellValue, row, column }) => { + if (cellValue) { + for (let i = 0; i < shopList.value.length; i++) { + if (cellValue === shopList.value[i].id) { + return shopList.value[i].shopName; + } + } + } + return ""; + }, + }, + { + title: t("basic.table.productivityModel"), + field: "productivityModel", + width: 160, + align: "center", + }, + { + title: t("basic.table.designCapacity"), + field: "designCapacity", + width: 160, + align: "center", + }, + ]; }, { immediate: true, deep: true } ); +async function handleRefresh() { + loadingRefresh.value = true; + const res = await apsRefreshProcessRouteDataList(); + if (res.code == 200) { + ElMessage({ + message: t("plan.message.update"), + type: "success", + }); + loadingRefresh.value = false; + getList(); + } else { + loadingRefresh.value = false; + } +} function changePageNo(currentPage) { queryParams.value.pageNum = currentPage; page.value.current = currentPage; @@ -227,10 +365,15 @@ function getList() { loading.value = true; queryParams.value.params = {}; - listPlan(queryParams.value).then((response) => { - planList.value = response.rows; - loading.value = false; - }); + apsStandardProcessRouteHeaderList(queryParams.value) + .then((response) => { + processRouteList.value = response.rows; + page.value.total = response.total; + loading.value = false; + }) + .catch(() => { + loading.value = false; + }); } /** 鎼滅储鎸夐挳鎿嶄綔 */ @@ -244,82 +387,24 @@ /** 閲嶇疆鎸夐挳鎿嶄綔 */ function resetQuery() { + page.value.current = 1; + page.value.total = 0; + queryParams.value.pageNum = 1; proxy.resetForm("queryRef"); - handleQuery(); + processRouteList.value = []; + subList.value = []; } function handleCheckView(row) { openDialog.value = true; - listProcessRoute({ workOrderNo: row.documentNumber }).then( - (data) => { - subList.value = data.rows; - }) + apsStandardProcessRouteLineList({ + routeId: row.routeId, + }).then((data) => { + subList.value = data.rows; + }); } // /*瀹氫箟涓嬫媺浜岀骇琛�*/ - -const subGridOptions = ref([ - { - title: "宸ヨ壓璺嚎ID", - field: "itemNo", - width: 150, - align: "center", - }, - { - title: "宸ュ簭搴忓彿", - field: "workOrderNo", - width: 150, - align: "center", - }, - { - title: "宸ュ簭鍚嶇О", - field: "processNumber", - width: 100, - align: "center", - }, - { - title: "鐢熸晥鏃ユ湡", - field: "processName", - width: 150, - align: "center", - }, - { - title: "澶辨晥鏃ユ湡", - field: "processPlanStartDay", - width: 200, - align: "center", - }, - { - title: "闆嗘垚鏃ユ湡", - field: "processPlanEndDay", - width: 200, - align: "center", - }, - { - title: "閫傜敤宸ュ巶", - field: "standardTime", - width: 90, - align: "center", - }, - { - title: "閫傜敤杞﹂棿", - field: "processOrder", - width: 90, - align: "center", - }, - { - title: "浜ц兘妯″瀷", - field: "integrationDay", - width: 160, - align: "center", - }, - { - title: "璁捐浜ц兘", - field: "integrationDay", - width: 160, - align: "center", - }, - ]) // const expandConfig = ref({ // lazy: true, // loadMethod({ row }) { @@ -332,10 +417,19 @@ // }, // }); -getList(); +// getList(); +onMounted(async () => { + const res = await listAll_plant({}); + plantList.value = res.data; + const shopres = await listAll_shop({}); + shopList.value = shopres.data; +}); </script> <style lang="css" scoped> h4 { font-weight: bold; } +.column-with-margin { + margin-right: 0px; +} </style> -- Gitblit v1.9.3