Authored by 李奇

差异工单列表修改

... ... @@ -29,8 +29,10 @@
},
created() {
this.diffService = new DiffService();
this.$Loading.start();
this.diffService.detail({id: +this.id})
.then(res => {
this.$Loading.finish();
let fields = [{
label: '主题:',
value: 'subject'
... ...
... ... @@ -6,7 +6,7 @@
:placeholder="filters.subject.holder"></Input>
</filter-item>
<filter-item :label="filters.emergency.label">
<Select v-model.trim="filters.emergency.model">
<Select v-model.trim="filters.emergency.model" clearable>
<Option v-for="option in filters.emergency.options"
:value="option.value"
:key="option.value">{{option.label}}</Option>
... ... @@ -16,15 +16,15 @@
<select-brand v-model="filters.brand.model"></select-brand>
</filter-item>
<filter-item :label="filters.status.label">
<Select v-model.trim="filters.status.model">
<Select v-model.trim="filters.status.model" clearable>
<Option v-for="option in filters.status.options"
:value="option.value"
:key="option.value">{{option.label}}</Option>
</Select>
</filter-item>
<filter-item>
<Button type="primary" @click="filterSearch">筛选</Button>
<Button @click="clearFilter">清空条件</Button>
<Button type="primary" @click="doSearch">筛选</Button>
<Button @click="reset">清空条件</Button>
</filter-item>
</layout-filter>
... ... @@ -37,9 +37,9 @@
</template>
<script>
import _ from 'lodash';
import {list as diffList} from './store';
import {DiffService} from 'services/repository';
import {SelectBrand} from 'components/select';
export default {
data() {
... ... @@ -47,32 +47,78 @@ export default {
},
created() {
this.DiffService = new DiffService();
this.DiffService.list()
.then(res => {
this.$Loading.finish();
this.dataList = res.data.records;
});
this.search(this.params());
},
methods: {
clearFilter() {
search(params) {
this.$Loading.start();
this.DiffService.list(params)
.then(res => {
this.$Loading.finish();
this.dataList = res.data.records;
this.page.total = res.data.totalCount;
}, () => {
this.$Loading.finish();
});
},
filterSearch() {
params() {
const defVal = {
pageNo: 1,
pageSize: 20,
statuses: [3, 21, 22]
};
const keyMap = {
brandId: 'brand',
statuses: 'status',
subject: 'subject',
emergencyDegree: 'emergency'
};
if (this.enableFilter) {
let model;
_.each(keyMap, (val, key) => {
model = this.filters[val].model;
if (('' + model).length) {
if (key === 'statuses') {
defVal[key] = [model];
} else {
defVal[key] = model;
}
}
});
}
return defVal;
},
pageChange() {
reset() {
_.each(this.filters, item => {
item.model = '';
});
this.page.current = 1;
this.enableFilter = false;
this.search(this.params());
},
doSearch() {
this.enableFilter = true;
this.search(this.params());
},
goDetail(id) {
pageChange(no) {
let params;
params = this.params();
params.pageNo = no;
this.search(params);
this.page.current = no;
},
toDetail(id) {
this.$router.push({
query: {
id
},
query: { id },
name: 'repository.diff.detail',
});
}
},
components: {
SelectBrand
}
};
</script>
... ...
... ... @@ -29,7 +29,11 @@ export default function() {
{
title: '品牌经理',
align: 'center',
key: 'claimName'
render(h, params) {
return (
<span>{params.row.claimName || '-'}</span>
);
}
},
{
title: '状态',
... ... @@ -42,16 +46,17 @@ export default function() {
render: (h, params) => {
return (
<i-button type="success" size="small"
onClick={() => this.goDetail(params.row.id)}>查看</i-button>
onClick={() => this.toDetail(params.row.id)}>查看</i-button>
);
}
}
],
dataList: [],
page: {
total: 0,
totalPage: 0,
current: 1
},
enableFilter: false,
filters: {
subject: {
label: '主题',
... ... @@ -62,15 +67,15 @@ export default function() {
model: '',
options: [
{
value: 1,
value: 3,
label: '一般'
},
{
value: 2,
value: 1,
label: '特别紧急'
},
{
value: 3,
value: 2,
label: '紧急'
},
{
... ... @@ -88,15 +93,15 @@ export default function() {
model: '',
options: [
{
value: 1,
value: 3,
label: '完成'
},
{
value: 2,
value: 21,
label: '处理中-待确认'
},
{
value: 3,
value: 22,
label: '处理中-已确认'
}
]
... ...