md
This commit is contained in:
parent
8e473b0d5d
commit
7323cd33e9
422
src/views/emis/emisCommissionQuote/ecqExpressionPanel.vue
Normal file
422
src/views/emis/emisCommissionQuote/ecqExpressionPanel.vue
Normal file
@ -0,0 +1,422 @@
|
|||||||
|
<template>
|
||||||
|
<div >
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['emis:emisQuoteExpression:add']"
|
||||||
|
>新增计算规则</el-button>
|
||||||
|
</el-col>
|
||||||
|
<!-- <el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleCopy"
|
||||||
|
v-hasPermi="['emis:emisQuoteExpression:add']"
|
||||||
|
>复制计算规则</el-button>
|
||||||
|
</el-col> -->
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['emis:emisQuoteExpression:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table size="mini" v-loading="loading" :data="emisQuoteExpressionList" border @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="序号" align="center" prop="quoteSequence" width="60" />
|
||||||
|
<el-table-column label="范围" align="center" prop="conditionExpression" width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div class="link-type" @click="handleUpdate(scope.row)">{{scope.row.startWeight}} < w <= {{scope.row.endWeight}}</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="公式" align="center" prop="calculateExpression" width="100" />
|
||||||
|
<el-table-column label="首重费(s)" align="center" prop="initialWeight" width="100" />
|
||||||
|
<el-table-column label="续重单价(d)" align="center" prop="additionalWeight" width="100" />
|
||||||
|
<!-- <el-table-column label="条件表达式" align="center" prop="conditionExpression" min-width="100" /> -->
|
||||||
|
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
>编辑</el-button>
|
||||||
|
<!-- <el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
@click="handleCopy(scope.row)"
|
||||||
|
>复制</el-button> -->
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
@click.native.prevent="handleDelete(scope.row,scope.$index, emisQuoteExpressionList)"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<!-- @click="handleDelete(scope.row)" -->
|
||||||
|
<!-- 添加或修改费用计算表达式对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="50%" :close-on-click-modal="false" v-dialogDrag append-to-body>
|
||||||
|
<el-row :gutter="0">
|
||||||
|
<el-form ref="form" size="mini" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-alert
|
||||||
|
title="填写说明"
|
||||||
|
type="info"
|
||||||
|
description="计算公式中只能包含(s,w,d数字,+,.*,/).示例:0-1公斤 首重费(s):5元,续重单价(d):每公斤2元 ,则计算公式: s+(w-1)*d"
|
||||||
|
show-icon
|
||||||
|
:closable="false"
|
||||||
|
style="margin-bottom: 10px;"
|
||||||
|
>
|
||||||
|
</el-alert>
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="计算范围" prop="endWeight">
|
||||||
|
<div style="display: inline-flex;">
|
||||||
|
<div><el-input v-model="form.startWeight" placeholder="" disabled></el-input></div>
|
||||||
|
<div style="width: 70px;font-size: 12px;text-align: center;font-weight: bold;"> <w<= </div>
|
||||||
|
<div><el-input v-model="form.endWeight" placeholder="" ></el-input></div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="公式" prop="calculateExpression">
|
||||||
|
<el-input v-model="form.calculateExpression" placeholder="" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="序号" prop="quoteSequence">
|
||||||
|
<el-input v-model="form.quoteSequence" placeholder="" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="首重费(s)" prop="initialWeight">
|
||||||
|
<el-input v-model="form.initialWeight" placeholder="" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="续重单价(d)" prop="additionalWeight" label-width="100px">
|
||||||
|
<el-input v-model="form.additionalWeight" placeholder="" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-form>
|
||||||
|
</el-row>
|
||||||
|
<div slot="footer" class="dialog-footer" style="text-align: center;margin-bottom: 10px;">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listEmisQuoteExpression, getEmisQuoteExpression, delEmisQuoteExpression, addEmisQuoteExpression, updateEmisQuoteExpression } from "@/api/emis/emisQuoteExpression";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "emisQuoteExpression",
|
||||||
|
props:{
|
||||||
|
value:{
|
||||||
|
type:Array,
|
||||||
|
},
|
||||||
|
quoteId:{
|
||||||
|
type:Number
|
||||||
|
},
|
||||||
|
isCopy:{
|
||||||
|
type:Boolean
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
value(newVal) {
|
||||||
|
},
|
||||||
|
quoteId(){
|
||||||
|
this.initData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: { },
|
||||||
|
dicts: [
|
||||||
|
],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: false,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 费用计算表达式表格数据
|
||||||
|
emisQuoteExpressionList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
currentRow:{},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
quoteSequence: [
|
||||||
|
{ required: true, message: "报价序号不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
startWeight: [
|
||||||
|
{ required: true, message: "起始重量不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
endWeight: [
|
||||||
|
{ required: true, message: "结束重量不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
// conditionExpression: [
|
||||||
|
// { required: true, message: "条件表达式不能为空", trigger: "blur" }
|
||||||
|
// ],
|
||||||
|
calculateExpression: [
|
||||||
|
{ required: true, message: "计算表达式不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.initData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initData() {
|
||||||
|
if(this.quoteId!=null){
|
||||||
|
// this.emisQuoteExpressionList = this.value;
|
||||||
|
this.getList();
|
||||||
|
}else{
|
||||||
|
this.emisQuoteExpressionList=[];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
let queryParams={
|
||||||
|
quoteId:this.quoteId,
|
||||||
|
}
|
||||||
|
listEmisQuoteExpression(queryParams).then(response => {
|
||||||
|
this.emisQuoteExpressionList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onChage(){
|
||||||
|
this.$emit("input", this.emisQuoteExpressionList);
|
||||||
|
this.$emit("onChange",this.emisQuoteExpressionList);
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
quoteId: this.quoteId,
|
||||||
|
quoteSequence: null,
|
||||||
|
useSiteCode: null,
|
||||||
|
useSite: null,
|
||||||
|
startWeight: 0,
|
||||||
|
endWeight: null,
|
||||||
|
initialWeight: 0,
|
||||||
|
additionalWeight: 0,
|
||||||
|
conditionExpression: null,
|
||||||
|
calculateExpression: null,
|
||||||
|
status: null,
|
||||||
|
remark: null,
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
this.currentRow = selection[0];
|
||||||
|
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd(row) {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "新增公式";
|
||||||
|
const quoteSequence=this.emisQuoteExpressionList.length+1;
|
||||||
|
this.form.quoteSequence=quoteSequence;
|
||||||
|
if(quoteSequence>1){
|
||||||
|
// 获取上一条数据
|
||||||
|
const [lastData]= this.emisQuoteExpressionList.slice(-1);
|
||||||
|
console.log(lastData);
|
||||||
|
this.form.startWeight=lastData.endWeight;
|
||||||
|
this.form.endWeight='';
|
||||||
|
this.form.initialWeight=0;
|
||||||
|
this.form.additionalWeight=0;
|
||||||
|
|
||||||
|
if(quoteSequence==2){
|
||||||
|
this.form.initialWeight=lastData.calculateExpression;
|
||||||
|
this.form.calculateExpression='s+(w-'+lastData.endWeight+')*d';
|
||||||
|
}
|
||||||
|
else if(quoteSequence>2){
|
||||||
|
// this.form.initialWeight=lastData.initialWeight;
|
||||||
|
this.form.calculateExpression='w*d';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
handleCopy(row){
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "复制公式";
|
||||||
|
console.log(row)
|
||||||
|
const quoteSequence=this.emisQuoteExpressionList.length+1;
|
||||||
|
if(quoteSequence>1){
|
||||||
|
// 获取上一条数据
|
||||||
|
let newData =Object.assign({}, row);
|
||||||
|
console.log(newData)
|
||||||
|
this.form=newData;
|
||||||
|
this.form.quoteSequence=quoteSequence;
|
||||||
|
// this.form.startWeight=newData.endWeight;
|
||||||
|
// this.form.endWeight='';
|
||||||
|
// this.form.initialWeight=0;
|
||||||
|
// this.form.additionalWeight=0;
|
||||||
|
// this.form.calculateExpression=newData.calculateExpression;
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
|
||||||
|
if(this.quoteId != null && !this.isCopy){
|
||||||
|
this.handleUpdateByQuoteId(row);
|
||||||
|
}else{
|
||||||
|
this.currentRow = row;
|
||||||
|
this.form = row;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改公式";
|
||||||
|
},
|
||||||
|
handleUpdateByQuoteId(row){
|
||||||
|
this.loading = true;
|
||||||
|
getEmisQuoteExpression(row.id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
// 如果是已经存在的报价,直接更新
|
||||||
|
if(this.quoteId != null && !this.isCopy){
|
||||||
|
this.submitFormByQuoteId()
|
||||||
|
}else{
|
||||||
|
this.submitFormByNew();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.form={};
|
||||||
|
this.open = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
submitFormByQuoteId(){
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateEmisQuoteExpression(this.form).then(response => {
|
||||||
|
// this.$modal.msgSuccess("修改成功");
|
||||||
|
// this.$emit("on-changed");
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addEmisQuoteExpression(this.form).then(response => {
|
||||||
|
// this.$modal.msgSuccess("添加成功");
|
||||||
|
// this.$emit("on-changed");
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submitFormByNew(){
|
||||||
|
// 新增的需要带回数据
|
||||||
|
if (this.form.id == null) {
|
||||||
|
let newItem = Object.assign({}, this.form);
|
||||||
|
newItem.id=-1;
|
||||||
|
// console.log("000=>"+JSON.stringify(newItem));
|
||||||
|
this.emisQuoteExpressionList.push(newItem);
|
||||||
|
}
|
||||||
|
this.onChage();
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row,index,list) {
|
||||||
|
if(this.quoteId != null && !this.isCopy){
|
||||||
|
this.handleDeleteQuoteId(row);
|
||||||
|
}else{
|
||||||
|
this.handleDeleteByNew(row,index,list);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 从数据库中删除
|
||||||
|
handleDeleteQuoteId(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除').then(function() {
|
||||||
|
return delEmisQuoteExpression(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
// this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
handleDeleteByNew(row,index,list){
|
||||||
|
list.splice(index, 1);
|
||||||
|
// @click.native.prevent="deleteItem(scope.$index, list)"
|
||||||
|
// let arr = []
|
||||||
|
// const quoteSequence = row.id || this.ids[0]
|
||||||
|
// this.emisQuoteExpressionList.map(item=>{
|
||||||
|
// if (item.quoteSequence == quoteSequence) {
|
||||||
|
// this.form = item;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.el-divider{
|
||||||
|
margin-top: 0px;
|
||||||
|
background: 0 0;
|
||||||
|
border-top: 1px solid #E6EBF5;
|
||||||
|
}
|
||||||
|
.el-divider__text {
|
||||||
|
color: #0955ee;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-alert__title {
|
||||||
|
color: black!important;;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-alert__description {
|
||||||
|
color: black!important;;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -0,0 +1,240 @@
|
|||||||
|
<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="quoteCode">
|
||||||
|
<el-input v-model="form.quoteCode" placeholder="请输入提成方案编码" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="提成方案名称" prop="quoteName">
|
||||||
|
<el-input v-model="form.quoteName" placeholder="请输入提成方案名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="计算类型" prop="calcType">
|
||||||
|
<el-input v-model="form.calcType" placeholder="请输入计算类型" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="岗位类型:emis_commission_post" prop="postType">
|
||||||
|
<el-input v-model="form.postType" placeholder="请输入岗位类型:emis_commission_post" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="快递类型:emis_biz_shipping_method" prop="transType">
|
||||||
|
<el-input v-model="form.transType" placeholder="请输入快递类型:emis_biz_shipping_method" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="启用状态" prop="blOpen">
|
||||||
|
<el-input v-model="form.blOpen" placeholder="请输入启用状态" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="员工编号" prop="empCode">
|
||||||
|
<el-input v-model="form.empCode" placeholder="请输入员工编号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="员工名称" prop="empName">
|
||||||
|
<el-input v-model="form.empName" placeholder="请输入员工名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="开始日期" prop="startDate">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.startDate"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择开始日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="结束日期" prop="endDate">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.endDate"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择结束日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="优先级" prop="priorityLevel">
|
||||||
|
<el-input v-model="form.priorityLevel" 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="emisCommissionQuoteOptions"
|
||||||
|
: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 { listEmisCommissionQuote, getEmisCommissionQuote, delEmisCommissionQuote, addEmisCommissionQuote, updateEmisCommissionQuote } from "@/api/emis/emisCommissionQuote";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "emisCommissionQuoteForm",
|
||||||
|
props:{
|
||||||
|
quoteId:{
|
||||||
|
type:Number
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: { },
|
||||||
|
dicts: [
|
||||||
|
],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
emisCommissionQuoteOptions: [],
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
quoteId: [
|
||||||
|
{ required: true, message: "序号不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
delFlag: [
|
||||||
|
{ required: true, message: "删除标志(0代表存在不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
"quoteId": {
|
||||||
|
handler (newValue, oldValue) {
|
||||||
|
this.quoteId = newValue;
|
||||||
|
this.initData();
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.initData();
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
initData() {
|
||||||
|
|
||||||
|
if(this.quoteId !=null) {
|
||||||
|
this.loading = true;
|
||||||
|
getEmisCommissionQuote(this.quoteId).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
this.reset();
|
||||||
|
}
|
||||||
|
// this.getTreeselect();
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.reset();
|
||||||
|
this.$emit("on-cancel");
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
quoteId: null,
|
||||||
|
quoteCode: null,
|
||||||
|
quoteName: null,
|
||||||
|
calcType: null,
|
||||||
|
postType: null,
|
||||||
|
transType: null,
|
||||||
|
blOpen: null,
|
||||||
|
empCode: null,
|
||||||
|
empName: null,
|
||||||
|
startDate: null,
|
||||||
|
endDate: null,
|
||||||
|
priorityLevel: 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.quoteId != null) {
|
||||||
|
updateEmisCommissionQuote(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.$emit("on-changed");
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addEmisCommissionQuote(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.quoteId,
|
||||||
|
// label: node.quoteIdName,
|
||||||
|
// children: node.children
|
||||||
|
// };
|
||||||
|
// },
|
||||||
|
// /** 查询菜单下拉树结构 */
|
||||||
|
// getTreeselect() {
|
||||||
|
// const queryParams = {}
|
||||||
|
// listEmisCommissionQuote(queryParams).then(response => {
|
||||||
|
// this.emisCommissionQuoteOptions = [];
|
||||||
|
// const rootItem = { quoteIdId: 0, emisCommissionQuoteName: '-', children: [] };
|
||||||
|
// rootItem.children = this.handleTree(response.data, "quoteId");
|
||||||
|
// this.emisCommissionQuoteOptions.push(rootItem);
|
||||||
|
|
||||||
|
// if(this.parentId != undefined) {
|
||||||
|
// this.form.parentId = this.parentId;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user