emis-frontend/src/views/emis/emisNotCalcAging/index.vue

422 lines
14 KiB
Vue
Raw Normal View History

2024-01-10 07:38:42 +00:00
<template>
<div class="app-container">
2024-01-12 12:08:57 +00:00
<el-row :gutter="20" type='flex'>
2024-04-22 05:33:25 +00:00
<!-- <el-col :span="4" :xs="4" style="border-right:1px solid rgb(248 249 251);">
<CountryTreePicker placeholder="所属国家" v-model="queryParams.country"></CountryTreePicker>
</el-col> -->
<el-col :span="24" :xs="24">
<SearchForm :model="queryParams" ref="queryForm" size="small" :maxShow="3" label-width="68px" v-show="showSearch" @search="handleQuery" @reset="resetQuery">
<el-form-item label="国家" prop="country" label-width="40px">
<CountryPicker :placeholder="$t('国家')" v-model="queryParams.country" @onChange="handleQuery"></CountryPicker>
</el-form-item>
<el-form-item label="时效不计算日期" label-width="150px" prop="noCalcDay">
<elDateSimplePicker placeholder="日期范围" v-model="daterangeNoCalcDay"></elDateSimplePicker>
</el-form-item>
2024-01-10 07:38:42 +00:00
2024-04-22 05:33:25 +00:00
</SearchForm>
2024-01-10 07:38:42 +00:00
2024-04-22 05:33:25 +00:00
<XdTable
v-loading="loading"
border
stripe
2024-01-10 07:38:42 +00:00
size="mini"
2024-04-22 05:33:25 +00:00
:data="emisNotCalcAgingList"
:showSearch.sync="showSearch"
:total="total"
@queryTable="getList"
:queryParams="queryParams"
@selection-change="handleSelectionChange"
@sort-change="handleSortChange"
>
<div slot="toolbar">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['emis:emisNotCalcAging:add']"
>新增</el-button>
</el-col>
<!--
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['emis:emisNotCalcAging:edit']"
>修改</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['emis:emisNotCalcAging:remove']"
>删除</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['emis:emisNotCalcAging:export']"
>导出</el-button>
</el-col> -->
</el-row>
</div>
2024-01-10 07:38:42 +00:00
<el-table-column type="selection" width="55" align="center" />
2024-01-12 12:08:57 +00:00
<el-table-column label="日期" align="left" prop="noCalcDay" min-width="180">
2024-01-10 07:38:42 +00:00
<template slot-scope="scope">
2024-01-11 07:07:28 +00:00
<div class="link-type" @click="handleUpdate(scope.row)">{{scope.row.noCalcDay}}</div>
2024-01-10 07:38:42 +00:00
</template>
</el-table-column>
2024-04-22 05:33:25 +00:00
<el-table-column label="国家" align="center" prop="countryName" min-width="100" >
<template slot-scope="scope">
<span v-if="scope.row.country=='-1'">全部国家</span>
<span v-else>{{scope.row.countryName}}</span>
</template>
</el-table-column>
2024-01-11 07:07:28 +00:00
<el-table-column label="启用状态" align="center" prop="status" min-width="100" >
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
2024-04-22 05:33:25 +00:00
:active-value="1"
:inactive-value="0"
2024-01-11 07:07:28 +00:00
@change="handleStatusChange(scope.row)"
></el-switch>
</template>
</el-table-column>
2024-01-12 12:08:57 +00:00
<el-table-column label="创建时间" align="center" prop="createTime" min-width="100" />
2024-01-10 07:38:42 +00:00
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['emis:emisNotCalcAging:edit']"
>修改</el-button>
</template>
</el-table-column>
2024-04-22 05:33:25 +00:00
</XdTable>
2024-01-10 07:38:42 +00:00
2024-04-22 05:33:25 +00:00
<el-dialog :title="titleForm" :visible.sync="openForm" width="50%" :destroy-on-close="true" append-to-body>
2024-01-10 07:38:42 +00:00
<emisNotCalcAgingForm :id="currentId" @on-changed="handleFormChanged" @on-cancel="cancelForm"></EmisNotCalcAgingForm>
</el-dialog>
2024-01-12 12:08:57 +00:00
</el-col>
</el-row>
2024-01-10 07:38:42 +00:00
</div>
</template>
<script>
2024-01-12 12:08:57 +00:00
import { listEmisNotCalcAging, getEmisNotCalcAging, delEmisNotCalcAging, addEmisNotCalcAging, updateEmisNotCalcAging,changeCalcStatus } from "@/api/emis/emisNotCalcAging";
2024-01-10 07:38:42 +00:00
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
import emisNotCalcAgingForm from '@/views/emis/emisNotCalcAging/emisNotCalcAgingForm';
2024-04-22 05:33:25 +00:00
import CountryTreePicker from '@/views/emis/EmisBaseTools/CountryTreePicker.vue';
import CountryPicker from '@/views/emis/EmisBaseTools/CountryPicker.vue';
2024-01-10 07:38:42 +00:00
export default {
name: "emisNotCalcAging",
2024-04-22 05:33:25 +00:00
components: { elDateSimplePicker,CountryPicker,CountryTreePicker,emisNotCalcAgingForm },
2024-01-10 07:38:42 +00:00
dicts: [
'sys_normal_disable',
],
data() {
return {
// 遮罩层
loading: true,
2024-01-12 12:08:57 +00:00
currentId:null,
2024-01-10 07:38:42 +00:00
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 创建时间搜索
dateTimeRange:[],
// 总条数
total: 0,
// 不计时效维护表格数据
emisNotCalcAgingList: [],
2024-01-12 12:08:57 +00:00
countryTree:[],
countryIdsOptions:[],
2024-01-10 07:38:42 +00:00
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
openForm: false,
titleForm: "",
titleEmisNotCalcAging: "",
openEmisNotCalcAging: false,
// 显示编辑框更多
moreInputVisible: false,
// 弹出展示层
id:null,
2024-01-12 12:08:57 +00:00
defaultProps: {
children: "children",
label: "label"
},
2024-01-10 07:38:42 +00:00
titleView:"",
openView: false,
// 备注时间范围
2024-01-11 06:38:10 +00:00
daterangeNoCalcDay: [],
2024-01-10 07:38:42 +00:00
// 备注时间范围
daterangeCreateTime: [],
// 备注时间范围
daterangeUpdateTime: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
country: null,
2024-01-11 06:38:10 +00:00
noCalcDay: null,
status: null,
remark: null,
2024-01-10 07:38:42 +00:00
},
2024-01-12 12:08:57 +00:00
countryName:null,
2024-01-10 07:38:42 +00:00
// 表单参数
form: {},
// 表单校验
rules: {
2024-01-11 06:38:10 +00:00
country: [
{ required: true, message: "所属国家,可能多个国家,逗号隔开不能为空", trigger: "blur" }
2024-01-10 07:38:42 +00:00
],
2024-01-11 06:38:10 +00:00
noCalcDay: [
{ required: true, message: "不计时效日期不能为空", trigger: "blur" }
],
status: [
{ required: true, message: "启用状态不能为空", trigger: "blur" }
2024-01-10 07:38:42 +00:00
],
}
};
},
2024-01-12 12:08:57 +00:00
watch: {
// 根据名称筛选部门树
countryName(val) {
this.$refs.tree.filter(val);
}
},
2024-01-10 07:38:42 +00:00
created() {
this.getList();
},
methods: {
2024-01-12 12:08:57 +00:00
handleStatusChange(row) {
2024-04-22 05:33:25 +00:00
let text = row.status == "1" ? "启用" : "停用";
this.$modal.confirm('确认要"' + text + '"不计算时效吗?').then(function() {
2024-01-12 12:08:57 +00:00
//改变线路的启用状态
return changeCalcStatus(row.id, row.status);
}).then(() => {
this.$modal.msgSuccess(text + "成功");
}).catch(function() {
2024-04-22 05:33:25 +00:00
// row.status = row.status === "" ? "1" : "0";
2024-01-12 12:08:57 +00:00
});
},
2024-01-10 07:38:42 +00:00
/** 查询不计时效维护列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
2024-04-22 05:33:25 +00:00
console.log(this.daterangeNoCalcDay);
2024-01-11 06:38:10 +00:00
if (null != this.daterangeNoCalcDay && '' != this.daterangeNoCalcDay) {
this.queryParams.params["beginNoCalcDay"] = this.daterangeNoCalcDay[0];
this.queryParams.params["endNoCalcDay"] = this.daterangeNoCalcDay[1];
2024-01-10 07:38:42 +00:00
}
2024-04-22 05:33:25 +00:00
// if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
// this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0];
// this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
// }
// if (null != this.daterangeUpdateTime && '' != this.daterangeUpdateTime) {
// this.queryParams.params["beginUpdateTime"] = this.daterangeUpdateTime[0];
// this.queryParams.params["endUpdateTime"] = this.daterangeUpdateTime[1];
// }
2024-01-10 07:38:42 +00:00
listEmisNotCalcAging(this.addDateRange(this.queryParams, this.dateTimeRange)).then(response => {
this.emisNotCalcAgingList = response.rows;
this.total = response.total;
this.loading = false;
});
},
2024-01-12 12:08:57 +00:00
2024-04-22 05:33:25 +00:00
2024-01-10 07:38:42 +00:00
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
2024-04-22 05:33:25 +00:00
},
// 排序 查询字段是表格中字段名字 动态取值排序顺序
handleSortChange(column) {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
this.getList();
2024-01-10 07:38:42 +00:00
},
/** 新增按钮操作 */
handleAdd(row) {
2024-04-22 05:33:25 +00:00
this.currentId=null;
this.openForm= true;
this.titleForm= "新增";
2024-01-10 07:38:42 +00:00
},
handleShowMoreInput(){
this.moreInputVisible = !this.moreInputVisible;
},
/** 修改按钮操作 */
handleUpdate(row) {
2024-04-22 05:33:25 +00:00
this.currentId=row.id;
this.openForm= true;
this.titleForm= "修改";
2024-01-10 07:38:42 +00:00
},
handleView(row) {
this.id=row.id;
this.titleView="查看";
this.openView=true;
// this.router.push({ path: '/emis/emisNotCalcAging/viewDetail', query: { id: row.id }})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
2024-01-14 13:16:36 +00:00
var country = "";
this.form.country.map((res) => {
country+=res+",";
});
if (country.charAt(country.length - 1) === ",") {
country = country.slice(0, -1);
}
this.form.country = country;
2024-01-10 07:38:42 +00:00
if (this.form.id != null) {
updateEmisNotCalcAging(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addEmisNotCalcAging(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
handleFormChanged(){
this.openForm = false;
this.getList();
},
cancelForm(){
this.openForm = false;
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除').then(function() {
return delEmisNotCalcAging(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
// this.download('emis/emisNotCalcAging/export', {
// ...this.queryParams
// }, `emisNotCalcAging_${new Date().getTime()}.xlsx`)
const loadingInstance = this.$loading({
text: '正在导出...'
})
var qParam = {...this.queryParams};
qParam.pageNum=1;
qParam.pageSize=5000;
listEmisNotCalcAging(this.addDateRange(qParam, this.dateTimeRange)).then(response => {
this.downloadLoading = false
if (response.code === 200) {
const curList = response.rows
import('@/vendor/Export2Excel').then(excel => {
2024-01-11 06:38:10 +00:00
const tHeader = ['序号','所属国家,可能多个国家,逗号隔开','不计时效日期','启用状态','备注','租户ID','删除标志(0代表存在','创建者','创建时间','更新者','更新时间',];
const filterVal = ['id','country','noCalcDay','status','remark','tenantId','delFlag','createBy','createTime','updateBy','updateTime',];
2024-01-10 07:38:42 +00:00
const data = this.formatJson(filterVal, curList, response.rows)
excel.export_json_to_excel({
header: tHeader,
data,
filename: '不计时效维护',
autoWidth: true
})
loadingInstance.close()
})
}
});
},
formatJson(filterVal, jsonData, resData) {
let index = 0
return jsonData.map(v => filterVal.map(j => {
if (j === 'index') {
return ++index
}
if (j === 'status') {
var statusStr='xxx'
if(v[j] == 10){
statusStr='xxx'
}
return statusStr;
}
return v[j]
}))
},
/** 列索引函数 */
getIndex($index) {
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
},
/** 时间搜索响应函数 */
dateTimeChange(value){
this.dateTimeRange=value;
},
}
};
</script>
<style scoped>
.el-divider{
margin-top: 0px;
background: 0 0;
border-top: 1px solid #E6EBF5;
}
.el-divider__text {
color: #0955ee;
cursor: pointer;
}
</style>