¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-row :gutter="20"> |
| | | <el-form |
| | | :model="queryParams" |
| | | ref="queryRef" |
| | | :rules="rules" |
| | | :inline="true" |
| | | v-show="showSearch" |
| | | label-width="68px" |
| | | > |
| | | <el-row :gutter="20"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="æå·" prop="itemCode"> |
| | | <el-input |
| | | style="width: 240px" |
| | | v-model="queryParams.itemCode" |
| | | placeholder="请è¾å
¥æå·" |
| | | 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-button icon="Refresh" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </el-row> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="Refresh" |
| | | @click="handleRefresh" |
| | | v-hasPermi="['apsPartRouteStat:edit']" |
| | | >æ´æ°</el-button |
| | | > |
| | | </el-col> |
| | | <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" |
| | | :page="page" |
| | | @changePageNo="changePageNo" |
| | | @changePageSize="changePageSize" |
| | | :expand-config="expandConfig" |
| | | :subGridOptions="subGridOptions" |
| | | > |
| | | </HxlhTable> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="ApsPlatePlan"> |
| | | import { |
| | | listPlan, |
| | | examplePlan, |
| | | confirmPart, |
| | | } from "@/api/mainPlan/apsPlatePlan.js"; |
| | | import { listProcessRoute } from "@/api/basicData/processRoute.js"; |
| | | import HxlhTable from "@/components/HxlhTable/index.vue"; |
| | | import { ref } from "vue"; |
| | | import { getToken } from "@/utils/auth.js"; |
| | | import { ElMessage } from "element-plus"; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | // å页屿§ |
| | | const page = ref({ |
| | | total: 0, |
| | | current: 1, |
| | | 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 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 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 data = reactive({ |
| | | form: {}, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | customer: null, |
| | | documentNumber: null, |
| | | itemCode: null, |
| | | }, |
| | | rules: { |
| | | itemCode: [{ required: true, message: "请è¾å
¥æå·", trigger: "blur" }], |
| | | }, |
| | | }); |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | function changePageNo(currentPage) { |
| | | queryParams.value.pageNum = currentPage; |
| | | page.value.current = currentPage; |
| | | getList(); |
| | | } |
| | | function changePageSize(pageSize) { |
| | | page.value.current = 1; |
| | | queryParams.value.pageNum = 1; |
| | | queryParams.value.pageSize = pageSize; |
| | | getList(); |
| | | } |
| | | /** æ¥è¯¢é£é计å临æ¶ç®¡çå表 */ |
| | | 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; |
| | | }); |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | function handleQuery() { |
| | | proxy.$refs["queryRef"].validate((valid) => { |
| | | if (valid) { |
| | | getList(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | function resetQuery() { |
| | | daterangePlanStartDay.value = []; |
| | | daterangePlanEndDay.value = []; |
| | | proxy.resetForm("queryRef"); |
| | | handleQuery(); |
| | | } |
| | | |
| | | // å¤éæ¡é䏿°æ® |
| | | const handleCheckboxChange = (data) => { |
| | | console.log(data); |
| | | }; |
| | | |
| | | /** æ¹éä¿®æ¹è®¡åå¼å·¥æ¥æé®æä½ */ |
| | | function plannedStart() {} |
| | | |
| | | /** æ¹éä¿®æ¹è®¡åå®å·¥æ¥æé®æä½ */ |
| | | function plannedEnd() {} |
| | | |
| | | /** 导å
¥æé®æä½ */ |
| | | function handleImport() { |
| | | upload.title = "é£éè®¡åæ°æ®ä¸ä¼ "; |
| | | 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: "æ°ä½ç®¡è·¯è®¡åæ°æ®å·²æåä¸ä¼ åè§£æ", |
| | | type: "success", |
| | | }); |
| | | getList(); |
| | | }); |
| | | } |
| | | |
| | | /** dialogåæ¶ */ |
| | | function dialogCancel() { |
| | | if (uploadRef.value) { |
| | | uploadRef.value.clearFiles(); |
| | | } |
| | | isVisible.value = false; |
| | | isError.value = false; |
| | | planned.value = true; |
| | | upload.open = false; |
| | | upload.isUploading = false; |
| | | } |
| | | /*å®ä¹ä¸æäºçº§è¡¨*/ |
| | | |
| | | const subGridOptions = reactive({ |
| | | border: true, |
| | | showOverflow: true, |
| | | columns: [ |
| | | { |
| | | 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", |
| | | }, |
| | | ], |
| | | }); |
| | | 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 { |
| | | font-weight: bold; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form |
| | | class="responsive-form" |
| | | :model="queryParams" |
| | | ref="queryRef" |
| | | :inline="true" |
| | | v-show="showSearch" |
| | | label-width="110px" |
| | | > |
| | | <el-form-item label="å·¥åå·" prop="description"> |
| | | <el-input |
| | | style="width: 140px" |
| | | v-model="queryParams.description" |
| | | placeholder="请è¾å
¥éæ±è¿½æº¯ID" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <!-- <el-row type="flex" justify="left"> |
| | | <el-col :span="5"> --> |
| | | <el-form-item label="éæ±è¿½æº¯ID" prop="description"> |
| | | <el-input |
| | | style="width: 140px" |
| | | v-model="queryParams.description" |
| | | placeholder="请è¾å
¥éæ±è¿½æº¯ID" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <!-- </el-col> |
| | | <el-col :span="5"> --> |
| | | <el-form-item label="æå·" prop="description"> |
| | | <el-input |
| | | style="width: 140px" |
| | | v-model="queryParams.description" |
| | | placeholder="请è¾å
¥æå·" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="å»¶è¿é£é©æ è¯" prop="description"> |
| | | <el-input |
| | | style="width: 140px" |
| | | v-model="queryParams.description" |
| | | placeholder="请è¾å
¥æå·" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <!-- </el-col> |
| | | <el-col :span="14" style="text-align: right"> --> |
| | | <el-form-item class="column-with-margin"> |
| | | <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-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> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="Edit" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['apsPlatePlan:edit']" |
| | | >çæé£é计åå·¥å</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | <HxlhTable |
| | | style="width: 100%" |
| | | :columns="columns" |
| | | :data="calendarList" |
| | | :loading="loading" |
| | | :height="height" |
| | | ref="tableRef" |
| | | :page="page" |
| | | @changePageNo="changePageNo" |
| | | @changePageSize="changePageSize" |
| | | @on-checkbox="handleCheckboxChange" |
| | | class="auto-height-grid" |
| | | > |
| | | </HxlhTable> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="Calendar"> |
| | | import HxlhTable from "@/components/HxlhTable"; |
| | | import { |
| | | listCalendar, |
| | | getCalendar, |
| | | delCalendar, |
| | | addCalendar, |
| | | updateCalendar, |
| | | } from "@/api/basicData/calendar"; |
| | | import axios from "axios"; |
| | | import { listAll_plant } from "@/api/basicData/plant"; |
| | | import { listAll_shop, listAps_shop } from "@/api/basicData/shop"; |
| | | import { selectProcessNameList } from "@/api/basicData/processRoute.js"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const tableRef = ref(); |
| | | const calendarList = ref([]); |
| | | 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 data = reactive({ |
| | | form: { |
| | | type: "1", |
| | | }, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | description: null, |
| | | type: null, |
| | | effectiveDate: null, |
| | | expiringDate: null, |
| | | content: null, |
| | | applicableFactory: null, |
| | | applicableWorkshop: null, |
| | | applicableProcess: null, |
| | | }, |
| | | }); |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | const typeRadioNumber = ref(1); |
| | | const plantList = ref([]); |
| | | const shopList = ref([]); |
| | | const allShopList = ref([]); |
| | | const processList = ref([]); |
| | | const height = ref(document.documentElement.clientHeight - 220 + "px;"); |
| | | // è¡¨æ ¼é
ç½®-å表 |
| | | const columns = ref([ |
| | | { type: "checkbox", width: 60, align: "center" }, |
| | | { |
| | | title: "éæ±ID", |
| | | field: "description", |
| | | width: 150, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "éæ±è¿½æº¯ID", |
| | | field: "type", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "å·¥åå·", |
| | | field: "effectiveDate", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "å¹é
æ°é", |
| | | field: "expiringDate", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "å·¥åç±»å", |
| | | field: "expiringDate", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "æå·", |
| | | field: "createTime", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "主件å¾å·", |
| | | field: "createTime", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "主件客æ·", |
| | | field: "createTime", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "ç产æ°é", |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "éæ±æ¥æ", |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "éç¨å·¥å", |
| | | field: "applicableFactory", |
| | | width: 200, |
| | | 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: "ç产åºå°", |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | ]); |
| | | // å页屿§ |
| | | const page = ref({ |
| | | total: 0, |
| | | current: 1, |
| | | size: 10, |
| | | }); |
| | | |
| | | /** æ¥è¯¢æ¥å管çå表 */ |
| | | function getList() { |
| | | loading.value = true; |
| | | listCalendar(queryParams.value).then((response) => { |
| | | calendarList.value = response.rows; |
| | | page.value.total = response.total; |
| | | loading.value = false; |
| | | }); |
| | | axios |
| | | .all([ |
| | | /** æ¥è¯¢å·¥åå表 */ |
| | | listAll_plant({}), |
| | | /** æ¥è¯¢è½¦é´å表 */ |
| | | listAll_shop({}), |
| | | ]) |
| | | .then( |
| | | axios.spread((response1, response2) => { |
| | | plantList.value = response1.data; |
| | | shopList.value = response2.data; |
| | | loading.value = false; |
| | | }) |
| | | ) |
| | | .catch((error) => { |
| | | console.error("请æ±åºé:", error); |
| | | }); |
| | | } |
| | | |
| | | // åæ¶æé® |
| | | function cancel() { |
| | | open.value = false; |
| | | reset(); |
| | | } |
| | | |
| | | // 表åéç½® |
| | | function reset() { |
| | | form.value = { |
| | | id: null, |
| | | description: null, |
| | | type: "1", |
| | | effectiveDate: null, |
| | | expiringDate: null, |
| | | content: null, |
| | | applicableFactory: null, |
| | | applicableWorkshop: null, |
| | | applicableProcess: null, |
| | | createBy: null, |
| | | createTime: null, |
| | | updateBy: null, |
| | | updateTime: null, |
| | | }; |
| | | proxy.resetForm("calendarRef"); |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | function resetQuery() { |
| | | proxy.resetForm("queryRef"); |
| | | handleQuery(); |
| | | } |
| | | |
| | | // å¤éæ¡é䏿°æ® |
| | | function handleSelectionChange(selection) { |
| | | ids.value = selection.map((item) => item.id); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | async function handleAdd() { |
| | | reset(); |
| | | open.value = true; |
| | | title.value = "æ·»å æ¥å管ç"; |
| | | } |
| | | /** 鿩工ååäºä»¶ å è½½è½¦é´ å å·¥åº **/ |
| | | function changePlant(plant) { |
| | | listAps_shop({ plantCode: plant }).then((response) => { |
| | | shopList.value = response.rows; |
| | | }); |
| | | selectProcessNameList({ orgCode: plant }).then((response) => { |
| | | processList.value = response.rows; |
| | | }); |
| | | } |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | function handleUpdate(row) { |
| | | reset(); |
| | | const _id = row.id || ids.value; |
| | | getCalendar(_id).then((response) => { |
| | | form.value = response.data; |
| | | // form.value.content = JSON.parse(response.data.content.value); |
| | | if (form.value.type === "1") { |
| | | weekDaysSettingList.value = JSON.parse( |
| | | response.data.content.value |
| | | ).weekdays; |
| | | } else if (form.value.type === "2") { |
| | | holidays.value = JSON.parse(response.data.content.value).holidays; |
| | | } |
| | | |
| | | open.value = true; |
| | | title.value = "ä¿®æ¹æ¥å管ç"; |
| | | }); |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | function submitForm() { |
| | | proxy.$refs["calendarRef"].validate((valid) => { |
| | | if (valid) { |
| | | if (form.value.id != null) { |
| | | if (form.value.type === "1") { |
| | | updateCalendar({ |
| | | ...form.value, |
| | | content: { |
| | | weekdays: weekDaysSettingList.value, |
| | | }, |
| | | applicableWorkshop: form.value.applicableWorkshop, |
| | | applicableProcess: form.value.applicableProcess, |
| | | }).then((response) => { |
| | | proxy.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } else if (form.value.type === "2") { |
| | | updateCalendar({ |
| | | ...form.value, |
| | | content: { |
| | | holidays: holidays.value, |
| | | }, |
| | | applicableWorkshop: form.value.applicableWorkshop, |
| | | applicableProcess: form.value.applicableProcess, |
| | | }).then((response) => { |
| | | proxy.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } |
| | | } else { |
| | | if (form.value.type === "1") { |
| | | addCalendar({ |
| | | ...form.value, |
| | | content: { |
| | | weekdays: weekDaysSettingList.value, |
| | | }, |
| | | }).then((response) => { |
| | | proxy.$modal.msgSuccess("æ°å¢æå"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } else if (form.value.type === "2") { |
| | | addCalendar({ |
| | | ...form.value, |
| | | content: { |
| | | holidays: holidays.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 delCalendar(_ids); |
| | | }) |
| | | .then(() => { |
| | | getList(); |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | }) |
| | | .catch(() => {}); |
| | | } |
| | | |
| | | /** å¯¼åºæé®æä½ */ |
| | | function handleExport() { |
| | | proxy.download( |
| | | "core/calendar/export", |
| | | { |
| | | ...queryParams.value, |
| | | }, |
| | | `calendar_${new Date().getTime()}.xlsx` |
| | | ); |
| | | } |
| | | function handleSwitchType(e) { |
| | | typeRadioNumber.value = e; |
| | | form.value.type = e; |
| | | form.value.effectiveDate = null; |
| | | form.value.expiringDate = null; |
| | | form.value.content = null; |
| | | form.value.applicableFactory = null; |
| | | form.value.applicableWorkshop = null; |
| | | form.value.applicableProcess = null; |
| | | } |
| | | function changePageNo(currentPage) { |
| | | queryParams.value.pageNum = currentPage; |
| | | page.value.current = currentPage; |
| | | getList(); |
| | | } |
| | | function changePageSize(pageSize) { |
| | | page.value.current = 1; |
| | | queryParams.value.pageNum = 1; |
| | | queryParams.value.pageSize = pageSize; |
| | | getList(); |
| | | } |
| | | // å¤éæ¡é䏿°æ® |
| | | const handleCheckboxChange = (data) => { |
| | | ids.value = data.records.map((item) => item.id); |
| | | single.value = data.records.length !== 1; |
| | | multiple.value = !data.records.length; |
| | | }; |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .column-with-margin { |
| | | margin-right: 0px; |
| | | } |
| | | .title_bar_line { |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | align-items: center; |
| | | color: #333; |
| | | margin-bottom: 10px; |
| | | .line_short { |
| | | width: 5%; |
| | | height: 1px; |
| | | margin-right: 20px; |
| | | border-top: 1px solid #ddd; |
| | | } |
| | | .line_long { |
| | | width: 60%; |
| | | height: 1px; |
| | | margin-left: 20px; |
| | | border-top: 1px solid #ddd; |
| | | } |
| | | } |
| | | .week_flex { |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | align-content: center; |
| | | color: #606266; |
| | | font-weight: 700; |
| | | margin-left: 20px; |
| | | &.mt20 { |
| | | margin-top: 20px; |
| | | margin-left: 0 !important; |
| | | } |
| | | .week_flex_item { |
| | | &:nth-child(1) { |
| | | margin-top: 5px; |
| | | } |
| | | &:nth-child(2) { |
| | | margin-left: 20px; |
| | | } |
| | | } |
| | | } |
| | | .factory_use_item { |
| | | margin-top: 10px; |
| | | } |
| | | .mart5 { |
| | | margin-top: 5px; |
| | | } |
| | | .custom-height { |
| | | height: 200px; /* æè
ä½¿ç¨ min-height */ |
| | | } |
| | | .auto-height-grid .xe-body .xe-body--row { |
| | | height: auto; /* æè
ä½¿ç¨ min-height */ |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form |
| | | class="responsive-form" |
| | | :model="queryParams" |
| | | ref="queryRef" |
| | | :inline="true" |
| | | v-show="showSearch" |
| | | label-width="90px" |
| | | > |
| | | <el-row type="flex" justify="left"> |
| | | <el-col :span="5"> |
| | | <el-form-item label="éæ±è¿½æº¯ID" prop="description"> |
| | | <el-input |
| | | style="width: 140px" |
| | | v-model="queryParams.description" |
| | | placeholder="请è¾å
¥éæ±è¿½æº¯ID" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="5"> |
| | | <el-form-item label="æå·" prop="description"> |
| | | <el-input |
| | | style="width: 140px" |
| | | v-model="queryParams.description" |
| | | placeholder="请è¾å
¥æå·" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="14" style="text-align: right"> |
| | | <el-form-item class="column-with-margin"> |
| | | <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-row :gutter="10" class="mb8"> |
| | | |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="Download" |
| | | @click="handleExport" |
| | | v-hasPermi="['core:calendar:export']" |
| | | >导åº</el-button |
| | | > |
| | | </el-col> |
| | | <right-toolbar |
| | | v-model:showSearch="showSearch" |
| | | @queryTable="getList" |
| | | ></right-toolbar> |
| | | </el-row> |
| | | <HxlhTable |
| | | style="width: 100%" |
| | | :columns="columns" |
| | | :data="calendarList" |
| | | :loading="loading" |
| | | :height="height" |
| | | ref="tableRef" |
| | | :page="page" |
| | | @changePageNo="changePageNo" |
| | | @changePageSize="changePageSize" |
| | | @on-checkbox="handleCheckboxChange" |
| | | class="auto-height-grid" |
| | | > |
| | | </HxlhTable> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="Calendar"> |
| | | import HxlhTable from "@/components/HxlhTable"; |
| | | import { |
| | | listCalendar, |
| | | getCalendar, |
| | | delCalendar, |
| | | addCalendar, |
| | | updateCalendar, |
| | | } from "@/api/basicData/calendar"; |
| | | import axios from "axios"; |
| | | import { listAll_plant } from "@/api/basicData/plant"; |
| | | import { listAll_shop, listAps_shop } from "@/api/basicData/shop"; |
| | | import { selectProcessNameList } from "@/api/basicData/processRoute.js"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const tableRef = ref(); |
| | | const calendarList = ref([]); |
| | | 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 data = reactive({ |
| | | form: { |
| | | type: "1", |
| | | }, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | description: null, |
| | | type: null, |
| | | effectiveDate: null, |
| | | expiringDate: null, |
| | | content: null, |
| | | applicableFactory: null, |
| | | applicableWorkshop: null, |
| | | applicableProcess: null, |
| | | }, |
| | | }); |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | const typeRadioNumber = ref(1); |
| | | const plantList = ref([]); |
| | | const shopList = ref([]); |
| | | const allShopList = ref([]); |
| | | const processList = ref([]); |
| | | const height = ref(document.documentElement.clientHeight - 220 + "px;"); |
| | | // è¡¨æ ¼é
ç½®-å表 |
| | | const columns = ref([ |
| | | { |
| | | title: "å·¥åå·", |
| | | field: "description", |
| | | width: 150, |
| | | align: "center" |
| | | }, |
| | | { |
| | | title: "åä»¶æå·", |
| | | field: "type", |
| | | width: 200, |
| | | align: "center" |
| | | }, |
| | | { |
| | | title: "ç产æ°é", |
| | | field: "effectiveDate", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "æªå¹é
ç产æ°é", |
| | | field: "expiringDate", |
| | | width: 200, |
| | | align: "center" |
| | | }, |
| | | { |
| | | title: "éç¨å·¥å", |
| | | field: "applicableFactory", |
| | | width: 200, |
| | | 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: "ç产åºå°", |
| | | field: "expiringDate", |
| | | width: 200, |
| | | align: "center" |
| | | }, |
| | | { |
| | | title: "计åå¼å·¥æ¥", |
| | | field: "createTime", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "计åå®å·¥æ¥", |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "å·¥åå建æ¶é´", |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | ]); |
| | | // å页屿§ |
| | | const page = ref({ |
| | | total: 0, |
| | | current: 1, |
| | | size: 10, |
| | | }); |
| | | |
| | | /** æ¥è¯¢æ¥å管çå表 */ |
| | | function getList() { |
| | | loading.value = true; |
| | | listCalendar(queryParams.value).then((response) => { |
| | | calendarList.value = response.rows; |
| | | page.value.total = response.total; |
| | | loading.value = false; |
| | | }); |
| | | axios |
| | | .all([ |
| | | /** æ¥è¯¢å·¥åå表 */ |
| | | listAll_plant({}), |
| | | /** æ¥è¯¢è½¦é´å表 */ |
| | | listAll_shop({}), |
| | | ]) |
| | | .then( |
| | | axios.spread((response1, response2) => { |
| | | plantList.value = response1.data; |
| | | shopList.value = response2.data; |
| | | loading.value = false; |
| | | }) |
| | | ) |
| | | .catch((error) => { |
| | | console.error("请æ±åºé:", error); |
| | | }); |
| | | } |
| | | |
| | | // åæ¶æé® |
| | | function cancel() { |
| | | open.value = false; |
| | | reset(); |
| | | } |
| | | |
| | | // 表åéç½® |
| | | function reset() { |
| | | form.value = { |
| | | id: null, |
| | | description: null, |
| | | type: "1", |
| | | effectiveDate: null, |
| | | expiringDate: null, |
| | | content: null, |
| | | applicableFactory: null, |
| | | applicableWorkshop: null, |
| | | applicableProcess: null, |
| | | createBy: null, |
| | | createTime: null, |
| | | updateBy: null, |
| | | updateTime: null, |
| | | }; |
| | | proxy.resetForm("calendarRef"); |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | function resetQuery() { |
| | | proxy.resetForm("queryRef"); |
| | | handleQuery(); |
| | | } |
| | | |
| | | // å¤éæ¡é䏿°æ® |
| | | function handleSelectionChange(selection) { |
| | | ids.value = selection.map((item) => item.id); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | async function handleAdd() { |
| | | reset(); |
| | | open.value = true; |
| | | title.value = "æ·»å æ¥å管ç"; |
| | | } |
| | | /** 鿩工ååäºä»¶ å è½½è½¦é´ å å·¥åº **/ |
| | | function changePlant(plant) { |
| | | listAps_shop({ plantCode: plant }).then((response) => { |
| | | shopList.value = response.rows; |
| | | }); |
| | | selectProcessNameList({ orgCode: plant }).then((response) => { |
| | | processList.value = response.rows; |
| | | }); |
| | | } |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | function handleUpdate(row) { |
| | | reset(); |
| | | const _id = row.id || ids.value; |
| | | getCalendar(_id).then((response) => { |
| | | form.value = response.data; |
| | | // form.value.content = JSON.parse(response.data.content.value); |
| | | if (form.value.type === "1") { |
| | | weekDaysSettingList.value = JSON.parse( |
| | | response.data.content.value |
| | | ).weekdays; |
| | | } else if (form.value.type === "2") { |
| | | holidays.value = JSON.parse(response.data.content.value).holidays; |
| | | } |
| | | |
| | | open.value = true; |
| | | title.value = "ä¿®æ¹æ¥å管ç"; |
| | | }); |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | function submitForm() { |
| | | proxy.$refs["calendarRef"].validate((valid) => { |
| | | if (valid) { |
| | | if (form.value.id != null) { |
| | | if (form.value.type === "1") { |
| | | updateCalendar({ |
| | | ...form.value, |
| | | content: { |
| | | weekdays: weekDaysSettingList.value, |
| | | }, |
| | | applicableWorkshop: form.value.applicableWorkshop, |
| | | applicableProcess: form.value.applicableProcess, |
| | | }).then((response) => { |
| | | proxy.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } else if (form.value.type === "2") { |
| | | updateCalendar({ |
| | | ...form.value, |
| | | content: { |
| | | holidays: holidays.value, |
| | | }, |
| | | applicableWorkshop: form.value.applicableWorkshop, |
| | | applicableProcess: form.value.applicableProcess, |
| | | }).then((response) => { |
| | | proxy.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } |
| | | } else { |
| | | if (form.value.type === "1") { |
| | | addCalendar({ |
| | | ...form.value, |
| | | content: { |
| | | weekdays: weekDaysSettingList.value, |
| | | }, |
| | | }).then((response) => { |
| | | proxy.$modal.msgSuccess("æ°å¢æå"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } else if (form.value.type === "2") { |
| | | addCalendar({ |
| | | ...form.value, |
| | | content: { |
| | | holidays: holidays.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 delCalendar(_ids); |
| | | }) |
| | | .then(() => { |
| | | getList(); |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | }) |
| | | .catch(() => {}); |
| | | } |
| | | |
| | | /** å¯¼åºæé®æä½ */ |
| | | function handleExport() { |
| | | proxy.download( |
| | | "core/calendar/export", |
| | | { |
| | | ...queryParams.value, |
| | | }, |
| | | `calendar_${new Date().getTime()}.xlsx` |
| | | ); |
| | | } |
| | | function handleSwitchType(e) { |
| | | typeRadioNumber.value = e; |
| | | form.value.type = e; |
| | | form.value.effectiveDate = null; |
| | | form.value.expiringDate = null; |
| | | form.value.content = null; |
| | | form.value.applicableFactory = null; |
| | | form.value.applicableWorkshop = null; |
| | | form.value.applicableProcess = null; |
| | | } |
| | | function changePageNo(currentPage) { |
| | | queryParams.value.pageNum = currentPage; |
| | | page.value.current = currentPage; |
| | | getList(); |
| | | } |
| | | function changePageSize(pageSize) { |
| | | page.value.current = 1; |
| | | queryParams.value.pageNum = 1; |
| | | queryParams.value.pageSize = pageSize; |
| | | getList(); |
| | | } |
| | | // å¤éæ¡é䏿°æ® |
| | | const handleCheckboxChange = (data) => { |
| | | ids.value = data.records.map((item) => item.id); |
| | | single.value = data.records.length !== 1; |
| | | multiple.value = !data.records.length; |
| | | }; |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .column-with-margin { |
| | | margin-right: 0px; |
| | | } |
| | | .title_bar_line { |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | align-items: center; |
| | | color: #333; |
| | | margin-bottom: 10px; |
| | | .line_short { |
| | | width: 5%; |
| | | height: 1px; |
| | | margin-right: 20px; |
| | | border-top: 1px solid #ddd; |
| | | } |
| | | .line_long { |
| | | width: 60%; |
| | | height: 1px; |
| | | margin-left: 20px; |
| | | border-top: 1px solid #ddd; |
| | | } |
| | | } |
| | | .week_flex { |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | align-content: center; |
| | | color: #606266; |
| | | font-weight: 700; |
| | | margin-left: 20px; |
| | | &.mt20 { |
| | | margin-top: 20px; |
| | | margin-left: 0 !important; |
| | | } |
| | | .week_flex_item { |
| | | &:nth-child(1) { |
| | | margin-top: 5px; |
| | | } |
| | | &:nth-child(2) { |
| | | margin-left: 20px; |
| | | } |
| | | } |
| | | } |
| | | .factory_use_item { |
| | | margin-top: 10px; |
| | | } |
| | | .mart5 { |
| | | margin-top: 5px; |
| | | } |
| | | .custom-height { |
| | | height: 200px; /* æè
ä½¿ç¨ min-height */ |
| | | } |
| | | .auto-height-grid .xe-body .xe-body--row { |
| | | height: auto; /* æè
ä½¿ç¨ min-height */ |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form |
| | | class="responsive-form" |
| | | :model="queryParams" |
| | | ref="queryRef" |
| | | :inline="true" |
| | | v-show="showSearch" |
| | | label-width="90px" |
| | | > |
| | | <el-row type="flex" justify="left"> |
| | | <el-col :span="5"> |
| | | <el-form-item label="éæ±è¿½æº¯ID" prop="description"> |
| | | <el-input |
| | | style="width: 140px" |
| | | v-model="queryParams.description" |
| | | placeholder="请è¾å
¥éæ±è¿½æº¯ID" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="5"> |
| | | <el-form-item label="æå·" prop="description"> |
| | | <el-input |
| | | style="width: 140px" |
| | | v-model="queryParams.description" |
| | | placeholder="请è¾å
¥æå·" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="14" style="text-align: right"> |
| | | <el-form-item class="column-with-margin"> |
| | | <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-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="Download" |
| | | @click="handleExport" |
| | | v-hasPermi="['core:calendar:export']" |
| | | >导åº</el-button |
| | | > |
| | | </el-col> |
| | | <right-toolbar |
| | | v-model:showSearch="showSearch" |
| | | @queryTable="getList" |
| | | ></right-toolbar> |
| | | </el-row> |
| | | <HxlhTable |
| | | style="width: 100%" |
| | | :columns="columns" |
| | | :data="calendarList" |
| | | :loading="loading" |
| | | :height="height" |
| | | ref="tableRef" |
| | | :page="page" |
| | | @changePageNo="changePageNo" |
| | | @changePageSize="changePageSize" |
| | | @on-checkbox="handleCheckboxChange" |
| | | class="auto-height-grid" |
| | | > |
| | | </HxlhTable> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="Calendar"> |
| | | import HxlhTable from "@/components/HxlhTable"; |
| | | import { |
| | | listCalendar, |
| | | getCalendar, |
| | | delCalendar, |
| | | addCalendar, |
| | | updateCalendar, |
| | | } from "@/api/basicData/calendar"; |
| | | import axios from "axios"; |
| | | import { listAll_plant } from "@/api/basicData/plant"; |
| | | import { listAll_shop, listAps_shop } from "@/api/basicData/shop"; |
| | | import { selectProcessNameList } from "@/api/basicData/processRoute.js"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const tableRef = ref(); |
| | | const calendarList = ref([]); |
| | | 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 data = reactive({ |
| | | form: { |
| | | type: "1", |
| | | }, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | description: null, |
| | | type: null, |
| | | effectiveDate: null, |
| | | expiringDate: null, |
| | | content: null, |
| | | applicableFactory: null, |
| | | applicableWorkshop: null, |
| | | applicableProcess: null, |
| | | }, |
| | | }); |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | const typeRadioNumber = ref(1); |
| | | const plantList = ref([]); |
| | | const shopList = ref([]); |
| | | const allShopList = ref([]); |
| | | const processList = ref([]); |
| | | const height = ref(document.documentElement.clientHeight - 220 + "px;"); |
| | | // è¡¨æ ¼é
ç½®-å表 |
| | | const columns = ref([ |
| | | { |
| | | title: "éæ±ID", |
| | | field: "description", |
| | | width: 150, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "éæ±è¿½æº¯ID", |
| | | field: "type", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "æå·", |
| | | field: "effectiveDate", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "BOMä½é¶ç ", |
| | | field: "expiringDate", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "å¹é
ç¶æ", |
| | | field: "expiringDate", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "å¹é
模å¼", |
| | | field: "createTime", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "æªå¹é
éæ±æ°é", |
| | | field: "createTime", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "计åå¼å·¥æ¥", |
| | | field: "createTime", |
| | | width: 200, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "计åå®å·¥æ¥", |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "éæ±æ¥æ", |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | { |
| | | title: "éç¨å·¥å", |
| | | field: "applicableFactory", |
| | | width: 200, |
| | | 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: "ç产åºå°", |
| | | field: "updateTime", |
| | | width: 100, |
| | | align: "center", |
| | | }, |
| | | ]); |
| | | // å页屿§ |
| | | const page = ref({ |
| | | total: 0, |
| | | current: 1, |
| | | size: 10, |
| | | }); |
| | | |
| | | /** æ¥è¯¢æ¥å管çå表 */ |
| | | function getList() { |
| | | loading.value = true; |
| | | listCalendar(queryParams.value).then((response) => { |
| | | calendarList.value = response.rows; |
| | | page.value.total = response.total; |
| | | loading.value = false; |
| | | }); |
| | | axios |
| | | .all([ |
| | | /** æ¥è¯¢å·¥åå表 */ |
| | | listAll_plant({}), |
| | | /** æ¥è¯¢è½¦é´å表 */ |
| | | listAll_shop({}), |
| | | ]) |
| | | .then( |
| | | axios.spread((response1, response2) => { |
| | | plantList.value = response1.data; |
| | | shopList.value = response2.data; |
| | | loading.value = false; |
| | | }) |
| | | ) |
| | | .catch((error) => { |
| | | console.error("请æ±åºé:", error); |
| | | }); |
| | | } |
| | | |
| | | // åæ¶æé® |
| | | function cancel() { |
| | | open.value = false; |
| | | reset(); |
| | | } |
| | | |
| | | // 表åéç½® |
| | | function reset() { |
| | | form.value = { |
| | | id: null, |
| | | description: null, |
| | | type: "1", |
| | | effectiveDate: null, |
| | | expiringDate: null, |
| | | content: null, |
| | | applicableFactory: null, |
| | | applicableWorkshop: null, |
| | | applicableProcess: null, |
| | | createBy: null, |
| | | createTime: null, |
| | | updateBy: null, |
| | | updateTime: null, |
| | | }; |
| | | proxy.resetForm("calendarRef"); |
| | | } |
| | | |
| | | /** æç´¢æé®æä½ */ |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | function resetQuery() { |
| | | proxy.resetForm("queryRef"); |
| | | handleQuery(); |
| | | } |
| | | |
| | | // å¤éæ¡é䏿°æ® |
| | | function handleSelectionChange(selection) { |
| | | ids.value = selection.map((item) => item.id); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | async function handleAdd() { |
| | | reset(); |
| | | open.value = true; |
| | | title.value = "æ·»å æ¥å管ç"; |
| | | } |
| | | /** 鿩工ååäºä»¶ å è½½è½¦é´ å å·¥åº **/ |
| | | function changePlant(plant) { |
| | | listAps_shop({ plantCode: plant }).then((response) => { |
| | | shopList.value = response.rows; |
| | | }); |
| | | selectProcessNameList({ orgCode: plant }).then((response) => { |
| | | processList.value = response.rows; |
| | | }); |
| | | } |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | function handleUpdate(row) { |
| | | reset(); |
| | | const _id = row.id || ids.value; |
| | | getCalendar(_id).then((response) => { |
| | | form.value = response.data; |
| | | // form.value.content = JSON.parse(response.data.content.value); |
| | | if (form.value.type === "1") { |
| | | weekDaysSettingList.value = JSON.parse( |
| | | response.data.content.value |
| | | ).weekdays; |
| | | } else if (form.value.type === "2") { |
| | | holidays.value = JSON.parse(response.data.content.value).holidays; |
| | | } |
| | | |
| | | open.value = true; |
| | | title.value = "ä¿®æ¹æ¥å管ç"; |
| | | }); |
| | | } |
| | | |
| | | /** æäº¤æé® */ |
| | | function submitForm() { |
| | | proxy.$refs["calendarRef"].validate((valid) => { |
| | | if (valid) { |
| | | if (form.value.id != null) { |
| | | if (form.value.type === "1") { |
| | | updateCalendar({ |
| | | ...form.value, |
| | | content: { |
| | | weekdays: weekDaysSettingList.value, |
| | | }, |
| | | applicableWorkshop: form.value.applicableWorkshop, |
| | | applicableProcess: form.value.applicableProcess, |
| | | }).then((response) => { |
| | | proxy.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } else if (form.value.type === "2") { |
| | | updateCalendar({ |
| | | ...form.value, |
| | | content: { |
| | | holidays: holidays.value, |
| | | }, |
| | | applicableWorkshop: form.value.applicableWorkshop, |
| | | applicableProcess: form.value.applicableProcess, |
| | | }).then((response) => { |
| | | proxy.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } |
| | | } else { |
| | | if (form.value.type === "1") { |
| | | addCalendar({ |
| | | ...form.value, |
| | | content: { |
| | | weekdays: weekDaysSettingList.value, |
| | | }, |
| | | }).then((response) => { |
| | | proxy.$modal.msgSuccess("æ°å¢æå"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } else if (form.value.type === "2") { |
| | | addCalendar({ |
| | | ...form.value, |
| | | content: { |
| | | holidays: holidays.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 delCalendar(_ids); |
| | | }) |
| | | .then(() => { |
| | | getList(); |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | }) |
| | | .catch(() => {}); |
| | | } |
| | | |
| | | /** å¯¼åºæé®æä½ */ |
| | | function handleExport() { |
| | | proxy.download( |
| | | "core/calendar/export", |
| | | { |
| | | ...queryParams.value, |
| | | }, |
| | | `calendar_${new Date().getTime()}.xlsx` |
| | | ); |
| | | } |
| | | function handleSwitchType(e) { |
| | | typeRadioNumber.value = e; |
| | | form.value.type = e; |
| | | form.value.effectiveDate = null; |
| | | form.value.expiringDate = null; |
| | | form.value.content = null; |
| | | form.value.applicableFactory = null; |
| | | form.value.applicableWorkshop = null; |
| | | form.value.applicableProcess = null; |
| | | } |
| | | function changePageNo(currentPage) { |
| | | queryParams.value.pageNum = currentPage; |
| | | page.value.current = currentPage; |
| | | getList(); |
| | | } |
| | | function changePageSize(pageSize) { |
| | | page.value.current = 1; |
| | | queryParams.value.pageNum = 1; |
| | | queryParams.value.pageSize = pageSize; |
| | | getList(); |
| | | } |
| | | // å¤éæ¡é䏿°æ® |
| | | const handleCheckboxChange = (data) => { |
| | | ids.value = data.records.map((item) => item.id); |
| | | single.value = data.records.length !== 1; |
| | | multiple.value = !data.records.length; |
| | | }; |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .column-with-margin { |
| | | margin-right: 0px; |
| | | } |
| | | .title_bar_line { |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | align-items: center; |
| | | color: #333; |
| | | margin-bottom: 10px; |
| | | .line_short { |
| | | width: 5%; |
| | | height: 1px; |
| | | margin-right: 20px; |
| | | border-top: 1px solid #ddd; |
| | | } |
| | | .line_long { |
| | | width: 60%; |
| | | height: 1px; |
| | | margin-left: 20px; |
| | | border-top: 1px solid #ddd; |
| | | } |
| | | } |
| | | .week_flex { |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | align-content: center; |
| | | color: #606266; |
| | | font-weight: 700; |
| | | margin-left: 20px; |
| | | &.mt20 { |
| | | margin-top: 20px; |
| | | margin-left: 0 !important; |
| | | } |
| | | .week_flex_item { |
| | | &:nth-child(1) { |
| | | margin-top: 5px; |
| | | } |
| | | &:nth-child(2) { |
| | | margin-left: 20px; |
| | | } |
| | | } |
| | | } |
| | | .factory_use_item { |
| | | margin-top: 10px; |
| | | } |
| | | .mart5 { |
| | | margin-top: 5px; |
| | | } |
| | | .custom-height { |
| | | height: 200px; /* æè
ä½¿ç¨ min-height */ |
| | | } |
| | | .auto-height-grid .xe-body .xe-body--row { |
| | | height: auto; /* æè
ä½¿ç¨ min-height */ |
| | | } |
| | | </style> |