同步表格检索
This commit is contained in:
parent
19a63d9408
commit
533d3a8918
@ -3,10 +3,10 @@
|
||||
<div class="setting-column__title">
|
||||
<span class="move_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="width_b">宽度</span>
|
||||
<span class="type_b">类型</span>
|
||||
<span class="type_b" v-if="columnHeaderSetup">类型</span>
|
||||
<span class="sortable_b">排序</span>
|
||||
<span class="fixed_b">固定</span>
|
||||
</div>
|
||||
@ -20,14 +20,14 @@
|
||||
<span class="show_b">
|
||||
<el-switch v-model="item.hide" :active-value="false" :inactive-value="true"></el-switch>
|
||||
</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>
|
||||
</span>
|
||||
<span class="name_b" :title="item.prop">{{ item.label }}</span>
|
||||
<span class="width_b">
|
||||
<el-input v-model="item.width" placeholder="auto" size="small"></el-input>
|
||||
</span>
|
||||
<span class="type_b">
|
||||
<span class="type_b" v-if="columnHeaderSetup">
|
||||
<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-select>
|
||||
@ -52,6 +52,7 @@
|
||||
|
||||
<script>
|
||||
import Sortable from 'sortablejs'
|
||||
import {inject} from "vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -82,6 +83,11 @@
|
||||
usercolumn: JSON.parse(JSON.stringify(this.column||[]))
|
||||
}
|
||||
},
|
||||
setup() {
|
||||
const columnHeaderSetup = inject('columnHeaderParams', true);
|
||||
|
||||
return {columnHeaderSetup};
|
||||
},
|
||||
watch:{
|
||||
usercolumn: {
|
||||
handler(){
|
||||
|
||||
@ -10,6 +10,17 @@
|
||||
<el-option v-for="em in item.data" :key="em" :label="em.label" :value="em.value || em.id"></el-option>
|
||||
</scMultipleSelect>
|
||||
</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">
|
||||
<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>
|
||||
@ -41,7 +52,6 @@ export default {
|
||||
handler(val){
|
||||
if(val && val.length>0){
|
||||
this.columnList = val.filter(em=> !em.hide && em.is_search);
|
||||
// console.log(this.columnList,233)
|
||||
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].value == "string"){
|
||||
this.params[i].value = "";
|
||||
}else if(typeof this.params[i].value == "boolean"){
|
||||
this.params[i].value = "";
|
||||
}else{
|
||||
this.params[i].value = [];
|
||||
}
|
||||
@ -151,6 +163,9 @@ export default {
|
||||
})
|
||||
for(let i in grouped){
|
||||
if(this.params[i]){
|
||||
if(i === 'active_status'){
|
||||
grouped[i].value = this.params[i]
|
||||
}
|
||||
grouped[i].value = this.params[i].value
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="popoverBox">
|
||||
<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>
|
||||
<el-icon class="sc-trend-icon"><sc-icon-Filter /></el-icon>
|
||||
</span>
|
||||
@ -28,14 +28,19 @@
|
||||
<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>
|
||||
</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 下拉选择-->
|
||||
<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-option v-for="(item, index) in column && column.data" :key="index" :label="item.label" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<!-- select 多选下拉选择-->
|
||||
<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)">
|
||||
@ -88,8 +93,9 @@ export default {
|
||||
const filterUploadParams = inject('filterUploadParams', () => { });
|
||||
const filterTagClose = inject('filterTagClose', () => { });
|
||||
const filterModelParams = inject('filterModelParams', ()=>{});
|
||||
const columnHeaderSetup = inject('columnHeaderParams', true);
|
||||
|
||||
return { filterUploadClick, filterUploadParams, filterTagClose, filterModelParams };
|
||||
return { filterUploadClick, filterUploadParams, filterTagClose, filterModelParams, columnHeaderSetup};
|
||||
},
|
||||
created() {
|
||||
eventBus.$on('close-all-popovers', this.closePopover);
|
||||
@ -138,7 +144,7 @@ export default {
|
||||
* */
|
||||
confirm() {
|
||||
this.visible = false;
|
||||
if (!this.filterValue || this.filterValue === "") {
|
||||
if ((!this.filterValue && this.checkedColumn.search_type!='radio') || this.filterValue === "") {
|
||||
this.filterValue = "";
|
||||
if(this.checkedColumn.search_type !== "text"){
|
||||
return
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
<div style="display: inline-block;width: 100%;" v-if="item.is_search && !item.hide">
|
||||
<type-popover ref="popoverRef" :columnIndex="index" :column="item"></type-popover>
|
||||
</div>
|
||||
<span v-else>{{ item.label }}</span>
|
||||
<span class="cell_name" v-else>{{ item.label }}</span>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<slot :name="item.prop" v-bind="scope">
|
||||
@ -42,7 +42,7 @@
|
||||
</div>
|
||||
<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-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>
|
||||
<el-button icon="el-icon-set-up" circle style="margin-left:15px"></el-button>
|
||||
</template>
|
||||
@ -75,6 +75,7 @@
|
||||
import config from "@/config/table";
|
||||
import columnSetting from './columnSetting'
|
||||
import TypePopover from './components/typePopover'
|
||||
import {inject} from "vue";
|
||||
|
||||
export default {
|
||||
name: 'scTable',
|
||||
@ -110,6 +111,11 @@
|
||||
rowChild:{type:Boolean, default:true},
|
||||
docsSort:{type:Boolean, default:false},
|
||||
},
|
||||
setup() {
|
||||
const columnHeaderSetup = inject('columnHeaderParams', true);
|
||||
|
||||
return {columnHeaderSetup};
|
||||
},
|
||||
watch: {
|
||||
//监听从props里拿到值了
|
||||
data(){
|
||||
|
||||
@ -5,8 +5,9 @@ import http from "@/utils/request";
|
||||
export default {
|
||||
successCode: 200, //请求完成代码
|
||||
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"
|
||||
column_config:["condition","filter","fix","hide","is_search","label","prop","search_type","sort","sortable","width"],
|
||||
parseData: function (res) { //数据分析
|
||||
return {
|
||||
data: res.data, //分析无分页的数据字段结构
|
||||
|
||||
@ -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.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 .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;}
|
||||
@ -152,6 +154,7 @@
|
||||
.el-table.el-table--large {font-size: 14px;}
|
||||
.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 .cell_name{display: inline-block;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
|
||||
.el-table {font-size: 12px;}
|
||||
.el-radio-button__inner {font-size: 12px;}
|
||||
.el-checkbox-button__inner {font-size: 12px;}
|
||||
|
||||
@ -21,15 +21,15 @@
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<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" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
|
||||
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
||||
</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>
|
||||
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
||||
<template #logo="scope">
|
||||
@ -84,6 +84,7 @@
|
||||
|
||||
<script>
|
||||
import saveDialog from './save'
|
||||
import {eventBus} from "@/utils/eventBus";
|
||||
export default {
|
||||
name:"costFlow",
|
||||
components: {
|
||||
@ -104,54 +105,104 @@ export default {
|
||||
selection: [],
|
||||
exportShow:false,
|
||||
searchShow:false,
|
||||
searchList:[
|
||||
{name:'费用类型',type:'select',code:['type_name'], data:[], placeholder:"请选择费用类型",show:true},
|
||||
{name:'费用类别',type:'select',code:['category_name'], data:[], placeholder:"请选择费用类别",isOpen:true,show:false},
|
||||
{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},
|
||||
],
|
||||
searchHeaderShow:false,
|
||||
filterMap:{
|
||||
data:{}
|
||||
},
|
||||
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: {
|
||||
/** 检索开始 */
|
||||
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(){
|
||||
this.searchShow = !this.searchShow;
|
||||
this.searchList.forEach(item=>{
|
||||
if(item.isOpen){
|
||||
item.show = 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.params = params; // 列表需要的参数
|
||||
this.filterMap.data = params; // 表头组件需要转 才能传的参数
|
||||
let searchParams = this.$TOOL.objCopy(params);
|
||||
searchParams.field = ""
|
||||
if (typeof data.code === 'string') {
|
||||
searchParams.field = data.code;
|
||||
if (typeof data.prop === 'string') {
|
||||
searchParams.field = data.prop;
|
||||
} else {
|
||||
searchParams.field = data.code[0];
|
||||
searchParams.field = data.prop[0];
|
||||
}
|
||||
if (data.type == 'select') {
|
||||
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.code];
|
||||
})
|
||||
}
|
||||
this.searchList.forEach(item => {
|
||||
if (item.code == data.code) {
|
||||
item.data = res.data;
|
||||
}
|
||||
})
|
||||
}
|
||||
if (data.search_type == 'select' || data.search_type == 'checkbox') {
|
||||
await this.getField(data,searchParams)
|
||||
}
|
||||
},
|
||||
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(){
|
||||
@ -260,7 +311,9 @@ export default {
|
||||
},
|
||||
reset(){
|
||||
this.params = {};
|
||||
this.filterMap.data = {};
|
||||
this.$refs.scSearch.reload();
|
||||
eventBus.$emit('reset-popovers');
|
||||
this.$refs.table.reload();
|
||||
},
|
||||
handleSaveSuccess(){
|
||||
|
||||
@ -138,6 +138,11 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
provide(){
|
||||
return{
|
||||
columnHeaderParams:false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
linkRouter(item){
|
||||
let list = this.filterDataByItem(item,this.$TOOL.objCopy(this.routerList));
|
||||
|
||||
@ -102,6 +102,11 @@ export default {
|
||||
|
||||
}
|
||||
},
|
||||
provide(){
|
||||
return{
|
||||
columnHeaderParams:false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
linkRouter(item){
|
||||
let list = this.filterDataByItem(item,this.$TOOL.objCopy(this.routerList));
|
||||
|
||||
@ -12,15 +12,16 @@
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<div class="searchMain">
|
||||
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch>
|
||||
<div class="searchItem searchBtn">
|
||||
<div class="searchMain" :class="!searchHeaderShow?'emptySearchMain':''">
|
||||
<scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
|
||||
|
||||
<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="info" icon="el-icon-RefreshRight">重置</el-button>
|
||||
</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>
|
||||
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="150">
|
||||
@ -49,6 +50,7 @@
|
||||
|
||||
<script>
|
||||
import saveDialog from "./save"
|
||||
import {eventBus} from "@/utils/eventBus";
|
||||
export default {
|
||||
name: 'earlyManager',
|
||||
components: {
|
||||
@ -57,7 +59,6 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
size:'small',
|
||||
searchShow:false,
|
||||
dialog: {
|
||||
save: false,
|
||||
permission: false
|
||||
@ -67,36 +68,73 @@ export default {
|
||||
apiObj: this.$API.early.earlyWarn.list,
|
||||
column:[]
|
||||
},
|
||||
searchList:[
|
||||
{name:'日期',type:'date',code:'created_at',show:true},
|
||||
{name:'区域',type:'text',code:['region'],placeholder:"请选择区域",show:true},
|
||||
{name:'部件类别',type:'text',code:['part_category'],placeholder:"请输入部件类别",show:true},
|
||||
{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},
|
||||
],
|
||||
searchShow:false,
|
||||
searchHeaderShow:false,
|
||||
filterMap:{
|
||||
data:{}
|
||||
},
|
||||
selection: [],
|
||||
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: {
|
||||
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(){
|
||||
this.searchShow = !this.searchShow;
|
||||
this.searchList.forEach(item=>{
|
||||
if(item.isOpen){
|
||||
item.show = this.searchShow
|
||||
}
|
||||
})
|
||||
eventBus.$emit('close-all-popovers');
|
||||
},
|
||||
getHeaderData(params){
|
||||
this.params = params;
|
||||
this.filterMap.data = params;
|
||||
},
|
||||
async getSelectData(item) {
|
||||
let {params} = item;
|
||||
this.params = params;
|
||||
this.filterMap.data = params;
|
||||
},
|
||||
/** 表格检索结束 */
|
||||
|
||||
//添加
|
||||
add(){
|
||||
this.dialog.save = true
|
||||
|
||||
@ -67,7 +67,7 @@
|
||||
<div class="searchMain " style="padding-left: 10px;">
|
||||
<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" type="primary" icon="el-icon-search" @click="upSearch">查询</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:"", // 邮件数据同步
|
||||
emailId:'',
|
||||
searchShow:false,
|
||||
searchHeaderShow:false,
|
||||
searchData:{},
|
||||
searchList:[
|
||||
{name:'是否确认',type:'select',code:['is_confirm'],data:[],placeholder:"请选择",isOpen:true,show:false},
|
||||
@ -266,6 +267,20 @@ export default {
|
||||
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: {
|
||||
isAllDisabled() {
|
||||
let isDis = false;
|
||||
@ -468,6 +483,7 @@ export default {
|
||||
eventBus.$emit('tagClose','/order/view-mail',{id:this.emailId});
|
||||
},
|
||||
|
||||
/** 检索开始 */
|
||||
async getSelectData(item) {
|
||||
let {data, params} = item;
|
||||
this.searchData = params;
|
||||
@ -495,6 +511,8 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
/** 检索结束 */
|
||||
|
||||
searchShowClick(){
|
||||
this.searchShow = !this.searchShow;
|
||||
this.searchList.forEach(item=>{
|
||||
|
||||
@ -19,15 +19,15 @@
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<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" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
|
||||
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
||||
</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>
|
||||
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
||||
<template #logo="scope">
|
||||
@ -67,6 +67,8 @@
|
||||
|
||||
<script>
|
||||
|
||||
import {eventBus} from "@/utils/eventBus";
|
||||
|
||||
export default {
|
||||
name:"inventoryList",
|
||||
components: {
|
||||
@ -87,60 +89,106 @@ export default {
|
||||
selection: [],
|
||||
exportShow:false,
|
||||
searchShow:false,
|
||||
searchList:[
|
||||
{name:'仓库编码',type:'text',code:['f_stock_id'],placeholder:"请输入仓库编码",isOpen:true,show:true},
|
||||
{name:'计划跟踪号',type:'text',code:['f_mto_no'],placeholder:"请输入计划跟踪号",isOpen:true,show:false},
|
||||
{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},
|
||||
],
|
||||
searchHeaderShow:false,
|
||||
filterMap:{
|
||||
data:{}
|
||||
},
|
||||
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: {
|
||||
/**
|
||||
* 表格检索开始
|
||||
* */
|
||||
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(){
|
||||
this.searchShow = !this.searchShow;
|
||||
this.searchList.forEach(item=>{
|
||||
if(item.isOpen){
|
||||
item.show = 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.params = params; // 列表需要的参数
|
||||
this.filterMap.data = params; // 表头组件需要转 才能传的参数
|
||||
let searchParams = this.$TOOL.objCopy(params);
|
||||
searchParams.field = ""
|
||||
if (typeof data.code === 'string') {
|
||||
searchParams.field = data.code;
|
||||
if (typeof data.prop === 'string') {
|
||||
searchParams.field = data.prop;
|
||||
} else {
|
||||
searchParams.field = data.code[0];
|
||||
searchParams.field = data.prop[0];
|
||||
}
|
||||
if (data.type == 'select') {
|
||||
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.code];
|
||||
})
|
||||
}
|
||||
this.searchList.forEach(item => {
|
||||
if (item.code == data.code) {
|
||||
item.data = res.data;
|
||||
}
|
||||
})
|
||||
}
|
||||
if (data.search_type == 'select' || data.search_type == 'checkbox') {
|
||||
await this.getField(data,searchParams)
|
||||
}
|
||||
},
|
||||
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(){
|
||||
@ -248,7 +296,9 @@ export default {
|
||||
},
|
||||
reset(){
|
||||
this.params = {};
|
||||
this.filterMap.data = {};
|
||||
this.$refs.scSearch.reload();
|
||||
eventBus.$emit('reset-popovers');
|
||||
this.$refs.table.reload();
|
||||
},
|
||||
handleSaveSuccess(){
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<el-container class="mainBox mainHeaderNoBorderPadding">
|
||||
<el-header>
|
||||
<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">
|
||||
<template #header>
|
||||
<el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
||||
|
||||
@ -149,8 +149,6 @@ export default {
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.buttonRef = this.$refs.buttonRef;
|
||||
|
||||
// 获取新消息
|
||||
eventBus.$on('sockBack', this.getWsResult);
|
||||
this.getStatusList();
|
||||
|
||||
@ -10,22 +10,22 @@
|
||||
<flow :list="flowList"/>
|
||||
</div>
|
||||
<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" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
|
||||
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
||||
</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>
|
||||
<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 #schedule_date="scope">{{scope.row.repair_order && scope.row.repair_order.schedule_date?scope.row.repair_order.schedule_date:''}}</template>
|
||||
<template #repair_status="scope">
|
||||
<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)`}"
|
||||
v-if="item.value == scope.row.repair_order.repair_status">{{item.label}}</span>
|
||||
</span>
|
||||
@ -75,6 +75,9 @@ export default {
|
||||
{name:'确认工单',left:false,right:true},
|
||||
{name:'下发维保',left:true,right:false},
|
||||
],
|
||||
setMap:{
|
||||
statusList:[]
|
||||
},
|
||||
dialog: {
|
||||
confirm: false,
|
||||
show: false,
|
||||
@ -86,63 +89,128 @@ export default {
|
||||
selection: [],
|
||||
exportShow:false,
|
||||
searchShow:false,
|
||||
searchList:[
|
||||
{name:'维修单号',type:'text',code:'repair_order_no', data:[], placeholder:"请输入维修单号",show:true},
|
||||
{name:'故障类型',type:'select',code:['fault_type'], data:[], placeholder:"请选择故障类型",show:true},
|
||||
{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},
|
||||
],
|
||||
searchHeaderShow:false,
|
||||
filterMap:{
|
||||
data:{}
|
||||
},
|
||||
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() {
|
||||
this.getStatusList();
|
||||
},
|
||||
methods: {
|
||||
searchShowClick(){
|
||||
this.searchShow = !this.searchShow;
|
||||
this.searchList.forEach(item=>{
|
||||
if(item.isOpen){
|
||||
item.show = this.searchShow
|
||||
}
|
||||
})
|
||||
},
|
||||
async getStatusList() {
|
||||
const res = await this.$API.orders.order.repair.status.post();
|
||||
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) {
|
||||
let {data, params} = item;
|
||||
this.params = params;
|
||||
this.params = params; // 列表需要的参数
|
||||
this.filterMap.data = params; // 表头组件需要转 才能传的参数
|
||||
let searchParams = this.$TOOL.objCopy(params);
|
||||
searchParams.field = ""
|
||||
if (typeof data.code === 'string') {
|
||||
searchParams.field = data.code;
|
||||
if (typeof data.prop === 'string') {
|
||||
searchParams.field = data.prop;
|
||||
} else {
|
||||
searchParams.field = data.code[0];
|
||||
searchParams.field = data.prop[0];
|
||||
}
|
||||
if (data.type == 'select') {
|
||||
const res = await this.$API.orders.order.maintenance.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;
|
||||
if (data.search_type == 'select' || data.search_type == 'checkbox') {
|
||||
await this.getField(data,searchParams)
|
||||
}
|
||||
},
|
||||
async getField(data,searchParams) {
|
||||
const res = await this.$API.orders.order.maintenance.field.post(searchParams);
|
||||
if (res.code == 200) {
|
||||
if (res.data && res.data.length > 0) {
|
||||
res.data.forEach(item => {
|
||||
if (data.prop === 'repair_status') {
|
||||
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(){
|
||||
this.dialog.confirm = true;
|
||||
this.$nextTick(() => {
|
||||
@ -169,7 +237,9 @@ export default {
|
||||
},
|
||||
reset(){
|
||||
this.params = {};
|
||||
this.filterMap.data = {};
|
||||
this.$refs.scSearch.reload();
|
||||
eventBus.$emit('reset-popovers');
|
||||
this.$refs.table.reload();
|
||||
},
|
||||
handleSaveSuccess(){
|
||||
|
||||
@ -5,19 +5,19 @@
|
||||
<flow :list="flowList"/>
|
||||
</div>
|
||||
<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" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
|
||||
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
||||
</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>
|
||||
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
||||
<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)`}"
|
||||
v-if="item.value == scope.row.repair_status">{{item.label}}</span>
|
||||
</span>
|
||||
@ -71,6 +71,9 @@ export default {
|
||||
save: false,
|
||||
show: false,
|
||||
},
|
||||
setMap:{
|
||||
statusList:[],
|
||||
},
|
||||
list: {
|
||||
apiObj: this.$API.orders.order.repair.list,
|
||||
column: [],
|
||||
@ -78,19 +81,36 @@ export default {
|
||||
selection: [],
|
||||
exportShow:false,
|
||||
searchShow:false,
|
||||
searchList:[
|
||||
{name:'创建日期',type:'date',code:'created_at',show:true},
|
||||
{name:'维修单号',type:'text',code:'repair_order_no', data:[], placeholder:"请输入维修单号",show:true},
|
||||
{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},
|
||||
],
|
||||
searchHeaderShow:false,
|
||||
filterMap:{
|
||||
data:{}
|
||||
},
|
||||
params: {},
|
||||
statusList:[],
|
||||
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() {
|
||||
this.getStatusList();
|
||||
// 获取新消息
|
||||
@ -111,44 +131,94 @@ export default {
|
||||
async getStatusList() {
|
||||
const res = await this.$API.orders.order.repair.status.post();
|
||||
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){
|
||||
item.show = this.searchShow
|
||||
/**
|
||||
* 表格检索开始
|
||||
* */
|
||||
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) {
|
||||
let {data, params} = item;
|
||||
this.params = params;
|
||||
this.params = params; // 列表需要的参数
|
||||
this.filterMap.data = params; // 表头组件需要转 才能传的参数
|
||||
let searchParams = this.$TOOL.objCopy(params);
|
||||
searchParams.field = ""
|
||||
if (typeof data.code === 'string') {
|
||||
searchParams.field = data.code;
|
||||
if (typeof data.prop === 'string') {
|
||||
searchParams.field = data.prop;
|
||||
} else {
|
||||
searchParams.field = data.code[0];
|
||||
searchParams.field = data.prop[0];
|
||||
}
|
||||
if (data.type == 'select') {
|
||||
const res = await this.$API.orders.order.repair.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;
|
||||
if (data.search_type == 'select' || data.search_type == 'checkbox') {
|
||||
await this.getField(data,searchParams)
|
||||
}
|
||||
},
|
||||
async getField(data,searchParams) {
|
||||
const res = await this.$API.orders.order.repair.field.post(searchParams);
|
||||
if (res.code == 200) {
|
||||
if (res.data && res.data.length > 0) {
|
||||
res.data.forEach(item => {
|
||||
if (data.prop === 'repair_status') {
|
||||
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(){
|
||||
@ -189,13 +259,14 @@ export default {
|
||||
selectionChange(selection){
|
||||
this.selection = selection;
|
||||
},
|
||||
|
||||
upSearch(){
|
||||
this.$refs.table.upData(this.params);
|
||||
},
|
||||
reset(){
|
||||
this.params = {};
|
||||
this.filterMap.data = {};
|
||||
this.$refs.scSearch.reload();
|
||||
eventBus.$emit('reset-popovers');
|
||||
this.$refs.table.reload();
|
||||
},
|
||||
handleSaveSuccess(){
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<el-container class="mainBox mainHeaderNoBorderPadding">
|
||||
<el-header>
|
||||
<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">
|
||||
<template #header>
|
||||
<el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<el-container class="mainBox mainHeaderNoBorderPadding">
|
||||
<el-header>
|
||||
<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">
|
||||
<template #header>
|
||||
<el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
||||
|
||||
@ -46,6 +46,11 @@ export default {
|
||||
params: {},
|
||||
}
|
||||
},
|
||||
provide(){
|
||||
return{
|
||||
columnHeaderParams:false,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTypeList();
|
||||
},
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
<el-button :size="size" type="primary" @click="save">保存配置</el-button>
|
||||
</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>
|
||||
<el-table-column width="380" label="客户名称" prop="customer_name">
|
||||
<template #default="scope">
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
||||
</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 label="序号" align="center" type="index"></sc-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="160">
|
||||
@ -75,6 +75,11 @@ export default {
|
||||
],
|
||||
}
|
||||
},
|
||||
provide(){
|
||||
return{
|
||||
columnHeaderParams:false,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
</div>
|
||||
</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>
|
||||
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
||||
<template #region_name="scope">
|
||||
@ -70,6 +70,11 @@ export default {
|
||||
},
|
||||
}
|
||||
},
|
||||
provide(){
|
||||
return{
|
||||
columnHeaderParams:false,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getRegion();
|
||||
this.getRoom();
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
<span class="tip">注意:此配置由专业IT管理员操作;无配置时以系统默认定时任务配置为准。</span>
|
||||
</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>
|
||||
<el-table-column width="200" label="任务名称" prop="name"></el-table-column>
|
||||
<el-table-column width="200" label="任务描述" prop="memo"></el-table-column>
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
</div>
|
||||
</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>
|
||||
<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>
|
||||
|
||||
@ -20,15 +20,15 @@
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<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" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
|
||||
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
||||
</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>
|
||||
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
||||
<!-- <template #disable_status="scope">-->
|
||||
@ -62,6 +62,7 @@
|
||||
<script>
|
||||
import saveDialog from './save'
|
||||
import showDialog from './show'
|
||||
import {eventBus} from "@/utils/eventBus";
|
||||
export default {
|
||||
name:"bom",
|
||||
components: {
|
||||
@ -83,74 +84,107 @@ export default {
|
||||
selection: [],
|
||||
exportShow:false,
|
||||
searchShow:false,
|
||||
searchList:[
|
||||
{name:'创建时间',type:'date',code:'created_at',show: true},
|
||||
{name:'更新时间',type:'date',code:'updated_at',show: true},
|
||||
{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},
|
||||
],
|
||||
searchHeaderShow:false,
|
||||
filterMap:{
|
||||
data:{}
|
||||
},
|
||||
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() {
|
||||
|
||||
},
|
||||
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(){
|
||||
this.searchShow = !this.searchShow;
|
||||
this.searchList.forEach(item=>{
|
||||
if(item.isOpen){
|
||||
item.show = 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.params = params; // 列表需要的参数
|
||||
this.filterMap.data = params; // 表头组件需要转 才能传的参数
|
||||
let searchParams = this.$TOOL.objCopy(params);
|
||||
searchParams.field = ""
|
||||
if (typeof data.code === 'string') {
|
||||
searchParams.field = data.code;
|
||||
if (typeof data.prop === 'string') {
|
||||
searchParams.field = data.prop;
|
||||
} else {
|
||||
searchParams.field = data.code[0];
|
||||
searchParams.field = data.prop[0];
|
||||
}
|
||||
if (data.type == 'select' || data.type == 'multiple') {
|
||||
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.code];
|
||||
item.value = item.id;
|
||||
item.id = item[data.code];
|
||||
})
|
||||
}
|
||||
this.searchList.forEach(item => {
|
||||
if (item.code == data.code) {
|
||||
item.data = res.data;
|
||||
}
|
||||
})
|
||||
}
|
||||
if (data.search_type == 'select' || data.search_type == 'checkbox') {
|
||||
await this.getField(data,searchParams)
|
||||
}
|
||||
},
|
||||
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(){
|
||||
@ -249,7 +283,9 @@ export default {
|
||||
},
|
||||
reset(){
|
||||
this.params = {};
|
||||
this.filterMap.data = {};
|
||||
this.$refs.scSearch.reload();
|
||||
eventBus.$emit('reset-popovers');
|
||||
this.$refs.table.reload();
|
||||
},
|
||||
handleSaveSuccess(){
|
||||
|
||||
@ -20,15 +20,15 @@
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<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" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
|
||||
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
||||
</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>
|
||||
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
||||
<template #logo="scope">
|
||||
@ -85,6 +85,7 @@
|
||||
<script>
|
||||
import saveDialog from './save'
|
||||
import seeDialog from './see'
|
||||
import {eventBus} from "@/utils/eventBus";
|
||||
|
||||
export default {
|
||||
name:"company",
|
||||
@ -110,69 +111,127 @@ export default {
|
||||
selection: [],
|
||||
exportShow:false,
|
||||
searchShow:false,
|
||||
searchList:[
|
||||
{name:'开通日期',type:'date',code:'activation_date',show:true},
|
||||
{name:'公司类型',type:'select',code:['company_type'],isConstant:true, data:[], placeholder:"请选择公司类型",show:true},
|
||||
{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},
|
||||
],
|
||||
searchHeaderShow:false,
|
||||
filterMap:{
|
||||
data:{}
|
||||
},
|
||||
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.getCompanyTypeSelect();
|
||||
},
|
||||
methods: {
|
||||
searchShowClick(){
|
||||
this.searchShow = !this.searchShow;
|
||||
this.searchList.forEach(item=>{
|
||||
if(item.isOpen){
|
||||
item.show = this.searchShow
|
||||
/** 检索开始 */
|
||||
columnBack(val){
|
||||
val.forEach(item=>{
|
||||
if(item.prop === "company_type"){
|
||||
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) {
|
||||
let {data, params} = item;
|
||||
this.params = params;
|
||||
this.params = params; // 列表需要的参数
|
||||
this.filterMap.data = params; // 表头组件需要转 才能传的参数
|
||||
let searchParams = this.$TOOL.objCopy(params);
|
||||
searchParams.field = ""
|
||||
if (typeof data.code === 'string') {
|
||||
searchParams.field = data.code;
|
||||
if (typeof data.prop === 'string') {
|
||||
searchParams.field = data.prop;
|
||||
} else {
|
||||
searchParams.field = data.code[0];
|
||||
searchParams.field = data.prop[0];
|
||||
}
|
||||
if (data.type == 'select' || data.type == 'multiple') {
|
||||
const res = await this.$API.system.company.field.post(searchParams);
|
||||
if (res.code == 200) {
|
||||
if (res.data && res.data.length > 0) {
|
||||
res.data.forEach(item => {
|
||||
if(data.isConstant){
|
||||
item.label = item[data.code+'_display'];
|
||||
item.value = item[data.code];
|
||||
}else{
|
||||
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;
|
||||
if (data.search_type == 'select' || data.search_type == 'checkbox') {
|
||||
await this.getField(data,searchParams)
|
||||
}
|
||||
},
|
||||
async getField(data,searchParams) {
|
||||
const res = await this.$API.system.company.field.post(searchParams);
|
||||
if (res.code == 200) {
|
||||
if (res.data && res.data.length > 0) {
|
||||
res.data.forEach(item => {
|
||||
if (data.prop === 'company_type') {
|
||||
item.label = item[data.prop+'_display'];
|
||||
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;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
/** 检索结束 */
|
||||
|
||||
// 加载公司类型
|
||||
async getCompanyTypeSelect(){
|
||||
const res = await this.$API.system.company.typeSelect.post();
|
||||
if(res.code == 200){
|
||||
if(res.data.length>0){
|
||||
res.data.forEach(em=>{
|
||||
em.value = em.company_type
|
||||
})
|
||||
}
|
||||
this.setMap['companyType'] = res.data;
|
||||
}
|
||||
},
|
||||
@ -319,7 +378,9 @@ export default {
|
||||
},
|
||||
reset(){
|
||||
this.params = {};
|
||||
this.filterMap.data = {};
|
||||
this.$refs.scSearch.reload();
|
||||
eventBus.$emit('reset-popovers');
|
||||
this.$refs.table.reload();
|
||||
},
|
||||
handleSaveSuccess(){
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
<template>
|
||||
<el-container class="mainBox mainBoxHeaderNoBorder">
|
||||
<el-main class="nopadding">
|
||||
<div class="searchMain">
|
||||
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch>
|
||||
<div class="searchItem searchBtn">
|
||||
<div class="searchMain logSearchMain">
|
||||
<scTableSearch ref="scSearch" :searchList="list.column" :paramsData="params" :searchShow="searchShow" @fetchSelectData="getSelectData" @changeHeaderData="getHeaderData"></scTableSearch>
|
||||
|
||||
<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="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
||||
</div>
|
||||
@ -13,8 +15,13 @@
|
||||
</scExport>
|
||||
</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>
|
||||
<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>
|
||||
</el-main>
|
||||
</el-container>
|
||||
@ -26,6 +33,7 @@
|
||||
|
||||
<script>
|
||||
import info from '../info'
|
||||
import {eventBus} from "@/utils/eventBus";
|
||||
export default {
|
||||
components: {
|
||||
info,
|
||||
@ -34,9 +42,9 @@ export default {
|
||||
return {
|
||||
size:"small",
|
||||
setMap:{
|
||||
name:[]
|
||||
name:[],
|
||||
typeList:[]
|
||||
},
|
||||
|
||||
infoDrawer: false,
|
||||
date: [],
|
||||
list:{
|
||||
@ -44,36 +52,141 @@ export default {
|
||||
column:[]
|
||||
},
|
||||
exportShow:false,
|
||||
searchList:[
|
||||
{name:'操作日期',type:'date',code:'created_at',show:true},
|
||||
{name:'操作功能',type:'multiple',code:'type', data:[], placeholder:"请选择功能",show:true},
|
||||
{name:'关键字',type:'text',code:['remark','ip','location','creator_name'],keyword:true,show:true},
|
||||
],
|
||||
searchShow:false,
|
||||
searchHeaderShow:false,
|
||||
filterMap:{
|
||||
data:{}
|
||||
},
|
||||
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: {
|
||||
getSelectData(item){
|
||||
let {data,params} = item;
|
||||
this.params = params;
|
||||
if(data.code == "type"){
|
||||
this.getTypeList(data,params)
|
||||
/**
|
||||
* 表格检索开始
|
||||
* */
|
||||
columnBack(val){
|
||||
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) {
|
||||
const res = await this.$API.system.log.operation.post(params);
|
||||
if(res.code == 200){
|
||||
res.data.forEach(item=>{
|
||||
item.id = item.type;
|
||||
item.label = item.log_title;
|
||||
})
|
||||
this.searchList.forEach(item=>{
|
||||
if(item.code == data.code){
|
||||
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;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
/** 表格检索结束 */
|
||||
|
||||
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){
|
||||
if(params.type == 8){
|
||||
@ -93,7 +206,9 @@ export default {
|
||||
},
|
||||
reset(){
|
||||
this.params = {};
|
||||
this.filterMap.data = {};
|
||||
this.$refs.scSearch.reload();
|
||||
eventBus.$emit('reset-popovers');
|
||||
this.$refs.table.reload();
|
||||
},
|
||||
rowClick(row){
|
||||
|
||||
@ -51,6 +51,11 @@ export default {
|
||||
params: {},
|
||||
}
|
||||
},
|
||||
provide(){
|
||||
return{
|
||||
columnHeaderParams:false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getSelectData(item){
|
||||
let {params} = item;
|
||||
|
||||
@ -21,15 +21,15 @@
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<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" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
|
||||
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
||||
</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>
|
||||
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="150">
|
||||
@ -59,6 +59,7 @@
|
||||
|
||||
<script>
|
||||
import infoSave from "../infoSave"
|
||||
import {eventBus} from "@/utils/eventBus";
|
||||
export default {
|
||||
name: "info",
|
||||
components:{
|
||||
@ -79,59 +80,140 @@ export default {
|
||||
column:[]
|
||||
},
|
||||
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,
|
||||
searchShow:false,
|
||||
searchHeaderShow:false,
|
||||
filterMap:{
|
||||
data:{}
|
||||
},
|
||||
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() {
|
||||
|
||||
},
|
||||
methods:{
|
||||
searchShowClick(){
|
||||
this.searchShow = !this.searchShow;
|
||||
this.searchList.forEach(item=>{
|
||||
if(item.isOpen){
|
||||
item.show = this.searchShow
|
||||
/** 检索开始 */
|
||||
columnBack(val){
|
||||
val.forEach(item=>{
|
||||
if(item.prop === "company_type"){
|
||||
item.data = this.setMap.companyType;
|
||||
}
|
||||
})
|
||||
this.list.column = val;
|
||||
},
|
||||
async getSelectData(item){
|
||||
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) {
|
||||
let {data, params} = item;
|
||||
this.params = params; // 列表需要的参数
|
||||
this.filterMap.data = params; // 表头组件需要转 才能传的参数
|
||||
let searchParams = this.$TOOL.objCopy(params);
|
||||
searchParams.field = ""
|
||||
if (typeof data.code === 'string') {
|
||||
searchParams.field = data.code;
|
||||
if (typeof data.prop === 'string') {
|
||||
searchParams.field = data.prop;
|
||||
} else {
|
||||
searchParams.field = data.code[0];
|
||||
searchParams.field = data.prop[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;
|
||||
}
|
||||
})
|
||||
}
|
||||
if (data.search_type == 'select' || data.search_type == 'checkbox') {
|
||||
await this.getField(data,searchParams)
|
||||
}
|
||||
},
|
||||
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(){
|
||||
@ -242,7 +324,9 @@ export default {
|
||||
},
|
||||
reset(){
|
||||
this.params = {};
|
||||
this.filterMap.data = {};
|
||||
this.$refs.scSearch.reload();
|
||||
eventBus.$emit('reset-popovers');
|
||||
this.$refs.table.reload();
|
||||
},
|
||||
|
||||
|
||||
@ -21,15 +21,15 @@
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<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" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
|
||||
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
||||
</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>
|
||||
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="150">
|
||||
@ -59,6 +59,7 @@
|
||||
|
||||
<script>
|
||||
import librarySave from "../librarySave";
|
||||
import {eventBus} from "@/utils/eventBus";
|
||||
export default {
|
||||
name: "library",
|
||||
components:{
|
||||
@ -79,61 +80,114 @@ export default {
|
||||
column:[]
|
||||
},
|
||||
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,
|
||||
searchShow:false,
|
||||
searchHeaderShow:false,
|
||||
filterMap:{
|
||||
data:{}
|
||||
},
|
||||
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() {
|
||||
|
||||
},
|
||||
methods:{
|
||||
searchShowClick(){
|
||||
this.searchShow = !this.searchShow;
|
||||
this.searchList.forEach(item=>{
|
||||
if(item.isOpen){
|
||||
item.show = this.searchShow
|
||||
/** 检索开始 */
|
||||
columnBack(val){
|
||||
val.forEach(item=>{
|
||||
if(item.prop === "company_type"){
|
||||
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) {
|
||||
let {data, params} = item;
|
||||
this.params = params;
|
||||
this.params = params; // 列表需要的参数
|
||||
this.filterMap.data = params; // 表头组件需要转 才能传的参数
|
||||
let searchParams = this.$TOOL.objCopy(params);
|
||||
searchParams.field = ""
|
||||
if (typeof data.code === 'string') {
|
||||
searchParams.field = data.code;
|
||||
if (typeof data.prop === 'string') {
|
||||
searchParams.field = data.prop;
|
||||
} else {
|
||||
searchParams.field = data.code[0];
|
||||
searchParams.field = data.prop[0];
|
||||
}
|
||||
if (data.type == 'select') {
|
||||
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.code];
|
||||
})
|
||||
}
|
||||
this.searchList.forEach(item => {
|
||||
if (item.code == data.code) {
|
||||
item.data = res.data;
|
||||
}
|
||||
})
|
||||
}
|
||||
if (data.search_type == 'select' || data.search_type == 'checkbox') {
|
||||
await this.getField(data,searchParams)
|
||||
}
|
||||
},
|
||||
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(){
|
||||
@ -239,7 +293,9 @@ export default {
|
||||
},
|
||||
reset(){
|
||||
this.params = {};
|
||||
this.filterMap.data = {};
|
||||
this.$refs.scSearch.reload();
|
||||
eventBus.$emit('reset-popovers');
|
||||
this.$refs.table.reload();
|
||||
},
|
||||
|
||||
|
||||
@ -186,6 +186,11 @@
|
||||
this.$refs.group.filter(val);
|
||||
}
|
||||
},
|
||||
provide(){
|
||||
return{
|
||||
columnHeaderParams:false,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getGroup()
|
||||
this.auditStatus();
|
||||
|
||||
@ -56,22 +56,13 @@
|
||||
</scTable>
|
||||
</el-main>
|
||||
</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>
|
||||
|
||||
<script>
|
||||
// import saveDialog from './save'
|
||||
// import permissionDialog from './permission'
|
||||
|
||||
export default {
|
||||
name: 'warehouse',
|
||||
components: {
|
||||
// saveDialog,
|
||||
// permissionDialog
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<el-container class="mainBox mainHeaderNoBorderPadding">
|
||||
<el-header>
|
||||
<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">
|
||||
<template #header>
|
||||
<el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
||||
@ -81,7 +81,7 @@ export default {
|
||||
show: false,
|
||||
},
|
||||
list: {
|
||||
apiObj: this.$API.shipment.out.list,
|
||||
apiObj: {},
|
||||
column: [],
|
||||
},
|
||||
selection: [],
|
||||
|
||||
@ -2,15 +2,15 @@
|
||||
<el-container class="mainBox mainBoxHeaderNoBorder">
|
||||
<el-main class="nopadding">
|
||||
<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" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
|
||||
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
||||
</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>
|
||||
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
||||
<template #logo="scope">
|
||||
@ -50,6 +50,8 @@
|
||||
|
||||
<script>
|
||||
|
||||
import {eventBus} from "@/utils/eventBus";
|
||||
|
||||
export default {
|
||||
name:"shipmentList",
|
||||
components: {
|
||||
@ -69,56 +71,118 @@ export default {
|
||||
selection: [],
|
||||
exportShow:false,
|
||||
searchShow:false,
|
||||
searchList:[
|
||||
{name:'实体主键',type:'text',code:['f_id'],placeholder:"请输入实体主键",isOpen:true,show:false},
|
||||
{name:'单据编号',type:'text',code:['f_bill_no'],placeholder:"请输入单据编号",isOpen:true,show:false},
|
||||
{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},
|
||||
],
|
||||
searchHeaderShow:false,
|
||||
filterMap:{
|
||||
data:{}
|
||||
},
|
||||
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: {
|
||||
searchShowClick(){
|
||||
this.searchShow = !this.searchShow;
|
||||
this.searchList.forEach(item=>{
|
||||
if(item.isOpen){
|
||||
item.show = this.searchShow
|
||||
/** 检索开始 */
|
||||
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) {
|
||||
let {data, params} = item;
|
||||
this.params = params;
|
||||
this.params = params; // 列表需要的参数
|
||||
this.filterMap.data = params; // 表头组件需要转 才能传的参数
|
||||
let searchParams = this.$TOOL.objCopy(params);
|
||||
searchParams.field = ""
|
||||
if (typeof data.code === 'string') {
|
||||
searchParams.field = data.code;
|
||||
if (typeof data.prop === 'string') {
|
||||
searchParams.field = data.prop;
|
||||
} else {
|
||||
searchParams.field = data.code[0];
|
||||
searchParams.field = data.prop[0];
|
||||
}
|
||||
if (data.type == 'select') {
|
||||
const res = await this.$API.orders.order.out.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;
|
||||
if (data.search_type == 'select' || data.search_type == 'checkbox') {
|
||||
await this.getField(data,searchParams)
|
||||
}
|
||||
},
|
||||
async getField(data,searchParams) {
|
||||
const res = await this.$API.orders.order.out.field.post(searchParams);
|
||||
if (res.code == 200) {
|
||||
if (res.data && res.data.length > 0) {
|
||||
res.data.forEach(item => {
|
||||
if (data.prop === 'repair_status') {
|
||||
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(){
|
||||
@ -244,7 +308,9 @@ export default {
|
||||
},
|
||||
reset(){
|
||||
this.params = {};
|
||||
this.filterMap.data = {};
|
||||
this.$refs.scSearch.reload();
|
||||
eventBus.$emit('reset-popovers');
|
||||
this.$refs.table.reload();
|
||||
},
|
||||
handleSaveSuccess(){
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<el-container class="mainBox mainHeaderNoBorderPadding">
|
||||
<el-header>
|
||||
<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">
|
||||
<template #header>
|
||||
<el-button v-auth="'organizationImport'" type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
<template>
|
||||
<el-card class="logCard" shadow="never" header="操作日志">
|
||||
<el-main class="nopadding">
|
||||
<div class="searchMain">
|
||||
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch>
|
||||
<div class="searchMain logSearchMain">
|
||||
<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="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
||||
</div>
|
||||
@ -14,8 +15,13 @@
|
||||
</scExport>
|
||||
</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>
|
||||
<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>
|
||||
</el-main>
|
||||
</el-card>
|
||||
@ -27,6 +33,7 @@
|
||||
|
||||
<script>
|
||||
import info from '../../setting/log/info'
|
||||
import {eventBus} from "@/utils/eventBus";
|
||||
export default {
|
||||
components:{
|
||||
info
|
||||
@ -34,51 +41,156 @@
|
||||
data() {
|
||||
return {
|
||||
size:"small",
|
||||
setMap:{
|
||||
typeList:[]
|
||||
},
|
||||
list:{
|
||||
apiObj: this.$API.user.log,
|
||||
column: [],
|
||||
},
|
||||
infoDrawer: false,
|
||||
exportShow:false,
|
||||
|
||||
searchList:[
|
||||
{name:'操作日期',type:'date',code:'created_at'},
|
||||
{name:'操作功能',type:'multiple',code:'type', data:[], placeholder:"请选择功能",show:true},
|
||||
{name:'关键字',type:'text',code:['remark','ip','location','creator_name'],keyword:true,show:true},
|
||||
],
|
||||
searchShow:false,
|
||||
searchHeaderShow:false,
|
||||
filterMap:{
|
||||
data:{}
|
||||
},
|
||||
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.getTypeData();
|
||||
},
|
||||
methods:{
|
||||
getSelectData(item){
|
||||
let {data,params} = item;
|
||||
this.params = params;
|
||||
if(data.code == "type"){
|
||||
this.getTypeList(data,params)
|
||||
}
|
||||
/**
|
||||
* 表格检索开始
|
||||
* */
|
||||
columnBack(val){
|
||||
val.forEach(item=>{
|
||||
if(item.prop === "type"){
|
||||
item.data = this.setMap.typeList;
|
||||
}
|
||||
})
|
||||
this.list.column = val;
|
||||
},
|
||||
async getTypeList(data,params) {
|
||||
let objData = this.$TOOL.objCopy(params);
|
||||
objData.creator_id = {
|
||||
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]
|
||||
};
|
||||
const res = await this.$API.system.log.operation.post(objData);
|
||||
if(res.code == 200){
|
||||
res.data.forEach(item=>{
|
||||
item.id = item.type;
|
||||
item.label = item.log_title;
|
||||
})
|
||||
this.searchList.forEach(item=>{
|
||||
if(item.code == data.code){
|
||||
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) {
|
||||
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;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
/** 表格检索结束 */
|
||||
|
||||
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){
|
||||
if(params.type == 34){
|
||||
@ -97,7 +209,9 @@
|
||||
},
|
||||
reset(){
|
||||
this.params = {};
|
||||
this.filterMap.data = {};
|
||||
this.$refs.scSearch.reload();
|
||||
eventBus.$emit('reset-popovers');
|
||||
this.$refs.table.reload();
|
||||
},
|
||||
rowClick(row){
|
||||
|
||||
Loading…
Reference in New Issue
Block a user