feat(exportSummary): 新增汇总申报功能
- 添加汇总申报 API 接口 - 实现汇总申报页面组件 - 集成用户口岸信息、客户列表、字典数据等接口 - 添加表单验证和数据提交逻辑
Showing
3 changed files
with
330 additions
and
4 deletions
| ... | @@ -43,3 +43,17 @@ export function getExportSummaryDetail(data){ | ... | @@ -43,3 +43,17 @@ export function getExportSummaryDetail(data){ |
| 43 | method: 'get', | 43 | method: 'get', |
| 44 | }) | 44 | }) |
| 45 | } | 45 | } |
| 46 | + | ||
| 47 | + | ||
| 48 | +/** | ||
| 49 | + * 汇总申报 | ||
| 50 | + * @param data | ||
| 51 | + * @returns {*} | ||
| 52 | + */ | ||
| 53 | +export function declareSummaryApplication(data){ | ||
| 54 | + return request({ | ||
| 55 | + url:'/bus-customer/exportSummary/declare', | ||
| 56 | + method:'post', | ||
| 57 | + data:data | ||
| 58 | + }) | ||
| 59 | +} | ... | ... |
| ... | @@ -172,3 +172,14 @@ export function getMenuByRoleId(roleId) { | ... | @@ -172,3 +172,14 @@ export function getMenuByRoleId(roleId) { |
| 172 | // params: data | 172 | // params: data |
| 173 | }) | 173 | }) |
| 174 | } | 174 | } |
| 175 | + | ||
| 176 | +/** | ||
| 177 | + * 获取当前用户的口岸信息 | ||
| 178 | + * @returns {AxiosPromise} | ||
| 179 | + */ | ||
| 180 | +export function getCurrUserPortInfo(){ | ||
| 181 | + return request({ | ||
| 182 | + url:'/bus-customer/user/getCurrUserPortInfo', | ||
| 183 | + method:'get' | ||
| 184 | + }) | ||
| 185 | +} | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | - <div></div> | 2 | + <div style="background-color: #FFFFFF;height: 100%"> |
| 3 | + <div class="title"> | ||
| 4 | + <div> | ||
| 5 | + </div> | ||
| 6 | + <div> | ||
| 7 | + 汇总申报信息 | ||
| 8 | + </div> | ||
| 9 | + </div> | ||
| 10 | + <div class="content"> | ||
| 11 | + <el-form | ||
| 12 | + class="fedexFormStyle fedexFormEditStyle" | ||
| 13 | + ref="editForm" | ||
| 14 | + :model="formData" | ||
| 15 | + :rules="formRules" | ||
| 16 | + label-position="top" | ||
| 17 | + size="small" | ||
| 18 | + > | ||
| 19 | + <el-row :gutter="5" type="flex" justify="center"> | ||
| 20 | + <el-col :span="10"> | ||
| 21 | + <Formitem label="出口口岸" prop="portCode"> | ||
| 22 | + <el-select | ||
| 23 | + type="text" | ||
| 24 | + id="inputInner--portCode" | ||
| 25 | + v-model="formData.portCode" | ||
| 26 | + clearable | ||
| 27 | + filterable | ||
| 28 | + placeholder="" | ||
| 29 | + > | ||
| 30 | + <el-option | ||
| 31 | + v-for="(item, index) in portInfo" | ||
| 32 | + :key="index" | ||
| 33 | + :label="item.portCode" | ||
| 34 | + :value="item.declarationPortCode" | ||
| 35 | + ></el-option> | ||
| 36 | + </el-select> | ||
| 37 | + </Formitem> | ||
| 38 | + </el-col> | ||
| 39 | + <el-col :span="10"> | ||
| 40 | + <Formitem label="申报地海关" prop="customsCode"> | ||
| 41 | + <el-select | ||
| 42 | + type="text" | ||
| 43 | + id="inputInner--customsCode" | ||
| 44 | + v-model="formData.customsCode" | ||
| 45 | + clearable | ||
| 46 | + placeholder="" | ||
| 47 | + > | ||
| 48 | + <el-option | ||
| 49 | + v-for="(item, index) in portInfo" | ||
| 50 | + :key="index" | ||
| 51 | + :label="item.declarationPortCode" | ||
| 52 | + :value="item.declarationPortCode" | ||
| 53 | + ></el-option> | ||
| 54 | + </el-select> | ||
| 55 | + </Formitem> | ||
| 56 | + </el-col> | ||
| 57 | + </el-row> | ||
| 58 | + <el-row :gutter="5" type="flex" justify="center"> | ||
| 59 | + <el-col :span="10"> | ||
| 60 | + <Formitem label="电商企业名称" prop="ebpcode"> | ||
| 61 | + <el-select | ||
| 62 | + type="text" | ||
| 63 | + id="inputInner--ebpcode" | ||
| 64 | + v-model="formData.ebpcode" | ||
| 65 | + clearable | ||
| 66 | + filterable | ||
| 67 | + placeholder="" | ||
| 68 | + > | ||
| 69 | + <el-option | ||
| 70 | + v-for="(item, index) in ebcDataList" | ||
| 71 | + :key="index" | ||
| 72 | + :label="item.ecomEntName" | ||
| 73 | + :value="item.ecomEntCode" | ||
| 74 | + ></el-option> | ||
| 75 | + </el-select> | ||
| 76 | + </Formitem> | ||
| 77 | + </el-col> | ||
| 78 | + <el-col :span="10"> | ||
| 79 | + <Formitem label="申报方式" prop="declareType"> | ||
| 80 | + <el-select | ||
| 81 | + type="text" | ||
| 82 | + id="inputInner--declareType" | ||
| 83 | + v-model="formData.declareType" | ||
| 84 | + clearable | ||
| 85 | + placeholder="" | ||
| 86 | + > | ||
| 87 | + <el-option | ||
| 88 | + v-for="(item, index) in declareType" | ||
| 89 | + :key="index" | ||
| 90 | + :label="item.itemChineseName" | ||
| 91 | + :value="item.itemValue" | ||
| 92 | + ></el-option> | ||
| 93 | + </el-select> | ||
| 94 | + </Formitem> | ||
| 95 | + </el-col> | ||
| 96 | + </el-row> | ||
| 97 | + <el-row :gutter="5" type="flex" justify="center"> | ||
| 98 | + <el-col :span="10"> | ||
| 99 | + <Formitem label="创建时间" prop="time" :activeType="true"> | ||
| 100 | + <el-date-picker | ||
| 101 | + class="inputInner--time" | ||
| 102 | + id="inputInner--time" | ||
| 103 | + v-model="formData.time" | ||
| 104 | + type="daterange" | ||
| 105 | + format="yyyy-MM-dd" | ||
| 106 | + prefix-icon="none" | ||
| 107 | + value-format="yyyy-MM-dd" | ||
| 108 | + range-separator="至" | ||
| 109 | + @change="dateChange" | ||
| 110 | + style="background-color: #f2f2f2;" | ||
| 111 | + /> | ||
| 112 | + </Formitem> | ||
| 113 | + </el-col> | ||
| 114 | + <el-col :span="5"> | ||
| 115 | + <Formitem label="发货人汇总" prop="summaryFlag"> | ||
| 116 | + <el-select | ||
| 117 | + type="text" | ||
| 118 | + id="inputInner--summaryFlag" | ||
| 119 | + v-model="formData.summaryFlag" | ||
| 120 | + clearable | ||
| 121 | + placeholder="" | ||
| 122 | + > | ||
| 123 | + <el-option | ||
| 124 | + v-for="(item, index) in summaryFlag" | ||
| 125 | + :key="index" | ||
| 126 | + :label="item.itemChineseName" | ||
| 127 | + :value="item.itemValue" | ||
| 128 | + ></el-option> | ||
| 129 | + </el-select> | ||
| 130 | + </Formitem> | ||
| 131 | + </el-col> | ||
| 132 | + <el-col :span="5"> | ||
| 133 | + <Formitem label="商品名汇总" prop="itemNameFlag"> | ||
| 134 | + <el-select | ||
| 135 | + type="text" | ||
| 136 | + id="inputInner--itemNameFlag" | ||
| 137 | + v-model="formData.itemNameFlag" | ||
| 138 | + clearable | ||
| 139 | + placeholder="" | ||
| 140 | + > | ||
| 141 | + <el-option | ||
| 142 | + v-for="(item, index) in itemNameFlag" | ||
| 143 | + :key="index" | ||
| 144 | + :label="item.itemChineseName" | ||
| 145 | + :value="item.itemValue" | ||
| 146 | + ></el-option> | ||
| 147 | + </el-select> | ||
| 148 | + </Formitem> | ||
| 149 | + </el-col> | ||
| 150 | + </el-row> | ||
| 151 | + </el-form> | ||
| 152 | + </div> | ||
| 153 | + <div class="entrySave"> | ||
| 154 | + <el-button | ||
| 155 | + class="entrySaveButton" | ||
| 156 | + @click="submit" | ||
| 157 | + >提交</el-button | ||
| 158 | + > | ||
| 159 | + <el-button | ||
| 160 | + class="entrySaveButton" | ||
| 161 | + @click="cancel" | ||
| 162 | + >取消</el-button | ||
| 163 | + > | ||
| 164 | + </div> | ||
| 165 | + </div> | ||
| 3 | </template> | 166 | </template> |
| 4 | 167 | ||
| 5 | <script> | 168 | <script> |
| 169 | +import { getCurrUserPortInfo } from "@/api/system/user.js"; | ||
| 170 | +import { getCustomerList} from "@/api/declareData-api.js"; | ||
| 171 | +import { getDictData } from '@/api/system/dict-api.js' | ||
| 172 | +import { declareSummaryApplication } from "@/api/exportSummary-api.js"; | ||
| 6 | export default { | 173 | export default { |
| 7 | name: "", | 174 | name: "", |
| 8 | data() { | 175 | data() { |
| 9 | - return {}; | 176 | + return { |
| 177 | + formRules:{ | ||
| 178 | + portCode:[ | ||
| 179 | + { required: true, message: '请选择出口口岸', trigger: 'change' }, | ||
| 180 | + ], | ||
| 181 | + customsCode:[ | ||
| 182 | + { required: true, message: '请选择申报地海关', trigger: 'change' }, | ||
| 183 | + ], | ||
| 184 | + ebpcode: [ | ||
| 185 | + { required: true, message: '请选择电商企业', trigger: 'change' }, | ||
| 186 | + ], | ||
| 187 | + declareType: [ | ||
| 188 | + { required: true, message: '请选择申报方式', trigger: 'change' }, | ||
| 189 | + ], | ||
| 190 | + time: [ | ||
| 191 | + { | ||
| 192 | + type: 'array', | ||
| 193 | + required: true, | ||
| 194 | + message: '请选择完整的日期区间', | ||
| 195 | + trigger: 'change' | ||
| 196 | + } | ||
| 197 | + ], | ||
| 198 | + summaryFlag: [ | ||
| 199 | + { required: true, message: '请选择发货人汇总', trigger: 'change' }, | ||
| 200 | + ], | ||
| 201 | + itemNameFlag: [ | ||
| 202 | + { required: true, message: '请选择商品名汇总', trigger: 'change' }, | ||
| 203 | + ], | ||
| 204 | + }, | ||
| 205 | + formData:{}, | ||
| 206 | + portInfo:[], | ||
| 207 | + ebcDataList:[], | ||
| 208 | + summaryFlag:[], | ||
| 209 | + itemNameFlag:[], | ||
| 210 | + declareType:[] | ||
| 211 | + }; | ||
| 212 | + }, | ||
| 213 | + created() { | ||
| 214 | + this.getCurrUserPortInfo() | ||
| 215 | + this.getCustomerList() | ||
| 216 | + this.getSummaryFlag() | ||
| 217 | + this.getItemNameFlag() | ||
| 218 | + this.getDeclareType() | ||
| 219 | + }, | ||
| 220 | + methods: { | ||
| 221 | + //获取当前用户的口岸信息 | ||
| 222 | + getCurrUserPortInfo(){ | ||
| 223 | + getCurrUserPortInfo() | ||
| 224 | + .then((res) => { | ||
| 225 | + if (res.code === "200") { | ||
| 226 | + this.portInfo = res.data; | ||
| 227 | + } | ||
| 228 | + }) | ||
| 229 | + .catch((err) => { | ||
| 230 | + console.log(err); | ||
| 231 | + }); | ||
| 232 | + }, | ||
| 233 | + //获取客户下拉列表数据 | ||
| 234 | + getCustomerList(){ | ||
| 235 | + getCustomerList().then(res =>{ | ||
| 236 | + if (res.code == 200) { | ||
| 237 | + this.ebcDataList = res.data.value | ||
| 238 | + } else { | ||
| 239 | + this.ebcDataList = [] | ||
| 240 | + } | ||
| 241 | + | ||
| 242 | + }).catch(err =>{ | ||
| 243 | + console.log(err) | ||
| 244 | + }) | ||
| 245 | + }, | ||
| 246 | + //获取发货人下拉数据 | ||
| 247 | + getSummaryFlag(){ | ||
| 248 | + getDictData({ | ||
| 249 | + doctCode: "SUMMARY_FLAG" | ||
| 250 | + }).then(res => { | ||
| 251 | + if (res.code == 200) { | ||
| 252 | + this.summaryFlag = res.data; | ||
| 253 | + } else { | ||
| 254 | + this.summaryFlag = []; | ||
| 255 | + } | ||
| 256 | + }); | ||
| 257 | + }, | ||
| 258 | + //获取发货人下拉数据 | ||
| 259 | + getItemNameFlag(){ | ||
| 260 | + getDictData({ | ||
| 261 | + doctCode: "ITEM_NAME_FLAG" | ||
| 262 | + }).then(res => { | ||
| 263 | + if (res.code == 200) { | ||
| 264 | + this.itemNameFlag = res.data; | ||
| 265 | + } else { | ||
| 266 | + this.itemNameFlag = []; | ||
| 267 | + } | ||
| 268 | + }); | ||
| 269 | + }, | ||
| 270 | + cancel(){ | ||
| 271 | + this.$router.push("summaryDataSearch") | ||
| 272 | + }, | ||
| 273 | + submit(){ | ||
| 274 | + this.$refs.editForm.validate((valid) => { | ||
| 275 | + if (!valid) { | ||
| 276 | + return; | ||
| 277 | + } | ||
| 278 | + declareSummaryApplication(this.formData).then(response => { | ||
| 279 | + if(response.data){ | ||
| 280 | + this.msgSuccess("汇总申报成功"); | ||
| 281 | + this.$router.push("summaryDataSearch") | ||
| 282 | + }else { | ||
| 283 | + this.msgError(response.message) | ||
| 284 | + } | ||
| 285 | + }) | ||
| 286 | + }) | ||
| 287 | + }, | ||
| 288 | + dateChange(val){ | ||
| 289 | + this.formData.startTime = val[0] | ||
| 290 | + this.formData.endTime = val[1] | ||
| 291 | + }, | ||
| 292 | + getDeclareType(){ | ||
| 293 | + getDictData({ | ||
| 294 | + doctCode: "DECLARE_TYPE" | ||
| 295 | + }).then(res => { | ||
| 296 | + if (res.code == 200) { | ||
| 297 | + this.declareType = res.data; | ||
| 298 | + } else { | ||
| 299 | + this.declareType = []; | ||
| 300 | + } | ||
| 301 | + }); | ||
| 302 | + } | ||
| 10 | }, | 303 | }, |
| 11 | - methods: {}, | ||
| 12 | }; | 304 | }; |
| 13 | </script> | 305 | </script> |
| 14 | 306 | ||
| 15 | -<style lang="scss" scoped></style> | 307 | +<style lang="scss" scoped> |
| 308 | +.content { | ||
| 309 | + margin-top: 50px; | ||
| 310 | +} | ||
| 311 | +.title{ | ||
| 312 | + font-size: 23px; | ||
| 313 | + margin-left: 8%; | ||
| 314 | + padding-top: 2%; | ||
| 315 | +} | ||
| 316 | +</style> | ... | ... |
-
Please register or login to post a comment