154 lines
4.4 KiB
Vue
154 lines
4.4 KiB
Vue
|
|
<template>
|
|||
|
|
<div >
|
|||
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|||
|
|
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
|
|||
|
|
<el-col :span="24">
|
|||
|
|
<el-form-item label="成本序号" prop="costNo">
|
|||
|
|
<el-input v-model="form.costNo" placeholder="请输入成本序号" />
|
|||
|
|
</el-form-item>
|
|||
|
|
</el-col>
|
|||
|
|
<el-col :span="24">
|
|||
|
|
<el-form-item label="费用类型" prop="feeType">
|
|||
|
|
<el-input v-model="form.feeType" placeholder="请输入费用类型" />
|
|||
|
|
</el-form-item>
|
|||
|
|
</el-col>
|
|||
|
|
<el-col :span="24">
|
|||
|
|
<el-form-item label="费用值" prop="fee">
|
|||
|
|
<el-input v-model="form.fee" placeholder="请输入费用值" />
|
|||
|
|
</el-form-item>
|
|||
|
|
</el-col>
|
|||
|
|
<el-col :span="24">
|
|||
|
|
<el-form-item label="费用币种" prop="currency">
|
|||
|
|
<el-input v-model="form.currency" placeholder="请输入费用币种" />
|
|||
|
|
</el-form-item>
|
|||
|
|
</el-col>
|
|||
|
|
<el-col :span="24">
|
|||
|
|
<el-form-item label="人民币汇率" prop="currecyToCnyRate">
|
|||
|
|
<el-input v-model="form.currecyToCnyRate" placeholder="请输入人民币汇率" />
|
|||
|
|
</el-form-item>
|
|||
|
|
</el-col>
|
|||
|
|
<el-col :span="24">
|
|||
|
|
<el-form-item label="实收人民币费用" prop="cnyFee">
|
|||
|
|
<el-input v-model="form.cnyFee" placeholder="请输入实收人民币费用" />
|
|||
|
|
</el-form-item>
|
|||
|
|
</el-col>
|
|||
|
|
<el-col :span="24">
|
|||
|
|
<el-form-item label="排序" prop="orderNum">
|
|||
|
|
<el-input v-model="form.orderNum" placeholder="请输入排序" />
|
|||
|
|
</el-form-item>
|
|||
|
|
</el-col>
|
|||
|
|
<el-col :span="24">
|
|||
|
|
<el-form-item label="备注" prop="remark">
|
|||
|
|
<el-input v-model="form.remark" placeholder="请输入备注" />
|
|||
|
|
</el-form-item>
|
|||
|
|
</el-col>
|
|||
|
|
</el-row>
|
|||
|
|
</el-form>
|
|||
|
|
<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 { listEmisTmsCostFeeFeeitem, getEmisTmsCostFeeFeeitem, delEmisTmsCostFeeFeeitem, addEmisTmsCostFeeFeeitem, updateEmisTmsCostFeeFeeitem } from "@/api/emis/emisTmsCostFeeFeeitem";
|
|||
|
|
|
|||
|
|
export default {
|
|||
|
|
name: "emisTmsCostFeeFeeitemForm",
|
|||
|
|
props:{
|
|||
|
|
id:{
|
|||
|
|
type:Number
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
components: { },
|
|||
|
|
dicts: [
|
|||
|
|
],
|
|||
|
|
data() {
|
|||
|
|
return {
|
|||
|
|
emisTmsCostFeeFeeitemOptions: [],
|
|||
|
|
// 遮罩层
|
|||
|
|
loading: true,
|
|||
|
|
// 表单参数
|
|||
|
|
form: {},
|
|||
|
|
// 表单校验
|
|||
|
|
rules: {
|
|||
|
|
id: [
|
|||
|
|
{ required: true, message: "id不能为空", trigger: "blur" }
|
|||
|
|
],
|
|||
|
|
delFlag: [
|
|||
|
|
{ required: true, message: "删除标志(0代表存在不能为空", 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;
|
|||
|
|
getEmisTmsCostFeeFeeitem(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,
|
|||
|
|
costNo: null,
|
|||
|
|
feeType: null,
|
|||
|
|
fee: null,
|
|||
|
|
currency: null,
|
|||
|
|
currecyToCnyRate: null,
|
|||
|
|
cnyFee: null,
|
|||
|
|
orderNum: null,
|
|||
|
|
remark: null
|
|||
|
|
};
|
|||
|
|
this.resetForm("form");
|
|||
|
|
},
|
|||
|
|
/** 提交按钮 */
|
|||
|
|
submitForm() {
|
|||
|
|
this.$refs["form"].validate(valid => {
|
|||
|
|
if (valid) {
|
|||
|
|
if (this.form.id != null) {
|
|||
|
|
updateEmisTmsCostFeeFeeitem(this.form).then(response => {
|
|||
|
|
this.$modal.msgSuccess("修改成功");
|
|||
|
|
this.$emit("on-changed");
|
|||
|
|
});
|
|||
|
|
} else {
|
|||
|
|
addEmisTmsCostFeeFeeitem(this.form).then(response => {
|
|||
|
|
this.$modal.msgSuccess("新增成功");
|
|||
|
|
this.$emit("on-changed");
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
</script>
|