123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- <template>
- <div class="page-container list-container">
- <!-- 功能按钮区 -->
- <div class="list-btns-container">
- <el-button
- type="primary"
- size="small"
- icon="Finished"
- :disabled="multiple"
- @click="handleUpdate"
- v-hasPermi="['business:bin:restore']"
- >还原</el-button
- >
- <el-button
- type="danger"
- size="small"
- icon="Delete"
- :disabled="multiple"
- @click="handleDelete"
- v-hasPermi="['business:bin:remove']"
- >删除</el-button
- >
- <el-button
- type="info"
- size="small"
- icon="Download"
- @click="handleExport"
- v-hasPermi="['business:bin:export']"
- >导出</el-button
- >
- <!--<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>-->
- </div>
- <!-- 搜索区 -->
- <el-form
- class="list-search-container"
- size="small"
- :model="queryParams"
- ref="queryRef"
- :inline="true"
- label-width="68px"
- >
- <el-form-item label="客户名称:" prop="sourceTableName">
- <el-input
- v-model="queryParams.sourceValue"
- placeholder="请输入客户名称"
- style="width: 150px"
- clearable
- @keyup.enter="handleQuery"
- />
- </el-form-item>
- <el-form-item>
- <el-button type="primary" icon="Search" @click="handleQuery"
- >搜索</el-button
- >
- <el-button icon="Refresh" @click="resetQuery">重置</el-button>
- </el-form-item>
- </el-form>
- <!-- 列表区 -->
- <el-table
- v-loading="loading"
- :data="binList"
- size="small"
- border
- height="100%"
- @selection-change="handleSelectionChange"
- >
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column label="客户名称" align="center" prop="sourceValue" />
- <el-table-column label="合同编号" align="center" prop="archiveCode" />
- <!-- <el-table-column label="来源表" align="center" prop="sourceTableName" /> -->
- <el-table-column
- label="操作"
- align="center"
- class-name="small-padding fixed-width"
- >
- <template #default="scope">
- <el-button
- link
- type="primary"
- size="small"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['business:bin:restore']"
- >还原</el-button
- >
- <el-button
- link
- type="danger"
- size="small"
- @click="handleDelete(scope.row)"
- v-hasPermi="['business:bin:remove']"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <!-- 分页 -->
- <pagination
- v-show="total > 0"
- :total="total"
- v-model:page="queryParams.pageNum"
- v-model:limit="queryParams.pageSize"
- @pagination="getList"
- />
- <!-- 表单 -->
- <bin-form ref="binRef" :get-list="getList"></bin-form>
- </div>
- </template>
- <script setup name="Bin">
- import { listBin, delBin, restoreArchiveBin } from "@/api/business/bin";
- import binForm from "./form";
- const { proxy } = getCurrentInstance();
- /** 字典数组区 */
- /** 查询 对象 */
- const binList = ref([]);
- const loading = ref(true);
- const ids = ref([]);
- const single = ref(true);
- const multiple = ref(true);
- const total = ref(0);
- /** 查询对象 */
- const queryParams = ref({
- pageNum: 1,
- pageSize: 20,
- orderByColumn: "create_time",
- sourceTableName: "biz_archive_input",
- sourceValue: null,
- isClean: null,
- isReturn: null,
- });
- /*********************** 方法区 ****************************/
- /** 查询回收站列表 */
- function getList() {
- loading.value = true;
- listBin(queryParams.value).then((response) => {
- binList.value = response.rows;
- total.value = response.total;
- loading.value = false;
- });
- }
- /** 搜索按钮操作 */
- function handleQuery() {
- queryParams.value.pageNum = 1;
- getList();
- }
- /** 重置按钮操作 */
- function resetQuery() {
- proxy.resetForm("queryRef");
- handleQuery();
- }
- // 多选框选中数据
- function handleSelectionChange(selection) {
- ids.value = selection.map((item) => item.id);
- single.value = selection.length != 1;
- multiple.value = !selection.length;
- }
- /** 新增按钮操作 */
- function handleAdd() {
- proxy.$refs.binRef.open();
- }
- /** 修改按钮操作 */
- function handleUpdate(row) {
- const _ids = row.id || ids.value;
- proxy.$modal
- .confirm("是否确认还原选中的数据项?")
- .then(function () {
- loading.value = true;
- return restoreArchiveBin(_ids);
- })
- .then(() => {
- getList();
- proxy.$modal.msgSuccess("还原成功!");
- })
- .catch(() => {});
- }
- /** 删除按钮操作 */
- function handleDelete(row) {
- const _ids = row.id || ids.value;
- proxy.$modal
- .confirm("删除数据项后不可恢复,是否确认删除选中的数据项?")
- .then(function () {
- return delBin(_ids);
- })
- .then(() => {
- getList();
- proxy.$modal.msgSuccess("删除成功!");
- })
- .catch(() => {});
- }
- /** 导出按钮操作 */
- function handleExport() {
- proxy.download(
- "business/bin/export",
- {
- ...queryParams.value,
- },
- `bin_${new Date().getTime()}.xlsx`
- );
- }
- getList();
- </script>
|