Showing
3 changed files
with
227 additions
and
1 deletions
| ... | @@ -44,7 +44,10 @@ export function declareDataUpload(data) { | ... | @@ -44,7 +44,10 @@ export function declareDataUpload(data) { |
| 44 | return request({ | 44 | return request({ |
| 45 | url: '/bus-customer/declareData/' + data.type, | 45 | url: '/bus-customer/declareData/' + data.type, |
| 46 | method: 'post', | 46 | method: 'post', |
| 47 | - data: data.declareIds, | 47 | + data:{ |
| 48 | + cancellationReason: data.cancellationReason, | ||
| 49 | + declareIds: data.declareIds | ||
| 50 | + }, | ||
| 48 | }) | 51 | }) |
| 49 | } | 52 | } |
| 50 | 53 | ... | ... |
| ... | @@ -316,6 +316,11 @@ | ... | @@ -316,6 +316,11 @@ |
| 316 | @dwonloadModelFile="dwonloadModelFile" | 316 | @dwonloadModelFile="dwonloadModelFile" |
| 317 | @close="close" | 317 | @close="close" |
| 318 | /> | 318 | /> |
| 319 | + <RevokeDialog | ||
| 320 | + :showDialog="revokeVisible" | ||
| 321 | + :selectedDatas="selected" | ||
| 322 | + :dropdownCode="dropdownCode" | ||
| 323 | + @cancelRevoke="cancelRevoke" /> | ||
| 319 | </div> | 324 | </div> |
| 320 | </template> | 325 | </template> |
| 321 | 326 | ||
| ... | @@ -330,11 +335,14 @@ import { | ... | @@ -330,11 +335,14 @@ import { |
| 330 | getLogisticsReceipt, | 335 | getLogisticsReceipt, |
| 331 | exportDeclareData | 336 | exportDeclareData |
| 332 | } from "@/api/declareData-api.js"; | 337 | } from "@/api/declareData-api.js"; |
| 338 | +import { getDictData } from '@/api/system/dict-api.js' | ||
| 333 | import DialogVue from "./dialog.vue"; | 339 | import DialogVue from "./dialog.vue"; |
| 340 | +import RevokeDialog from "./revokeDialog.vue"; | ||
| 334 | export default { | 341 | export default { |
| 335 | name: "ReportingData", | 342 | name: "ReportingData", |
| 336 | components: { | 343 | components: { |
| 337 | DialogVue, | 344 | DialogVue, |
| 345 | + RevokeDialog | ||
| 338 | }, | 346 | }, |
| 339 | data() { | 347 | data() { |
| 340 | return { | 348 | return { |
| ... | @@ -459,10 +467,14 @@ export default { | ... | @@ -459,10 +467,14 @@ export default { |
| 459 | outerVisible: false, | 467 | outerVisible: false, |
| 460 | dropdownName: "一键申报", | 468 | dropdownName: "一键申报", |
| 461 | dropdownCode: "full", | 469 | dropdownCode: "full", |
| 470 | + | ||
| 471 | + | ||
| 472 | + revokeVisible:false, | ||
| 462 | }; | 473 | }; |
| 463 | }, | 474 | }, |
| 464 | created() { | 475 | created() { |
| 465 | this.search(0); | 476 | this.search(0); |
| 477 | + // this.getCancellationReasons() | ||
| 466 | }, | 478 | }, |
| 467 | mounted() { | 479 | mounted() { |
| 468 | this.tableMaxheight = window.innerHeight - 300; | 480 | this.tableMaxheight = window.innerHeight - 300; |
| ... | @@ -584,6 +596,12 @@ export default { | ... | @@ -584,6 +596,12 @@ export default { |
| 584 | this.selected.forEach((item) => { | 596 | this.selected.forEach((item) => { |
| 585 | obj.declareIds.push(item.declareId); | 597 | obj.declareIds.push(item.declareId); |
| 586 | }); | 598 | }); |
| 599 | + | ||
| 600 | + if (this.dropdownName === '撤销单申报') { | ||
| 601 | + this.revokeVisible = true | ||
| 602 | + return | ||
| 603 | + } | ||
| 604 | + | ||
| 587 | declareDataUpload(obj) | 605 | declareDataUpload(obj) |
| 588 | .then((res) => { | 606 | .then((res) => { |
| 589 | if (res.code === "200") { | 607 | if (res.code === "200") { |
| ... | @@ -598,6 +616,8 @@ export default { | ... | @@ -598,6 +616,8 @@ export default { |
| 598 | console.log(err); | 616 | console.log(err); |
| 599 | this.loadings.dropDownLoading = false; | 617 | this.loadings.dropDownLoading = false; |
| 600 | }); | 618 | }); |
| 619 | + | ||
| 620 | + | ||
| 601 | } else { | 621 | } else { |
| 602 | this.alertWarningMsg("请选择数据!"); | 622 | this.alertWarningMsg("请选择数据!"); |
| 603 | } | 623 | } |
| ... | @@ -751,6 +771,12 @@ export default { | ... | @@ -751,6 +771,12 @@ export default { |
| 751 | }); | 771 | }); |
| 752 | } | 772 | } |
| 753 | }, | 773 | }, |
| 774 | + cancelRevoke(){ | ||
| 775 | + this.loadings.dropDownLoading = false; | ||
| 776 | + this.revokeVisible = false | ||
| 777 | + } | ||
| 778 | + | ||
| 779 | + | ||
| 754 | }, | 780 | }, |
| 755 | }; | 781 | }; |
| 756 | </script> | 782 | </script> |
| ... | @@ -799,4 +825,10 @@ export default { | ... | @@ -799,4 +825,10 @@ export default { |
| 799 | transform: translate(0, -50%); | 825 | transform: translate(0, -50%); |
| 800 | z-index: 10; | 826 | z-index: 10; |
| 801 | } | 827 | } |
| 828 | +.revokeOperation{ | ||
| 829 | + margin-bottom:25px; | ||
| 830 | + .revokeSubmitBtn{ | ||
| 831 | + margin-right: 30px; | ||
| 832 | + } | ||
| 833 | +} | ||
| 802 | </style> | 834 | </style> | ... | ... |
src/views/reportingData/revokeDialog.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <el-dialog | ||
| 3 | + class="entryDialog classCUploadDialog" | ||
| 4 | + title="撤销单申报" | ||
| 5 | + :visible.sync="cancelVisible" | ||
| 6 | + :show-close="false" | ||
| 7 | + width="60%" | ||
| 8 | + :close-on-click-modal="false" | ||
| 9 | + > | ||
| 10 | + <div> | ||
| 11 | + <el-form class="fedexFormStyle" | ||
| 12 | + ref="cancelForm" | ||
| 13 | + :model="cancelFormData" | ||
| 14 | + :rules="cancelFormRules" | ||
| 15 | + label-position="left" | ||
| 16 | + size="small" | ||
| 17 | + > | ||
| 18 | + <Formitem label="撤销原因" prop="cancellationReason"> | ||
| 19 | + <el-select | ||
| 20 | + type="text" | ||
| 21 | + v-model="cancelFormData.cancellationReason" | ||
| 22 | + @change="changeCancellationReason" | ||
| 23 | + clearable | ||
| 24 | + placeholder="" | ||
| 25 | + > | ||
| 26 | + <el-option | ||
| 27 | + v-for="(item) in cancellationReasons" | ||
| 28 | + :key="item.itemValue" | ||
| 29 | + :label="item.itemValue" | ||
| 30 | + :value="item.itemValue" | ||
| 31 | + ></el-option> | ||
| 32 | + </el-select> | ||
| 33 | + </Formitem> | ||
| 34 | + <Formitem v-if="showOtherReason" label="其他原因" prop="otherReason"> | ||
| 35 | + <el-input | ||
| 36 | + type="textarea" | ||
| 37 | + class="inputShadow" | ||
| 38 | + resize="none" | ||
| 39 | + v-model="cancelFormData.otherReason" | ||
| 40 | + clearable | ||
| 41 | + placeholder="请输入其它撤销原因" | ||
| 42 | + ></el-input> | ||
| 43 | + </Formitem> | ||
| 44 | + </el-form> | ||
| 45 | + </div> | ||
| 46 | + <div class="dialogOption entrySave revokeOperation"> | ||
| 47 | + <el-button | ||
| 48 | + class="entrySaveButton entrySaveButton-background revokeSubmitBtn" | ||
| 49 | + type="primary" | ||
| 50 | + @click="submitRevoke" | ||
| 51 | + >提交</el-button> | ||
| 52 | + <el-button | ||
| 53 | + class="entrySaveButton" | ||
| 54 | + @click="cancelRevoke" | ||
| 55 | + >取消</el-button> | ||
| 56 | + </div> | ||
| 57 | +</el-dialog> | ||
| 58 | +</template> | ||
| 59 | + | ||
| 60 | + <script> | ||
| 61 | + import { declareDataUpload } from "@/api/declareData-api.js"; | ||
| 62 | + import { getDictData } from '@/api/system/dict-api.js' | ||
| 63 | + export default { | ||
| 64 | + props: { | ||
| 65 | + showDialog: { | ||
| 66 | + type: Boolean, | ||
| 67 | + default: false, | ||
| 68 | + }, | ||
| 69 | + selectedDatas:{ | ||
| 70 | + type:Array, | ||
| 71 | + default:() => [] | ||
| 72 | + }, | ||
| 73 | + dropdownCode: { | ||
| 74 | + type: String, | ||
| 75 | + default: 'full', | ||
| 76 | + }, | ||
| 77 | + }, | ||
| 78 | + data() { | ||
| 79 | + return { | ||
| 80 | + cancelVisible:false, | ||
| 81 | + showOtherReason:false, | ||
| 82 | + cancellationReasons:[], | ||
| 83 | + cancelFormData:{ | ||
| 84 | + cancellationReason:'', | ||
| 85 | + otherReason:'', | ||
| 86 | + }, | ||
| 87 | + cancelFormRules: { | ||
| 88 | + cancellationReason: [ | ||
| 89 | + { required: true, message: '请选择撤销原因', trigger: 'change' } | ||
| 90 | + ], | ||
| 91 | + otherReason:[ | ||
| 92 | + { required: true, message: '请输入撤销原因', trigger: 'blur' } | ||
| 93 | + ] | ||
| 94 | + } | ||
| 95 | + }; | ||
| 96 | + }, | ||
| 97 | + watch: { | ||
| 98 | + showDialog(val) { | ||
| 99 | + if (val) { | ||
| 100 | + this.cancelVisible = val | ||
| 101 | + } | ||
| 102 | + }, | ||
| 103 | + }, | ||
| 104 | + created() { | ||
| 105 | + this.getCancellationReasons() | ||
| 106 | + }, | ||
| 107 | + methods: { | ||
| 108 | + getCancellationReasons(){ | ||
| 109 | + getDictData({doctCode:'CANCELLATION_REASON'}).then(res =>{ | ||
| 110 | + if (res.code == '200') { | ||
| 111 | + this.cancellationReasons = res.data | ||
| 112 | + } | ||
| 113 | + }).catch(err =>{ | ||
| 114 | + console.error(err) | ||
| 115 | + }) | ||
| 116 | + }, | ||
| 117 | + changeCancellationReason(ev){ | ||
| 118 | + if (ev == '手工输入') { | ||
| 119 | + this.showOtherReason = true | ||
| 120 | + } else { | ||
| 121 | + this.showOtherReason = false | ||
| 122 | + | ||
| 123 | + } | ||
| 124 | + }, | ||
| 125 | + submitRevoke(){ | ||
| 126 | + if (!this.showOtherReason) { | ||
| 127 | + this.cancelFormData.otherReason = '' | ||
| 128 | + } | ||
| 129 | + this.$refs.cancelForm.validate((valid) => { | ||
| 130 | + if (valid) { | ||
| 131 | + let obj = { | ||
| 132 | + cancellationReason: this.cancelFormData.otherReason || this.cancelFormData.cancellationReason, | ||
| 133 | + declareIds: [], | ||
| 134 | + type: this.dropdownCode, | ||
| 135 | + }; | ||
| 136 | + this.selectedDatas.forEach((item) => { | ||
| 137 | + obj.declareIds.push(item.declareId); | ||
| 138 | + }); | ||
| 139 | + console.log('datas==', obj) | ||
| 140 | + declareDataUpload(obj) | ||
| 141 | + .then((res) => { | ||
| 142 | + if (res.code === "200") { | ||
| 143 | + // this.alertSuccessMsg(res.message); | ||
| 144 | + this.alertSuccessMsg("数据已成功提交申报,请等待海关回执。"); | ||
| 145 | + } else { | ||
| 146 | + this.alertWarningMsg(res.message); | ||
| 147 | + } | ||
| 148 | + this.cancelRevoke() | ||
| 149 | + }) | ||
| 150 | + .catch((err) => { | ||
| 151 | + console.log(err); | ||
| 152 | + this.cancelRevoke() | ||
| 153 | + }); | ||
| 154 | + } else { | ||
| 155 | + return false; | ||
| 156 | + } | ||
| 157 | + }); | ||
| 158 | + }, | ||
| 159 | + | ||
| 160 | + cancelRevoke(){ | ||
| 161 | + this.cancelVisible = false | ||
| 162 | + this.showOtherReason = false | ||
| 163 | + this.cancelFormData.cancellationReason = '' | ||
| 164 | + this.cancelFormData.otherReason = '' | ||
| 165 | + this.$emit('cancelRevoke') | ||
| 166 | + } | ||
| 167 | + }, | ||
| 168 | + }; | ||
| 169 | + </script> | ||
| 170 | + | ||
| 171 | + <style lang="scss" scoped> | ||
| 172 | + @import "@/assets/styles/variables.scss"; | ||
| 173 | + .modelItem { | ||
| 174 | + width: 100%; | ||
| 175 | + .modelItem-title { | ||
| 176 | + display: flex; | ||
| 177 | + justify-content: space-between; | ||
| 178 | + margin-bottom: 5px; | ||
| 179 | + font-size: 14px; | ||
| 180 | + font-weight: 600; | ||
| 181 | + color: #333; | ||
| 182 | + } | ||
| 183 | + } | ||
| 184 | + .revokeOperation{ | ||
| 185 | + margin-bottom:25px; | ||
| 186 | + .revokeSubmitBtn{ | ||
| 187 | + margin-right: 30px; | ||
| 188 | + } | ||
| 189 | +} | ||
| 190 | + </style> | ||
| 191 | + | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment