zhanbo.xu

feat: 开发运抵

<template>
<el-dialog
<el-dialog
class="entryDialog classCUploadDialog"
title="批量修改"
:visible.sync="batchModifyVisible"
:show-close="false"
width="60%"
:close-on-click-modal="false"
>
<div>
<el-form class="fedexFormStyle"
ref="batchModifyForm"
:model="batchModifyFormData"
:rules="batchModifyFormRules"
label-position="left"
size="small"
>
<Formitem label="修改数据" prop="modifyData">
<el-select
title="批量修改"
:visible.sync="batchModifyVisible"
:show-close="false"
width="60%"
:close-on-click-modal="false"
>
<div>
<el-form
class="fedexFormStyle"
ref="batchModifyForm"
:model="batchModifyFormData"
:rules="batchModifyFormRules"
label-position="left"
size="small"
>
<Formitem label="修改数据" prop="modifyData">
<el-select
type="text"
v-model="batchModifyFormData.modifyData"
clearable
placeholder=""
>
>
<el-option
v-for="(item, index) in modifyDataList"
:key="index"
:label="item.name"
:value="item.value"
v-for="item in modifyDataList"
:key="item.itemValue"
:label="item.itemChineseName"
:value="item.itemValue"
></el-option>
</el-select>
</el-select>
</Formitem>
<Formitem label="修改内容" prop="modifyContent">
<el-input
type="text"
class="inputShadow"
resize="none"
v-model="batchModifyFormData.modifyContent"
clearable
placeholder="请输入修改内容"
></el-input>
<el-input
type="text"
class="inputShadow"
resize="none"
v-model="batchModifyFormData.modifyContent"
clearable
placeholder="请输入修改内容"
></el-input>
</Formitem>
</el-form>
</div>
<div class="dialogOption entrySave revokeOperation">
<el-button
class="entrySaveButton entrySaveButton-background revokeSubmitBtn"
type="primary"
@click="formSubmit"
>确定</el-button>
<el-button
class="entrySaveButton"
@click="cancelModify"
>关闭</el-button>
</div>
</el-dialog>
</template>
</el-form>
</div>
<div class="dialogOption entrySave revokeOperation">
<el-button
class="entrySaveButton entrySaveButton-background revokeSubmitBtn"
type="primary"
@click="formSubmit"
>确定</el-button
>
<el-button class="entrySaveButton" @click="cancelModify">关闭</el-button>
</div>
</el-dialog>
</template>
<script>
import { bathDeclareDate } from "@/api/declareData-api.js";
export default {
props: {
showDialog: {
type: Boolean,
default: false,
},
selectedDatas:{
type:Array,
default:() => []
},
},
data() {
return {
batchModifyVisible:false,
batchModifyFormData:{
modifyData:'',
modifyContent:''
},
batchModifyFormRules: {
modifyData: [{ required: true, message: '请选择修改数据', trigger: 'change' }],
modifyContent: [{ required: true, message: '请输入修改内容', trigger: 'blur' }],
},
modifyDataList:[
{name:'提运单号',value:'BILLNO'},
{name:'航班航次号',value:'FLIGHT_NUMBER'},
]
};
},
watch: {
showDialog(val) {
if (val) {
this.batchModifyVisible = val
this.batchModifyFormData.modifyData=""
this.batchModifyFormData.modifyContent=""
}
},
},
created() {
},
methods: {
formSubmit(){
this.$refs.batchModifyForm.validate((valid) => {
if (valid) {
let obj = {
declareIds: [],
modifyData: this.batchModifyFormData.modifyData,
modifyContent: this.batchModifyFormData.modifyContent,
};
this.selectedDatas.forEach((item) => {
obj.declareIds.push(item.declareId);
<script>
import { bathDeclareDate } from "@/api/declareData-api.js";
import { getDictData } from "@/api/system/dict-api.js";
export default {
props: {
showDialog: {
type: Boolean,
default: false,
},
selectedDatas: {
type: Array,
default: () => [],
},
},
data() {
return {
batchModifyVisible: false,
batchModifyFormData: {
modifyData: "",
modifyContent: "",
},
batchModifyFormRules: {
modifyData: [
{ required: true, message: "请选择修改数据", trigger: "change" },
],
modifyContent: [
{ required: true, message: "请输入修改内容", trigger: "blur" },
],
},
modifyDataList: [
{ name: "提运单号", value: "BILLNO" },
{ name: "航班航次号", value: "FLIGHT_NUMBER" },
],
};
},
watch: {
showDialog(val) {
if (val) {
this.batchModifyVisible = val;
this.batchModifyFormData.modifyData = "";
this.batchModifyFormData.modifyContent = "";
}
},
},
created() {
this.getModifyDataList();
},
methods: {
getModifyDataList() {
getDictData({ doctCode: "DATABASE_FIELD" })
.then((res) => {
if (res.code == "200") {
this.modifyDataList = res.data;
}
})
.catch((err) => {
console.error(err);
});
},
formSubmit() {
this.$refs.batchModifyForm.validate((valid) => {
if (valid) {
let obj = {
declareIds: [],
modifyData: this.batchModifyFormData.modifyData,
modifyContent: this.batchModifyFormData.modifyContent,
};
this.selectedDatas.forEach((item) => {
obj.declareIds.push(item.declareId);
});
console.log("datas==", obj);
bathDeclareDate(obj)
.then((res) => {
if (res.code === "200") {
this.msgSuccess("批量修改成功");
this.cancelModify(1);
} else {
this.alertWarningMsg(res.message);
}
})
.catch((err) => {
console.log(err);
this.alertWarningMsg(err.message);
this.cancelModify(1);
});
console.log('datas==', obj)
bathDeclareDate(obj).then((res) => {
if (res.code === "200") {
this.msgSuccess('批量修改成功')
this.cancelModify(1)
} else {
this.alertWarningMsg(res.message);
}
})
.catch((err) => {
console.log(err);
this.alertWarningMsg(err.message);
this.cancelModify(1)
});
} else {
return false;
}
});
},
} else {
return false;
}
});
},
cancelModify(val){
this.batchModifyVisible = false
this.$emit('cancelBatchModify',val)
}
},
};
</script>
cancelModify(val) {
this.batchModifyVisible = false;
this.$emit("cancelBatchModify", val);
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/styles/variables.scss";
.modelItem {
width: 100%;
.modelItem-title {
display: flex;
justify-content: space-between;
margin-bottom: 5px;
font-size: 14px;
font-weight: 600;
color: #333;
}
}
.revokeOperation{
margin-bottom:25px;
.revokeSubmitBtn{
margin-right: 30px;
}
}
</style>
<style lang="scss" scoped>
@import "@/assets/styles/variables.scss";
.modelItem {
width: 100%;
.modelItem-title {
display: flex;
justify-content: space-between;
margin-bottom: 5px;
font-size: 14px;
font-weight: 600;
color: #333;
}
}
.revokeOperation {
margin-bottom: 25px;
.revokeSubmitBtn {
margin-right: 30px;
}
}
</style>
......
......@@ -187,9 +187,7 @@
type="primary"
class="dropdown-style-button"
:loading="loadings.departureLoading"
@click="
declareData('departureLoading', '运抵单申报', 'logisticsDeparture')
"
@click="declareData('arrivalInLoading', '运抵单申报', 'arrivalIn')"
>
<svg-icon
class="el-icon-user-solid"
......@@ -632,6 +630,7 @@ export default {
exportDeclareLoading: false,
revokeLoading: false, // 撤销单申报加载状态
departureLoading: false, // 离境单申报加载状态
arrivalInLoading: false, // 运抵单申报加载状态
},
textareaVisible: {},
tableMaxheight: 500,
......
<template>
<el-dialog
class="entryDialog classCUploadDialog"
<el-dialog
class="entryDialog classCUploadDialog"
title="撤销单申报"
:visible.sync="cancelVisible"
:show-close="false"
width="60%"
:close-on-click-modal="false"
>
<div>
<el-form class="fedexFormStyle"
<div>
<el-form
class="fedexFormStyle"
ref="cancelForm"
:model="cancelFormData"
:rules="cancelFormRules"
label-position="left"
size="small"
>
<Formitem label="撤销原因" prop="cancellationReason">
<el-select
type="text"
v-model="cancelFormData.cancellationReason"
@change="changeCancellationReason"
clearable
placeholder=""
>
<el-option
v-for="(item) in cancellationReasons"
:key="item.itemValue"
:label="item.itemValue"
:value="item.itemValue"
></el-option>
</el-select>
</Formitem>
<Formitem v-if="showOtherReason" label="其他原因" prop="otherReason">
<el-input
type="textarea"
class="inputShadow"
resize="none"
v-model="cancelFormData.otherReason"
clearable
placeholder="请输入其它撤销原因"
></el-input>
</Formitem>
</el-form>
</div>
<Formitem label="撤销原因" prop="cancellationReason">
<el-select
type="text"
v-model="cancelFormData.cancellationReason"
@change="changeCancellationReason"
clearable
placeholder=""
>
<el-option
v-for="item in cancellationReasons"
:key="item.itemValue"
:label="item.itemValue"
:value="item.itemValue"
></el-option>
</el-select>
</Formitem>
<Formitem v-if="showOtherReason" label="其他原因" prop="otherReason">
<el-input
type="textarea"
class="inputShadow"
resize="none"
v-model="cancelFormData.otherReason"
clearable
placeholder="请输入其它撤销原因"
></el-input>
</Formitem>
</el-form>
</div>
<div class="dialogOption entrySave revokeOperation">
<el-button
class="entrySaveButton entrySaveButton-background revokeSubmitBtn"
type="primary"
@click="submitRevoke"
>提交</el-button>
<el-button
class="entrySaveButton"
@click="cancelRevoke"
>取消</el-button>
>提交</el-button
>
<el-button class="entrySaveButton" @click="cancelRevoke">取消</el-button>
</div>
</el-dialog>
</el-dialog>
</template>
<script>
import { declareDataUpload } from "@/api/declareData-api.js";
import { getDictData } from '@/api/system/dict-api.js'
export default {
props: {
showDialog: {
type: Boolean,
default: false,
},
selectedDatas:{
type:Array,
default:() => []
},
dropdownCode: {
type: String,
default: 'full',
},
<script>
import { declareDataUpload } from "@/api/declareData-api.js";
import { getDictData } from "@/api/system/dict-api.js";
export default {
props: {
showDialog: {
type: Boolean,
default: false,
},
data() {
return {
cancelVisible:false,
showOtherReason:false,
cancellationReasons:[],
cancelFormData:{
cancellationReason:'',
otherReason:'',
selectedDatas: {
type: Array,
default: () => [],
},
dropdownCode: {
type: String,
default: "full",
},
},
data() {
return {
cancelVisible: false,
showOtherReason: false,
cancellationReasons: [],
cancelFormData: {
cancellationReason: "",
otherReason: "",
},
cancelFormRules: {
cancellationReason: [
{ required: true, message: '请选择撤销原因', trigger: 'change' }
],
otherReason:[
{ required: true, message: '请输入撤销原因', trigger: 'blur' }
]
{ required: true, message: "请选择撤销原因", trigger: "change" },
],
otherReason: [
{ required: true, message: "请输入撤销原因", trigger: "blur" },
],
},
};
},
watch: {
showDialog(val) {
if (val) {
this.cancelVisible = val;
}
};
},
watch: {
showDialog(val) {
if (val) {
this.cancelVisible = val
}
},
},
created() {
this.getCancellationReasons()
this.getCancellationReasons();
},
methods: {
getCancellationReasons(){
getDictData({doctCode:'CANCELLATION_REASON'}).then(res =>{
if (res.code == '200') {
this.cancellationReasons = res.data
}
}).catch(err =>{
console.error(err)
})
methods: {
getCancellationReasons() {
getDictData({ doctCode: "CANCELLATION_REASON" })
.then((res) => {
if (res.code == "200") {
this.cancellationReasons = res.data;
}
})
.catch((err) => {
console.error(err);
});
},
changeCancellationReason(ev){
if (ev == '手工输入') {
this.showOtherReason = true
changeCancellationReason(ev) {
if (ev == "手工输入") {
this.showOtherReason = true;
} else {
this.showOtherReason = false
this.showOtherReason = false;
}
},
submitRevoke(){
submitRevoke() {
if (!this.showOtherReason) {
this.cancelFormData.otherReason = ''
this.cancelFormData.otherReason = "";
}
this.$refs.cancelForm.validate((valid) => {
if (valid) {
if (valid) {
let obj = {
cancellationReason: this.cancelFormData.otherReason || this.cancelFormData.cancellationReason,
declareIds: [],
type: this.dropdownCode,
};
this.selectedDatas.forEach((item) => {
obj.declareIds.push(item.declareId);
cancellationReason:
this.cancelFormData.otherReason ||
this.cancelFormData.cancellationReason,
declareIds: [],
type: this.dropdownCode,
};
this.selectedDatas.forEach((item) => {
obj.declareIds.push(item.declareId);
});
console.log("datas==", obj);
declareDataUpload(obj)
.then((res) => {
if (res.code === "200") {
// this.alertSuccessMsg(res.message);
this.alertSuccessMsg("数据已成功提交申报,请等待海关回执。");
} else {
this.alertWarningMsg(res.message);
}
this.cancelRevoke();
})
.catch((err) => {
console.log(err);
this.cancelRevoke();
});
console.log('datas==', obj)
declareDataUpload(obj)
.then((res) => {
if (res.code === "200") {
// this.alertSuccessMsg(res.message);
this.alertSuccessMsg("数据已成功提交申报,请等待海关回执。");
} else {
this.alertWarningMsg(res.message);
}
this.cancelRevoke()
})
.catch((err) => {
console.log(err);
this.cancelRevoke()
});
} else {
return false;
}
});
return false;
}
});
},
cancelRevoke(){
this.cancelVisible = false
this.showOtherReason = false
this.cancelFormData.cancellationReason = ''
this.cancelFormData.otherReason = ''
this.$emit('cancelRevoke')
}
cancelRevoke() {
this.cancelVisible = false;
this.showOtherReason = false;
this.cancelFormData.cancellationReason = "";
this.cancelFormData.otherReason = "";
this.$emit("cancelRevoke");
},
};
</script>
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/styles/variables.scss";
.modelItem {
width: 100%;
.modelItem-title {
display: flex;
justify-content: space-between;
margin-bottom: 5px;
font-size: 14px;
font-weight: 600;
color: #333;
}
<style lang="scss" scoped>
@import "@/assets/styles/variables.scss";
.modelItem {
width: 100%;
.modelItem-title {
display: flex;
justify-content: space-between;
margin-bottom: 5px;
font-size: 14px;
font-weight: 600;
color: #333;
}
.revokeOperation{
margin-bottom:25px;
.revokeSubmitBtn{
}
.revokeOperation {
margin-bottom: 25px;
.revokeSubmitBtn {
margin-right: 30px;
}
}
</style>
</style>
......