From 5952d34811ee82e797ef0070f84ff041381072a5 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期二, 10 三月 2026 17:52:40 +0800
Subject: [PATCH] 新增采购退货单增加费用等数据

---
 src/views/financialManagement/salesRefund/components/ReceiptandRefundPopupWindow.vue |  226 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 226 insertions(+), 0 deletions(-)

diff --git a/src/views/financialManagement/salesRefund/components/ReceiptandRefundPopupWindow.vue b/src/views/financialManagement/salesRefund/components/ReceiptandRefundPopupWindow.vue
new file mode 100644
index 0000000..d8218c1
--- /dev/null
+++ b/src/views/financialManagement/salesRefund/components/ReceiptandRefundPopupWindow.vue
@@ -0,0 +1,226 @@
+<template>
+  <el-dialog v-model="visible" title="鏀舵/閫�娆�" width="90%" append-to-body>
+    <div class="section">
+      <div class="section-title descriptions">鍩虹璧勬枡</div>
+      <el-form :model="form" label-width="100px">
+        <el-row :gutter="20">
+          <el-col :span="6">
+            <el-form-item label="鍗曟嵁缂栧彿">
+              <el-input v-model="form.billNo" placeholder="浣跨敤绯荤粺缂栧彿" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="瀹㈡埛">
+              <el-select v-model="form.customerId" placeholder="璇烽�夋嫨">
+                <el-option v-for="c in customerOptions" :key="c.value" :label="c.label" :value="c.value" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="鍒跺崟浜�">
+              <el-select v-model="form.makerId" placeholder="璇烽�夋嫨">
+                <el-option v-for="u in userOptions" :key="u.value" :label="u.label" :value="u.value" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="鍒跺崟鏃ユ湡">
+              <el-date-picker v-model="form.makeDate" type="date" value-format="YYYY-MM-DD" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="鐢宠閮ㄩ棬">
+              <el-select v-model="form.applyDeptId" placeholder="璇烽�夋嫨">
+                <el-option v-for="d in deptOptions" :key="d.value" :label="d.label" :value="d.value" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="澶囨敞">
+              <el-input v-model="form.remark" maxlength="100" show-word-limit placeholder="璇疯緭鍏�" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="闄勪欢">
+              <el-upload :action="uploadUrl" :headers="uploadHeaders" name="files" :on-success="onUploadSuccess">
+                <el-button>涓婁紶鏂囦欢</el-button>
+              </el-upload>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </div>
+
+    <div class="section">
+      <div class="toolbar">
+      <div class="section-title descriptions">浠樻鍒楄〃</div>
+        <el-input v-model="form.discountAmount" placeholder="浼樻儬閲戦" style="width:240px" />
+      </div>
+      <el-table :data="form.paymentList" border>
+        <el-table-column label="浠樻璐﹀彿" minWidth="160">
+          <template #default="scope">
+            <el-input v-model="scope.row.accountNo" placeholder="璇疯緭鍏�" />
+          </template>
+        </el-table-column>
+        <el-table-column label="浠樻璐﹀彿鍚嶇О" minWidth="180">
+          <template #default="scope">
+            <el-select v-model="scope.row.accountName" placeholder="璇烽�夋嫨">
+              <el-option v-for="a in accountOptions" :key="a.value" :label="a.label" :value="a.label" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column label="浠樻鏂瑰紡" minWidth="140">
+          <template #default="scope">
+            <el-select v-model="scope.row.payMethod" placeholder="璇烽�夋嫨">
+              <el-option v-for="m in payMethodOptions" :key="m.value" :label="m.label" :value="m.value" />
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column label="瀹為檯浠樻閲戦" minWidth="160">
+          <template #default="scope">
+            <el-input v-model="scope.row.amount" placeholder="璇疯緭鍏�" />
+          </template>
+        </el-table-column>
+        <el-table-column label="鎵嬬画璐�" minWidth="140">
+          <template #default="scope">
+            <el-input v-model="scope.row.fee" placeholder="璇疯緭鍏�" />
+          </template>
+        </el-table-column>
+        <el-table-column label="浜ゆ槗鍙�/绁ㄦ嵁鍙�" minWidth="180">
+          <template #default="scope">
+            <el-input v-model="scope.row.txNo" placeholder="璇疯緭鍏�" />
+          </template>
+        </el-table-column>
+        <el-table-column label="澶囨敞" minWidth="200">
+          <template #default="scope">
+            <el-input v-model="scope.row.remark" maxlength="30" show-word-limit placeholder="璇疯緭鍏�" />
+          </template>
+        </el-table-column>
+        <el-table-column label="鎿嶄綔" minWidth="120" fixed="right">
+          <template #default="scope">
+            <el-button link type="primary" @click="addPayment">鏂板涓�琛�</el-button>
+            <el-button link type="danger" @click="removePayment(scope.$index)">鍒犻櫎</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="summary">鍚堣</div>
+    </div>
+
+    <div class="section">
+      <div class="section-container">
+        <div class="section-title descriptions">婧愬崟淇℃伅</div>
+      <div class="source-toolbar">
+        <el-button @click="clearSource">娓呯┖</el-button>
+        <el-button @click="selectSource">閫夋嫨婧愬崟</el-button>
+        <el-button type="primary" @click="autoWriteOff">鑷姩鏍搁攢</el-button>
+      </div>
+      </div>
+      <el-table :data="form.sourceList" border>
+        <el-table-column label="鍗曟嵁鏃ユ湡" minWidth="160" prop="billDate" />
+        <el-table-column label="鍗曟嵁绫诲瀷" minWidth="160" prop="billType" />
+        <el-table-column label="鍗曟嵁缂栧彿" minWidth="200" prop="billNo" />
+        <el-table-column label="鍗曟嵁閲戦" minWidth="120" prop="billAmount" />
+        <el-table-column label="宸叉牳閿�閲戦" minWidth="120" prop="wroteAmount" />
+        <el-table-column label="鏈牳閿�閲戦" minWidth="120" prop="unWroteAmount" />
+        <el-table-column label="鏈鏍搁攢閲戦" minWidth="160">
+          <template #default="scope">
+            <el-input v-model="scope.row.thisWriteOffAmount" />
+          </template>
+        </el-table-column>
+        <el-table-column label="鎿嶄綔" width="100" fixed="right">
+          <template #default="scope">
+            <el-button link type="danger" @click="removeSource(scope.$index)">鍒犻櫎</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="summary">鍚堣</div>
+    </div>
+
+    <template #footer>
+      <el-button type="primary" @click="submit">纭</el-button>
+      <el-button @click="visible=false">鍙栨秷</el-button>
+    </template>
+  </el-dialog>
+</template>
+
+<script setup>
+import { ref } from 'vue';
+import { getToken } from '@/utils/auth';
+
+const visible = ref(false);
+const form = ref({
+  billNo: '',
+  customerId: undefined,
+  makerId: undefined,
+  makeDate: '',
+  applyDeptId: undefined,
+  remark: '',
+  discountAmount: '',
+  paymentList: [{ accountNo: '', accountName: '', payMethod: '', amount: '', fee: '', txNo: '', remark: '' }],
+  sourceList: [{ billDate: '', billType: '', billNo: '', billAmount: 0, wroteAmount: 0, unWroteAmount: 0, thisWriteOffAmount: '' }]
+});
+
+const customerOptions = ref([]);
+const userOptions = ref([]);
+const deptOptions = ref([]);
+const accountOptions = ref([]);
+const payMethodOptions = ref([]);
+
+const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/basic/customer-follow/upload';
+const uploadHeaders = { Authorization: 'Bearer ' + getToken() };
+
+function addPayment() {
+  form.value.paymentList.push({ accountNo: '', accountName: '', payMethod: '', amount: '', fee: '', txNo: '', remark: '' });
+}
+function removePayment(i) {
+  form.value.paymentList.splice(i, 1);
+}
+function removeSource(i) {
+  form.value.sourceList.splice(i, 1);
+}
+function clearSource() {
+  form.value.sourceList = [];
+}
+function selectSource() {}
+function autoWriteOff() {}
+function onUploadSuccess() {}
+
+function open(payload) {
+  visible.value = true;
+}
+function submit() {
+  visible.value = false;
+  emit('submitted');
+}
+
+defineExpose({ open });
+</script>
+
+<style scoped>
+.section { background: #fff; border-radius: 8px; box-shadow: 0 2px 12px 0 rgba(0,0,0,0.05); padding: 16px; margin-bottom: 16px; }
+.section-title { font-weight: 600; margin-bottom: 12px; }
+.descriptions {
+  margin-bottom: 20px;
+  display: inline-block;
+  font-size: 1rem;
+  font-weight: 600;
+  padding-left: 12px;
+  position: relative;
+}
+.descriptions::before {
+  content: "";
+  position: absolute;
+  left: 0;
+  top: 50%;
+  transform: translateY(-50%);
+  width: 4px;
+  height: 1rem;
+  background-color: #002FA7;
+  border-radius: 2px;
+}
+.toolbar { margin-bottom: 10px; display: flex;     justify-content: space-between;
+    align-items: center; }
+.source-toolbar { margin-bottom: 10px; display: flex; gap: 8px; }
+.summary { padding: 8px 12px; background: #fff7e6; color: #ad6800; }
+.section-container{display: flex;align-items: center;justify-content: space-between; }
+</style>

--
Gitblit v1.9.3