Showing
4 changed files
with
232 additions
and
12 deletions
src/api/home.js
0 → 100644
| ... | @@ -98,7 +98,7 @@ let ductLabels = { | ... | @@ -98,7 +98,7 @@ let ductLabels = { |
| 98 | }, | 98 | }, |
| 99 | "status": { | 99 | "status": { |
| 100 | "0": "未处理", | 100 | "0": "未处理", |
| 101 | - "1": "已处理", | 101 | + "1": "处理成功", |
| 102 | "2": "无需处理", | 102 | "2": "无需处理", |
| 103 | "3": "处理失败", | 103 | "3": "处理失败", |
| 104 | "4": "校验不通过", | 104 | "4": "校验不通过", | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | - <div></div> | 2 | + <div style="padding:10px" v-loading="loading"> |
| 3 | + <!-- 配舱汇总信息 --> | ||
| 4 | + <el-card class="mb10" ref="card1"> | ||
| 5 | + <el-divider content-position="left">今日配舱汇总</el-divider> | ||
| 6 | + <el-row :gutter="10"> | ||
| 7 | + <el-col :span="6"> | ||
| 8 | + <div class="allInformation"> | ||
| 9 | + <div class="informationItem">航班总重量(KG)</div> | ||
| 10 | + <div class="informationNum">{{ totalWeight }}</div> | ||
| 11 | + </div> | ||
| 12 | + </el-col> | ||
| 13 | + <el-col :span="6"> | ||
| 14 | + <div class="allInformation"> | ||
| 15 | + <div class="informationItem">已配重量(KG)</div> | ||
| 16 | + <div class="informationNum">{{ allocationWeight }}</div> | ||
| 17 | + </div> | ||
| 18 | + </el-col> | ||
| 19 | + <el-col :span="6"> | ||
| 20 | + <div class="allInformation"> | ||
| 21 | + <div class="informationItem">配舱比例(百分比)</div> | ||
| 22 | + <div class="informationNum">{{ (percentage == 0 ? 0 : ((percentage) * 100).toFixed(2)) + '%' }}</div> | ||
| 23 | + </div> | ||
| 24 | + </el-col> | ||
| 25 | + </el-row> | ||
| 26 | + </el-card> | ||
| 27 | + <!-- 今日航班box --> | ||
| 28 | + <el-card class="mb10" ref="card2"> | ||
| 29 | + <el-form ref="indexForm" size="mini" inline @submit.native.prevent> | ||
| 30 | + <el-form-item label="配载航班日期"> | ||
| 31 | + <el-date-picker v-model="selectData.fltDate" type="date" placeholder="选择日期" value-format="yyyy-MM-dd" | ||
| 32 | + :clearable="false" @change="getFlight"> | ||
| 33 | + </el-date-picker> | ||
| 34 | + </el-form-item> | ||
| 35 | + <el-form-item label="航班种类"> | ||
| 36 | + <el-select v-model="selectData.kindId" placeholder="不限" @change="getFlight" clearable> | ||
| 37 | + <el-option v-for="item in fltKindIdList" :label="item.englishName" :value="item.id"></el-option> | ||
| 38 | + </el-select> | ||
| 39 | + </el-form-item> | ||
| 40 | + <el-form-item> | ||
| 41 | + <el-button type="primary" icon="el-icon-refresh" :loading="loading" @click="getFlight"></el-button> | ||
| 42 | + </el-form-item> | ||
| 43 | + </el-form> | ||
| 44 | + <el-row class="card2"> | ||
| 45 | + <el-col :span="1" v-for="item in tableData"> | ||
| 46 | + <div class="fltBox" @click="rowClick(item)" | ||
| 47 | + :style="{ backgroundColor: (item.percentage * 100).toFixed(2) >= 100 ? '#13ce66' : (item.percentage * 100).toFixed(2) >= 75 ? '#ffba00' : '#ff4949' }"> | ||
| 48 | + <div class="fltName">{{ item.fltNo }}</div> | ||
| 49 | + <div class="fltWeight">{{ (item.percentage == 0 ? 0 : ((item.percentage) * 100).toFixed(2)) + '%' }} | ||
| 50 | + </div> | ||
| 51 | + </div> | ||
| 52 | + </el-col> | ||
| 53 | + </el-row> | ||
| 54 | + <!-- 各航班配舱进度详情 --> | ||
| 55 | + <el-divider content-position="left">各航班配舱进度</el-divider> | ||
| 56 | + <Tables ref="indexTable" ductName="indexTable" :order="true" :data="tableData" :headerData="tableHeader" | ||
| 57 | + tableAlign="center" :showOverflowTooltip="false" :height="tableHeight" :totalCount="total" | ||
| 58 | + :page="selectData.page" :limitSize="selectData.size" :pageSizes="[100]" :pagination="false" | ||
| 59 | + @currentChange="currentChange" @rowClick="rowClick"> | ||
| 60 | + <template v-slot:percentage="scope"> | ||
| 61 | + <el-progress stroke-width="100" | ||
| 62 | + :color="(scope.row.percentage * 100).toFixed(2) >= 100 ? '#13ce66' : (scope.row.percentage * 100).toFixed(2) >= 75 ? '#ffba00' : '#ff4949'" | ||
| 63 | + :stroke-width="18" | ||
| 64 | + :percentage="scope.row.percentage == 0 ? 0 : Number((scope.row.percentage * 100).toFixed(2))"> | ||
| 65 | + </el-progress> | ||
| 66 | + </template> | ||
| 67 | + </Tables> | ||
| 68 | + </el-card> | ||
| 69 | + </div> | ||
| 3 | </template> | 70 | </template> |
| 71 | + | ||
| 4 | <script> | 72 | <script> |
| 5 | -import { delUser } from "@/api/system/user"; | 73 | +import { filghtKindData } from "@/api/flightInfoImport"; |
| 74 | +import { getOneDayFlight } from '@/api/home.js' | ||
| 6 | 75 | ||
| 7 | export default { | 76 | export default { |
| 77 | + name: 'Index', | ||
| 8 | props: { | 78 | props: { |
| 9 | user: { | 79 | user: { |
| 10 | - type: Object, | 80 | + type: Object |
| 11 | - }, | 81 | + } |
| 12 | }, | 82 | }, |
| 13 | data() { | 83 | data() { |
| 14 | return { | 84 | return { |
| 15 | - // 表单校验 | 85 | + selectData: { |
| 86 | + fltDate: null, | ||
| 87 | + kindId: null, | ||
| 88 | + page: 1, | ||
| 89 | + size: 1 | ||
| 90 | + },//查询条件 | ||
| 91 | + tableData: [],//table数据 | ||
| 92 | + tableHeader: this.tableHeaders['index'],//表头 | ||
| 93 | + fltKindIdList: [],//航班类型 | ||
| 94 | + percentage: 0,//配舱比例 | ||
| 95 | + totalWeight: 0,//航班总重量 | ||
| 96 | + allocationWeight: 0,//航班已配重量 | ||
| 97 | + type: "", | ||
| 98 | + tableHeight: null, | ||
| 99 | + total: 0, | ||
| 100 | + loading: false, | ||
| 16 | }; | 101 | }; |
| 17 | }, | 102 | }, |
| 103 | + created() { | ||
| 104 | + this.selectData.fltDate = this.nowDate(); | ||
| 105 | + this.getFltKindId() | ||
| 106 | + }, | ||
| 107 | + // activated() { | ||
| 108 | + // this.getFlight() | ||
| 109 | + // }, | ||
| 110 | + mounted() { | ||
| 111 | + this.tableHeight = window.innerHeight - this.$refs.card1.$el.offsetHeight - this.$refs.indexForm.$el.offsetHeight - 350 | ||
| 112 | + this.getFlight() | ||
| 113 | + }, | ||
| 18 | methods: { | 114 | methods: { |
| 19 | - submit() { | 115 | + //获取航班类型 |
| 20 | - this.msgSuccess("修改成功"); | 116 | + async getFltKindId() { |
| 21 | - delUser("112").then((response) => { | 117 | + filghtKindData().then(res => { |
| 22 | - this.msgSuccess("修改成功"); | 118 | + if (res.code === 200) { |
| 23 | - }); | 119 | + this.fltKindIdList = res.data |
| 120 | + } else { | ||
| 121 | + this.msgWarning(res.msg) | ||
| 122 | + } | ||
| 123 | + }).catch(err => { | ||
| 124 | + console.log(err) | ||
| 125 | + }) | ||
| 126 | + }, | ||
| 127 | + //获取首页信息(日期查询) | ||
| 128 | + async getFlight() { | ||
| 129 | + this.loading = true | ||
| 130 | + getOneDayFlight(this.selectData).then(res => { | ||
| 131 | + this.loading = false | ||
| 132 | + if (res.code === 200) { | ||
| 133 | + this.tableData = res.data.list | ||
| 134 | + this.percentage = res.data.percentage | ||
| 135 | + this.totalWeight = res.data.totalWeight | ||
| 136 | + this.allocationWeight = res.data.allocationWeight | ||
| 137 | + } else { | ||
| 138 | + this.msgWarning(res.msg) | ||
| 139 | + } | ||
| 140 | + }).catch(err => { | ||
| 141 | + this.loading = false | ||
| 142 | + console.log(err) | ||
| 143 | + }) | ||
| 24 | }, | 144 | }, |
| 145 | + //某行被点击 | ||
| 146 | + rowClick(val) { | ||
| 147 | + let obj = {} | ||
| 148 | + obj.fltNo = val.fltNo | ||
| 149 | + obj.fltDate = val.fltDate | ||
| 150 | + this.$router.push({ name: 'QueryCargo', params: obj }) | ||
| 151 | + }, | ||
| 152 | + //翻页 | ||
| 153 | + currentChange(val) { }, | ||
| 25 | }, | 154 | }, |
| 26 | }; | 155 | }; |
| 27 | </script> | 156 | </script> |
| 28 | 157 | ||
| 158 | +<style lang="scss" scoped> | ||
| 159 | +.cardTop { | ||
| 160 | + height: 400px; | ||
| 161 | + margin: 10px; | ||
| 162 | + padding: 10px; | ||
| 163 | + overflow: auto; | ||
| 164 | + | ||
| 165 | + &::-webkit-scrollbar { | ||
| 166 | + height: 5px; | ||
| 167 | + width: 5px; | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | + &::-webkit-scrollbar-track { | ||
| 171 | + background-color: #fff; | ||
| 172 | + } | ||
| 173 | + | ||
| 174 | + &::-webkit-scrollbar-thumb { | ||
| 175 | + background-color: #ccc; | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + &::-webkit-scrollbar-thumb:hover { | ||
| 179 | + background-color: #409eff; | ||
| 180 | + } | ||
| 181 | + | ||
| 182 | + .label { | ||
| 183 | + font-weight: 700; | ||
| 184 | + } | ||
| 185 | + | ||
| 186 | + .totalWeight { | ||
| 187 | + font-size: 12px; | ||
| 188 | + } | ||
| 189 | +} | ||
| 190 | + | ||
| 191 | +.progressTab { | ||
| 192 | + height: 100%; | ||
| 193 | +} | ||
| 194 | + | ||
| 195 | +.allInformation { | ||
| 196 | + width: 100%; | ||
| 197 | + height: 100px; | ||
| 198 | + padding: 10px 20px; | ||
| 199 | + color: #fff; | ||
| 200 | + background-color: #409eff; | ||
| 201 | + | ||
| 202 | + .allInformation { | ||
| 203 | + font-size: 12px; | ||
| 204 | + } | ||
| 205 | + | ||
| 206 | + .informationNum { | ||
| 207 | + font-size: 24px; | ||
| 208 | + margin-top: 25px; | ||
| 209 | + } | ||
| 210 | +} | ||
| 211 | + | ||
| 212 | +.card2 { | ||
| 213 | + | ||
| 214 | + .fltBox { | ||
| 215 | + width: 90%; | ||
| 216 | + height: 60px; | ||
| 217 | + font-size: 12px; | ||
| 218 | + font-weight: 700; | ||
| 219 | + color: #fff; | ||
| 220 | + text-align: center; | ||
| 221 | + position: relative; | ||
| 222 | + border-radius: 10px; | ||
| 223 | + padding: 5px; | ||
| 224 | + line-height: 25px; | ||
| 225 | + margin-bottom: 10px; | ||
| 226 | + overflow: hidden; | ||
| 227 | + | ||
| 228 | + .fltWeight { | ||
| 229 | + font-size: 14px; | ||
| 230 | + } | ||
| 231 | + } | ||
| 232 | +} | ||
| 233 | +</style> | ... | ... |
| ... | @@ -24,8 +24,9 @@ | ... | @@ -24,8 +24,9 @@ |
| 24 | <el-select v-model="selectForm.status" class="formItem" placeholder="不限" clearable> | 24 | <el-select v-model="selectForm.status" class="formItem" placeholder="不限" clearable> |
| 25 | <el-option label="未处理" value="0"></el-option> | 25 | <el-option label="未处理" value="0"></el-option> |
| 26 | <el-option label="处理成功" value="1"></el-option> | 26 | <el-option label="处理成功" value="1"></el-option> |
| 27 | - <el-option label="已处理" value="2"></el-option> | 27 | + <el-option label="无需处理" value="2"></el-option> |
| 28 | <el-option label="处理失败" value="3"></el-option> | 28 | <el-option label="处理失败" value="3"></el-option> |
| 29 | + <el-option label="校验不通过" value="4"></el-option> | ||
| 29 | <el-option label="处理中" value="9"></el-option> | 30 | <el-option label="处理中" value="9"></el-option> |
| 30 | </el-select> | 31 | </el-select> |
| 31 | </el-form-item> | 32 | </el-form-item> | ... | ... |
-
Please register or login to post a comment