增加回车检索

This commit is contained in:
曹前明 2022-09-07 10:17:12 +08:00
parent 8fca5caaa8
commit 38a3d10117
23 changed files with 742 additions and 431 deletions

View File

@ -62,7 +62,7 @@
v-model="query.search" v-model="query.search"
placeholder="姓名" placeholder="姓名"
clearable clearable
@click="handleQuery" @keyup.enter="handleQuery"
></el-input> ></el-input>
<el-button <el-button
type="primary" type="primary"

View File

@ -180,6 +180,7 @@ export default {
handleBindBlt(type, row) { handleBindBlt(type, row) {
this.dis = false; this.dis = false;
this.form.blt = row.id; this.form.blt = row.id;
this.form.code = row.code;
this.bindBltMac = row.code; this.bindBltMac = row.code;
this.form.type = type; this.form.type = type;
if (type === 20) { if (type === 20) {
@ -189,13 +190,15 @@ export default {
this.showBindBlt = true; this.showBindBlt = true;
}, },
submitBindBlt() { submitBindBlt() {
let that = this; let that = this
that.$API.third.tdevice.bltBind.req(this.form).then((res) => { let form = {
if (res.err_msg) { code: this.form.code,
} else { type: this.form.type,
that.showBindBlt = false; employee: this.form.employee
}
that.$API.third.tdevice.bltBind.req(form).then((res) => {
this.showBindBlt = false;
that.$refs.table.refresh(); that.$refs.table.refresh();
}
}); });
}, },
}, },

View File

@ -15,7 +15,7 @@
v-model="query.search" v-model="query.search"
placeholder="编号" placeholder="编号"
clearable clearable
@click="handleQuery" @keyup.enter="handleQuery"
></el-input> ></el-input>
<el-button <el-button
type="primary" type="primary"

View File

@ -1,6 +1,6 @@
<template> <template>
<el-container> <el-container>
<el-header> <!-- <el-header>
<div class="left-panel"> <div class="left-panel">
<el-select <el-select
v-model="query.cates" v-model="query.cates"
@ -42,7 +42,7 @@
/> />
</div> </div>
<div class="right-panel"></div> <div class="right-panel"></div>
</el-header> </el-header> -->
<el-main class="nopadding"> <el-main class="nopadding">
<scTable <scTable
ref="table" ref="table"
@ -148,8 +148,8 @@ export default {
}; };
}, },
created() { created() {
this.getCateOptions(); // this.getCateOptions();
this.getAreaOptions(); // this.getAreaOptions();
}, },
methods: { methods: {
getCateOptions() { getCateOptions() {

View File

@ -124,6 +124,7 @@ export default {
dutyAgg: [], dutyAgg: [],
// //
ep_count_type: "2", ep_count_type: "2",
countIndex: "2",
userCount: { userCount: {
total: 0, total: 0,
count_employee: 0, // count_employee: 0, //

View File

@ -18,12 +18,12 @@
v-model="query.search" v-model="query.search"
placeholder="证书名称/编号" placeholder="证书名称/编号"
clearable clearable
@keyup.enter="handleQuery"
></el-input> ></el-input>
<el-button <el-button
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleQuery"
></el-button> ></el-button>
</div> </div>
</div> </div>

View File

@ -18,12 +18,12 @@
v-model="query.search" v-model="query.search"
placeholder="证书名称/编号" placeholder="证书名称/编号"
clearable clearable
@keyup.enter="handleQuery"
></el-input> ></el-input>
<el-button <el-button
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleQuery"
></el-button> ></el-button>
</div> </div>
</div> </div>

View File

@ -7,12 +7,12 @@
v-model="query.search" v-model="query.search"
placeholder="员工姓名/编号" placeholder="员工姓名/编号"
clearable clearable
@keyup.enter="handleQuery"
></el-input> ></el-input>
<el-button <el-button
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleQuery"
></el-button> ></el-button>
</div> </div>
</div> </div>

View File

@ -18,7 +18,7 @@
v-model="query.search" v-model="query.search"
placeholder="姓名/手机号" placeholder="姓名/手机号"
clearable clearable
@click="handleQuery" @keyup.enter="handleQuery"
></el-input> ></el-input>
<el-button <el-button
type="primary" type="primary"

View File

@ -1,224 +1,355 @@
<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" v-auth="'operation.create'"></el-button> <el-button
<!-- <el-button type="danger" plain icon="el-icon-delete" :disabled="selection.length==0" @click="batch_del"></el-button> type="primary"
<el-button type="primary" plain :disabled="selection.length!=1" @click="permission">权限设置</el-button> --> icon="el-icon-plus"
</div> @click="add"
<div class="right-panel"> v-auth="'operation.create'"
<div class="right-panel-search"> ></el-button>
<el-select v-model="query.create_by"> <el-select
<el-option label="全部" value="000" /> v-model="query.state"
<el-option label="我的" :value="userId" /> placeholder="作业状态"
</el-select> @change="handleQuery"
<el-input v-model="query.search" placeholder="名称" clearable @click="handleQuery"></el-input> style="margin-left: 2px"
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> clearable
</div> >
</div> <el-option
</el-header> v-for="item in stateOptions"
<el-main class="nopadding"> :key="item.value"
<scTable ref="tableoperation" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" stripe :label="item.label"
@resetQuery="resetQuery"> :value="item.value"
<!-- <el-table-column ></el-option>
</el-select>
<el-date-picker
v-model="timeRange"
type="datetimerange"
range-separator="至"
start-placeholder="作业开始时间始"
end-placeholder="作业开始时间止"
style="margin-left: 2px"
value-format="YYYY-MM-DD HH:mm:ss"
@change="handleQuery"
clearable
/>
</div>
<div class="right-panel">
<el-select @change="handleFilterTypeChange" v-model="filterType">
<el-option
v-for="item in filterOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
<el-input
v-model="query.search"
placeholder="名称"
clearable
@keyup.enter="handleQuery"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="tableoperation"
:apiObj="apiObj"
row-key="id"
@selection-change="selectionChange"
stripe
@resetQuery="resetQuery"
>
<!-- <el-table-column
label="#" label="#"
type="index" type="index"
width="50" width="50"
></el-table-column> --> ></el-table-column> -->
<el-table-column label="许可证" prop="opls" width="160"> <el-table-column label="许可证" prop="opls" width="160">
<template #default="scope"> <template #default="scope">
<el-tag v-for="item in scope.row.cates_" :key="item.id" style="margin-right:2px">{{ item.name }} <el-tag
</el-tag> v-for="item in scope.row.cates_"
</template> :key="item.id"
</el-table-column> style="margin-right: 2px"
<el-table-column label="作业简介" prop="name" width="200"></el-table-column> >{{ item.name }}
<el-table-column label="作业状态" prop="state"> </el-tag>
<template #default="scope">{{ stateoptions[scope.row.state] }}</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="生产状态" prop="state_work"></el-table-column> <el-table-column
<el-table-column label="作业区域"><template #default="scope"> label="作业简介"
{{ scope.row.area_.name }} prop="name"
</template> width="200"
</el-table-column> ></el-table-column>
<el-table-column label="预计开始" prop="start_time"></el-table-column> <el-table-column label="作业状态" prop="state">
<el-table-column label="预计结束" prop="end_time"></el-table-column> <template #default="scope">{{
<el-table-column label="属地部门" prop="dept_ter"><template #default="scope"> stateoptions[scope.row.state]
{{ scope.row.dept_ter_.name }} }}</template>
</template></el-table-column> </el-table-column>
<el-table-column label="业务部门" prop="dept_bus"><template #default="scope"> <el-table-column label="生产状态" prop="state_work"></el-table-column>
{{ scope.row.dept_bus_.name }} <el-table-column label="作业区域"
</template></el-table-column> ><template #default="scope">
<el-table-column label="创建人" prop="create_by"><template #default="scope"> {{ scope.row.area_.name }}
{{ scope.row.create_by_.name }} </template>
</template></el-table-column> </el-table-column>
<el-table-column label="创建时间" prop="create_time"></el-table-column> <el-table-column label="预计开始" prop="start_time"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="180"> <el-table-column label="预计结束" prop="end_time"></el-table-column>
<template #default="scope"> <el-table-column label="属地部门" prop="dept_ter"
<el-button link type="primary" size="small" v-auth="'operation.update'" ><template #default="scope">
@click="creatopl(scope.row)">许可证 {{ scope.row.dept_ter_.name }}
</el-button> </template></el-table-column
<el-button link type="primary" size="small" @click="table_show(scope.row, scope.$index)">查看 >
</el-button> <el-table-column label="业务部门" prop="dept_bus"
<el-button v-if="scope.row.state === 10" link type="warning" size="small" ><template #default="scope">
v-auth="'operation.update'" @click="table_edit(scope.row, scope.$index)">编辑 {{ scope.row.dept_bus_.name }}
</el-button> </template></el-table-column
<el-button link type="danger" size="small" v-if="scope.row.state === 10" >
v-auth="'operation.delete'" @click="table_del(scope.row)">删除 <el-table-column label="创建人" prop="create_by"
</el-button> ><template #default="scope">
</template> {{ scope.row.create_by_.name }}
</el-table-column> </template></el-table-column
</scTable> >
</el-main> <el-table-column label="创建时间" prop="create_time"></el-table-column>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save = false"> <el-table-column label="操作" fixed="right" align="center" width="180">
</save-dialog> <template #default="scope">
</el-container> <el-button
link
type="primary"
size="small"
v-auth="'operation.update'"
@click="creatopl(scope.row)"
>许可证
</el-button>
<el-button
link
type="primary"
size="small"
@click="table_show(scope.row, scope.$index)"
>查看
</el-button>
<el-button
v-if="scope.row.state === 10"
link
type="warning"
size="small"
v-auth="'operation.update'"
@click="table_edit(scope.row, scope.$index)"
>编辑
</el-button>
<el-button
link
type="danger"
size="small"
v-if="scope.row.state === 10"
v-auth="'operation.delete'"
@click="table_del(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
>
</save-dialog>
</el-container>
</template> </template>
<script> <script>
import saveDialog from "./operation_form.vue"; import saveDialog from "./operation_form.vue";
export default { export default {
name: "operation", name: "operation",
components: { components: {
saveDialog, saveDialog,
}, },
data() { data() {
return { return {
dialog: { dialog: {
save: false, save: false,
permission: false, permission: false,
}, },
apiObj: this.$API.opm.operation.list, apiObj: this.$API.opm.operation.list,
query: { query: {},
search: '', filterType: "all",
create_by: '000', filterOptions: [
}, {
selection: [], label: "全部",
search: { value: "all",
keyword: null, },
}, {
stateoptions: { label: "我创建的",
10: "创建中", value: "my",
20: "审批中", },
30: "待作业", ],
40: "作业中", timeRange: [],
50: "已结束", stateOptions: [
}, {
userId: '', label: "创建中",
}; value: 10,
}, },
mounted() { {
let userInfo = this.$TOOL.data.get("USER_INFO"); label: "审批中",
this.userId = userInfo.id; value: 20,
}, },
methods: { {
label: "待作业",
value: 30,
},
{
label: "进行中",
value: 40,
},
{
label: "已结束",
value: 50,
},
],
selection: [],
search: {
keyword: null,
},
stateoptions: {
10: "创建中",
20: "审批中",
30: "待作业",
40: "作业中",
50: "已结束",
},
userId: "",
};
},
mounted() {
let userInfo = this.$TOOL.data.get("USER_INFO");
this.userId = userInfo.id;
},
methods: {
//
add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
});
},
// //
add() { table_edit(row) {
this.dialog.save = true; this.dialog.save = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.saveDialog.open("add"); this.$refs.saveDialog.open("edit").setData(row);
}); });
}, },
//
table_show(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show").setData(row);
});
},
//
creatopl(row) {
this.$router.push({
name: "opl",
query: {
id: row.id,
},
});
},
//
permission() {
this.dialog.permission = true;
this.$nextTick(() => {
this.$refs.permissionDialog.open();
});
},
// //
table_edit(row) { table_del(row) {
this.dialog.save = true; this.$API.opm.operation.delete
this.$nextTick(() => { .req(row.id)
this.$refs.saveDialog.open("edit").setData(row); .then((res) => {
}); this.$message.success("删除成功");
}, this.$refs.tableoperation.refresh();
// return res;
table_show(row) { })
this.dialog.save = true; .catch((err) => {
this.$nextTick(() => { return err;
this.$refs.saveDialog.open("show").setData(row); });
}); },
},
//
creatopl(row) {
this.$router.push({
name: "opl",
query: {
id: row.id,
},
});
},
//
permission() {
this.dialog.permission = true;
this.$nextTick(() => {
this.$refs.permissionDialog.open();
});
},
// //
table_del(row) { selectionChange(selection) {
this.$API.opm.operation.delete this.selection = selection;
.req(row.id) },
.then((res) => { //
this.$message.success("删除成功"); changeSwitch(val, row) {
this.$refs.tableoperation.refresh(); row.status = row.status == "1" ? "0" : "1";
return res; row.$switch_status = true;
}) setTimeout(() => {
.catch((err) => { delete row.$switch_status;
return err; row.status = val;
}); this.$message.success("操作成功");
}, }, 500);
},
//
handleQuery() {
let obj = {};
if (this.timeRange) {
this.query.start_create = this.timeRange[0];
this.query.end_create = this.timeRange[1];
} else {
this.query.end_create = null;
this.query.start_create = null;
}
if (this.query.cates) {
} else {
this.query.cates = null;
}
this.$refs.tableoperation.queryData(this.query);
},
handleFilterTypeChange(val) {
if (val == "all") {
this.query.create_by = null;
} else if (val == "my") {
this.query.create_by = this.userId;
}
this.$refs.tableoperation.queryData(this.query);
},
//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.tableoperation.tableData);
// return target;
selectionChange(selection) { },
this.selection = selection; //
}, handleSaveSuccess(data, mode) {
// if (mode == "add") {
changeSwitch(val, row) { this.$refs.tableoperation.refresh();
row.status = row.status == "1" ? "0" : "1"; } else if (mode == "edit") {
row.$switch_status = true; this.$refs.tableoperation.refresh();
setTimeout(() => { }
delete row.$switch_status; },
row.status = val; resetQuery() {
this.$message.success("操作成功"); this.query = {};
}, 500); },
}, },
//
handleQuery() {
let obj = {};
obj.search = this.query.search;
if (this.query.create_by == '000') {
obj.create_by = '';
} else {
obj.create_by = this.query.create_by;
}
this.$refs.tableoperation.queryData(obj);
},
//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.tableoperation.tableData);
return target;
},
//
handleSaveSuccess(data, mode) {
if (mode == "add") {
this.$refs.tableoperation.refresh();
} else if (mode == "edit") {
this.$refs.tableoperation.refresh();
}
},
resetQuery() {
this.query = {};
},
},
}; };
</script> </script>

View File

@ -8,7 +8,7 @@
</div> </div>
<div class="right-panel"> <div class="right-panel">
<div class="right-panel-search"> <div class="right-panel-search">
<el-input v-model="query.search" placeholder="名称" clearable @click="handleQuery"></el-input> <el-input v-model="query.search" placeholder="名称" clearable @keyup.enter="handleQuery"></el-input>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
</div> </div>
</div> </div>

View File

@ -18,7 +18,7 @@
v-model="query.search" v-model="query.search"
placeholder="编号/名称" placeholder="编号/名称"
clearable clearable
@click="handleQuery" @keyup.enter="handleQuery"
></el-input> ></el-input>
<el-button <el-button
type="primary" type="primary"

View File

@ -12,7 +12,7 @@
v-model="query.search" v-model="query.search"
placeholder="姓名" placeholder="姓名"
clearable clearable
@keyup.enter="handleQuery"
></el-input> ></el-input>
<el-button <el-button
type="primary" type="primary"

View File

@ -12,12 +12,12 @@
v-model="query.search" v-model="query.search"
placeholder="名称" placeholder="名称"
clearable clearable
@keyup.enter="handleQuery"
></el-input> ></el-input>
<el-button <el-button
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleQuery"
></el-button> ></el-button>
</div> </div>
</div> </div>

View File

@ -1,213 +1,385 @@
<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" v-auth="'rpj.create'"></el-button> <el-button
<!-- <el-button type="danger" plain icon="el-icon-delete" :disabled="selection.length==0" @click="batch_del"></el-button> type="primary"
<el-button type="primary" plain :disabled="selection.length!=1" @click="permission">权限设置</el-button> --> icon="el-icon-plus"
</div> @click="add"
<div class="right-panel"> v-auth="'rpj.create'"
<div class="right-panel-search"> ></el-button>
<el-select v-model="query.create_by"> <el-select
<el-option label="全部" value="000" /> v-model="query.state"
<el-option label="我的" :value="userId" /> placeholder="项目状态"
</el-select> @change="handleQuery"
<el-input v-model="query.search" placeholder="名称" clearable></el-input> style="margin-left: 2px"
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> clearable
</div> >
</div> <el-option
</el-header> v-for="item in stateOptions"
<el-main class="nopadding"> :key="item.value"
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe @resetQuery="resetQuery"> :label="item.label"
<el-table-column label="#" type="index" fixed="left" width="50"></el-table-column> :value="item.value"
<el-table-column label="名称" prop="name" fixed="left" width="180"></el-table-column> ></el-option>
<el-table-column label="项目类型" prop="type" width="180"> </el-select>
<template #default="scope">{{ type_[scope.row.type] }} <el-date-picker
</template> v-model="timeRange"
</el-table-column> type="datetimerange"
<el-table-column label="合同编号" prop="contract_number" width="180"></el-table-column> range-separator="至"
<el-table-column label="进厂时间" prop="come_time" width="180"></el-table-column> start-placeholder="入厂时间始"
<el-table-column label="离厂时间" prop="leave_time" width="180"></el-table-column> end-placeholder="入厂时间止"
<el-table-column label="状态" prop="state" width="100"> style="margin-left: 2px"
<template #default="scope">{{ state_[scope.row.state] }}</template> value-format="YYYY-MM-DD HH:mm:ss"
</el-table-column> @change="handleQuery"
<el-table-column label="审批状态" width="200"> clearable
<template #default="scope"> />
<span v-if="scope.row.ticket_ && scope.row.ticket_.state_" </div>
style="margin-right: 5px;">{{ scope.row.ticket_.state_.name }}</span> <div class="right-panel">
<el-tag v-if="scope.row.ticket_ && scope.row.ticket_.act_state" <div class="right-panel-search">
:type="scope.row.ticket_.act_state === 0 ? '' : scope.row.ticket_.act_state === 1 ? '' : scope.row.ticket_.act_state === 2 ? 'danger' : scope.row.ticket_.act_state === 3 ? 'danger' : scope.row.ticket_.act_state === 5 ? 'danger' : scope.row.ticket_.act_state === 4 ? 'success' : ''"> <el-select @change="handleFilterTypeChange" v-model="filterType">
{{ act_states[scope.row.ticket_.act_state] }} <el-option
</el-tag> v-for="item in filterOptions"
</template> :key="item.value"
</el-table-column> :label="item.label"
<el-table-column label="所属部门" prop="belong_dept_name" width="180"></el-table-column> :value="item.value"
<el-table-column label="相关方" prop="rparty_name" width="180"></el-table-column> ></el-option>
<el-table-column label="创建人" prop="create_by" width="180"></el-table-column> </el-select>
<el-table-column label="创建时间" prop="create_time" width="180"></el-table-column> <el-input
<el-table-column label="操作" fixed="right" align="center" width="180"> v-model="query.search"
<template #default="scope"> placeholder="名称"
<el-button v-if="scope.row.state === 10" link type="primary" size="small" clearable
@click="next_add(scope.row, scope.$index)" v-auth="'rpj.update'">继续编辑 @keyup.enter="handleQuery"
</el-button> ></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
@resetQuery="resetQuery"
>
<el-table-column
label="#"
type="index"
fixed="left"
width="50"
></el-table-column>
<el-table-column
label="名称"
prop="name"
fixed="left"
width="180"
></el-table-column>
<el-table-column label="项目类型" prop="type" width="180">
<template #default="scope">{{ type_[scope.row.type] }} </template>
</el-table-column>
<el-table-column
label="合同编号"
prop="contract_number"
width="180"
></el-table-column>
<el-table-column
label="进厂时间"
prop="come_time"
width="180"
></el-table-column>
<el-table-column
label="离厂时间"
prop="leave_time"
width="180"
></el-table-column>
<el-table-column label="状态" prop="state" width="100">
<template #default="scope">{{ state_[scope.row.state] }}</template>
</el-table-column>
<el-table-column label="审批状态" width="200">
<template #default="scope">
<span
v-if="scope.row.ticket_ && scope.row.ticket_.state_"
style="margin-right: 5px"
>{{ scope.row.ticket_.state_.name }}</span
>
<el-tag
v-if="scope.row.ticket_ && scope.row.ticket_.act_state"
:type="
scope.row.ticket_.act_state === 0
? ''
: scope.row.ticket_.act_state === 1
? ''
: scope.row.ticket_.act_state === 2
? 'danger'
: scope.row.ticket_.act_state === 3
? 'danger'
: scope.row.ticket_.act_state === 5
? 'danger'
: scope.row.ticket_.act_state === 4
? 'success'
: ''
"
>
{{ act_states[scope.row.ticket_.act_state] }}
</el-tag>
</template>
</el-table-column>
<el-table-column
label="所属部门"
prop="belong_dept_name"
width="180"
></el-table-column>
<el-table-column
label="相关方"
prop="rparty_name"
width="180"
></el-table-column>
<el-table-column
label="创建人"
prop="create_by_name"
width="180"
></el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
width="180"
></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="180">
<template #default="scope">
<el-button
v-if="scope.row.state === 10"
link
type="primary"
size="small"
@click="next_add(scope.row, scope.$index)"
v-auth="'rpj.update'"
>继续编辑
</el-button>
<el-button link type="primary" size="small" @click="table_show(scope.row, scope.$index)">查看 <el-button
</el-button> link
<!--<el-button type="primary"
size="small"
@click="table_show(scope.row, scope.$index)"
>查看
</el-button>
<!--<el-button
text text
type="warning" type="warning"
size="small" size="small"
@click="table_edit(scope.row, scope.$index)" @click="table_edit(scope.row, scope.$index)"
>编辑 >编辑
</el-button>--> </el-button>-->
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)"> <el-popconfirm
<template #reference> title="确定删除吗?"
<el-button link type="danger" size="small" v-auth="'rpj.delete'">删除</el-button> @confirm="table_del(scope.row, scope.$index)"
</template> >
</el-popconfirm> <template #reference>
</template> <el-button link type="danger" size="small" v-auth="'rpj.delete'"
</el-table-column> >删除</el-button
</scTable> >
</el-main> </template>
</el-container> </el-popconfirm>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save = false"> <save-dialog
</save-dialog> v-if="dialog.save"
<show-dialog v-if="dialog.show" ref="showDialog" @closed="dialog.show = false"></show-dialog> ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
>
</save-dialog>
<show-dialog
v-if="dialog.show"
ref="showDialog"
@closed="dialog.show = false"
></show-dialog>
</template> </template>
<script> <script>
import saveDialog from "./rpj_form.vue"; import saveDialog from "./rpj_form.vue";
import showDialog from "./rpj_show.vue"; import showDialog from "./rpj_show.vue";
export default { export default {
name: "remployee", name: "remployee",
components: { components: {
saveDialog, saveDialog,
showDialog, showDialog,
}, },
data() { data() {
return { return {
dialog: { dialog: {
save: false, save: false,
show: false, show: false,
permission: false, permission: false,
}, },
adminform: { adminform: {
username: "", username: "",
}, },
apiObj: this.$API.rpm.rpj.list, apiObj: this.$API.rpm.rpj.list,
query: { query: {},
search: '', userId: "",
create_by: '000' selection: [],
}, search: {
userId: '', search: "",
selection: [], keyword: null,
search: { },
search: '', type_: {
keyword: null, 10: "建筑施工",
}, 20: "设备设施检维修",
type_: { 30: "保安保洁服务",
10: "建筑施工", 40: "其他",
20: "设备设施检维修", },
30: "保安保洁服务", timeRange: [],
40: "其他", filteType: "all",
}, stateOptions: [
state_: { {
10: "创建中", label: "创建中",
20: "审批中", value: 10,
30: "待入厂", },
40: "进行中", {
50: "已完成", label: "审批中",
}, value: 20,
act_states: { },
0: "草稿中", {
1: "进行中", label: "待入厂",
2: "被退回", value: 30,
3: "被撤回", },
4: "已完成", {
5: "已关闭", label: "进行中",
}, value: 40,
}; },
}, {
mounted() { label: "已完成",
let userInfo = this.$TOOL.data.get("USER_INFO"); value: 50,
this.userId = userInfo.id; },
}, {
methods: { label: "已关闭",
// value: 60,
add() { },
this.dialog.save = true; ],
this.$nextTick(() => { state_: {
this.$refs.saveDialog.open("add"); 10: "创建中",
}); 20: "审批中",
}, 30: "待入厂",
// 40: "进行中",
table_edit(row) { 50: "已完成",
this.dialog.save = true; },
this.$nextTick(() => { act_states: {
this.$refs.saveDialog.open("edit").setData(row); 0: "草稿中",
}); 1: "进行中",
}, 2: "被退回",
// 3: "被撤回",
table_show(row) { 4: "已完成",
// debugger; 5: "已关闭",
this.dialog.show = true; },
this.$nextTick(() => { filterType: "all",
this.$refs.showDialog.open().setData(row); filterOptions: [
}); {
}, label: "全部",
value: "all",
},
{
label: "我创建的",
value: "my",
},
],
};
},
mounted() {
let userInfo = this.$TOOL.data.get("USER_INFO");
this.userId = userInfo.id;
},
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) {
// debugger;
this.dialog.show = true;
this.$nextTick(() => {
this.$refs.showDialog.open().setData(row);
});
},
// //
permission() { permission() {
this.dialog.permission = true; this.dialog.permission = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.permissionDialog.open(); this.$refs.permissionDialog.open();
}); });
}, },
// //
async table_del(row) { async table_del(row) {
this.$API.rpm.rpj.delete this.$API.rpm.rpj.delete
.req(row.id) .req(row.id)
.then((res) => { .then((res) => {
this.$message.success("删除成功"); this.$message.success("删除成功");
return res; return res;
}) })
.catch((err) => { .catch((err) => {
return err; return err;
}); });
}, },
next_add(row) { next_add(row) {
this.$router.push({ this.$router.push({
name: "rpjadd", name: "rpjadd",
query: { query: {
rpjid: row.id, //id rpjid: row.id, //id
}, },
}); });
}, },
// //
handleSaveSuccess(data, mode) { handleSaveSuccess(data, mode) {
if (mode == "add") { if (mode == "add") {
this.$refs.table.refresh(); this.$refs.table.refresh();
} else if (mode == "edit") { } else if (mode == "edit") {
this.$refs.table.refresh(); this.$refs.table.refresh();
} }
}, },
resetQuery() { resetQuery() {
this.query = {}; this.query = {};
}, },
// //
handleQuery() { handleQuery() {
let obj = {}; if (this.timeRange) {
obj.search = this.query.search; this.query.start_come = this.timeRange[0];
if (this.query.create_by == '000') { this.query.end_come = this.timeRange[1];
obj.create_by = ''; } else {
} else { this.query.end_come = null;
obj.create_by = this.query.create_by; this.query.start_come = null;
} }
this.$refs.table.queryData(obj); this.$refs.table.queryData(this.query);
}, },
}, handleFilterTypeChange(val) {
if (val == "all") {
this.query.create_by = null;
} else if (val == "my") {
this.query.create_by = this.userId;
}
this.$refs.table.queryData(this.query);
},
},
}; };
</script> </script>

View File

@ -7,7 +7,7 @@
</div> </div>
<div class="right-panel"> <div class="right-panel">
<div class="right-panel-search"> <div class="right-panel-search">
<el-input v-model="query.search" placeholder="部门名称" clearable></el-input> <el-input v-model="query.search" placeholder="部门名称" clearable @keyup.enter="handleQuery"></el-input>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
</div> </div>
</div> </div>

View File

@ -8,7 +8,7 @@
</div> </div>
<div class="right-panel"> <div class="right-panel">
<div class="right-panel-search"> <div class="right-panel-search">
<el-input v-model="query.search" placeholder="角色名称" clearable></el-input> <el-input v-model="query.search" placeholder="角色名称" clearable @keyup.enter="handleQuery"></el-input>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
</div> </div>
</div> </div>

View File

@ -20,7 +20,7 @@
</div> </div>
<div class="right-panel"> <div class="right-panel">
<div class="right-panel-search"> <div class="right-panel-search">
<el-input v-model="query.search" placeholder="登录账号 / 姓名" clearable></el-input> <el-input v-model="query.search" placeholder="登录账号/姓名" clearable @keyup.enter="handleQuery"></el-input>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
</div> </div>
</div> </div>

View File

@ -19,7 +19,7 @@
</div> </div>
<div class="right-panel"> <div class="right-panel">
<div class="right-panel-search"> <div class="right-panel-search">
<el-input v-model="query.search" placeholder="部门名称"></el-input> <el-input v-model="query.search" placeholder="部门名称" @keyup.enter="handleQuery"></el-input>
<el-button <el-button
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"

View File

@ -8,7 +8,7 @@
</div> </div>
<div class="right-panel"> <div class="right-panel">
<div class="right-panel-search"> <div class="right-panel-search">
<el-input v-model="query.search" placeholder="角色名称" clearable></el-input> <el-input v-model="query.search" placeholder="角色名称" clearable @keyup.enter="handleQuery"></el-input>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
</div> </div>
</div> </div>

View File

@ -10,10 +10,12 @@
v-model="query.search" v-model="query.search"
placeholder="名称" placeholder="名称"
clearable clearable
@keyup.enter="handleQuery"
></el-input> ></el-input>
<el-button <el-button
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="handleQuery"
></el-button> ></el-button>
</div> </div>
</div> </div>

View File

@ -18,8 +18,9 @@
v-model="query.search" v-model="query.search"
placeholder="姓名/手机号" placeholder="姓名/手机号"
clearable clearable
@keyup.enter="handleQuery"
></el-input> ></el-input>
<el-button type="primary" icon="el-icon-search"></el-button> <el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
</div> </div>
</div> </div>
</el-header> </el-header>

View File

@ -17,6 +17,7 @@
v-model="query.search" v-model="query.search"
placeholder="工作流名称" placeholder="工作流名称"
clearable clearable
@keyup.enter="handleQuery"
></el-input> ></el-input>
<el-button <el-button
type="primary" type="primary"