From a563ea879ef5fb6897e76d2df661e465dce2ab9b Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期一, 01 六月 2026 15:02:27 +0800
Subject: [PATCH] Merge branch 'dev_新疆_大罗素马铃薯new' of http://114.132.189.42:9002/r/product-inventory-management into dev_新疆_大罗素马铃薯new
---
src/views/salesManagement/returnOrder/index.vue | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 219 insertions(+), 0 deletions(-)
diff --git a/src/views/salesManagement/returnOrder/index.vue b/src/views/salesManagement/returnOrder/index.vue
new file mode 100644
index 0000000..0a8257b
--- /dev/null
+++ b/src/views/salesManagement/returnOrder/index.vue
@@ -0,0 +1,219 @@
+<template>
+ <div class="app-container">
+ <div class="search_form">
+ <el-form :model="searchForm" class="demo-form-inline" :inline="true">
+ <el-form-item label="閫�璐у崟鍙�">
+ <el-input v-model="searchForm.returnNo" placeholder="璇疯緭鍏ラ��璐у崟鍙�" clearable />
+ </el-form-item>
+ <el-form-item label="瀹㈡埛鍚嶇О">
+ <el-input v-model="searchForm.customerName" placeholder="瀹㈡埛鍚嶇О" clearable />
+ </el-form-item>
+ <el-form-item label="閿�鍞崟鍙�">
+ <el-input v-model="searchForm.salesContractNo" placeholder="閿�鍞崟鍙�" clearable />
+ </el-form-item>
+ <el-form-item label="鍏宠仈鍙戣揣鍗曞彿">
+ <el-input v-model="searchForm.shippingNo" placeholder="鍏宠仈鍙戣揣鍗曞彿" clearable />
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" @click="handleQuery">鎼滅储</el-button>
+ <el-button @click="handleReset">閲嶇疆</el-button>
+ </el-form-item>
+ </el-form>
+ </div>
+ <div class="table_list">
+ <div class="table_header" style="display: flex;justify-content: flex-end;margin-bottom: 10px;">
+ <el-button type="primary" @click="openForm('add')">鏂板缓閿�鍞��璐�</el-button>
+ <el-button type="danger" :disabled="selectedRows.length === 0 || selectedRows.some(row => row.status !== 0)" @click="handleDelete">鍒犻櫎</el-button>
+ </div>
+ <PIMTable
+ rowKey="id"
+ :column="tableColumn"
+ :tableData="tableData"
+ :page="page"
+ :isSelection="true"
+ @selection-change="handleSelectionChange"
+ :tableLoading="tableLoading"
+ @pagination="pagination"
+ >
+ <template #status="{ row }">
+ <el-tag :type="getStatusType(row.status)">{{ getStatusText(row.status) }}</el-tag>
+ </template>
+ </PIMTable>
+ </div>
+ <form-dia ref="formDia" @close="handleQuery" />
+ <detail-dia ref="detailDia" />
+ </div>
+</template>
+
+<script setup>
+import { reactive, ref, toRefs, computed, getCurrentInstance, nextTick, onMounted } from "vue";
+import { ElMessageBox } from "element-plus";
+import FormDia from "./components/formDia.vue";
+import DetailDia from "./components/detailDia.vue";
+import { returnManagementList, returnManagementDel, returnManagementHandle } from "@/api/salesManagement/returnOrder.js";
+const { proxy } = getCurrentInstance();
+
+const formDia = ref();
+const detailDia = ref();
+const openForm = (type, row) => {
+ nextTick(() => formDia.value?.openDialog(type, row));
+};
+
+const openDetail = (row) => {
+ nextTick(() => detailDia.value?.openDialog(row));
+};
+
+const handleRowDelete = (row) => {
+ if (!row?.id) return;
+ ElMessageBox.confirm("璇ラ��璐у崟灏嗚鍒犻櫎锛屾槸鍚︾‘璁ゅ垹闄わ紵", "鍒犻櫎鎻愮ず", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ }).then(() => {
+ returnManagementDel([row.id]).then(() => {
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ getList();
+ });
+ });
+};
+
+const handleRowHandle = (row) => {
+ if (!row?.id) return;
+ ElMessageBox.confirm("鏄惁澶勭悊璇ラ��璐у崟锛熷鐞嗗悗灏嗘棤娉曚慨鏀�", "澶勭悊鎻愮ず", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ }).then(() => {
+ returnManagementHandle({ returnManagementId: String(row.id) }).then(() => {
+ proxy.$modal.msgSuccess("澶勭悊鎴愬姛");
+ getList();
+ });
+ });
+}
+
+const data = reactive({
+ searchForm: {
+ returnNo: "",
+ status: "",
+ customerName: "",
+ salesContractNo: "",
+ salesman: "",
+ shippingNo: "",
+ projectName: "",
+ salesLedgerId: "",
+ makeTime: ""
+ }
+});
+const { searchForm } = toRefs(data);
+
+const documentStatusOptions = ref([
+ { label: "寰呭鐞�", value: 0 },
+ { label: "宸插鐞�", value: 1 }
+]);
+
+const defaultColumns = [
+ { label: "閫�璐у崟鍙�", prop: "returnNo", minWidth: 160 },
+ { label: "鍗曟嵁鐘舵��", prop: "status", minWidth: 90, dataType: "slot", slot: "status" },
+ { label: "鍒跺崟鏃堕棿", prop: "makeTime", minWidth: 170 },
+ { label: "瀹㈡埛鍚嶇О", prop: "customerName", minWidth: 220 },
+ { label: "閿�鍞崟鍙�", prop: "salesContractNo", minWidth: 160 },
+ { label: "涓氬姟鍛�", prop: "salesman", minWidth: 120 },
+ { label: "鍏宠仈鍙戣揣鍗曞彿", prop: "shippingNo", minWidth: 170 },
+ { label: "椤圭洰鍚嶇О", prop: "projectName", minWidth: 180 },
+ { label: "鍒跺崟浜�", prop: "maker", minWidth: 120 },
+ {
+ label: "鎿嶄綔",
+ prop: "operation",
+ dataType: "action",
+ align: "center",
+ fixed: "right",
+ minWidth: 240,
+ operation: [
+ { name: "缂栬緫", disabled: (row) => row.status !== 0, type: "text", clickFun: (row) => openForm("edit", row) },
+ { name: "閫�娆惧鐞�", disabled: (row) => row.status !== 0, type: "text", clickFun: (row) => handleRowHandle(row) },
+ { name: "璇︽儏", type: "text", clickFun: (row) => openDetail(row) },
+ { name: "鍒犻櫎", disabled: (row) => row.status !== 0, type: "text", clickFun: (row) => handleRowDelete(row) },
+ ],
+ },
+];
+const tableColumn = defaultColumns;
+
+const tableData = ref([]);
+const tableLoading = ref(false);
+const page = reactive({ current: 1, size: 10, total: 0 });
+const selectedRows = ref([]);
+const tableHeight = computed(() => "calc(100% - 80px)");
+
+const handleReset = () => {
+ Object.keys(searchForm.value).forEach(k => searchForm.value[k] = "");
+ handleQuery();
+};
+const handleSelectionChange = (selection) => {
+ selectedRows.value = selection;
+};
+const handleQuery = () => {
+ page.current = 1;
+ getList();
+};
+const pagination = (obj) => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+};
+const getList = () => {
+ tableLoading.value = true;
+ returnManagementList({ ...searchForm.value, ...page }).then(res => {
+ tableLoading.value = false;
+ tableData.value = res?.data?.records || [];
+ page.total = res?.data?.total || 0;
+ }).finally(() => tableLoading.value = false);
+};
+const handleOut = () => {
+ ElMessageBox.alert("瀵煎嚭鍔熻兘寰呮帴鍏ユ帴鍙�", "鎻愮ず");
+};
+const handleDelete = () => {
+ let ids = [];
+ if (selectedRows.value.length === 0) {
+ proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+ return;
+ }
+ ids = selectedRows.value.map(i => i.id);
+ console.log(ids);
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎鎻愮ず", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ }).then(() => {
+ returnManagementDel( ids ).then(() => {
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ getList();
+ });
+ });
+};
+
+const getStatusType = (status) => {
+ const statusMap = {
+ 0: "warning",
+ 1: "success"
+ };
+ return statusMap[status] || "info";
+};
+
+const getStatusText = (status) => {
+ const statusMap = {
+ 0: "寰呭鐞�",
+ 1: "宸插鐞�"
+ };
+ return statusMap[status] || "鏈煡";
+};
+
+onMounted(() => {
+ getList();
+});
+</script>
+
+<style scoped lang="scss">
+.table_list {
+ margin-top: unset;
+}
+</style>
--
Gitblit v1.9.3