From e3e17a37d85f50bace525ed019ee0cd8d39143eb Mon Sep 17 00:00:00 2001 From: CD配唱片 <CD配唱片> Date: 星期四, 08 五月 2025 18:19:23 +0800 Subject: [PATCH] 钣金工单计划管理 --- src/views/basicData/processRouteDataPreparate/index.vue | 780 ++++++++++++++++++++++------------------------------------- 1 files changed, 288 insertions(+), 492 deletions(-) diff --git a/src/views/basicData/processRouteDataPreparate/index.vue b/src/views/basicData/processRouteDataPreparate/index.vue index ba13333..c25fe34 100644 --- a/src/views/basicData/processRouteDataPreparate/index.vue +++ b/src/views/basicData/processRouteDataPreparate/index.vue @@ -7,26 +7,53 @@ :rules="rules" :inline="true" v-show="showSearch" - label-width="68px" + :label-width="locale === 'zh' ? '90px' : '160px'" > <el-row :gutter="20"> - <el-col :span="6"> - <el-form-item label="鏂欏彿" prop="itemCode"> + <el-col :span="9"> + <el-form-item :label="$t('plan.query.itemNumber')" prop="itemCode"> <el-input style="width: 240px" v-model="queryParams.itemCode" - placeholder="璇疯緭鍏ユ枡鍙�" + :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" - >鏌ヨ</el-button + <el-col :span="9"> + <el-form-item + :label="$t('plan.table.applicableFactories')" + prop="orgCode" + > + <el-select + clearable + v-model="queryParams.orgCode" + :style="{ width: locale == 'zh' ? '160px' : '250px' }" + :placeholder="`${$t('common.common.placeholder')}${$t( + 'plan.table.applicableFactories' + )}`" > - <el-button icon="Refresh" @click="resetQuery">閲嶇疆</el-button> + <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="6" 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> @@ -40,7 +67,7 @@ icon="Refresh" @click="handleRefresh" v-hasPermi="['apsPartRouteStat:edit']" - >鏇存柊</el-button + >{{ $t("common.common.update") }}</el-button > </el-col> <right-toolbar @@ -52,324 +79,258 @@ <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" @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']" + >{{ $t("common.common.view") }}</el-button + > + </template> </HxlhTable> + <el-dialog + :title="$t('common.common.viewDetails')" + v-model="openDialog" + width="900px" + append-to-body + > + <HxlhTable + style="width: 100%" + :columns="subGridOptions" + :data="subList" + :loading="loading" + :height="heightSub" + > + </HxlhTable> + <template #footer> + <span class="dialog-footer"> + <el-button @click="openDialog = false">{{ + $t("common.common.cancel") + }}</el-button> + </span> + </template> + </el-dialog> </div> </template> <script setup name="ApsPlatePlan"> +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, +} 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 + 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 exampleList = ref([]); -const planList = ref([]); -const loading = ref(true); +const plantList = ref([]); +const shopList = ref([]); +const processRouteList = ref([]); +const subGridOptions = ref([]); +const subList = ref([]); +const loading = ref(false); 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 height = ref(document.documentElement.clientHeight - 210 + "px;"); +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: { pageNum: 1, pageSize: 10, - customer: null, - documentNumber: null, itemCode: null, }, rules: { - itemCode: [{ required: true, message: "璇疯緭鍏ユ枡鍙�", trigger: "blur" }], + itemCode: [], }, }); const { queryParams, form, rules } = toRefs(data); +watch( + locale, + (newLocale) => { + rules.value = { + itemCode: [ + { + required: true, + message: `${t("common.common.placeholder")}${t( + "plan.query.itemNumber" + )}`, + trigger: "blur", + }, + ], + }; + columns.value = [ + // { + // field: "expand", + // type: "expand", + // width: 60, + // align: "center", + // slots: { content: "expandContent" }, + // }, + // { type: "checkbox", width: 60, align: "center" }, + { + title: t("basic.table.processRouteID"), + field: "routeId", + }, + { + title: t("basic.table.processRouteVersion"), + field: "version", + }, + { + title: t("plan.table.itemNumber"), + field: "itemCode", + }, + { + title: t("basic.table.effectiveDate"), + field: "startDate", + }, + { + title: t("basic.table.expiringDate"), + field: "endDate", + }, + { + title: t("basic.table.integrationDate"), + field: "createTime", + }, + { + title: t("basic.table.applicableFactories"), + 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: "鎿嶄綔", + 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: 200, + align: "center", + }, + { + title: t("basic.table.expiringDate"), + field: "endDate", + width: 200, + align: "center", + }, + { + title: t("basic.table.integrationDate"), + field: "createTime", + width: 200, + 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 } +); function changePageNo(currentPage) { queryParams.value.pageNum = currentPage; page.value.current = currentPage; @@ -381,36 +342,20 @@ 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; - }); + apsStandardProcessRouteHeaderList(queryParams.value) + .then((response) => { + processRouteList.value = response.rows; + page.value.total = response.total; + loading.value = false; + }) + .catch(() => { + loading.value = false; + }); } /** 鎼滅储鎸夐挳鎿嶄綔 */ @@ -424,192 +369,43 @@ /** 閲嶇疆鎸夐挳鎿嶄綔 */ function resetQuery() { - daterangePlanStartDay.value = []; - daterangePlanEndDay.value = []; + page.value.current = 1; + page.value.total = 0; + queryParams.value.pageNum = 1; proxy.resetForm("queryRef"); - handleQuery(); + processRouteList.value = []; + subList.value = []; } -// 澶氶�夋閫変腑鏁版嵁 -const handleCheckboxChange = (data) => { - console.log(data); -}; - -/** 鎵归噺淇敼璁″垝寮�宸ユ棩鎸夐挳鎿嶄綔 */ -function plannedStart() {} - -/** 鎵归噺淇敼璁″垝瀹屽伐鏃ユ寜閽搷浣� */ -function plannedEnd() {} - -/** 瀵煎叆鎸夐挳鎿嶄綔 */ -function handleImport() { - upload.title = "閽i噾璁″垝鏁版嵁涓婁紶"; - upload.open = true; -} - -/** 瀵煎嚭鎸夐挳鎿嶄綔 */ -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(); +function handleCheckView(row) { + openDialog.value = true; + apsStandardProcessRouteLineList({ + routeId: row.routeId, + }).then((data) => { + subList.value = data.rows; }); } -/** 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 expandConfig = ref({ +// lazy: true, +// loadMethod({ row }) { +// // 璋冪敤鎺ュ彛 +// return listProcessRoute({ workOrderNo: row.documentNumber }).then( +// (data) => { +// row.subList = data.rows; +// } +// ); +// }, +// }); -const subGridOptions = reactive({ - border: true, - showOverflow: true, - columns: [ - { - 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", - }, - ], +// getList(); +onMounted(async () => { + const res = await listAll_plant({}); + plantList.value = res.data; + const shopres = await listAll_shop({}); + shopList.value = shopres.data; }); -const expandConfig = ref({ - lazy: true, - loadMethod({ row }) { - // 璋冪敤鎺ュ彛 - return listProcessRoute({ workOrderNo: row.documentNumber }).then( - (data) => { - row.subList = data.rows; - } - ); - }, -}); - -getList(); </script> <style lang="css" scoped> h4 { -- Gitblit v1.9.3