Commit 256af943 by 叶富雄

修改检查规则

parent 95e5647d
......@@ -12,8 +12,8 @@
<script>
import formCompontent from "@c/form.vue";
import { insertJcgz, updateJcgzById, selectJcgz } from "@/api/zjcl/jcgz.js";
import { zjcljcgz } from "@/utils/params.js";
import { getJcgzById,addJcgz,updateJcgz } from "@/api/zjcl/jcgz.js";
import {getZjclLb } from "@/api/zjcl/zjcl.js";
export default {
name: "insertJcgz",
components: {
......@@ -29,10 +29,34 @@ export default {
id: 1,
objStr: "",
index: 0,
data: zjcljcgz,
data: [
{
name: "案事件类型:",
id: "ajlbdm",
type: "codeTree",
codeTree: "CODE_AJLB",
codeOptions: [],
value: "",
placeholder: "请输入",
col: "2",
prop:'checkEmpty'
},
{
name: "证件分类",
id: "zjcldm",
type: "checkboxList",
value: "01",
placeholder: "",
col: "22",
checkboxData: [],
},
],
},
],
formLabelAlign: {},
formLabelAlign: {
zjcldm: [],
},
zjclmc:[],
breadcrumbList: [
{
name: "检查规则管理",
......@@ -45,7 +69,7 @@ export default {
isActive: false,
},
{
name: this.$route.query.xxzjbh
name: this.$route.query.ruleid
? "修改检查规则信息"
: "新增检查规则信息",
to: "/insertJcgz",
......@@ -56,20 +80,30 @@ export default {
},
methods: {
submit(params) {
this.zjclmc = []
for(let i of this.formLabelAlign.zjcldm){
for(let j of this.propFormField[0]['data'][1]['checkboxData']){
if(i==j.val){
this.zjclmc.push(j.label)
}
}
}
let loading = this.$loading({
lock: true,
text: "正在保存...",
spinner: "el-icon-loading",
background: "rgba(255, 255, 255, 0.7)",
});
if (!this.xxzjbh) {
params.append('zjclmc',this.zjclmc)
if (!this.ruleid) {
this.addSubmit(params, loading);
} else {
this.editSubmit(params, loading);
}
},
addSubmit(params, loading) {
insertJcgz(params).then((res) => {
addJcgz(params).then((res) => {
if (res.success && res.code == 200) {
this.$alert("保存成功!", "提示", {
confirmButtonText: "确定",
......@@ -81,13 +115,13 @@ export default {
});
} else {
loading.close();
this.$message.error("添加失败,请检查数据格式是否正确");
this.$message.error(res.message);
}
});
},
editSubmit(params, loading) {
params.append("xxzjbh", this.xxzjbh);
updateJcgzById(params).then((res) => {
params.append("ruleid", this.ruleid);
updateJcgz(params).then((res) => {
if (res.success && res.code == 200) {
this.$alert("保存成功!", "提示", {
confirmButtonText: "确定",
......@@ -99,7 +133,7 @@ export default {
});
} else {
loading.close();
this.$message.error("添加失败,请检查数据格式是否正确");
this.$message.error(res.message);
}
});
},
......@@ -111,30 +145,39 @@ export default {
background: "rgba(255, 255, 255, 0.7)",
});
var self = this;
selectJcgz({
xxzjbh: this.xxzjbh,
getJcgzById({
ruleid: this.ruleid,
}).then((res) => {
var result = res.data.jcgz;
self.propFormField.forEach((fieldItem) => {
if (fieldItem.data && fieldItem.data.length > 0) {
fieldItem.data.forEach((i) => {
this.$set(this.formLabelAlign, i.id, result[i.id]);
});
}
this.$forceUpdate();
});
self.$set(self.formLabelAlign, "editing", true);
let zjcldm = res.data.jcgz.zjcldm;
self.formLabelAlign.zjcldm = zjcldm.split(',')
let ajlbdm = res.data.jcgz.ajlbdm;
self.formLabelAlign.ajlbdm = ajlbdm
self.$forceUpdate();
loading.close();
});
},
},
created() {
getZjclLb().then(res=>{
if(res.code === 200) {
let list = res.data.list
let objs = []
for(let i of list) {
objs.push({
label:i.name,
val:i.code
})
}
this.propFormField[0]['data'][1]['checkboxData'] = objs
}
else {
this.$message({type: "warning", message: res.msg,});
}
})
this.$store.commit("user/SET_Breadcrumb", this.breadcrumbList);
if (this.$route.query.xxzjbh) {
// this.$set(this.propFormField[0], "title", "修改检查规则信息");
if (this.$route.query.ruleid) {
this.title = "修改检查规则信息"
this.xxzjbh = this.$route.query.xxzjbh;
this.ruleid = this.$route.query.ruleid;
this.getshuju();
}
},
......@@ -142,4 +185,4 @@ export default {
</script>
<style scoped lang="scss">
</style>
\ No newline at end of file
</style>
......@@ -163,7 +163,7 @@ export default {
this.$router.push({
path: "/insertJcgz",
query: {
xxzjbh: obj.row.xxzjbh,
ruleid: obj.row.ruleid,
},
});
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment