From a1d7e81859f554f3a53680cc35f0f49bf1f77098 Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期四, 14 五月 2026 14:37:02 +0800
Subject: [PATCH] 导入项目

---
 src/views/erp/sale/out/components/SaleOutReceiptEnableList.vue |  199 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 199 insertions(+), 0 deletions(-)

diff --git a/src/views/erp/sale/out/components/SaleOutReceiptEnableList.vue b/src/views/erp/sale/out/components/SaleOutReceiptEnableList.vue
new file mode 100644
index 0000000..0c4a21d
--- /dev/null
+++ b/src/views/erp/sale/out/components/SaleOutReceiptEnableList.vue
@@ -0,0 +1,199 @@
+<!-- 鍙敹娆剧殑閿�鍞嚭搴撳崟鍒楄〃 -->
+<template>
+  <Dialog
+    title="閫夋嫨閿�鍞嚭搴擄紙浠呭睍绀哄彲鏀舵锛�"
+    v-model="dialogVisible"
+    :appendToBody="true"
+    :scroll="true"
+    width="1080"
+  >
+    <ContentWrap>
+      <!-- 鎼滅储宸ヤ綔鏍� -->
+      <el-form
+        class="-mb-15px"
+        :model="queryParams"
+        ref="queryFormRef"
+        :inline="true"
+        label-width="68px"
+      >
+        <el-form-item label="鍑哄簱鍗曞彿" prop="no">
+          <el-input
+            v-model="queryParams.no"
+            placeholder="璇疯緭鍏ュ嚭搴撳崟鍙�"
+            clearable
+            @keyup.enter="handleQuery"
+            class="!w-160px"
+          />
+        </el-form-item>
+        <el-form-item label="浜у搧" prop="productId">
+          <el-select
+            v-model="queryParams.productId"
+            clearable
+            filterable
+            placeholder="璇烽�夋嫨浜у搧"
+            class="!w-160px"
+          >
+            <el-option
+              v-for="item in productList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="鍑哄簱鏃堕棿" prop="orderTime">
+          <el-date-picker
+            v-model="queryParams.outTime"
+            value-format="YYYY-MM-DD HH:mm:ss"
+            type="daterange"
+            start-placeholder="寮�濮嬫棩鏈�"
+            end-placeholder="缁撴潫鏃ユ湡"
+            :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
+            class="!w-160px"
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 鎼滅储</el-button>
+          <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 閲嶇疆</el-button>
+        </el-form-item>
+      </el-form>
+    </ContentWrap>
+
+    <ContentWrap>
+      <el-table
+        v-loading="loading"
+        :data="list"
+        :show-overflow-tooltip="true"
+        :stripe="true"
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column width="30" label="閫夋嫨" type="selection" />
+        <el-table-column min-width="180" label="鍑哄簱鍗曞彿" align="center" prop="no" />
+        <el-table-column label="瀹㈡埛" align="center" prop="customerName" />
+        <el-table-column label="浜у搧淇℃伅" align="center" prop="productNames" min-width="200" />
+        <el-table-column
+          label="鍑哄簱鏃堕棿"
+          align="center"
+          prop="outTime"
+          :formatter="dateFormatter2"
+          width="120px"
+        />
+        <el-table-column label="鍒涘缓浜�" align="center" prop="creatorName" />
+        <el-table-column
+          label="搴旀敹閲戦"
+          align="center"
+          prop="totalPrice"
+          :formatter="erpPriceTableColumnFormatter"
+        />
+        <el-table-column
+          label="宸叉敹閲戦"
+          align="center"
+          prop="receiptPrice"
+          :formatter="erpPriceTableColumnFormatter"
+        />
+        <el-table-column label="鏈敹閲戦" align="center">
+          <template #default="scope">
+            <span v-if="scope.row.receiptPrice === scope.row.totalPrice">0</span>
+            <el-tag type="danger" v-else>
+              {{ erpPriceInputFormatter(scope.row.totalPrice - scope.row.receiptPrice) }}
+            </el-tag>
+          </template>
+        </el-table-column>
+      </el-table>
+      <!-- 鍒嗛〉 -->
+      <Pagination
+        v-model:limit="queryParams.pageSize"
+        v-model:page="queryParams.pageNo"
+        :total="total"
+        @pagination="getList"
+      />
+    </ContentWrap>
+    <template #footer>
+      <el-button :disabled="!selectionList.length" type="primary" @click="submitForm">
+        纭� 瀹�
+      </el-button>
+      <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
+    </template>
+  </Dialog>
+</template>
+<script lang="ts" setup>
+import { ElTable } from 'element-plus'
+import { dateFormatter2 } from '@/utils/formatTime'
+import { erpPriceInputFormatter, erpPriceTableColumnFormatter } from '@/utils'
+import { ProductApi, ProductVO } from '@/api/erp/product/product'
+import { SaleOutApi, SaleOutVO } from '@/api/erp/sale/out'
+
+defineOptions({ name: 'SaleOutReceiptEnableList' })
+
+const list = ref<SaleOutVO[]>([]) // 鍒楄〃鐨勬暟鎹�
+const total = ref(0) // 鍒楄〃鐨勬�婚〉鏁�
+const loading = ref(false) // 鍒楄〃鐨勫姞杞戒腑
+const dialogVisible = ref(false) // 寮圭獥鐨勬槸鍚﹀睍绀�
+const queryParams = reactive({
+  pageNo: 1,
+  pageSize: 10,
+  no: undefined,
+  productId: undefined,
+  outTime: [],
+  receiptEnable: true,
+  customerId: undefined
+})
+const queryFormRef = ref() // 鎼滅储鐨勮〃鍗�
+const productList = ref<ProductVO[]>([]) // 浜у搧鍒楄〃
+
+/** 閫変腑鎿嶄綔 */
+const selectionList = ref<SaleOutVO[]>([])
+const handleSelectionChange = (rows: SaleOutVO[]) => {
+  selectionList.value = rows
+}
+
+/** 鎵撳紑寮圭獥 */
+const open = async (customerId: number) => {
+  dialogVisible.value = true
+  await nextTick() // 绛夊緟锛岄伩鍏� queryFormRef 涓虹┖
+  // 鍔犺浇鍙嚭搴撶殑璁㈠崟鍒楄〃
+  queryParams.customerId = customerId
+  await resetQuery()
+  // 鍔犺浇浜у搧鍒楄〃
+  productList.value = await ProductApi.getProductSimpleList()
+}
+defineExpose({ open }) // 鎻愪緵 open 鏂规硶锛岀敤浜庢墦寮�寮圭獥
+
+/** 鎻愪氦閫夋嫨 */
+const emits = defineEmits<{
+  (e: 'success', value: SaleOutVO[]): void
+}>()
+const submitForm = () => {
+  try {
+    emits('success', selectionList.value)
+  } finally {
+    // 鍏抽棴寮圭獥
+    dialogVisible.value = false
+  }
+}
+
+/** 鍔犺浇鍒楄〃  */
+const getList = async () => {
+  loading.value = true
+  try {
+    const data = await SaleOutApi.getSaleOutPage(queryParams)
+    list.value = data.list
+    total.value = data.total
+  } finally {
+    loading.value = false
+  }
+}
+
+/** 閲嶇疆鎸夐挳鎿嶄綔 */
+const resetQuery = () => {
+  queryFormRef.value.resetFields()
+  handleQuery()
+}
+
+/** 鎼滅储鎸夐挳鎿嶄綔 */
+const handleQuery = () => {
+  queryParams.pageNo = 1
+  selectionList.value = []
+  getList()
+}
+</script>

--
Gitblit v1.8.0