4 changed files with 368 additions and 20 deletions
-
3src/components/webBooking/WebBookingMzak.vue
-
9src/store/index.js
-
283src/views/common-settings/BigtextResultTypeEdit.vue
-
93src/views/fee-settings/ResultSetting.vue
@ -0,0 +1,283 @@ |
|||||
|
<template> |
||||
|
<div style="padding: 10px 0;"> |
||||
|
<div> |
||||
|
<el-form :model="form" label-width="100px" :rules="rules" ref="ruleForm"> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<el-form-item label="上级类别"> |
||||
|
<el-cascader ref="depref" @change="cascaderchang" :show-all-levels="false" v-model="form.parentId" |
||||
|
:options="treeData" :props="{ |
||||
|
checkStrictly: true, |
||||
|
children: 'treeChildren', |
||||
|
label: 'displayName', |
||||
|
value: 'bigtextResultTypeId', |
||||
|
}" clearable size="small"></el-cascader> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<el-form-item label="名称" prop="displayName"> |
||||
|
<el-input v-model="form.displayName" ref="refinput" size="small"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="24"> |
||||
|
<el-form-item label="项目类别" prop="itemTypeId"> |
||||
|
<el-cascader ref="depref" @change="itemTypeIdchang" :show-all-levels="false" v-model="form.itemTypeId" |
||||
|
:options="itemtypes" filterable :props="{ |
||||
|
checkStrictly: true, |
||||
|
children: 'treeChildren', |
||||
|
label: 'displayName', |
||||
|
value: 'id', |
||||
|
}" clearable size="small"></el-cascader> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
<div style="display: flex;justify-content: space-between;padding: 10px 0;"> |
||||
|
<div></div> |
||||
|
<div> |
||||
|
<el-button @click="dialogWin.BigtextResultTypeEdit = false" class="difference">取消</el-button> |
||||
|
<el-button type="" @click="btnSubmit" class="commonbutton">确定</el-button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
|
||||
|
import { getapi, postapi, putapi } from "@/api/api"; |
||||
|
import { mapState } from "vuex"; |
||||
|
import { objCopy, tcdate } from "@/utlis/proFunc"; |
||||
|
|
||||
|
|
||||
|
export default { |
||||
|
props: ["refParams", "refFunOther"], |
||||
|
data() { |
||||
|
return { |
||||
|
treeData: [], // 树节点(编辑用) |
||||
|
itemtypes: [], // 项目树 |
||||
|
rules: { |
||||
|
displayName: [ |
||||
|
{ required: true, message: "请输入名称", trigger: "blur" }, |
||||
|
], |
||||
|
itemTypeId: [ |
||||
|
{ required: true, message: "请选择项目类别", trigger: "blur" }, |
||||
|
] |
||||
|
}, |
||||
|
defaultProps: { |
||||
|
children: "treeChildren", |
||||
|
label: "displayName", |
||||
|
}, |
||||
|
title: 1, |
||||
|
tableData: [], |
||||
|
tableHeight: window.innerHeight - 180, //表格动态高度 |
||||
|
screenHeight: window.innerHeight, //内容区域高度 |
||||
|
form: { |
||||
|
id: "", |
||||
|
displayName: "", |
||||
|
parentId: "", |
||||
|
itemTypeId: "" |
||||
|
}, |
||||
|
value: "", //指引类别选择的数据 |
||||
|
dialogVisible: false, |
||||
|
guideoptions: [], |
||||
|
row: {}, |
||||
|
isshow: true, |
||||
|
activeRows: [], |
||||
|
message: true, |
||||
|
tableKey: '', |
||||
|
isshows: true |
||||
|
}; |
||||
|
}, |
||||
|
created() { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
|
||||
|
this.dictInit() |
||||
|
this.dispEdit() |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
computed: { |
||||
|
...mapState(["window", "dialogWin", "dataTransOpts"]), |
||||
|
}, |
||||
|
methods: { |
||||
|
// 字典数据初始化 |
||||
|
dictInit() { |
||||
|
// this.getTreeData() |
||||
|
// 获取项目 |
||||
|
getapi('/api/app/item-type/by-code-all').then(res => { |
||||
|
if (res.code > -1) { |
||||
|
this.itemtypes = res.data |
||||
|
tcdate(this.itemtypes) |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
postapi('/api/app/BigtextResultType/GetByCodeAll').then(res => { |
||||
|
if (res.code > -1) { |
||||
|
this.treeData = res.data |
||||
|
tcdate(this.treeData) |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
cascaderchang(v) { |
||||
|
if (v) { |
||||
|
this.form.parentId = v[v.length - 1]; |
||||
|
} else { |
||||
|
this.form.parentId = null |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
itemTypeIdchang(v) { |
||||
|
if (v) { |
||||
|
this.form.itemTypeId = v[v.length - 1]; |
||||
|
} else { |
||||
|
this.form.itemTypeId = null |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
// 删除 |
||||
|
btnDel() { |
||||
|
let bigtextResultTypeId = this.row.bigtextResultTypeId; |
||||
|
this.$confirm("是否删除, 是否继续?", "提示", { |
||||
|
confirmButtonText: "确定", |
||||
|
cancelButtonText: "取消", |
||||
|
type: "warning", |
||||
|
cancelButtonClass: "difference", |
||||
|
confirmButtonClass: "commonbutton", |
||||
|
}) |
||||
|
.then(() => { |
||||
|
postapi('/api/app/BigtextResultType/Delete', { bigtextResultTypeId }).then((res) => { |
||||
|
if (res.code > -1) { |
||||
|
//this.$message.success("删除成功"); |
||||
|
this.row = this.$options.data().row; |
||||
|
|
||||
|
} |
||||
|
}); |
||||
|
}) |
||||
|
.catch(() => { |
||||
|
this.$message("取消成功"); |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
formFocus() { |
||||
|
|
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.refinput.focus(); |
||||
|
}); |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
|
||||
|
dispEdit() { |
||||
|
if (this.$refs.ruleForm !== undefined) { |
||||
|
this.$refs.ruleForm.resetFields(); |
||||
|
} |
||||
|
if (this.refParams.id) { |
||||
|
objCopy(this.refParams, this.form) |
||||
|
postapi('/api/app/BigtextResultType/Get', { bigtextResultTypeId: this.refParams.id }).then((res) => { |
||||
|
if (res.code > -1) { |
||||
|
objCopy(res.data, this.form); |
||||
|
this.formFocus() |
||||
|
} |
||||
|
}) |
||||
|
} else { |
||||
|
objCopy(this.refParams, this.form) |
||||
|
this.formFocus() |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
//确定新增或者编辑 |
||||
|
btnSubmit() { |
||||
|
this.$refs.ruleForm.validate((v) => { |
||||
|
if (v) { |
||||
|
if (!this.form.id) { |
||||
|
postapi('/api/app/BigtextResultType/Create', this.form).then(res => { |
||||
|
if (res.code > -1) { |
||||
|
this.refFunOther(res.data) |
||||
|
this.dialogWin.BigtextResultTypeEdit = false |
||||
|
} |
||||
|
}) |
||||
|
} else { |
||||
|
postapi('/api/app/BigtextResultType/Update', Object.assign({}, this.form, { bigtextResultTypeId: this.form.id })).then(res => { |
||||
|
if (res.code > -1) { |
||||
|
this.refFunOther(this.form) |
||||
|
this.dialogWin.BigtextResultTypeEdit = false |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
|
||||
|
//监听事件 |
||||
|
watch: { |
||||
|
// |
||||
|
"dataTransOpts.refresh.bigtext_result_type.S": { |
||||
|
// immediate:true, |
||||
|
handler(newVal, oldVal) { |
||||
|
console.log(`watch dataTransOpts.refresh.bigtext_result_type.S newVal: ${newVal}, oldVal: ${oldVal}`); |
||||
|
if (newVal != oldVal) this.dispEdit() |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
@import "../../assets/css/global_button.css"; |
||||
|
@import "../../assets/css/global_dialog.css"; |
||||
|
@import "../../assets/css/global_table.css"; |
||||
|
@import "../../assets/css/global_form.css"; |
||||
|
@import "../../assets/css/global_input.css"; |
||||
|
@import "../../assets/css/global.css"; |
||||
|
|
||||
|
.box { |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
} |
||||
|
|
||||
|
.layeredleftright { |
||||
|
width: 100%; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
} |
||||
|
|
||||
|
:deep .el-form-item { |
||||
|
margin-bottom: 14px; |
||||
|
} |
||||
|
|
||||
|
/* el-dialog的头部样式 */ |
||||
|
:deep .el-dialog__header { |
||||
|
padding: 11px 20px 11px; |
||||
|
} |
||||
|
|
||||
|
/* el-dialog的主体样式 */ |
||||
|
:deep .el-dialog__body { |
||||
|
padding: 0px 20px 0px; |
||||
|
} |
||||
|
|
||||
|
/* el-divider样式 */ |
||||
|
:deep .el-divider--horizontal { |
||||
|
margin: 0px 0 12px; |
||||
|
} |
||||
|
|
||||
|
/* el-dialog的底部样式 */ |
||||
|
:deep .el-dialog__footer { |
||||
|
padding: 0px 20px 14px; |
||||
|
} |
||||
|
|
||||
|
:deep .el-table tr { |
||||
|
height: 35px; |
||||
|
} |
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue