|
@@ -14,25 +14,25 @@
|
|
|
<template v-if="f.type === 'input'">
|
|
<template v-if="f.type === 'input'">
|
|
|
<el-input clearable v-model.trim="searchDataClone[f.prop]" size="small" :placeholder="'请输入'+f.label"></el-input>
|
|
<el-input clearable v-model.trim="searchDataClone[f.prop]" size="small" :placeholder="'请输入'+f.label"></el-input>
|
|
|
</template>
|
|
</template>
|
|
|
- <template v-else-if="f.type === 'select'">
|
|
|
|
|
|
|
+ <template v-else-if="f.type === 'company'">
|
|
|
<el-select size="small" clearable v-model="searchDataClone[f.prop]" :placeholder="'请输入'+f.label">
|
|
<el-select size="small" clearable v-model="searchDataClone[f.prop]" :placeholder="'请输入'+f.label">
|
|
|
<el-option label="不限" value v-if="f.selectAuto"></el-option>
|
|
<el-option label="不限" value v-if="f.selectAuto"></el-option>
|
|
|
<el-option
|
|
<el-option
|
|
|
- v-for="(s, i) in f.options"
|
|
|
|
|
|
|
+ v-for="(s, i) in InsCompanyList"
|
|
|
:key="i"
|
|
:key="i"
|
|
|
- :label="s.label"
|
|
|
|
|
- :value="s.value"
|
|
|
|
|
|
|
+ :label="s.name"
|
|
|
|
|
+ :value="s.id"
|
|
|
></el-option>
|
|
></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</template>
|
|
</template>
|
|
|
- <template v-else-if="f.type === 'company'">
|
|
|
|
|
|
|
+ <template v-else-if="f.type === 'select'">
|
|
|
<el-select size="small" clearable v-model="searchDataClone[f.prop]" :placeholder="'请输入'+f.label">
|
|
<el-select size="small" clearable v-model="searchDataClone[f.prop]" :placeholder="'请输入'+f.label">
|
|
|
<el-option label="不限" value v-if="f.selectAuto"></el-option>
|
|
<el-option label="不限" value v-if="f.selectAuto"></el-option>
|
|
|
<el-option
|
|
<el-option
|
|
|
- v-for="(s, i) in InsCompanyList"
|
|
|
|
|
|
|
+ v-for="(s, i) in f.options"
|
|
|
:key="i"
|
|
:key="i"
|
|
|
- :label="s.name"
|
|
|
|
|
- :value="s.id"
|
|
|
|
|
|
|
+ :label="s.label"
|
|
|
|
|
+ :value="s.value"
|
|
|
></el-option>
|
|
></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</template>
|
|
</template>
|
|
@@ -63,8 +63,8 @@
|
|
|
></el-date-picker>
|
|
></el-date-picker>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else-if="f.type === 'radio'">
|
|
<template v-else-if="f.type === 'radio'">
|
|
|
- <el-radio-group v-model="searchDataClone[f.prop]">
|
|
|
|
|
- <el-radio v-for="(r, i) in f.radioList" :key="i" :label="r.value">{{r.label}}</el-radio>
|
|
|
|
|
|
|
+ <el-radio-group v-model="searchDataClone[f.prop]" :placeholder="'请输入'+f.label">
|
|
|
|
|
+ <el-radio v-for="(r, i) in f.radioList" :key="i" :label="r.value" >{{r.label}}</el-radio>
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</template>
|
|
</template>
|
|
|
</template>
|
|
</template>
|
|
@@ -93,7 +93,7 @@
|
|
|
v-loading="tableConfig.loading"
|
|
v-loading="tableConfig.loading"
|
|
|
element-loading-text="数据加载中"
|
|
element-loading-text="数据加载中"
|
|
|
element-loading-spinner="el-icon-loading"
|
|
element-loading-spinner="el-icon-loading"
|
|
|
- @selection-change="handleTableCurrentChange"
|
|
|
|
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
:row-style="{ height: '55px' }"
|
|
:row-style="{ height: '55px' }"
|
|
|
:cell-style="{ padding: '0px' }"
|
|
:cell-style="{ padding: '0px' }"
|
|
|
:header-cell-style="{ background: '#F2F7FC', fontWeight: '700', color: '#606266' }"
|
|
:header-cell-style="{ background: '#F2F7FC', fontWeight: '700', color: '#606266' }"
|
|
@@ -114,10 +114,15 @@
|
|
|
<span>{{ selectDictLabel(dictData[item.dic], scope.row[item.prop]) }}</span>
|
|
<span>{{ selectDictLabel(dictData[item.dic], scope.row[item.prop]) }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
+ <el-table-column v-if="item.type === 'statMap'" :align="'center'" :width="item.width || ''" :fixed="item.fixed" show-overflow-tooltip :label="item.label" :key="item.prop" :prop="item.prop">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span> {{ statMaps(item.options)[scope.row[item.prop]] || '--' }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<!-- 自定义内容 -->
|
|
<!-- 自定义内容 -->
|
|
|
<slot v-if="item.type ==='slot'" show-overflow-tooltip :name="item.name"></slot>
|
|
<slot v-if="item.type ==='slot'" show-overflow-tooltip :name="item.name"></slot>
|
|
|
<!-- 常规文本内容 -->
|
|
<!-- 常规文本内容 -->
|
|
|
- <el-table-column v-else :align="'center'" :width="item.width || ''" :fixed="item.fixed" :label="item.label" :key="item.prop" :prop="item.prop"></el-table-column>
|
|
|
|
|
|
|
+ <el-table-column v-if="item.type ==='text'" :align="'center'" :width="item.width || ''" :fixed="item.fixed" :label="item.label" :key="item.prop" :prop="item.prop"></el-table-column>
|
|
|
|
|
|
|
|
</template>
|
|
</template>
|
|
|
<!-- <slot name="operate" :row="scope.row"></slot> -->
|
|
<!-- <slot name="operate" :row="scope.row"></slot> -->
|
|
@@ -141,7 +146,7 @@
|
|
|
<el-table-column v-if="tableConfig.optBtns" :min-width="tableConfig.operationWidth || '100'" label="操作" fixed="right" header-align="center" align="center" >
|
|
<el-table-column v-if="tableConfig.optBtns" :min-width="tableConfig.operationWidth || '100'" label="操作" fixed="right" header-align="center" align="center" >
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<span v-for="(btn, index) in tableConfig.optBtns" :key="index">
|
|
<span v-for="(btn, index) in tableConfig.optBtns" :key="index">
|
|
|
- <el-button style="margin:0 10px" v-permission="btn.perm" @click="btn.click(scope.row, index)" :type="btn.type ||'primary'" :icon="btn.icon" size="small">{{ btn.label }} </el-button>
|
|
|
|
|
|
|
+ <el-button style="margin:0 10px" v-if="btn.hide(scope.row)" v-permission="btn.perm" @click="btn.click(scope.row, index)" :type="btn.type ||'primary'" :icon="btn.icon" size="small">{{ btn.label }} </el-button>
|
|
|
</span>
|
|
</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -223,6 +228,15 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ formatDateTime(date) {
|
|
|
|
|
+ let d = new Date(date),
|
|
|
|
|
+ month = '' + (d.getMonth() + 1),
|
|
|
|
|
+ day = '' + d.getDate(),
|
|
|
|
|
+ year = d.getFullYear();
|
|
|
|
|
+ if (month.length < 2) month = '0' + month;
|
|
|
|
|
+ if (day.length < 2) day = '0' + day;
|
|
|
|
|
+ return [year, month, day].join('-');
|
|
|
|
|
+ },
|
|
|
companyFun(){
|
|
companyFun(){
|
|
|
this.$api.cost.gainTopList().then(res => {
|
|
this.$api.cost.gainTopList().then(res => {
|
|
|
if (res.data) {
|
|
if (res.data) {
|
|
@@ -230,6 +244,14 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ statMaps(list) {
|
|
|
|
|
+ if (!list) return;
|
|
|
|
|
+ let obj = {};
|
|
|
|
|
+ list.forEach(item => {
|
|
|
|
|
+ obj[item.value || item.id] = item.label || item.value;
|
|
|
|
|
+ });
|
|
|
|
|
+ return obj;
|
|
|
|
|
+ },
|
|
|
selectDictLabel(dicts, value) {
|
|
selectDictLabel(dicts, value) {
|
|
|
if (value === undefined) {
|
|
if (value === undefined) {
|
|
|
return '';
|
|
return '';
|
|
@@ -250,12 +272,8 @@ export default {
|
|
|
return actions.join('');
|
|
return actions.join('');
|
|
|
},
|
|
},
|
|
|
// 表格多选
|
|
// 表格多选
|
|
|
- selectionChange(e) {
|
|
|
|
|
- this.$emit("selectionChange", e);
|
|
|
|
|
- },
|
|
|
|
|
- // 单选
|
|
|
|
|
- handleTableCurrentChange(currentRow) {
|
|
|
|
|
- this.$emit('changeCurrent', currentRow);
|
|
|
|
|
|
|
+ handleSelectionChange(currentRow) {
|
|
|
|
|
+ this.$emit('selectionChange', currentRow);
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
handleSizeChange(value) {
|
|
handleSizeChange(value) {
|