This commit is contained in:
2309368887@qq.com 2022-06-23 09:51:06 +08:00
parent bda5bb2771
commit 46b34704d5
15 changed files with 745 additions and 88 deletions

View File

@ -1,13 +1,14 @@
import config from "@/config" import config from "@/config"
import http from "@/utils/request" import http from "@/utils/request"
/*区域接口*/
export default { export default {
rparty: {
area: {
list: { list: {
name: "获取", name: "获取",
req: async function(data){ req: async function(data){
return await http.get( return await http.get(
`${config.API_URL}/opm/opl_cate/`, `${config.API_URL}/am/area/`,
data data
); );
} }
@ -16,7 +17,7 @@ export default {
name: "更新", name: "更新",
req: async function(id, data){ req: async function(id, data){
return await http.put( return await http.put(
`${config.API_URL}/opm/opl_cate/${id}/`, `${config.API_URL}/am/area/${id}/`,
data); data);
} }
}, },
@ -24,7 +25,7 @@ export default {
name: "创建", name: "创建",
req: async function(data){ req: async function(data){
return await http.post( return await http.post(
`${config.API_URL}/opm/opl_cate/`, `${config.API_URL}/am/area/`,
data); data);
} }
}, },
@ -32,8 +33,12 @@ export default {
name: "删除", name: "删除",
req: async function(id){ req: async function(id){
return await http.delete( return await http.delete(
`${config.API_URL}/opm/opl_cate/${id}/`); `${config.API_URL}/am/area/${id}/`);
} }
} }
}, },
} }

78
src/api/model/opm.js Normal file
View File

@ -0,0 +1,78 @@
import config from "@/config"
import http from "@/utils/request"
/*作业接口*/
export default {
/*作业许可证分类*/
oplcate: {
list: {
name: "获取",
req: async function(data){
return await http.get(
`${config.API_URL}/opm/opl_cate/`,
data
);
}
},
update: {
name: "更新",
req: async function(id, data){
return await http.put(
`${config.API_URL}/opm/opl_cate/${id}/`,
data);
}
},
create: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/opm/opl_cate/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/opm/opl_cate/${id}/`);
}
}
},
/*作业*/
operation: {
list: {
name: "获取",
req: async function(data){
return await http.get(
`${config.API_URL}/opm/operation/`,
data
);
}
},
update: {
name: "更新",
req: async function(id, data){
return await http.put(
`${config.API_URL}/opm/operation/${id}/`,
data);
}
},
create: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/opm/operation/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/opm/operation/${id}/`);
}
}
},
}

View File

@ -264,7 +264,7 @@ export default {
}, },
// //
async getData() { async getData() {
debugger;
this.loading = true; this.loading = true;
var reqData = { var reqData = {
[config.request.page]: this.currentPage, [config.request.page]: this.currentPage,
@ -278,7 +278,7 @@ export default {
// delete reqData[config.request.pageSize] // delete reqData[config.request.pageSize]
} }
Object.assign(reqData, this.tableParams); Object.assign(reqData, this.tableParams);
debugger;
try { try {
var res = await this.apiObj.req(reqData); var res = await this.apiObj.req(reqData);
if (this.hidePagination) { if (this.hidePagination) {
@ -288,7 +288,7 @@ export default {
} }
if(this.$route.path==='/sys/dept'||this.$route.path==='/sys/perm'){ if(this.$route.path==='/sys/dept'||this.$route.path==='/sys/perm'){
this.tableData = this.redata(res); this.tableData = this.redata(res);
debugger;
console.log(this.tableData) console.log(this.tableData)
}else{ }else{
this.tableData = res || []; this.tableData = res || [];
@ -316,7 +316,7 @@ export default {
} }
if(this.$route.path==='/sys/dept'||this.$route.path==='/ops/menu'){ if(this.$route.path==='/sys/dept'||this.$route.path==='/ops/menu'){
this.tableData = this.redata(dataList); this.tableData = this.redata(dataList);
debugger;
console.log(this.tableData) console.log(this.tableData)
}else{ }else{
this.tableData = dataList || []; this.tableData = dataList || [];
@ -354,7 +354,7 @@ export default {
parent.children = parent.children ? parent.children : []; parent.children = parent.children ? parent.children : [];
parent.children.push(item); parent.children.push(item);
} }
debugger;
console.log(arr); console.log(arr);
return arr; return arr;
}, },

View File

@ -16,3 +16,30 @@ export function verifyCars(rule, value, callback) {
} }
callback() callback()
} }
export function genTree(data) {
const result = []
if (!Array.isArray(data)) {
return result
}
data.forEach(item => {
delete item.children
})
const map = {}
data.forEach(item => {
item.label = item.name
if(item.fullname){
item.label = item.fullname
}
item.value = item.id
map[item.id] = item
})
data.forEach(item => {
const parent = map[item.parent]
if (parent) {
(parent.children || (parent.children = [])).push(item)
} else {
result.push(item)
}
})
return result
}

View File

@ -226,14 +226,14 @@
}, },
// //
submit() { submit() {
debugger; //debugger;
this.$refs.dialogForm.validate((valid) => { this.$refs.dialogForm.validate((valid) => {
debugger; // debugger;
if (valid) { if (valid) {
debugger; // debugger;
this.isSaveing = true; this.isSaveing = true;
if (this.mode === 'add') { if (this.mode === 'add') {
debugger; // debugger;
this.$API.hrm.employee.create.req(this.form) this.$API.hrm.employee.create.req(this.form)
.then(res => { .then(res => {
this.isSaveing = false; this.isSaveing = false;
@ -264,7 +264,7 @@
}, },
// //
setData(data) { setData(data) {
debugger; //debugger;
console.log(defaultForm); console.log(defaultForm);
// this.form = defaultForm; // this.form = defaultForm;
Object.assign(this.form, data); Object.assign(this.form, data);

View File

@ -1,64 +1,49 @@
<template> <template>
<el-container> <el-container>
<!-- <el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button> <el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
<el-button type="danger" plain icon="el-icon-delete" :disabled="selection.length==0" @click="batch_del"></el-button> <!-- <el-button type="danger" plain icon="el-icon-delete" :disabled="selection.length==0" @click="batch_del"></el-button>
<el-button type="primary" plain :disabled="selection.length!=1" @click="permission">权限设置</el-button> <el-button type="primary" plain :disabled="selection.length!=1" @click="permission">权限设置</el-button> -->
</div> </div>
<div class="right-panel"> <div class="right-panel">
<div class="right-panel-search"> <div class="right-panel-search">
<el-input v-model="search.keyword" placeholder="姓名/手机号" clearable @click="upsearch"></el-input> <el-input v-model="search.keyword" placeholder="名称" clearable @click="upsearch"></el-input>
<el-button type="primary" icon="el-icon-search" @click="upsearch"></el-button> <el-button type="primary" icon="el-icon-search" @click="upsearch"></el-button>
</div> </div>
</div> </div>
</el-header> --> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" fit stripe @resetQuery="resetQuery"> <scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" stripe @resetQuery="resetQuery" >
<el-table-column label="#" type="index" width="50"></el-table-column> <el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column label="事件种类" prop="cate_name"></el-table-column> <el-table-column label="名称" prop="name" width="200"></el-table-column>
<el-table-column label="发生区域" prop="area_name"> <el-table-column label="标识" prop="code" width="180">
</el-table-column> </el-table-column>
<el-table-column label="人员类型" prop="peope_type">
<template #default="scope"> <el-table-column label="操作" fixed="right" align="right" width="170">
<span v-if="scope.row.peope_type=='employee'">企业员工</span>
<span v-if="scope.row.peope_type=='remployee'">相关方</span>
<span v-if="scope.row.peope_type=='visitor'">访客</span>
</template>
</el-table-column>
<el-table-column label="当事人" prop="people_name"></el-table-column>
<el-table-column label="发生时间" prop="create_time"></el-table-column>
<el-table-column label="是否已处理">
<template #default="scope">
<el-icon v-if="scope.row.handle_user" color="green"><CircleCheckFilled /></el-icon>
<el-icon v-else color="red"><CircleCloseFilled /></el-icon>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="right">
<template #default="scope"> <template #default="scope">
<el-button-group> <el-button-group>
<el-button text type="primary" size="small" @click="table_show(scope.row, scope.$index)">查看</el-button> <el-button text type="primary" size="small" @click="table_show(scope.row, scope.$index)">查看</el-button>
<!-- <el-button text type="warning" size="small" @click="table_edit(scope.row, scope.$index)">编辑</el-button> --> <el-button text type="warning" size="small" @click="table_edit(scope.row, scope.$index)">编辑</el-button>
<!-- <el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
<template #reference>
<el-button text type="danger" size="small">删除</el-button>
</template>
</el-popconfirm> -->
</el-button-group> </el-button-group>
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
</el-main> </el-main>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save=false"></save-dialog>
</el-container> </el-container>
</template> </template>
<script> <script>
import { CircleCheckFilled, CircleCloseFilled } from '@element-plus/icons-vue' import saveDialog from './operation_form.vue'
export default { export default {
name: 'event', name: 'operation',
components: { components: {
CircleCheckFilled, saveDialog
CircleCloseFilled
}, },
data() { data() {
return { return {
@ -66,7 +51,7 @@
save: false, save: false,
permission: false permission: false
}, },
apiObj: this.$API.ecm.event.list, apiObj: this.$API.opm.operation.list,
query: {}, query: {},
selection: [], selection: [],
search: { search: {
@ -75,6 +60,20 @@
} }
}, },
methods: { methods: {
//
add(){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open('add')
})
},
//
table_edit(row){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open('edit').setData(row)
})
},
// //
table_show(row){ table_show(row){
this.dialog.save = true this.dialog.save = true
@ -82,9 +81,70 @@
this.$refs.saveDialog.open('show').setData(row) this.$refs.saveDialog.open('show').setData(row)
}) })
}, },
//
permission(){
this.dialog.permission = true
this.$nextTick(() => {
this.$refs.permissionDialog.open()
})
},
//
async table_del(row){
var reqData = {id: row.id}
var res = await this.$API.demo.post.post(reqData);
if(res.code == 200){
this.$refs.table.refresh()
this.$message.success("删除成功")
}else{
this.$alert(res.message, "提示", {type: 'error'})
}
},
//
async batch_del(){
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?如果删除项中含有子集将会被一并删除`, '提示', {
type: 'warning'
}).then(() => {
const loading = this.$loading();
this.$refs.table.refresh()
loading.close();
this.$message.success("操作成功")
}).catch(() => {
})
},
//
selectionChange(selection){
this.selection = selection;
},
//
changeSwitch(val, row){
row.status = row.status == '1'?'0':'1'
row.$switch_status = true;
setTimeout(()=>{
delete row.$switch_status;
row.status = val;
this.$message.success("操作成功")
}, 500)
},
// //
upsearch(){ upsearch(){
},
//ID
filterTree(id){
var target = null;
function filter(tree){
tree.forEach(item => {
if(item.id == id){
target = item
}
if(item.children){
filter(item.children)
}
})
}
filter(this.$refs.table.tableData)
return target
}, },
// //
handleSaveSuccess(data, mode){ handleSaveSuccess(data, mode){

View File

@ -0,0 +1,254 @@
<template>
<el-drawer
:title="titleMap[mode]"
v-model="visible"
:size="1000"
destroy-on-close
@closed="$emit('closed')"
>
<el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px">
<el-form
ref="dialogForm"
:model="form"
:rules="rules"
:disabled="mode == 'show'"
label-width="100px"
>
<el-row>
<el-col :md="24" :sm="12" :xs="24">
<el-form-item label="作业简介">
<el-input v-model="form.name" type="text" clearable></el-input>
</el-form-item>
</el-col>
<el-col :md="24" :sm="12" :xs="24">
<el-form-item label="具体地点">
<el-input v-model="form.place" type="text" clearable></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="开始时间">
<el-date-picker
v-model="form.start_time"
type="datetime"
placeholder="选择开始时间"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="结束时间">
<el-date-picker
v-model="form.end_time"
type="datetime"
placeholder="选择结束时间"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="生产状态">
<el-select v-model="form.state_work" placeholder="选择生产状态">
<el-option
v-for="item in stateoptions"
:key="item.id"
:label="item.name"
:value="item.name"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="作业区域">
<el-select v-model="form.area" placeholder="选择作业区域">
<el-option
v-for="item in areaoptions"
:key="item.id"
:label="item.name"
:value="item.name"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="所属部门">
<el-cascader
placeholder="选择所属部门"
v-model="form.belong_dept"
:options="deptoptions"
clearable
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="属地部门">
<el-select v-model="form.dept_ter" placeholder="选择属地部门">
<el-option
v-for="item in deptoptions"
:key="item.id"
:label="item.name"
:value="item.name"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="业务部门">
<el-select v-model="form.dept_bus" placeholder="选择业务部门">
<el-option
v-for="item in deptoptions"
:key="item.id"
:label="item.name"
:value="item.name"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" :xs="24">
<el-form-item label="部门协调员">
<el-select
v-model="form.coordinator"
placeholder="选择业务部门协调员"
>
<el-option
v-for="item in coordinatoroptions"
:key="item.id"
:label="item.name"
:value="item.name"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-main>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit"
>保存</el-button
>
<el-button @click="visible = false">取消</el-button>
</el-footer>
</el-container>
</el-drawer>
</template>
<script>
import {genTree} from "@/utils/verificate";
export default {
emits: ["success", "closed"],
data() {
return {
loading: false,
mode: "add",
titleMap: {
add: "新增",
edit: "编辑",
show: "查看",
},
form: {},
rules: {
name: [{ required: true, message: "请输入作业简介" }],
start_time: [{ required: true, message: "请输入" }],
end_time: [{ required: true, message: "请输入" }],
state_work: [{ required: true, message: "请输入" }],
area: [{ required: true, message: "请输入" }],
dept_ter: [{ required: true, message: "请输入" }],
dept_bus: [{ required: true, message: "请输入" }],
coordinator: [{ required: true, message: "请输入" }],
},
visible: false,
isSaveing: false,
selectionFilters: [],
setFiltersVisible: false,
stateoptions: [
{ id: 10, name: "运行" },
{ id: 20, name: "停机" },
{ id: 20, name: "检修" },
],
deptoptions: [],
areaoptions: [],
};
},
mounted() {
this.getDept();
this.getArea();
},
methods: {
//,
getDept() {
this.$API.system.dept.list.req({ page: 0 }).then((res) => {
this.deptoptions = genTree(res);
console.log(this.deptoptions);
});
},
//
getArea() {
this.$API.am.area.list.req({ page: 0 }).then((res) => {
console.log(res);
this.areaoptions = res;
});
},
//
open(mode = "add") {
this.mode = mode;
this.visible = true;
return this;
},
//
submit() {
this.$refs.dialogForm.validate(async (valid) => {
if (valid) {
this.isSaveing = true;
try {
var res;
if (this.mode == "add") {
res = await this.$API.opm.operation.create.req(this.form);
} else if (this.mode == "edit") {
res = await this.$API.opm.operation.update.req(
this.form.id,
this.form
);
}
this.isSaveing = false;
this.$emit("success", this.form, this.mode);
this.visible = false;
this.$message.success("操作成功");
return res;
} catch (err) {
//
this.isSaveing = false;
return err;
}
}
});
},
//
setData(data) {
// this.loading = true
// const params = {
// id: data.id
// }
// setTimeout(async ()=>{
// var res = await this.$API.system.table.info.get(params)
// this.loading = false
// this.form = res.data
// },400)
Object.assign(this.form, data);
},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
},
};
</script>
<style scoped>
.el-transfer {
--el-transfer-panel-width: 345px !important;
}
</style>

View File

@ -33,21 +33,25 @@
</scTable> </scTable>
</el-main> </el-main>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save=false"></save-dialog>
</el-container> </el-container>
</template> </template>
<script> <script>
import saveDialog from './oplcate_form.vue'
export default { export default {
name: 'oplcate', name: 'oplcate',
components: { components: {
saveDialog
}, },
data() { data() {
return { return {
dialog: {
apiObj: this.$API.opm.opl_cate.list, save: false,
permission: false
},
apiObj: this.$API.opm.oplcate.list,
query: {}, query: {},
selection: [], selection: [],
search: { search: {

View File

@ -0,0 +1,228 @@
<template>
<el-drawer
:title="titleMap[mode]"
v-model="visible"
:size="1000"
destroy-on-close
@closed="$emit('closed')"
>
<el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px">
<el-form
ref="dialogForm"
:model="form"
:rules="rules"
:disabled="mode == 'show'"
label-width="80px"
>
<el-row>
<el-col :md="8" :sm="12" :xs="24">
<el-form-item label="标识">
<el-input v-model="form.code" type="text" clearable></el-input>
</el-form-item>
</el-col>
<el-col :md="8" :sm="12" :xs="24">
<el-form-item label="名称">
<el-input v-model="form.name" type="text" clearable></el-input>
</el-form-item>
</el-col>
<el-col :md="8" :sm="12" :xs="24">
<el-form-item label="工作流">
<el-select v-model="form.workflow">
<el-option
v-for="item in workflowoptions"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="24" :sm="12" :xs="24">
<el-form-item label="风险分析">
<el-transfer
width="500px"
v-model="form.risk_options"
:props="{
key: 'id',
label: 'name',
}"
:data="riskoptions"
/>
</el-form-item>
</el-col>
<el-col :md="24" :sm="12" :xs="24">
<el-form-item label="控制措施">
<el-transfer
v-model="form.measure_options"
:props="{
key: 'id',
label: 'name',
}"
:data="measureoptions"
/>
</el-form-item>
</el-col>
<el-col :md="24" :sm="24" :xs="24">
<el-form-item label="关闭工作">
<el-transfer
v-model="form.close_options"
:props="{
key: 'id',
label: 'name',
}"
:data="closeoptions"
/>
</el-form-item>
</el-col>
<el-col :md="24" :sm="12" :xs="24">
<el-form-item label="描述">
<el-input
v-model="form.description"
type="textarea"
clearable
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-main>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit"
>保存</el-button
>
<el-button @click="visible = false">取消</el-button>
</el-footer>
</el-container>
</el-drawer>
</template>
<script>
export default {
emits: ["success", "closed"],
data() {
return {
loading: false,
mode: "add",
titleMap: {
add: "新增",
edit: "编辑",
show: "查看",
},
form: {},
rules: {},
visible: false,
isSaveing: false,
selectionFilters: [],
setFiltersVisible: false,
workflowoptions: [],
riskoptions: [],
measureoptions:[],
closeoptions:[],
};
},
mounted() {
this.getWorkflow();
this.getRisk();
this.getMeasure();
this.getClose();
},
methods: {
//
getWorkflow() {
this.$API.system.dept.list.req({ page: 0 }).then((res) => {
this.workflowoptions = res;
});
},
//
getRisk() {
this.$API.system.dict.list
.req({ page: 0, type__code: "risk_options" })
.then((res) => {
this.riskoptions = res;
});
},
//
getMeasure() {
this.$API.system.dict.list
.req({ page: 0, type__code: "measure_options" })
.then((res) => {
this.measureoptions = res;
});
},
//
getClose() {
this.$API.system.dict.list
.req({ page: 0, type__code: "close_options" })
.then((res) => {
this.closeoptions = res;
});
},
//
open(mode = "add") {
this.mode = mode;
this.visible = true;
return this;
},
//
submit() {
this.$refs.dialogForm.validate(async (valid) => {
if (valid) {
this.isSaveing = true;
try {
var res;
if (this.mode == "add") {
res = await this.$API.opm.oplcate.create.req(this.form);
} else if (this.mode == "edit") {
res = await this.$API.opm.oplcate.update.req(
this.form.id,
this.form
);
}
this.isSaveing = false;
this.$emit("success", this.form, this.mode);
this.visible = false;
this.$message.success("操作成功");
return res;
} catch (err) {
//
this.isSaveing = false;
return err;
}
}
});
},
//
setData(data) {
// this.loading = true
// const params = {
// id: data.id
// }
// setTimeout(async ()=>{
// var res = await this.$API.system.table.info.get(params)
// this.loading = false
// this.form = res.data
// },400)
Object.assign(this.form, data);
},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
},
};
</script>
<style scoped>
.el-transfer {
--el-transfer-panel-width: 345px !important;
}
</style>

View File

@ -32,7 +32,7 @@
methods: { methods: {
setData(data){ setData(data){
this.data = data; this.data = data;
debugger; // debugger;
console.log(data); console.log(data);
let dataStr = ''; let dataStr = '';
for (let i in data) { for (let i in data) {

View File

@ -158,14 +158,14 @@
}, },
handleChange(value) { handleChange(value) {
// this.menu.checked = check.checkedKeys; // this.menu.checked = check.checkedKeys;
debugger; // debugger;
console.log(value); console.log(value);
console.log(this.addForm.parent); console.log(this.addForm.parent);
}, },
// //
async getGroup() { async getGroup() {
var res = await this.$API.system.permission.list.req({page: 0}); var res = await this.$API.system.permission.list.req({page: 0});
debugger; // debugger;
let permList = res; let permList = res;
this.permList = res; this.permList = res;
let posts = []; let posts = [];
@ -187,7 +187,7 @@
parent.children = parent.children ? parent.children : []; parent.children = parent.children ? parent.children : [];
parent.children.push(item); parent.children.push(item);
} }
debugger; //debugger;
this.group = arr; this.group = arr;
}, },
@ -200,7 +200,7 @@
this.codesLimited = true; this.codesLimited = true;
}, },
saveCodes(){ saveCodes(){
debugger;console.log(this.addForm.codes); // debugger;console.log(this.addForm.codes);
this.addForm.codes.push(this.codes); this.addForm.codes.push(this.codes);
this.codes = '' this.codes = ''
}, },
@ -214,7 +214,7 @@
this.type = 'edit'; this.type = 'edit';
this.addForm.id = row.id; this.addForm.id = row.id;
this.addForm.name = row.name; this.addForm.name = row.name;
debugger; // debugger;
console.log(row.codes); console.log(row.codes);
this.codes = row.codes.join(','); this.codes = row.codes.join(',');
let parent = row.parent!==null?this.findParents(this.permList, row.parent):''; let parent = row.parent!==null?this.findParents(this.permList, row.parent):'';
@ -227,7 +227,7 @@
this.limitedVisible = true; this.limitedVisible = true;
}, },
findParents(arr, parent) { findParents(arr, parent) {
debugger; //debugger;
let data = []; let data = [];
arr.forEach(item => { arr.forEach(item => {
if (item.id === parent) { if (item.id === parent) {
@ -239,7 +239,7 @@
} }
} }
}); });
debugger; //debugger;
return data return data
}, },
// //
@ -255,15 +255,15 @@
}, },
submitHandle() { submitHandle() {
let that = this; let that = this;
debugger; // debugger;
console.log(this.addForm.parent); console.log(this.addForm.parent);
debugger; // debugger;
if (this.addForm.parent !== null) { if (this.addForm.parent !== null) {
this.addForm.parent = this.addForm.parent[this.addForm.parent.length - 1]; this.addForm.parent = this.addForm.parent[this.addForm.parent.length - 1];
} else { } else {
this.addForm.parent = "" this.addForm.parent = ""
} }
debugger; // debugger;
console.log(this.codes); console.log(this.codes);
if(this.codes.indexOf(','>-1)){ if(this.codes.indexOf(','>-1)){
@ -271,10 +271,10 @@
}else{ }else{
this.addForm.codes.push(this.codes) this.addForm.codes.push(this.codes)
} }
debugger; // debugger;
console.log(this.addForm.codes); console.log(this.addForm.codes);
this.$refs.addForm.validate((valid) => { this.$refs.addForm.validate((valid) => {
debugger; // debugger;
if (valid) { if (valid) {
this.isSaveing = true; this.isSaveing = true;
var res; var res;
@ -287,7 +287,7 @@
this.limitedVisible = false; this.limitedVisible = false;
this.$refs.table.refresh(); this.$refs.table.refresh();
console.log(res); console.log(res);
debugger; // debugger;
} }
}) })
}, },

View File

@ -123,7 +123,7 @@
methods: { methods: {
handleChange(value) { handleChange(value) {
// this.menu.checked = check.checkedKeys; // this.menu.checked = check.checkedKeys;
debugger; //debugger;
console.log(value); console.log(value);
console.log(this.addForm.parent); console.log(this.addForm.parent);
}, },
@ -165,7 +165,7 @@
}, },
// //
editDept(row){ editDept(row){
debugger; // debugger;
this.temp = []; this.temp = [];
this.type='edit'; this.type='edit';
this.addForm.id=row.id; this.addForm.id=row.id;
@ -203,12 +203,12 @@
}, },
submitHandle(){ submitHandle(){
let that = this; let that = this;
debugger; //debugger;
console.log(this.addForm.parent); console.log(this.addForm.parent);
debugger; //debugger;
this.addForm.parent = this.addForm.parent!==null?this.addForm.parent[0]?this.addForm.parent[0]:'':''; this.addForm.parent = this.addForm.parent!==null?this.addForm.parent[0]?this.addForm.parent[0]:'':'';
this.$refs.addForm.validate( (valid) => { this.$refs.addForm.validate( (valid) => {
debugger; // debugger;
if (valid) { if (valid) {
this.isSaveing = true; this.isSaveing = true;
var res; var res;
@ -221,7 +221,7 @@
this.limitedVisible = false; this.limitedVisible = false;
this.$refs.table.refresh(); this.$refs.table.refresh();
console.log(res); console.log(res);
debugger; // debugger;
} }
}) })
}, },

View File

@ -41,6 +41,7 @@
<el-table-column label="序号" type="index"></el-table-column> <el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="名称" prop="name" min-width="150"></el-table-column> <el-table-column label="名称" prop="name" min-width="150"></el-table-column>
<el-table-column label="键值" prop="value" min-width="100"></el-table-column> <el-table-column label="键值" prop="value" min-width="100"></el-table-column>
<el-table-column label="描述" prop="description" min-width="100"></el-table-column>
<el-table-column label="是否有效" prop="yx" width="100"> <el-table-column label="是否有效" prop="yx" width="100">
<template #default="scope"> <template #default="scope">
<el-switch v-if="scope.row.yx" v-model="scope.row.yx" @change="changeSwitch($event, scope.row)" :loading="scope.row.$switch_yx" active-value="1" inactive-value="0"></el-switch> <el-switch v-if="scope.row.yx" v-model="scope.row.yx" @change="changeSwitch($event, scope.row)" :loading="scope.row.$switch_yx" active-value="1" inactive-value="0"></el-switch>
@ -90,7 +91,7 @@
<el-form-item label="字典名称" prop="name"> <el-form-item label="字典名称" prop="name">
<el-input v-model="dicForm.name" clearable></el-input> <el-input v-model="dicForm.name" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="键值" prop="value"> <el-form-item label="键值" >
<el-input v-model="dicForm.value" clearable></el-input> <el-input v-model="dicForm.value" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item label="标识"> <el-form-item label="标识">
@ -275,7 +276,7 @@
}, },
findParents(arr,parent){ findParents(arr,parent){
let that = this; let that = this;
debugger; // debugger;
arr.forEach(item=>{ arr.forEach(item=>{
debugger; debugger;
if(item.id===parent){ if(item.id===parent){
@ -314,7 +315,7 @@
} }
}*/ }*/
let res = this.$API.system.dicttype.delete.req(data.id); let res = this.$API.system.dicttype.delete.req(data.id);
debugger; // debugger;
console.log(res); console.log(res);
this.getDicType(); this.getDicType();
this.showDicloading = false; this.showDicloading = false;

View File

@ -120,7 +120,7 @@
methods: { methods: {
handleChange(item, check) { handleChange(item, check) {
this.menu.checked = check.checkedKeys; this.menu.checked = check.checkedKeys;
debugger; //debugger;
console.log(check); console.log(check);
console.log(this.checkList); console.log(this.checkList);
}, },
@ -142,7 +142,7 @@
// debugger; // debugger;
console.log(obj); console.log(obj);
for (let item of posts) { for (let item of posts) {
debugger; // debugger;
if (item.parentId == null) { if (item.parentId == null) {
arr.push(item); arr.push(item);
continue continue
@ -169,12 +169,12 @@
console.log(this.menu.list); console.log(this.menu.list);
},*/ },*/
submitHandle(){ submitHandle(){
debugger; // debugger;
let that = this; let that = this;
debugger; // debugger;
this.addForm.perms = this.menu.checked; this.addForm.perms = this.menu.checked;
this.$refs.addForm.validate( (valid) => { this.$refs.addForm.validate( (valid) => {
debugger; // debugger;
if (valid) { if (valid) {
this.isSaveing = true; this.isSaveing = true;
var res; var res;
@ -187,7 +187,7 @@
this.limitedVisible = false; this.limitedVisible = false;
this.$refs.table.refresh(); this.$refs.table.refresh();
console.log(res); console.log(res);
debugger; // debugger;
} }
}) })
}, },

View File

@ -279,7 +279,7 @@
}, },
// //
formEdit(row,index) { formEdit(row,index) {
debugger; // debugger;
console.log(row); console.log(row);
this.limitedVisible = true; this.limitedVisible = true;
if(index==='1'){ if(index==='1'){
@ -370,7 +370,7 @@
// //
groupClick(data) { groupClick(data) {
console.log(data); console.log(data);
debugger; // debugger;
let params = {belong_dept: data.id}; let params = {belong_dept: data.id};
this.$refs.table.reload(params); this.$refs.table.reload(params);
}, },
@ -380,10 +380,10 @@
}, },
// //
submit(){ submit(){
debugger; // debugger;
this.$refs.addForm.validate(async (valid) => { this.$refs.addForm.validate(async (valid) => {
if (valid) { if (valid) {
debugger; // debugger;
this.isSaveing = true; this.isSaveing = true;
// this.addForm.belong_dept = this.addForm.belong_dept[this.addForm.belong_dept.length - 1]; // this.addForm.belong_dept = this.addForm.belong_dept[this.addForm.belong_dept.length - 1];
let res; let res;