162 lines
4.7 KiB
Vue
162 lines
4.7 KiB
Vue
<template>
|
|
<div >
|
|
<el-row :gutter="0">
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
<el-col :span="24">
|
|
<el-form-item label="运单号" prop="billCode">
|
|
<el-input v-model="form.billCode" placeholder="请输入运单号" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="资料类型" prop="fileName">
|
|
<el-radio-group v-model="form.attachType" >
|
|
<el-radio :key="'3'" label="3">报关资料</el-radio>
|
|
<el-radio :key="'4'" label="4">清关资料</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="资料名称" prop="fileName">
|
|
<el-input v-model="form.fileName" placeholder="请输入资料名称" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="资料上传" prop="fileUrl">
|
|
<!-- <el-input v-model="form.fileUrl" placeholder="请输入文件地址" /> -->
|
|
<FileUpload :showTip="true" v-model="form.fileUrl" :isNeedUpload="true" :fileType="['jpg','png','bmp','pdf','zip','xls','xlsx']" :limit="10"></FileUpload>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-form-item label="资料描述" prop="fileDesc">
|
|
<el-input v-model="form.fileDesc" type="textarea" placeholder="请输入资料描述" />
|
|
</el-form-item>
|
|
</el-col>
|
|
<!-- <el-col :span="24">
|
|
<el-form-item label="备注" prop="remark">
|
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
|
</el-form-item>
|
|
</el-col> -->
|
|
|
|
</el-form>
|
|
</el-row>
|
|
<div style="text-align: center;margin-bottom: 10px;">
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
<el-button @click="cancel">取 消</el-button>
|
|
</div>
|
|
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { listEmisWaybillDeclareAttachment, getEmisWaybillDeclareAttachment, delEmisWaybillDeclareAttachment, addEmisWaybillDeclareAttachment, updateEmisWaybillDeclareAttachment } from "@/api/emis/emisWaybillDeclareAttachment";
|
|
|
|
export default {
|
|
name: "emisWaybillDeclareAttachmentForm",
|
|
props:{
|
|
id:{
|
|
type:Number
|
|
}
|
|
},
|
|
components: { },
|
|
dicts: [
|
|
],
|
|
data() {
|
|
return {
|
|
emisWaybillDeclareAttachmentOptions: [],
|
|
// 遮罩层
|
|
loading: true,
|
|
// 表单参数
|
|
form: {},
|
|
// 表单校验
|
|
rules: {
|
|
billCode: [
|
|
{ required: true, message: "运单号不能为空", trigger: "blur" }
|
|
],
|
|
attachType: [
|
|
{ required: true, message: "附件类型不能为空", trigger: "blur" }
|
|
],
|
|
fileName: [
|
|
{ required: true, message: "文件名称不能为空", trigger: "blur" }
|
|
],
|
|
fileUrl: [
|
|
{ required: true, message: "文件地址不能为空", trigger: "blur" }
|
|
],
|
|
}
|
|
};
|
|
},
|
|
watch: {
|
|
"id": {
|
|
handler (newValue, oldValue) {
|
|
this.id = newValue;
|
|
this.initData();
|
|
},
|
|
deep: true
|
|
}
|
|
},
|
|
created() {
|
|
this.initData();
|
|
},
|
|
|
|
methods: {
|
|
initData() {
|
|
|
|
if(this.id !=null) {
|
|
this.loading = true;
|
|
getEmisWaybillDeclareAttachment(this.id).then(response => {
|
|
this.form = response.data;
|
|
this.loading = false;
|
|
});
|
|
}else{
|
|
this.reset();
|
|
}
|
|
// this.getTreeselect();
|
|
},
|
|
// 取消按钮
|
|
cancel() {
|
|
this.reset();
|
|
this.$emit("on-cancel");
|
|
},
|
|
// 表单重置
|
|
reset() {
|
|
this.form = {
|
|
id: null,
|
|
waybillId: null,
|
|
billCode: null,
|
|
attachType: null,
|
|
fileName: null,
|
|
fileUrl: null,
|
|
fileSiez: null,
|
|
fileDesc: null,
|
|
orderNum: null,
|
|
dataFrom: null,
|
|
blAudit: null,
|
|
auditDate: null,
|
|
auditManCode: null,
|
|
auditSiteCode: null,
|
|
auditNote: null,
|
|
remark: null,
|
|
};
|
|
this.resetForm("form");
|
|
},
|
|
/** 提交按钮 */
|
|
submitForm() {
|
|
this.$refs["form"].validate(valid => {
|
|
if (valid) {
|
|
if (this.form.id != null) {
|
|
updateEmisWaybillDeclareAttachment(this.form).then(response => {
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.$emit("on-changed");
|
|
});
|
|
} else {
|
|
addEmisWaybillDeclareAttachment(this.form).then(response => {
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.$emit("on-changed");
|
|
});
|
|
}
|
|
}
|
|
});
|
|
},
|
|
}
|
|
};
|
|
</script>
|