From 4eac422e52a4d28fb651b75d0f054697c7a2c0fa Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期一, 09 二月 2026 15:14:13 +0800
Subject: [PATCH] 优化

---
 admin/src/components/business/OperaOrderRefundWindow.vue |  277 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 277 insertions(+), 0 deletions(-)

diff --git a/admin/src/components/business/OperaOrderRefundWindow.vue b/admin/src/components/business/OperaOrderRefundWindow.vue
new file mode 100644
index 0000000..d8b2cd4
--- /dev/null
+++ b/admin/src/components/business/OperaOrderRefundWindow.vue
@@ -0,0 +1,277 @@
+<template>
+  <GlobalWindow
+      :title="title"
+      width="100%"
+      :visible.sync="visible"
+  >
+    <div class="detail-box"  >
+      <p class="tip-warn" style="margin-bottom: 30px;font-size: 14px;">
+        <i class="el-icon-warning"></i>
+        鎿嶄綔璇存槑锛氭偍姝i拡瀵硅鍗�<span class="red">{{ info.code }} </span>杩涜閫�娆炬搷浣滐紝璇ユ搷浣滀笉鍙�嗚璋ㄦ厧鎿嶄綔锛侊紒</p>
+      <div class="header">
+        <div  class="header-b">鍟嗗搧淇℃伅</div>
+      </div>
+      <div class="info-item"  >
+        <el-table  :data="info.goodsorderDetailList||[]"  stripe  border >
+          <el-table-column prop="imgurl" label="鍟嗗搧鍥�" min-width="80px" align="center">
+            <template slot-scope="{row}">
+              <el-image style="width: 50px;height: 50px;" v-if="row.imgurl && row.imgurl!=''" :src="row.imgurl" :preview-src-list="[row.imgurl]"></el-image>
+            </template>
+          </el-table-column>
+          <el-table-column prop="name" label="鍟嗗搧鍚嶇О"   align="center" min-width="150px">  </el-table-column>
+          <el-table-column prop="categoryName" label="鍟嗗搧鍒嗙被"   align="center" min-width="150px">  </el-table-column>
+          <el-table-column prop="goodsWeight" label="閲嶉噺(kg)" align="center" min-width="150px"></el-table-column>
+          <el-table-column prop="price" label="閿�鍞环(鍏�)" align="center" min-width="100px">
+            <template slot-scope="{row}">
+              <span>锟{(row.price || 0).toFixed(2)}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="goodsNum" label="鏁伴噺" align="center" min-width="150px"></el-table-column>
+          <el-table-column prop="totalPrice" label="灏忚(鍏�)" align="center" min-width="150px">
+            <template slot-scope="{row}">
+              <span class="orange">锟{(row.totalPrice || 0).toFixed(2)}}</span>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <div class="info-item"  >
+        <div class="info-item-a">鍟嗗搧鎬讳环锛�<span> 锟{((info.totalPrice||0)-(info.mailPrice || 0)).toFixed(2)}}</span></div>
+        <div class="info-item-a">蹇�掕垂锛�<span>锟{(info.mailPrice||0).toFixed(2)}}</span></div>
+        <div class="info-item-a">璁㈠崟鎬讳环锛�<span> 锟{(info.totalPrice||0).toFixed(2)}}</span></div>
+      </div>
+      <div class="info-item"  >
+        <div class="info-item-a">绉垎鎶垫墸锛�<span v-if="(info.integral||0)>0">-锟{(info.integral||0).toFixed(2) +'  '}}浣跨敤{{(info.useIntegral||0)}}绉垎鎶垫墸锟{(info.integral||0).toFixed(2) +'  '}}鍏�</span></div>
+        <div class="info-item-a">浼樻儬鍒革細<span v-if="(info.couponPrice||0)>0">-锟{(info.couponPrice||0).toFixed(2) +'  '}} 浣跨敤{{info.couponName}}</span></div>
+        <div class="info-item-a">缁忛攢鍟嗙粨绠楋細<span style="margin-right: 10px;"> 锟{(info.shopSettlement||0).toFixed(2)}}</span>锛坽{info.shopName}}锛�</div>
+      </div>
+      <div class="info-item"  >
+        <div class="info-item-a">瀹炰粯閲戦锛�<span class="red"> 锟{(info.price||0).toFixed(2)}}</span></div>
+        <div class="info-item-a">杩旇繕鐢ㄦ埛绉垎锛�<span class="orange"> {{(info.returnMemberIntegral||0)}}</span></div>
+        <div class="info-item-a">杩旇繕缁忛攢鍟嗙Н鍒嗭細<span class="orange">锟{(info.shopSettlement || 0).toFixed(2) }}</span></div>
+      </div>
+      <div class="header">
+        <div  class="header-b">閫�娆惧唴瀹�</div>
+        <div class="info-item"  >
+          <el-form :model="form" ref="form" label-width="120px" label-suffix="锛�"  :rules="rules" inline>
+            <el-form-item label="閫�娆鹃噾棰�" prop="money" style="display: block;">
+              <el-input type="number"  v-model="form.money" placeholder="璇疯緭鍏ラ��娆鹃噾棰�" v-trim>  <template slot="append"> 鍏�</template>  </el-input>
+              <span class="tip-warn" style="margin-bottom: 30px;font-size: 14px;">   <i class="el-icon-warning"></i>
+              鎻愮ず锛氬綋鍓嶈鍗曟渶澶氬彲閫�閲戦涓�<span class="red">{{(info.price||0).toFixed(2)}}</span></span>
+            </el-form-item>
+            <div style="display:flex;">
+              <el-form-item label="閫�杩�" prop="refundInfo"  style="display: inline;">
+                <el-checkbox style="border: none;" v-model="form.returnUseCouponStatus" label="閫�杩樺鎴蜂紭鎯犲埜" border></el-checkbox>
+              </el-form-item>
+              <el-form-item label="" prop="refundInfo"  style="display: inline;">
+                <el-checkbox style="border: none"  v-model="form.returnUseIntegralStatus" label="閫�杩樺鎴风Н鍒�" border></el-checkbox>
+              </el-form-item>
+            </div>
+            <div style="display:flex;">
+              <el-form-item label="鎵i櫎" prop="refundInfo"  style="display: inline;">
+                <el-checkbox style="border: none"  v-model="form.returnShopSettlementStatus" label="鎵i櫎缁忛攢鍟嗗凡缁撶畻閲戦" border></el-checkbox>
+              </el-form-item>
+              <el-form-item label="" prop="refundInfo"  style="display: inline;">
+                <el-checkbox style="border: none"  v-model="form.returnIntegralStatus" label="鎵i櫎宸茶繑瀹㈡埛绉垎" border></el-checkbox>
+              </el-form-item>
+              <el-form-item label="" prop="refundInfo"  style="display: inline;">
+                <el-checkbox style="border: none"  v-model="form.returnShopIntegralStatus" label="鎵i櫎宸茶繑缁忛攢鍟嗙Н鍒�" border></el-checkbox>
+              </el-form-item>
+            </div>
+            <el-form-item label="澶囨敞" prop="remark"  style="display: block;">
+              <el-input type="textarea" :autosize="{ minRows: 4, maxRows:4 }" style="width: 500px;" v-model="form.remark" placeholder="璇疯緭鍏ュ彇娑堣鏄�"  v-trim/>
+            </el-form-item>
+          </el-form>
+        </div>
+      </div>
+    </div>
+    <template  v-slot:footer>
+      <el-button type="primary" @click="confirm">纭</el-button>
+      <el-button @click="visible=false">杩斿洖</el-button>
+    </template>
+  </GlobalWindow>
+</template>
+
+<script>
+import GlobalWindow from '@/components/common/GlobalWindow'
+import BaseOpera from '@/components/base/BaseOpera'
+import { shopDetail } from '@/api/business/shop'
+export default {
+  name: 'OperaOrderRefundWindow',
+  extends: BaseOpera,
+  components: { GlobalWindow },
+  data () {
+    return {
+      title: '',
+      visible2: false,
+      visible: false,
+      tabelHeight: null,
+      info: {},
+      shopInfo: {},
+      rules: {
+        money: [
+          { required: true, message: '璇疯緭鍏ラ��娆鹃噾棰�', tigger: 'blur' }
+        ]
+      },
+      // 鎼滅储
+      form: {
+        orderId: '',
+        money: null,
+        returnShopIntegralStatus: false,
+        returnIntegralStatus: false,
+        returnShopSettlementStatus: false,
+        returnUseIntegralStatus: false,
+        returnUseCouponStatus: false,
+        remark: ''
+      }
+    }
+  },
+  created () {
+    this.config({
+      module: '璁㈠崟淇℃伅琛�',
+      api: '/business/goodsorder',
+      'field.id': 'id',
+      'field.main': 'id'
+    })
+  },
+  methods: {
+    successBiz () {
+      this.loadInfo()
+      this.$emit('success')
+    },
+    loadInfo () {
+      shopDetail(this.info.distributionShopId).then(res => {
+        this.shopInfo = res || this.shopInfo
+      })
+    },
+    open (title, info) {
+      this.title = title
+      this.visible = true
+      this.info = info || {}
+      this.form = {
+        orderId: info.id,
+        money: null,
+        returnShopIntegralStatus: false,
+        returnIntegralStatus: false,
+        returnShopSettlementStatus: false,
+        returnUseIntegralStatus: false,
+        returnUseCouponStatus: false,
+        remark: ''
+      }
+
+      if (this.info.distributionShopId != null) {
+        this.loadInfo()
+      }
+    },
+    doSubmit () {
+
+    },
+    confirm () {
+      this.$refs.form.validate((valid) => {
+        if (!valid) {
+          return
+        }
+        var msg = `纭畾瀵硅鍗曘��${this.info.code}銆戣繘琛岄��娆炬搷浣滃悧锛焋
+        if (this.form.returnShopSettlementStatus && (this.info.shopSettlement || 0) > 0 && (this.info.shopSettlement || 0) > (this.shopInfo.amount || 0)) {
+          msg = '缁忛攢鍟嗕綑棰濅笉瓒筹紝' + msg
+        }
+        this.$dialog.messageWaring(msg)
+          .then(() => {
+            this.isWorking = true
+            this.api.orderRefund({
+              orderId: this.form.orderId,
+              money: this.form.money,
+              returnShopIntegralStatus: this.form.returnShopIntegralStatus ? 1 : 0,
+              returnIntegralStatus: this.form.returnIntegralStatus ? 1 : 0,
+              returnShopSettlementStatus: this.form.returnShopSettlementStatus ? 1 : 0,
+              returnUseIntegralStatus: this.form.returnUseIntegralStatus ? 1 : 0,
+              returnUseCouponStatus: this.form.returnUseCouponStatus ? 1 : 0,
+              remark: this.form.remark
+            })
+              .then(() => {
+                this.visible = false
+                this.$tip.apiSuccess('閫�娆炬垚鍔�')
+                this.$emit('success')
+              }).catch(e => {
+                this.$tip.apiFailed(e)
+              })
+              .finally(() => {
+                this.isWorking = false
+              })
+          })
+        // 璋冪敤鏂板缓鎺ュ彛
+      })
+    }
+  }
+}
+</script>
+<style scoped  lang="scss">
+.table-pagination{
+  position: fixed !important;
+  bottom: 50px;
+}
+.header-b{
+  display: inline-block;
+  font-size: 16px;
+  font-weight: bold;
+}
+.header-red-btn{
+  display: inline-block;
+  font-size: 12px;
+  background-color:  red;
+  padding: 2px 10px 3px 10px;
+  margin-left: 20px;
+  color: white;
+  cursor: pointer;
+  border-radius: 5px ;
+}
+.header-blue-btn{
+  display: inline-block;
+  font-size: 12px;
+  background-color:  #216EEE;
+  padding: 2px 10px 3px 10px;
+  margin-left: 20px;
+  color: white;
+  cursor: pointer;
+  border-radius: 5px ;
+}
+.header-grey{
+  display: inline-block;
+  font-size: 12px;
+  border: 1px solid grey;
+  padding: 2px 10px;
+  margin-left: 20px;
+  color: grey;
+  border-radius: 5px ;
+}
+.header-orange{
+  display: inline-block;
+  font-size: 12px;
+  border: 1px solid orange;
+  padding: 2px 10px;
+  margin-left: 20px;
+  color: orange;
+  border-radius: 5px ;
+}
+.header-btn{
+  display: inline-block;
+  border: none;
+  padding: 2px 10px;
+  margin-left: 20px;
+}
+.info-item{
+  display: flex;
+  width: 100%;
+  margin: 15px;
+}
+.info-item-a{
+  flex: 1;
+  font-size: 14px;
+
+}
+.info-item-a span{
+}
+.info-item-a  .btn{
+  font-size: 12px !important;
+  cursor: pointer !important;
+}
+</style>

--
Gitblit v1.9.3