From 4079d1c5a3efb6b31879d9f80dd067cc01b11e91 Mon Sep 17 00:00:00 2001 From: CD配唱片 <CD配唱片> Date: 星期三, 07 五月 2025 11:28:02 +0800 Subject: [PATCH] 对接bom静态页及联调接口 --- src/views/basicData/processRouteDataPreparate/index.vue | 525 +++++++++++++-------------------------------------------- 1 files changed, 121 insertions(+), 404 deletions(-) diff --git a/src/views/basicData/processRouteDataPreparate/index.vue b/src/views/basicData/processRouteDataPreparate/index.vue index 61cebba..f30c099 100644 --- a/src/views/basicData/processRouteDataPreparate/index.vue +++ b/src/views/basicData/processRouteDataPreparate/index.vue @@ -15,9 +15,9 @@ <el-input style="width: 240px" v-model="queryParams.itemCode" - :placeholder="`${$t('common.common.placeholder')}${$t( - 'plan.query.itemNumber' - )}`" + :placeholder="`${$t('common.common.placeholder')}${$t( + 'plan.query.itemNumber' + )}`" clearable @keyup.enter="handleQuery" /> @@ -25,14 +25,12 @@ </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 type="primary" icon="Search" @click="handleQuery">{{ + $t("common.common.query") + }}</el-button> <el-button icon="Refresh" @click="resetQuery">{{ - $t("common.common.reset") - }}</el-button> + $t("common.common.reset") + }}</el-button> </el-form-item> </el-col> </el-row> @@ -46,7 +44,7 @@ icon="Refresh" @click="handleRefresh" v-hasPermi="['apsPartRouteStat:edit']" - >{{$t("common.common.update")}}</el-button + >{{ $t("common.common.update") }}</el-button > </el-col> <right-toolbar @@ -65,10 +63,33 @@ :page="page" @changePageNo="changePageNo" @changePageSize="changePageSize" - :expand-config="expandConfig" - :subGridOptions="subGridOptions" > + <!-- :expand-config="expandConfig" + :subGridOptions="subGridOptions" --> + <template #buttons="{ row }"> + <el-button + type="primary" + link + @click="handleCheckView(row)" + v-hasPermi="['aps:calendar:update']" + >鏌ョ湅</el-button + > + </template> </HxlhTable> + <el-dialog :title="title" v-model="openDialog" width="900px" append-to-body> + <HxlhTable + style="width: 100%" + :columns="subGridOptions" + :data="subList" + :loading="loading" + :height="heightSub" + @on-checkbox="handleCheckboxChange" + :page="page" + @changePageNo="changePageNo" + @changePageSize="changePageSize" + > + </HxlhTable> + </el-dialog> </div> </template> @@ -83,13 +104,14 @@ import { ref } from "vue"; import { getToken } from "@/utils/auth.js"; import { ElMessage } from "element-plus"; - +import { useI18n } from "vue-i18n"; //瑕佸湪js涓娇鐢ㄥ浗闄呭寲 +const { t, locale } = useI18n(); const { proxy } = getCurrentInstance(); // 鍒嗛〉灞炴�� const page = ref({ total: 0, current: 1, - size: 10 + size: 10, }); const { aps_is_suspended, @@ -103,264 +125,18 @@ "aps_business_type" ); -const exampleList = ref([]); const planList = ref([]); +const subList = ref([]); const loading = ref(true); const showSearch = ref(true); const single = ref(true); const total = ref(0); -const daterangePlanStartDay = ref([]); -const daterangePlanEndDay = ref([]); const height = ref(document.documentElement.clientHeight - 270 + "px;"); -const isVisible = ref(false); -const isError = ref(false); -const planned = ref(true); -const batchNumber = ref(null); -const exampleHeight = ref("500px"); -const uploadRef = ref(); - -/*** 鐢ㄦ埛瀵煎叆鍙傛暟 */ -const upload = reactive({ - // 鏄惁鏄剧ず寮瑰嚭灞傦紙鐢ㄦ埛瀵煎叆锛� - open: false, - // 寮瑰嚭灞傛爣棰橈紙鐢ㄦ埛瀵煎叆锛� - title: "", - // 鏄惁绂佺敤涓婁紶 - isUploading: false, - // 鏄惁鏇存柊宸茬粡瀛樺湪鐨勭敤鎴锋暟鎹� - updateSupport: 0, - // 璁剧疆涓婁紶鐨勮姹傚ご閮� - headers: { Authorization: "Bearer " + getToken(), local: "zhl" }, - // 涓婁紶鐨勫湴鍧� - url: import.meta.env.VITE_APP_BASE_API + "/aps/apsPlatePlan/importData", -}); - +const heightSub = ref(document.documentElement.clientHeight - 320 + "px;"); // 琛ㄦ牸閰嶇疆 -const exampleColumns = ref([ - { type: "seq", title: "搴忓彿", width: 60 }, - { - title: "涓昏鍒掑憳", - field: "masterPlanner", - width: 100, - }, - { - title: "鍛ㄦ棩", - field: "weekDay", - width: 100, - formatter: ({ cellValue, row, column }) => { - if (cellValue) { - const weekDay = new Date(cellValue); - const year = weekDay.getFullYear(); - const month = String(weekDay.getMonth() + 1).padStart(2, "0"); - const day = String(weekDay.getDate()).padStart(2, "0"); - return `${month}-${day}`; - } - return ""; - }, - }, - { - title: "鍛ㄥ害", - field: "weekCycle", - width: 80, - }, - { - title: "涓讳欢鏂欏彿", - field: "mainPartNumber", - width: 150, - }, - { - title: "涓讳欢鍥惧彿", - field: "mainPartDrawingNumber", - width: 150, - }, - { - title: "瀹㈡埛鍚嶇О", - field: "customer", - width: 200, - }, - { - title: "涓氬姟绫诲瀷", - field: "businessType", - width: 150, - }, - { - title: "鍗曟嵁鍙�", - field: "documentNumber", - width: 150, - }, - { - title: "闇�姹傚垎绫�", - field: "requirementType", - width: 150, - }, - { - title: "鍗曟嵁鐘舵��", - field: "documentStatus", - width: 100, - }, - { - title: "鏂欏彿", - field: "itemNumber", - width: 150, - }, - { - title: "鍥惧彿", - field: "drawingNo", - width: 150, - }, - { - title: "鐗堟湰鍙�", - field: "versionNumber", - width: 100, - }, - { - title: "鐢熶骇鏁伴噺", - field: "productionQuantity", - width: 100, - }, - { - title: "鑹搧鏁伴噺", - field: "goodProductsQuantity", - width: 100, - }, - { - title: "宸ュ簭鍙�", - field: "processNumber", - width: 150, - }, - { - title: "宸ヤ綔涓績", - field: "workCenter", - width: 150, - }, - { - title: "鎵�灞為儴闂�", - field: "department", - width: 100, - }, - { - title: "璁″垝寮�宸ユ棩", - field: "planStartDay", - width: 100, - }, - { - title: "璁″垝瀹屽伐鏃�", - field: "planEndDay", - width: 100, - }, - { - title: "澶囨枡鏂欏彿", - field: "standbyNumber", - width: 100, - }, - { - title: "澶囨枡鍚嶇О", - field: "standbyName", - width: 200, - }, - { - title: "澶囨枡搴撳瓨", - field: "standbyStock", - width: 100, - }, - { - title: "涓嬮亾宸ュ簭鎵�灞為儴闂�", - field: "nextProcessDeparment", - width: 180, - }, - { - title: "鏄惁鎸傝捣", - field: "isSuspended", - width: 100, - }, - { - title: "澶栧崗鏍囪瘑", - field: "isOutsourcing", - width: 100, - }, - { - title: "璐﹀", - field: "account", - width: 100, - }, - // { - // title: '涓婇樁鐗╂枡', - // field: 'advancedMaterials', - // width: 100, - // }, - // { - // title: '涓婇樁鍗曟嵁鍙�', - // field: 'advancedDocumentNumber', - // width: 100, - // }, - // { - // title: '涓婇樁闇�姹傛棩鏈�', - // field: 'advancedRequirementDay', - // width: 150, - // }, - // { - // title: '璁″垝榻愬', - // field: 'isPlanComplete', - // width: 100, - // }, - // { - // title: '搴撳瓨榻愬', - // field: 'isStockComplete', - // width: 100, - // }, - // { - // title: '鏄惁鏈夋姌杩斿伐搴�', - // field: 'hasTurnback', - // width: 150, - // }, - // { - // title: '椋庨櫓鏍囪瘑', - // field: 'hasRisk', - // width: 100, - // }, -]); - -// 琛ㄦ牸閰嶇疆 -const columns = ref([ - { - field: "expand", - type: "expand", - width: 60, - align: "center", - slots: { content: "expandContent" }, - }, - { type: "checkbox", width: 60, align: "center" }, - { - title: "宸ヨ壓璺嚎ID", - field: "mainPartNumber", - }, - { - title: "宸ヨ壓璺嚎鐗堟湰", - field: "businessType", - }, - { - title: "鏂欏彿", - field: "documentNumber", - }, - { - title: "鐢熸晥鏃ユ湡", - field: "requirementType", - }, - { - title: "澶辨晥鏃ユ湡", - field: "documentStatus", - }, - { - title: "闆嗘垚鏃ユ湡", - field: "itemNumber", - }, - { - title: "閫傜敤宸ュ巶", - field: "drawingNo", - }, -]); - +const columns = ref([]); +const openDialog = ref(false); const data = reactive({ form: {}, queryParams: { @@ -371,11 +147,70 @@ itemCode: null, }, rules: { - itemCode: [{ required: true, message: "璇疯緭鍏ユ枡鍙�", trigger: "blur" }], + itemCode: [ + { + required: true, + message: `${t("common.common.placeholder")}${t( + "plan.query.itemNumber" + )}`, + trigger: "blur", + }, + ], }, }); const { queryParams, form, rules } = toRefs(data); +watch( + locale, + (newLocale) => { + columns.value = [ + // { + // field: "expand", + // type: "expand", + // width: 60, + // align: "center", + // slots: { content: "expandContent" }, + // }, + // { type: "checkbox", width: 60, align: "center" }, + { + title: t("basic.table.processRouteVersion"), + field: "mainPartNumber", + }, + { + title: t("basic.table.processRouteVersion"), + field: "businessType", + }, + { + title: t("plan.table.itemNumber"), + field: "documentNumber", + }, + { + title: t("basic.table.effectiveDate"), + field: "requirementType", + }, + { + title: t("basic.table.expiringDate"), + field: "documentStatus", + }, + { + title: t("basic.table.integrationDate"), + field: "itemNumber", + }, + { + title: t("basic.table.applicableFactories"), + field: "drawingNo", + }, + { + title: "鎿嶄綔", + width: 100, + fixed: "right", + slots: { default: "buttons" }, + align: "center", + }, + ]; + }, + { immediate: true, deep: true } +); function changePageNo(currentPage) { queryParams.value.pageNum = currentPage; page.value.current = currentPage; @@ -387,32 +222,11 @@ queryParams.value.pageSize = pageSize; getList(); } -/** 鏌ヨ閽i噾璁″垝涓存椂绠$悊鍒楄〃 */ -function getExampleList() { - loading.value = true; - queryParams.value = {}; - queryParams.value.batchNumber = batchNumber.value; - examplePlan(queryParams.value).then((response) => { - exampleList.value = response.rows; - total.value = response.total; - loading.value = false; - }); -} /** 鏌ヨ闆朵欢璁″垝绠$悊鍒楄〃 */ function getList() { loading.value = true; queryParams.value.params = {}; - if (null != daterangePlanStartDay && "" !== daterangePlanStartDay) { - queryParams.value.params["beginPlanStartDay"] = - daterangePlanStartDay.value[0]; - queryParams.value.params["endPlanStartDay"] = - daterangePlanStartDay.value[1]; - } - if (null != daterangePlanEndDay && "" !== daterangePlanEndDay) { - queryParams.value.params["beginPlanEndDay"] = daterangePlanEndDay.value[0]; - queryParams.value.params["endPlanEndDay"] = daterangePlanEndDay.value[1]; - } listPlan(queryParams.value).then((response) => { planList.value = response.rows; loading.value = false; @@ -430,117 +244,21 @@ /** 閲嶇疆鎸夐挳鎿嶄綔 */ function resetQuery() { - daterangePlanStartDay.value = []; - daterangePlanEndDay.value = []; proxy.resetForm("queryRef"); handleQuery(); } -// 澶氶�夋閫変腑鏁版嵁 -const handleCheckboxChange = (data) => { - console.log(data); -}; - -/** 鎵归噺淇敼璁″垝寮�宸ユ棩鎸夐挳鎿嶄綔 */ -function plannedStart() {} - -/** 鎵归噺淇敼璁″垝瀹屽伐鏃ユ寜閽搷浣� */ -function plannedEnd() {} - -/** 瀵煎叆鎸夐挳鎿嶄綔 */ -function handleImport() { - upload.title = "閽i噾璁″垝鏁版嵁涓婁紶"; - upload.open = true; +function handleCheckView(row) { + openDialog.value = true; + listProcessRoute({ workOrderNo: row.documentNumber }).then( + (data) => { + subList.value = data.rows; + }) } -/** 瀵煎嚭鎸夐挳鎿嶄綔 */ -function handleExport() { - proxy.download( - "aps/apsPlatePlan/export", - { - ...queryParams.value, - }, - `plan_${new Date().getTime()}.xlsx` - ); -} +// /*瀹氫箟涓嬫媺浜岀骇琛�*/ -/** 涓嬭浇妯℃澘鎿嶄綔 */ -function importTemplate() { - proxy.download( - "system/user/importTemplate", - {}, - `user_template_${new Date().getTime()}.xlsx` - ); -} - -/** buildEexample */ -function buildEexample() { - proxy.$refs["uploadRef"].submit(); -} - -/**鏂囦欢涓婁紶涓鐞� */ -const handleFileUploadProgress = (event, file, fileList) => { - upload.isUploading = true; -}; - -/** 鏂囦欢涓婁紶鎴愬姛澶勭悊 */ -const handleFileSuccess = (response, file, fileList) => { - if (response.code == "200") { - batchNumber.value = response.data; - isVisible.value = true; - planned.value = false; - isError.value = false; - getExampleList(); - } else { - isError.value = true; - proxy.$alert( - "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + - response.msg + - "</div>", - "瀵煎叆缁撴灉", - { dangerouslyUseHTMLString: true } - ); - } - proxy.$refs["uploadRef"].handleRemove(file); - upload.isUploading = false; -}; - -/** 涓婁紶骞惰В鏋愭寜閽搷浣� */ -function uploadParse() { - queryParams.value.params = {}; - queryParams.value.params["batchNumber"] = batchNumber.value; - confirmPart(queryParams.value).then((response) => { - exampleList.value = response.rows; - loading.value = false; - isVisible.value = false; - isError.value = false; - planned.value = true; - upload.open = false; - ElMessage({ - message: "姘斾綋绠¤矾璁″垝鏁版嵁宸叉垚鍔熶笂浼犲拰瑙f瀽", - type: "success", - }); - getList(); - }); -} - -/** dialog鍙栨秷 */ -function dialogCancel() { - if (uploadRef.value) { - uploadRef.value.clearFiles(); - } - isVisible.value = false; - isError.value = false; - planned.value = true; - upload.open = false; - upload.isUploading = false; -} -/*瀹氫箟涓嬫媺浜岀骇琛�*/ - -const subGridOptions = reactive({ - border: true, - showOverflow: true, - columns: [ +const subGridOptions = ref([ { title: "宸ヨ壓璺嚎ID", field: "itemNo", @@ -601,19 +319,18 @@ width: 160, align: "center", }, - ], -}); -const expandConfig = ref({ - lazy: true, - loadMethod({ row }) { - // 璋冪敤鎺ュ彛 - return listProcessRoute({ workOrderNo: row.documentNumber }).then( - (data) => { - row.subList = data.rows; - } - ); - }, -}); + ]) +// const expandConfig = ref({ +// lazy: true, +// loadMethod({ row }) { +// // 璋冪敤鎺ュ彛 +// return listProcessRoute({ workOrderNo: row.documentNumber }).then( +// (data) => { +// row.subList = data.rows; +// } +// ); +// }, +// }); getList(); </script> -- Gitblit v1.9.3