增加回车检索

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"
placeholder="姓名"
clearable
@click="handleQuery"
@keyup.enter="handleQuery"
></el-input>
<el-button
type="primary"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,24 +2,69 @@
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'operation.create'"></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"
icon="el-icon-plus"
@click="add"
v-auth="'operation.create'"
></el-button>
<el-select
v-model="query.state"
placeholder="作业状态"
@change="handleQuery"
style="margin-left: 2px"
clearable
>
<el-option
v-for="item in stateOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></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">
<div class="right-panel-search">
<el-select v-model="query.create_by">
<el-option label="全部" value="000" />
<el-option label="我的" :value="userId" />
<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 @click="handleQuery"></el-input>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
</div>
<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">
<scTable
ref="tableoperation"
:apiObj="apiObj"
row-key="id"
@selection-change="selectionChange"
stripe
@resetQuery="resetQuery"
>
<!-- <el-table-column
label="#"
type="index"
@ -27,49 +72,93 @@
></el-table-column> -->
<el-table-column label="许可证" prop="opls" width="160">
<template #default="scope">
<el-tag v-for="item in scope.row.cates_" :key="item.id" style="margin-right:2px">{{ item.name }}
<el-tag
v-for="item in scope.row.cates_"
:key="item.id"
style="margin-right: 2px"
>{{ item.name }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="作业简介" prop="name" width="200"></el-table-column>
<el-table-column
label="作业简介"
prop="name"
width="200"
></el-table-column>
<el-table-column label="作业状态" prop="state">
<template #default="scope">{{ stateoptions[scope.row.state] }}</template>
<template #default="scope">{{
stateoptions[scope.row.state]
}}</template>
</el-table-column>
<el-table-column label="生产状态" prop="state_work"></el-table-column>
<el-table-column label="作业区域"><template #default="scope">
<el-table-column label="作业区域"
><template #default="scope">
{{ scope.row.area_.name }}
</template>
</el-table-column>
<el-table-column label="预计开始" prop="start_time"></el-table-column>
<el-table-column label="预计结束" prop="end_time"></el-table-column>
<el-table-column label="属地部门" prop="dept_ter"><template #default="scope">
<el-table-column label="属地部门" prop="dept_ter"
><template #default="scope">
{{ scope.row.dept_ter_.name }}
</template></el-table-column>
<el-table-column label="业务部门" prop="dept_bus"><template #default="scope">
</template></el-table-column
>
<el-table-column label="业务部门" prop="dept_bus"
><template #default="scope">
{{ scope.row.dept_bus_.name }}
</template></el-table-column>
<el-table-column label="创建人" prop="create_by"><template #default="scope">
</template></el-table-column
>
<el-table-column label="创建人" prop="create_by"
><template #default="scope">
{{ scope.row.create_by_.name }}
</template></el-table-column>
</template></el-table-column
>
<el-table-column label="创建时间" prop="create_time"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="180">
<template #default="scope">
<el-button link type="primary" size="small" v-auth="'operation.update'"
@click="creatopl(scope.row)">许可证
<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
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
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
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
v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
>
</save-dialog>
</el-container>
</template>
@ -88,10 +177,41 @@ export default {
permission: false,
},
apiObj: this.$API.opm.operation.list,
query: {
search: '',
create_by: '000',
query: {},
filterType: "all",
filterOptions: [
{
label: "全部",
value: "all",
},
{
label: "我创建的",
value: "my",
},
],
timeRange: [],
stateOptions: [
{
label: "创建中",
value: 10,
},
{
label: "审批中",
value: 20,
},
{
label: "待作业",
value: 30,
},
{
label: "进行中",
value: 40,
},
{
label: "已结束",
value: 50,
},
],
selection: [],
search: {
keyword: null,
@ -103,7 +223,7 @@ export default {
40: "作业中",
50: "已结束",
},
userId: '',
userId: "",
};
},
mounted() {
@ -111,7 +231,6 @@ export default {
this.userId = userInfo.id;
},
methods: {
//
add() {
this.dialog.save = true;
@ -165,7 +284,6 @@ export default {
});
},
//
selectionChange(selection) {
this.selection = selection;
@ -183,13 +301,26 @@ export default {
//
handleQuery() {
let obj = {};
obj.search = this.query.search;
if (this.query.create_by == '000') {
obj.create_by = '';
if (this.timeRange) {
this.query.start_create = this.timeRange[0];
this.query.end_create = this.timeRange[1];
} else {
obj.create_by = this.query.create_by;
this.query.end_create = null;
this.query.start_create = null;
}
this.$refs.tableoperation.queryData(obj);
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) {

View File

@ -8,7 +8,7 @@
</div>
<div class="right-panel">
<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>
</div>
</div>

View File

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

View File

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

View File

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

View File

@ -2,56 +2,170 @@
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'rpj.create'"></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"
icon="el-icon-plus"
@click="add"
v-auth="'rpj.create'"
></el-button>
<el-select
v-model="query.state"
placeholder="项目状态"
@change="handleQuery"
style="margin-left: 2px"
clearable
>
<el-option
v-for="item in stateOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></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">
<div class="right-panel-search">
<el-select v-model="query.create_by">
<el-option label="全部" value="000" />
<el-option label="我的" :value="userId" />
<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></el-input>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
<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>
</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>
<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>
<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="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' : ''">
<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" width="180"></el-table-column>
<el-table-column label="创建时间" prop="create_time" width="180"></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
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
link
type="primary"
size="small"
@click="table_show(scope.row, scope.$index)"
>查看
</el-button>
<!--<el-button
text
@ -60,9 +174,14 @@
@click="table_edit(scope.row, scope.$index)"
>编辑
</el-button>-->
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
<el-popconfirm
title="确定删除吗?"
@confirm="table_del(scope.row, scope.$index)"
>
<template #reference>
<el-button link type="danger" size="small" v-auth="'rpj.delete'">删除</el-button>
<el-button link type="danger" size="small" v-auth="'rpj.delete'"
>删除</el-button
>
</template>
</el-popconfirm>
</template>
@ -71,9 +190,18 @@
</el-main>
</el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save = false">
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
>
</save-dialog>
<show-dialog v-if="dialog.show" ref="showDialog" @closed="dialog.show = false"></show-dialog>
<show-dialog
v-if="dialog.show"
ref="showDialog"
@closed="dialog.show = false"
></show-dialog>
</template>
<script>
import saveDialog from "./rpj_form.vue";
@ -96,14 +224,11 @@ export default {
username: "",
},
apiObj: this.$API.rpm.rpj.list,
query: {
search: '',
create_by: '000'
},
userId: '',
query: {},
userId: "",
selection: [],
search: {
search: '',
search: "",
keyword: null,
},
type_: {
@ -112,6 +237,34 @@ export default {
30: "保安保洁服务",
40: "其他",
},
timeRange: [],
filteType: "all",
stateOptions: [
{
label: "创建中",
value: 10,
},
{
label: "审批中",
value: 20,
},
{
label: "待入厂",
value: 30,
},
{
label: "进行中",
value: 40,
},
{
label: "已完成",
value: 50,
},
{
label: "已关闭",
value: 60,
},
],
state_: {
10: "创建中",
20: "审批中",
@ -127,6 +280,17 @@ export default {
4: "已完成",
5: "已关闭",
},
filterType: "all",
filterOptions: [
{
label: "全部",
value: "all",
},
{
label: "我创建的",
value: "my",
},
],
};
},
mounted() {
@ -199,14 +363,22 @@ export default {
},
//
handleQuery() {
let obj = {};
obj.search = this.query.search;
if (this.query.create_by == '000') {
obj.create_by = '';
if (this.timeRange) {
this.query.start_come = this.timeRange[0];
this.query.end_come = this.timeRange[1];
} else {
obj.create_by = this.query.create_by;
this.query.end_come = null;
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);
},
},
};

View File

@ -7,7 +7,7 @@
</div>
<div class="right-panel">
<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>
</div>
</div>

View File

@ -8,7 +8,7 @@
</div>
<div class="right-panel">
<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>
</div>
</div>

View File

@ -20,7 +20,7 @@
</div>
<div class="right-panel">
<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>
</div>
</div>

View File

@ -19,7 +19,7 @@
</div>
<div class="right-panel">
<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
type="primary"
icon="el-icon-search"

View File

@ -8,7 +8,7 @@
</div>
<div class="right-panel">
<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>
</div>
</div>

View File

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

View File

@ -18,8 +18,9 @@
v-model="query.search"
placeholder="姓名/手机号"
clearable
@keyup.enter="handleQuery"
></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>
</el-header>

View File

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