238 lines
7.5 KiB
Vue
238 lines
7.5 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="quoteSequence">
|
|||
|
|
<el-input v-model="form.quoteSequence" placeholder="请输入报价序号" />
|
|||
|
|
</el-form-item>
|
|||
|
|
</el-col>
|
|||
|
|
<el-col :span="24">
|
|||
|
|
<el-form-item label="使用站点代码" prop="useSiteCode">
|
|||
|
|
<el-input v-model="form.useSiteCode" placeholder="请输入使用站点代码" />
|
|||
|
|
</el-form-item>
|
|||
|
|
</el-col>
|
|||
|
|
<el-col :span="24">
|
|||
|
|
<el-form-item label="使用站点名称" prop="useSite">
|
|||
|
|
<el-input v-model="form.useSite" placeholder="请输入使用站点名称" />
|
|||
|
|
</el-form-item>
|
|||
|
|
</el-col>
|
|||
|
|
<el-col :span="24">
|
|||
|
|
<el-form-item label="起始重量" prop="startWeight">
|
|||
|
|
<el-input v-model="form.startWeight" placeholder="请输入起始重量" />
|
|||
|
|
</el-form-item>
|
|||
|
|
</el-col>
|
|||
|
|
<el-col :span="24">
|
|||
|
|
<el-form-item label="结束重量" prop="endWeight">
|
|||
|
|
<el-input v-model="form.endWeight" placeholder="请输入结束重量" />
|
|||
|
|
</el-form-item>
|
|||
|
|
</el-col>
|
|||
|
|
<el-col :span="24">
|
|||
|
|
<el-form-item label="首重" prop="initialWeight">
|
|||
|
|
<el-input v-model="form.initialWeight" placeholder="请输入首重" />
|
|||
|
|
</el-form-item>
|
|||
|
|
</el-col>
|
|||
|
|
<el-col :span="24">
|
|||
|
|
<el-form-item label="续重" prop="additionalWeight">
|
|||
|
|
<el-input v-model="form.additionalWeight" placeholder="请输入续重" />
|
|||
|
|
</el-form-item>
|
|||
|
|
</el-col>
|
|||
|
|
<el-col :span="24">
|
|||
|
|
<el-form-item label="条件表达式" prop="conditionExpression">
|
|||
|
|
<el-input v-model="form.conditionExpression" placeholder="请输入条件表达式" />
|
|||
|
|
</el-form-item>
|
|||
|
|
</el-col>
|
|||
|
|
<el-col :span="24">
|
|||
|
|
<el-form-item label="计算表达式" prop="calculateExpression">
|
|||
|
|
<el-input v-model="form.calculateExpression" 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="remark">
|
|||
|
|
<el-input v-model="form.remark" placeholder="请输入备注" />
|
|||
|
|
</el-form-item>
|
|||
|
|
</el-col>
|
|||
|
|
<el-col :span="24">
|
|||
|
|
<el-form-item label="删除标志(0代表存在" prop="delFlag">
|
|||
|
|
<el-input v-model="form.delFlag" placeholder="请输入删除标志(0代表存在" />
|
|||
|
|
</el-form-item>
|
|||
|
|
</el-col>
|
|||
|
|
|
|||
|
|
<!--
|
|||
|
|
<el-form-item label="上级字典">
|
|||
|
|
<treeselect
|
|||
|
|
ref="tree"
|
|||
|
|
v-model="form.parentId"
|
|||
|
|
:options="emisCommissionExpressionOptions"
|
|||
|
|
:normalizer="normalizer"
|
|||
|
|
:default-expand-level="1"
|
|||
|
|
:show-count="true"
|
|||
|
|
placeholder="选择上级"
|
|||
|
|
/>
|
|||
|
|
</el-form-item>
|
|||
|
|
-->
|
|||
|
|
</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 { listEmisCommissionExpression, getEmisCommissionExpression, delEmisCommissionExpression, addEmisCommissionExpression, updateEmisCommissionExpression } from "@/api/emis/emisCommissionExpression";
|
|||
|
|
|
|||
|
|
export default {
|
|||
|
|
name: "emisCommissionExpressionForm",
|
|||
|
|
props:{
|
|||
|
|
id:{
|
|||
|
|
type:Number
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
components: { },
|
|||
|
|
dicts: [
|
|||
|
|
],
|
|||
|
|
data() {
|
|||
|
|
return {
|
|||
|
|
emisCommissionExpressionOptions: [],
|
|||
|
|
// 遮罩层
|
|||
|
|
loading: true,
|
|||
|
|
// 表单参数
|
|||
|
|
form: {},
|
|||
|
|
// 表单校验
|
|||
|
|
rules: {
|
|||
|
|
id: [
|
|||
|
|
{ required: true, message: "序号不能为空", trigger: "blur" }
|
|||
|
|
],
|
|||
|
|
quoteId: [
|
|||
|
|
{ required: true, message: "报价ID不能为空", trigger: "blur" }
|
|||
|
|
],
|
|||
|
|
quoteSequence: [
|
|||
|
|
{ required: true, message: "报价序号不能为空", trigger: "blur" }
|
|||
|
|
],
|
|||
|
|
startWeight: [
|
|||
|
|
{ required: true, message: "起始重量不能为空", trigger: "blur" }
|
|||
|
|
],
|
|||
|
|
endWeight: [
|
|||
|
|
{ required: true, message: "结束重量不能为空", 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;
|
|||
|
|
getEmisCommissionExpression(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,
|
|||
|
|
quoteId: null,
|
|||
|
|
quoteSequence: null,
|
|||
|
|
useSiteCode: null,
|
|||
|
|
useSite: null,
|
|||
|
|
startWeight: null,
|
|||
|
|
endWeight: null,
|
|||
|
|
initialWeight: null,
|
|||
|
|
additionalWeight: null,
|
|||
|
|
conditionExpression: null,
|
|||
|
|
calculateExpression: null,
|
|||
|
|
status: null,
|
|||
|
|
remark: null,
|
|||
|
|
tenantId: null,
|
|||
|
|
delFlag: null,
|
|||
|
|
createBy: null,
|
|||
|
|
createTime: null,
|
|||
|
|
updateBy: null,
|
|||
|
|
updateTime: null,
|
|||
|
|
createSite: null,
|
|||
|
|
updateSite: null
|
|||
|
|
};
|
|||
|
|
this.resetForm("form");
|
|||
|
|
},
|
|||
|
|
/** 提交按钮 */
|
|||
|
|
submitForm() {
|
|||
|
|
this.$refs["form"].validate(valid => {
|
|||
|
|
if (valid) {
|
|||
|
|
if (this.form.id != null) {
|
|||
|
|
updateEmisCommissionExpression(this.form).then(response => {
|
|||
|
|
this.$modal.msgSuccess("修改成功");
|
|||
|
|
this.$emit("on-changed");
|
|||
|
|
});
|
|||
|
|
} else {
|
|||
|
|
addEmisCommissionExpression(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 = {}
|
|||
|
|
// listEmisCommissionExpression(queryParams).then(response => {
|
|||
|
|
// this.emisCommissionExpressionOptions = [];
|
|||
|
|
// const rootItem = { idId: 0, emisCommissionExpressionName: '-', children: [] };
|
|||
|
|
// rootItem.children = this.handleTree(response.data, "id");
|
|||
|
|
// this.emisCommissionExpressionOptions.push(rootItem);
|
|||
|
|
|
|||
|
|
// if(this.parentId != undefined) {
|
|||
|
|
// this.form.parentId = this.parentId;
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// });
|
|||
|
|
// },
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
</script>
|