|
@@ -0,0 +1,67 @@
|
|
|
+<script>
|
|
|
+import { deleteApplies } from "@/api/requisition/basic";
|
|
|
+export default {
|
|
|
+ name: "PiLiangShanChu",
|
|
|
+ props: {
|
|
|
+ selectData: {
|
|
|
+ type: Array,
|
|
|
+ default: () => [],
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ title: "批量删除",
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ disabled: {
|
|
|
+ get() {
|
|
|
+ let { selectData } = this.$props;
|
|
|
+ // 单据状态:0-自由态;3-已驳回;9-已回退
|
|
|
+ let delStatus = ["0", "3", "9"];
|
|
|
+ if (selectData.length > 0) {
|
|
|
+ let del = selectData.filter(
|
|
|
+ (item) => delStatus.findIndex((d) => d == item.status) === -1
|
|
|
+ );
|
|
|
+ return del.length > 0;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ },
|
|
|
+ set() {},
|
|
|
+ },
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async onClick() {
|
|
|
+ this.$confirm("确认批量删除?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(async () => {
|
|
|
+ try {
|
|
|
+ this.$modal.loading("处理中...");
|
|
|
+ let ids = this.$props.selectData.map((item) => item.id);
|
|
|
+ console.log(ids, "ids");
|
|
|
+ let { code, msg } = await deleteApplies({ ids });
|
|
|
+ if (code == 200) {
|
|
|
+ this.$notify.success({ message: msg });
|
|
|
+ this.$emit("success");
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ } finally {
|
|
|
+ this.$modal.closeLoading();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ // this.$emit("success");
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+};
|
|
|
+</script>
|
|
|
+<template>
|
|
|
+ <el-button @click="onClick" :disabled="disabled" :size="$attrs.size">
|
|
|
+ {{ title }}
|
|
|
+ </el-button>
|
|
|
+</template>
|