Showing
9 changed files
with
388 additions
and
351 deletions
| 1 | <template> | 1 | <template> |
| 2 | <div> | 2 | <div> |
| 3 | - <el-dialog title="货物配舱" width="80%" :visible.sync="dialogVisible" :close-on-click-modal="false" | 3 | + <el-dialog title="货物配舱" width="80%" :visible.sync="dialogVisible" :close-on-click-modal="false" :show-close="false" |
| 4 | :append-to-body="true"> | 4 | :append-to-body="true"> |
| 5 | <el-divider content-position="left">已选货物信息</el-divider> | 5 | <el-divider content-position="left">已选货物信息</el-divider> |
| 6 | <el-table :data="tableData" size="mini" height="200" max-height="200" border stripe highlight-current-row | 6 | <el-table :data="tableData" size="mini" height="200" max-height="200" border stripe highlight-current-row |
| ... | @@ -148,7 +148,7 @@ export default { | ... | @@ -148,7 +148,7 @@ export default { |
| 148 | }); | 148 | }); |
| 149 | } else { | 149 | } else { |
| 150 | this.loading = false; | 150 | this.loading = false; |
| 151 | - this.msgWarning("航班号或航班日期不能为空") | 151 | + this.msgWarning('航班号或航班日期不能为空') |
| 152 | } | 152 | } |
| 153 | }, | 153 | }, |
| 154 | dialogBeforeClose() { | 154 | dialogBeforeClose() { | ... | ... |
| ... | @@ -16,13 +16,16 @@ | ... | @@ -16,13 +16,16 @@ |
| 16 | </el-form-item> | 16 | </el-form-item> |
| 17 | <div> | 17 | <div> |
| 18 | <el-button style="margin-bottom: 20px" type="primary" icon="el-icon-plus" size="mini" | 18 | <el-button style="margin-bottom: 20px" type="primary" icon="el-icon-plus" size="mini" |
| 19 | - v-hasPermi="['allocation:alloc:add']" | 19 | + v-hasPermi="['allocation:alloc:add']" @click=" |
| 20 | - @click="$router.push({ name: 'FlightAllocConfigAdd', params: { handle: 'add' } })">添加</el-button> | 20 | + $router.push({ |
| 21 | + name: 'FlightAllocConfigAdd', | ||
| 22 | + params: { handle: 'add' }, | ||
| 23 | + }) | ||
| 24 | + ">添加</el-button> | ||
| 21 | </div> | 25 | </div> |
| 22 | </el-form> | 26 | </el-form> |
| 23 | <el-table :data="flyList" v-loading="loading" size="small" highlight-current-row border stripe> | 27 | <el-table :data="flyList" v-loading="loading" size="small" highlight-current-row border stripe> |
| 24 | <el-table-column prop="purposeOfFlightNo" label="航班号" align="center"></el-table-column> | 28 | <el-table-column prop="purposeOfFlightNo" label="航班号" align="center"></el-table-column> |
| 25 | - | ||
| 26 | <el-table-column prop="status" label="状态" align="center"> | 29 | <el-table-column prop="status" label="状态" align="center"> |
| 27 | <template slot-scope="scope"> | 30 | <template slot-scope="scope"> |
| 28 | <span v-if="scope.row.status === '0'">无效</span> | 31 | <span v-if="scope.row.status === '0'">无效</span> |
| ... | @@ -31,21 +34,18 @@ | ... | @@ -31,21 +34,18 @@ |
| 31 | <span v-if="scope.row.status === '3'">停用</span> | 34 | <span v-if="scope.row.status === '3'">停用</span> |
| 32 | </template> | 35 | </template> |
| 33 | </el-table-column> | 36 | </el-table-column> |
| 34 | - | ||
| 35 | <el-table-column prop="createUserName" label="操作人" align="center"> | 37 | <el-table-column prop="createUserName" label="操作人" align="center"> |
| 36 | </el-table-column> | 38 | </el-table-column> |
| 37 | - | ||
| 38 | <el-table-column prop="createTime" label="更新时间" align="center"> | 39 | <el-table-column prop="createTime" label="更新时间" align="center"> |
| 39 | </el-table-column> | 40 | </el-table-column> |
| 40 | - | ||
| 41 | <el-table-column label="操作" prop="id" align="center"> | 41 | <el-table-column label="操作" prop="id" align="center"> |
| 42 | <template slot-scope="scope"> | 42 | <template slot-scope="scope"> |
| 43 | <el-button type="text" size="mini" icon="el-icon-view" @click="handleClick(scope.row.id, 'detail')">查看 | 43 | <el-button type="text" size="mini" icon="el-icon-view" @click="handleClick(scope.row.id, 'detail')">查看 |
| 44 | </el-button> | 44 | </el-button> |
| 45 | <el-button type="text" size="mini" icon="el-icon-edit" v-hasPermi="['allocation:alloc:update']" | 45 | <el-button type="text" size="mini" icon="el-icon-edit" v-hasPermi="['allocation:alloc:update']" |
| 46 | @click="handleClick(scope.row.id, 'update')">修改</el-button> | 46 | @click="handleClick(scope.row.id, 'update')">修改</el-button> |
| 47 | - <el-button type="text" size="mini" icon="el-icon-delete" style="color:#ff4949" v-hasPermi="['allocation:alloc:delete']" | 47 | + <el-button type="text" size="mini" icon="el-icon-delete" style="color:#ff4949" |
| 48 | - @click="del(scope.row.id, scope.row.status)">删除</el-button> | 48 | + v-hasPermi="['allocation:alloc:delete']" @click="del(scope.row.id, scope.row.status)">删除</el-button> |
| 49 | <el-button type="text" size="mini" icon="el-icon-video-pause" v-hasPermi="['allocation:alloc:openClose']" | 49 | <el-button type="text" size="mini" icon="el-icon-video-pause" v-hasPermi="['allocation:alloc:openClose']" |
| 50 | @click="changeStatus(scope.row.id, 3)" v-if="scope.row.status == '1'">停用</el-button> | 50 | @click="changeStatus(scope.row.id, 3)" v-if="scope.row.status == '1'">停用</el-button> |
| 51 | <el-button type="text" size="mini" icon="el-icon-video-play" v-hasPermi="['allocation:alloc:openClose']" | 51 | <el-button type="text" size="mini" icon="el-icon-video-play" v-hasPermi="['allocation:alloc:openClose']" |
| ... | @@ -66,6 +66,7 @@ import { | ... | @@ -66,6 +66,7 @@ import { |
| 66 | delFlightId, | 66 | delFlightId, |
| 67 | enableOrDisable, | 67 | enableOrDisable, |
| 68 | } from "@/api/destinationFlight"; | 68 | } from "@/api/destinationFlight"; |
| 69 | + | ||
| 69 | export default { | 70 | export default { |
| 70 | name: "FlightAllocConfig", | 71 | name: "FlightAllocConfig", |
| 71 | data() { | 72 | data() { |
| ... | @@ -105,7 +106,7 @@ export default { | ... | @@ -105,7 +106,7 @@ export default { |
| 105 | this.loading = true; | 106 | this.loading = true; |
| 106 | findFlightNo(this.queryParams).then((response) => { | 107 | findFlightNo(this.queryParams).then((response) => { |
| 107 | if (response.code != 200) { | 108 | if (response.code != 200) { |
| 108 | - this.msgError(response.msg) | 109 | + this.msgWarning(response.msg) |
| 109 | return; | 110 | return; |
| 110 | } | 111 | } |
| 111 | this.flyList = response.data.list; | 112 | this.flyList = response.data.list; |
| ... | @@ -134,15 +135,14 @@ export default { | ... | @@ -134,15 +135,14 @@ export default { |
| 134 | cancelButtonText: "取消", | 135 | cancelButtonText: "取消", |
| 135 | showCancelButton: true, | 136 | showCancelButton: true, |
| 136 | type: "warning", | 137 | type: "warning", |
| 137 | - }) | 138 | + }).then(() => { |
| 138 | - .then(() => { | 139 | + delFlightId(id) |
| 139 | - delFlightId(id) | 140 | + .then((res) => { |
| 140 | - .then((res) => { | 141 | + res.code === 200 ? this.msgSuccess(res.msg) : this.msgWarning(res.msg) |
| 141 | - res.code === 200 ? this.msgSuccess(res.msg) : this.msgWarning(res.msg) | 142 | + this.getList() |
| 142 | - this.getList() | 143 | + }) |
| 143 | - }) | 144 | + .catch(() => { }); |
| 144 | - .catch(() => { }); | 145 | + }); |
| 145 | - }) | ||
| 146 | } | 146 | } |
| 147 | }, | 147 | }, |
| 148 | //启用,停用 | 148 | //启用,停用 |
| ... | @@ -152,9 +152,9 @@ export default { | ... | @@ -152,9 +152,9 @@ export default { |
| 152 | confirmButtonText: "确定", | 152 | confirmButtonText: "确定", |
| 153 | cancelButtonText: "取消", | 153 | cancelButtonText: "取消", |
| 154 | type: "warning", | 154 | type: "warning", |
| 155 | - }) | 155 | + }).then(() => { |
| 156 | - .then(() => { | 156 | + enableOrDisable(id, status) |
| 157 | - enableOrDisable(id, status).then((res) => { | 157 | + .then((res) => { |
| 158 | if (res.code != 200) { | 158 | if (res.code != 200) { |
| 159 | this.msgError(res.msg); | 159 | this.msgError(res.msg); |
| 160 | } else { | 160 | } else { |
| ... | @@ -162,8 +162,8 @@ export default { | ... | @@ -162,8 +162,8 @@ export default { |
| 162 | this.msgSuccess(tip + "成功"); | 162 | this.msgSuccess(tip + "成功"); |
| 163 | } | 163 | } |
| 164 | }) | 164 | }) |
| 165 | - .catch(() => { }); | 165 | + .catch(() => { }); |
| 166 | - }) | 166 | + }); |
| 167 | }, | 167 | }, |
| 168 | }, | 168 | }, |
| 169 | computed: { | 169 | computed: { |
| ... | @@ -172,10 +172,10 @@ export default { | ... | @@ -172,10 +172,10 @@ export default { |
| 172 | return this.queryParams.purposeOfFlightNo; | 172 | return this.queryParams.purposeOfFlightNo; |
| 173 | }, | 173 | }, |
| 174 | set: function (val) { | 174 | set: function (val) { |
| 175 | - this.queryParams.purposeOfFlightNo = this.upCase(val) | 175 | + this.queryParams.purposeOfFlightNo = this.upCase(val); |
| 176 | }, | 176 | }, |
| 177 | }, | 177 | }, |
| 178 | - } | 178 | + }, |
| 179 | }; | 179 | }; |
| 180 | </script> | 180 | </script> |
| 181 | 181 | ... | ... |
| ... | @@ -9,7 +9,8 @@ | ... | @@ -9,7 +9,8 @@ |
| 9 | <el-row :gutter="20"> | 9 | <el-row :gutter="20"> |
| 10 | <el-col :span="12"> | 10 | <el-col :span="12"> |
| 11 | <el-form-item label="航班号" prop="purposeOfFlightNo"> | 11 | <el-form-item label="航班号" prop="purposeOfFlightNo"> |
| 12 | - <el-input v-model.trim="form.purposeOfFlightNo" style="width: 60%" :disabled="nameDisabled"></el-input> | 12 | + <el-input v-model.trim="form.purposeOfFlightNo" maxlength="10" style="width: 60%" |
| 13 | + :disabled="nameDisabled"></el-input> | ||
| 13 | </el-form-item> | 14 | </el-form-item> |
| 14 | </el-col> | 15 | </el-col> |
| 15 | <el-col :span="12"> | 16 | <el-col :span="12"> |
| ... | @@ -25,39 +26,30 @@ | ... | @@ -25,39 +26,30 @@ |
| 25 | <el-radio v-model="isLocation" label="1" size="mini">站点包含</el-radio> | 26 | <el-radio v-model="isLocation" label="1" size="mini">站点包含</el-radio> |
| 26 | <el-radio v-model="isLocation" label="2" size="mini">站点不包含</el-radio> | 27 | <el-radio v-model="isLocation" label="2" size="mini">站点不包含</el-radio> |
| 27 | </el-col> | 28 | </el-col> |
| 28 | - <el-col :span="6"> | ||
| 29 | - <el-alert title="提示:站点之间用回车符分隔" type="warning" show-icon size="mini" :closable="false" | ||
| 30 | - style="height: 30px; width: fit-content"> | ||
| 31 | - </el-alert> | ||
| 32 | - </el-col> | ||
| 33 | </el-row> | 29 | </el-row> |
| 34 | </el-form-item> | 30 | </el-form-item> |
| 35 | - | ||
| 36 | <el-form-item label="站点包含" v-show="isLocation == 1"> | 31 | <el-form-item label="站点包含" v-show="isLocation == 1"> |
| 37 | - <el-input type="textarea" v-model="form.location" :rows="6" resize="none" style="width: 600px"></el-input> | 32 | + <el-input type="textarea" v-model="form.location" :rows="6" resize="none" style="width: 600px" |
| 33 | + placeholder="站点之间用回车符分隔"></el-input> | ||
| 38 | </el-form-item> | 34 | </el-form-item> |
| 39 | <el-form-item label="站点不包含" v-show="isLocation == 2"> | 35 | <el-form-item label="站点不包含" v-show="isLocation == 2"> |
| 40 | - <el-input type="textarea" v-model="form.notLocation" :rows="6" resize="none" style="width: 600px"></el-input> | 36 | + <el-input type="textarea" v-model="form.notLocation" :rows="6" resize="none" style="width: 600px" |
| 41 | - </el-form-item> | 37 | + placeholder="站点之间用回车符分隔"></el-input> |
| 42 | - | ||
| 43 | - <el-form-item> | ||
| 44 | - <el-alert title="提示:URSA之间用分号分隔,例:F2;F3;P_" type="warning" show-icon size="mini" :closable="false" | ||
| 45 | - style="height: 30px; width: fit-content"> | ||
| 46 | - </el-alert> | ||
| 47 | </el-form-item> | 38 | </el-form-item> |
| 48 | <el-row :gutter="20"> | 39 | <el-row :gutter="20"> |
| 49 | <el-col :span="10"> | 40 | <el-col :span="10"> |
| 50 | - <el-form-item label="URSA包含"> | 41 | + <el-form-item label="URSA包含" prop="includeUrsa"> |
| 51 | - <el-input type="textarea" v-model.trim="includeUrsa" :rows="6" resize="none"></el-input> | 42 | + <el-input type="textarea" v-model.trim="includeUrsa" :rows="6" resize="none" |
| 43 | + placeholder="URSA之间用分号分隔,例:F2;F3;P_"></el-input> | ||
| 52 | </el-form-item> | 44 | </el-form-item> |
| 53 | </el-col> | 45 | </el-col> |
| 54 | <el-col :span="10"> | 46 | <el-col :span="10"> |
| 55 | - <el-form-item label="URSA不包含"> | 47 | + <el-form-item label="URSA不包含" prop="notIncludeUrsa"> |
| 56 | - <el-input type="textarea" v-model.trim="notIncludeUrsa" :rows="6" resize="none"></el-input> | 48 | + <el-input type="textarea" v-model.trim="notIncludeUrsa" :rows="6" resize="none" |
| 49 | + placeholder="URSA之间用分号分隔,例:F2;F3;P_"></el-input> | ||
| 57 | </el-form-item> | 50 | </el-form-item> |
| 58 | </el-col> | 51 | </el-col> |
| 59 | </el-row> | 52 | </el-row> |
| 60 | - | ||
| 61 | <el-form-item label="件数"> | 53 | <el-form-item label="件数"> |
| 62 | <el-col :span="3"> | 54 | <el-col :span="3"> |
| 63 | <el-input class="numberInput" v-model.trim="minNumOfPieces"></el-input> | 55 | <el-input class="numberInput" v-model.trim="minNumOfPieces"></el-input> |
| ... | @@ -83,7 +75,6 @@ | ... | @@ -83,7 +75,6 @@ |
| 83 | ></el-input-number> --> | 75 | ></el-input-number> --> |
| 84 | </el-col> | 76 | </el-col> |
| 85 | </el-form-item> | 77 | </el-form-item> |
| 86 | - | ||
| 87 | <el-form-item label="重量"> | 78 | <el-form-item label="重量"> |
| 88 | <el-col :span="3"> | 79 | <el-col :span="3"> |
| 89 | <el-input class="numberInput" v-model.trim="minWeight"></el-input> | 80 | <el-input class="numberInput" v-model.trim="minWeight"></el-input> |
| ... | @@ -115,68 +106,72 @@ | ... | @@ -115,68 +106,72 @@ |
| 115 | </el-col> | 106 | </el-col> |
| 116 | <el-col :span="1" style="text-align: center"><span>Kg</span></el-col> | 107 | <el-col :span="1" style="text-align: center"><span>Kg</span></el-col> |
| 117 | </el-form-item> | 108 | </el-form-item> |
| 118 | - | ||
| 119 | <el-form-item label="申报类别"> | 109 | <el-form-item label="申报类别"> |
| 120 | <el-card shadow="never" style="width: 80%"> | 110 | <el-card shadow="never" style="width: 80%"> |
| 121 | <el-checkbox-group v-model="form.typeOfGoods"> | 111 | <el-checkbox-group v-model="form.typeOfGoods"> |
| 122 | <el-row> | 112 | <el-row> |
| 123 | <el-col :span="2" v-for="item in cargoType" :key="item.id"> | 113 | <el-col :span="2" v-for="item in cargoType" :key="item.id"> |
| 124 | - <el-checkbox :label="item.chineseName" :name="item.chineseName"> | 114 | + <el-checkbox v-if="item.status === 1" :label="item.chineseName" :name="item.chineseName"> |
| 125 | </el-checkbox> | 115 | </el-checkbox> |
| 126 | </el-col> | 116 | </el-col> |
| 127 | </el-row> | 117 | </el-row> |
| 128 | </el-checkbox-group> | 118 | </el-checkbox-group> |
| 129 | </el-card> | 119 | </el-card> |
| 130 | </el-form-item> | 120 | </el-form-item> |
| 131 | - | ||
| 132 | <el-form-item label="货物类型"> | 121 | <el-form-item label="货物类型"> |
| 133 | <el-card shadow="never" style="width: 80%"> | 122 | <el-card shadow="never" style="width: 80%"> |
| 134 | <el-checkbox-group v-model="form.declarationCategory"> | 123 | <el-checkbox-group v-model="form.declarationCategory"> |
| 135 | <el-row> | 124 | <el-row> |
| 136 | <el-col :span="3" v-for="item in cargoStatus" :key="item.id"> | 125 | <el-col :span="3" v-for="item in cargoStatus" :key="item.id"> |
| 137 | - <el-checkbox :label="item.chineseName" :name="item.chineseName" disabled></el-checkbox> | 126 | + <el-checkbox v-if="item.status === 1" :label="item.chineseName" :name="item.chineseName" disabled> |
| 127 | + </el-checkbox> | ||
| 138 | </el-col> | 128 | </el-col> |
| 139 | </el-row> | 129 | </el-row> |
| 140 | </el-checkbox-group> | 130 | </el-checkbox-group> |
| 141 | </el-card> | 131 | </el-card> |
| 142 | </el-form-item> | 132 | </el-form-item> |
| 143 | - | ||
| 144 | <el-form-item label="Service Code"> | 133 | <el-form-item label="Service Code"> |
| 145 | <el-card shadow="never" style="width: 80%"> | 134 | <el-card shadow="never" style="width: 80%"> |
| 146 | <el-checkbox-group v-model="form.serviceCode"> | 135 | <el-checkbox-group v-model="form.serviceCode"> |
| 147 | <el-row> | 136 | <el-row> |
| 148 | <el-col :span="2" v-for="item in serviceCode" :key="item.id"> | 137 | <el-col :span="2" v-for="item in serviceCode" :key="item.id"> |
| 149 | - <el-checkbox :label="item.englishName" :name="item.englishName"></el-checkbox> | 138 | + <el-checkbox v-if="item.status === 1 || form.serviceCode.includes(item.englishName)" |
| 139 | + :label="item.englishName" :name="item.englishName" | ||
| 140 | + :disabled="form.serviceCode.includes(item.englishName) && item.status === 0"> | ||
| 141 | + </el-checkbox> | ||
| 150 | </el-col> | 142 | </el-col> |
| 151 | </el-row> | 143 | </el-row> |
| 152 | </el-checkbox-group> | 144 | </el-checkbox-group> |
| 153 | </el-card> | 145 | </el-card> |
| 154 | </el-form-item> | 146 | </el-form-item> |
| 155 | - | ||
| 156 | <el-form-item label="Handling Code"> | 147 | <el-form-item label="Handling Code"> |
| 157 | <el-card shadow="never" style="width: 80%"> | 148 | <el-card shadow="never" style="width: 80%"> |
| 158 | <el-checkbox-group v-model="form.handlingCode"> | 149 | <el-checkbox-group v-model="form.handlingCode"> |
| 159 | <el-row> | 150 | <el-row> |
| 160 | <el-col :span="3" v-for="item in handlingCode" :key="item.id"> | 151 | <el-col :span="3" v-for="item in handlingCode" :key="item.id"> |
| 161 | - <el-checkbox :label="item.englishName" :name="item.englishName"></el-checkbox> | 152 | + <el-checkbox v-if="item.status === 1 || form.handlingCode.includes(item.englishName)" |
| 153 | + :label="item.englishName" :name="item.englishName" | ||
| 154 | + :disabled="form.handlingCode.includes(item.englishName) && item.status === 0"> | ||
| 155 | + </el-checkbox> | ||
| 162 | </el-col> | 156 | </el-col> |
| 163 | </el-row> | 157 | </el-row> |
| 164 | </el-checkbox-group> | 158 | </el-checkbox-group> |
| 165 | </el-card> | 159 | </el-card> |
| 166 | </el-form-item> | 160 | </el-form-item> |
| 167 | - | ||
| 168 | <el-form-item label="Sub Category"> | 161 | <el-form-item label="Sub Category"> |
| 169 | <el-card shadow="never" style="width: 80%"> | 162 | <el-card shadow="never" style="width: 80%"> |
| 170 | <el-checkbox-group v-model="form.subCategory"> | 163 | <el-checkbox-group v-model="form.subCategory"> |
| 171 | <el-row> | 164 | <el-row> |
| 172 | <el-col :span="3" v-for="item in subCategory" :key="item.id"> | 165 | <el-col :span="3" v-for="item in subCategory" :key="item.id"> |
| 173 | - <el-checkbox :label="item.englishName" :name="item.englishName"></el-checkbox> | 166 | + <el-checkbox v-if="item.status === 1 || form.subCategory.includes(item.englishName)" |
| 167 | + :label="item.englishName" :name="item.englishName" | ||
| 168 | + :disabled="form.subCategory.includes(item.englishName) && item.status === 0"> | ||
| 169 | + </el-checkbox> | ||
| 174 | </el-col> | 170 | </el-col> |
| 175 | </el-row> | 171 | </el-row> |
| 176 | </el-checkbox-group> | 172 | </el-checkbox-group> |
| 177 | </el-card> | 173 | </el-card> |
| 178 | </el-form-item> | 174 | </el-form-item> |
| 179 | - | ||
| 180 | </el-form> | 175 | </el-form> |
| 181 | <div style="marginLeft: 200px"> | 176 | <div style="marginLeft: 200px"> |
| 182 | <el-button type="primary" size="small" v-if="$route.params.handle != 'detail'" @click="submit('form')" | 177 | <el-button type="primary" size="small" v-if="$route.params.handle != 'detail'" @click="submit('form')" |
| ... | @@ -241,9 +236,127 @@ export default { | ... | @@ -241,9 +236,127 @@ export default { |
| 241 | isEmpty: false, | 236 | isEmpty: false, |
| 242 | routeName: "", | 237 | routeName: "", |
| 243 | dataId: "", | 238 | dataId: "", |
| 244 | - handleName: "" | 239 | + handleName: "", |
| 245 | }; | 240 | }; |
| 246 | }, | 241 | }, |
| 242 | + created() { | ||
| 243 | + this.routeName = this.$route.name; | ||
| 244 | + this.dataId = this.$route.params.id; | ||
| 245 | + this.handleName = this.$route.params.handle; | ||
| 246 | + this.dictData(); | ||
| 247 | + if (this.handleName === "detail") { | ||
| 248 | + this.disable = true; | ||
| 249 | + } | ||
| 250 | + | ||
| 251 | + if (this.handleName != "add") { | ||
| 252 | + this.nameDisabled = true; | ||
| 253 | + let id = this.$route.params.id; | ||
| 254 | + if ( | ||
| 255 | + sessionStorage.getItem("flightInfo" + id) && | ||
| 256 | + this.$route.name == "FlightAllocConfigInfo" && | ||
| 257 | + this.handleName != "detail" | ||
| 258 | + ) { | ||
| 259 | + this.loading = false; | ||
| 260 | + this.form = JSON.parse( | ||
| 261 | + sessionStorage.getItem("flightInfo" + this.$route.params.id) | ||
| 262 | + ); | ||
| 263 | + this.isNeedRequired = this.form.isNeedRequired; | ||
| 264 | + if (this.form.notLocation != null || this.form.notLocation == "") { | ||
| 265 | + this.isLocation = "2"; | ||
| 266 | + } else { | ||
| 267 | + this.isLocation = "1"; | ||
| 268 | + } | ||
| 269 | + } else { | ||
| 270 | + if (isNaN(Number(this.dataId))) { | ||
| 271 | + findDestinationFltRuleByActualFlight(this.dataId).then((response) => { | ||
| 272 | + if (response.code != 200) { | ||
| 273 | + this.msgWarning(response.msg) | ||
| 274 | + this.isEmpty = true; | ||
| 275 | + } else if (response.data == null) { | ||
| 276 | + this.isEmpty = true; | ||
| 277 | + } else { | ||
| 278 | + let info = response.data; | ||
| 279 | + info.typeOfGoods = info.typeOfGoods | ||
| 280 | + ? info.typeOfGoods.split(";") | ||
| 281 | + : []; | ||
| 282 | + info.declarationCategory = info.declarationCategory | ||
| 283 | + ? info.declarationCategory.split(";") | ||
| 284 | + : []; | ||
| 285 | + info.serviceCode = info.serviceCode | ||
| 286 | + ? info.serviceCode.split(";") | ||
| 287 | + : []; | ||
| 288 | + info.handlingCode = info.handlingCode | ||
| 289 | + ? info.handlingCode.split(";") | ||
| 290 | + : []; | ||
| 291 | + info.subCategory = info.subCategory | ||
| 292 | + ? info.subCategory.split(";") | ||
| 293 | + : []; | ||
| 294 | + this.form = info; | ||
| 295 | + if (info.notLocation != null || info.notLocation == "") { | ||
| 296 | + this.isLocation = "2"; | ||
| 297 | + } else { | ||
| 298 | + this.isLocation = "1"; | ||
| 299 | + } | ||
| 300 | + this.isNeedRequired = info.isNeedRequired; | ||
| 301 | + } | ||
| 302 | + this.loading = false; | ||
| 303 | + }).catch(() => { | ||
| 304 | + this.loading = false; | ||
| 305 | + }) | ||
| 306 | + } else { | ||
| 307 | + //货物信息 | ||
| 308 | + findByFlightId(this.dataId).then((response) => { | ||
| 309 | + if (response.code != 200) { | ||
| 310 | + this.msgWarning(response.msg) | ||
| 311 | + this.isEmpty = true; | ||
| 312 | + } else { | ||
| 313 | + let info = response.data.list; | ||
| 314 | + info.typeOfGoods = info.typeOfGoods | ||
| 315 | + ? info.typeOfGoods.split(";") | ||
| 316 | + : []; | ||
| 317 | + info.declarationCategory = info.declarationCategory | ||
| 318 | + ? info.declarationCategory.split(";") | ||
| 319 | + : []; | ||
| 320 | + info.serviceCode = info.serviceCode | ||
| 321 | + ? info.serviceCode.split(";") | ||
| 322 | + : []; | ||
| 323 | + info.handlingCode = info.handlingCode | ||
| 324 | + ? info.handlingCode.split(";") | ||
| 325 | + : []; | ||
| 326 | + info.subCategory = info.subCategory | ||
| 327 | + ? info.subCategory.split(";") | ||
| 328 | + : []; | ||
| 329 | + this.form = info; | ||
| 330 | + if (info.notLocation != null || info.notLocation == "") { | ||
| 331 | + this.isLocation = "2"; | ||
| 332 | + } else { | ||
| 333 | + this.isLocation = "1"; | ||
| 334 | + } | ||
| 335 | + let isNeedRequired = response.data.isNeedRequired; | ||
| 336 | + this.form.isNeedRequired = isNeedRequired; | ||
| 337 | + this.isNeedRequired = isNeedRequired; | ||
| 338 | + } | ||
| 339 | + this.loading = false; | ||
| 340 | + }).catch(() => { | ||
| 341 | + this.loading = false; | ||
| 342 | + }) | ||
| 343 | + } | ||
| 344 | + } | ||
| 345 | + } else { | ||
| 346 | + this.loading = false; | ||
| 347 | + } | ||
| 348 | + if (this.$route.name == "FlightAllocConfigAdd") { | ||
| 349 | + if (sessionStorage.getItem("flightAdd")) { | ||
| 350 | + this.form = JSON.parse(sessionStorage.getItem("flightAdd")); | ||
| 351 | + this.isNeedRequired = this.form.isNeedRequired; | ||
| 352 | + if (this.form.notLocation != null || this.form.notLocation == "") { | ||
| 353 | + this.isLocation = "2"; | ||
| 354 | + } else { | ||
| 355 | + this.isLocation = "1"; | ||
| 356 | + } | ||
| 357 | + } | ||
| 358 | + } | ||
| 359 | + }, | ||
| 247 | methods: { | 360 | methods: { |
| 248 | //排序 | 361 | //排序 |
| 249 | sorttodo(arr, englishName) { | 362 | sorttodo(arr, englishName) { |
| ... | @@ -268,8 +381,7 @@ export default { | ... | @@ -268,8 +381,7 @@ export default { |
| 268 | }); | 381 | }); |
| 269 | 382 | ||
| 270 | this.btnLoading = true; | 383 | this.btnLoading = true; |
| 271 | - let handle = this.$route.params.handle; | 384 | + if (this.handleName === "update") { |
| 272 | - if (handle === "update") { | ||
| 273 | //修改,获取id | 385 | //修改,获取id |
| 274 | this.form.id = this.$route.params.id; | 386 | this.form.id = this.$route.params.id; |
| 275 | } | 387 | } |
| ... | @@ -282,13 +394,14 @@ export default { | ... | @@ -282,13 +394,14 @@ export default { |
| 282 | this.formSubCategory = this.form.subCategory; | 394 | this.formSubCategory = this.form.subCategory; |
| 283 | this.form.isNeedRequired = this.isNeedRequired; | 395 | this.form.isNeedRequired = this.isNeedRequired; |
| 284 | if (this.form.purposeOfFlightNo) { | 396 | if (this.form.purposeOfFlightNo) { |
| 285 | - this.form.purposeOfFlightNo = this.upCase(this.form.purposeOfFlightNo); | 397 | + this.form.purposeOfFlightNo = this.form.purposeOfFlightNo.toUpperCase(); |
| 286 | } | 398 | } |
| 287 | if (this.isLocation == 1) { | 399 | if (this.isLocation == 1) { |
| 288 | this.form.notLocation = ""; | 400 | this.form.notLocation = ""; |
| 289 | } else { | 401 | } else { |
| 290 | this.form.location = ""; | 402 | this.form.location = ""; |
| 291 | } | 403 | } |
| 404 | + | ||
| 292 | if ( | 405 | if ( |
| 293 | this.form.includeUrsa && | 406 | this.form.includeUrsa && |
| 294 | this.form.includeUrsa.length != 0 && | 407 | this.form.includeUrsa.length != 0 && |
| ... | @@ -299,6 +412,10 @@ export default { | ... | @@ -299,6 +412,10 @@ export default { |
| 299 | let notInclude = this.form.notIncludeUrsa.split(";"); | 412 | let notInclude = this.form.notIncludeUrsa.split(";"); |
| 300 | let errorList = []; | 413 | let errorList = []; |
| 301 | notInclude.forEach((element) => { | 414 | notInclude.forEach((element) => { |
| 415 | + // if (include.includes(element)) { | ||
| 416 | + // this.msgWarning("URSA包含与URSA不包含中有相同项,不能设置") | ||
| 417 | + // return | ||
| 418 | + // } | ||
| 302 | if (element.indexOf("_") > 0) { | 419 | if (element.indexOf("_") > 0) { |
| 303 | errorList.push(element); | 420 | errorList.push(element); |
| 304 | } else { | 421 | } else { |
| ... | @@ -319,17 +436,38 @@ export default { | ... | @@ -319,17 +436,38 @@ export default { |
| 319 | } | 436 | } |
| 320 | }); | 437 | }); |
| 321 | if (errorList.length != 0) { | 438 | if (errorList.length != 0) { |
| 322 | - this.msgError("URSA不包含中[" + errorList + "]错误,URSA不包含必须属于URSA包含中的类型") | 439 | + this.msgWarning("URSA不包含中[" + errorList + "]错误,URSA不包含必须属于URSA包含中的类型") |
| 323 | this.btnLoading = false; | 440 | this.btnLoading = false; |
| 324 | return; | 441 | return; |
| 325 | } | 442 | } |
| 326 | } | 443 | } |
| 444 | + let service = [] | ||
| 445 | + this.serviceCode.forEach(item => { | ||
| 446 | + if (item.status === 1 && this.form.serviceCode.includes(item.englishName)) { | ||
| 447 | + service.push(item.englishName) | ||
| 448 | + } | ||
| 449 | + }) | ||
| 450 | + this.form.serviceCode = service | ||
| 451 | + let hand = [] | ||
| 452 | + this.handlingCode.forEach(item => { | ||
| 453 | + if (item.status === 1 && this.form.handlingCode.includes(item.englishName)) { | ||
| 454 | + hand.push(item.englishName) | ||
| 455 | + } | ||
| 456 | + }) | ||
| 457 | + this.form.handlingCode = hand | ||
| 458 | + let sub = [] | ||
| 459 | + this.subCategory.forEach(item => { | ||
| 460 | + if (item.status === 1 && this.form.subCategory.includes(item.englishName)) { | ||
| 461 | + sub.push(item.englishName) | ||
| 462 | + } | ||
| 463 | + }) | ||
| 464 | + this.form.subCategory = sub | ||
| 327 | updateOrAddFlight(this.form).then((response) => { | 465 | updateOrAddFlight(this.form).then((response) => { |
| 328 | if (response.code === 200) { | 466 | if (response.code === 200) { |
| 329 | this.msgSuccess('成功') | 467 | this.msgSuccess('成功') |
| 330 | this.close(); | 468 | this.close(); |
| 331 | } else { | 469 | } else { |
| 332 | - this.msgError(response.msg) | 470 | + this.msgWarning(response.msg) |
| 333 | this.btnLoading = false; | 471 | this.btnLoading = false; |
| 334 | } | 472 | } |
| 335 | }); | 473 | }); |
| ... | @@ -340,7 +478,7 @@ export default { | ... | @@ -340,7 +478,7 @@ export default { |
| 340 | this.form.subCategory = this.formSubCategory; | 478 | this.form.subCategory = this.formSubCategory; |
| 341 | }, | 479 | }, |
| 342 | close() { | 480 | close() { |
| 343 | - this.removes() | 481 | + this.removes(); |
| 344 | this.$store.state.tagsView.visitedViews.splice( | 482 | this.$store.state.tagsView.visitedViews.splice( |
| 345 | this.$store.state.tagsView.visitedViews.findIndex( | 483 | this.$store.state.tagsView.visitedViews.findIndex( |
| 346 | (item) => item.path === this.$route.path | 484 | (item) => item.path === this.$route.path |
| ... | @@ -348,22 +486,17 @@ export default { | ... | @@ -348,22 +486,17 @@ export default { |
| 348 | 1 | 486 | 1 |
| 349 | ); | 487 | ); |
| 350 | this.$router.push({ name: "FlightAllocConfig" }) | 488 | this.$router.push({ name: "FlightAllocConfig" }) |
| 351 | - // this.$router.push( | ||
| 352 | - // this.$store.state.tagsView.visitedViews[ | ||
| 353 | - // this.$store.state.tagsView.visitedViews.length - 1 | ||
| 354 | - // ].path | ||
| 355 | - // ); | ||
| 356 | }, | 489 | }, |
| 357 | 490 | ||
| 358 | removes() { | 491 | removes() { |
| 359 | if (this.routeName == "FlightAllocConfigAdd") { | 492 | if (this.routeName == "FlightAllocConfigAdd") { |
| 360 | - sessionStorage.setItem("flightAdd", "remove") | 493 | + sessionStorage.setItem("flightAdd", "remove"); |
| 361 | } else { | 494 | } else { |
| 362 | - sessionStorage.setItem("flightInfo" + this.dataId, "remove") | 495 | + sessionStorage.setItem("flightInfo" + this.dataId, "remove"); |
| 363 | } | 496 | } |
| 364 | }, | 497 | }, |
| 365 | 498 | ||
| 366 | - async dictData() { | 499 | + dictData() { |
| 367 | allDictData().then((response) => { | 500 | allDictData().then((response) => { |
| 368 | if (response.code != 200) { | 501 | if (response.code != 200) { |
| 369 | this.msgError(response.msg) | 502 | this.msgError(response.msg) |
| ... | @@ -372,149 +505,53 @@ export default { | ... | @@ -372,149 +505,53 @@ export default { |
| 372 | let dict = response.data; | 505 | let dict = response.data; |
| 373 | this.cargoType = dict.cargoType; | 506 | this.cargoType = dict.cargoType; |
| 374 | this.cargoStatus = dict.cargoStatus; | 507 | this.cargoStatus = dict.cargoStatus; |
| 375 | - this.serviceCode = dict.serviceCode.sort((a, b) => | 508 | + this.serviceCode = this.dicSort(dict.serviceCode.sort((a, b) => |
| 376 | a.englishName.localeCompare(b.englishName) | 509 | a.englishName.localeCompare(b.englishName) |
| 377 | - ); | 510 | + )); |
| 378 | - | 511 | + this.handlingCode = this.dicSort(this.sorttodo(dict.handlingCode, "BLANK")); |
| 379 | - this.handlingCode = this.sorttodo(dict.handlingCode, "BLANK"); | 512 | + this.subCategory = this.dicSort(dict.subCategory); |
| 380 | - this.subCategory = dict.subCategory; | ||
| 381 | }); | 513 | }); |
| 514 | + }, | ||
| 515 | + | ||
| 516 | + dicSort(val) { | ||
| 517 | + let status1 = [] | ||
| 518 | + let status0 = [] | ||
| 519 | + let arr = [] | ||
| 520 | + val.forEach(item => { | ||
| 521 | + if (item.status == 1) { | ||
| 522 | + status1.push(item) | ||
| 523 | + } else { | ||
| 524 | + status0.push(item) | ||
| 525 | + } | ||
| 526 | + }) | ||
| 527 | + arr = status1.concat(status0) | ||
| 528 | + return arr | ||
| 382 | } | 529 | } |
| 383 | }, | 530 | }, |
| 384 | 531 | ||
| 385 | beforeDestroy() { | 532 | beforeDestroy() { |
| 386 | if (this.routeName == "FlightAllocConfigAdd") { | 533 | if (this.routeName == "FlightAllocConfigAdd") { |
| 387 | if (sessionStorage.getItem("flightAdd") == "remove") { | 534 | if (sessionStorage.getItem("flightAdd") == "remove") { |
| 388 | - sessionStorage.removeItem("flightAdd") | 535 | + sessionStorage.removeItem("flightAdd"); |
| 389 | } else { | 536 | } else { |
| 390 | - this.form.isNeedRequired = this.isNeedRequired | 537 | + this.form.isNeedRequired = this.isNeedRequired; |
| 391 | - sessionStorage.setItem("flightAdd", JSON.stringify(this.form)) | 538 | + sessionStorage.setItem("flightAdd", JSON.stringify(this.form)); |
| 392 | } | 539 | } |
| 393 | } else { | 540 | } else { |
| 394 | if (sessionStorage.getItem("flightInfo" + this.dataId) == "remove") { | 541 | if (sessionStorage.getItem("flightInfo" + this.dataId) == "remove") { |
| 395 | - sessionStorage.removeItem("flightInfo" + this.dataId) | 542 | + sessionStorage.removeItem("flightInfo" + this.dataId); |
| 396 | } else { | 543 | } else { |
| 397 | - if (this.handleName == "detail") { | 544 | + if (this.handleName != "detail") { |
| 398 | - this.form.isNeedRequired = this.isNeedRequired | 545 | + this.form.isNeedRequired = this.isNeedRequired; |
| 399 | - sessionStorage.setItem("flightInfo" + this.dataId, JSON.stringify(this.form)) | 546 | + sessionStorage.setItem( |
| 547 | + "flightInfo" + this.dataId, | ||
| 548 | + JSON.stringify(this.form) | ||
| 549 | + ); | ||
| 400 | } | 550 | } |
| 401 | } | 551 | } |
| 402 | } | 552 | } |
| 403 | }, | 553 | }, |
| 404 | 554 | ||
| 405 | - created() { | ||
| 406 | - let handle = this.$route.params.handle; | ||
| 407 | - this.routeName = this.$route.name; | ||
| 408 | - this.dataId = this.$route.params.id; | ||
| 409 | - this.handleName = this.$route.params.handle; | ||
| 410 | - this.dictData() | ||
| 411 | - if (handle === "detail") { | ||
| 412 | - this.disable = true; | ||
| 413 | - } | ||
| 414 | - | ||
| 415 | - if (handle != "add") { | ||
| 416 | - this.nameDisabled = true; | ||
| 417 | - let id = this.$route.params.id; | ||
| 418 | - if (sessionStorage.getItem("flightInfo" + id) && this.$route.name == "FlightAllocConfigInfo" && handle != "detail") { | ||
| 419 | - this.loading = false | ||
| 420 | - this.form = JSON.parse(sessionStorage.getItem("flightInfo" + this.$route.params.id)) | ||
| 421 | - this.isNeedRequired = this.form.isNeedRequired; | ||
| 422 | - if (this.form.notLocation != null || this.form.notLocation == "") { | ||
| 423 | - this.isLocation = "2"; | ||
| 424 | - } else { | ||
| 425 | - this.isLocation = "1"; | ||
| 426 | - } | ||
| 427 | - } else { | ||
| 428 | - if (isNaN(Number(id))) { | ||
| 429 | - findDestinationFltRuleByActualFlight(id).then((response) => { | ||
| 430 | - if (response.code != 200) { | ||
| 431 | - this.msgError(response.msg) | ||
| 432 | - this.isEmpty = true; | ||
| 433 | - } else if (response.data == null) { | ||
| 434 | - this.isEmpty = true; | ||
| 435 | - } else { | ||
| 436 | - let info = response.data; | ||
| 437 | - info.typeOfGoods = info.typeOfGoods | ||
| 438 | - ? info.typeOfGoods.split(";") | ||
| 439 | - : []; | ||
| 440 | - info.declarationCategory = info.declarationCategory | ||
| 441 | - ? info.declarationCategory.split(";") | ||
| 442 | - : []; | ||
| 443 | - info.serviceCode = info.serviceCode | ||
| 444 | - ? info.serviceCode.split(";") | ||
| 445 | - : []; | ||
| 446 | - info.handlingCode = info.handlingCode | ||
| 447 | - ? info.handlingCode.split(";") | ||
| 448 | - : []; | ||
| 449 | - info.subCategory = info.subCategory | ||
| 450 | - ? info.subCategory.split(";") | ||
| 451 | - : []; | ||
| 452 | - this.form = info; | ||
| 453 | - if (info.notLocation != null || info.notLocation == "") { | ||
| 454 | - this.isLocation = "2"; | ||
| 455 | - } else { | ||
| 456 | - this.isLocation = "1"; | ||
| 457 | - } | ||
| 458 | - this.isNeedRequired = info.isNeedRequired; | ||
| 459 | - } | ||
| 460 | - this.loading = false; | ||
| 461 | - }).catch(() => { | ||
| 462 | - this.loading = false; | ||
| 463 | - }) | ||
| 464 | - } else { | ||
| 465 | - //货物信息 | ||
| 466 | - findByFlightId(id).then((response) => { | ||
| 467 | - if (response.code != 200) { | ||
| 468 | - this.msgError(response.msg) | ||
| 469 | - this.isEmpty = true; | ||
| 470 | - } else { | ||
| 471 | - let info = response.data.list; | ||
| 472 | - info.typeOfGoods = info.typeOfGoods | ||
| 473 | - ? info.typeOfGoods.split(";") | ||
| 474 | - : []; | ||
| 475 | - info.declarationCategory = info.declarationCategory | ||
| 476 | - ? info.declarationCategory.split(";") | ||
| 477 | - : []; | ||
| 478 | - info.serviceCode = info.serviceCode | ||
| 479 | - ? info.serviceCode.split(";") | ||
| 480 | - : []; | ||
| 481 | - info.handlingCode = info.handlingCode | ||
| 482 | - ? info.handlingCode.split(";") | ||
| 483 | - : []; | ||
| 484 | - info.subCategory = info.subCategory | ||
| 485 | - ? info.subCategory.split(";") | ||
| 486 | - : []; | ||
| 487 | - this.form = info; | ||
| 488 | - if (info.notLocation != null || info.notLocation == "") { | ||
| 489 | - this.isLocation = "2"; | ||
| 490 | - } else { | ||
| 491 | - this.isLocation = "1"; | ||
| 492 | - } | ||
| 493 | - let isNeedRequired = response.data.isNeedRequired; | ||
| 494 | - this.form.isNeedRequired = isNeedRequired; | ||
| 495 | - this.isNeedRequired = isNeedRequired; | ||
| 496 | - } | ||
| 497 | - this.loading = false; | ||
| 498 | - }).catch(() => { | ||
| 499 | - this.loading = false; | ||
| 500 | - }) | ||
| 501 | - } | ||
| 502 | - } | ||
| 503 | - } else { | ||
| 504 | - this.loading = false; | ||
| 505 | - } | ||
| 506 | - if (this.$route.name == "FlightAllocConfigAdd") { | ||
| 507 | - if (sessionStorage.getItem("flightAdd")) { | ||
| 508 | - this.form = JSON.parse(sessionStorage.getItem("flightAdd")) | ||
| 509 | - this.isNeedRequired = this.form.isNeedRequired; | ||
| 510 | - if (this.form.notLocation != null || this.form.notLocation == "") { | ||
| 511 | - this.isLocation = "2"; | ||
| 512 | - } else { | ||
| 513 | - this.isLocation = "1"; | ||
| 514 | - } | ||
| 515 | - } | ||
| 516 | - } | ||
| 517 | - }, | ||
| 518 | computed: { | 555 | computed: { |
| 519 | includeUrsa: { | 556 | includeUrsa: { |
| 520 | get: function () { | 557 | get: function () { |
| ... | @@ -537,10 +574,12 @@ export default { | ... | @@ -537,10 +574,12 @@ export default { |
| 537 | return this.form.minNumOfPieces; | 574 | return this.form.minNumOfPieces; |
| 538 | }, | 575 | }, |
| 539 | set: function (val) { | 576 | set: function (val) { |
| 577 | + const reg = /^[1-9]{0,}$/ | ||
| 578 | + if (reg.test(val)) { | ||
| 579 | + this.form.minNumOfPieces = val | ||
| 580 | + } | ||
| 540 | if (val == 0 || val == null || val == "-") { | 581 | if (val == 0 || val == null || val == "-") { |
| 541 | this.form.minNumOfPieces = undefined; | 582 | this.form.minNumOfPieces = undefined; |
| 542 | - } else if (!isNaN(val)) { | ||
| 543 | - this.form.minNumOfPieces = val; | ||
| 544 | } | 583 | } |
| 545 | }, | 584 | }, |
| 546 | }, | 585 | }, |
| ... | @@ -549,10 +588,12 @@ export default { | ... | @@ -549,10 +588,12 @@ export default { |
| 549 | return this.form.maxNumOfPieces; | 588 | return this.form.maxNumOfPieces; |
| 550 | }, | 589 | }, |
| 551 | set: function (val) { | 590 | set: function (val) { |
| 591 | + const reg = /^[1-9]{0,}$/ | ||
| 592 | + if (reg.test(val)) { | ||
| 593 | + this.form.maxNumOfPieces = val | ||
| 594 | + } | ||
| 552 | if (val == 0 || val == null || val == "-") { | 595 | if (val == 0 || val == null || val == "-") { |
| 553 | this.form.maxNumOfPieces = undefined; | 596 | this.form.maxNumOfPieces = undefined; |
| 554 | - } else if (!isNaN(val)) { | ||
| 555 | - this.form.maxNumOfPieces = val; | ||
| 556 | } | 597 | } |
| 557 | }, | 598 | }, |
| 558 | }, | 599 | }, |
| ... | @@ -561,6 +602,8 @@ export default { | ... | @@ -561,6 +602,8 @@ export default { |
| 561 | return this.form.minWeight; | 602 | return this.form.minWeight; |
| 562 | }, | 603 | }, |
| 563 | set: function (val) { | 604 | set: function (val) { |
| 605 | + const reg = /^\d{1,1}\d*\.{0,1}\d{0,}$/ | ||
| 606 | + console.log(reg.test(val)) | ||
| 564 | if (val == null || val == "-") { | 607 | if (val == null || val == "-") { |
| 565 | this.form.minWeight = undefined; | 608 | this.form.minWeight = undefined; |
| 566 | } else if (!isNaN(val)) { | 609 | } else if (!isNaN(val)) { | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | <div> | 2 | <div> |
| 3 | - <el-form class="form-header" :model="queryParams" ref="queryForm" size="medium" :inline="true" | 3 | + <el-form class="form-header" :model="queryParams" ref="queryForm" size="small" :inline="true" label-position="right" |
| 4 | - label-position="right" label-width="auto"> | 4 | + label-width="auto"> |
| 5 | <el-form-item label="原航班"> | 5 | <el-form-item label="原航班"> |
| 6 | <el-input type="text" v-model="sourceFlightNo" placeholder="请输入原航班" clearable></el-input> | 6 | <el-input type="text" v-model="sourceFlightNo" placeholder="请输入原航班" clearable></el-input> |
| 7 | </el-form-item> | 7 | </el-form-item> |
| ... | @@ -47,8 +47,8 @@ | ... | @@ -47,8 +47,8 @@ |
| 47 | <template slot-scope="scope"> | 47 | <template slot-scope="scope"> |
| 48 | <el-button size="mini" type="text" icon="el-icon-edit" v-hasPermi="['allocation:rand:update']" | 48 | <el-button size="mini" type="text" icon="el-icon-edit" v-hasPermi="['allocation:rand:update']" |
| 49 | @click="handleUpdate(scope.row)">修改</el-button> | 49 | @click="handleUpdate(scope.row)">修改</el-button> |
| 50 | - <el-button size="mini" type="text" icon="el-icon-delete" v-hasPermi="['allocation:rand:delete']" | 50 | + <el-button size="mini" type="text" icon="el-icon-delete" style="color:#ff4949" |
| 51 | - @click="handleDeleteorPlayorpause(scope.row, 0, '删除')" style="color:#ff4949"> | 51 | + v-hasPermi="['allocation:rand:delete']" @click="handleDeleteorPlayorpause(scope.row, 0, '删除')"> |
| 52 | 删除</el-button> | 52 | 删除</el-button> |
| 53 | <el-button size="mini" type="text" icon="el-icon-video-play" v-if="scope.row.status == '3'" | 53 | <el-button size="mini" type="text" icon="el-icon-video-play" v-if="scope.row.status == '3'" |
| 54 | v-hasPermi="['allocation:rand:openClose']" @click="handleDeleteorPlayorpause(scope.row, 1, '启用')">启用 | 54 | v-hasPermi="['allocation:rand:openClose']" @click="handleDeleteorPlayorpause(scope.row, 1, '启用')">启用 |
| ... | @@ -63,7 +63,7 @@ | ... | @@ -63,7 +63,7 @@ |
| 63 | :page.sync="queryParams.pageNum" :limit.sync="queryParams.limit" @pagination="findSourceFlightRules" /> | 63 | :page.sync="queryParams.pageNum" :limit.sync="queryParams.limit" @pagination="findSourceFlightRules" /> |
| 64 | <!-- 查看目的航班对话框 --> | 64 | <!-- 查看目的航班对话框 --> |
| 65 | <el-dialog title="实际配载航班" :visible.sync="openFlightDate" width="70%" :close-on-click-modal="false" | 65 | <el-dialog title="实际配载航班" :visible.sync="openFlightDate" width="70%" :close-on-click-modal="false" |
| 66 | - :append-to-body="true"> | 66 | + :show-close="false" :append-to-body="true"> |
| 67 | <el-table v-loading="loadingFlightDate" :data="sourceFlightAndFlightDate"> | 67 | <el-table v-loading="loadingFlightDate" :data="sourceFlightAndFlightDate"> |
| 68 | <el-table-column type="index" label="序号" align="center"> | 68 | <el-table-column type="index" label="序号" align="center"> |
| 69 | <template slot-scope="scope">{{ scope.$index + 1 }}</template> | 69 | <template slot-scope="scope">{{ scope.$index + 1 }}</template> |
| ... | @@ -83,8 +83,9 @@ | ... | @@ -83,8 +83,9 @@ |
| 83 | </div> | 83 | </div> |
| 84 | </el-dialog> | 84 | </el-dialog> |
| 85 | <!-- 添加或修改对话框 --> | 85 | <!-- 添加或修改对话框 --> |
| 86 | - <el-dialog :title="title" :visible.sync="open" width="55%" :append-to-body="true" :close-on-click-modal="false"> | 86 | + <el-dialog :title="title" :visible.sync="open" width="55%" :append-to-body="true" :close-on-click-modal="false" |
| 87 | - <el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="auto"> | 87 | + :show-close="false"> |
| 88 | + <el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="auto" size="small"> | ||
| 88 | <el-row> | 89 | <el-row> |
| 89 | <el-col :span="8"> | 90 | <el-col :span="8"> |
| 90 | <el-form-item label="原航班" prop="sourceFlightNo"> | 91 | <el-form-item label="原航班" prop="sourceFlightNo"> |
| ... | @@ -93,7 +94,7 @@ | ... | @@ -93,7 +94,7 @@ |
| 93 | </el-col> | 94 | </el-col> |
| 94 | <el-col :span="8"> | 95 | <el-col :span="8"> |
| 95 | <el-form-item label="口岸" prop="portName"> | 96 | <el-form-item label="口岸" prop="portName"> |
| 96 | - <el-select :disabled="true" v-model="form.portName" size="mini" placeholder="选择口岸"> | 97 | + <el-select :disabled="true" v-model="form.portName" placeholder="选择口岸"> |
| 97 | <el-option v-for="item in portNameList" :label="item" :value="item" :key="item"> | 98 | <el-option v-for="item in portNameList" :label="item" :value="item" :key="item"> |
| 98 | </el-option> | 99 | </el-option> |
| 99 | </el-select> | 100 | </el-select> |
| ... | @@ -103,15 +104,15 @@ | ... | @@ -103,15 +104,15 @@ |
| 103 | <el-row> | 104 | <el-row> |
| 104 | <el-col :span="8"> | 105 | <el-col :span="8"> |
| 105 | <el-form-item label="有效开始时间" prop="startDate"> | 106 | <el-form-item label="有效开始时间" prop="startDate"> |
| 106 | - <el-date-picker clearable size="small" :picker-options="pickerOptionsStart" v-model="form.startDate" | 107 | + <el-date-picker clearable :picker-options="pickerOptionsStart" v-model="form.startDate" type="date" |
| 107 | - type="date" value-format="yyyy-MM-dd" placeholder="选择开始时间"> | 108 | + value-format="yyyy-MM-dd" placeholder="选择开始时间"> |
| 108 | </el-date-picker> | 109 | </el-date-picker> |
| 109 | </el-form-item> | 110 | </el-form-item> |
| 110 | </el-col> | 111 | </el-col> |
| 111 | <el-col :span="12"> | 112 | <el-col :span="12"> |
| 112 | <el-form-item label="有效结束时间" prop="endDate"> | 113 | <el-form-item label="有效结束时间" prop="endDate"> |
| 113 | - <el-date-picker clearable size="small" :picker-options="pickerOptionsEnd" v-model="form.endDate" | 114 | + <el-date-picker clearable :picker-options="pickerOptionsEnd" v-model="form.endDate" type="date" |
| 114 | - type="date" value-format="yyyy-MM-dd" placeholder="选择结束时间"> | 115 | + value-format="yyyy-MM-dd" placeholder="选择结束时间"> |
| 115 | </el-date-picker> | 116 | </el-date-picker> |
| 116 | </el-form-item> | 117 | </el-form-item> |
| 117 | </el-col> | 118 | </el-col> | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | <div> | 2 | <div> |
| 3 | - <el-form class="form-header" :model="queryParams" label-position="right" label-width="auto" size="medium"> | 3 | + <el-form class="form-header" :model="queryParams" label-position="right" label-width="auto" size="small"> |
| 4 | <el-row> | 4 | <el-row> |
| 5 | <el-col :span="6"> | 5 | <el-col :span="6"> |
| 6 | <el-form-item label="航班日期从" prop="fltDateStart"> | 6 | <el-form-item label="航班日期从" prop="fltDateStart"> |
| ... | @@ -18,27 +18,27 @@ | ... | @@ -18,27 +18,27 @@ |
| 18 | </el-col> | 18 | </el-col> |
| 19 | <el-col :span="6"> | 19 | <el-col :span="6"> |
| 20 | <el-form-item label="航班号"> | 20 | <el-form-item label="航班号"> |
| 21 | - <el-input type="textarea" v-model="fltNo" clearable class="formItem" placeholder="AC001;AC002" :rows="1"> | 21 | + <el-input type="textarea" v-model="fltNo" clearable class="formItem" placeholder="AC001;AC002" rows="1"> |
| 22 | </el-input> | 22 | </el-input> |
| 23 | </el-form-item> | 23 | </el-form-item> |
| 24 | </el-col> | 24 | </el-col> |
| 25 | <el-col :span="6"> | 25 | <el-col :span="6"> |
| 26 | <el-form-item label="运单号"> | 26 | <el-form-item label="运单号"> |
| 27 | <el-input clearable type="textarea" v-model="queryParams.waybillNo" class="formItem" | 27 | <el-input clearable type="textarea" v-model="queryParams.waybillNo" class="formItem" |
| 28 | - placeholder="请输入运单号(回车间隔)" :rows="1"></el-input> | 28 | + placeholder="请输入运单号(回车间隔)" rows="1"></el-input> |
| 29 | </el-form-item> | 29 | </el-form-item> |
| 30 | </el-col> | 30 | </el-col> |
| 31 | </el-row> | 31 | </el-row> |
| 32 | <el-row> | 32 | <el-row> |
| 33 | <el-col :span="6"> | 33 | <el-col :span="6"> |
| 34 | <el-form-item label="站点"> | 34 | <el-form-item label="站点"> |
| 35 | - <el-input type="textarea" v-model="siteName" class="formItem" placeholder="PVG;PEK" clearable :rows="1"> | 35 | + <el-input type="textarea" v-model="siteName" class="formItem" placeholder="PVG;PEK" clearable rows="1"> |
| 36 | </el-input> | 36 | </el-input> |
| 37 | </el-form-item> | 37 | </el-form-item> |
| 38 | </el-col> | 38 | </el-col> |
| 39 | <el-col :span="6"> | 39 | <el-col :span="6"> |
| 40 | <el-form-item label="URSA"> | 40 | <el-form-item label="URSA"> |
| 41 | - <el-input clearable type="textarea" v-model="ursa" class="formItem" placeholder="S_;P_;E2" :rows="1"> | 41 | + <el-input clearable type="textarea" v-model="ursa" class="formItem" placeholder="S_;P_;E2" rows="1"> |
| 42 | </el-input> | 42 | </el-input> |
| 43 | </el-form-item> | 43 | </el-form-item> |
| 44 | </el-col> | 44 | </el-col> |
| ... | @@ -53,7 +53,6 @@ | ... | @@ -53,7 +53,6 @@ |
| 53 | }}</el-button> | 53 | }}</el-button> |
| 54 | </div> | 54 | </div> |
| 55 | </el-form> | 55 | </el-form> |
| 56 | - | ||
| 57 | <el-table max-height="500" highlight-current-row border stripe v-loading="loading" :data="tableData"> | 56 | <el-table max-height="500" highlight-current-row border stripe v-loading="loading" :data="tableData"> |
| 58 | <el-table-column label="运单号" align="center" prop="waybillNo" /> | 57 | <el-table-column label="运单号" align="center" prop="waybillNo" /> |
| 59 | <el-table-column :show-overflow-tooltip="true" label="品牌描述" align="center" prop="nameDescription" /> | 58 | <el-table-column :show-overflow-tooltip="true" label="品牌描述" align="center" prop="nameDescription" /> | ... | ... |
| ... | @@ -15,7 +15,8 @@ | ... | @@ -15,7 +15,8 @@ |
| 15 | <div style="font-size: 12px; font-weight: 700"> | 15 | <div style="font-size: 12px; font-weight: 700"> |
| 16 | 提示:<span style="color: #1890ff">以下为所提交的数据或出错信息</span> | 16 | 提示:<span style="color: #1890ff">以下为所提交的数据或出错信息</span> |
| 17 | </div> | 17 | </div> |
| 18 | - <el-table ref="filterTable" :data="tableData" v-loading="loading" style="width: 100%; margin-top: 20px" size="small" border> | 18 | + <el-table ref="filterTable" :data="tableData" v-loading="loading" style="width: 100%; margin-top: 20px" size="small" |
| 19 | + border> | ||
| 19 | <el-table-column label="行号" prop="line" width="50" align="center"> | 20 | <el-table-column label="行号" prop="line" width="50" align="center"> |
| 20 | </el-table-column> | 21 | </el-table-column> |
| 21 | <el-table-column label="错误信息" prop="errorMessage" width="300"> | 22 | <el-table-column label="错误信息" prop="errorMessage" width="300"> |
| ... | @@ -31,99 +32,99 @@ | ... | @@ -31,99 +32,99 @@ |
| 31 | <el-table-column v-if="tableData.length > 0" label="航班日期" align="center" prop="C" /> | 32 | <el-table-column v-if="tableData.length > 0" label="航班日期" align="center" prop="C" /> |
| 32 | <el-table-column v-if="tableData.length > 0" label="航班号" align="center" prop="D" /> | 33 | <el-table-column v-if="tableData.length > 0" label="航班号" align="center" prop="D" /> |
| 33 | <el-table-column v-if="tableData.length > 0" label="预审意见" align="center" prop="E" /> | 34 | <el-table-column v-if="tableData.length > 0" label="预审意见" align="center" prop="E" /> |
| 34 | - <!-- <el-table-column v-for="(value, key) in this.tableData[0]" :key="key" | 35 | + <!-- <el-table-column v-for="(value, key) in this.tableData[0]" :key="key" |
| 35 | v-if="key != 'errorMessage' && key != 'line'" :label="key" :prop="key" width="120"></el-table-column>--> | 36 | v-if="key != 'errorMessage' && key != 'line'" :label="key" :prop="key" width="120"></el-table-column>--> |
| 36 | </el-table> | 37 | </el-table> |
| 37 | </div> | 38 | </div> |
| 38 | </template> | 39 | </template> |
| 39 | 40 | ||
| 40 | <script> | 41 | <script> |
| 41 | - import { | 42 | +import { |
| 42 | - downLoadTemplate, | 43 | + downLoadTemplate, |
| 43 | - importcaPreReview, | 44 | + importcaPreReview, |
| 44 | - } from "@/api/caPreReviewImport"; | 45 | +} from "@/api/caPreReviewImport"; |
| 45 | - export default { | 46 | +export default { |
| 46 | - name:"CAPreReviewImport", | 47 | + name: "CAPreReviewImport", |
| 47 | - data() { | 48 | + data() { |
| 48 | - return { | 49 | + return { |
| 49 | - // 遮罩层 | 50 | + // 遮罩层 |
| 50 | - loading: false, | 51 | + loading: false, |
| 51 | - flightType: [], | 52 | + flightType: [], |
| 52 | - form: { | 53 | + form: { |
| 53 | - type: "", | 54 | + type: "", |
| 54 | - region: "", | 55 | + region: "", |
| 55 | - }, | ||
| 56 | - fileList: [], | ||
| 57 | - tableData: [], | ||
| 58 | - }; | ||
| 59 | - }, | ||
| 60 | - methods: { | ||
| 61 | - downloadTempleate() { | ||
| 62 | - let fileName = "航班预审导入模板.xlsx"; | ||
| 63 | - downLoadTemplate().then((res) => { | ||
| 64 | - if (res) { | ||
| 65 | - const blob = new Blob([res]); | ||
| 66 | - const link = document.createElement("a"); //创建a标签 | ||
| 67 | - link.download = fileName; //a标签添加属性 | ||
| 68 | - link.style.display = "none"; | ||
| 69 | - link.href = URL.createObjectURL(blob); | ||
| 70 | - document.body.appendChild(link); | ||
| 71 | - link.click(); //执行下载 | ||
| 72 | - URL.revokeObjectURL(link.href); //释放url | ||
| 73 | - document.body.removeChild(link); //释放标签 | ||
| 74 | - } else { | ||
| 75 | - this.$message.error("下载失败"); | ||
| 76 | - } | ||
| 77 | - }); | ||
| 78 | - | ||
| 79 | }, | 56 | }, |
| 80 | - uploadExcel(option) { | 57 | + fileList: [], |
| 81 | - //上传excel | 58 | + tableData: [], |
| 82 | - const file = option.file; | 59 | + }; |
| 83 | - this.loading=true; | 60 | + }, |
| 84 | - importcaPreReview(file, this.form.type).then((res) => { | 61 | + methods: { |
| 85 | - this.loading=false; | 62 | + downloadTempleate() { |
| 86 | - if (res.code != 200) { | 63 | + let fileName = "航班预审导入模板.xlsx"; |
| 87 | - if (res.code == 603) { | 64 | + downLoadTemplate().then((res) => { |
| 88 | - this.$alert(res.msg, "提示", { | 65 | + if (res) { |
| 89 | - confirmButtonText: "确定", | 66 | + const blob = new Blob([res]); |
| 90 | - type: "warning", | 67 | + const link = document.createElement("a"); //创建a标签 |
| 91 | - }); | 68 | + link.download = fileName; //a标签添加属性 |
| 92 | - } else { | 69 | + link.style.display = "none"; |
| 93 | - this.$message.error(res.msg); | 70 | + link.href = URL.createObjectURL(blob); |
| 94 | - this.tableData = res.data; | 71 | + document.body.appendChild(link); |
| 95 | - } | 72 | + link.click(); //执行下载 |
| 73 | + URL.revokeObjectURL(link.href); //释放url | ||
| 74 | + document.body.removeChild(link); //释放标签 | ||
| 75 | + } else { | ||
| 76 | + this.$message.error("下载失败"); | ||
| 77 | + } | ||
| 78 | + }); | ||
| 79 | + | ||
| 80 | + }, | ||
| 81 | + uploadExcel(option) { | ||
| 82 | + //上传excel | ||
| 83 | + const file = option.file; | ||
| 84 | + this.loading = true; | ||
| 85 | + importcaPreReview(file, this.form.type).then((res) => { | ||
| 86 | + this.loading = false; | ||
| 87 | + if (res.code != 200) { | ||
| 88 | + if (res.code == 603) { | ||
| 89 | + this.$alert(res.msg, "提示", { | ||
| 90 | + confirmButtonText: "确定", | ||
| 91 | + type: "warning", | ||
| 92 | + }); | ||
| 96 | } else { | 93 | } else { |
| 97 | - this.$message.success(res.msg); | 94 | + this.$message.warning(res.msg); |
| 98 | this.tableData = res.data; | 95 | this.tableData = res.data; |
| 99 | } | 96 | } |
| 100 | - }); | 97 | + } else { |
| 101 | - }, | 98 | + this.$message.success(res.msg); |
| 102 | - handleRemove(file, fileList) { | 99 | + this.tableData = res.data; |
| 103 | - //清掉上传的文件 | 100 | + } |
| 104 | - this.tableData = []; | 101 | + }); |
| 105 | - this.fileList = []; | 102 | + }, |
| 106 | - }, | 103 | + handleRemove(file, fileList) { |
| 107 | - handleExceed(files) { | 104 | + //清掉上传的文件 |
| 108 | - //重复上传文件 | 105 | + this.tableData = []; |
| 109 | - let file = {}; | 106 | + this.fileList = []; |
| 110 | - file.file = files[0]; | 107 | + }, |
| 111 | - file.name = files[0].name; | 108 | + handleExceed(files) { |
| 112 | - this.fileList = []; | 109 | + //重复上传文件 |
| 113 | - this.fileList.push(file); | 110 | + let file = {}; |
| 114 | - this.uploadExcel(file); | 111 | + file.file = files[0]; |
| 115 | - }, | 112 | + file.name = files[0].name; |
| 113 | + this.fileList = []; | ||
| 114 | + this.fileList.push(file); | ||
| 115 | + this.uploadExcel(file); | ||
| 116 | }, | 116 | }, |
| 117 | - }; | 117 | + }, |
| 118 | +}; | ||
| 118 | </script> | 119 | </script> |
| 119 | <style rel="stylesheet/scss" lang="scss"> | 120 | <style rel="stylesheet/scss" lang="scss"> |
| 120 | - .upload-demo { | 121 | +.upload-demo { |
| 121 | - float: right; | 122 | + float: right; |
| 122 | - } | 123 | +} |
| 123 | 124 | ||
| 124 | - .el-upload-list { | 125 | +.el-upload-list { |
| 125 | - display: inline-block; | 126 | + display: inline-block; |
| 126 | - margin-left: 10px; | 127 | + margin-left: 10px; |
| 127 | - vertical-align: top; | 128 | + vertical-align: top; |
| 128 | - } | 129 | +} |
| 129 | </style> | 130 | </style> | ... | ... |
| ... | @@ -60,6 +60,15 @@ export default { | ... | @@ -60,6 +60,15 @@ export default { |
| 60 | }; | 60 | }; |
| 61 | }, | 61 | }, |
| 62 | methods: { | 62 | methods: { |
| 63 | + typeData() { | ||
| 64 | + filghtKindData().then((response) => { | ||
| 65 | + if (response.code != 200) { | ||
| 66 | + this.msgError(response.msg) | ||
| 67 | + } | ||
| 68 | + this.flightType = response.data; | ||
| 69 | + this.form.type = response.data[0].code; | ||
| 70 | + }); | ||
| 71 | + }, | ||
| 63 | downloadTempleate() { | 72 | downloadTempleate() { |
| 64 | let downloadType = ""; | 73 | let downloadType = ""; |
| 65 | let fileName = ""; | 74 | let fileName = ""; |
| ... | @@ -108,7 +117,7 @@ export default { | ... | @@ -108,7 +117,7 @@ export default { |
| 108 | type: "warning", | 117 | type: "warning", |
| 109 | }); | 118 | }); |
| 110 | } else { | 119 | } else { |
| 111 | - this.$message.error(res.msg); | 120 | + this.$message.warning(res.msg); |
| 112 | this.tableData = res.data; | 121 | this.tableData = res.data; |
| 113 | } | 122 | } |
| 114 | } else { | 123 | } else { |
| ... | @@ -133,14 +142,11 @@ export default { | ... | @@ -133,14 +142,11 @@ export default { |
| 133 | }, | 142 | }, |
| 134 | }, | 143 | }, |
| 135 | created() { | 144 | created() { |
| 136 | - filghtKindData().then((response) => { | 145 | + this.typeData() |
| 137 | - if (response.code != 200) { | ||
| 138 | - this.msgError(response.msg) | ||
| 139 | - } | ||
| 140 | - this.flightType = response.data; | ||
| 141 | - this.form.type = response.data[0].code; | ||
| 142 | - }); | ||
| 143 | }, | 146 | }, |
| 147 | + activated() { | ||
| 148 | + this.typeData() | ||
| 149 | + } | ||
| 144 | }; | 150 | }; |
| 145 | </script> | 151 | </script> |
| 146 | <style rel="stylesheet/scss" lang="scss"> | 152 | <style rel="stylesheet/scss" lang="scss"> | ... | ... |
| ... | @@ -299,17 +299,17 @@ export default { | ... | @@ -299,17 +299,17 @@ export default { |
| 299 | trigger: "blur", | 299 | trigger: "blur", |
| 300 | }, | 300 | }, |
| 301 | ], | 301 | ], |
| 302 | - route: [ | 302 | + // route: [ |
| 303 | - { | 303 | + // { |
| 304 | - required: true, | 304 | + // required: true, |
| 305 | - message: "航班线路不能为空", | 305 | + // message: "航班线路不能为空", |
| 306 | - trigger: "blur", | 306 | + // trigger: "blur", |
| 307 | - }, | 307 | + // }, |
| 308 | - { | 308 | + // { |
| 309 | - pattern: /^([A-Z]{3,4})(\-[A-Z]{3,4})+$/, | 309 | + // pattern: /^([A-Z]{3,4})(\-[A-Z]{3,4})+$/, |
| 310 | - message: "请输入正确得航班线路" | 310 | + // message: "请输入正确得航班线路" |
| 311 | - } | 311 | + // } |
| 312 | - ] | 312 | + // ] |
| 313 | }, | 313 | }, |
| 314 | //原航班规则数据 | 314 | //原航班规则数据 |
| 315 | findAllFltDatList: [], | 315 | findAllFltDatList: [], | ... | ... |
| ... | @@ -18,18 +18,6 @@ | ... | @@ -18,18 +18,6 @@ |
| 18 | <div v-else>{{ roleData.remark }}</div> | 18 | <div v-else>{{ roleData.remark }}</div> |
| 19 | </el-form-item> | 19 | </el-form-item> |
| 20 | </el-col> | 20 | </el-col> |
| 21 | - <!-- <el-col :span="24"> | ||
| 22 | - <el-form-item label="角色状态:" prop="valid"> | ||
| 23 | - <el-switch | ||
| 24 | - v-model="roleForm.valid" | ||
| 25 | - :active-value="1" | ||
| 26 | - :inactive-value="2" | ||
| 27 | - active-color="#13ce66" | ||
| 28 | - inactive-color="#ff4949" | ||
| 29 | - :disabled="roleFormDisabled" | ||
| 30 | - ></el-switch> | ||
| 31 | - </el-form-item> | ||
| 32 | - </el-col> --> | ||
| 33 | <el-col :span="24"> | 21 | <el-col :span="24"> |
| 34 | <el-form-item label="角色权限:" prop="menuIdList"> | 22 | <el-form-item label="角色权限:" prop="menuIdList"> |
| 35 | <el-tree ref="tree" :data="treeData" node-key="id" :props="defaultProps" :show-checkbox="true" | 23 | <el-tree ref="tree" :data="treeData" node-key="id" :props="defaultProps" :show-checkbox="true" |
| ... | @@ -91,26 +79,13 @@ export default { | ... | @@ -91,26 +79,13 @@ export default { |
| 91 | }, | 79 | }, |
| 92 | }; | 80 | }; |
| 93 | }, | 81 | }, |
| 94 | - created() { | ||
| 95 | - //权限列表 | ||
| 96 | - getAllAuth() | ||
| 97 | - .then((res) => { | ||
| 98 | - if (res.code === 200) { | ||
| 99 | - this.treeData = this.treeDataInfo(res.data); | ||
| 100 | - } else { | ||
| 101 | - this.msgWarning(res.msg) | ||
| 102 | - } | ||
| 103 | - }) | ||
| 104 | - .catch((err) => { | ||
| 105 | - console.log(err); | ||
| 106 | - }); | ||
| 107 | - }, | ||
| 108 | watch: { | 82 | watch: { |
| 109 | roleFormDisabled() { | 83 | roleFormDisabled() { |
| 110 | this.treeData = this.treeDisabled(this.treeData); | 84 | this.treeData = this.treeDisabled(this.treeData); |
| 111 | }, | 85 | }, |
| 112 | drawer(val, oldVal) { | 86 | drawer(val, oldVal) { |
| 113 | if (val) { | 87 | if (val) { |
| 88 | + this.allAuth() | ||
| 114 | this.roleForm = this.roleData; | 89 | this.roleForm = this.roleData; |
| 115 | } else { | 90 | } else { |
| 116 | this.loading = false; | 91 | this.loading = false; |
| ... | @@ -118,12 +93,25 @@ export default { | ... | @@ -118,12 +93,25 @@ export default { |
| 118 | }, | 93 | }, |
| 119 | }, | 94 | }, |
| 120 | methods: { | 95 | methods: { |
| 96 | + //权限列表 | ||
| 97 | + allAuth() { | ||
| 98 | + getAllAuth() | ||
| 99 | + .then((res) => { | ||
| 100 | + if (res.code === 200) { | ||
| 101 | + this.treeData = this.treeDataInfo(res.data); | ||
| 102 | + } else { | ||
| 103 | + this.msgWarning(res.msg) | ||
| 104 | + } | ||
| 105 | + }) | ||
| 106 | + .catch((err) => { | ||
| 107 | + console.log(err); | ||
| 108 | + }); | ||
| 109 | + }, | ||
| 121 | //关闭 | 110 | //关闭 |
| 122 | handleClose() { | 111 | handleClose() { |
| 123 | this.$refs["roleForm"].clearValidate(); | 112 | this.$refs["roleForm"].clearValidate(); |
| 124 | this.$emit("handleClose", false); | 113 | this.$emit("handleClose", false); |
| 125 | }, | 114 | }, |
| 126 | - | ||
| 127 | //提交 | 115 | //提交 |
| 128 | submit() { | 116 | submit() { |
| 129 | let formData = {}; | 117 | let formData = {}; |
| ... | @@ -151,7 +139,6 @@ export default { | ... | @@ -151,7 +139,6 @@ export default { |
| 151 | console.log(err); | 139 | console.log(err); |
| 152 | }); | 140 | }); |
| 153 | }, | 141 | }, |
| 154 | - | ||
| 155 | //权限结构禁用 | 142 | //权限结构禁用 |
| 156 | treeDisabled(val) { | 143 | treeDisabled(val) { |
| 157 | let data = []; | 144 | let data = []; |
| ... | @@ -164,7 +151,7 @@ export default { | ... | @@ -164,7 +151,7 @@ export default { |
| 164 | }); | 151 | }); |
| 165 | return data; | 152 | return data; |
| 166 | }, | 153 | }, |
| 167 | - | 154 | + //权限结构数据整理 |
| 168 | treeDataInfo(val) { | 155 | treeDataInfo(val) { |
| 169 | let data = []; | 156 | let data = []; |
| 170 | val.forEach((item) => { | 157 | val.forEach((item) => { | ... | ... |
-
Please register or login to post a comment