From 6472e7cb3babd991e0e10e8de6bafee4dafdf76e Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 12 六月 2025 15:52:00 +0800
Subject: [PATCH] 1.销售出库页面联调
---
src/views/salesOutbound/index.vue | 96 +++++++++++++++++++++++++++++-------------------
1 files changed, 58 insertions(+), 38 deletions(-)
diff --git a/src/views/salesOutbound/index.vue b/src/views/salesOutbound/index.vue
index 955cd78..1c28393 100644
--- a/src/views/salesOutbound/index.vue
+++ b/src/views/salesOutbound/index.vue
@@ -1,33 +1,27 @@
<template>
<div class="app-container">
<el-form :inline="true" :model="queryParams" class="search-form">
- <el-form-item label="鎼滅储">
- <el-input
- v-model="queryParams.searchText"
- placeholder="璇疯緭鍏ュ叧閿瘝"
+ <el-form-item label="閿�鍞棩鏈�">
+ <el-date-picker
+ v-model="queryParams.saleDate"
+ type="date"
+ placeholder="璇烽�夋嫨"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
clearable
- :style="{ width: '100%' }"
/>
</el-form-item>
- <el-form-item label="渚涘簲鍟嗗悕绉�">
+ <el-form-item label="瀹㈡埛">
<el-input
- v-model="queryParams.supplierName"
+ v-model="queryParams.customer"
placeholder="璇疯緭鍏�"
clearable
:style="{ width: '100%' }"
/>
</el-form-item>
- <el-form-item label="缁熶竴浜鸿瘑鍒彿">
+ <el-form-item label="鐓ょ">
<el-input
- v-model="queryParams.identifyNumber"
- placeholder="璇疯緭鍏�"
- clearable
- :style="{ width: '100%' }"
- />
- </el-form-item>
- <el-form-item label="缁忚惀鍦板潃">
- <el-input
- v-model="queryParams.address"
+ v-model="queryParams.coal"
placeholder="璇疯緭鍏�"
clearable
:style="{ width: '100%' }"
@@ -50,7 +44,7 @@
</el-tabs>
<!-- 鎿嶄綔鎸夐挳鍖� -->
<el-space>
- <el-button type="primary" :icon="Plus" @click="openDia('add')">鏂板缓</el-button>
+ <el-button type="primary" :icon="Plus" @click="openDia()">鏂板缓</el-button>
<el-button type="danger" :icon="Delete" @click="handleDelete">鍒犻櫎</el-button>
<el-button type="info" plain :icon="Download" @click="handleExport">瀵煎嚭</el-button>
</el-space>
@@ -79,12 +73,13 @@
</template>
<script setup>
-import {ref, reactive} from "vue";
+import {ref, reactive, onMounted} from "vue";
const { proxy } = getCurrentInstance()
import {Delete, Download, Plus} from "@element-plus/icons-vue";
import ETable from "@/components/Table/ETable.vue";
import Pagination from "@/components/Pagination/index.vue";
import FormDia from "@/views/salesOutbound/components/formDia.vue";
+import {delSalesRecord, salesRecordList} from "../../api/salesOutbound/index.js";
const formDia = ref()
const activeTab = ref("out");
@@ -96,17 +91,22 @@
const tableLoading = ref(false);
const tableData = ref([]);
const columns = ref([
- { prop: "supplierName", label: "閿�鍞棩鏈�", minWidth: 160 },
- { prop: "identifyNumber", label: "瀹㈡埛", minWidth: 120 },
- { prop: "address", label: "鐓ょ", minWidth: 150 },
+ { prop: "saleDate", label: "閿�鍞棩鏈�", minWidth: 160 },
+ { prop: "customer", label: "瀹㈡埛", minWidth: 120 },
+ { prop: "coal", label: "鐓ょ", minWidth: 150 },
{ prop: "unit", label: "鍗曚綅", minWidth: 150 },
- { prop: "bank", label: "搴撳瓨鏁伴噺", minWidth: 120 },
- { prop: "bankAccount", label: "閿�鍞崟浠�(鍚◣)", minWidth: 150 },
- { prop: "contacts", label: "閿�鍞�讳环(鍚◣)", minWidth: 120 },
- { prop: "contacts", label: "鍒╂鼎", minWidth: 90 },
- { prop: "contactAddress", label: "鐑��", minWidth: 150 },
- { prop: "maintainer", label: "缁存姢浜�", minWidth: 100 },
- { prop: "maintainDate", label: "缁存姢鏃ユ湡", minWidth: 100 },
+ { prop: "priceIncludingTax", label: "鍗曚环(鍚◣)", minWidth: 150 },
+ { prop: "inventoryQuantity", label: "搴撳瓨鏁伴噺", minWidth: 120 },
+ { prop: "saleQuantity", label: "閿�鍞暟閲�", minWidth: 120 },
+ { prop: "salePrice", label: "閿�鍞崟浠�(鍚◣)", minWidth: 150 },
+ { prop: "totalAmount", label: "閿�鍞�讳环(鍚◣)", minWidth: 120 },
+ { prop: "freight", label: "杩愯垂", minWidth: 90 },
+ { prop: "taxCoal", label: "璐攢鐓ょ◣鐜�(%)", minWidth: 120 },
+ { prop: "taxTrans", label: "杩愯緭绋庣巼(%)", minWidth: 120 },
+ { prop: "grossProfit", label: "姣涘埄娑�", minWidth: 90 },
+ { prop: "netProfit", label: "鍑�鍒╂鼎", minWidth: 90 },
+ { prop: "registrant", label: "鐧昏浜�", minWidth: 100 },
+ { prop: "registrationDate", label: "鐧昏鏃ユ湡", minWidth: 100 },
]);
const selectedRows = ref([]);
const total = ref(0);
@@ -114,18 +114,26 @@
const pageSize = ref(10);
// 鏌ヨ鍙傛暟
const queryParams = reactive({
- searchText: "",
- supplierName: "",
- identifyNumber: "",
- address: "",
+ saleDate: "",
+ customer: "",
+ coal: "",
})
-
+onMounted(() => {
+ handleQuery()
+});
// 鐐瑰嚮鏌ヨ
const handleQuery = () => {
+ pageNum.value = 1
+ pageSize.value = 10
+ getList()
+}
+const getList = () => {
tableLoading.value = true;
- setTimeout(() => {
+ salesRecordList({...queryParams, current: pageNum.value, size: pageSize.value}).then(res => {
tableLoading.value = false;
- }, 500);
+ tableData.value = res.data.records;
+ total.value = res.data.total;
+ })
}
// 閲嶇疆鏌ヨ
const resetQuery = () => {
@@ -137,14 +145,26 @@
handleQuery();
};
// 鏂板鍑哄簱
-const openDia = (type, row) => {
+const openDia = (row) => {
+ console.log(row)
+ const type = row === undefined ? 'add' : 'edit'
nextTick(() => {
formDia.value?.openDialog(type, row)
})
};
// 鍒犻櫎鍑哄簱
const handleDelete = () => {
-
+ if (selectedRows.value.length === 0) {
+ proxy.$modal.msgWarning("璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁");
+ return;
+ }
+ const deleteIds = selectedRows.value.map(item => item.id);
+ proxy.$modal.confirm('鏄惁纭鍒犻櫎鎵�閫夋暟鎹」锛�').then(function() {
+ return delSalesRecord(deleteIds)
+ }).then(() => {
+ handleQuery()
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛")
+ }).catch(() => {})
};
// 瀵煎嚭鍑哄簱
const handleExport = () => {
--
Gitblit v1.9.3