From a07bd2102524d610589c174a33c34e03b79deae2 Mon Sep 17 00:00:00 2001
From: bluejay <253316343@qq.com>
Date: 星期一, 14 四月 2025 11:40:23 +0800
Subject: [PATCH] 钣金计划上传页面
---
src/views/ApsPlatePlan/index.vue | 565 ++++++++++++++++++++++++++++++++++++++------------------
src/api/ApsPlatePlan/ApsPlatePlan.js | 19 +
2 files changed, 401 insertions(+), 183 deletions(-)
diff --git a/src/api/ApsPlatePlan/ApsPlatePlan.js b/src/api/ApsPlatePlan/ApsPlatePlan.js
index faa4b8e..c887193 100644
--- a/src/api/ApsPlatePlan/ApsPlatePlan.js
+++ b/src/api/ApsPlatePlan/ApsPlatePlan.js
@@ -3,7 +3,7 @@
// 鏌ヨ閽i噾璁″垝绠$悊鍒楄〃
export function listPlan(query) {
return request({
- url: '/aps/ApsPlatePlan/list',
+ url: '/aps/apsPlatePlan/list',
method: 'get',
params: query
})
@@ -51,3 +51,20 @@
data: data
})
}
+// 鏌ヨ闆朵欢璁″垝绠$悊鍒楄〃
+export function examplePlan(query) {
+ return request({
+ url: '/aps/apsPlatePlanTemp/list',
+ method: 'get',
+ params: query
+ })
+}
+
+// 鏌ヨ闆朵欢璁″垝绠$悊鍒楄〃
+export function confirmPart(data) {
+ return request({
+ url: '/aps/apsPlatePlan/confirmPart',
+ method: 'post',
+ data: data
+ })
+}
\ No newline at end of file
diff --git a/src/views/ApsPlatePlan/index.vue b/src/views/ApsPlatePlan/index.vue
index 43f8e7c..481ba2a 100644
--- a/src/views/ApsPlatePlan/index.vue
+++ b/src/views/ApsPlatePlan/index.vue
@@ -2,7 +2,9 @@
<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-form-item label="璁″垝寮�宸ユ棩" style="width: 350px">
+ <el-row :gutter="20">
+ <el-col :span="6">
+ <el-form-item label="璁″垝寮�宸ユ棩" style="width: 100%;">
<el-date-picker
v-model="daterangePlanStartDay"
value-format="YYYY-MM-DD"
@@ -12,7 +14,9 @@
end-placeholder="缁撴潫鏃ユ湡"
></el-date-picker>
</el-form-item>
- <el-form-item label="璁″垝瀹屽伐鏃�" style="width: 350px">
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="璁″垝瀹屽伐鏃�" style="width: 100%;">
<el-date-picker
v-model="daterangePlanEndDay"
value-format="YYYY-MM-DD"
@@ -22,7 +26,9 @@
end-placeholder="缁撴潫鏃ユ湡"
></el-date-picker>
</el-form-item>
- <el-form-item label="鍗曟嵁鍙�" prop="documentNumber">
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="鍗曟嵁鍙�" prop="documentNumber" style="width: 100%;">
<el-input
v-model="queryParams.documentNumber"
placeholder="璇疯緭鍏ュ崟鎹彿"
@@ -30,7 +36,9 @@
@keyup.enter="handleQuery"
/>
</el-form-item>
- <el-form-item label="瀹㈡埛鍚嶇О" prop="customer">
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="瀹㈡埛鍚嶇О" prop="customer" style="width: 100%;">
<el-input
v-model="queryParams.customer"
placeholder="璇疯緭鍏ュ鎴峰悕绉�"
@@ -38,10 +46,14 @@
@keyup.enter="handleQuery"
/>
</el-form-item>
+ </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-form-item>
+ </el-col>
+ </el-row>
</el-form>
</el-col> </el-row>
<el-row :gutter="10" class="mb8">
@@ -52,7 +64,7 @@
icon="Plus"
:disabled="single"
@click="handleUpdate"
- v-hasPermi="['ApsPlatePlan:ApsPlatePlan:edit']"
+ v-hasPermi="['apsPlatePlan:edit']"
>鎵归噺淇敼璁″垝寮�宸ユ棩</el-button>
</el-col>
<el-col :span="1.5">
@@ -62,7 +74,7 @@
icon="Edit"
:disabled="single"
@click="handleUpdate"
- v-hasPermi="['ApsPlatePlan:ApsPlatePlan:edit']"
+ v-hasPermi="['apsPlatePlan:edit']"
>鎵归噺淇敼璁″垝瀹屽伐鏃�</el-button>
</el-col>
<el-col :span="1.5">
@@ -71,7 +83,7 @@
plain
icon="Upload"
@click="handleImport"
- v-hasPermi="['ApsPlatePlan:ApsPlatePlan:edit']"
+ v-hasPermi="['apsPlatePlan:import']"
>瀵煎叆</el-button>
</el-col>
<el-col :span="1.5">
@@ -80,7 +92,7 @@
plain
icon="Download"
@click="handleExport"
- v-hasPermi="['ApsPlatePlan:ApsPlatePlan:export']"
+ v-hasPermi="['apsPlatePlan:export']"
>瀵煎嚭</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
@@ -97,167 +109,84 @@
</HxlhTable>
<!-- 娣诲姞鎴栦慨鏀归挘閲戣鍒掔鐞嗗璇濇 -->
- <el-dialog :title="title" v-model="open" width="500px" append-to-body>
-<!-- <el-dialog :title="title" width="500px" append-to-body>-->
- <el-form ref="ApsPlatePlanRef" :model="form" :rules="rules" label-width="80px">
- <el-form-item label="涓婚敭id" prop="id">
- <el-input v-model="form.id" placeholder="璇疯緭鍏ヤ富閿甶d" />
- </el-form-item>
- <el-form-item label="涓昏鍒掑憳" prop="masterPlanner">
- <el-input v-model="form.masterPlanner" placeholder="璇疯緭鍏ヤ富璁″垝鍛�" />
- </el-form-item>
- <el-form-item label="鍛ㄦ棩" prop="weekDay">
- <el-date-picker clearable
- v-model="form.weekDay"
- type="date"
- value-format="YYYY-MM-DD"
- placeholder="璇烽�夋嫨鍛ㄦ棩">
- </el-date-picker>
- </el-form-item>
- <el-form-item label="鍛ㄥ害" prop="weekCycle">
- <el-input v-model="form.weekCycle" placeholder="璇疯緭鍏ュ懆搴�" />
- </el-form-item>
- <el-form-item label="涓讳欢鏂欏彿" prop="mainPartNumber">
- <el-input v-model="form.mainPartNumber" placeholder="璇疯緭鍏ヤ富浠舵枡鍙�" />
- </el-form-item>
- <el-form-item label="涓讳欢鍥惧彿" prop="mainPartDrawingNumber">
- <el-input v-model="form.mainPartDrawingNumber" placeholder="璇疯緭鍏ヤ富浠跺浘鍙�" />
- </el-form-item>
- <el-form-item label="瀹㈡埛鍚嶇О" prop="customer">
- <el-input v-model="form.customer" placeholder="璇疯緭鍏ュ鎴峰悕绉�" />
- </el-form-item>
- <el-form-item label="涓氬姟绫诲瀷" prop="businessType">
- <el-select v-model="form.businessType" placeholder="璇烽�夋嫨涓氬姟绫诲瀷">
- <el-option
- v-for="dict in aps_business_type"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="鍗曟嵁鍙�" prop="documentNumber">
- <el-input v-model="form.documentNumber" placeholder="璇疯緭鍏ュ崟鎹彿" />
- </el-form-item>
- <el-form-item label="闇�姹傚垎绫�" prop="requirementType">
- <el-input v-model="form.requirementType" placeholder="璇疯緭鍏ラ渶姹傚垎绫�" />
- </el-form-item>
- <el-form-item label="鍗曟嵁鐘舵��" prop="documentStatus">
- <el-select v-model="form.documentStatus" placeholder="璇烽�夋嫨鍗曟嵁鐘舵��">
- <el-option
- v-for="dict in aps_document_status"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="鏂欏彿" prop="itemNumber">
- <el-input v-model="form.itemNumber" placeholder="璇疯緭鍏ユ枡鍙�" />
- </el-form-item>
- <el-form-item label="鍥惧彿" prop="drawingNo">
- <el-input v-model="form.drawingNo" placeholder="璇疯緭鍏ュ浘鍙�" />
- </el-form-item>
- <el-form-item label="鐗堟湰鍙�" prop="versionNumber">
- <el-input v-model="form.versionNumber" placeholder="璇疯緭鍏ョ増鏈彿" />
- </el-form-item>
- <el-form-item label="鐢熶骇鏁伴噺" prop="productionQuantity">
- <el-input v-model="form.productionQuantity" placeholder="璇疯緭鍏ョ敓浜ф暟閲�" />
- </el-form-item>
- <el-form-item label="鑹搧鏁伴噺" prop="goodProductsQuantity">
- <el-input v-model="form.goodProductsQuantity" placeholder="璇疯緭鍏ヨ壇鍝佹暟閲�" />
- </el-form-item>
- <el-form-item label="宸ュ簭鍙�" prop="processNumber">
- <el-input v-model="form.processNumber" placeholder="璇疯緭鍏ュ伐搴忓彿" />
- </el-form-item>
- <el-form-item label="宸ヤ綔涓績" prop="workCenter">
- <el-input v-model="form.workCenter" placeholder="璇疯緭鍏ュ伐浣滀腑蹇�" />
- </el-form-item>
- <el-form-item label="鎵�灞為儴闂�" prop="department">
- <el-input v-model="form.department" placeholder="璇疯緭鍏ユ墍灞為儴闂�" />
- </el-form-item>
- <el-form-item label="璁″垝寮�宸ユ棩" prop="planStartDay">
- <el-date-picker clearable
- v-model="form.planStartDay"
- type="date"
- value-format="YYYY-MM-DD"
- placeholder="璇烽�夋嫨璁″垝寮�宸ユ棩">
- </el-date-picker>
- </el-form-item>
- <el-form-item label="璁″垝瀹屽伐鏃�" prop="planEndDay">
- <el-date-picker clearable
- v-model="form.planEndDay"
- type="date"
- value-format="YYYY-MM-DD"
- placeholder="璇烽�夋嫨璁″垝瀹屽伐鏃�">
- </el-date-picker>
- </el-form-item>
- <el-form-item label="澶囨枡鏂欏彿" prop="standbyNumber">
- <el-input v-model="form.standbyNumber" placeholder="璇疯緭鍏ュ鏂欐枡鍙�" />
- </el-form-item>
- <el-form-item label="澶囨枡鍚嶇О" prop="standbyName">
- <el-input v-model="form.standbyName" placeholder="璇疯緭鍏ュ鏂欏悕绉�" />
- </el-form-item>
- <el-form-item label="澶囨枡搴撳瓨" prop="standbyStock">
- <el-input v-model="form.standbyStock" placeholder="璇疯緭鍏ュ鏂欏簱瀛�" />
- </el-form-item>
- <el-form-item label="涓嬮亾宸ュ簭鎵�灞為儴闂�" prop="nextProcessDeparment">
- <el-input v-model="form.nextProcessDeparment" placeholder="璇疯緭鍏ヤ笅閬撳伐搴忔墍灞為儴闂�" />
- </el-form-item>
- <el-form-item label="鏄惁鎸傝捣" prop="isSuspended">
- <el-select v-model="form.isSuspended" placeholder="璇烽�夋嫨鏄惁鎸傝捣">
- <el-option
- v-for="dict in aps_is_suspended"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="澶栧崗鏍囪瘑" prop="isOutsourcing">
- <el-input v-model="form.isOutsourcing" placeholder="璇疯緭鍏ュ鍗忔爣璇�" />
- </el-form-item>
- <el-form-item label="璐﹀" prop="account">
- <el-select v-model="form.account" placeholder="璇烽�夋嫨璐﹀">
- <el-option
- v-for="dict in aps_account"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="涓婇樁鐗╂枡" prop="advancedMaterials">
- <el-input v-model="form.advancedMaterials" placeholder="璇疯緭鍏ヤ笂闃剁墿鏂�" />
- </el-form-item>
- <el-form-item label="涓婇樁鍗曟嵁鍙�" prop="advancedDocumentNumber">
- <el-input v-model="form.advancedDocumentNumber" placeholder="璇疯緭鍏ヤ笂闃跺崟鎹彿" />
- </el-form-item>
- <el-form-item label="涓婇樁闇�姹傛棩鏈�" prop="advancedRequirementDay">
- <el-date-picker clearable
- v-model="form.advancedRequirementDay"
- type="date"
- value-format="YYYY-MM-DD"
- placeholder="璇烽�夋嫨涓婇樁闇�姹傛棩鏈�">
- </el-date-picker>
- </el-form-item>
- <el-form-item label="璁″垝榻愬" prop="isPlanComplete">
- <el-input v-model="form.isPlanComplete" placeholder="璇疯緭鍏ヨ鍒掗綈濂�" />
- </el-form-item>
- <el-form-item label="搴撳瓨榻愬" prop="isStockComplete">
- <el-input v-model="form.isStockComplete" placeholder="璇疯緭鍏ュ簱瀛橀綈濂�" />
- </el-form-item>
- <el-form-item label="鏄惁鏈夋姌杩斿伐搴�" prop="hasTurnback">
- <el-input v-model="form.hasTurnback" placeholder="璇疯緭鍏ユ槸鍚︽湁鎶樿繑宸ュ簭" />
- </el-form-item>
- <el-form-item label="椋庨櫓鏍囪瘑" prop="hasRisk">
- <el-input v-model="form.hasRisk" placeholder="璇疯緭鍏ラ闄╂爣璇�" />
- </el-form-item>
- </el-form>
+ <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瀽鏁版嵁骞朵繚瀛樺埌鏈湴锛岀敤浜庡叧鑱斿埌闆朵欢璁″垝涓��</p>
+ </div>
+ </el-col>
+ <el-col >
+ <div></div>
+ </el-col>
+ </el-row>
+ <el-row :gutter="10" style="margin-top: 20px;"> </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">
+ <!-- <div class="el-upload__tip">
+ <el-checkbox v-model="upload.updateSupport" />鏄惁鏇存柊宸茬粡瀛樺湪鐨勭敤鎴锋暟鎹�
+ </div> -->
+ <span>浠呭厑璁稿鍏ls銆亁lsx鏍煎紡鏂囦欢銆�</span>
+ <!-- <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">涓嬭浇妯℃澘</el-link> -->
+ </div>
+ </template>
+ </el-upload>
+ </el-col>
+ </el-row>
+ <el-row style="margin-top: 20px;">
+ <el-col>
+ <div>
+ <el-button
+ type="success"
+ plain
+ icon="Check"
+ :disabled="planned"
+ @click="uploadParse"
+ v-hasPermi="['partPlan:confirmPart']"
+ >涓婁紶骞惰В鏋�</el-button>
+ </div>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col style="margin-top: 20px;">
+ <div v-show="isVisible">
+ <el-alert icon="Check" :show-icon="true" title="閽i噾璁″垝鏁版嵁宸叉垚鍔熻В鏋�" type="success" :closable="false"/>
+ </div>
+ <div v-show="isError">
+ <el-alert icon="Close" :show-icon="true" title="閽i噾璁″垝鏁版嵁宸茶В鏋愬け璐�" type="error" :closable="false"/>
+ </div>
+ </el-col>
+ </el-row>
+ <el-row v-show="isVisible">
+ <el-col>
+ <div>
+ <h2>鏁版嵁棰勮</h2>
+ </div>
+ <HxlhTable
+ 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>
+ </el-col>
+ </el-row>
<template #footer>
<div class="dialog-footer">
- <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
- <el-button @click="cancel">鍙� 娑�</el-button>
+ <!-- <el-button type="primary" @click="submitFileForm">纭� 瀹�</el-button> -->
+ <el-button @click="dialogCancel">鍙� 娑�</el-button>
</div>
</template>
</el-dialog>
@@ -266,14 +195,17 @@
</template>
<script setup name="ApsPlatePlan">
-import { listPlan, getApsPlatePlan, delApsPlatePlan, addApsPlatePlan, updateApsPlatePlan ,uploadApsPlatePlan} from "@/api/ApsPlatePlan/ApsPlatePlan";
+import { listPlan, examplePlan, confirmPart} from "@/api/ApsPlatePlan/ApsPlatePlan";
import HxlhTable from '@/components/HxlhTable'
+import { ref } from "vue";
import { getToken } from "@/utils/auth";
+import {ElMessage} from "element-plus";
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 exampleList = ref([]);
const planList = ref([]);
const loading = ref(true);
const showSearch = ref(true);
@@ -281,8 +213,13 @@
const total = ref(0);
const daterangePlanStartDay = ref([]);
const daterangePlanEndDay = ref([]);
-const vxeTable = ref(null);
-const height = ref(document.documentElement.clientHeight - 260 + "px;")
+const height = ref(document.documentElement.clientHeight - 210 + "px;")
+const isVisible = ref(false);
+const isError = ref(false);
+const planned = ref(true);
+const batchNumber = ref(null);
+const exampleHeight = ref("500px");
+const uploadRef = ref();
/*** 鐢ㄦ埛瀵煎叆鍙傛暟 */
@@ -296,10 +233,195 @@
// 鏄惁鏇存柊宸茬粡瀛樺湪鐨勭敤鎴锋暟鎹�
updateSupport: 0,
// 璁剧疆涓婁紶鐨勮姹傚ご閮�
- headers: { Authorization: "Bearer " + getToken() },
+ headers: { Authorization: "Bearer " + getToken() ,local: 'zhl'},
// 涓婁紶鐨勫湴鍧�
- url: import.meta.env.VITE_APP_BASE_API + "/system/user/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: 150,
+ },
+ {
+ 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([
@@ -503,23 +625,33 @@
}
});
-const { queryParams, form, rules } = toRefs(data);
+const { queryParams } = toRefs(data);
+/** 鏌ヨ閽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;
+ });
+}
-/** 鏌ヨ閽i噾璁″垝绠$悊鍒楄〃 */
+/** 鏌ヨ闆朵欢璁″垝绠$悊鍒楄〃 */
function getList() {
loading.value = true;
queryParams.value.params = {};
- if (null != daterangePlanStartDay && '' != daterangePlanStartDay) {
+ 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 => {
planList.value = response.rows;
- total.value = response.total;
loading.value = false;
});
}
@@ -534,7 +666,6 @@
function resetQuery() {
daterangePlanStartDay.value = [];
daterangePlanEndDay.value = [];
- daterangeAdvancedRequirementDay.value = [];
proxy.resetForm("queryRef");
handleQuery();
}
@@ -545,25 +676,95 @@
};
/** 鎵归噺淇敼璁″垝寮�宸ユ棩鎸夐挳鎿嶄綔 */
-function plannedStart(row) {
+function plannedStart() {
}
/** 鎵归噺淇敼璁″垝瀹屽伐鏃ユ寜閽搷浣� */
-function plannedEnd(row) {
+function plannedEnd() {
}
+
/** 瀵煎叆鎸夐挳鎿嶄綔 */
function handleImport() {
- upload.title = "瀵煎叆";
+ upload.title = "閽i噾璁″垝鏁版嵁涓婁紶";
upload.open = true;
};
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
function handleExport() {
- proxy.download('aps/partPlan/export', {
+ 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: '閽i噾璁″垝鏁版嵁宸叉垚鍔熶笂浼犲拰瑙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;
+}
+
getList();
</script>
+<style lang="css" scoped>
+h4 {
+ font-weight: bold;
+}
+</style>
\ No newline at end of file
--
Gitblit v1.9.3