|
@@ -2,7 +2,7 @@
|
|
|
<div class="table-box">
|
|
|
<LjVxeTable
|
|
|
ref="VxeTableRef"
|
|
|
- row-key="springid"
|
|
|
+ row-key="billcode"
|
|
|
:columns="columns"
|
|
|
:request-api="getData"
|
|
|
:data-callback="dataCallback"
|
|
@@ -16,7 +16,7 @@
|
|
|
<!-- 表格 header 按钮 -->
|
|
|
<template #tableHeader>
|
|
|
<el-button-group>
|
|
|
- <el-button>解锁</el-button>
|
|
|
+ <el-button @click="handleUnLock">解锁</el-button>
|
|
|
</el-button-group>
|
|
|
</template>
|
|
|
</LjVxeTable>
|
|
@@ -29,6 +29,9 @@ import { getLockBillList } from "@/api/modules/basicinfo";
|
|
|
import { ColumnProps } from "@/components/LjVxeTable/interface";
|
|
|
import { useI18n } from "vue-i18n";
|
|
|
import { useAuthButtons } from "@/hooks/useAuthButtons";
|
|
|
+import { UnLockBill } from "@/api/modules/common";
|
|
|
+import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
+import { getCurrentRecords } from "@/utils/index";
|
|
|
|
|
|
const dwname = "web_lock_table";
|
|
|
const tableProps = {
|
|
@@ -36,10 +39,11 @@ const tableProps = {
|
|
|
editConfig: { trigger: "click", mode: "cell" }
|
|
|
};
|
|
|
|
|
|
+const VxeTableRef = ref();
|
|
|
const { t } = useI18n();
|
|
|
const { CheckPower, CheckOption, buttonNew, buttonDefault } = useAuthButtons(t);
|
|
|
const columns = ref<ColumnProps<any>[]>([
|
|
|
- { type: "checkbox", width: 40, fixed: "left" },
|
|
|
+ // { type: "checkbox", width: 40, fixed: "left" },
|
|
|
{
|
|
|
field: "pid",
|
|
|
title: "序",
|
|
@@ -119,6 +123,33 @@ const dataCallback = (data: any) => {
|
|
|
};
|
|
|
};
|
|
|
|
|
|
+const handleUnLock = () => {
|
|
|
+ const { curRecords } = getCurrentRecords(VxeTableRef.value);
|
|
|
+ if (!curRecords.length) {
|
|
|
+ ElMessage.warning(t("business.tips.mattress.records"));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ElMessageBox.confirm("是否确定要解锁吗?", "询问", {
|
|
|
+ confirmButtonText: "是",
|
|
|
+ cancelButtonText: "否",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ curRecords.forEach(element => {
|
|
|
+ UnLockBill(element).then(() => {
|
|
|
+ ElMessage.success("解锁成功!");
|
|
|
+ VxeTableRef?.value.refresh();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ ElMessage({
|
|
|
+ type: "info",
|
|
|
+ message: "操作取消"
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
// 返回绑定的事件
|
|
|
const tableEvents = {
|
|
|
// "cell-dblclick": handleDBlClickTable
|