Merge remote-tracking branch 'origin/dev' into dev
# Conflicts:
# src/views/mainPlan/platePlanList/index.vue
| | |
| | | # æ è¯æ¬å°å¼åæå¡ï¼ç¨äºGateWay转åå°æ¬å°æå¡ |
| | | # é
åå端æå¡ |
| | | # VITE_APP_LOCAL = 'int' |
| | | VITE_APP_LOCAL = 'zhl' |
| | | # VITE_APP_LOCAL = 'zhl' |
| | | VITE_APP_LOCAL = 'hjy' |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // æ°ä½ç®¡è·¯äº§è½è§åå表 |
| | | export function listGasPlan(query) { |
| | | return request({ |
| | | url: '/aps/gasPipelineCapacityPlan/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢é£é计å管çè¯¦ç» |
| | | export function getGasPlanSave(data) { |
| | | return request({ |
| | | url: '/aps/gasPipelineCapacityPlan', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | |
| | | :tree-config="treeConfig" |
| | | :row-style="rowStyle" |
| | | :virtualYConfig="virtualYConfig" |
| | | :edit-config="editConfig" |
| | | @sort-change="sortChange" |
| | | @page-change="pagerChange" |
| | | @form-submit="findList" |
| | |
| | | default: () => { |
| | | return {}; |
| | | }, |
| | | }, |
| | | editConfig:{ |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | }, |
| | | } |
| | | }); |
| | | |
| | |
| | | <template> |
| | | <HxlhTable |
| | | style="width: 100%" |
| | | :columns="columns" |
| | | :data="gasPlanList" |
| | | :loading="loading" |
| | | :height="height" |
| | | <div class="app-container"> |
| | | <el-form |
| | | class="responsive-form" |
| | | :model="queryParams" |
| | | ref="queryRef" |
| | | :inline="true" |
| | | label-width="68px" |
| | | > |
| | | </HxlhTable> |
| | | <el-row type="flex" justify="left"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="éæ©æä»½" prop="description"> |
| | | <el-date-picker |
| | | clearable |
| | | v-model="queryParams.date" |
| | | type="month" |
| | | value-format="YYYY-MM" |
| | | placeholder="éæ©æä»½" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="18" 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> |
| | | <div class="box_container"> |
| | | <div class="title_text">管路è§å产è½</div> |
| | | <div class="tabel_container"> |
| | | <!-- <HxlhTable |
| | | style="width: 100%" |
| | | :columns="columns" |
| | | :data="routePlanList" |
| | | :loading="loading" |
| | | :height="height" |
| | | :editConfig="editConfig" |
| | | > |
| | | <template #edit_role="{ row }"> |
| | | <vxe-select |
| | | v-model="row.dayProduceType" |
| | | :options="dayProduceTypeOptions" |
| | | filterable |
| | | ></vxe-select> |
| | | </template> |
| | | </HxlhTable> --> |
| | | <vxe-table |
| | | border |
| | | ref="xTable" |
| | | show-overflow |
| | | :loading="loading" |
| | | :height="height" |
| | | :edit-config="{ mode: 'row', trigger: 'click', showStatus: true }" |
| | | :data="routePlanList" |
| | | @cell-click="cellClickEvent" |
| | | > |
| | | <vxe-column field="processName" title="æ åå·¥åºåç§°" min-width="150"> |
| | | </vxe-column> |
| | | <!-- :edit-render="sexEditRender" --> |
| | | <vxe-column |
| | | field="dayProduceType" |
| | | title="æ¥äº§åºç±»å" |
| | | min-width="160" |
| | | :edit-render="{ }" |
| | | > |
| | | <template #edit="{ row }"> |
| | | <vxe-select v-model="row.dayProduceType" :options="dayProduceTypeOptions"></vxe-select> |
| | | </template> |
| | | <template #default="{ row }"> |
| | | <span>{{ formatTypeLabel([row.dayProduceType]) }}</span> |
| | | </template> |
| | | </vxe-column> |
| | | <vxe-column |
| | | field="dayProduceNum" |
| | | title="æ¥äº§åºæ°é" |
| | | min-width="200" |
| | | :edit-render="{ autoFocus: 'input' }" |
| | | > |
| | | <template #edit="{ row }"> |
| | | <el-input-number |
| | | v-model="row.dayProduceNum" |
| | | size="mini" |
| | | /> |
| | | </template> |
| | | </vxe-column> |
| | | <vxe-column |
| | | field="dayProduceUnit" |
| | | title="æ¥äº§åºåä½" |
| | | min-width="200" |
| | | :edit-render="{ autoFocus: 'input' }" |
| | | > |
| | | <template #edit="{ row }"> |
| | | <el-input v-model="row.dayProduceUnit" /> |
| | | </template> |
| | | </vxe-column> |
| | | <vxe-column |
| | | field="personnelNumber" |
| | | title="äººåæ°é" |
| | | min-width="200" |
| | | :edit-render="{ autoFocus: 'input' }" |
| | | > |
| | | <template #edit="{ row }"> |
| | | <el-input-number |
| | | v-model="row.personnelNumber" |
| | | /> |
| | | </template> |
| | | </vxe-column> |
| | | <vxe-column |
| | | field="dayProduceAllNum" |
| | | title="æ¥äº§åºæ»æ°é" |
| | | min-width="200" |
| | | :edit-render="{ autoFocus: 'input' }" |
| | | > |
| | | <template #edit="{ row }"> |
| | | <el-input-number |
| | | v-model="row.dayProduceAllNum" |
| | | disabled |
| | | /> |
| | | </template> |
| | | </vxe-column> |
| | | <vxe-column |
| | | field="days" |
| | | title="天æ°" |
| | | min-width="200" |
| | | :edit-render="{ autoFocus: 'input' }" |
| | | > |
| | | <template #edit="{ row }"> |
| | | <el-input-number v-model="row.days" /> |
| | | </template> |
| | | </vxe-column> |
| | | <vxe-column |
| | | field="monthProduceAllNum" |
| | | title="æäº§åºæ°é" |
| | | min-width="200" |
| | | :edit-render="{ autoFocus: 'input' }" |
| | | > |
| | | <template #edit="{ row }"> |
| | | <el-input-number v-model="row.monthProduceAllNum" disabled/> |
| | | </template> |
| | | </vxe-column> |
| | | <vxe-column |
| | | field="remark" |
| | | title="夿³¨" |
| | | min-width="200" |
| | | :edit-render="{ autoFocus: 'input' }" |
| | | > |
| | | <template #edit="{ row }"> |
| | | <el-input type="textarea" v-model="row.remark" /> |
| | | </template> |
| | | </vxe-column> |
| | | </vxe-table> |
| | | </div> |
| | | </div> |
| | | <div class="box_container"> |
| | | <div class="title_text">æ°ä½è§å产è½</div> |
| | | <div class="tabel_container"> |
| | | <!-- <HxlhTable |
| | | style="width: 100%" |
| | | :columns="columns" |
| | | :data="gasPlanList" |
| | | :loading="loading" |
| | | :height="height" |
| | | > |
| | | </HxlhTable> --> |
| | | <vxe-table |
| | | border |
| | | ref="xTable" |
| | | show-overflow |
| | | :loading="loading" |
| | | :height="height" |
| | | :edit-config="{ mode: 'row', trigger: 'click', showStatus: true }" |
| | | :data="gasPlanList" |
| | | @cell-click="cellClickEvent" |
| | | > |
| | | <vxe-column field="processName" title="æ åå·¥åºåç§°" min-width="150"> |
| | | </vxe-column> |
| | | <!-- :edit-render="sexEditRender" --> |
| | | <vxe-column |
| | | field="dayProduceType" |
| | | title="æ¥äº§åºç±»å" |
| | | min-width="160" |
| | | :edit-render="{ }" |
| | | > |
| | | <template #edit="{ row }"> |
| | | <vxe-select v-model="row.dayProduceType" :options="dayProduceTypeOptions"></vxe-select> |
| | | </template> |
| | | <template #default="{ row }"> |
| | | <span>{{ formatTypeLabel([row.dayProduceType]) }}</span> |
| | | </template> |
| | | </vxe-column> |
| | | <vxe-column |
| | | field="dayProduceNum" |
| | | title="æ¥äº§åºæ°é" |
| | | min-width="200" |
| | | :edit-render="{ autoFocus: 'input' }" |
| | | > |
| | | <template #edit="{ row }"> |
| | | <el-input-number |
| | | v-model="row.dayProduceNum" |
| | | size="mini" |
| | | /> |
| | | </template> |
| | | </vxe-column> |
| | | <vxe-column |
| | | field="dayProduceUnit" |
| | | title="æ¥äº§åºåä½" |
| | | min-width="200" |
| | | :edit-render="{ autoFocus: 'input' }" |
| | | > |
| | | <template #edit="{ row }"> |
| | | <el-input v-model="row.dayProduceUnit" /> |
| | | </template> |
| | | </vxe-column> |
| | | <vxe-column |
| | | field="personnelNumber" |
| | | title="äººåæ°é" |
| | | min-width="200" |
| | | :edit-render="{ autoFocus: 'input' }" |
| | | > |
| | | <template #edit="{ row }"> |
| | | <el-input-number |
| | | v-model="row.personnelNumber" |
| | | /> |
| | | </template> |
| | | </vxe-column> |
| | | <vxe-column |
| | | field="dayProduceAllNum" |
| | | title="æ¥äº§åºæ»æ°é" |
| | | min-width="200" |
| | | :edit-render="{ autoFocus: 'input' }" |
| | | > |
| | | <template #edit="{ row }"> |
| | | <el-input-number |
| | | v-model="row.dayProduceAllNum" |
| | | /> |
| | | </template> |
| | | </vxe-column> |
| | | <vxe-column |
| | | field="days" |
| | | title="天æ°" |
| | | min-width="200" |
| | | :edit-render="{ autoFocus: 'input' }" |
| | | > |
| | | <template #edit="{ row }"> |
| | | <el-input-number v-model="row.days" /> |
| | | </template> |
| | | </vxe-column> |
| | | <vxe-column |
| | | field="monthProduceAllNum" |
| | | title="æäº§åºæ°é" |
| | | min-width="200" |
| | | :edit-render="{ autoFocus: 'input' }" |
| | | > |
| | | <template #edit="{ row }"> |
| | | <el-input-number v-model="row.monthProduceAllNum" /> |
| | | </template> |
| | | </vxe-column> |
| | | <vxe-column |
| | | field="remark" |
| | | title="夿³¨" |
| | | min-width="200" |
| | | :edit-render="{ autoFocus: 'input' }" |
| | | > |
| | | <template #edit="{ row }"> |
| | | <el-input type="textarea" v-model="row.remark" /> |
| | | </template> |
| | | </vxe-column> |
| | | </vxe-table> |
| | | <div class="btn_center"> |
| | | <el-button type="primary" @click="handleSave">ä¿å</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- --> |
| | | </template> |
| | | <script setup> |
| | | const height = ref(document.documentElement.clientHeight - 270 + "px;"); |
| | | const loading = ref(true); |
| | | import HxlhTable from "@/components/HxlhTable"; |
| | | import { ElMessage } from "element-plus"; |
| | | import { listGasPlan, getGasPlanSave } from "@/api/mainPlan/gasPlanning"; |
| | | const height = ref(document.documentElement.clientHeight - 400 + "px;"); |
| | | const loading = ref(false); |
| | | const data = reactive({ |
| | | queryParams: { |
| | | date: "", |
| | | }, |
| | | }); |
| | | const { queryParams } = toRefs(data); |
| | | const gasPlanList = ref([]); |
| | | // è¡¨æ ¼é
ç½® |
| | | const columns = ref([ |
| | | { |
| | | title: "主件æå·", |
| | | field: "mainPartNumber", |
| | | width: 150, |
| | | }, |
| | | { |
| | | title: "ä¸å¡ç±»å", |
| | | field: "businessType", |
| | | }, |
| | | { |
| | | title: "åæ®å·", |
| | | field: "documentNumber", |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: "å½åå·¥åºå·", |
| | | field: "currentProcessNumberTxt", |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: "éæ±åç±»", |
| | | field: "requirementType", |
| | | width: 80, |
| | | }, |
| | | { |
| | | title: "åæ®ç¶æ", |
| | | field: "documentStatus", |
| | | width: 80, |
| | | }, |
| | | { |
| | | title: "å½åå·¥åº", |
| | | field: "workCenter", |
| | | width: 80, |
| | | }, |
| | | { |
| | | title: "计åå¼å·¥æ¥", |
| | | field: "processPlanStartDaytxt", |
| | | width: 140, |
| | | type: "html", |
| | | }, |
| | | { |
| | | title: "æå·", |
| | | field: "itemNumber", |
| | | width: 140, |
| | | type: "html", |
| | | }, |
| | | { |
| | | title: "å¾å·", |
| | | field: "drawingNo", |
| | | width: 120, |
| | | // format: 'YYYY-MM-DD' |
| | | }, |
| | | { |
| | | title: "çæ¬å·", |
| | | field: "versionNumber", |
| | | width: 140, |
| | | type: "html", |
| | | }, |
| | | { |
| | | title: "ç产æ°é", |
| | | field: "productionQuantity", |
| | | width: 140, |
| | | type: "html", |
| | | }, |
| | | { |
| | | title: "计åå®å·¥æ¥", |
| | | field: "planEndDay", |
| | | width: 140, |
| | | format: "YYYY-MM-DD hh:mm:ss", |
| | | }, |
| | | const routePlanList = ref([]); |
| | | const dayProduceTypeOptions = ref([ |
| | | { label: "å人æ¥äº§åº", value: "1" }, |
| | | { label: "åºå®æ¥äº§åº", value: "2" }, |
| | | ]); |
| | | |
| | | </script> |
| | | const formatTypeLabel = (list) => { |
| | | if (list) { |
| | | return list.map(type => { |
| | | const item = dayProduceTypeOptions.value.find(item => item.value === type) |
| | | return item ? item.label : type |
| | | }).join(',') |
| | | } |
| | | return '' |
| | | } |
| | | // è¡¨æ ¼é
ç½® |
| | | // const columns = ref([ |
| | | // // { |
| | | // // title: "è§å年份", |
| | | // // field: "year", |
| | | // // width: 150, |
| | | // // }, |
| | | // // { |
| | | // // title: "è§åæä»½", |
| | | // // field: "month", |
| | | // // }, |
| | | // // { |
| | | // // title: "ä¸ä¸", |
| | | // // field: "major", |
| | | // // width: 100, |
| | | // // }, |
| | | // { |
| | | // title: "æ åå·¥åºåç§°", |
| | | // field: "processName", |
| | | // width: 100, |
| | | // }, |
| | | // { |
| | | // title: "æ¥äº§åºç±»å", |
| | | // field: "dayProduceType", |
| | | // width: 140, |
| | | // editRender: {}, |
| | | // slots: { edit: "edit_role", default: "default_role" }, |
| | | // }, |
| | | // { |
| | | // title: "æ¥äº§åºæ°é", |
| | | // field: "dayProduceNum", |
| | | // width: 140, |
| | | // // editRender: { autoFocus: "input" }, |
| | | // // slots: { edit: "edit_name", default: "default_name" }, |
| | | // }, |
| | | // { |
| | | // title: "æ¥äº§åºæ°éåä½", |
| | | // field: "dayProduceUnit", |
| | | // width: 140, |
| | | // }, |
| | | // { |
| | | // title: "äººåæ°é", |
| | | // field: "personnelNumber", |
| | | // width: 140, |
| | | // type: "html", |
| | | // }, |
| | | // { |
| | | // title: "æ¥äº§åºæ»æ°é", |
| | | // field: "dayProduceAllNum", |
| | | // width: 140, |
| | | // type: "html", |
| | | // }, |
| | | // { |
| | | // title: "天æ°", |
| | | // field: "days", |
| | | // width: 120, |
| | | // // format: 'YYYY-MM-DD' |
| | | // }, |
| | | // { |
| | | // title: "æäº§åºæ»æ°é", |
| | | // field: "monthProduceAllNum", |
| | | // width: 140, |
| | | // type: "html", |
| | | // }, |
| | | // { |
| | | // title: "夿³¨", |
| | | // field: "remark", |
| | | // width: 140, |
| | | // type: "html", |
| | | // }, |
| | | // ]); |
| | | async function getRouteList(year, month) { |
| | | const res = await listGasPlan({ |
| | | major: "管路", |
| | | year, |
| | | month, |
| | | }); |
| | | console.log(res.rows, "getList"); |
| | | routePlanList.value = res.rows; |
| | | routePlanList.value = routePlanList.value.map((item, index) => { |
| | | return { |
| | | ...item, |
| | | dayProduceType: item.dayProduceType == null ? "" : item.dayProduceType, |
| | | dayProduceNum: item.dayProduceNum == null ? "0" : item.dayProduceNum, |
| | | dayProduceUnit: item.dayProduceUnit == null ? "个" : item.dayProduceUnit, |
| | | personnelNumber: |
| | | item.personnelNumber == null ? "1" : item.personnelNumber, |
| | | dayProduceAllNum: |
| | | item.dayProduceAllNum == null ? "0" : item.dayProduceNum*item.personnelNumber, |
| | | days: item.days == null ? "22" : item.days, |
| | | monthProduceAllNum: |
| | | item.monthProduceAllNum == null ? "0" : item.dayProduceAllNum*item.days, |
| | | }; |
| | | }); |
| | | loading.value = false; |
| | | } |
| | | async function getGasList(year, month) { |
| | | const res = await listGasPlan({ |
| | | major: "æ°ä½", |
| | | year, |
| | | month, |
| | | }); |
| | | console.log(res.rows, "getList"); |
| | | gasPlanList.value = res.rows; |
| | | gasPlanList.value = gasPlanList.value.map((item, index) => { |
| | | return { |
| | | ...item, |
| | | dayProduceType: item.dayProduceType == null ? "" : item.dayProduceType, |
| | | dayProduceNum: item.dayProduceNum == null ? "0" : item.dayProduceNum, |
| | | dayProduceUnit: item.dayProduceUnit == null ? "个" : item.dayProduceUnit, |
| | | personnelNumber: |
| | | item.personnelNumber == null ? "1" : item.personnelNumber, |
| | | dayProduceAllNum: |
| | | item.dayProduceAllNum == null ? "0" : item.dayProduceNum*item.personnelNumber, |
| | | days: item.days == null ? "22" : item.days, |
| | | monthProduceAllNum: |
| | | item.monthProduceAllNum == null ? "0" : item.dayProduceAllNum*item.days, |
| | | }; |
| | | }); |
| | | loading.value = false; |
| | | } |
| | | function cellClickEvent ({ row, column }){ |
| | | console.log(column,row) |
| | | row.dayProduceAllNum = row.dayProduceNum*row.personnelNumber |
| | | row.monthProduceAllNum = row.dayProduceAllNum*row.days |
| | | } |
| | | function handleQuery() { |
| | | console.log(queryParams.value.date, "scsciciisc"); |
| | | const year = queryParams.value.date.split("-")[0]; |
| | | const month = parseInt(queryParams.value.date.split("-")[1]); |
| | | getRouteList(year, month); |
| | | getGasList(year, month); |
| | | } |
| | | async function handleSave() { |
| | | const year = queryParams.value.date.split("-")[0]; |
| | | const month = parseInt(queryParams.value.date.split("-")[1]); |
| | | gasPlanList.value = gasPlanList.value.map((item)=>{ |
| | | return { |
| | | ...item, |
| | | major: "æ°ä½", |
| | | year, |
| | | month |
| | | } |
| | | }) |
| | | routePlanList.value = routePlanList.value.map((item)=>{ |
| | | return { |
| | | ...item, |
| | | major: "管路", |
| | | year, |
| | | month |
| | | } |
| | | }) |
| | | const res = await getGasPlanSave([ |
| | | ...gasPlanList.value, |
| | | ...routePlanList.value |
| | | ]) |
| | | ElMessage({ |
| | | message: "æ°æ®ä¿åæå", |
| | | type: "success", |
| | | }); |
| | | handleQuery() |
| | | console.log(res,"akiwjciwj") |
| | | } |
| | | onMounted(() => { |
| | | // getRouteList(); |
| | | // getGasList(); |
| | | }); |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .box_container { |
| | | width: 100%; |
| | | margin: 20px auto; |
| | | background: #fff; |
| | | border-radius: 5px; |
| | | box-shadow: 1px 1px 1px 4px#f1f1f1; |
| | | .title_text { |
| | | padding-top: 20px; |
| | | margin-left: 20px; |
| | | } |
| | | .tabel_container { |
| | | width: 98%; |
| | | margin: 20px auto; |
| | | } |
| | | } |
| | | .btn_center{ |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | margin-top:20px; |
| | | padding-bottom:20px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="Download" |
| | | @click="handleExport" |
| | | v-hasPermi="['apsPartRouteStat:export']" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="info" |
| | | plain |
| | | icon="Refresh" |
| | | @click="handleRefresh" |
| | | v-hasPermi="['apsPartRouteStat:edit']" |
| | | >æ´æ°</el-button> |
| | | </el-col> |
| | | <right-toolbar @queryTable="getList" :search="false"></right-toolbar> |
| | | </el-row> |
| | | <vxe-grid ref="gridRef" v-bind="gridOptions" :loading="loading"></vxe-grid> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="apsPartRouteStat"> |
| | | import { query,updateStat } from "@/api/mainPlan/partRouteStat.js"; |
| | | import { ref } from "vue"; |
| | | import * as XLSX from 'xlsx'; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | const loading = ref(true); |
| | | const gridRef = ref(); |
| | | const height = ref(document.documentElement.clientHeight - 130 + "px;") |
| | | const headers = ref([]); |
| | | const exportData = ref([]); |
| | | |
| | | const gridOptions = reactive({ |
| | | border: true, |
| | | stripe: true, |
| | | loading: false, |
| | | showOverflow: true, |
| | | showHeaderOverflow: true, |
| | | showFooterOverflow: true, |
| | | height: height, |
| | | columnConfig: { |
| | | resizable: true |
| | | }, |
| | | scrollX: { |
| | | enabled: true, |
| | | gt: 0, |
| | | threshold: 50 |
| | | }, |
| | | scrollY: { |
| | | enabled: true, |
| | | gt: 0, |
| | | threshold: 50 |
| | | } |
| | | }); |
| | | |
| | | let tableColumn = [] |
| | | let tableData = [] |
| | | let merges = []; |
| | | |
| | | /** æ¥è¯¢é¶ä»¶ç»è®¡è¡¨å表 */ |
| | | function getList() { |
| | | let rowKey = 0 |
| | | let colKey = 0 |
| | | headers.value = [] |
| | | exportData.value = [] |
| | | tableColumn = [] |
| | | tableData = [] |
| | | loading.value = true; |
| | | query().then(response => { |
| | | const colList = [] |
| | | let headersOne = [] |
| | | let headersTwo = [] |
| | | if(response.code == '200'){ |
| | | if (!response.planTitle) { |
| | | loading.value = false; |
| | | return; |
| | | } |
| | | headersOne.push('æ¥æ'); |
| | | headersTwo.push('èµæºç»'); |
| | | colList.push({ |
| | | field: 'dateCol', |
| | | title: 'æ¥æ', |
| | | fixed: 'left', |
| | | children: [ |
| | | { field: `resourceName`, title: 'èµæºç»', width: 250, type: 'html'}, |
| | | ], |
| | | width: 160 |
| | | }) |
| | | response.planTitle.forEach(item => { |
| | | headersOne.push(item); |
| | | headersOne.push(''); |
| | | headersOne.push(''); |
| | | headersTwo.push('设计工æ¶'); |
| | | headersTwo.push('鿱工æ¶'); |
| | | headersTwo.push('产è½è´è·'); |
| | | colKey++ |
| | | colList.push({ |
| | | field: `dateColTime${colKey}`, |
| | | title: item, |
| | | children: [ |
| | | { field: `designTimes${colKey}`, title: '设计工æ¶', width: 80}, |
| | | { field: `requireTimes${colKey}`, title: '鿱工æ¶', width: 80}, |
| | | { field: `capacityLoad${colKey}`, title: '产è½è´è·', width: 80, type: 'html'}, |
| | | ], |
| | | width: 160 |
| | | }) |
| | | }); |
| | | |
| | | headers.value.push(headersOne); |
| | | headers.value.push(headersTwo); |
| | | |
| | | const columnList = [...tableColumn, ...colList] |
| | | const dataList = [] |
| | | let startCol = 1; |
| | | |
| | | //è·åmap |
| | | response.planTable.forEach(mapItem => { |
| | | rowKey++ |
| | | let lastCol = startCol + 2; |
| | | merges.push({ s: { r: 0, c: startCol }, e: { r: 0, c: lastCol} }); |
| | | startCol = lastCol + 1; |
| | | let data = []; |
| | | const item = { |
| | | id: `${rowKey}` |
| | | } |
| | | for (const [key, listValue] of Object.entries(mapItem)) { |
| | | data.push(key); |
| | | |
| | | let tableKey = 0; |
| | | let flag = false; |
| | | listValue.forEach(listItem => { |
| | | |
| | | tableKey++ |
| | | item[`designTimes${tableKey}`] = listItem.designTimes; |
| | | item[`requireTimes${tableKey}`] = listItem.requireTimes; |
| | | item[`capacityLoad${tableKey}`] = listItem.capacityLoad > 100 ? `<font color="red">${listItem.capacityLoad}%</font>` :listItem.capacityLoad+'%'; |
| | | data.push(listItem.designTimes); |
| | | data.push(listItem.requireTimes); |
| | | data.push(listItem.capacityLoad+'%'); |
| | | if (listItem.capacityLoad > 100) { |
| | | flag = true; |
| | | } |
| | | }); |
| | | |
| | | item[`resourceName`] = flag ? `<div class='el-badge'><sup class="el-badge__content is-fixed is-dot"></sup>${key}</div>` : key; |
| | | } |
| | | exportData.value.push(data); |
| | | dataList.push(item); |
| | | }); |
| | | |
| | | const $grid = gridRef.value |
| | | if ($grid) { |
| | | tableColumn = columnList |
| | | tableData = [...tableData, ...dataList] |
| | | $grid.loadColumn(tableColumn) |
| | | $grid.loadData(tableData) |
| | | gridOptions.loading = false |
| | | } |
| | | |
| | | loading.value = false; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** å¯¼åºæé®æä½ */ |
| | | function handleExport() { |
| | | |
| | | // åå¹¶è¡¨å¤´åæ°æ® |
| | | const finalData = [...headers.value, ...exportData.value]; |
| | | |
| | | // å°æ°æ®è½¬æ¢ä¸º worksheet |
| | | const ws = XLSX.utils.aoa_to_sheet(finalData); |
| | | |
| | | // åå¹¶åå
æ ¼ï¼å¦æéè¦ï¼ |
| | | /* ws['!merges'] = [ |
| | | { s: { r: 0, c: 1 }, e: { r: 0, c: 3 } }, |
| | | { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } } |
| | | ]; */ |
| | | |
| | | ws['!merges'] = merges; |
| | | |
| | | // å建 workbook |
| | | const wb = XLSX.utils.book_new(); |
| | | // å° worksheet æ·»å å° workbook ä¸ |
| | | XLSX.utils.book_append_sheet(wb, ws, 'Sheet1'); |
| | | // å¯¼åºæä»¶ |
| | | XLSX.writeFile(wb, `apsPartRouteStat_${new Date().getTime()}.xlsx`); |
| | | |
| | | } |
| | | |
| | | /** å·æ°æé®æä½ */ |
| | | function handleRefresh(){ |
| | | updateStat().then(response => { |
| | | if(response.code == '200'){ |
| | | getList(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | getList(); |
| | | </script> |
| | |
| | | const proxyConfig = () => { |
| | | const personProxy = { |
| | | "/prod-api": { |
| | | target: "http://192.168.50.13:8080", // å¼åç¯å¢çå端å°å |
| | | target: "http://192.168.50.160:8080",//"http://192.168.50.13:8080", // å¼åç¯å¢çå端å°å |
| | | changeOrigin: true, |
| | | rewrite: (path) => path.replace(/^\/prod-api/, ""), |
| | | }, |
| | |
| | | |
| | | switch (VITE_APP_ENV) { |
| | | case "development": |
| | | return devProxy; |
| | | return personProxy; |
| | | case "int": |
| | | return devProxy; |
| | | case "uat": |