From 5333935ae59999c47653122a669f4326f0173c1c Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期四, 08 一月 2026 14:47:02 +0800
Subject: [PATCH] 确认按钮在左边
---
src/views/salesManagement/paymentShipping/index.vue | 772 +++++++++++++++++++++++++++++++++-------------------------
1 files changed, 439 insertions(+), 333 deletions(-)
diff --git a/src/views/salesManagement/paymentShipping/index.vue b/src/views/salesManagement/paymentShipping/index.vue
index 31dcf55..e545eb3 100644
--- a/src/views/salesManagement/paymentShipping/index.vue
+++ b/src/views/salesManagement/paymentShipping/index.vue
@@ -2,183 +2,255 @@
<div class="app-container">
<el-card class="box-card">
<!-- 鎼滅储鍖哄煙 -->
- <el-row :gutter="20" class="search-row">
+ <el-row :gutter="20"
+ class="search-row">
<el-col :span="6">
- <el-input
- v-model="searchForm.orderNo"
- placeholder="璇疯緭鍏ヨ鍗曞彿"
- clearable
- @keyup.enter="handleSearch"
- >
+ <el-input v-model="searchForm.orderNo"
+ placeholder="璇疯緭鍏ヨ鍗曞彿"
+ clearable
+ @keyup.enter="handleSearch">
<template #prefix>
- <el-icon><Search /></el-icon>
+ <el-icon>
+ <Search />
+ </el-icon>
</template>
</el-input>
</el-col>
<el-col :span="6">
- <el-select v-model="searchForm.paymentStatus" placeholder="璇烽�夋嫨浠樻鐘舵��" clearable>
- <el-option label="鏈粯娆�" value="鏈粯娆�"></el-option>
- <el-option label="宸蹭粯娆�" value="宸蹭粯娆�"></el-option>
- <el-option label="閮ㄥ垎浠樻" value="閮ㄥ垎浠樻"></el-option>
+ <el-select v-model="searchForm.paymentStatus"
+ placeholder="璇烽�夋嫨浠樻鐘舵��"
+ clearable>
+ <el-option label="鏈粯娆�"
+ value="鏈粯娆�"></el-option>
+ <el-option label="宸蹭粯娆�"
+ value="宸蹭粯娆�"></el-option>
+ <el-option label="閮ㄥ垎浠樻"
+ value="閮ㄥ垎浠樻"></el-option>
</el-select>
</el-col>
<el-col :span="6">
- <el-select v-model="searchForm.shippingStatus" placeholder="璇烽�夋嫨鍙戣揣鐘舵��" clearable>
- <el-option label="寰呭彂璐�" value="寰呭彂璐�"></el-option>
- <el-option label="宸插彂璐�" value="宸插彂璐�"></el-option>
- <el-option label="宸茬鏀�" value="宸茬鏀�"></el-option>
+ <el-select v-model="searchForm.shippingStatus"
+ placeholder="璇烽�夋嫨鍙戣揣鐘舵��"
+ clearable>
+ <el-option label="寰呭彂璐�"
+ value="寰呭彂璐�"></el-option>
+ <el-option label="宸插彂璐�"
+ value="宸插彂璐�"></el-option>
+ <el-option label="宸茬鏀�"
+ value="宸茬鏀�"></el-option>
</el-select>
</el-col>
<el-col :span="6">
- <el-button type="primary" @click="handleSearch">鎼滅储</el-button>
+ <el-button type="primary"
+ @click="handleSearch">鎼滅储</el-button>
<el-button @click="resetSearch">閲嶇疆</el-button>
- <el-button style="float: right;" type="primary" @click="handleAdd">
+ <el-button style="float: right;"
+ type="primary"
+ @click="handleAdd">
鏂板璁板綍
</el-button>
</el-col>
</el-row>
-
<!-- 鏀粯涓庡彂璐у垪琛� -->
- <el-table
- :data="recordList"
- style="width: 100%"
- v-loading="loading"
- border
- stripe
- height="calc(100vh - 22em)"
- >
- <el-table-column prop="id" label="ID" width="80" align="center"/>
- <el-table-column prop="orderNo" label="璁㈠崟鍙�" />
- <el-table-column prop="customer" label="瀹㈡埛鍚嶇О" />
- <el-table-column prop="orderAmount" label="璁㈠崟閲戦" width="120">
+ <el-table :data="recordList"
+ style="width: 100%"
+ v-loading="loading"
+ border
+ stripe
+ height="calc(100vh - 22em)">
+ <el-table-column prop="id"
+ label="ID"
+ width="80"
+ align="center" />
+ <el-table-column prop="orderNo"
+ label="璁㈠崟鍙�" />
+ <el-table-column prop="customer"
+ label="瀹㈡埛鍚嶇О" />
+ <el-table-column prop="orderAmount"
+ label="璁㈠崟閲戦"
+ width="120">
<template #default="scope">
楼{{ scope.row.orderAmount }}
</template>
</el-table-column>
- <el-table-column prop="orderAmount" label="宸蹭粯娆鹃噾棰�" width="120">
+ <el-table-column prop="orderAmount"
+ label="宸蹭粯娆鹃噾棰�"
+ width="120">
<template #default="scope">
楼{{ scope.row.paidAmount }}
</template>
</el-table-column>
- <el-table-column prop="paymentStatus" label="浠樻鐘舵��" width="100">
+ <el-table-column prop="paymentStatus"
+ label="浠樻鐘舵��"
+ width="100">
<template #default="scope">
<el-tag :type="getPaymentStatusType(scope.row.paymentStatus)">
{{ scope.row.paymentStatus }}
</el-tag>
</template>
</el-table-column>
- <el-table-column prop="shippingStatus" label="鍙戣揣鐘舵��" width="100">
+ <el-table-column prop="shippingStatus"
+ label="鍙戣揣鐘舵��"
+ width="100">
<template #default="scope">
<el-tag :type="getShippingStatusType(scope.row.shippingStatus)">
{{ scope.row.shippingStatus }}
</el-tag>
</template>
</el-table-column>
- <el-table-column prop="shippingDate" label="鍙戣揣鏃ユ湡" width="120" />
- <el-table-column label="鎿嶄綔" width="250" fixed="right" align="center">
+ <el-table-column prop="shippingDate"
+ label="鍙戣揣鏃ユ湡"
+ width="120" />
+ <el-table-column label="鎿嶄綔"
+ width="250"
+ fixed="right"
+ align="center">
<template #default="scope">
-<!-- <el-button link type="primary" @click="handleView(scope.row)">鏌ョ湅</el-button>-->
- <el-button link type="primary" @click="handlePayment(scope.row)" v-if="scope.row.paymentStatus !== '宸蹭粯娆�'">浠樻</el-button>
- <el-button link type="primary" @click="handleShipping(scope.row)" v-if="scope.row.paymentStatus === '宸蹭粯娆�' && scope.row.shippingStatus === '寰呭彂璐�'">鍙戣揣</el-button>
- <el-button link type="primary" @click="handleEdit(scope.row)">缂栬緫</el-button>
- <el-button link type="danger" @click="handleDelete(scope.row)">鍒犻櫎</el-button>
+ <!-- <el-button link type="primary" @click="handleView(scope.row)">鏌ョ湅</el-button>-->
+ <el-button link
+ type="primary"
+ @click="handlePayment(scope.row)"
+ v-if="scope.row.paymentStatus !== '宸蹭粯娆�'">浠樻</el-button>
+ <el-button link
+ type="primary"
+ @click="handleShipping(scope.row)"
+ v-if="scope.row.paymentStatus === '宸蹭粯娆�' && scope.row.shippingStatus === '寰呭彂璐�'">鍙戣揣</el-button>
+ <el-button link
+ type="primary"
+ @click="handleEdit(scope.row)">缂栬緫</el-button>
+ <el-button link
+ type="danger"
+ @click="handleDelete(scope.row)">鍒犻櫎</el-button>
</template>
</el-table-column>
</el-table>
-
<!-- 鍒嗛〉 -->
- <pagination
- :total="total"
- layout="total, sizes, prev, pager, next, jumper"
- :page="pagination.current"
- :limit="pagination.size"
- @pagination="handleCurrentChange"
- />
+ <pagination :total="total"
+ layout="total, sizes, prev, pager, next, jumper"
+ :page="pagination.current"
+ :limit="pagination.size"
+ @pagination="handleCurrentChange" />
</el-card>
-
<!-- 鏂板/缂栬緫瀵硅瘽妗� -->
- <el-dialog v-model="dialogVisible" :title="dialogTitle" width="700px">
- <el-form :model="form" :rules="rules" ref="formRef" label-width="100px">
+ <el-dialog v-model="dialogVisible"
+ :title="dialogTitle"
+ width="700px">
+ <el-form :model="form"
+ :rules="rules"
+ ref="formRef"
+ label-width="100px">
<el-row :gutter="20">
<el-col :span="12">
- <el-form-item label="璁㈠崟鍙�" prop="orderNo">
- <el-input v-model="form.orderNo" placeholder="璇疯緭鍏ヨ鍗曞彿" disabled></el-input>
+ <el-form-item label="璁㈠崟鍙�"
+ prop="orderNo">
+ <el-input v-model="form.orderNo"
+ placeholder="璇疯緭鍏ヨ鍗曞彿"
+ disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="瀹㈡埛鍚嶇О" prop="customer">
- <el-select v-model="form.customer" placeholder="璇烽�夋嫨瀹㈡埛" style="width: 100%">
- <el-option label="涓婃捣绉戞妧鏈夐檺鍏徃" value="涓婃捣绉戞妧鏈夐檺鍏徃"></el-option>
- <el-option label="娣卞湷鐢靛瓙鏈夐檺鍏徃" value="娣卞湷鐢靛瓙鏈夐檺鍏徃"></el-option>
- <el-option label="鍖椾含璐告槗鍏徃" value="鍖椾含璐告槗鍏徃"></el-option>
+ <el-form-item label="瀹㈡埛鍚嶇О"
+ prop="customer">
+ <el-select v-model="form.customer"
+ placeholder="璇烽�夋嫨瀹㈡埛"
+ style="width: 100%">
+ <el-option label="涓婃捣绉戞妧鏈夐檺鍏徃"
+ value="涓婃捣绉戞妧鏈夐檺鍏徃"></el-option>
+ <el-option label="娣卞湷鐢靛瓙鏈夐檺鍏徃"
+ value="娣卞湷鐢靛瓙鏈夐檺鍏徃"></el-option>
+ <el-option label="鍖椾含璐告槗鍏徃"
+ value="鍖椾含璐告槗鍏徃"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
- <el-form-item label="璁㈠崟閲戦" prop="orderAmount">
- <el-input-number v-model="form.orderAmount" :precision="2" :min="0" style="width: 100%"></el-input-number>
+ <el-form-item label="璁㈠崟閲戦"
+ prop="orderAmount">
+ <el-input-number v-model="form.orderAmount"
+ :precision="2"
+ :min="0"
+ style="width: 100%"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
- <el-form-item label="浠樻鐘舵��" prop="paymentStatus">
- <el-select v-model="form.paymentStatus" placeholder="璇烽�夋嫨浠樻鐘舵��" style="width: 100%">
- <el-option label="鏈粯娆�" value="鏈粯娆�"></el-option>
- <el-option label="宸蹭粯娆�" value="宸蹭粯娆�"></el-option>
- <el-option label="閮ㄥ垎浠樻" value="閮ㄥ垎浠樻"></el-option>
+ <el-form-item label="浠樻鐘舵��"
+ prop="paymentStatus">
+ <el-select v-model="form.paymentStatus"
+ placeholder="璇烽�夋嫨浠樻鐘舵��"
+ style="width: 100%">
+ <el-option label="鏈粯娆�"
+ value="鏈粯娆�"></el-option>
+ <el-option label="宸蹭粯娆�"
+ value="宸蹭粯娆�"></el-option>
+ <el-option label="閮ㄥ垎浠樻"
+ value="閮ㄥ垎浠樻"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="鍙戣揣鐘舵��" prop="shippingStatus">
- <el-select v-model="form.shippingStatus" placeholder="璇烽�夋嫨鍙戣揣鐘舵��" style="width: 100%">
- <el-option label="寰呭彂璐�" value="寰呭彂璐�"></el-option>
- <el-option label="宸插彂璐�" value="宸插彂璐�"></el-option>
- <el-option label="宸茬鏀�" value="宸茬鏀�"></el-option>
+ <el-form-item label="鍙戣揣鐘舵��"
+ prop="shippingStatus">
+ <el-select v-model="form.shippingStatus"
+ placeholder="璇烽�夋嫨鍙戣揣鐘舵��"
+ style="width: 100%">
+ <el-option label="寰呭彂璐�"
+ value="寰呭彂璐�"></el-option>
+ <el-option label="宸插彂璐�"
+ value="宸插彂璐�"></el-option>
+ <el-option label="宸茬鏀�"
+ value="宸茬鏀�"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
- <el-form-item label="鍙戣揣鏃ユ湡" prop="shippingDate">
- <el-date-picker
- v-model="form.shippingDate"
- type="date"
- placeholder="閫夋嫨鍙戣揣鏃ユ湡"
- style="width: 100%"
- format="YYYY-MM-DD"
- value-format="YYYY-MM-DD"
- />
+ <el-form-item label="鍙戣揣鏃ユ湡"
+ prop="shippingDate">
+ <el-date-picker v-model="form.shippingDate"
+ type="date"
+ placeholder="閫夋嫨鍙戣揣鏃ユ湡"
+ style="width: 100%"
+ format="YYYY-MM-DD"
+ value-format="YYYY-MM-DD" />
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="鐗╂祦鍗曞彿" prop="trackingNo">
- <el-input v-model="form.trackingNo" placeholder="璇疯緭鍏ョ墿娴佸崟鍙�"></el-input>
+ <el-form-item label="鐗╂祦鍗曞彿"
+ prop="trackingNo">
+ <el-input v-model="form.trackingNo"
+ placeholder="璇疯緭鍏ョ墿娴佸崟鍙�"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
- <el-form-item label="澶囨敞" prop="remark">
- <el-input type="textarea" v-model="form.remark" placeholder="璇疯緭鍏ュ娉ㄤ俊鎭�" rows="3"></el-input>
+ <el-form-item label="澶囨敞"
+ prop="remark">
+ <el-input type="textarea"
+ v-model="form.remark"
+ placeholder="璇疯緭鍏ュ娉ㄤ俊鎭�"
+ rows="3"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<div class="dialog-footer">
+ <el-button type="primary"
+ @click="handleSubmit">纭� 瀹�</el-button>
<el-button @click="dialogVisible = false">鍙� 娑�</el-button>
- <el-button type="primary" @click="handleSubmit">纭� 瀹�</el-button>
</div>
</template>
</el-dialog>
-
<!-- 浠樻瀵硅瘽妗� -->
- <el-dialog v-model="paymentDialogVisible" title="璁㈠崟浠樻" width="500px">
+ <el-dialog v-model="paymentDialogVisible"
+ title="璁㈠崟浠樻"
+ width="500px">
<el-form label-width="100px">
<el-form-item label="璁㈠崟鍙�">
<span>{{ currentRecord.orderNo }}</span>
@@ -189,23 +261,34 @@
<el-form-item label="璁㈠崟閲戦">
<span>楼{{ currentRecord.orderAmount }}</span>
</el-form-item>
- <el-form-item label="浠樻閲戦" prop="paymentAmount">
- <el-input-number v-model="paymentAmount" :precision="2" :min="0" :max="currentRecord.orderAmount" style="width: 100%"></el-input-number>
+ <el-form-item label="浠樻閲戦"
+ prop="paymentAmount">
+ <el-input-number v-model="paymentAmount"
+ :precision="2"
+ :min="0"
+ :max="currentRecord.orderAmount"
+ style="width: 100%"></el-input-number>
</el-form-item>
- <el-form-item label="浠樻澶囨敞" prop="paymentRemark">
- <el-input type="textarea" v-model="paymentRemark" rows="3" placeholder="璇疯緭鍏ヤ粯娆惧娉�"></el-input>
+ <el-form-item label="浠樻澶囨敞"
+ prop="paymentRemark">
+ <el-input type="textarea"
+ v-model="paymentRemark"
+ rows="3"
+ placeholder="璇疯緭鍏ヤ粯娆惧娉�"></el-input>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
+ <el-button type="primary"
+ @click="savePayment">纭� 瀹�</el-button>
<el-button @click="paymentDialogVisible = false">鍙� 娑�</el-button>
- <el-button type="primary" @click="savePayment">纭� 瀹�</el-button>
</div>
</template>
</el-dialog>
-
<!-- 鍙戣揣瀵硅瘽妗� -->
- <el-dialog v-model="shippingDialogVisible" title="璁㈠崟鍙戣揣" width="500px">
+ <el-dialog v-model="shippingDialogVisible"
+ title="璁㈠崟鍙戣揣"
+ width="500px">
<el-form label-width="100px">
<el-form-item label="璁㈠崟鍙�">
<span>{{ currentRecord.orderNo }}</span>
@@ -213,36 +296,50 @@
<el-form-item label="瀹㈡埛鍚嶇О">
<span>{{ currentRecord.customer }}</span>
</el-form-item>
- <el-form-item label="鍙戣揣鏃ユ湡" prop="shippingDate">
- <el-date-picker
- v-model="shippingDate"
- type="date"
- placeholder="閫夋嫨鍙戣揣鏃ユ湡"
- style="width: 100%"
- format="YYYY-MM-DD"
- value-format="YYYY-MM-DD"
- />
+ <el-form-item label="鍙戣揣鏃ユ湡"
+ prop="shippingDate">
+ <el-date-picker v-model="shippingDate"
+ type="date"
+ placeholder="閫夋嫨鍙戣揣鏃ユ湡"
+ style="width: 100%"
+ format="YYYY-MM-DD"
+ value-format="YYYY-MM-DD" />
</el-form-item>
- <el-form-item label="鐗╂祦鍏徃" prop="logisticsCompany">
- <el-select v-model="logisticsCompany" placeholder="璇烽�夋嫨鐗╂祦鍏徃" style="width: 100%">
- <el-option label="椤轰赴閫熻繍" value="椤轰赴閫熻繍"></el-option>
- <el-option label="鍦嗛�氶�熼��" value="鍦嗛�氶�熼��"></el-option>
- <el-option label="涓�氬揩閫�" value="涓�氬揩閫�"></el-option>
- <el-option label="鐢抽�氬揩閫�" value="鐢抽�氬揩閫�"></el-option>
- <el-option label="闊佃揪閫熼��" value="闊佃揪閫熼��"></el-option>
+ <el-form-item label="鐗╂祦鍏徃"
+ prop="logisticsCompany">
+ <el-select v-model="logisticsCompany"
+ placeholder="璇烽�夋嫨鐗╂祦鍏徃"
+ style="width: 100%">
+ <el-option label="椤轰赴閫熻繍"
+ value="椤轰赴閫熻繍"></el-option>
+ <el-option label="鍦嗛�氶�熼��"
+ value="鍦嗛�氶�熼��"></el-option>
+ <el-option label="涓�氬揩閫�"
+ value="涓�氬揩閫�"></el-option>
+ <el-option label="鐢抽�氬揩閫�"
+ value="鐢抽�氬揩閫�"></el-option>
+ <el-option label="闊佃揪閫熼��"
+ value="闊佃揪閫熼��"></el-option>
</el-select>
</el-form-item>
- <el-form-item label="鐗╂祦鍗曞彿" prop="trackingNo">
- <el-input v-model="trackingNo" placeholder="璇疯緭鍏ョ墿娴佸崟鍙�"></el-input>
+ <el-form-item label="鐗╂祦鍗曞彿"
+ prop="trackingNo">
+ <el-input v-model="trackingNo"
+ placeholder="璇疯緭鍏ョ墿娴佸崟鍙�"></el-input>
</el-form-item>
- <el-form-item label="鍙戣揣澶囨敞" prop="shippingRemark">
- <el-input type="textarea" v-model="shippingRemark" rows="3" placeholder="璇疯緭鍏ュ彂璐у娉�"></el-input>
+ <el-form-item label="鍙戣揣澶囨敞"
+ prop="shippingRemark">
+ <el-input type="textarea"
+ v-model="shippingRemark"
+ rows="3"
+ placeholder="璇疯緭鍏ュ彂璐у娉�"></el-input>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
+ <el-button type="primary"
+ @click="saveShipping">纭� 瀹�</el-button>
<el-button @click="shippingDialogVisible = false">鍙� 娑�</el-button>
- <el-button type="primary" @click="saveShipping">纭� 瀹�</el-button>
</div>
</template>
</el-dialog>
@@ -250,232 +347,241 @@
</template>
<script setup>
-import { ref, reactive, computed,onMounted } from 'vue'
-import { ElMessage, ElMessageBox } from 'element-plus'
-import { Plus, Search } from '@element-plus/icons-vue'
-import {listPage,add,update,deletePaymentShipping} from "@/api/salesManagement/paymentShipping.js"
-import Pagination from '@/components/PIMTable/Pagination.vue'
+ import { ref, reactive, computed, onMounted } from "vue";
+ import { ElMessage, ElMessageBox } from "element-plus";
+ import { Plus, Search } from "@element-plus/icons-vue";
+ import {
+ listPage,
+ add,
+ update,
+ deletePaymentShipping,
+ } from "@/api/salesManagement/paymentShipping.js";
+ import Pagination from "@/components/PIMTable/Pagination.vue";
-const total = ref(0)
-onMounted(() => {
- getList()
-})
+ const total = ref(0);
+ onMounted(() => {
+ getList();
+ });
-const getList = () => {
- loading.value = true
- listPage({...searchForm,...pagination}).then(res => {
- if(res.code === 200){
- recordList.value = res.data.records
- total.value = res.data.total
- loading.value = false
- console.log(recordList.value)
- }
- })
-}
-
-// 鍝嶅簲寮忔暟鎹�
-const loading = ref(false)
-const searchForm = reactive({
- orderNo: '',
- paymentStatus: '',
- shippingStatus: ''
-})
-
-const recordList = ref([])
-
-const pagination = reactive({
- current: 1,
- size: 10
-})
-
-const dialogVisible = ref(false)
-const dialogTitle = ref('鏂板璁板綍')
-const form = reactive({
- orderNo: '',
- customer: '',
- orderAmount: 0,
- paymentStatus: '鏈粯娆�',
- shippingStatus: '寰呭彂璐�',
- shippingDate: '',
- trackingNo: '',
- remark: ''
-})
-
-const rules = {
- // orderNo: [{ required: true, message: '璇疯緭鍏ヨ鍗曞彿', trigger: 'blur' }],
- customer: [{ required: true, message: '璇烽�夋嫨瀹㈡埛', trigger: 'change' }],
- orderAmount: [{ required: true, message: '璇疯緭鍏ヨ鍗曢噾棰�', trigger: 'blur' }],
- paymentStatus: [{ required: true, message: '璇烽�夋嫨浠樻鐘舵��', trigger: 'change' }],
- shippingStatus: [{ required: true, message: '璇烽�夋嫨鍙戣揣鐘舵��', trigger: 'change' }]
-}
-
-const isEdit = ref(false)
-const editId = ref(null)
-const paymentDialogVisible = ref(false)
-const shippingDialogVisible = ref(false)
-const currentRecord = ref({})
-const paymentAmount = ref(0)
-const paymentRemark = ref('')
-const shippingDate = ref('')
-const logisticsCompany = ref('')
-const trackingNo = ref('')
-const shippingRemark = ref('')
-const formRef = ref()
-
-// 鏂规硶
-const getPaymentStatusType = (status) => {
- const statusMap = {
- '鏈粯娆�': 'danger',
- '宸蹭粯娆�': 'success',
- '閮ㄥ垎浠樻': 'warning'
- }
- return statusMap[status] || 'info'
-}
-
-const getShippingStatusType = (status) => {
- const statusMap = {
- '寰呭彂璐�': 'warning',
- '宸插彂璐�': 'primary',
- '宸茬鏀�': 'success'
- }
- return statusMap[status] || 'info'
-}
-
-const handleSearch = () => {
- // 鎼滅储閫昏緫宸插湪computed涓鐞�
- getList()
-}
-
-const resetSearch = () => {
- searchForm.orderNo = ''
- searchForm.paymentStatus = ''
- searchForm.shippingStatus = ''
-}
-
-const handleAdd = () => {
- dialogTitle.value = '鏂板璁板綍'
- isEdit.value = false
- form.orderNo = ''
- form.customer = ''
- form.orderAmount = 0
- form.paymentStatus = '鏈粯娆�'
- form.shippingStatus = '寰呭彂璐�'
- form.shippingDate = ''
- form.trackingNo = ''
- form.remark = ''
- dialogVisible.value = true
-}
-
-const handleView = (row) => {
- // 鏌ョ湅璁板綍璇︽儏
- ElMessage.info('鏌ョ湅璁板綍璇︽儏鍔熻兘寰呭疄鐜�')
-}
-
-const handleEdit = (row) => {
- dialogTitle.value = '缂栬緫璁板綍'
- isEdit.value = true
- editId.value = row.id
- Object.assign(form, row)
- dialogVisible.value = true
-}
-
-const handlePayment = (row) => {
- currentRecord.value = row
- paymentAmount.value = row.orderAmount - row.paidAmount
- paymentRemark.value = ''
- paymentDialogVisible.value = true
-}
-
-const handleShipping = (row) => {
- currentRecord.value = row
- shippingDate.value = ''
- logisticsCompany.value = ''
- trackingNo.value = ''
- shippingRemark.value = ''
- shippingDialogVisible.value = true
-}
-
-const handleDelete = (row) => {
- ElMessageBox.confirm('纭鍒犻櫎璇ヨ褰曞悧锛�', '鎻愮ず', {
- confirmButtonText: '纭畾',
- cancelButtonText: '鍙栨秷',
- type: 'warning'
- }).then(() => {
- let ids = [row.id]
- deletePaymentShipping(ids).then(res => {
- if(res.code === 200){
- ElMessage.success('鍒犻櫎鎴愬姛')
- getList()
+ const getList = () => {
+ loading.value = true;
+ listPage({ ...searchForm, ...pagination }).then(res => {
+ if (res.code === 200) {
+ recordList.value = res.data.records;
+ total.value = res.data.total;
+ loading.value = false;
+ console.log(recordList.value);
}
- })
- })
-}
+ });
+ };
-const savePayment = () => {
- currentRecord.value.paidAmount = Number(currentRecord.value.paidAmount) + paymentAmount.value
- if(currentRecord.value.paidAmount == currentRecord.value.orderAmount){
- currentRecord.value.paymentStatus = '宸蹭粯娆�'
- }else{
- currentRecord.value.paymentStatus = '閮ㄥ垎浠樻'
- }
- update(currentRecord.value).then(res => {
- if(res.code === 200){
- ElMessage.success('浠樻淇℃伅宸蹭繚瀛�')
- paymentDialogVisible.value = false
- getList()
+ // 鍝嶅簲寮忔暟鎹�
+ const loading = ref(false);
+ const searchForm = reactive({
+ orderNo: "",
+ paymentStatus: "",
+ shippingStatus: "",
+ });
+
+ const recordList = ref([]);
+
+ const pagination = reactive({
+ current: 1,
+ size: 10,
+ });
+
+ const dialogVisible = ref(false);
+ const dialogTitle = ref("鏂板璁板綍");
+ const form = reactive({
+ orderNo: "",
+ customer: "",
+ orderAmount: 0,
+ paymentStatus: "鏈粯娆�",
+ shippingStatus: "寰呭彂璐�",
+ shippingDate: "",
+ trackingNo: "",
+ remark: "",
+ });
+
+ const rules = {
+ // orderNo: [{ required: true, message: '璇疯緭鍏ヨ鍗曞彿', trigger: 'blur' }],
+ customer: [{ required: true, message: "璇烽�夋嫨瀹㈡埛", trigger: "change" }],
+ orderAmount: [{ required: true, message: "璇疯緭鍏ヨ鍗曢噾棰�", trigger: "blur" }],
+ paymentStatus: [
+ { required: true, message: "璇烽�夋嫨浠樻鐘舵��", trigger: "change" },
+ ],
+ shippingStatus: [
+ { required: true, message: "璇烽�夋嫨鍙戣揣鐘舵��", trigger: "change" },
+ ],
+ };
+
+ const isEdit = ref(false);
+ const editId = ref(null);
+ const paymentDialogVisible = ref(false);
+ const shippingDialogVisible = ref(false);
+ const currentRecord = ref({});
+ const paymentAmount = ref(0);
+ const paymentRemark = ref("");
+ const shippingDate = ref("");
+ const logisticsCompany = ref("");
+ const trackingNo = ref("");
+ const shippingRemark = ref("");
+ const formRef = ref();
+
+ // 鏂规硶
+ const getPaymentStatusType = status => {
+ const statusMap = {
+ 鏈粯娆�: "danger",
+ 宸蹭粯娆�: "success",
+ 閮ㄥ垎浠樻: "warning",
+ };
+ return statusMap[status] || "info";
+ };
+
+ const getShippingStatusType = status => {
+ const statusMap = {
+ 寰呭彂璐�: "warning",
+ 宸插彂璐�: "primary",
+ 宸茬鏀�: "success",
+ };
+ return statusMap[status] || "info";
+ };
+
+ const handleSearch = () => {
+ // 鎼滅储閫昏緫宸插湪computed涓鐞�
+ getList();
+ };
+
+ const resetSearch = () => {
+ searchForm.orderNo = "";
+ searchForm.paymentStatus = "";
+ searchForm.shippingStatus = "";
+ };
+
+ const handleAdd = () => {
+ dialogTitle.value = "鏂板璁板綍";
+ isEdit.value = false;
+ form.orderNo = "";
+ form.customer = "";
+ form.orderAmount = 0;
+ form.paymentStatus = "鏈粯娆�";
+ form.shippingStatus = "寰呭彂璐�";
+ form.shippingDate = "";
+ form.trackingNo = "";
+ form.remark = "";
+ dialogVisible.value = true;
+ };
+
+ const handleView = row => {
+ // 鏌ョ湅璁板綍璇︽儏
+ ElMessage.info("鏌ョ湅璁板綍璇︽儏鍔熻兘寰呭疄鐜�");
+ };
+
+ const handleEdit = row => {
+ dialogTitle.value = "缂栬緫璁板綍";
+ isEdit.value = true;
+ editId.value = row.id;
+ Object.assign(form, row);
+ dialogVisible.value = true;
+ };
+
+ const handlePayment = row => {
+ currentRecord.value = row;
+ paymentAmount.value = row.orderAmount - row.paidAmount;
+ paymentRemark.value = "";
+ paymentDialogVisible.value = true;
+ };
+
+ const handleShipping = row => {
+ currentRecord.value = row;
+ shippingDate.value = "";
+ logisticsCompany.value = "";
+ trackingNo.value = "";
+ shippingRemark.value = "";
+ shippingDialogVisible.value = true;
+ };
+
+ const handleDelete = row => {
+ ElMessageBox.confirm("纭鍒犻櫎璇ヨ褰曞悧锛�", "鎻愮ず", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ }).then(() => {
+ let ids = [row.id];
+ deletePaymentShipping(ids).then(res => {
+ if (res.code === 200) {
+ ElMessage.success("鍒犻櫎鎴愬姛");
+ getList();
+ }
+ });
+ });
+ };
+
+ const savePayment = () => {
+ currentRecord.value.paidAmount =
+ Number(currentRecord.value.paidAmount) + paymentAmount.value;
+ if (currentRecord.value.paidAmount == currentRecord.value.orderAmount) {
+ currentRecord.value.paymentStatus = "宸蹭粯娆�";
+ } else {
+ currentRecord.value.paymentStatus = "閮ㄥ垎浠樻";
}
- })
-
-}
-
-const saveShipping = () => {
- if (!shippingDate.value || !logisticsCompany.value || !trackingNo.value) {
- ElMessage.warning('璇峰~鍐欏畬鏁寸殑鍙戣揣淇℃伅')
- return
- }
- currentRecord.value.shippingStatus = '宸插彂璐�'
- update(currentRecord.value).then(res => {
- if(res.code === 200){
- ElMessage.success('鍙戣揣淇℃伅宸蹭繚瀛�')
- shippingDialogVisible.value = false
- getList()
- }
- })
-}
-
-const handleSubmit = () => {
- formRef.value.validate((valid) => {
- if (valid) {
- if (isEdit.value) {
- // 缂栬緫
- update(form).then(res => {
- if(res.code === 200){
- ElMessage.success('缂栬緫鎴愬姛')
- getList()
- }
- })
- } else {
- // 鏂板
- add(form).then(res => {
- if(res.code === 200){
- ElMessage.success('鏂板鎴愬姛')
- getList()
- }
- })
+ update(currentRecord.value).then(res => {
+ if (res.code === 200) {
+ ElMessage.success("浠樻淇℃伅宸蹭繚瀛�");
+ paymentDialogVisible.value = false;
+ getList();
}
- dialogVisible.value = false
- }
- })
-}
+ });
+ };
-const handleCurrentChange = (val) => {
- pagination.current = val.page
- pagination.size = val.limit
-}
+ const saveShipping = () => {
+ if (!shippingDate.value || !logisticsCompany.value || !trackingNo.value) {
+ ElMessage.warning("璇峰~鍐欏畬鏁寸殑鍙戣揣淇℃伅");
+ return;
+ }
+ currentRecord.value.shippingStatus = "宸插彂璐�";
+ update(currentRecord.value).then(res => {
+ if (res.code === 200) {
+ ElMessage.success("鍙戣揣淇℃伅宸蹭繚瀛�");
+ shippingDialogVisible.value = false;
+ getList();
+ }
+ });
+ };
+
+ const handleSubmit = () => {
+ formRef.value.validate(valid => {
+ if (valid) {
+ if (isEdit.value) {
+ // 缂栬緫
+ update(form).then(res => {
+ if (res.code === 200) {
+ ElMessage.success("缂栬緫鎴愬姛");
+ getList();
+ }
+ });
+ } else {
+ // 鏂板
+ add(form).then(res => {
+ if (res.code === 200) {
+ ElMessage.success("鏂板鎴愬姛");
+ getList();
+ }
+ });
+ }
+ dialogVisible.value = false;
+ }
+ });
+ };
+
+ const handleCurrentChange = val => {
+ pagination.current = val.page;
+ pagination.size = val.limit;
+ };
</script>
<style scoped>
-.search-row {
- margin-bottom: 20px;
-}
+ .search-row {
+ margin-bottom: 20px;
+ }
</style>
--
Gitblit v1.9.3