This commit is contained in:
wangyan 2024-05-16 17:41:32 +08:00
parent d71695d328
commit 2fbf53f986

View File

@ -3,9 +3,30 @@
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input
v-model="searchObj.projectId"
clearable
placeholder="项目编号"
style="width: 200px;"
class="filter-item"
/>
<el-input
v-model="searchObj.projectName"
clearable
placeholder="项目简称"
style="width: 200px;"
class="filter-item"
/>
<el-input
v-model="searchObj.projectLongName"
clearable
placeholder="项目名称"
class="filter-item"
style="width: 200px"
/>
<el-date-picker
v-model="searchObj.value1"
class="filter-item el-range-editor--small"
style="width:400px"
type="datetimerange"
format="yyyy-MM-dd HH:mm"
@ -16,6 +37,7 @@
<el-date-picker
v-model="searchObj.value2"
class="filter-item el-range-editor--small"
style="width:400px"
type="datetimerange"
format="yyyy-MM-dd HH:mm"
@ -29,7 +51,7 @@
type="success"
icon="el-icon-search"
@click="searchBtn"
>搜索</el-button
>搜索</el-button
>
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
@ -39,10 +61,11 @@
type="primary"
icon="el-icon-plus"
@click="handleLinkAdd"
>新增</el-button
>新增</el-button
>
</div>
<!-- 导出 -->
<!-- 导出 -->
</el-input>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd" />
@ -118,14 +141,14 @@
size="mini"
type="text"
@click="$refs[scope.row.id].doClose()"
>取消</el-button
>取消</el-button
>
<el-button
:loading="delLoading"
type="primary"
size="mini"
@click="subDelete(scope.row.id)"
>确定</el-button
>确定</el-button
>
</div>
<el-button
@ -151,11 +174,11 @@
</template>
<script>
import Pagination from "@/components/Pagination";
import checkPermission from "@/utils/permission";
import initData from "@/mixins/initData";
import { del, downloadBiddingInfo, list } from "@/api/biddingInfo";
import eForm from "./form";
import Pagination from '@/components/Pagination'
import checkPermission from '@/utils/permission'
import initData from '@/mixins/initData'
import { del, downloadBiddingInfo, list } from '@/api/biddingInfo'
import eForm from './form'
export default {
components: { eForm, Pagination },
mixins: [initData],
@ -169,139 +192,149 @@ export default {
},
delLoading: false,
queryTypeOptions: [
{ key: "projectId", display_name: "项目编号" },
{ key: "projectName", display_name: "项目简称" },
{ key: "projectLongName", display_name: "项目名称" }
{ key: 'projectId', display_name: '项目编号' },
{ key: 'projectName', display_name: '项目简称' },
{ key: 'projectLongName', display_name: '项目名称' }
]
};
}
},
created() {
this.getList();
this.getList()
},
methods: {
getList(
registrationDeadlineStartDate = "",
registrationDeadlineEndDate = "",
biddingDateTimeStartDate = "",
biddingDateTimeEndDate = ""
registrationDeadlineStartDate = '',
registrationDeadlineEndDate = '',
biddingDateTimeStartDate = '',
biddingDateTimeEndDate = ''
) {
const { projectId, projectName, projectLongName } = this.searchObj
const obj = {
page: this.listQuery.page - 1,
size: this.listQuery.limit,
registrationDeadlineStartDate,
registrationDeadlineEndDate,
biddingDateTimeStartDate,
biddingDateTimeEndDate
};
biddingDateTimeEndDate,
projectId,
projectName,
projectLongName
}
list(obj).then(res => {
// console.log(res);
this.list = res.content;
this.total = res.totalElements;
});
this.list = res.content
this.total = res.totalElements
})
},
paginations(item) {
// console.log(item);
this.listQuery.page = item.page;
this.listQuery.limit = item.limit;
const time = this.searchObj.value1;
const biddingDateTimeStartDate = time[0] ? time[0] : "";
const biddingDateTimeEndDate = time[1] ? time[1] : "";
const time2 = this.searchObj.value2;
const registrationDeadlineStartDate = time2[0] ? time2[0] : "";
const registrationDeadlineEndDate = time2[1] ? time2[1] : "";
this.listQuery.page = item.page
this.listQuery.limit = item.limit
const { projectId, projectName, projectLongName } = this.searchObj
const time = this.searchObj.value1
const biddingDateTimeStartDate = time[0] ? time[0] : ''
const biddingDateTimeEndDate = time[1] ? time[1] : ''
const time2 = this.searchObj.value2
const registrationDeadlineStartDate = time2[0] ? time2[0] : ''
const registrationDeadlineEndDate = time2[1] ? time2[1] : ''
this.getList(
registrationDeadlineStartDate,
registrationDeadlineEndDate,
biddingDateTimeStartDate,
biddingDateTimeEndDate
);
biddingDateTimeEndDate,
projectId,
projectName,
projectLongName
)
},
searchBtn() {
const time = this.searchObj.value1;
const biddingDateTimeStartDate = time ? time[0] : "";
const biddingDateTimeEndDate = time ? time[1] : "";
const time2 = this.searchObj.value2;
const registrationDeadlineStartDate = time2 ? time2[0] : "";
const registrationDeadlineEndDate = time2 ? time2[1] : "";
const time = this.searchObj.value1
const biddingDateTimeStartDate = time ? time[0] : ''
const biddingDateTimeEndDate = time ? time[1] : ''
const time2 = this.searchObj.value2
const registrationDeadlineStartDate = time2 ? time2[0] : ''
const registrationDeadlineEndDate = time2 ? time2[1] : ''
const { projectId, projectName, projectLongName } = this.searchObj
this.getList(
registrationDeadlineStartDate,
registrationDeadlineEndDate,
biddingDateTimeStartDate,
biddingDateTimeEndDate
);
biddingDateTimeEndDate,
projectId,
projectName,
projectLongName
)
},
handleLinkAdd() {
localStorage.setItem("editData", null);
this.$router.push({ path: "create" });
localStorage.setItem('editData', null)
this.$router.push({ path: 'create' })
},
handleLinkDetail(scope) {
localStorage.setItem("date", JSON.stringify(scope.row));
localStorage.setItem('date', JSON.stringify(scope.row))
this.$router.push({
path: "/newproject/bidding/detail",
path: '/newproject/bidding/detail',
query: {
source: 0
}
});
})
},
checkPermission,
beforeInit() {
this.url = "api/biddingInfo";
const sort = "id,desc";
this.params = { page: this.page, size: this.size, sort: sort };
const query = this.query;
const type = query.type;
const value = query.value;
this.url = 'api/biddingInfo'
const sort = 'id,desc'
this.params = { page: this.page, size: this.size, sort: sort }
const query = this.query
const type = query.type
const value = query.value
if (type && value) {
this.params[type] = value;
this.params[type] = value
}
return true;
return true
},
subDelete(id) {
this.delLoading = true;
this.delLoading = true
del(id)
.then(res => {
this.delLoading = false;
this.$refs[id].doClose();
this.dleChangePage();
this.getList();
this.delLoading = false
this.$refs[id].doClose()
this.dleChangePage()
this.getList()
this.$notify({
title: "删除成功",
type: "success",
title: '删除成功',
type: 'success',
duration: 2500
});
})
})
.catch(err => {
this.delLoading = false;
this.$refs[id].doClose();
console.log(err.response.data.message);
});
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},
add() {
this.isAdd = true;
this.$refs.form.dialog = true;
this.isAdd = true
this.$refs.form.dialog = true
},
edit(scope) {
localStorage.setItem("editData", JSON.stringify(scope.row));
this.$router.push("/newproject/bidding/create");
localStorage.setItem('editData', JSON.stringify(scope.row))
this.$router.push('/newproject/bidding/create')
},
//
download() {
this.beforeInit();
this.downloadLoading = true;
this.beforeInit()
this.downloadLoading = true
downloadBiddingInfo(this.params)
.then(result => {
downloadFile(result, "BiddingInfo列表", "xlsx");
this.downloadLoading = false;
downloadFile(result, 'BiddingInfo列表', 'xlsx')
this.downloadLoading = false
})
.catch(() => {
this.downloadLoading = false;
});
this.downloadLoading = false
})
}
}
};
}
</script>
<style scoped></style>