From a07f90d6106971923e8f761f253a9b4d30a60752 Mon Sep 17 00:00:00 2001 From: CD配唱片 <CD配唱片> Date: 星期二, 06 五月 2025 15:37:30 +0800 Subject: [PATCH] Merge branch 'feature-i18n' into dev --- src/views/mainPlan/platePlan/index.vue | 1414 +++++++++++++++++++++++++++++++++------------------------- 1 files changed, 796 insertions(+), 618 deletions(-) diff --git a/src/views/mainPlan/platePlan/index.vue b/src/views/mainPlan/platePlan/index.vue index 38fc61f..835b280 100644 --- a/src/views/mainPlan/platePlan/index.vue +++ b/src/views/mainPlan/platePlan/index.vue @@ -1,90 +1,111 @@ <template> <div class="app-container"> - <el-row :gutter="20"> <el-col> - <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="90px"> - <el-row :gutter="20"> - <el-col :span="6"> - <el-form-item label="璁″垝寮�宸ユ棩" style="width: 100%;"> + <el-row :gutter="10" class="mb8"> + <el-form + :model="queryParams" + ref="queryRef" + :inline="true" + v-show="showSearch" + :label-width="locale === 'zh' ? '90px' : '180px'" + label-position="left" + > + <!-- <el-row :gutter="20"> + <el-col :span="6"> --> + <el-form-item :label="$t('plan.query.daterangePlanStartDay')"> <el-date-picker - v-model="daterangePlanStartDay" - value-format="YYYY-MM-DD" - type="daterange" - range-separator="-" - start-placeholder="寮�濮嬫棩鏈�" - end-placeholder="缁撴潫鏃ユ湡" + style="width: 240px" + v-model="daterangePlanStartDay" + value-format="YYYY-MM-DD" + type="daterange" + range-separator="-" + :start-placeholder="$t('plan.placeholder.startDate')" + :end-placeholder="$t('plan.placeholder.endDate')" ></el-date-picker> </el-form-item> - </el-col> - <el-col :span="6"> - <el-form-item label="璁″垝瀹屽伐鏃�" style="width: 100%;"> + <!-- </el-col> + <el-col :span="6"> --> + <el-form-item :label="$t('plan.query.daterangePlanEndDay')"> <el-date-picker - v-model="daterangePlanEndDay" - value-format="YYYY-MM-DD" - type="daterange" - range-separator="-" - start-placeholder="寮�濮嬫棩鏈�" - end-placeholder="缁撴潫鏃ユ湡" + style="width: 240px" + v-model="daterangePlanEndDay" + value-format="YYYY-MM-DD" + type="daterange" + range-separator="-" + :start-placeholder="$t('plan.placeholder.startDate')" + :end-placeholder="$t('plan.placeholder.endDate')" ></el-date-picker> </el-form-item> - </el-col> - <el-col :span="6"> - <el-form-item label="鍗曟嵁鍙�" prop="documentNumber" style="width: 100%;"> + <!-- </el-col> + <el-col :span="6"> --> + <el-form-item + :label="$t('plan.query.documentNumber')" + prop="documentNumber" + > <el-input - v-model="queryParams.documentNumber" - placeholder="璇疯緭鍏ュ崟鎹彿" - clearable - @keyup.enter="handleQuery" + style="width: 240px" + v-model="queryParams.documentNumber" + :placeholder="$t('plan.placeholder.documentNumber')" + clearable + @keyup.enter="handleQuery" /> </el-form-item> - </el-col> - <el-col :span="6"> - <el-form-item label="瀹㈡埛鍚嶇О" prop="customer" style="width: 100%;"> + <!-- </el-col> + <el-col :span="6"> --> + <el-form-item :label="$t('plan.query.customer')" prop="customer"> <el-input - v-model="queryParams.customer" - placeholder="璇疯緭鍏ュ鎴峰悕绉�" - clearable - @keyup.enter="handleQuery" + style="width: 240px" + v-model="queryParams.customer" + :placeholder="$t('plan.placeholder.customer')" + clearable + @keyup.enter="handleQuery" /> </el-form-item> - </el-col> - <el-col :span="24" style="text-align: right;"> + <!-- </el-col> + <el-col :span="24" style="text-align: right;"> --> <el-form-item> - <el-button type="primary" icon="Search" @click="handleQuery">鎼滅储</el-button> - <el-button icon="Refresh" @click="resetQuery">閲嶇疆</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> </el-form-item> - </el-col> - </el-row> + <!-- </el-col> --> + <!-- </el-row> --> </el-form> - </el-col> </el-row> + </el-row> <el-row :gutter="10" class="mb8"> <el-col :span="1.5"> <el-button - type="primary" - plain - icon="Plus" - :disabled="single" - @click="handleUpdate" - v-hasPermi="['apsPlatePlan:edit']" - >鎵归噺淇敼璁″垝寮�宸ユ棩</el-button> + type="primary" + plain + icon="Plus" + :disabled="single" + @click="handleUpdate" + v-hasPermi="['apsPlatePlan:edit']" + >{{ $t("plan.btns.batchPlanStartDay") }}</el-button + > </el-col> <el-col :span="1.5"> <el-button - type="success" - plain - icon="Edit" - :disabled="single" - @click="handleUpdate" - v-hasPermi="['apsPlatePlan:edit']" - >鎵归噺淇敼璁″垝瀹屽伐鏃�</el-button> + type="success" + plain + icon="Edit" + :disabled="single" + @click="handleUpdate" + v-hasPermi="['apsPlatePlan:edit']" + >{{ $t("plan.btns.batchPlanEndDay") }}</el-button + > </el-col> <el-col :span="1.5"> <el-button - type="info" - plain - icon="Upload" - @click="handleImport" - v-hasPermi="['apsPlatePlan:import']" - >瀵煎叆</el-button> + type="info" + plain + icon="Upload" + @click="handleImport" + v-hasPermi="['apsPlatePlan:import']" + >{{ $t("common.common.import") }}</el-button + > </el-col> <el-col :span="1.5"> <el-button @@ -93,122 +114,167 @@ icon="Download" @click="handleExport" v-hasPermi="['apsPlatePlan:export']" - >瀵煎嚭</el-button> + >{{ $t("common.common.export") }}</el-button + > </el-col> - <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> + <right-toolbar + v-model:showSearch="showSearch" + @queryTable="getList" + ></right-toolbar> </el-row> <HxlhTable - style="width: 100%" - :columns="columns" - :data="planList" - :loading="loading" - :height="height" - @on-checkbox="handleCheckboxChange" - :expand-config="expandConfig" - :subGridOptions="subGridOptions" + style="width: 100%" + :columns="columns" + :data="planList" + :loading="loading" + :height="height" + @on-checkbox="handleCheckboxChange" + :expand-config="expandConfig" + :subGridOptions="subGridOptions" > - </HxlhTable> <!-- 娣诲姞鎴栦慨鏀归挘閲戣鍒掔鐞嗗璇濇 --> - <el-dialog :title="upload.title" v-model="upload.open" width="90%" append-to-body @close="dialogCancel" > + <el-dialog + :title="upload.title" + v-model="upload.open" + width="90%" + append-to-body + @close="dialogCancel" + > <el-row :gutter="10"> <el-col> - <div style="border-bottom: 1px solid #ccc;" > - <p>涓婁紶Excel鏂囦欢锛屽寘鍚挘閲戣鍒掍俊鎭�傜郴缁熷皢瑙f瀽鏁版嵁骞朵繚瀛樺埌鏈湴锛岀敤浜庡叧鑱斿埌閽i噾璁″垝涓��</p> + <div style="border-bottom: 1px solid #ccc"> + <p>{{ $t("plan.upload.info") }}</p> </div> </el-col> - <el-col > + <el-col> <div></div> </el-col> </el-row> <el-row> <el-col> - <el-upload ref="uploadRef" - :limit="1" - accept=".xlsx, .xls" - :headers="upload.headers" - :action="upload.url + '?updateSupport=' + upload.updateSupport" - :disabled="upload.isUploading" - :on-progress="handleFileUploadProgress" - :on-success="handleFileSuccess" - :auto-upload="true" drag> - <el-icon class="el-icon--upload"><upload-filled /></el-icon> - <div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div> - <template #tip> - <div class="el-upload__tip"> - <span>浠呭厑璁稿鍏ls銆亁lsx鏍煎紡鏂囦欢銆�</span> - </div> - </template> + <el-upload + ref="uploadRef" + :limit="1" + accept=".xlsx, .xls" + :headers="upload.headers" + :action="upload.url + '?updateSupport=' + upload.updateSupport" + :disabled="upload.isUploading" + :on-progress="handleFileUploadProgress" + :on-success="handleFileSuccess" + :auto-upload="true" + drag + > + <el-icon class="el-icon--upload"><upload-filled /></el-icon> + <div class="el-upload__text"> + {{ $t("plan.upload.prevText") + }}<em>{{ $t("plan.upload.uploadText") }}</em> + </div> + <template #tip> + <div class="el-upload__tip"> + <span>{{ $t("plan.upload.fileTypeImport") }}</span> + </div> + </template> </el-upload> </el-col> </el-row> <el-row> - <el-col style="margin-top: 20px;"> + <el-col style="margin-top: 20px"> <div v-show="isVisible"> - <el-alert icon="Check" :show-icon="true" title="閽i噾璁″垝鏁版嵁宸叉垚鍔熻В鏋�" type="success" :closable="false"/> + <el-alert + icon="Check" + :show-icon="true" + :title="$t('plan.message.metalplanDataSuccess')" + type="success" + :closable="false" + /> </div> <div v-show="isError"> - <el-alert icon="Close" :show-icon="true" title="閽i噾璁″垝鏁版嵁宸茶В鏋愬け璐�" type="error" :closable="false"/> + <el-alert + icon="Close" + :show-icon="true" + :title="$t('plan.message.metalplanDataError')" + type="error" + :closable="false" + /> </div> </el-col> </el-row> <el-row v-show="isVisible"> <el-col> <div> - <h2>鏁版嵁棰勮</h2> + <h2>{{ $t("plan.upload.dataPreview") }}</h2> </div> <HxlhTable - style="width: 100%" - :columns="exampleColumns" - :data="exampleList" - :loading="loading" - :maxHeight="exampleHeight" - @on-checkbox="handleCheckboxChange" + style="width: 100%" + :columns="exampleColumns" + :data="exampleList" + :loading="loading" + :maxHeight="exampleHeight" + @on-checkbox="handleCheckboxChange" > </HxlhTable> </el-col> <el-col> - <div style="text-align: right;"> - <h4>鍏变笂浼�<span style="color: blue;">{{ total }}</span>鏉¢浂浠跺伐鍗曟暟鎹�</h4> + <div style="text-align: right"> + <h4> + {{ $t("plan.upload.totalUpload") + }}<span style="color: blue">{{ total }}</span + >{{ $t("plan.upload.itemUpload") }} + </h4> </div> </el-col> </el-row> <template #footer> <div class="dialog-footer"> + <el-button + type="success" + plain + icon="Check" + :disabled="planned" + @click="uploadParse" + v-hasPermi="['apsPlatePlan:confirm']" + >{{ $t("plan.upload.confirmUpload") }}</el-button + > - <el-button - type="success" - plain - icon="Check" - :disabled="planned" - @click="uploadParse" - v-hasPermi="['apsPlatePlan:confirm']" - >纭涓婁紶</el-button> - - <el-button @click="dialogCancel">鍙� 娑�</el-button> + <el-button @click="dialogCancel">{{ + $t("plan.upload.cancel") + }}</el-button> </div> </template> </el-dialog> - </div> </template> <script setup name="ApsPlatePlan"> -import { listPlan, examplePlan, confirmPart} from "@/api/mainPlan/apsPlatePlan.js"; +import { + listPlan, + examplePlan, + confirmPart, +} from "@/api/mainPlan/apsPlatePlan.js"; import { listProcessRoute } from "@/api/basicData/processRoute.js"; -import HxlhTable from '@/components/HxlhTable/index.vue' +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 { proxy } = getCurrentInstance(); - -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 { t, locale } = useI18n(); +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); @@ -218,14 +284,13 @@ const daterangePlanStartDay = ref([]); const daterangePlanEndDay = ref([]); -const height = ref(document.documentElement.clientHeight - 270 + "px;") +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({ @@ -238,406 +303,502 @@ // 鏄惁鏇存柊宸茬粡瀛樺湪鐨勭敤鎴锋暟鎹� updateSupport: 0, // 璁剧疆涓婁紶鐨勮姹傚ご閮� - headers: { Authorization: "Bearer " + getToken() ,local: 'zhl'}, + headers: { Authorization: "Bearer " + getToken(), local: "zhl" }, // 涓婁紶鐨勫湴鍧� - url: import.meta.env.VITE_APP_BASE_API + "/aps/apsPlatePlan/importData" + url: import.meta.env.VITE_APP_BASE_API + "/aps/apsPlatePlan/importData", }); - -// 琛ㄦ牸閰嶇疆 -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"}, - { 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: 100, - }, - { - title: '鍗曟嵁鍙�', - field: 'documentNumber', - width: 140, - }, - { - title: '闇�姹傚垎绫�', - field: 'requirementType', - width: 100, - }, - { - title: '鍗曟嵁鐘舵��', - field: 'documentStatus', - width: 100, - }, - { - title: '鏂欏彿', - field: 'itemNumber', - width: 100, - }, - { - title: '鍥惧彿', - field: 'drawingNo', - width: 100, - }, - // { - // title: '鐗堟湰鍙�', - // field: 'versionNumber', - // width: 100, - // }, - { - title: '鐢熶骇鏁伴噺', - field: 'productionQuantity', - width: 100, - }, - // { - // title: '鑹搧鏁伴噺', - // field: 'goodProductsQuantity', - // width: 100, - // }, - { - title: '宸ュ簭鍙�', - field: 'processNumber', - width: 100, - }, - { - title: '宸ヤ綔涓績', - field: 'workCenter', - width: 180, - }, - // { - // title: '鎵�灞為儴闂�', - // field: 'department', - // width: 100, - // }, - // { - // title: '璁″垝寮�宸ユ棩', - // field: 'planStartDay', - // width: 100, - // }, - { - title: '璁″垝瀹屽伐鏃�', - field: 'planEndDay', - width: 100, - }, - // { - // title: '澶囨枡鏂欏彿', - // field: 'standbyNumber', - // width: 100, - // }, - // { - // title: '澶囨枡鍚嶇О', - // field: 'standbyName', - // width: 100, - // }, - // { - // title: '澶囨枡搴撳瓨', - // field: 'standbyStock', - // width: 100, - // }, - // { - // title: '涓嬮亾宸ュ簭鎵�灞為儴闂�', - // field: 'nextProcessDeparment', - // width: 160, - // }, - // { - // 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: 100, - // }, - // { - // title: '璁″垝榻愬', - // field: 'isPlanComplete', - // width: 100, - // }, - // { - // title: '搴撳瓨榻愬', - // field: 'isStockComplete', - // width: 100, - // }, - // { - // title: '鏄惁鏈夋姌杩斿伐搴�', - // field: 'hasTurnback', - // width: 120, - // }, - // { - // title: '椋庨櫓鏍囪瘑', - // field: 'hasRisk', - // width: 100, - // }, -]); - - const data = reactive({ form: {}, queryParams: { pageNum: 1, pageSize: 10, customer: null, - documentNumber: null + documentNumber: null, }, rules: { id: [ - { required: true, message: "涓婚敭id涓嶈兘涓虹┖", trigger: "blur" } + { + required: true, + message: t("plan.message.idNotBeEmpty"), + trigger: "blur", + }, ], - } + }, }); const { queryParams } = toRefs(data); +const exampleColumns = ref([]); +const columns = ref([]); +const subGridOptions = ref({ + border: true, + showOverflow: true, + columns: [], +}); + +watch( + locale, + (newLocale) => { + // 閲嶆柊鑾峰彇缈昏瘧鏂囨湰 + // 琛ㄦ牸閰嶇疆 + exampleColumns.value = [ + { type: "seq", title: t("plan.table.seq"), width: 60 }, + { + title: t("plan.table.masterPlanner"), + field: "masterPlanner", + width: 100, + }, + { + title: t("plan.table.weekDay"), + 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: t("plan.table.weekCycle"), + field: "weekCycle", + width: 80, + }, + { + title: t("plan.table.mainPartNumber"), + field: "mainPartNumber", + width: 150, + }, + { + title: t("plan.table.mainPartDrawingNumber"), + field: "mainPartDrawingNumber", + width: 150, + }, + { + title: t("plan.table.customer"), + field: "customer", + width: 200, + }, + { + title: t("plan.table.businessType"), + field: "businessType", + width: 150, + }, + { + title: t("plan.table.documentNumber"), + field: "documentNumber", + width: 150, + }, + { + title: t("plan.table.requirementType"), + field: "requirementType", + width: 150, + }, + { + title: t("plan.table.documentStatus"), + field: "documentStatus", + width: 100, + }, + { + title: t("plan.table.itemNumber"), + field: "itemNumber", + width: 150, + }, + { + title: t("plan.table.drawingNo"), + field: "drawingNo", + width: 150, + }, + { + title: t("plan.table.versionNumber"), + field: "versionNumber", + width: 100, + }, + { + title: t("plan.table.productionQuantity"), + field: "productionQuantity", + width: 100, + }, + { + title: t("plan.table.goodProductsQuantity"), + field: "goodProductsQuantity", + width: 100, + }, + { + title: t("plan.table.processNumber"), + field: "processNumber", + width: 150, + }, + { + title: t("plan.table.factoryCenter"), + field: "workCenter", + width: 150, + }, + { + title: t("plan.table.dependencyDepartment"), + field: "department", + width: 100, + }, + { + title: t("plan.table.planStartDay"), + field: "planStartDay", + width: 100, + }, + { + title: t("plan.table.planEndDayDate"), + field: "planEndDay", + width: 100, + }, + { + title: t("plan.table.standbyNumber"), + field: "standbyNumber", + width: 100, + }, + { + title: t("plan.table.standbyName"), + field: "standbyName", + width: 200, + }, + { + title: t("plan.table.standbyStock"), + field: "standbyStock", + width: 100, + }, + { + title: t("plan.table.departmentToNextProcessBelongs"), + field: "nextProcessDeparment", + width: 180, + }, + { + title: t("plan.table.isSuspended"), + field: "isSuspended", + width: 100, + }, + { + title: t("plan.table.isOutsourcing"), + field: "isOutsourcing", + width: 100, + }, + { + title: t("plan.table.account"), + 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, + // }, + ]; + // 琛ㄦ牸閰嶇疆 + columns.value = [ + { + field: "expand", + type: "expand", + width: 60, + align: "center", + slots: { content: "expandContent" }, + }, + { type: "checkbox", width: 60, align: "center" }, + { type: "seq", title: t("plan.table.seq"), 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: t("plan.table.mainPartNumber"), + field: "mainPartNumber", + width: 150, + }, + // { + // title: '涓讳欢鍥惧彿', + // field: 'mainPartDrawingNumber', + // width: 150, + // }, + // { + // title: '瀹㈡埛鍚嶇О', + // field: 'customer', + // width: 200, + // }, + { + title: t("plan.table.businessType"), + field: "businessType", + width: 100, + }, + { + title: t("plan.table.documentNumber"), + field: "documentNumber", + width: 140, + }, + { + title: t("plan.table.requirementType"), + field: "requirementType", + width: 100, + }, + { + title: t("plan.table.documentStatus"), + field: "documentStatus", + width: 100, + }, + { + title: t("plan.table.itemNumber"), + field: "itemNumber", + width: 100, + }, + { + title: t("plan.table.drawingNo"), + field: "drawingNo", + width: 100, + }, + // { + // title: '鐗堟湰鍙�', + // field: 'versionNumber', + // width: 100, + // }, + { + title: t("plan.table.productionQuantity"), + field: "productionQuantity", + width: 100, + }, + // { + // title: '鑹搧鏁伴噺', + // field: 'goodProductsQuantity', + // width: 100, + // }, + { + title: t("plan.table.processNumber"), + field: "processNumber", + width: 100, + }, + { + title: t("plan.table.factoryCenter"), + field: "workCenter", + width: 180, + }, + // { + // title: '鎵�灞為儴闂�', + // field: 'department', + // width: 100, + // }, + // { + // title: '璁″垝寮�宸ユ棩', + // field: 'planStartDay', + // width: 100, + // }, + { + title: t("plan.table.planEndDayDate"), + field: "planEndDay", + width: 100, + }, + // { + // title: '澶囨枡鏂欏彿', + // field: 'standbyNumber', + // width: 100, + // }, + // { + // title: '澶囨枡鍚嶇О', + // field: 'standbyName', + // width: 100, + // }, + // { + // title: '澶囨枡搴撳瓨', + // field: 'standbyStock', + // width: 100, + // }, + // { + // title: '涓嬮亾宸ュ簭鎵�灞為儴闂�', + // field: 'nextProcessDeparment', + // width: 160, + // }, + // { + // 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: 100, + // }, + // { + // title: '璁″垝榻愬', + // field: 'isPlanComplete', + // width: 100, + // }, + // { + // title: '搴撳瓨榻愬', + // field: 'isStockComplete', + // width: 100, + // }, + // { + // title: '鏄惁鏈夋姌杩斿伐搴�', + // field: 'hasTurnback', + // width: 120, + // }, + // { + // title: '椋庨櫓鏍囪瘑', + // field: 'hasRisk', + // width: 100, + // }, + ]; + subGridOptions.value.columns = [ + { + title: t("plan.table.itemNumber"), + field: "itemNo", + width: 150, + align: "center", + }, + { + title: t("plan.table.workOrderNo"), + field: "workOrderNo", + width: 150, + align: "center", + }, + { + title: t("plan.table.processNumber"), + field: "processNumber", + width: 150, + align: "center", + }, + { + title: t("plan.table.processName"), + field: "processName", + width: 150, + align: "center", + }, + { + title: t("plan.table.startDateOfProcessPlan"), + field: "processPlanStartDay", + width: 200, + align: "center", + }, + { + title: t("plan.table.endDateOfProcessPlan"), + field: "processPlanEndDay", + width: 200, + align: "center", + }, + // { + // title: '鏈紑宸ユ暟閲�', + // field: 'notStartWorkCount', + // width: 90, + // align:"center", + // }, + // { + // title: '宸插畬鎴愭暟閲�', + // field: 'completedCount', + // width: 90, + // align:"center", + // }, + // { + // title: '搴熷純鏁伴噺', + // field: 'discardCount', + // width: 90, + // align:"center", + // }, + { + title: t("plan.table.standardTime"), + field: "standardTime", + width: 90, + align: "center", + }, + { + title: t("plan.table.processOrder"), + field: "processOrder", + width: 90, + align: "center", + }, + { + title: t("plan.table.integrationDay"), + field: "integrationDay", + width: 160, + align: "center", + }, + ]; + getList(); + }, + { immediate: true, deep: true } +); /** 鏌ヨ閽i噾璁″垝涓存椂绠$悊鍒楄〃 */ function getExampleList() { loading.value = true; queryParams.value = {}; queryParams.value.batchNumber = batchNumber.value; - examplePlan(queryParams.value).then(response => { + examplePlan(queryParams.value).then((response) => { exampleList.value = response.rows; total.value = response.total; loading.value = false; @@ -648,15 +809,17 @@ 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 != daterangePlanStartDay && "" !== daterangePlanStartDay) { + queryParams.value.params["beginPlanStartDay"] = + daterangePlanStartDay.value[0]; + queryParams.value.params["endPlanStartDay"] = + daterangePlanStartDay.value[1]; } - if (null != daterangePlanEndDay && '' !== daterangePlanEndDay) { + if (null != daterangePlanEndDay && "" !== daterangePlanEndDay) { queryParams.value.params["beginPlanEndDay"] = daterangePlanEndDay.value[0]; queryParams.value.params["endPlanEndDay"] = daterangePlanEndDay.value[1]; } - listPlan(queryParams.value).then(response => { + listPlan(queryParams.value).then((response) => { planList.value = response.rows; loading.value = false; }); @@ -682,38 +845,41 @@ }; /** 鎵归噺淇敼璁″垝寮�宸ユ棩鎸夐挳鎿嶄綔 */ -function plannedStart() { - -} +function plannedStart() {} /** 鎵归噺淇敼璁″垝瀹屽伐鏃ユ寜閽搷浣� */ -function plannedEnd() { - -} +function plannedEnd() {} /** 瀵煎叆鎸夐挳鎿嶄綔 */ function handleImport() { - upload.title = "閽i噾璁″垝鏁版嵁涓婁紶"; + upload.title = t("plan.upload.uploadSheetMetalPlanData"); upload.open = true; -}; +} /** 瀵煎嚭鎸夐挳鎿嶄綔 */ function handleExport() { - proxy.download('aps/apsPlatePlan/export', { - ...queryParams.value - }, `plan_${new Date().getTime()}.xlsx`) + 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`); -}; + proxy.download( + "system/user/importTemplate", + {}, + `user_template_${new Date().getTime()}.xlsx` + ); +} /** buildEexample */ function buildEexample() { proxy.$refs["uploadRef"].submit(); -}; +} /**鏂囦欢涓婁紶涓鐞� */ const handleFileUploadProgress = (event, file, fileList) => { @@ -722,15 +888,24 @@ /** 鏂囦欢涓婁紶鎴愬姛澶勭悊 */ const handleFileSuccess = (response, file, fileList) => { - if(response.code == '200'){ + if (response.code == "200") { batchNumber.value = response.data; isVisible.value = true; planned.value = false; isError.value = false; getExampleList(); - }else{ + } 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.$alert( + "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + + response.msg + + "</div>", + t("plan.upload.errorResult"), + { dangerouslyUseHTMLString: true, + confirmButtonText: t("plan.btns.confirm"), + cancelButtonText: t("plan.btns.cancel"), + } + ); } proxy.$refs["uploadRef"].handleRemove(file); upload.isUploading = false; @@ -740,7 +915,7 @@ function uploadParse() { queryParams.value.params = {}; queryParams.value.params["batchNumber"] = batchNumber.value; - confirmPart(queryParams.value).then(response => { + confirmPart(queryParams.value).then((response) => { exampleList.value = response.rows; loading.value = false; isVisible.value = false; @@ -748,15 +923,15 @@ planned.value = true; upload.open = false; ElMessage({ - message: '姘斾綋绠¤矾璁″垝鏁版嵁宸叉垚鍔熶笂浼犲拰瑙f瀽', - type: 'success', - }) + message: t("plan.message.metalplanDataSuccess"), + type: "success", + }); getList(); }); } /** dialog鍙栨秷 */ -function dialogCancel(){ +function dialogCancel() { if (uploadRef.value) { uploadRef.value.clearFiles(); } @@ -768,98 +943,101 @@ } /*瀹氫箟涓嬫媺浜岀骇琛�*/ -const subGridOptions = reactive({ - border: true, - showOverflow: true, - columns: [ - { - title: '鏂欏彿', - 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: 'notStartWorkCount', - // width: 90, - // align:"center", - // }, - // { - // title: '宸插畬鎴愭暟閲�', - // field: 'completedCount', - // width: 90, - // align:"center", - // }, - // { - // title: '搴熷純鏁伴噺', - // field: 'discardCount', - // width: 90, - // align:"center", - // }, - { - title: '鏍囧噯宸ユ椂', - field: 'standardTime', - width: 90, - align:"center", - }, - { - title: '宸ュ簭鎺掑簭', - field: 'processOrder', - width: 90, - align:"center", - }, - { - title: '闆嗘垚鏃ユ湡', - field: 'integrationDay', - width: 160, - align:"center", - } - ] -}) +// const subGridOptions = ref({ +// border: true, +// showOverflow: true, +// columns: [ +// { +// title: t('plan.table.itemNumber'), +// field: 'itemNo', +// width: 150, +// align:"center", +// }, +// { +// title: t('plan.table.workOrderNo'), +// field: 'workOrderNo', +// width: 150, +// align:"center", +// }, +// { +// title: t('plan.table.processNumber'), +// field: 'processNumber', +// width: 100, +// align:"center", +// }, +// { +// title: t('plan.table.processName'), +// field: 'processName', +// width: 150, +// align:"center", +// }, +// { +// title: t('plan.table.startDateOfProcessPlan'), +// field: 'processPlanStartDay', +// width: 200, +// align:"center", +// }, +// { +// title: '宸ュ簭璁″垝缁撴潫鏃ユ湡', +// field: 'processPlanEndDay', +// width: 200, +// align:"center", +// }, +// // { +// // title: '鏈紑宸ユ暟閲�', +// // field: 'notStartWorkCount', +// // width: 90, +// // align:"center", +// // }, +// // { +// // title: '宸插畬鎴愭暟閲�', +// // field: 'completedCount', +// // width: 90, +// // align:"center", +// // }, +// // { +// // title: '搴熷純鏁伴噺', +// // field: 'discardCount', +// // width: 90, +// // align:"center", +// // }, +// { +// title: '鏍囧噯宸ユ椂', +// field: 'standardTime', +// width: 90, +// align:"center", +// }, +// { +// title: '宸ュ簭鎺掑簭', +// field: 'processOrder', +// width: 90, +// align:"center", +// }, +// { +// title: '闆嗘垚鏃ユ湡', +// field: 'integrationDay', +// width: 160, +// align:"center", +// } +// ] +// }) + const expandConfig = ref({ lazy: true, - loadMethod ({ row }) { + loadMethod({ row }) { // 璋冪敤鎺ュ彛 - return listProcessRoute({'workOrderNo':row.documentNumber}).then(data => { - row.subList = data.rows; - }) - } -}) + return listProcessRoute({ workOrderNo: row.documentNumber }).then( + (data) => { + row.subList = data.rows; + } + ); + }, +}); -getList(); +// getList(); </script> <style lang="css" scoped> h4 { font-weight: bold; } -</style> \ No newline at end of file +</style> -- Gitblit v1.9.3