|
@@ -67,15 +67,23 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
+
|
|
|
+
|
|
|
<script setup>
|
|
|
import { ref, getCurrentInstance, onMounted } from "vue";
|
|
|
-import { showSuccessToast, showFailToast } from "vant";
|
|
|
+import {
|
|
|
+ showSuccessToast,
|
|
|
+ showFailToast,
|
|
|
+ showDialog,
|
|
|
+ showConfirmDialog,
|
|
|
+} from "vant";
|
|
|
import { useRoute } from "vue-router";
|
|
|
import { getUserInfo } from "@/utils/auth";
|
|
|
const proxy = getCurrentInstance().proxy;
|
|
|
const route = useRoute();
|
|
|
const showPicker = ref(false);
|
|
|
const typeModal = ref(false);
|
|
|
+
|
|
|
const formData = ref({
|
|
|
name: null,
|
|
|
type: null,
|
|
@@ -137,6 +145,20 @@ const onConfirm = ({ selectedOptions }) => {
|
|
|
|
|
|
const onClickLeft = () => history.back();
|
|
|
|
|
|
+const warehouseDelete = () => {
|
|
|
+ showConfirmDialog({
|
|
|
+ title: "提示",
|
|
|
+ message: "您确定删除本条数据吗?",
|
|
|
+ }).then(() => {
|
|
|
+ proxy.post("/warehouse/delete", { id: route.query.id }).then((res) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ showSuccessToast("删除成功");
|
|
|
+ proxy.$router.push("/main/warehouseConfig");
|
|
|
+ }, 500);
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
const onSubmit = () => {
|
|
|
proxy
|
|
|
.post("/warehouse/" + (!route.query.id ? "add" : "edit"), formData.value)
|