211 lines
6.3 KiB
Vue
211 lines
6.3 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="lineCode">
|
||
|
|
<el-input v-model="form.lineCode" placeholder="请输入线路代码" />
|
||
|
|
</el-form-item>
|
||
|
|
</el-col>
|
||
|
|
<el-col :span="24">
|
||
|
|
<el-form-item label="线路名称" prop="lineName">
|
||
|
|
<el-input v-model="form.lineName" placeholder="请输入线路名称" />
|
||
|
|
</el-form-item>
|
||
|
|
</el-col>
|
||
|
|
<el-col :span="24">
|
||
|
|
<el-form-item label="启用状态" prop="status">
|
||
|
|
<el-input v-model="form.status" placeholder="请输入启用状态" />
|
||
|
|
</el-form-item>
|
||
|
|
</el-col>
|
||
|
|
<el-col :span="24">
|
||
|
|
<el-form-item label="单证员" prop="siteAuditMan">
|
||
|
|
<el-input v-model="form.siteAuditMan" placeholder="请输入单证员" />
|
||
|
|
</el-form-item>
|
||
|
|
</el-col>
|
||
|
|
<el-col :span="24">
|
||
|
|
<el-form-item label="单证员代码" prop="siteAuditManCode">
|
||
|
|
<el-input v-model="form.siteAuditManCode" placeholder="请输入单证员代码" />
|
||
|
|
</el-form-item>
|
||
|
|
</el-col>
|
||
|
|
<el-col :span="24">
|
||
|
|
<el-form-item label="客服专员" prop="marketMan">
|
||
|
|
<el-input v-model="form.marketMan" placeholder="请输入客服专员" />
|
||
|
|
</el-form-item>
|
||
|
|
</el-col>
|
||
|
|
<el-col :span="24">
|
||
|
|
<el-form-item label="客服专员代码" prop="marketManCode">
|
||
|
|
<el-input v-model="form.marketManCode" placeholder="请输入客服专员代码" />
|
||
|
|
</el-form-item>
|
||
|
|
</el-col>
|
||
|
|
<el-col :span="24">
|
||
|
|
<el-form-item label="操作员" prop="operateMan">
|
||
|
|
<el-input v-model="form.operateMan" placeholder="请输入操作员" />
|
||
|
|
</el-form-item>
|
||
|
|
</el-col>
|
||
|
|
<el-col :span="24">
|
||
|
|
<el-form-item label="操作员代码" prop="operateManCode">
|
||
|
|
<el-input v-model="form.operateManCode" placeholder="请输入操作员代码" />
|
||
|
|
</el-form-item>
|
||
|
|
</el-col>
|
||
|
|
<el-col :span="24">
|
||
|
|
<el-form-item label="目的国家" prop="country">
|
||
|
|
<el-input v-model="form.country" placeholder="请输入目的国家" />
|
||
|
|
</el-form-item>
|
||
|
|
</el-col>
|
||
|
|
<el-col :span="24">
|
||
|
|
<el-form-item label="适用范围" prop="applyScope">
|
||
|
|
<el-input v-model="form.applyScope" placeholder="请输入适用范围" />
|
||
|
|
</el-form-item>
|
||
|
|
</el-col>
|
||
|
|
<el-col :span="24">
|
||
|
|
<el-form-item label="品牌类型" prop="logoType">
|
||
|
|
<el-input v-model="form.logoType" placeholder="请输入品牌类型" />
|
||
|
|
</el-form-item>
|
||
|
|
</el-col>
|
||
|
|
|
||
|
|
<el-form-item label="上级字典">
|
||
|
|
<treeselect
|
||
|
|
ref="tree"
|
||
|
|
v-model="form.parentId"
|
||
|
|
:options="emisTransLineOptions"
|
||
|
|
:normalizer="normalizer"
|
||
|
|
:default-expand-level="1"
|
||
|
|
:show-count="true"
|
||
|
|
placeholder="选择上级"
|
||
|
|
/>
|
||
|
|
</el-form-item>
|
||
|
|
|
||
|
|
|
||
|
|
</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 { listEmisTransLine, getEmisTransLine, delEmisTransLine, addEmisTransLine, updateEmisTransLine } from "@/api/emis/emisTransLine";
|
||
|
|
|
||
|
|
export default {
|
||
|
|
name: "emisTransLineForm",
|
||
|
|
props:{
|
||
|
|
id:undefined
|
||
|
|
},
|
||
|
|
components: { },
|
||
|
|
dicts: [
|
||
|
|
],
|
||
|
|
data() {
|
||
|
|
return {
|
||
|
|
emisTransLineOptions: [],
|
||
|
|
// 遮罩层
|
||
|
|
loading: true,
|
||
|
|
// 表单参数
|
||
|
|
form: {},
|
||
|
|
// 表单校验
|
||
|
|
rules: {
|
||
|
|
id: [
|
||
|
|
{ required: true, message: "序号不能为空", trigger: "blur" }
|
||
|
|
],
|
||
|
|
}
|
||
|
|
};
|
||
|
|
},
|
||
|
|
watch: {
|
||
|
|
"id": {
|
||
|
|
handler (newValue, oldValue) {
|
||
|
|
this.id = newValue;
|
||
|
|
this.initData();
|
||
|
|
},
|
||
|
|
deep: true
|
||
|
|
}
|
||
|
|
},
|
||
|
|
created() {
|
||
|
|
this.initData();
|
||
|
|
},
|
||
|
|
|
||
|
|
methods: {
|
||
|
|
initData() {
|
||
|
|
this.reset();
|
||
|
|
if(this.id !=undefined) {
|
||
|
|
this.loading = true;
|
||
|
|
getEmisTransLine(this.id).then(response => {
|
||
|
|
this.form = response.data;
|
||
|
|
this.loading = false;
|
||
|
|
});
|
||
|
|
}
|
||
|
|
this.getTreeselect();
|
||
|
|
},
|
||
|
|
// 取消按钮
|
||
|
|
cancel() {
|
||
|
|
this.reset();
|
||
|
|
this.$emit("on-cancel");
|
||
|
|
},
|
||
|
|
// 表单重置
|
||
|
|
reset() {
|
||
|
|
this.form = {
|
||
|
|
id: null,
|
||
|
|
lineCode: null,
|
||
|
|
lineName: null,
|
||
|
|
status: null,
|
||
|
|
siteAuditMan: null,
|
||
|
|
siteAuditManCode: null,
|
||
|
|
marketMan: null,
|
||
|
|
marketManCode: null,
|
||
|
|
operateMan: null,
|
||
|
|
operateManCode: null,
|
||
|
|
country: null,
|
||
|
|
applyScope: null,
|
||
|
|
logoType: null
|
||
|
|
};
|
||
|
|
this.resetForm("form");
|
||
|
|
},
|
||
|
|
/** 提交按钮 */
|
||
|
|
submitForm() {
|
||
|
|
this.$refs["form"].validate(valid => {
|
||
|
|
if (valid) {
|
||
|
|
if (this.form.id != null) {
|
||
|
|
updateEmisTransLine(this.form).then(response => {
|
||
|
|
this.$modal.msgSuccess("修改成功");
|
||
|
|
this.$emit("on-changed");
|
||
|
|
});
|
||
|
|
} else {
|
||
|
|
addEmisTransLine(this.form).then(response => {
|
||
|
|
this.$modal.msgSuccess("修改成功");
|
||
|
|
this.$emit("on-changed");
|
||
|
|
});
|
||
|
|
}
|
||
|
|
}
|
||
|
|
});
|
||
|
|
},
|
||
|
|
/** 转换菜单数据结构 */
|
||
|
|
normalizer(node) {
|
||
|
|
if (node.children && !node.children.length) {
|
||
|
|
delete node.children;
|
||
|
|
}
|
||
|
|
return {
|
||
|
|
id: node.id,
|
||
|
|
label: node.idName,
|
||
|
|
children: node.children
|
||
|
|
};
|
||
|
|
},
|
||
|
|
/** 查询菜单下拉树结构 */
|
||
|
|
getTreeselect() {
|
||
|
|
const queryParams = {}
|
||
|
|
listEmisTransLine(queryParams).then(response => {
|
||
|
|
this.emisTransLineOptions = [];
|
||
|
|
const rootItem = { idId: 0, emisTransLineName: '-', children: [] };
|
||
|
|
rootItem.children = this.handleTree(response.data, "id");
|
||
|
|
this.emisTransLineOptions.push(rootItem);
|
||
|
|
|
||
|
|
if(this.parentId != undefined) {
|
||
|
|
this.form.parentId = this.parentId;
|
||
|
|
}
|
||
|
|
|
||
|
|
});
|
||
|
|
},
|
||
|
|
}
|
||
|
|
};
|
||
|
|
</script>
|