驾驶舱&基础信息配置
This commit is contained in:
@@ -22,22 +22,28 @@
|
||||
|
||||
<script>
|
||||
import GroupKeyAdd from './components/groupKeyAdd.vue';
|
||||
import { getImportantWorkConfigPage,delImportantWorkConfig } from '@/api/basicInfoConfig';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import moment from 'moment';
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'name',
|
||||
prop: 'importantWork',
|
||||
label: '重点工作'
|
||||
},
|
||||
{
|
||||
prop: 'code1',
|
||||
label: '单位'
|
||||
prop: 'unit',
|
||||
label: '单位',
|
||||
filter: publicFormatter('lb_dw')
|
||||
},
|
||||
{
|
||||
prop: 'code',
|
||||
label: '所属年份'
|
||||
prop: 'time',
|
||||
label: '所属年份',
|
||||
filter: (val) => val ? moment(val).format('YYYY') : '-'
|
||||
},
|
||||
{
|
||||
prop: 'jd',
|
||||
label: '累计值计算方式'
|
||||
prop: 'calculateMethod',
|
||||
label: '累计值计算方式',
|
||||
filter: publicFormatter('important_work_method')
|
||||
},
|
||||
];
|
||||
export default {
|
||||
@@ -50,7 +56,7 @@ export default {
|
||||
type: 'input',
|
||||
label: '重点工作',
|
||||
placeholder: '重点工作',
|
||||
param: 'cName'
|
||||
param: 'importantWork'
|
||||
},
|
||||
{
|
||||
type: 'datePicker',
|
||||
@@ -59,7 +65,7 @@ export default {
|
||||
format: 'yyyy',
|
||||
valueFormat: 'yyyy',
|
||||
placeholder: '所属年份',
|
||||
param: 'searchTime1',
|
||||
param: 'time',
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
@@ -80,11 +86,13 @@ export default {
|
||||
}
|
||||
],
|
||||
listQuery:{
|
||||
importantWork:'',
|
||||
time:'',
|
||||
pageSize:20,
|
||||
pageNo:1
|
||||
},
|
||||
total:2,
|
||||
tableData:[{name:'111'}],
|
||||
total:0,
|
||||
tableData:[],
|
||||
tableProps,
|
||||
tableBtn:[
|
||||
{
|
||||
@@ -101,13 +109,19 @@ export default {
|
||||
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$refs.searchBarForm.formInline.time = moment().endOf('year').endOf('month').endOf('day').format('YYYY-MM-DD HH:mm:ss')
|
||||
this.listQuery.time = moment().endOf('year').endOf('month').endOf('day').format('YYYY-MM-DD HH:mm:ss')
|
||||
this.getDataList();
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
console.log(val)
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.importantWork = val.importantWork;
|
||||
this.listQuery.time = val.time ? moment(val.time).endOf('year').endOf('month').endOf('day').format('YYYY-MM-DD HH:mm:ss') : '';
|
||||
this.listQuery.pageNo = 1;
|
||||
this.getList();
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'add':
|
||||
this.addOrEditTitle = '新增';
|
||||
@@ -119,7 +133,15 @@ export default {
|
||||
}
|
||||
},
|
||||
getDataList() {
|
||||
|
||||
getImportantWorkConfigPage({...this.listQuery}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.list;
|
||||
this.total = res.data.total;
|
||||
}else{
|
||||
this.tableData = [];
|
||||
this.total = 0;
|
||||
}
|
||||
})
|
||||
},
|
||||
handleClick(val) {
|
||||
switch (val.type) {
|
||||
@@ -144,14 +166,16 @@ export default {
|
||||
},
|
||||
successSubmit() {
|
||||
this.handleCancel();
|
||||
this.getList();
|
||||
this.getDataList();
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal.confirm('确定删除重点工作"' + row.name + '吗?').then(function() {
|
||||
deleteModel(row.id).then(response => {
|
||||
that.getList();
|
||||
that.$modal.msgSuccess("删除成功");
|
||||
let _this = this;
|
||||
_this.$modal.confirm('确定删除重点工作"' + row.importantWork + '吗?').then(function() {
|
||||
delImportantWorkConfig({id:row.id}).then(response => {
|
||||
_this.$modal.msgSuccess("删除成功");
|
||||
_this.getDataList();
|
||||
|
||||
})
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user