¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // æ¥è¯¢å·¥èºè·¯çº¿å表 |
| | | export function listProcessRoute(query) { |
| | | return request({ |
| | | url: '/aps/processRoute/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢å·¥èºè·¯çº¿è¯¦ç» |
| | | export function getProcessRoute(id) { |
| | | return request({ |
| | | url: '/aps/processRoute/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢å·¥èºè·¯çº¿ |
| | | export function addProcessRoute(data) { |
| | | return request({ |
| | | url: '/aps/processRoute', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹å·¥èºè·¯çº¿ |
| | | export function updateProcessRoute(data) { |
| | | return request({ |
| | | url: '/aps/processRoute', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å é¤å·¥èºè·¯çº¿ |
| | | export function delProcessRoute(id) { |
| | | return request({ |
| | | url: '/aps/processRoute/' + id, |
| | | method: 'delete' |
| | | }) |
| | | } |
| | | // æ¥è¯¢ä¸´æ¶å表 |
| | | export function processRouteTempList(query) { |
| | | return request({ |
| | | url: '/aps/processRouteTemp/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | export function confirmProcessRoute(data) { |
| | | return request({ |
| | | url: '/aps/processRoute/confirmProcessRoute', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // æ¥è¯¢èµæºç»å表 |
| | | export function listApsResourceGroup(query) { |
| | | return request({ |
| | | url: '/aps/apsResourceGroup/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢èµæºç»è¯¦ç» |
| | | export function getApsResourceGroup(id) { |
| | | return request({ |
| | | url: '/aps/apsResourceGroup/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢èµæºç» |
| | | export function addApsResourceGroup(data) { |
| | | return request({ |
| | | url: '/aps/apsResourceGroup', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹èµæºç» |
| | | export function updateApsResourceGroup(data) { |
| | | return request({ |
| | | url: '/aps/apsResourceGroup', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å é¤èµæºç» |
| | | export function delApsResourceGroup(id) { |
| | | return request({ |
| | | url: '/aps/apsResourceGroup/' + id, |
| | | method: 'delete' |
| | | }) |
| | | } |
| | | // æ¥è¯¢ä¸´æ¶å表 |
| | | export function apsResourceGroupTempList(query) { |
| | | return request({ |
| | | url: '/aps/apsResourceGroupTemp/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | export function confirmApsResourceGroup(data) { |
| | | return request({ |
| | | url: '/aps/apsResourceGroup/confirmData', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="éææ¥æ" style="width: 308px"> |
| | | <el-date-picker |
| | | v-model="daterangeIntegrationDay" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | type="daterange" |
| | | range-separator="-" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="æå·" prop="itemNo"> |
| | | <el-input |
| | | v-model="queryParams.itemNo" |
| | | placeholder="请è¾å
¥æå·" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <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-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <!-- <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="Plus" |
| | | @click="handleAdd" |
| | | v-hasPermi="['aps:processRoute:add']" |
| | | >æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="Edit" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['aps:processRoute:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="Delete" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['aps:processRoute:remove']" |
| | | >å é¤</el-button> |
| | | </el-col> --> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="info" |
| | | plain |
| | | icon="Upload" |
| | | @click="handleImport" |
| | | v-hasPermi="['partPlan:import']" |
| | | >导å
¥</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="Download" |
| | | @click="handleExport" |
| | | v-hasPermi="['aps:processRoute:export']" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | <HxlhTable |
| | | style="width: 100%" |
| | | :columns="columns" |
| | | :data="processRouteList" |
| | | :loading="loading" |
| | | :height="height" |
| | | @on-checkbox="handleCheckboxChange" |
| | | > |
| | | </HxlhTable> |
| | | <!-- ç¨æ·å¯¼å
¥å¯¹è¯æ¡ --> |
| | | <el-dialog :title="upload.title" v-model="upload.open" width="90%" append-to-body> |
| | | <el-row :gutter="10"> |
| | | <el-col> |
| | | <div style="border-bottom: 1px solid #ccc;" > |
| | | <p>ä¸ä¼ Excelæä»¶ï¼å
å«å·¥èºè·¯çº¿ä¿¡æ¯ãç³»ç»å°è§£ææ°æ®å¹¶ä¿åå°æ¬å°ï¼ç¨äºå
³èå°é¶ä»¶è®¡åä¸ã</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"> |
| | | <span>ä»
å
许导å
¥xlsãxlsxæ ¼å¼æä»¶ã</span> |
| | | </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:edit']" |
| | | >ä¸ä¼ å¹¶è§£æ</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="å·¥èºè·¯çº¿æ°æ®å·²æåè§£æ" type="success" :closable="false"/> |
| | | </div> |
| | | <div v-show="isError"> |
| | | <el-alert icon="Close" :show-icon="true" title="å·¥èºè·¯çº¿æ°æ®å·²è§£æå¤±è´¥" 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 @click="dialogCancel">å æ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="ProcessRoute"> |
| | | import { listProcessRoute, getProcessRoute, delProcessRoute, addProcessRoute, updateProcessRoute,processRouteTempList,confirmProcessRoute } from "@/api/aps/processRoute"; |
| | | import HxlhTable from '@/components/HxlhTable' |
| | | import { getToken } from "@/utils/auth"; |
| | | import { ref } from "vue"; |
| | | import { ElMessage } from 'element-plus' |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | const processRouteList = ref([]); |
| | | const open = ref(false); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | | const ids = ref([]); |
| | | const single = ref(true); |
| | | const multiple = ref(true); |
| | | const total = ref(0); |
| | | const title = ref(""); |
| | | const daterangeIntegrationDay = ref([]); |
| | | //å¼¹çªç¸å
³ |
| | | const height = ref(document.documentElement.clientHeight - 260 + "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 exampleList = ref([]); |
| | | /*** ç¨æ·å¯¼å
¥åæ° */ |
| | | const upload = reactive({ |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå±ï¼ç¨æ·å¯¼å
¥ï¼ |
| | | open: false, |
| | | // å¼¹åºå±æ é¢ï¼ç¨æ·å¯¼å
¥ï¼ |
| | | title: "", |
| | | // æ¯å¦ç¦ç¨ä¸ä¼ |
| | | isUploading: false, |
| | | // æ¯å¦æ´æ°å·²ç»åå¨çç¨æ·æ°æ® |
| | | updateSupport: 0, |
| | | // 设置ä¸ä¼ ç请æ±å¤´é¨ |
| | | headers: { Authorization: "Bearer " + getToken() }, |
| | | // ä¸ä¼ çå°å |
| | | url: import.meta.env.VITE_APP_BASE_API + "/aps/processRoute/importData" |
| | | }); |
| | | // è¡¨æ ¼é
ç½®-å表 |
| | | const columns = ref([ |
| | | { type: 'checkbox', width: 60, align:"center"}, |
| | | { type: 'seq', title: 'åºå·', width: 60 }, |
| | | { |
| | | 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: 150, |
| | | align:"center", |
| | | }, |
| | | { |
| | | title: '已宿æ°é', |
| | | field: 'completedCount', |
| | | width: 150, |
| | | align:"center", |
| | | }, |
| | | { |
| | | title: 'åºå¼æ°é', |
| | | field: 'discardCount', |
| | | width: 150, |
| | | align:"center", |
| | | }, |
| | | { |
| | | title: 'éææ¥æ', |
| | | field: 'integrationDay', |
| | | width: 160, |
| | | align:"center", |
| | | } |
| | | ]); |
| | | // è¡¨æ ¼é
ç½®-å¼¹çª |
| | | const exampleColumns = ref([ |
| | | { type: 'seq', title: 'åºå·', width: 60 }, |
| | | { |
| | | 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: 150, |
| | | align:"center", |
| | | }, |
| | | { |
| | | title: '已宿æ°é', |
| | | field: 'completedCount', |
| | | width: 150, |
| | | align:"center", |
| | | }, |
| | | { |
| | | title: 'åºå¼æ°é', |
| | | field: 'discardCount', |
| | | width: 150, |
| | | align:"center", |
| | | }, |
| | | { |
| | | title: 'éææ¥æ', |
| | | field: 'integrationDay', |
| | | width: 160, |
| | | align:"center", |
| | | } |
| | | ]); |
| | | const data = reactive({ |
| | | form: {}, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | itemNo: null, |
| | | integrationDay: null, |
| | | }, |
| | | rules: { |
| | | } |
| | | }); |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | |
| | | /** æ¥è¯¢å·¥èºè·¯çº¿å表 */ |
| | | function getList() { |
| | | loading.value = true; |
| | | queryParams.value.params = {}; |
| | | if (null != daterangeIntegrationDay && '' != daterangeIntegrationDay) { |
| | | queryParams.value.params["beginIntegrationDay"] = daterangeIntegrationDay.value[0]; |
| | | queryParams.value.params["endIntegrationDay"] = daterangeIntegrationDay.value[1]; |
| | | } |
| | | listProcessRoute(queryParams.value).then(response => { |
| | | processRouteList.value = response.rows; |
| | | total.value = response.total; |
| | | loading.value = false; |
| | | }); |
| | | } |
| | | |
| | | // åæ¶æé® |
| | | function cancel() { |
| | | open.value = false; |
| | | reset(); |
| | | } |
| | | // å¤éæ¡é䏿°æ® |
| | | const handleCheckboxChange = (data) => { |
| | | console.log(data); |
| | | }; |
| | | // 表åéç½® |
| | | function reset() { |
| | | form.value = { |
| | | id: null, |
| | | itemNo: null, |
| | | workOrderNo: null, |
| | | processNumber: null, |
| | | processName: null, |
| | | processPlanStartDay: null, |
| | | processPlanEndDay: null, |
| | | notStartWorkCount: null, |
| | | completedCount: null, |
| | | discardCount: null, |
| | | integrationDay: null, |
| | | plant: null, |
| | | delFlag: null, |
| | | createBy: null, |
| | | createTime: null, |
| | | updateBy: null, |
| | | updateTime: null |
| | | }; |
| | | proxy.resetForm("processRouteRef"); |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | function resetQuery() { |
| | | daterangeIntegrationDay.value = []; |
| | | proxy.resetForm("queryRef"); |
| | | handleQuery(); |
| | | } |
| | | |
| | | // å¤éæ¡é䏿°æ® |
| | | function handleSelectionChange(selection) { |
| | | ids.value = selection.map(item => item.id); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | function handleAdd() { |
| | | reset(); |
| | | open.value = true; |
| | | title.value = "æ·»å å·¥èºè·¯çº¿"; |
| | | } |
| | | |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | function handleUpdate(row) { |
| | | reset(); |
| | | const _id = row.id || ids.value |
| | | getProcessRoute(_id).then(response => { |
| | | form.value = response.data; |
| | | open.value = true; |
| | | title.value = "ä¿®æ¹å·¥èºè·¯çº¿"; |
| | | }); |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | function submitForm() { |
| | | proxy.$refs["processRouteRef"].validate(valid => { |
| | | if (valid) { |
| | | if (form.value.id != null) { |
| | | updateProcessRoute(form.value).then(response => { |
| | | proxy.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } else { |
| | | addProcessRoute(form.value).then(response => { |
| | | proxy.$modal.msgSuccess("æ°å¢æå"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** å é¤æé®æä½ */ |
| | | function handleDelete(row) { |
| | | const _ids = row.id || ids.value; |
| | | proxy.$modal.confirm('æ¯å¦ç¡®è®¤å é¤å·¥èºè·¯çº¿ç¼å·ä¸º"' + _ids + '"çæ°æ®é¡¹ï¼').then(function() { |
| | | return delProcessRoute(_ids); |
| | | }).then(() => { |
| | | getList(); |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | }).catch(() => {}); |
| | | } |
| | | /** 导å
¥æé®æä½ */ |
| | | function handleImport() { |
| | | upload.title = "å·¥èºè·¯çº¿æ°æ®ä¸ä¼ "; |
| | | upload.open = true; |
| | | }; |
| | | /** å¯¼åºæé®æä½ */ |
| | | function handleExport() { |
| | | proxy.download('aps/processRoute/export', { |
| | | ...queryParams.value |
| | | }, `processRoute_${new Date().getTime()}.xlsx`) |
| | | } |
| | | |
| | | |
| | | /**æä»¶ä¸ä¼ ä¸å¤ç */ |
| | | 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 getExampleList() { |
| | | loading.value = true; |
| | | queryParams.value = {}; |
| | | queryParams.value.batchNumber = batchNumber.value; |
| | | processRouteTempList(queryParams.value).then(response => { |
| | | exampleList.value = response.rows; |
| | | total.value = response.total; |
| | | loading.value = false; |
| | | }); |
| | | } |
| | | /** ä¸ä¼ å¹¶è§£ææé®æä½ */ |
| | | function uploadParse() { |
| | | queryParams.value.params = {}; |
| | | queryParams.value.params["batchNumber"] = batchNumber.value; |
| | | confirmProcessRoute(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: 'å·¥èºè·¯çº¿æ°æ®å·²æåä¸ä¼ åè§£æ', |
| | | type: 'success', |
| | | }) |
| | | getList(); |
| | | }); |
| | | } |
| | | |
| | | /** dialogåæ¶ */ |
| | | function dialogCancel(){ |
| | | if (uploadRef.value) { |
| | | uploadRef.value.clearFiles(); |
| | | } |
| | | isVisible.value = false; |
| | | isError.value = false; |
| | | planned.value = true; |
| | | upload.open = false; |
| | | } |
| | | getList(); |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="èµæºç»" prop="resourceGroupName"> |
| | | <el-input |
| | | v-model="queryParams.resourceGroupName" |
| | | placeholder="请è¾å
¥èµæºç»åç§°" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="æªæ¢æºå éæ±æ¥æ" style="width: 400px" label-width="150px"> |
| | | <el-date-picker |
| | | v-model="daterangeRequestDate" |
| | | value-format="YYYY-MM-DD" |
| | | type="daterange" |
| | | range-separator="-" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <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-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="info" |
| | | plain |
| | | icon="Upload" |
| | | @click="handleImport" |
| | | v-hasPermi="['partPlan:import']" |
| | | >导å
¥</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="Download" |
| | | @click="handleExport" |
| | | v-hasPermi="['ApsResourceGroup:ApsResourceGroup:export']" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <HxlhTable |
| | | style="width: 100%" |
| | | :columns="columns" |
| | | :data="ApsResourceGroupList" |
| | | :loading="loading" |
| | | :height="height" |
| | | @on-checkbox="handleCheckboxChange" |
| | | > |
| | | </HxlhTable> |
| | | <!-- ç¨æ·å¯¼å
¥å¯¹è¯æ¡ --> |
| | | <el-dialog :title="upload.title" v-model="upload.open" width="90%" append-to-body> |
| | | <el-row :gutter="10"> |
| | | <el-col> |
| | | <div style="border-bottom: 1px solid #ccc;" > |
| | | <p>ä¸ä¼ Excelæä»¶ï¼å
å«èµæºæ± ä¿¡æ¯ãç³»ç»å°è§£ææ°æ®å¹¶ä¿åå°æ¬å°ï¼ç¨äºå
³èå°é¶ä»¶è®¡åä¸ã</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"> |
| | | <span>ä»
å
许导å
¥xlsãxlsxæ ¼å¼æä»¶ã</span> |
| | | </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:edit']" |
| | | >ä¸ä¼ å¹¶è§£æ</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="èµæºæ± æ°æ®å·²æåè§£æ" type="success" :closable="false"/> |
| | | </div> |
| | | <div v-show="isError"> |
| | | <el-alert icon="Close" :show-icon="true" title="èµæºæ± æ°æ®å·²è§£æå¤±è´¥" 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 @click="dialogCancel">å æ¶</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="ApsResourceGroup"> |
| | | import { listApsResourceGroup, getApsResourceGroup, delApsResourceGroup, addApsResourceGroup, updateApsResourceGroup,apsResourceGroupTempList,confirmApsResourceGroup } from "@/api/basicData/ApsResourceGroup"; |
| | | import HxlhTable from '@/components/HxlhTable' |
| | | import { getToken } from "@/utils/auth"; |
| | | import { ref } from "vue"; |
| | | import { ElMessage } from 'element-plus' |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | const ApsResourceGroupList = ref([]); |
| | | const open = ref(false); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | | const ids = ref([]); |
| | | const single = ref(true); |
| | | const multiple = ref(true); |
| | | const total = ref(0); |
| | | const title = ref(""); |
| | | const daterangeRequestDate = ref([]); |
| | | //å¼¹çªç¸å
³ |
| | | const height = ref(document.documentElement.clientHeight - 260 + "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 exampleList = ref([]); |
| | | /*** ç¨æ·å¯¼å
¥åæ° */ |
| | | const upload = reactive({ |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå±ï¼ç¨æ·å¯¼å
¥ï¼ |
| | | open: false, |
| | | // å¼¹åºå±æ é¢ï¼ç¨æ·å¯¼å
¥ï¼ |
| | | title: "", |
| | | // æ¯å¦ç¦ç¨ä¸ä¼ |
| | | isUploading: false, |
| | | // æ¯å¦æ´æ°å·²ç»åå¨çç¨æ·æ°æ® |
| | | updateSupport: 0, |
| | | // 设置ä¸ä¼ ç请æ±å¤´é¨ |
| | | headers: { Authorization: "Bearer " + getToken() }, |
| | | // ä¸ä¼ çå°å |
| | | url: import.meta.env.VITE_APP_BASE_API + "/aps/apsResourceGroup/importData" |
| | | }); |
| | | // è¡¨æ ¼é
ç½®-å表 |
| | | const columns = ref([ |
| | | { type: 'checkbox', width: 60, align:"center"}, |
| | | { type: 'seq', title: 'åºå·', width: 60 }, |
| | | { |
| | | 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: 150, |
| | | align:"center", |
| | | }, |
| | | { |
| | | title: '已宿æ°é', |
| | | field: 'completedCount', |
| | | width: 150, |
| | | align:"center", |
| | | }, |
| | | { |
| | | title: 'åºå¼æ°é', |
| | | field: 'discardCount', |
| | | width: 150, |
| | | align:"center", |
| | | }, |
| | | { |
| | | title: 'éææ¥æ', |
| | | field: 'integrationDay', |
| | | width: 160, |
| | | align:"center", |
| | | } |
| | | ]); |
| | | // è¡¨æ ¼é
ç½®-å¼¹çª |
| | | const exampleColumns = ref([ |
| | | { type: 'seq', title: 'åºå·', width: 60 }, |
| | | { |
| | | 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: 150, |
| | | align:"center", |
| | | }, |
| | | { |
| | | title: '已宿æ°é', |
| | | field: 'completedCount', |
| | | width: 150, |
| | | align:"center", |
| | | }, |
| | | { |
| | | title: 'åºå¼æ°é', |
| | | field: 'discardCount', |
| | | width: 150, |
| | | align:"center", |
| | | }, |
| | | { |
| | | title: 'éææ¥æ', |
| | | field: 'integrationDay', |
| | | width: 160, |
| | | align:"center", |
| | | } |
| | | ]); |
| | | const data = reactive({ |
| | | form: {}, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | resourceGroupName: null, |
| | | devicesQuantity: null, |
| | | theoryHours: null, |
| | | restDays: null, |
| | | theoryCapacity: null, |
| | | requestDate: null, |
| | | plant: null |
| | | }, |
| | | rules: { |
| | | } |
| | | }); |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | |
| | | /** æ¥è¯¢èµæºç»å表 */ |
| | | function getList() { |
| | | loading.value = true; |
| | | queryParams.value.params = {}; |
| | | if (null != daterangeRequestDate && '' != daterangeRequestDate) { |
| | | queryParams.value.params["beginRequestDate"] = daterangeRequestDate.value[0]; |
| | | queryParams.value.params["endRequestDate"] = daterangeRequestDate.value[1]; |
| | | } |
| | | listApsResourceGroup(queryParams.value).then(response => { |
| | | ApsResourceGroupList.value = response.rows; |
| | | total.value = response.total; |
| | | loading.value = false; |
| | | }); |
| | | } |
| | | |
| | | // åæ¶æé® |
| | | function cancel() { |
| | | open.value = false; |
| | | reset(); |
| | | } |
| | | |
| | | // 表åéç½® |
| | | function reset() { |
| | | form.value = { |
| | | id: null, |
| | | resourceGroupName: null, |
| | | devicesQuantity: null, |
| | | theoryHours: null, |
| | | restDays: null, |
| | | theoryCapacity: null, |
| | | requestDate: null, |
| | | delFlag: null, |
| | | createBy: null, |
| | | createTime: null, |
| | | updateBy: null, |
| | | updateTime: null, |
| | | plant: null |
| | | }; |
| | | proxy.resetForm("ApsResourceGroupRef"); |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | function resetQuery() { |
| | | daterangeRequestDate.value = []; |
| | | proxy.resetForm("queryRef"); |
| | | handleQuery(); |
| | | } |
| | | |
| | | // å¤éæ¡é䏿°æ® |
| | | function handleSelectionChange(selection) { |
| | | ids.value = selection.map(item => item.id); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | function handleAdd() { |
| | | reset(); |
| | | open.value = true; |
| | | title.value = "æ·»å èµæºç»"; |
| | | } |
| | | |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | function handleUpdate(row) { |
| | | reset(); |
| | | const _id = row.id || ids.value |
| | | getApsResourceGroup(_id).then(response => { |
| | | form.value = response.data; |
| | | open.value = true; |
| | | title.value = "ä¿®æ¹èµæºç»"; |
| | | }); |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | function submitForm() { |
| | | proxy.$refs["ApsResourceGroupRef"].validate(valid => { |
| | | if (valid) { |
| | | if (form.value.id != null) { |
| | | updateApsResourceGroup(form.value).then(response => { |
| | | proxy.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } else { |
| | | addApsResourceGroup(form.value).then(response => { |
| | | proxy.$modal.msgSuccess("æ°å¢æå"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** å é¤æé®æä½ */ |
| | | function handleDelete(row) { |
| | | const _ids = row.id || ids.value; |
| | | proxy.$modal.confirm('æ¯å¦ç¡®è®¤å é¤èµæºç»ç¼å·ä¸º"' + _ids + '"çæ°æ®é¡¹ï¼').then(function() { |
| | | return delApsResourceGroup(_ids); |
| | | }).then(() => { |
| | | getList(); |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | }).catch(() => {}); |
| | | } |
| | | |
| | | /** 导å
¥æé®æä½ */ |
| | | function handleImport() { |
| | | upload.title = "èµæºæ± æ°æ®ä¸ä¼ "; |
| | | upload.open = true; |
| | | }; |
| | | /** å¯¼åºæé®æä½ */ |
| | | function handleExport() { |
| | | proxy.download('aps/apsResourceGroup/export', { |
| | | ...queryParams.value |
| | | }, `apsResourceGroup_${new Date().getTime()}.xlsx`) |
| | | } |
| | | |
| | | |
| | | /**æä»¶ä¸ä¼ ä¸å¤ç */ |
| | | 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 getExampleList() { |
| | | loading.value = true; |
| | | queryParams.value = {}; |
| | | queryParams.value.batchNumber = batchNumber.value; |
| | | apsResourceGroupTempList(queryParams.value).then(response => { |
| | | exampleList.value = response.rows; |
| | | total.value = response.total; |
| | | loading.value = false; |
| | | }); |
| | | } |
| | | /** ä¸ä¼ å¹¶è§£ææé®æä½ */ |
| | | function uploadParse() { |
| | | queryParams.value.params = {}; |
| | | queryParams.value.params["batchNumber"] = batchNumber.value; |
| | | confirmApsResourceGroup(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: 'èµæºæ± æ°æ®å·²æåä¸ä¼ åè§£æ', |
| | | type: 'success', |
| | | }) |
| | | getList(); |
| | | }); |
| | | } |
| | | |
| | | /** dialogåæ¶ */ |
| | | function dialogCancel(){ |
| | | if (uploadRef.value) { |
| | | uploadRef.value.clearFiles(); |
| | | } |
| | | isVisible.value = false; |
| | | isError.value = false; |
| | | planned.value = true; |
| | | upload.open = false; |
| | | } |
| | | |
| | | getList(); |
| | | </script> |