同步表格检索

This commit is contained in:
龙运模 2024-12-23 18:52:36 +08:00
parent 19a63d9408
commit 533d3a8918
36 changed files with 1365 additions and 472 deletions

View File

@ -3,10 +3,10 @@
<div class="setting-column__title"> <div class="setting-column__title">
<span class="move_b"></span> <span class="move_b"></span>
<span class="show_b">显示</span> <span class="show_b">显示</span>
<span class="search_b">检索</span> <span class="search_b" v-if="columnHeaderSetup">检索</span>
<span class="name_b">名称</span> <span class="name_b">名称</span>
<span class="width_b">宽度</span> <span class="width_b">宽度</span>
<span class="type_b">类型</span> <span class="type_b" v-if="columnHeaderSetup">类型</span>
<span class="sortable_b">排序</span> <span class="sortable_b">排序</span>
<span class="fixed_b">固定</span> <span class="fixed_b">固定</span>
</div> </div>
@ -20,14 +20,14 @@
<span class="show_b"> <span class="show_b">
<el-switch v-model="item.hide" :active-value="false" :inactive-value="true"></el-switch> <el-switch v-model="item.hide" :active-value="false" :inactive-value="true"></el-switch>
</span> </span>
<span class="search_b"> <span class="search_b" v-if="columnHeaderSetup">
<el-switch v-model="item.is_search" :active-value="true" :inactive-value="false"></el-switch> <el-switch v-model="item.is_search" :active-value="true" :inactive-value="false"></el-switch>
</span> </span>
<span class="name_b" :title="item.prop">{{ item.label }}</span> <span class="name_b" :title="item.prop">{{ item.label }}</span>
<span class="width_b"> <span class="width_b">
<el-input v-model="item.width" placeholder="auto" size="small"></el-input> <el-input v-model="item.width" placeholder="auto" size="small"></el-input>
</span> </span>
<span class="type_b"> <span class="type_b" v-if="columnHeaderSetup">
<el-select v-model="item.condition" size="small" disabled> <el-select v-model="item.condition" size="small" disabled>
<el-option :value="item.value" :label="item.label" v-for="(item,index) in conditionList" :key="index"></el-option> <el-option :value="item.value" :label="item.label" v-for="(item,index) in conditionList" :key="index"></el-option>
</el-select> </el-select>
@ -52,6 +52,7 @@
<script> <script>
import Sortable from 'sortablejs' import Sortable from 'sortablejs'
import {inject} from "vue";
export default { export default {
components: { components: {
@ -82,6 +83,11 @@
usercolumn: JSON.parse(JSON.stringify(this.column||[])) usercolumn: JSON.parse(JSON.stringify(this.column||[]))
} }
}, },
setup() {
const columnHeaderSetup = inject('columnHeaderParams', true);
return {columnHeaderSetup};
},
watch:{ watch:{
usercolumn: { usercolumn: {
handler(){ handler(){

View File

@ -10,6 +10,17 @@
<el-option v-for="em in item.data" :key="em" :label="em.label" :value="em.value || em.id"></el-option> <el-option v-for="em in item.data" :key="em" :label="em.label" :value="em.value || em.id"></el-option>
</scMultipleSelect> </scMultipleSelect>
</div> </div>
<div class="searchItem" v-if="item.search_type == 'radio' && (searchShow || (!searchShow && index<4)) && !item.hide && item.is_search">
<label class="name">{{item.label}}</label>
<el-select class="input" :size="size" v-if="params[item.prop]" v-model="params[item.prop].value" @change="changeData" @visible-change="getSelect(item,$event)" :placeholder="'请选择'+item.label" filterable clearable>
<el-option label="开启" :value="true"></el-option>
<el-option label="关闭" :value="false"></el-option>
</el-select>
<el-select class="input" :size="size" v-else v-model="params[item.prop]" :placeholder="'请选择'+item.label" filterable clearable>
<el-option label="开启" :value="true"></el-option>
<el-option label="关闭" :value="false"></el-option>
</el-select>
</div>
<div class="searchItem" v-if="item.search_type == 'select' && (searchShow || (!searchShow && index<4)) && !item.hide && item.is_search"> <div class="searchItem" v-if="item.search_type == 'select' && (searchShow || (!searchShow && index<4)) && !item.hide && item.is_search">
<label class="name">{{item.label}}</label> <label class="name">{{item.label}}</label>
<el-select class="input" :size="size" v-model="params[item.prop]" @change="changeData" @visible-change="getSelect(item,$event)" :placeholder="'请选择'+item.label" filterable clearable> <el-select class="input" :size="size" v-model="params[item.prop]" @change="changeData" @visible-change="getSelect(item,$event)" :placeholder="'请选择'+item.label" filterable clearable>
@ -41,7 +52,6 @@ export default {
handler(val){ handler(val){
if(val && val.length>0){ if(val && val.length>0){
this.columnList = val.filter(em=> !em.hide && em.is_search); this.columnList = val.filter(em=> !em.hide && em.is_search);
// console.log(this.columnList,233)
this.params = this.groupByType(val); this.params = this.groupByType(val);
} }
}, },
@ -103,6 +113,8 @@ export default {
if(typeof this.params[i] === "object" && this.params[i] !=null){ if(typeof this.params[i] === "object" && this.params[i] !=null){
if(typeof this.params[i].value == "string"){ if(typeof this.params[i].value == "string"){
this.params[i].value = ""; this.params[i].value = "";
}else if(typeof this.params[i].value == "boolean"){
this.params[i].value = "";
}else{ }else{
this.params[i].value = []; this.params[i].value = [];
} }
@ -151,6 +163,9 @@ export default {
}) })
for(let i in grouped){ for(let i in grouped){
if(this.params[i]){ if(this.params[i]){
if(i === 'active_status'){
grouped[i].value = this.params[i]
}
grouped[i].value = this.params[i].value grouped[i].value = this.params[i].value
} }
} }

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="popoverBox"> <div class="popoverBox">
<div class="handlerView" ref="buttonRef"> <div class="handlerView" ref="buttonRef">
<span v-if="column.is_search && !column.hide" class="label" :class="filterModelParams.data[column.prop] && filterModelParams.data[column.prop].value!=''?'labelColor':''" style=" cursor: pointer;" @click.stop="clickShow(column)"> <span v-if="column.is_search && !column.hide && columnHeaderSetup" class="label" :class="filterModelParams.data && filterModelParams.data[column.prop] && ((typeof filterModelParams.data[column.prop].value === 'boolean' && filterModelParams.data[column.prop].value!=='') || (typeof filterModelParams.data[column.prop].value != 'boolean' && filterModelParams.data[column.prop].value!='')) ?'labelColor':''" style=" cursor: pointer;" @click.stop="clickShow(column)">
<span class="name">{{ column.label }}</span> <span class="name">{{ column.label }}</span>
<el-icon class="sc-trend-icon"><sc-icon-Filter /></el-icon> <el-icon class="sc-trend-icon"><sc-icon-Filter /></el-icon>
</span> </span>
@ -28,14 +28,19 @@
<div v-else-if="column.search_type == 'date_range'" @click.stop> <div v-else-if="column.search_type == 'date_range'" @click.stop>
<el-date-picker v-model="filterValue" type="daterange" :size="size" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD" @change="dateChange"></el-date-picker> <el-date-picker v-model="filterValue" type="daterange" :size="size" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD" @change="dateChange"></el-date-picker>
</div> </div>
<!-- radio 单选框-->
<div v-else-if="column.search_type == 'radio'" @click.stop>
<el-radio-group :size="size" v-model="filterValue">
<el-radio :value="true" :label="true">开启</el-radio>
<el-radio :value="false" :label="false">关闭</el-radio>
</el-radio-group>
</div>
<!-- select 下拉选择--> <!-- select 下拉选择-->
<div v-else-if="column.search_type == 'select'" @click.stop> <div v-else-if="column.search_type == 'select'" @click.stop>
<el-select v-model="filterValue" placeholder="请选择" style="width: 100%" :size="size" clearable filterable filter @clear="filterClear" @visible-change="visibleChange(column,$event)"> <el-select v-model="filterValue" placeholder="请选择" style="width: 100%" :size="size" clearable filterable filter @clear="filterClear" @visible-change="visibleChange(column,$event)">
<el-option v-for="(item, index) in column && column.data" :key="index" :label="item.label" :value="item.id"></el-option> <el-option v-for="(item, index) in column && column.data" :key="index" :label="item.label" :value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
<!-- select 多选下拉选择--> <!-- select 多选下拉选择-->
<div v-else-if="column.search_type == 'checkbox'" @click.stop> <div v-else-if="column.search_type == 'checkbox'" @click.stop>
<el-select v-model="filterValue" placeholder="请选择" style="width: 100%" :size="size" clearable filterable filter multiple collapse-tags @clear="filterClear" @visible-change="visibleChange(column,$event)"> <el-select v-model="filterValue" placeholder="请选择" style="width: 100%" :size="size" clearable filterable filter multiple collapse-tags @clear="filterClear" @visible-change="visibleChange(column,$event)">
@ -88,8 +93,9 @@ export default {
const filterUploadParams = inject('filterUploadParams', () => { }); const filterUploadParams = inject('filterUploadParams', () => { });
const filterTagClose = inject('filterTagClose', () => { }); const filterTagClose = inject('filterTagClose', () => { });
const filterModelParams = inject('filterModelParams', ()=>{}); const filterModelParams = inject('filterModelParams', ()=>{});
const columnHeaderSetup = inject('columnHeaderParams', true);
return { filterUploadClick, filterUploadParams, filterTagClose, filterModelParams }; return { filterUploadClick, filterUploadParams, filterTagClose, filterModelParams, columnHeaderSetup};
}, },
created() { created() {
eventBus.$on('close-all-popovers', this.closePopover); eventBus.$on('close-all-popovers', this.closePopover);
@ -138,7 +144,7 @@ export default {
* */ * */
confirm() { confirm() {
this.visible = false; this.visible = false;
if (!this.filterValue || this.filterValue === "") { if ((!this.filterValue && this.checkedColumn.search_type!='radio') || this.filterValue === "") {
this.filterValue = ""; this.filterValue = "";
if(this.checkedColumn.search_type !== "text"){ if(this.checkedColumn.search_type !== "text"){
return return

View File

@ -18,7 +18,7 @@
<div style="display: inline-block;width: 100%;" v-if="item.is_search && !item.hide"> <div style="display: inline-block;width: 100%;" v-if="item.is_search && !item.hide">
<type-popover ref="popoverRef" :columnIndex="index" :column="item"></type-popover> <type-popover ref="popoverRef" :columnIndex="index" :column="item"></type-popover>
</div> </div>
<span v-else>{{ item.label }}</span> <span class="cell_name" v-else>{{ item.label }}</span>
</template> </template>
<template #default="scope"> <template #default="scope">
<slot :name="item.prop" v-bind="scope"> <slot :name="item.prop" v-bind="scope">
@ -42,7 +42,7 @@
</div> </div>
<div class="scTable-do" v-if="!hideDo"> <div class="scTable-do" v-if="!hideDo">
<el-button v-if="!hideRefresh" @click="refresh" icon="el-icon-refresh" circle style="margin-left:15px"></el-button> <el-button v-if="!hideRefresh" @click="refresh" icon="el-icon-refresh" circle style="margin-left:15px"></el-button>
<el-popover v-if="column" placement="top" title="列设置" :width="630" trigger="click" :hide-after="0" @show="customColumnShow=true" @after-leave="customColumnShow=false"> <el-popover v-if="column" placement="top" title="列设置" :width="columnHeaderSetup?630:480" trigger="click" :hide-after="0" @show="customColumnShow=true" @after-leave="customColumnShow=false">
<template #reference> <template #reference>
<el-button icon="el-icon-set-up" circle style="margin-left:15px"></el-button> <el-button icon="el-icon-set-up" circle style="margin-left:15px"></el-button>
</template> </template>
@ -75,6 +75,7 @@
import config from "@/config/table"; import config from "@/config/table";
import columnSetting from './columnSetting' import columnSetting from './columnSetting'
import TypePopover from './components/typePopover' import TypePopover from './components/typePopover'
import {inject} from "vue";
export default { export default {
name: 'scTable', name: 'scTable',
@ -110,6 +111,11 @@
rowChild:{type:Boolean, default:true}, rowChild:{type:Boolean, default:true},
docsSort:{type:Boolean, default:false}, docsSort:{type:Boolean, default:false},
}, },
setup() {
const columnHeaderSetup = inject('columnHeaderParams', true);
return {columnHeaderSetup};
},
watch: { watch: {
//props //props
data(){ data(){

View File

@ -5,8 +5,9 @@ import http from "@/utils/request";
export default { export default {
successCode: 200, //请求完成代码 successCode: 200, //请求完成代码
pageSize: 100, //表格每一页条数 pageSize: 100, //表格每一页条数
pageSizes: [30, 50, 100, 150, 200, 300], //表格可设置的一页条数 pageSizes: [30, 50, 100, 150, 200, 300], //表格可设置的一页条数
paginationLayout: "total, sizes, prev, pager, next, jumper", //表格分页布局,可设置"total, sizes, prev, pager, next, jumper" paginationLayout: "total, sizes, prev, pager, next, jumper", //表格分页布局,可设置"total, sizes, prev, pager, next, jumper"
column_config:["condition","filter","fix","hide","is_search","label","prop","search_type","sort","sortable","width"],
parseData: function (res) { //数据分析 parseData: function (res) { //数据分析
return { return {
data: res.data, //分析无分页的数据字段结构 data: res.data, //分析无分页的数据字段结构

View File

@ -114,6 +114,8 @@
/** 列表上面的检索 */ /** 列表上面的检索 */
.el-main.nopadding .searchMain{position: relative;display: flex;flex-wrap: wrap;align-items: self-end;padding-bottom: 10px;margin: 15px 0 0 0; border-bottom: 1px solid var(--el-border-color-light);} .el-main.nopadding .searchMain{position: relative;display: flex;flex-wrap: wrap;align-items: self-end;padding-bottom: 10px;margin: 15px 0 0 0; border-bottom: 1px solid var(--el-border-color-light);}
.el-main.nopadding .searchMain.logSearchMain{min-height: 50px;}
.el-main.nopadding .searchMain.emptySearchMain{margin: 0;padding-bottom: 0;border-bottom: 0;}
.el-main.nopadding .searchMainNoTop{margin-top: 0;} .el-main.nopadding .searchMainNoTop{margin-top: 0;}
.el-main.nopadding .searchMain .searchItem{display: flex;flex-direction: column;align-items: flex-start;margin-right: 20px;margin-bottom: 10px;} .el-main.nopadding .searchMain .searchItem{display: flex;flex-direction: column;align-items: flex-start;margin-right: 20px;margin-bottom: 10px;}
.el-main.nopadding .searchMain .searchItem .name{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;color: #303133;padding-bottom: 5px;text-align: right;} .el-main.nopadding .searchMain .searchItem .name{white-space: nowrap;overflow: hidden;text-overflow: ellipsis;color: #303133;padding-bottom: 5px;text-align: right;}
@ -152,6 +154,7 @@
.el-table.el-table--large {font-size: 14px;} .el-table.el-table--large {font-size: 14px;}
.el-table.el-table--small {font-size: 12px;} .el-table.el-table--small {font-size: 12px;}
.scTable .el-table.el-table--small .el-table__header-wrapper .cell{display: flex;align-items: center;} .scTable .el-table.el-table--small .el-table__header-wrapper .cell{display: flex;align-items: center;}
.scTable .el-table.el-table--small .el-table__header-wrapper .cell .cell_name{display: inline-block;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
.el-table {font-size: 12px;} .el-table {font-size: 12px;}
.el-radio-button__inner {font-size: 12px;} .el-radio-button__inner {font-size: 12px;}
.el-checkbox-button__inner {font-size: 12px;} .el-checkbox-button__inner {font-size: 12px;}

View File

@ -21,15 +21,15 @@
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<div class="searchMain searchMainNoTop"> <div class="searchMain searchMainNoTop">
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch> <scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn"> <div class="searchItem searchBtn" v-if="searchHeaderShow">
<el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button> <el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button>
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button> <el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button> <el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
</div> </div>
</div> </div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe border :size="size" @selection-change="selectionChange" :hideTotal="false"> <scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe border :size="size" @selection-change="selectionChange" @columnBack="columnBack" :hideTotal="false">
<el-table-column type="selection" align="center" width="40"></el-table-column> <el-table-column type="selection" align="center" width="40"></el-table-column>
<sc-table-column label="序号" align="center" type="index"></sc-table-column> <sc-table-column label="序号" align="center" type="index"></sc-table-column>
<template #logo="scope"> <template #logo="scope">
@ -84,6 +84,7 @@
<script> <script>
import saveDialog from './save' import saveDialog from './save'
import {eventBus} from "@/utils/eventBus";
export default { export default {
name:"costFlow", name:"costFlow",
components: { components: {
@ -104,54 +105,104 @@ export default {
selection: [], selection: [],
exportShow:false, exportShow:false,
searchShow:false, searchShow:false,
searchList:[ searchHeaderShow:false,
{name:'费用类型',type:'select',code:['type_name'], data:[], placeholder:"请选择费用类型",show:true}, filterMap:{
{name:'费用类别',type:'select',code:['category_name'], data:[], placeholder:"请选择费用类别",isOpen:true,show:false}, data:{}
{name:'地址',type:'text',code:['location'],placeholder:"请输入地址",isOpen:true,show:false}, },
{name:'单号',type:'text',code:['identifier'],placeholder:"请输入单号",isOpen:true,show:false},
{name:'单位',type:'text',code:['unit'],placeholder:"请输入单位",isOpen:true,show:false},
{name:'交付/快递日期',type:'date',code:'time',show:true},
{name:'新增日期',type:'date',code:'created_at',show:true},
{name:'关键字',type:'text',code:['quantity','amount','remark'],keyword:true,show:true},
],
params: {}, params: {},
} }
}, },
provide(){
return{
filterUploadClick:this.filterClick,
filterUploadParams:this.filterParams,
filterTagClose:this.tagClose,
filterModelParams:this.filterModelParams,
}
},
watch:{
'list.column':{
handler(val){
this.searchHeaderShow = val.length>0 && val.some(em=>em.is_search);
},
immediate:false,
deep:true
}
},
computed:{
filterModelParams(){
return this.filterMap
},
},
methods: { methods: {
/** 检索开始 */
columnBack(val){
this.list.column = val;
},
async filterClick(item) {
let {data, params} = item;
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
let searchParams = this.$TOOL.objCopy(this.params);
searchParams.field = ""
if (typeof data.prop === 'string') {
searchParams.field = data.prop;
} else {
searchParams.field = data.prop[0];
}
if (data.search_type == 'select' || data.search_type == 'checkbox') {
await this.getField(data,searchParams);
}
},
filterParams(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
this.upSearch();
},
tagClose(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
},
searchShowClick(){ searchShowClick(){
this.searchShow = !this.searchShow; this.searchShow = !this.searchShow;
this.searchList.forEach(item=>{ eventBus.$emit('close-all-popovers');
if(item.isOpen){ },
item.show = this.searchShow getHeaderData(params){
} this.params = params;
}) this.filterMap.data = params;
}, },
async getSelectData(item) { async getSelectData(item) {
let {data, params} = item; let {data, params} = item;
this.params = params; this.params = params; //
this.filterMap.data = params; //
let searchParams = this.$TOOL.objCopy(params); let searchParams = this.$TOOL.objCopy(params);
searchParams.field = "" searchParams.field = ""
if (typeof data.code === 'string') { if (typeof data.prop === 'string') {
searchParams.field = data.code; searchParams.field = data.prop;
} else { } else {
searchParams.field = data.code[0]; searchParams.field = data.prop[0];
} }
if (data.type == 'select') { if (data.search_type == 'select' || data.search_type == 'checkbox') {
const res = await this.$API.finance.cost.field.post(searchParams); await this.getField(data,searchParams)
if (res.code == 200) {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item[data.code];
})
}
this.searchList.forEach(item => {
if (item.code == data.code) {
item.data = res.data;
}
})
}
} }
}, },
async getField(data,searchParams) {
const res = await this.$API.finance.cost.field.post(searchParams);
if (res.code == 200) {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item[data.prop];
item.value = item[data.prop];
})
}
this.list.column.forEach(item => {
if (item.prop == data.prop) {
item.data = res.data;
}
})
}
},
/** 检索结束 */
// //
add(){ add(){
@ -260,7 +311,9 @@ export default {
}, },
reset(){ reset(){
this.params = {}; this.params = {};
this.filterMap.data = {};
this.$refs.scSearch.reload(); this.$refs.scSearch.reload();
eventBus.$emit('reset-popovers');
this.$refs.table.reload(); this.$refs.table.reload();
}, },
handleSaveSuccess(){ handleSaveSuccess(){

View File

@ -138,6 +138,11 @@ export default {
} }
} }
}, },
provide(){
return{
columnHeaderParams:false,
}
},
methods: { methods: {
linkRouter(item){ linkRouter(item){
let list = this.filterDataByItem(item,this.$TOOL.objCopy(this.routerList)); let list = this.filterDataByItem(item,this.$TOOL.objCopy(this.routerList));

View File

@ -102,6 +102,11 @@ export default {
} }
}, },
provide(){
return{
columnHeaderParams:false,
}
},
methods: { methods: {
linkRouter(item){ linkRouter(item){
let list = this.filterDataByItem(item,this.$TOOL.objCopy(this.routerList)); let list = this.filterDataByItem(item,this.$TOOL.objCopy(this.routerList));

View File

@ -12,15 +12,16 @@
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<div class="searchMain"> <div class="searchMain" :class="!searchHeaderShow?'emptySearchMain':''">
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch> <scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn">
<div class="searchItem searchBtn" v-if="searchHeaderShow">
<el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button> <el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button>
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button> <el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
<el-button :size="size" type="info" icon="el-icon-RefreshRight">重置</el-button> <el-button :size="size" type="info" icon="el-icon-RefreshRight">重置</el-button>
</div> </div>
</div> </div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" @selection-change="selectionChange" border stripe :size="size"> <scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" @selection-change="selectionChange" @columnBack="columnBack" border stripe :size="size">
<el-table-column type="selection" align="center" width="40"></el-table-column> <el-table-column type="selection" align="center" width="40"></el-table-column>
<sc-table-column label="序号" align="center" type="index"></sc-table-column> <sc-table-column label="序号" align="center" type="index"></sc-table-column>
<el-table-column label="操作" fixed="right" align="center" width="150"> <el-table-column label="操作" fixed="right" align="center" width="150">
@ -49,6 +50,7 @@
<script> <script>
import saveDialog from "./save" import saveDialog from "./save"
import {eventBus} from "@/utils/eventBus";
export default { export default {
name: 'earlyManager', name: 'earlyManager',
components: { components: {
@ -57,7 +59,6 @@ export default {
data() { data() {
return { return {
size:'small', size:'small',
searchShow:false,
dialog: { dialog: {
save: false, save: false,
permission: false permission: false
@ -67,36 +68,73 @@ export default {
apiObj: this.$API.early.earlyWarn.list, apiObj: this.$API.early.earlyWarn.list,
column:[] column:[]
}, },
searchList:[ searchShow:false,
{name:'日期',type:'date',code:'created_at',show:true}, searchHeaderShow:false,
{name:'区域',type:'text',code:['region'],placeholder:"请选择区域",show:true}, filterMap:{
{name:'部件类别',type:'text',code:['part_category'],placeholder:"请输入部件类别",show:true}, data:{}
{name:'部件MPN',type:'text',code:['part_mpn'],placeholder:"请输入部件MPN",isOpen:true,show:false}, },
{name:'在保备件出货总量',type:'text',code:['total_protected_parts'],placeholder:"请输入在保备件出货总量",isOpen:true,show:false},
{name:'在保备件数量',type:'text',code:['protected_spares_quantity'],placeholder:"请输入在保备件数量",isOpen:true,show:false},
{name:'预估三个月用量',type:'text',code:['sn'],placeholder:"请输入预估三个月用量",isOpen:true,show:false},
{name:'风险等级',type:'text',code:['risk_level'],placeholder:"请输入风险等级",isOpen:true,show:false},
{name:'风险描述',type:'text',code:['risk_description'],placeholder:"请输入风险描述",isOpen:true,show:false},
{name:'治理计划',type:'text',code:['governance_plan'],placeholder:"请输入治理计划",isOpen:true,show:false},
{name:'关键字',type:'text',code:['fault_description'],keyword:true,show:true},
],
selection: [], selection: [],
params: {} params: {}
} }
}, },
provide(){
return{
filterUploadClick:this.filterClick,
filterUploadParams:this.filterParams,
filterTagClose:this.tagClose,
filterModelParams:this.filterModelParams,
}
},
watch:{
'list.column':{
handler(val){
this.searchHeaderShow = val.length>0 && val.some(em=>em.is_search);
},
immediate:false,
deep:true
}
},
computed:{
filterModelParams(){
return this.filterMap
},
},
methods: { methods: {
getSelectData(item){ /**
let { params} = item; // data, * 表格检索开始
this.params = params; * */
columnBack(val){
this.list.column = val;
},
async filterClick(item) {
let {params} = item;
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
},
filterParams(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
this.upSearch();
},
tagClose(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
}, },
searchShowClick(){ searchShowClick(){
this.searchShow = !this.searchShow; this.searchShow = !this.searchShow;
this.searchList.forEach(item=>{ eventBus.$emit('close-all-popovers');
if(item.isOpen){
item.show = this.searchShow
}
})
}, },
getHeaderData(params){
this.params = params;
this.filterMap.data = params;
},
async getSelectData(item) {
let {params} = item;
this.params = params;
this.filterMap.data = params;
},
/** 表格检索结束 */
// //
add(){ add(){
this.dialog.save = true this.dialog.save = true

View File

@ -67,7 +67,7 @@
<div class="searchMain " style="padding-left: 10px;"> <div class="searchMain " style="padding-left: 10px;">
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch> <scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch>
<div class="searchItem searchBtn"> <div class="searchItem searchBtn" v-if="searchHeaderShow">
<el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button> <el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button>
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button> <el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button> <el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
@ -208,6 +208,7 @@ export default {
is_auto_repair:"", // is_auto_repair:"", //
emailId:'', emailId:'',
searchShow:false, searchShow:false,
searchHeaderShow:false,
searchData:{}, searchData:{},
searchList:[ searchList:[
{name:'是否确认',type:'select',code:['is_confirm'],data:[],placeholder:"请选择",isOpen:true,show:false}, {name:'是否确认',type:'select',code:['is_confirm'],data:[],placeholder:"请选择",isOpen:true,show:false},
@ -266,6 +267,20 @@ export default {
emptyText: "暂无数据", emptyText: "暂无数据",
} }
}, },
provide(){
return{
columnHeaderParams:false,
}
},
watch:{
'userColumn':{
handler(val){
this.searchHeaderShow = val.length>0 && val.some(em=>em.is_search);
},
immediate:false,
deep:true
}
},
computed: { computed: {
isAllDisabled() { isAllDisabled() {
let isDis = false; let isDis = false;
@ -468,6 +483,7 @@ export default {
eventBus.$emit('tagClose','/order/view-mail',{id:this.emailId}); eventBus.$emit('tagClose','/order/view-mail',{id:this.emailId});
}, },
/** 检索开始 */
async getSelectData(item) { async getSelectData(item) {
let {data, params} = item; let {data, params} = item;
this.searchData = params; this.searchData = params;
@ -495,6 +511,8 @@ export default {
} }
} }
}, },
/** 检索结束 */
searchShowClick(){ searchShowClick(){
this.searchShow = !this.searchShow; this.searchShow = !this.searchShow;
this.searchList.forEach(item=>{ this.searchList.forEach(item=>{

View File

@ -19,15 +19,15 @@
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<div class="searchMain"> <div class="searchMain">
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch> <scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn"> <div class="searchItem searchBtn" v-if="searchHeaderShow">
<el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button> <el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button>
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button> <el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button> <el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
</div> </div>
</div> </div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe border :size="size" @selection-change="selectionChange"> <scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe border :size="size" @selection-change="selectionChange" @columnBack="columnBack">
<el-table-column type="selection" align="center" width="40"></el-table-column> <el-table-column type="selection" align="center" width="40"></el-table-column>
<sc-table-column label="序号" align="center" type="index"></sc-table-column> <sc-table-column label="序号" align="center" type="index"></sc-table-column>
<template #logo="scope"> <template #logo="scope">
@ -67,6 +67,8 @@
<script> <script>
import {eventBus} from "@/utils/eventBus";
export default { export default {
name:"inventoryList", name:"inventoryList",
components: { components: {
@ -87,60 +89,106 @@ export default {
selection: [], selection: [],
exportShow:false, exportShow:false,
searchShow:false, searchShow:false,
searchList:[ searchHeaderShow:false,
{name:'仓库编码',type:'text',code:['f_stock_id'],placeholder:"请输入仓库编码",isOpen:true,show:true}, filterMap:{
{name:'计划跟踪号',type:'text',code:['f_mto_no'],placeholder:"请输入计划跟踪号",isOpen:true,show:false}, data:{}
{name:'生产日期',type:'date',code:'f_produce_date',show:true}, },
{name:'库存量(基本单位)',type:'text',code:['f_base_qty'],placeholder:"请输入库存量(基本单位)",isOpen:true,show:false},
{name:'预留量(基本单位)',type:'text',code:['f_base_lock_qty'],placeholder:"请输入预留量(基本单位)",isOpen:true,show:false},
{name:'库存量(库存辅单位)',type:'select',code:'f_sec_qty', data:[], placeholder:"请选择库存量(库存辅单位)",isOpen:true,show:false},
{name:'预留量(辅单位)',type:'select',code:'f_sec_lock_qty', data:[], placeholder:"请选择预留量(辅单位)",isOpen:true,show:false},
{name:'库存主单位编码',type:'text',code:['f_stock_unit_id'],placeholder:"请输入库存主单位编码",isOpen:true,show:false},
{name:'编码',type:'text',code:['f_material_id'],placeholder:"请输入编码",isOpen:true,show:false},
{name:'可用量(基本单位)',type:'text',code:['f_base_avb_qty'],placeholder:"请输入可用量(基本单位)",isOpen:true,show:false},
{name:'实体主键',type:'text',code:['f_id'],placeholder:"请输入实体主键",isOpen:true,show:false},
{name:'BOM版本编码',type:'text',code:['f_bom_id'],placeholder:"请输入BOM版本编码",isOpen:true,show:false},
{name:'创建日期',type:'date',code:'created_at',show:true},
{name:'关键字',type:'text',code:['name'],keyword:true,show:true},
],
params: {}, params: {},
} }
}, },
provide(){
return{
filterUploadClick:this.filterClick,
filterUploadParams:this.filterParams,
filterTagClose:this.tagClose,
filterModelParams:this.filterModelParams,
}
},
watch:{
'list.column':{
handler(val){
this.searchHeaderShow = val.length>0 && val.some(em=>em.is_search);
},
immediate:false,
deep:true
}
},
computed:{
filterModelParams(){
return this.filterMap
},
},
methods: { methods: {
/**
* 表格检索开始
* */
columnBack(val){
this.list.column = val;
},
async filterClick(item) {
let {data, params} = item;
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
let searchParams = this.$TOOL.objCopy(this.params);
searchParams.field = ""
if (typeof data.prop === 'string') {
searchParams.field = data.prop;
} else {
searchParams.field = data.prop[0];
}
if (data.search_type == 'select' || data.search_type == 'checkbox') {
await this.getField(data,searchParams);
}
},
filterParams(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
this.upSearch();
},
tagClose(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
},
searchShowClick(){ searchShowClick(){
this.searchShow = !this.searchShow; this.searchShow = !this.searchShow;
this.searchList.forEach(item=>{ eventBus.$emit('close-all-popovers');
if(item.isOpen){ },
item.show = this.searchShow getHeaderData(params){
} this.params = params;
}) this.filterMap.data = params;
}, },
async getSelectData(item) { async getSelectData(item) {
let {data, params} = item; let {data, params} = item;
this.params = params; this.params = params; //
this.filterMap.data = params; //
let searchParams = this.$TOOL.objCopy(params); let searchParams = this.$TOOL.objCopy(params);
searchParams.field = "" searchParams.field = ""
if (typeof data.code === 'string') { if (typeof data.prop === 'string') {
searchParams.field = data.code; searchParams.field = data.prop;
} else { } else {
searchParams.field = data.code[0]; searchParams.field = data.prop[0];
} }
if (data.type == 'select') { if (data.search_type == 'select' || data.search_type == 'checkbox') {
const res = await this.$API.orders.order.sock.field.post(searchParams); await this.getField(data,searchParams)
if (res.code == 200) {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item[data.code];
})
}
this.searchList.forEach(item => {
if (item.code == data.code) {
item.data = res.data;
}
})
}
} }
}, },
async getField(data,searchParams) {
const res = await this.$API.orders.order.sock.field.post(searchParams);
if (res.code == 200) {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item[data.prop];
item.value = item[data.prop];
})
}
this.list.column.forEach(item => {
if (item.prop == data.prop) {
item.data = res.data;
}
})
}
},
/** 表格检索结束 */
// //
add(){ add(){
@ -248,7 +296,9 @@ export default {
}, },
reset(){ reset(){
this.params = {}; this.params = {};
this.filterMap.data = {};
this.$refs.scSearch.reload(); this.$refs.scSearch.reload();
eventBus.$emit('reset-popovers');
this.$refs.table.reload(); this.$refs.table.reload();
}, },
handleSaveSuccess(){ handleSaveSuccess(){

View File

@ -2,7 +2,7 @@
<el-container class="mainBox mainHeaderNoBorderPadding"> <el-container class="mainBox mainHeaderNoBorderPadding">
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增工单</el-button> <el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增</el-button>
<scImport ref="scImport" :size="size" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess"> <scImport ref="scImport" :size="size" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess">
<template #header> <template #header>
<el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button> <el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>

View File

@ -149,8 +149,6 @@ export default {
}, },
}, },
mounted() { mounted() {
this.buttonRef = this.$refs.buttonRef;
// //
eventBus.$on('sockBack', this.getWsResult); eventBus.$on('sockBack', this.getWsResult);
this.getStatusList(); this.getStatusList();

View File

@ -10,22 +10,22 @@
<flow :list="flowList"/> <flow :list="flowList"/>
</div> </div>
<div class="searchMain searchMainNoTop"> <div class="searchMain searchMainNoTop">
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch> <scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn"> <div class="searchItem searchBtn" v-if="searchHeaderShow">
<el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button> <el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button>
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button> <el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button> <el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
</div> </div>
</div> </div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe border :size="size" @selection-change="selectionChange"> <scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe border :size="size" @selection-change="selectionChange" @columnBack="columnBack">
<el-table-column type="selection" align="center" width="40"></el-table-column> <el-table-column type="selection" align="center" width="40"></el-table-column>
<sc-table-column label="序号" align="center" type="index"></sc-table-column> <sc-table-column label="序号" align="center" type="index"></sc-table-column>
<template #repair_date="scope">{{scope.row.repair_order && scope.row.repair_order.repair_date?scope.row.repair_order.repair_date:''}}</template> <template #repair_date="scope">{{scope.row.repair_order && scope.row.repair_order.repair_date?scope.row.repair_order.repair_date:''}}</template>
<template #schedule_date="scope">{{scope.row.repair_order && scope.row.repair_order.schedule_date?scope.row.repair_order.schedule_date:''}}</template> <template #schedule_date="scope">{{scope.row.repair_order && scope.row.repair_order.schedule_date?scope.row.repair_order.schedule_date:''}}</template>
<template #repair_status="scope"> <template #repair_status="scope">
<span v-if="scope.row.repair_order && scope.row.repair_order.repair_status"> <span v-if="scope.row.repair_order && scope.row.repair_order.repair_status">
<span v-for="(item,ind) in statusList" :key="ind"> <span v-for="(item,ind) in setMap.statusList" :key="ind">
<span :style="{color:item.value==1?`var(--el-order-color-1)`:item.value==2?`var(--el-order-color-2)`:item.value==3?`var(--el-order-color-3)`:item.value==4?`var(--el-order-color-4)`:`var(--el-order-color-100)`}" <span :style="{color:item.value==1?`var(--el-order-color-1)`:item.value==2?`var(--el-order-color-2)`:item.value==3?`var(--el-order-color-3)`:item.value==4?`var(--el-order-color-4)`:`var(--el-order-color-100)`}"
v-if="item.value == scope.row.repair_order.repair_status">{{item.label}}</span> v-if="item.value == scope.row.repair_order.repair_status">{{item.label}}</span>
</span> </span>
@ -75,6 +75,9 @@ export default {
{name:'确认工单',left:false,right:true}, {name:'确认工单',left:false,right:true},
{name:'下发维保',left:true,right:false}, {name:'下发维保',left:true,right:false},
], ],
setMap:{
statusList:[]
},
dialog: { dialog: {
confirm: false, confirm: false,
show: false, show: false,
@ -86,63 +89,128 @@ export default {
selection: [], selection: [],
exportShow:false, exportShow:false,
searchShow:false, searchShow:false,
searchList:[ searchHeaderShow:false,
{name:'维修单号',type:'text',code:'repair_order_no', data:[], placeholder:"请输入维修单号",show:true}, filterMap:{
{name:'故障类型',type:'select',code:['fault_type'], data:[], placeholder:"请选择故障类型",show:true}, data:{}
{name:'整机型号',type:'select',code:['device_model'], data:[], placeholder:"请选择整机型号",isOpen:true,show:true}, },
{name:'机房城市',type:'select',code:['city'], data:[], placeholder:"请选择机房城市",isOpen:true,show:false},
{name:'故障描述',type:'text',code:['fault_description'],placeholder:"请输故障描述",isOpen:true,show:false},
{name:'关键字',type:'text',code:['fault_description','device_sn'],keyword:true,show:true},
],
params: {}, params: {},
statusList:[],
} }
}, },
provide(){
return{
filterUploadClick:this.filterClick,
filterUploadParams:this.filterParams,
filterTagClose:this.tagClose,
filterModelParams:this.filterModelParams,
}
},
watch:{
'list.column':{
handler(val){
this.searchHeaderShow = val.length>0 && val.some(em=>em.is_search);
},
immediate:false,
deep:true
}
},
computed:{
filterModelParams(){
return this.filterMap
},
},
mounted() { mounted() {
this.getStatusList(); this.getStatusList();
}, },
methods: { methods: {
searchShowClick(){
this.searchShow = !this.searchShow;
this.searchList.forEach(item=>{
if(item.isOpen){
item.show = this.searchShow
}
})
},
async getStatusList() { async getStatusList() {
const res = await this.$API.orders.order.repair.status.post(); const res = await this.$API.orders.order.repair.status.post();
if (res.code == 200) { if (res.code == 200) {
this.statusList = res.data; this.setMap.statusList = res.data;
} }
}, },
/** 检索开始 */
columnBack(val){
val.forEach(item=>{
if(item.prop === "repair_status"){
item.data = this.setMap.statusList;
}
})
this.list.column = val;
},
async filterClick(item) {
let {data, params} = item;
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
let searchParams = this.$TOOL.objCopy(this.params);
searchParams.field = ""
if (typeof data.prop === 'string') {
searchParams.field = data.prop;
} else {
searchParams.field = data.prop[0];
}
if (data.search_type == 'select' || data.search_type == 'checkbox') {
await this.getField(data,searchParams);
}
},
filterParams(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
this.upSearch();
},
tagClose(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
},
searchShowClick(){
this.searchShow = !this.searchShow;
eventBus.$emit('close-all-popovers');
},
getHeaderData(params){
this.params = params;
this.filterMap.data = params;
},
async getSelectData(item) { async getSelectData(item) {
let {data, params} = item; let {data, params} = item;
this.params = params; this.params = params; //
this.filterMap.data = params; //
let searchParams = this.$TOOL.objCopy(params); let searchParams = this.$TOOL.objCopy(params);
searchParams.field = "" searchParams.field = ""
if (typeof data.code === 'string') { if (typeof data.prop === 'string') {
searchParams.field = data.code; searchParams.field = data.prop;
} else { } else {
searchParams.field = data.code[0]; searchParams.field = data.prop[0];
} }
if (data.type == 'select') { if (data.search_type == 'select' || data.search_type == 'checkbox') {
const res = await this.$API.orders.order.maintenance.field.post(searchParams); await this.getField(data,searchParams)
if (res.code == 200) { }
if (res.data && res.data.length > 0) { },
res.data.forEach(item => { async getField(data,searchParams) {
item.label = item[data.code]; const res = await this.$API.orders.order.maintenance.field.post(searchParams);
}) if (res.code == 200) {
} if (res.data && res.data.length > 0) {
this.searchList.forEach(item => { res.data.forEach(item => {
if (item.code == data.code) { if (data.prop === 'repair_status') {
item.data = res.data; this.setMap.statusList.forEach(em => {
if (em.value === item[data.prop]) {
item.label = em.label;
item.value = em.value;
}
})
} else {
item.label = item[data.prop];
item.value = item[data.prop];
} }
}) })
} }
this.list.column.forEach(item => {
if (item.prop == data.prop) {
item.data = res.data;
}
})
} }
}, },
/** 检索结束 */
confirmOrder(){ confirmOrder(){
this.dialog.confirm = true; this.dialog.confirm = true;
this.$nextTick(() => { this.$nextTick(() => {
@ -169,7 +237,9 @@ export default {
}, },
reset(){ reset(){
this.params = {}; this.params = {};
this.filterMap.data = {};
this.$refs.scSearch.reload(); this.$refs.scSearch.reload();
eventBus.$emit('reset-popovers');
this.$refs.table.reload(); this.$refs.table.reload();
}, },
handleSaveSuccess(){ handleSaveSuccess(){

View File

@ -5,19 +5,19 @@
<flow :list="flowList"/> <flow :list="flowList"/>
</div> </div>
<div class="searchMain searchMainNoTop"> <div class="searchMain searchMainNoTop">
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch> <scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn"> <div class="searchItem searchBtn" v-if="searchHeaderShow">
<el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button> <el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button>
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button> <el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button> <el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
</div> </div>
</div> </div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe border :size="size" :hideTotal="false" @selection-change="selectionChange"> <scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe border :size="size" :hideTotal="false" @selection-change="selectionChange" @columnBack="columnBack">
<el-table-column type="selection" align="center" width="40"></el-table-column> <el-table-column type="selection" align="center" width="40"></el-table-column>
<sc-table-column label="序号" align="center" type="index"></sc-table-column> <sc-table-column label="序号" align="center" type="index"></sc-table-column>
<template #repair_status="scope"> <template #repair_status="scope">
<span v-for="(item,ind) in statusList" :key="ind"> <span v-for="(item,ind) in setMap.statusList" :key="ind">
<span :style="{color:item.value==1?`var(--el-order-color-1)`:item.value==2?`var(--el-order-color-2)`:item.value==3?`var(--el-order-color-3)`:item.value==4?`var(--el-order-color-4)`:`var(--el-order-color-100)`}" <span :style="{color:item.value==1?`var(--el-order-color-1)`:item.value==2?`var(--el-order-color-2)`:item.value==3?`var(--el-order-color-3)`:item.value==4?`var(--el-order-color-4)`:`var(--el-order-color-100)`}"
v-if="item.value == scope.row.repair_status">{{item.label}}</span> v-if="item.value == scope.row.repair_status">{{item.label}}</span>
</span> </span>
@ -71,6 +71,9 @@ export default {
save: false, save: false,
show: false, show: false,
}, },
setMap:{
statusList:[],
},
list: { list: {
apiObj: this.$API.orders.order.repair.list, apiObj: this.$API.orders.order.repair.list,
column: [], column: [],
@ -78,19 +81,36 @@ export default {
selection: [], selection: [],
exportShow:false, exportShow:false,
searchShow:false, searchShow:false,
searchList:[ searchHeaderShow:false,
{name:'创建日期',type:'date',code:'created_at',show:true}, filterMap:{
{name:'维修单号',type:'text',code:'repair_order_no', data:[], placeholder:"请输入维修单号",show:true}, data:{}
{name:'故障类型',type:'select',code:['fault_type'], data:[], placeholder:"请选择故障类型",show:true}, },
{name:'状态',type:'select',code:['repair_status'], data:[], placeholder:"请选择状态",isOpen:true,show:false},
{name:'故障描述',type:'text',code:['fault_description'],placeholder:"请输故障描述",isOpen:true,show:false},
{name:'关键字',type:'text',code:['fault_description','device_sn'],keyword:true,show:true},
],
params: {}, params: {},
statusList:[],
countParams:this.$store.state.msg.repair_count countParams:this.$store.state.msg.repair_count
} }
}, },
provide(){
return{
filterUploadClick:this.filterClick,
filterUploadParams:this.filterParams,
filterTagClose:this.tagClose,
filterModelParams:this.filterModelParams,
}
},
watch:{
'list.column':{
handler(val){
this.searchHeaderShow = val.length>0 && val.some(em=>em.is_search);
},
immediate:false,
deep:true
}
},
computed:{
filterModelParams(){
return this.filterMap
},
},
mounted() { mounted() {
this.getStatusList(); this.getStatusList();
// //
@ -111,44 +131,94 @@ export default {
async getStatusList() { async getStatusList() {
const res = await this.$API.orders.order.repair.status.post(); const res = await this.$API.orders.order.repair.status.post();
if (res.code == 200) { if (res.code == 200) {
this.statusList = res.data; this.setMap.statusList = res.data;
} }
}, },
searchShowClick(){ /**
this.searchShow = !this.searchShow; * 表格检索开始
this.searchList.forEach(item=>{ * */
if(item.isOpen){ columnBack(val){
item.show = this.searchShow val.forEach(item=>{
if(item.prop === "repair_status"){
item.data = this.setMap.statusList;
} }
}) })
this.list.column = val;
},
async filterClick(item) {
let {data, params} = item;
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
let searchParams = this.$TOOL.objCopy(this.params);
searchParams.field = ""
if (typeof data.prop === 'string') {
searchParams.field = data.prop;
} else {
searchParams.field = data.prop[0];
}
if (data.search_type == 'select' || data.search_type == 'checkbox') {
await this.getField(data,searchParams);
}
},
filterParams(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
this.upSearch();
},
tagClose(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
},
searchShowClick(){
this.searchShow = !this.searchShow;
eventBus.$emit('close-all-popovers');
},
getHeaderData(params){
this.params = params;
this.filterMap.data = params;
}, },
async getSelectData(item) { async getSelectData(item) {
let {data, params} = item; let {data, params} = item;
this.params = params; this.params = params; //
this.filterMap.data = params; //
let searchParams = this.$TOOL.objCopy(params); let searchParams = this.$TOOL.objCopy(params);
searchParams.field = "" searchParams.field = ""
if (typeof data.code === 'string') { if (typeof data.prop === 'string') {
searchParams.field = data.code; searchParams.field = data.prop;
} else { } else {
searchParams.field = data.code[0]; searchParams.field = data.prop[0];
} }
if (data.type == 'select') { if (data.search_type == 'select' || data.search_type == 'checkbox') {
const res = await this.$API.orders.order.repair.field.post(searchParams); await this.getField(data,searchParams)
if (res.code == 200) { }
if (res.data && res.data.length > 0) { },
res.data.forEach(item => { async getField(data,searchParams) {
item.label = item[data.code]; const res = await this.$API.orders.order.repair.field.post(searchParams);
}) if (res.code == 200) {
} if (res.data && res.data.length > 0) {
this.searchList.forEach(item => { res.data.forEach(item => {
if (item.code == data.code) { if (data.prop === 'repair_status') {
item.data = res.data; this.setMap.statusList.forEach(em => {
if (em.value === item[data.prop]) {
item.label = em.label;
item.value = em.value;
}
})
} else {
item.label = item[data.prop];
item.value = item[data.prop];
} }
}) })
} }
this.list.column.forEach(item => {
if (item.prop == data.prop) {
item.data = res.data;
}
})
} }
}, },
/** 表格检索结束 */
// //
add(){ add(){
@ -189,13 +259,14 @@ export default {
selectionChange(selection){ selectionChange(selection){
this.selection = selection; this.selection = selection;
}, },
upSearch(){ upSearch(){
this.$refs.table.upData(this.params); this.$refs.table.upData(this.params);
}, },
reset(){ reset(){
this.params = {}; this.params = {};
this.filterMap.data = {};
this.$refs.scSearch.reload(); this.$refs.scSearch.reload();
eventBus.$emit('reset-popovers');
this.$refs.table.reload(); this.$refs.table.reload();
}, },
handleSaveSuccess(){ handleSaveSuccess(){

View File

@ -2,7 +2,7 @@
<el-container class="mainBox mainHeaderNoBorderPadding"> <el-container class="mainBox mainHeaderNoBorderPadding">
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增工单</el-button> <el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增</el-button>
<scImport ref="scImport" :size="size" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess"> <scImport ref="scImport" :size="size" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess">
<template #header> <template #header>
<el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button> <el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>

View File

@ -2,7 +2,7 @@
<el-container class="mainBox mainHeaderNoBorderPadding"> <el-container class="mainBox mainHeaderNoBorderPadding">
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增工单</el-button> <el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增</el-button>
<scImport ref="scImport" :size="size" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess"> <scImport ref="scImport" :size="size" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess">
<template #header> <template #header>
<el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button> <el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>

View File

@ -46,6 +46,11 @@ export default {
params: {}, params: {},
} }
}, },
provide(){
return{
columnHeaderParams:false,
}
},
mounted() { mounted() {
this.getTypeList(); this.getTypeList();
}, },

View File

@ -8,7 +8,7 @@
<el-button :size="size" type="primary" @click="save">保存配置</el-button> <el-button :size="size" type="primary" @click="save">保存配置</el-button>
</div> </div>
</div> </div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe :size="size" highlightCurrentRow :hideDo="true" > <scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe border :size="size" highlightCurrentRow :hideDo="true" >
<sc-table-column label="序号" align="center" type="index"></sc-table-column> <sc-table-column label="序号" align="center" type="index"></sc-table-column>
<el-table-column width="380" label="客户名称" prop="customer_name"> <el-table-column width="380" label="客户名称" prop="customer_name">
<template #default="scope"> <template #default="scope">

View File

@ -26,7 +26,7 @@
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button> <el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
</div> </div>
</div> </div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe :size="size" highlightCurrentRow @selection-change="selectionChange"> <scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe :size="size" border highlightCurrentRow @selection-change="selectionChange">
<sc-table-column type="selection" align="center" width="40"></sc-table-column> <sc-table-column type="selection" align="center" width="40"></sc-table-column>
<sc-table-column label="序号" align="center" type="index"></sc-table-column> <sc-table-column label="序号" align="center" type="index"></sc-table-column>
<el-table-column label="操作" fixed="right" align="center" width="160"> <el-table-column label="操作" fixed="right" align="center" width="160">
@ -75,6 +75,11 @@ export default {
], ],
} }
}, },
provide(){
return{
columnHeaderParams:false,
}
},
mounted() { mounted() {
}, },

View File

@ -10,7 +10,7 @@
</div> </div>
</el-header> </el-header>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe :size="size" highlightCurrentRow :hideDo="true" @selection-change="selectionChange"> <scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe border :size="size" highlightCurrentRow :hideDo="true" @selection-change="selectionChange">
<el-table-column type="selection" align="center" width="40"></el-table-column> <el-table-column type="selection" align="center" width="40"></el-table-column>
<sc-table-column label="序号" align="center" type="index"></sc-table-column> <sc-table-column label="序号" align="center" type="index"></sc-table-column>
<template #region_name="scope"> <template #region_name="scope">
@ -70,6 +70,11 @@ export default {
}, },
} }
}, },
provide(){
return{
columnHeaderParams:false,
}
},
mounted() { mounted() {
this.getRegion(); this.getRegion();
this.getRoom(); this.getRoom();

View File

@ -32,7 +32,7 @@
<span class="tip">注意此配置由专业IT管理员操作无配置时以系统默认定时任务配置为准</span> <span class="tip">注意此配置由专业IT管理员操作无配置时以系统默认定时任务配置为准</span>
</div> </div>
</div> </div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe :size="size" highlightCurrentRow :hideDo="true" :hidePagination="true"> <scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe border :size="size" highlightCurrentRow :hideDo="true" :hidePagination="true">
<sc-table-column label="序号" align="center" type="index"></sc-table-column> <sc-table-column label="序号" align="center" type="index"></sc-table-column>
<el-table-column width="200" label="任务名称" prop="name"></el-table-column> <el-table-column width="200" label="任务名称" prop="name"></el-table-column>
<el-table-column width="200" label="任务描述" prop="memo"></el-table-column> <el-table-column width="200" label="任务描述" prop="memo"></el-table-column>

View File

@ -10,7 +10,7 @@
</div> </div>
</el-header> </el-header>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe :size="size" :hideDo="true" :hidePagination="true" @selection-change="selectionChange"> <scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe border :size="size" :hideDo="true" :hidePagination="true" @selection-change="selectionChange">
<sc-table-column label="序号" align="center" type="index"></sc-table-column> <sc-table-column label="序号" align="center" type="index"></sc-table-column>
<el-table-column width="200" label="备件类别" prop="spare_parts_category"></el-table-column> <el-table-column width="200" label="备件类别" prop="spare_parts_category"></el-table-column>
<el-table-column width="200" label="故障率" prop="failure_rate"></el-table-column> <el-table-column width="200" label="故障率" prop="failure_rate"></el-table-column>

View File

@ -20,15 +20,15 @@
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<div class="searchMain searchMainNoTop"> <div class="searchMain searchMainNoTop">
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch> <scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn"> <div class="searchItem searchBtn" v-if="searchHeaderShow">
<el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button> <el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button>
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button> <el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button> <el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
</div> </div>
</div> </div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" :params="params" row-key="id" stripe border :size="size" @selection-change="selectionChange"> <scTable ref="table" :apiObj="list.apiObj" :column="list.column" :params="params" row-key="id" stripe border :size="size" @selection-change="selectionChange" @columnBack="columnBack">
<el-table-column type="selection" align="center" width="40"></el-table-column> <el-table-column type="selection" align="center" width="40"></el-table-column>
<sc-table-column label="序号" align="center" type="index"></sc-table-column> <sc-table-column label="序号" align="center" type="index"></sc-table-column>
<!-- <template #disable_status="scope">--> <!-- <template #disable_status="scope">-->
@ -62,6 +62,7 @@
<script> <script>
import saveDialog from './save' import saveDialog from './save'
import showDialog from './show' import showDialog from './show'
import {eventBus} from "@/utils/eventBus";
export default { export default {
name:"bom", name:"bom",
components: { components: {
@ -83,74 +84,107 @@ export default {
selection: [], selection: [],
exportShow:false, exportShow:false,
searchShow:false, searchShow:false,
searchList:[ searchHeaderShow:false,
{name:'创建时间',type:'date',code:'created_at',show: true}, filterMap:{
{name:'更新时间',type:'date',code:'updated_at',show: true}, data:{}
{name:'BOM版本',type:'select',code:['bom_version'],placeholder:"请输入BOM版本",show:true}, },
{name:'BOM简称',type:'text',code:'bom_abbreviation',placeholder:"请输入BOM简称",show:false},
{name:'BOM分类',type:'select',code:['bom_classification'],placeholder:"请输入BOM分类",isOpen:true,show:false},
{name:'BOM用途',type:'text',code:['bom_purpose'],placeholder:"请输入BOM用途",isOpen:true,show:false},
{name:'父项物料编码',type:'text',code:['parent_material_code'],placeholder:"请输入父项物料编码",isOpen:true,show:false},
{name:'父项物料名称',type:'text',code:['parent_material_name'],placeholder:"请输入父项物料名称",isOpen:true,show:false},
{name:'父项物料单位',type:'text',code:['parent_material_unit'],placeholder:"请输入父项物料单位",isOpen:true,show:false},
{name:'子项物料编码',type:'text',code:['child_material_code'],placeholder:"请输入子项物料编码",isOpen:true,show:false},
{name:'子项物料名称',type:'text',code:['child_material_name'],placeholder:"请输入子项物料名称",isOpen:true,show:false},
{name:'子项物料单位',type:'text',code:['child_material_unit'],placeholder:"请输入子项物料单位",isOpen:true,show:false},
{name:'次项',type:'text',code:['item_sequence'],placeholder:"请输入次项",isOpen:true,show:false},
{name:'子项类型',type:'text',code:['child_material_type'],placeholder:"请输入子项类型",isOpen:true,show:false},
{name:'用量分母',type:'text',code:['usage_numerator'],placeholder:"请输入用量分母",isOpen:true,show:false},
{name:'用量分子',type:'text',code:['usage_denominator'],placeholder:"请输入用量分子",isOpen:true,show:false},
{name:'创建组织编码',type:'text',code:['create_org_code'],placeholder:"请输入创建组织编码",isOpen:true,show:false},
{name:'创建组织名称',type:'text',code:['create_org_name'],placeholder:"请输入创建组织名称",isOpen:true,show:false},
{name:'使用组织编码',type:'text',code:['use_org_code'],placeholder:"请输入使用组织编码",isOpen:true,show:false},
{name:'使用组织名称',type:'text',code:['use_org_name'],placeholder:"请输入使用组织名称",isOpen:true,show:false},
{name:'单据状态',type:'text',code:['document_status'],placeholder:"请输入单据状态",isOpen:true,show:false},
{name:'禁用状态',type:'text',code:['disable_status'],placeholder:"请输入禁用状态",isOpen:true,show:false},
{name:'关键字',type:'text',code:['bom_abbreviation'],keyword:true,show:true},
],
params: {}, params: {},
} }
}, },
provide(){
return{
filterUploadClick:this.filterClick,
filterUploadParams:this.filterParams,
filterTagClose:this.tagClose,
filterModelParams:this.filterModelParams,
}
},
watch:{
'list.column':{
handler(val){
this.searchHeaderShow = val.length>0 && val.some(em=>em.is_search);
},
immediate:false,
deep:true
}
},
computed:{
filterModelParams(){
return this.filterMap
},
},
mounted() { mounted() {
}, },
methods: { methods: {
/** 检索开始 */
columnBack(val){
this.list.column = val;
},
async filterClick(item) {
let {data, params} = item;
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
let searchParams = this.$TOOL.objCopy(this.params);
searchParams.field = ""
if (typeof data.prop === 'string') {
searchParams.field = data.prop;
} else {
searchParams.field = data.prop[0];
}
if (data.search_type == 'select' || data.search_type == 'checkbox') {
await this.getField(data,searchParams);
}
},
filterParams(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
this.upSearch();
},
tagClose(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
},
searchShowClick(){ searchShowClick(){
this.searchShow = !this.searchShow; this.searchShow = !this.searchShow;
this.searchList.forEach(item=>{ eventBus.$emit('close-all-popovers');
if(item.isOpen){ },
item.show = this.searchShow getHeaderData(params){
} this.params = params;
}) this.filterMap.data = params;
}, },
async getSelectData(item) { async getSelectData(item) {
let {data, params} = item; let {data, params} = item;
this.params = params; this.params = params; //
this.filterMap.data = params; //
let searchParams = this.$TOOL.objCopy(params); let searchParams = this.$TOOL.objCopy(params);
searchParams.field = "" searchParams.field = ""
if (typeof data.code === 'string') { if (typeof data.prop === 'string') {
searchParams.field = data.code; searchParams.field = data.prop;
} else { } else {
searchParams.field = data.code[0]; searchParams.field = data.prop[0];
} }
if (data.type == 'select' || data.type == 'multiple') { if (data.search_type == 'select' || data.search_type == 'checkbox') {
const res = await this.$API.setup.bom.field.post(searchParams); await this.getField(data,searchParams)
if (res.code == 200) {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item[data.code];
item.value = item.id;
item.id = item[data.code];
})
}
this.searchList.forEach(item => {
if (item.code == data.code) {
item.data = res.data;
}
})
}
} }
}, },
async getField(data,searchParams) {
const res = await this.$API.setup.bom.field.post(searchParams);
if (res.code == 200) {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item[data.prop];
item.value = item[data.prop];
})
}
this.list.column.forEach(item => {
if (item.prop == data.prop) {
item.data = res.data;
}
})
}
},
/** 检索结束 */
// //
importFile(){ importFile(){
@ -249,7 +283,9 @@ export default {
}, },
reset(){ reset(){
this.params = {}; this.params = {};
this.filterMap.data = {};
this.$refs.scSearch.reload(); this.$refs.scSearch.reload();
eventBus.$emit('reset-popovers');
this.$refs.table.reload(); this.$refs.table.reload();
}, },
handleSaveSuccess(){ handleSaveSuccess(){

View File

@ -20,15 +20,15 @@
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<div class="searchMain searchMainNoTop"> <div class="searchMain searchMainNoTop">
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch> <scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn"> <div class="searchItem searchBtn" v-if="searchHeaderShow">
<el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button> <el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button>
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button> <el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button> <el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
</div> </div>
</div> </div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe border :size="size" @selection-change="selectionChange"> <scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe border :size="size" @selection-change="selectionChange" @columnBack="columnBack">
<el-table-column type="selection" align="center" width="40"></el-table-column> <el-table-column type="selection" align="center" width="40"></el-table-column>
<sc-table-column label="序号" align="center" type="index"></sc-table-column> <sc-table-column label="序号" align="center" type="index"></sc-table-column>
<template #logo="scope"> <template #logo="scope">
@ -85,6 +85,7 @@
<script> <script>
import saveDialog from './save' import saveDialog from './save'
import seeDialog from './see' import seeDialog from './see'
import {eventBus} from "@/utils/eventBus";
export default { export default {
name:"company", name:"company",
@ -110,69 +111,127 @@ export default {
selection: [], selection: [],
exportShow:false, exportShow:false,
searchShow:false, searchShow:false,
searchList:[ searchHeaderShow:false,
{name:'开通日期',type:'date',code:'activation_date',show:true}, filterMap:{
{name:'公司类型',type:'select',code:['company_type'],isConstant:true, data:[], placeholder:"请选择公司类型",show:true}, data:{}
{name:'公司名称',type:'multiple',code:'full_name',data:[], placeholder:"请选择公司名称",show:true}, },
{name:'状态',type:'select',code:['active_status'],isConstant:true, data:[], placeholder:"请选择状态",isOpen:true,show:false},
{name:'手机号',type:'text',code:['mobile'],placeholder:"请输入手机号",isOpen:true,show:false},
{name:'邮件地址',type:'text',code:['email'],placeholder:"请输入邮箱地址",isOpen:true,show:false},
{name:'公司地址',type:'text',code:['address'],placeholder:"请输入公司地址",isOpen:true,show:false},
{name:'负责人',type:'text',code:['owner'],placeholder:"请输入负责人",isOpen:true,show:false},
{name:'关键字',type:'text',code:['domain','name'],keyword:true,show:true},
],
params: {}, params: {},
} }
}, },
provide(){
return{
filterUploadClick:this.filterClick,
filterUploadParams:this.filterParams,
filterTagClose:this.tagClose,
filterModelParams:this.filterModelParams,
}
},
watch:{
'list.column':{
handler(val){
this.searchHeaderShow = val.length>0 && val.some(em=>em.is_search);
},
immediate:false,
deep:true
}
},
computed:{
filterModelParams(){
return this.filterMap
},
},
mounted() { mounted() {
this.getCompanyTypeSelect(); this.getCompanyTypeSelect();
}, },
methods: { methods: {
searchShowClick(){ /** 检索开始 */
this.searchShow = !this.searchShow; columnBack(val){
this.searchList.forEach(item=>{ val.forEach(item=>{
if(item.isOpen){ if(item.prop === "company_type"){
item.show = this.searchShow item.data = this.setMap.companyType;
} }
}) })
this.list.column = val;
},
async filterClick(item) {
let {data, params} = item;
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
let searchParams = this.$TOOL.objCopy(this.params);
searchParams.field = ""
if (typeof data.prop === 'string') {
searchParams.field = data.prop;
} else {
searchParams.field = data.prop[0];
}
if (data.search_type == 'select' || data.search_type == 'checkbox') {
await this.getField(data,searchParams);
}
},
filterParams(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
this.upSearch();
},
tagClose(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
},
searchShowClick(){
this.searchShow = !this.searchShow;
eventBus.$emit('close-all-popovers');
},
getHeaderData(params){
this.params = params;
this.filterMap.data = params;
}, },
async getSelectData(item) { async getSelectData(item) {
let {data, params} = item; let {data, params} = item;
this.params = params; this.params = params; //
this.filterMap.data = params; //
let searchParams = this.$TOOL.objCopy(params); let searchParams = this.$TOOL.objCopy(params);
searchParams.field = "" searchParams.field = ""
if (typeof data.code === 'string') { if (typeof data.prop === 'string') {
searchParams.field = data.code; searchParams.field = data.prop;
} else { } else {
searchParams.field = data.code[0]; searchParams.field = data.prop[0];
} }
if (data.type == 'select' || data.type == 'multiple') { if (data.search_type == 'select' || data.search_type == 'checkbox') {
const res = await this.$API.system.company.field.post(searchParams); await this.getField(data,searchParams)
if (res.code == 200) { }
if (res.data && res.data.length > 0) { },
res.data.forEach(item => { async getField(data,searchParams) {
if(data.isConstant){ const res = await this.$API.system.company.field.post(searchParams);
item.label = item[data.code+'_display']; if (res.code == 200) {
item.value = item[data.code]; if (res.data && res.data.length > 0) {
}else{ res.data.forEach(item => {
item.label = item[data.code]; if (data.prop === 'company_type') {
item.value = item.id; item.label = item[data.prop+'_display'];
item.id = item[data.code]; item.value = item[data.prop];
} } else {
}) item.label = item[data.prop];
} item.value = item[data.prop];
this.searchList.forEach(item => {
if (item.code == data.code) {
item.data = res.data;
} }
}) })
} }
this.list.column.forEach(item => {
if (item.prop == data.prop) {
item.data = res.data;
}
})
} }
}, },
/** 检索结束 */
// //
async getCompanyTypeSelect(){ async getCompanyTypeSelect(){
const res = await this.$API.system.company.typeSelect.post(); const res = await this.$API.system.company.typeSelect.post();
if(res.code == 200){ if(res.code == 200){
if(res.data.length>0){
res.data.forEach(em=>{
em.value = em.company_type
})
}
this.setMap['companyType'] = res.data; this.setMap['companyType'] = res.data;
} }
}, },
@ -319,7 +378,9 @@ export default {
}, },
reset(){ reset(){
this.params = {}; this.params = {};
this.filterMap.data = {};
this.$refs.scSearch.reload(); this.$refs.scSearch.reload();
eventBus.$emit('reset-popovers');
this.$refs.table.reload(); this.$refs.table.reload();
}, },
handleSaveSuccess(){ handleSaveSuccess(){

View File

@ -1,9 +1,11 @@
<template> <template>
<el-container class="mainBox mainBoxHeaderNoBorder"> <el-container class="mainBox mainBoxHeaderNoBorder">
<el-main class="nopadding"> <el-main class="nopadding">
<div class="searchMain"> <div class="searchMain logSearchMain">
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch> <scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn">
<div class="searchItem searchBtn" v-if="searchHeaderShow">
<el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button>
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button> <el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button> <el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
</div> </div>
@ -13,8 +15,13 @@
</scExport> </scExport>
</div> </div>
</div> </div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe border :size="size" highlightCurrentRow @row-click="rowClick"> <scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe border :size="size" highlightCurrentRow @row-click="rowClick" @columnBack="columnBack">
<sc-table-column label="序号" align="center" type="index"></sc-table-column> <sc-table-column label="序号" align="center" type="index"></sc-table-column>
<template #type="scope">
<span v-for="(item,ind) in setMap.typeList" :key="ind">
<span v-if="item.type == scope.row.type">{{item.type_text}}</span>
</span>
</template>
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container>
@ -26,6 +33,7 @@
<script> <script>
import info from '../info' import info from '../info'
import {eventBus} from "@/utils/eventBus";
export default { export default {
components: { components: {
info, info,
@ -34,9 +42,9 @@ export default {
return { return {
size:"small", size:"small",
setMap:{ setMap:{
name:[] name:[],
typeList:[]
}, },
infoDrawer: false, infoDrawer: false,
date: [], date: [],
list:{ list:{
@ -44,36 +52,141 @@ export default {
column:[] column:[]
}, },
exportShow:false, exportShow:false,
searchList:[ searchShow:false,
{name:'操作日期',type:'date',code:'created_at',show:true}, searchHeaderShow:false,
{name:'操作功能',type:'multiple',code:'type', data:[], placeholder:"请选择功能",show:true}, filterMap:{
{name:'关键字',type:'text',code:['remark','ip','location','creator_name'],keyword:true,show:true}, data:{}
], },
params: {}, params: {},
} }
}, },
provide(){
return{
filterUploadClick:this.filterClick,
filterUploadParams:this.filterParams,
filterTagClose:this.tagClose,
filterModelParams:this.filterModelParams,
}
},
watch:{
'list.column':{
handler(val){
this.searchHeaderShow = val.length>0 && val.some(em=>em.is_search);
},
immediate:false,
deep:true
}
},
computed:{
filterModelParams(){
return this.filterMap
},
},
mounted() {
this.getTypeList();
},
methods: { methods: {
getSelectData(item){ /**
let {data,params} = item; * 表格检索开始
this.params = params; * */
if(data.code == "type"){ columnBack(val){
this.getTypeList(data,params) val.forEach(item=>{
if(item.prop === "type"){
item.data = this.setMap.typeList;
}
})
this.list.column = val;
},
async filterClick(item) {
let {data, params} = item;
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
let searchParams = this.$TOOL.objCopy(this.params);
searchParams.creator_id = {
operator:"in",
value:[this.$TOOL.data.get('USER_INFO').id]
};
searchParams.field = ""
if (typeof data.prop === 'string') {
searchParams.field = data.prop;
} else {
searchParams.field = data.prop[0];
}
if (data.search_type == 'select' || data.search_type == 'checkbox') {
await this.getField(data,searchParams);
} }
}, },
async getTypeList(data,params) { filterParams(params){
const res = await this.$API.system.log.operation.post(params); let filterParams = Object.assign(this.params,params);
if(res.code == 200){ this.filterMap.data = filterParams;
res.data.forEach(item=>{ this.upSearch();
item.id = item.type; },
item.label = item.log_title; tagClose(params){
}) let filterParams = Object.assign(this.params,params);
this.searchList.forEach(item=>{ this.filterMap.data = filterParams;
if(item.code == data.code){ },
searchShowClick(){
this.searchShow = !this.searchShow;
eventBus.$emit('close-all-popovers');
},
getHeaderData(params){
this.params = params;
this.filterMap.data = params;
},
async getSelectData(item) {
let {data, params} = item;
this.params = params;
this.filterMap.data = params;
let searchParams = this.$TOOL.objCopy(params);
searchParams.creator_id = {
operator:"in",
value:[this.$TOOL.data.get('USER_INFO').id]
};
searchParams.field = ""
if (typeof data.prop === 'string') {
searchParams.field = data.prop;
} else {
searchParams.field = data.prop[0];
}
if (data.search_type == 'select' || data.search_type == 'checkbox') {
await this.getField(data,searchParams)
}
},
async getField(data,searchParams) {
const res = await this.$API.system.log.operation.post(searchParams);
if (res.code == 200) {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
if (data.prop === 'type') {
item.label = item[data.prop+'_text'];
item.value = item[data.prop];
} else {
item.label = item[data.prop];
item.value = item[data.prop];
}
})
}
this.list.column.forEach(item => {
if (item.prop == data.prop) {
item.data = res.data; item.data = res.data;
} }
}) })
} }
}, },
/** 表格检索结束 */
async getTypeList() {
const res = await this.$API.system.log.operation.post();
if(res.code == 200){
if(res.data.length>0){
res.data.forEach(item=>{
item.value = item.type;
item.label = item.type_text;
})
}
this.setMap.typeList = res.data;
}
},
// //
exportChangeShow(params){ exportChangeShow(params){
if(params.type == 8){ if(params.type == 8){
@ -93,7 +206,9 @@ export default {
}, },
reset(){ reset(){
this.params = {}; this.params = {};
this.filterMap.data = {};
this.$refs.scSearch.reload(); this.$refs.scSearch.reload();
eventBus.$emit('reset-popovers');
this.$refs.table.reload(); this.$refs.table.reload();
}, },
rowClick(row){ rowClick(row){

View File

@ -51,6 +51,11 @@ export default {
params: {}, params: {},
} }
}, },
provide(){
return{
columnHeaderParams:false,
}
},
methods: { methods: {
getSelectData(item){ getSelectData(item){
let {params} = item; let {params} = item;

View File

@ -21,15 +21,15 @@
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<div class="searchMain searchMainNoTop"> <div class="searchMain searchMainNoTop">
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch> <scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn"> <div class="searchItem searchBtn" v-if="searchHeaderShow">
<el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button> <el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button>
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button> <el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button> <el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
</div> </div>
</div> </div>
<scTable ref="table" :apiObj="list.apiObj" row-key="id" @selection-change="selectionChange" stripe border :size="size"> <scTable ref="table" :apiObj="list.apiObj" row-key="id" @selection-change="selectionChange" @columnBack="columnBack" stripe border :size="size">
<el-table-column type="selection" align="center" width="40"></el-table-column> <el-table-column type="selection" align="center" width="40"></el-table-column>
<sc-table-column label="序号" align="center" type="index"></sc-table-column> <sc-table-column label="序号" align="center" type="index"></sc-table-column>
<el-table-column label="操作" fixed="right" align="center" width="150"> <el-table-column label="操作" fixed="right" align="center" width="150">
@ -59,6 +59,7 @@
<script> <script>
import infoSave from "../infoSave" import infoSave from "../infoSave"
import {eventBus} from "@/utils/eventBus";
export default { export default {
name: "info", name: "info",
components:{ components:{
@ -79,59 +80,140 @@ export default {
column:[] column:[]
}, },
selection: [], selection: [],
searchList:[
{name:'创建日期',type:'date',code:'created_at',show:true},
{name:'ERP编号',type:'select',code:['erp_pn'],data:[],placeholder:"请输入ERP编号",show:true},
{name:'供应商',type:'select',code:['vendor'],data:[],placeholder:"请输入供应商",isOpen:true,show:false},
{name:'名称',type:'text',code:['name'],data:[],placeholder:"请输入名称",show:true},
{name:'制造商型号',type:'select',code:['mpn'],data:[],placeholder:"请输入制造商型号",isOpen:true,show:false},
{name:'规格',type:'text',code:['specification'],placeholder:"请输入规格",isOpen:true,show:false},
{name:'创建人',type:'select',code:['creator_name'],data:[], placeholder:"请输入创建人",isOpen:true,show:false},
{name:'关键字',type:'text',code:['remark','name'],keyword:true,show:true},
],
searchShow:false,
exportShow:false, exportShow:false,
searchShow:false,
searchHeaderShow:false,
filterMap:{
data:{}
},
params: {} params: {}
} }
}, },
provide(){
return{
filterUploadClick:this.filterClick,
filterUploadParams:this.filterParams,
filterTagClose:this.tagClose,
filterModelParams:this.filterModelParams,
}
},
watch:{
'list.column':{
handler(val){
this.searchHeaderShow = val.length>0 && val.some(em=>em.is_search);
},
immediate:false,
deep:true
}
},
computed:{
filterModelParams(){
return this.filterMap
},
},
mounted() { mounted() {
}, },
methods:{ methods:{
searchShowClick(){ /** 检索开始 */
this.searchShow = !this.searchShow; columnBack(val){
this.searchList.forEach(item=>{ val.forEach(item=>{
if(item.isOpen){ if(item.prop === "company_type"){
item.show = this.searchShow item.data = this.setMap.companyType;
} }
}) })
this.list.column = val;
}, },
async getSelectData(item){ async filterClick(item) {
let {data, params} = item; let {data, params} = item;
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
let searchParams = this.$TOOL.objCopy(this.params);
searchParams.field = ""
if (typeof data.prop === 'string') {
searchParams.field = data.prop;
} else {
searchParams.field = data.prop[0];
}
if (data.search_type == 'select' || data.search_type == 'checkbox') {
await this.getField(data,searchParams);
}
},
filterParams(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
this.upSearch();
},
tagClose(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
},
searchShowClick(){
this.searchShow = !this.searchShow;
eventBus.$emit('close-all-popovers');
},
getHeaderData(params){
this.params = params; this.params = params;
this.filterMap.data = params;
},
async getSelectData(item) {
let {data, params} = item;
this.params = params; //
this.filterMap.data = params; //
let searchParams = this.$TOOL.objCopy(params); let searchParams = this.$TOOL.objCopy(params);
searchParams.field = "" searchParams.field = ""
if (typeof data.code === 'string') { if (typeof data.prop === 'string') {
searchParams.field = data.code; searchParams.field = data.prop;
} else { } else {
searchParams.field = data.code[0]; searchParams.field = data.prop[0];
} }
if (data.type == 'select') { if (data.search_type == 'select' || data.search_type == 'checkbox') {
const res = await this.$API.system.spareInfo.field.post(searchParams); await this.getField(data,searchParams)
if (res.code == 200) {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item[data.code];
})
}
this.searchList.forEach(item => {
if (item.code == data.code) {
item.data = res.data;
}
})
}
} }
}, },
async getField(data,searchParams) {
const res = await this.$API.system.spareInfo.field.post(searchParams);
if (res.code == 200) {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item[data.prop];
item.value = item[data.prop];
})
}
this.list.column.forEach(item => {
if (item.prop == data.prop) {
item.data = res.data;
}
})
}
},
/** 检索结束 */
// async getSelectData(item){
// let {data, params} = item;
// this.params = params;
// let searchParams = this.$TOOL.objCopy(params);
// searchParams.field = ""
// if (typeof data.code === 'string') {
// searchParams.field = data.code;
// } else {
// searchParams.field = data.code[0];
// }
// if (data.type == 'select') {
// const res = await this.$API.system.spareInfo.field.post(searchParams);
// if (res.code == 200) {
// if (res.data && res.data.length > 0) {
// res.data.forEach(item => {
// item.label = item[data.code];
// })
// }
// this.searchList.forEach(item => {
// if (item.code == data.code) {
// item.data = res.data;
// }
// })
// }
// }
// },
// //
add(){ add(){
@ -242,7 +324,9 @@ export default {
}, },
reset(){ reset(){
this.params = {}; this.params = {};
this.filterMap.data = {};
this.$refs.scSearch.reload(); this.$refs.scSearch.reload();
eventBus.$emit('reset-popovers');
this.$refs.table.reload(); this.$refs.table.reload();
}, },

View File

@ -21,15 +21,15 @@
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<div class="searchMain searchMainNoTop"> <div class="searchMain searchMainNoTop">
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch> <scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn"> <div class="searchItem searchBtn" v-if="searchHeaderShow">
<el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button> <el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button>
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button> <el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button> <el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
</div> </div>
</div> </div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" @selection-change="selectionChange" stripe border :size="size"> <scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" @selection-change="selectionChange" @columnBack="columnBack" stripe border :size="size">
<el-table-column type="selection" align="center" width="40"></el-table-column> <el-table-column type="selection" align="center" width="40"></el-table-column>
<sc-table-column label="序号" align="center" type="index"></sc-table-column> <sc-table-column label="序号" align="center" type="index"></sc-table-column>
<el-table-column label="操作" fixed="right" align="center" width="150"> <el-table-column label="操作" fixed="right" align="center" width="150">
@ -59,6 +59,7 @@
<script> <script>
import librarySave from "../librarySave"; import librarySave from "../librarySave";
import {eventBus} from "@/utils/eventBus";
export default { export default {
name: "library", name: "library",
components:{ components:{
@ -79,61 +80,114 @@ export default {
column:[] column:[]
}, },
selection: [], selection: [],
searchList:[
{name:'创建日期',type:'date',code:'created_at',show:true},
{name:'备件SN',type:'select',code:['sn'],data:[],placeholder:"请输入备件SN",show:true},
{name:'收获城市',type:'select',code:['receive_city'],data:[],placeholder:"请输入收获城市",isOpen:true,show:false},
{name:'收货日期',type:'date',code:'receive_date',show:true},
{name:'最终状态',type:'select',code:['final_status'],data:[],placeholder:"请输入最终状态",isOpen:true,show:false},
{name:'单号',type:'select',code:['order_number'],data:[],placeholder:"请输入单号",isOpen:true,show:false},
{name:'库房',type:'select',code:['warehouse'],data:[],placeholder:"请输入库房",isOpen:true,show:false},
{name:'FW',type:'select',code:['fw'],data:[],placeholder:"请输入FW",isOpen:true,show:false},
{name:'到货类型',type:'select',code:['delivery_type'],data:[],placeholder:"请输入到货类型",isOpen:true,show:false},
{name:'关键字',type:'text',code:['remark','erp_pn'],keyword:true,show:true},
],
searchShow:false,
exportShow:false, exportShow:false,
searchShow:false,
searchHeaderShow:false,
filterMap:{
data:{}
},
params: {} params: {}
} }
}, },
provide(){
return{
filterUploadClick:this.filterClick,
filterUploadParams:this.filterParams,
filterTagClose:this.tagClose,
filterModelParams:this.filterModelParams,
}
},
watch:{
'list.column':{
handler(val){
this.searchHeaderShow = val.length>0 && val.some(em=>em.is_search);
},
immediate:false,
deep:true
}
},
computed:{
filterModelParams(){
return this.filterMap
},
},
mounted() { mounted() {
}, },
methods:{ methods:{
searchShowClick(){ /** 检索开始 */
this.searchShow = !this.searchShow; columnBack(val){
this.searchList.forEach(item=>{ val.forEach(item=>{
if(item.isOpen){ if(item.prop === "company_type"){
item.show = this.searchShow item.data = this.setMap.companyType;
} }
}) })
this.list.column = val;
},
async filterClick(item) {
let {data, params} = item;
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
let searchParams = this.$TOOL.objCopy(this.params);
searchParams.field = ""
if (typeof data.prop === 'string') {
searchParams.field = data.prop;
} else {
searchParams.field = data.prop[0];
}
if (data.search_type == 'select' || data.search_type == 'checkbox') {
await this.getField(data,searchParams);
}
},
filterParams(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
this.upSearch();
},
tagClose(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
},
searchShowClick(){
this.searchShow = !this.searchShow;
eventBus.$emit('close-all-popovers');
},
getHeaderData(params){
this.params = params;
this.filterMap.data = params;
}, },
async getSelectData(item) { async getSelectData(item) {
let {data, params} = item; let {data, params} = item;
this.params = params; this.params = params; //
this.filterMap.data = params; //
let searchParams = this.$TOOL.objCopy(params); let searchParams = this.$TOOL.objCopy(params);
searchParams.field = "" searchParams.field = ""
if (typeof data.code === 'string') { if (typeof data.prop === 'string') {
searchParams.field = data.code; searchParams.field = data.prop;
} else { } else {
searchParams.field = data.code[0]; searchParams.field = data.prop[0];
} }
if (data.type == 'select') { if (data.search_type == 'select' || data.search_type == 'checkbox') {
const res = await this.$API.system.spare.field.post(searchParams); await this.getField(data,searchParams)
if (res.code == 200) {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item[data.code];
})
}
this.searchList.forEach(item => {
if (item.code == data.code) {
item.data = res.data;
}
})
}
} }
}, },
async getField(data,searchParams) {
const res = await this.$API.system.spare.field.post(searchParams);
if (res.code == 200) {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
item.label = item[data.prop];
item.value = item[data.prop];
})
}
this.list.column.forEach(item => {
if (item.prop == data.prop) {
item.data = res.data;
}
})
}
},
/** 检索结束 */
// //
add(){ add(){
@ -239,7 +293,9 @@ export default {
}, },
reset(){ reset(){
this.params = {}; this.params = {};
this.filterMap.data = {};
this.$refs.scSearch.reload(); this.$refs.scSearch.reload();
eventBus.$emit('reset-popovers');
this.$refs.table.reload(); this.$refs.table.reload();
}, },

View File

@ -186,6 +186,11 @@
this.$refs.group.filter(val); this.$refs.group.filter(val);
} }
}, },
provide(){
return{
columnHeaderParams:false,
}
},
mounted() { mounted() {
this.getGroup() this.getGroup()
this.auditStatus(); this.auditStatus();

View File

@ -56,22 +56,13 @@
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container>
<!-- <save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save=false"></save-dialog>-->
<!-- <permission-dialog v-if="dialog.permission" ref="permissionDialog" @closed="dialog.permission=false"></permission-dialog>-->
</template> </template>
<script> <script>
// import saveDialog from './save'
// import permissionDialog from './permission'
export default { export default {
name: 'warehouse', name: 'warehouse',
components: { components: {
// saveDialog,
// permissionDialog
}, },
data() { data() {
return { return {

View File

@ -2,7 +2,7 @@
<el-container class="mainBox mainHeaderNoBorderPadding"> <el-container class="mainBox mainHeaderNoBorderPadding">
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增工单</el-button> <el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增</el-button>
<scImport ref="scImport" :size="size" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess"> <scImport ref="scImport" :size="size" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess">
<template #header> <template #header>
<el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button> <el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
@ -81,7 +81,7 @@ export default {
show: false, show: false,
}, },
list: { list: {
apiObj: this.$API.shipment.out.list, apiObj: {},
column: [], column: [],
}, },
selection: [], selection: [],

View File

@ -2,15 +2,15 @@
<el-container class="mainBox mainBoxHeaderNoBorder"> <el-container class="mainBox mainBoxHeaderNoBorder">
<el-main class="nopadding"> <el-main class="nopadding">
<div class="searchMain"> <div class="searchMain">
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch> <scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn"> <div class="searchItem searchBtn" v-if="searchHeaderShow">
<el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button> <el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button>
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button> <el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button> <el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
</div> </div>
</div> </div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe border :size="size" @selection-change="selectionChange"> <scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe border :size="size" @selection-change="selectionChange" @columnBack="columnBack">
<el-table-column type="selection" align="center" width="40"></el-table-column> <el-table-column type="selection" align="center" width="40"></el-table-column>
<sc-table-column label="序号" align="center" type="index"></sc-table-column> <sc-table-column label="序号" align="center" type="index"></sc-table-column>
<template #logo="scope"> <template #logo="scope">
@ -50,6 +50,8 @@
<script> <script>
import {eventBus} from "@/utils/eventBus";
export default { export default {
name:"shipmentList", name:"shipmentList",
components: { components: {
@ -69,56 +71,118 @@ export default {
selection: [], selection: [],
exportShow:false, exportShow:false,
searchShow:false, searchShow:false,
searchList:[ searchHeaderShow:false,
{name:'实体主键',type:'text',code:['f_id'],placeholder:"请输入实体主键",isOpen:true,show:false}, filterMap:{
{name:'单据编号',type:'text',code:['f_bill_no'],placeholder:"请输入单据编号",isOpen:true,show:false}, data:{}
{name:'日期',type:'date',code:'f_date',show:true}, },
{name:'收货方地址',type:'text',code:['f_receive_address'],placeholder:"请输入收货方地址",isOpen:true,show:false},
{name:'客户名称',type:'select',code:['f_customer_id'],data:[],placeholder:"请选择客户名称",isOpen:true,show:false},
{name:'物料编码',type:'text',code:['f_material_id'],placeholder:"请输入物料编码",isOpen:true,show:false},
{name:'实发数量',type:'text',code:['f_real_qty'],placeholder:"请输入实发数量",isOpen:true,show:false},
{name:'应发数量',type:'text',code:['f_must_qty'],placeholder:"请输入应发数量",isOpen:true,show:false},
{name:'创建日期',type:'date',code:'created_at',show:true},
{name:'关键字',type:'text',code:['name'],keyword:true,show:true},
],
params: {}, params: {},
} }
}, },
provide(){
return{
filterUploadClick:this.filterClick,
filterUploadParams:this.filterParams,
filterTagClose:this.tagClose,
filterModelParams:this.filterModelParams,
}
},
watch:{
'list.column':{
handler(val){
this.searchHeaderShow = val.length>0 && val.some(em=>em.is_search);
},
immediate:false,
deep:true
}
},
computed:{
filterModelParams(){
return this.filterMap
},
},
methods: { methods: {
searchShowClick(){ /** 检索开始 */
this.searchShow = !this.searchShow; columnBack(val){
this.searchList.forEach(item=>{ val.forEach(item=>{
if(item.isOpen){ if(item.prop === "repair_status"){
item.show = this.searchShow item.data = this.setMap.statusList;
} }
}) })
this.list.column = val;
},
async filterClick(item) {
let {data, params} = item;
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
let searchParams = this.$TOOL.objCopy(this.params);
searchParams.field = ""
if (typeof data.prop === 'string') {
searchParams.field = data.prop;
} else {
searchParams.field = data.prop[0];
}
if (data.search_type == 'select' || data.search_type == 'checkbox') {
await this.getField(data,searchParams);
}
},
filterParams(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
this.upSearch();
},
tagClose(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
},
searchShowClick(){
this.searchShow = !this.searchShow;
eventBus.$emit('close-all-popovers');
},
getHeaderData(params){
this.params = params;
this.filterMap.data = params;
}, },
async getSelectData(item) { async getSelectData(item) {
let {data, params} = item; let {data, params} = item;
this.params = params; this.params = params; //
this.filterMap.data = params; //
let searchParams = this.$TOOL.objCopy(params); let searchParams = this.$TOOL.objCopy(params);
searchParams.field = "" searchParams.field = ""
if (typeof data.code === 'string') { if (typeof data.prop === 'string') {
searchParams.field = data.code; searchParams.field = data.prop;
} else { } else {
searchParams.field = data.code[0]; searchParams.field = data.prop[0];
} }
if (data.type == 'select') { if (data.search_type == 'select' || data.search_type == 'checkbox') {
const res = await this.$API.orders.order.out.field.post(searchParams); await this.getField(data,searchParams)
if (res.code == 200) { }
if (res.data && res.data.length > 0) { },
res.data.forEach(item => { async getField(data,searchParams) {
item.label = item[data.code]; const res = await this.$API.orders.order.out.field.post(searchParams);
}) if (res.code == 200) {
} if (res.data && res.data.length > 0) {
this.searchList.forEach(item => { res.data.forEach(item => {
if (item.code == data.code) { if (data.prop === 'repair_status') {
item.data = res.data; this.setMap.statusList.forEach(em => {
if (em.value === item[data.prop]) {
item.label = em.label;
item.value = em.value;
}
})
} else {
item.label = item[data.prop];
item.value = item[data.prop];
} }
}) })
} }
this.list.column.forEach(item => {
if (item.prop == data.prop) {
item.data = res.data;
}
})
} }
}, },
/** 检索结束 */
// //
add(){ add(){
@ -244,7 +308,9 @@ export default {
}, },
reset(){ reset(){
this.params = {}; this.params = {};
this.filterMap.data = {};
this.$refs.scSearch.reload(); this.$refs.scSearch.reload();
eventBus.$emit('reset-popovers');
this.$refs.table.reload(); this.$refs.table.reload();
}, },
handleSaveSuccess(){ handleSaveSuccess(){

View File

@ -2,7 +2,7 @@
<el-container class="mainBox mainHeaderNoBorderPadding"> <el-container class="mainBox mainHeaderNoBorderPadding">
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增工单</el-button> <el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增</el-button>
<scImport ref="scImport" :size="size" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess"> <scImport ref="scImport" :size="size" title="批量导入维保工单" @parentParams="importUpload" @importSuccess="importSuccess">
<template #header> <template #header>
<el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button> <el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>

View File

@ -1,10 +1,11 @@
<template> <template>
<el-card class="logCard" shadow="never" header="操作日志"> <el-card class="logCard" shadow="never" header="操作日志">
<el-main class="nopadding"> <el-main class="nopadding">
<div class="searchMain"> <div class="searchMain logSearchMain">
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch> <scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
<div class="searchItem searchBtn"> <div class="searchItem searchBtn" v-if="searchHeaderShow">
<el-button :size="size" :icon="searchShow?'el-icon-ArrowUpBold':'el-icon-ArrowDownBold'" @click="searchShowClick">{{searchShow?'收起':'更多'}}</el-button>
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button> <el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button> <el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
</div> </div>
@ -14,8 +15,13 @@
</scExport> </scExport>
</div> </div>
</div> </div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe border :size="size" @row-click="rowClick"> <scTable ref="table" :apiObj="list.apiObj" :column="list.column" row-key="id" stripe border :size="size" @row-click="rowClick" @columnBack="columnBack">
<sc-table-column label="序号" type="index"></sc-table-column> <sc-table-column label="序号" type="index"></sc-table-column>
<template #type="scope">
<span v-for="(item,ind) in setMap.typeList" :key="ind">
<span v-if="item.type == scope.row.type">{{item.type_text}}</span>
</span>
</template>
</scTable> </scTable>
</el-main> </el-main>
</el-card> </el-card>
@ -27,6 +33,7 @@
<script> <script>
import info from '../../setting/log/info' import info from '../../setting/log/info'
import {eventBus} from "@/utils/eventBus";
export default { export default {
components:{ components:{
info info
@ -34,51 +41,156 @@
data() { data() {
return { return {
size:"small", size:"small",
setMap:{
typeList:[]
},
list:{ list:{
apiObj: this.$API.user.log, apiObj: this.$API.user.log,
column: [], column: [],
}, },
infoDrawer: false, infoDrawer: false,
exportShow:false, exportShow:false,
searchShow:false,
searchList:[ searchHeaderShow:false,
{name:'操作日期',type:'date',code:'created_at'}, filterMap:{
{name:'操作功能',type:'multiple',code:'type', data:[], placeholder:"请选择功能",show:true}, data:{}
{name:'关键字',type:'text',code:['remark','ip','location','creator_name'],keyword:true,show:true}, },
],
params: {}, params: {},
} }
}, },
provide(){
return{
filterUploadClick:this.filterClick,
filterUploadParams:this.filterParams,
filterTagClose:this.tagClose,
filterModelParams:this.filterModelParams,
}
},
watch:{
'list.column':{
handler(val){
this.searchHeaderShow = val.length>0 && val.some(em=>em.is_search);
},
immediate:false,
deep:true
}
},
computed:{
filterModelParams(){
return this.filterMap
},
},
mounted() { mounted() {
this.getTypeData();
}, },
methods:{ methods:{
getSelectData(item){ /**
let {data,params} = item; * 表格检索开始
this.params = params; * */
if(data.code == "type"){ columnBack(val){
this.getTypeList(data,params) val.forEach(item=>{
} if(item.prop === "type"){
item.data = this.setMap.typeList;
}
})
this.list.column = val;
}, },
async getTypeList(data,params) { async filterClick(item) {
let objData = this.$TOOL.objCopy(params); let {data, params} = item;
objData.creator_id = { let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
let searchParams = this.$TOOL.objCopy(this.params);
searchParams.creator_id = {
operator:"in", operator:"in",
value:[this.$TOOL.data.get('USER_INFO').id] value:[this.$TOOL.data.get('USER_INFO').id]
}; };
const res = await this.$API.system.log.operation.post(objData); searchParams.field = ""
if(res.code == 200){ if (typeof data.prop === 'string') {
res.data.forEach(item=>{ searchParams.field = data.prop;
item.id = item.type; } else {
item.label = item.log_title; searchParams.field = data.prop[0];
}) }
this.searchList.forEach(item=>{ if (data.search_type == 'select' || data.search_type == 'checkbox') {
if(item.code == data.code){ await this.getField(data,searchParams);
}
},
filterParams(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
this.upSearch();
},
tagClose(params){
let filterParams = Object.assign(this.params,params);
this.filterMap.data = filterParams;
},
searchShowClick(){
this.searchShow = !this.searchShow;
eventBus.$emit('close-all-popovers');
},
getHeaderData(params){
this.params = params;
this.filterMap.data = params;
},
async getSelectData(item) {
let {data, params} = item;
this.params = params;
this.filterMap.data = params;
let searchParams = this.$TOOL.objCopy(params);
searchParams.creator_id = {
operator:"in",
value:[this.$TOOL.data.get('USER_INFO').id]
};
searchParams.field = ""
if (typeof data.prop === 'string') {
searchParams.field = data.prop;
} else {
searchParams.field = data.prop[0];
}
if (data.search_type == 'select' || data.search_type == 'checkbox') {
await this.getField(data,searchParams)
}
},
async getField(data,searchParams) {
const res = await this.$API.system.log.operation.post(searchParams);
if (res.code == 200) {
if (res.data && res.data.length > 0) {
res.data.forEach(item => {
if (data.prop === 'type') {
item.label = item[data.prop+'_text'];
item.value = item[data.prop];
} else {
item.label = item[data.prop];
item.value = item[data.prop];
}
})
}
this.list.column.forEach(item => {
if (item.prop == data.prop) {
item.data = res.data; item.data = res.data;
} }
}) })
} }
}, },
/** 表格检索结束 */
async getTypeData() {
let params = {
creator_id:{
operator:"in",
value:[this.$TOOL.data.get('USER_INFO').id]
}
}
const res = await this.$API.system.log.operation.post(params);
if(res.code === 200){
if(res.data.length>0){
res.data.forEach(item=>{
item.value = item.type;
item.label = item.type_text;
})
}
this.setMap.typeList = res.data;
}
},
// //
exportChangeShow(params){ exportChangeShow(params){
if(params.type == 34){ if(params.type == 34){
@ -97,7 +209,9 @@
}, },
reset(){ reset(){
this.params = {}; this.params = {};
this.filterMap.data = {};
this.$refs.scSearch.reload(); this.$refs.scSearch.reload();
eventBus.$emit('reset-popovers');
this.$refs.table.reload(); this.$refs.table.reload();
}, },
rowClick(row){ rowClick(row){