MONSTER-ygh 1 settimana fa
parent
commit
b66d56481e

+ 9 - 0
src/api/order/groupBuyingMr.js

@@ -99,4 +99,13 @@ export const listGoodsByTeamIdApi = (data) => {
     method: 'get',
     params: data,
   })
+}
+
+// 对公支付凭证修改
+export const updateCorporateApi = (data) => {
+  return request({
+    url: '/order/orderInfo/updateCorporate',
+    method: 'post',
+    data: data
+  })
 }

+ 264 - 0
src/views/order/groupBuyingMr/dialog/payOrCredit.vue

@@ -0,0 +1,264 @@
+<!--
+ * @Description: 详情弹框
+ * @Author: Sugar.
+ * @Date: 2023-11-24 13:55:00
+ * @LastEditors: gcz
+ * @LastEditTime: 2025-03-20 15:37:39
+ * @FilePath: \great_webui\src\views\order\groupBuyingMr\dialog\details.vue
+ * @Copyright: Copyright (c) 2016~2023 by Sugar., All Rights Reserved.
+-->
+<template>
+  <el-dialog :title="title" :visible.sync="open" width="500" append-to-body :close-on-click-modal="false"
+    @close="cancel">
+    <div class="dialog" v-if="form">
+      <div v-loading="loading" element-loading-text="加载详情中...">
+        <!-- 对公支付信息 -->
+        <el-form :model="form" ref="form" size="mini" :rules="rules" label-width="150px">
+          <el-form-item label="对公支付凭证上传:" prop="voucherUrl">
+            <div style="display: flex;flex-wrap: wrap;">
+              <div v-for="(item, index) in form.voucherUrl" :key="index"
+                style="width: 100px; height: 100px;margin-top: 5px; position: relative;border: 1px solid #999;border-radius: 5px;margin-right: 20px;">
+                <el-image style="width: 100%; height: 100%" :src="item" :preview-src-list="form.voucherUrl">
+                </el-image>
+                <span @click="handleRemove(index)"
+                  style="position: absolute;top: -15px;right: -15px;color: red;font-size: 24px;z-index: 999;cursor: pointer;">
+                  <i class="el-icon-error"></i>
+                </span>
+              </div>
+              <div style="width: 100px; height: 100px;margin-top: 5px;" v-if="!form.voucherUrl || form.voucherUrl.length < 15"
+                v-loading="actionUrlLoading" element-loading-text="上传中..." element-loading-spinner="el-icon-loading"
+                element-loading-background="rgba(0, 0, 0, 0.8)">
+                <el-upload class="avatar-uploader" :action="uploadObj.url" :headers="uploadObj.headers"
+                  :show-file-list="false" :before-upload="beforeAvatarUpload" :on-success="handleAvatarSuccess"
+                  :on-progress="handleAvatarProgress" :disabled="actionUrlLoading" :on-error="handleAvatarError">
+                  <i class="el-icon-plus avatar-uploader-icon"></i>
+                </el-upload>
+              </div>
+            </div>
+          </el-form-item>
+          <el-form-item label="备注:" prop="remark">
+            <el-input v-model="form.remark" type="textarea" placeholder="请输入备注"></el-input>
+          </el-form-item>
+        </el-form>
+      </div>
+    </div>
+
+
+    <span slot="footer" class="dialog-footer">
+      <el-button type="primary" @click="cancel">关闭</el-button>
+      <el-button type="primary" @click="updateCorporateFun()" :loading="loading">
+        <span v-if="loading">提交中...</span>
+        <span v-else>确认修改</span>
+      </el-button>
+    </span>
+
+  </el-dialog>
+</template>
+
+<script>
+import { getSelectById, updateCorporateApi } from '@/api/order/groupBuyingMr'
+import { getToken } from "@/utils/auth";
+export default {
+  name: "detailsDia11",
+  data() {
+    return {
+      title: "订单详情",
+      model: "EDIT",
+      open: false,
+      loading: false,
+      form: {
+        id: undefined
+      },
+      rules: {
+        voucherUrl: [{ required: true, message: "请上传凭证", trigger: ["change","blur"] }],
+        remark: [
+          { required: true, message: '请输入备注', trigger: ['change','blur' ]}
+        ],
+      },
+      loading_form: false,//  加载表单
+      orderType: 'normal', // 订单类型 normal:没有新订单和原订单,new:有新订单,old:有原订单
+      uploadObj: {
+        url: process.env.VUE_APP_UPLOAD_FILE_API + "/upload/single/minio",
+        Headers: { Authorization: "Bearer " + getToken() },
+      },
+      actionUrlLoading:false,
+    };
+  },
+  methods: {
+    /**
+     * 打开弹框
+     * @date 2023-11-22
+     * @param {any} obj
+     * @returns {any}
+     */
+    async openDialog(title, obj, type) {
+      this.orderType = type;
+      this.title = title
+      this.open = true;
+      await this.getSelectByIdApi(obj);
+      this.$nextTick(() => {
+        this.$refs["form"].clearValidate();
+      });
+    },
+    /** 获取详情 */
+    async getSelectByIdApi(row) {
+      let id = row.id;
+      try {
+        this.loading = true
+        let res = await getSelectById(id)
+        this.seatSelectList = res.data.viewersOrderList
+        this.resubmit = res.data.resubmit||{};
+        this.form = {
+          ...res.data,
+          orderId: res.id,
+          voucherUrl: [],
+          remark: null,
+        };
+        console.log('this.form',this.form);
+        this.form.payOrCredit = null
+        if(res.data.corporate){
+          this.form.payOrCredit = 1
+          this.form.voucherUrl = res.data.corporate.voucherUrl.split(',')||[];
+          this.form.remark =  res.data.corporate.remark;
+        }
+        this.loading = false
+      } catch (error) {
+        this.loading = false
+      }
+      
+    },
+    /** 对公支付凭证修改 */
+    async updateCorporateFun() {
+      this.$refs["form"].validate(async (valid) => {
+        if (valid) {
+          try {
+            if(this.form.voucherUrl.length==0) {
+              this.$message.error("请上传凭证!");
+            }
+            this.loading = true
+            let param = JSON.parse(JSON.stringify(this.form))
+            param.voucherUrl = param.voucherUrl
+            let res = await updateCorporateApi(param)
+            if(res.code == 200) {
+              this.$message.success("操作成功!");
+              this.loading = false
+              this.$emit("getList");
+              this.cancel()
+            }else {
+              this.loading = false
+            }
+          } catch (error) {
+            console.error(error)
+            this.loading = false
+          }
+        }
+      })
+    },
+    /**
+     * 关闭弹框
+     * @date 2023-11-22
+     * @returns {any}
+     */
+    cancel() {
+      this.open = false;
+    },
+    /**  上传图片 单张  */
+    handleAvatarSuccess(response, file, fileList) {
+      console.log("res, file",response, file, fileList)
+      this.actionUrlLoading = false
+      if(response.code == 200) {
+        this.form.voucherUrl.push(response.data.url)
+      }
+      this.$refs.form.validateField('voucherUrl')
+    },
+    beforeAvatarUpload(file) {
+      const isLt2M = file.size / 1024 / 1024 <= 100;
+      let testmsg = file.name.substring(file.name.lastIndexOf('.')+1)
+      let typeList = ['png','jepg','jpg','gif']
+      const isJPG = typeList.includes(testmsg);
+      if (!isJPG) {
+        this.$message.error(`上传图片图片只能是 ${typeList} 格式!`);
+      }
+      if (!isLt2M) {
+        this.$message.error('上传图片图片大小不能超过 100MB!');
+      }
+      return isJPG && isLt2M;
+    },
+    handleAvatarProgress(){
+      this.actionUrlLoading = true
+    },
+    handleAvatarError() {
+      this.actionUrlLoading = false
+    },
+    handleRemove(index) {
+      this.form.voucherUrl.splice(index,1)
+      this.$refs.form.validateField('voucherUrl')
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.dialog {
+  width: 100%;
+}
+.dialog {
+  padding: 0 30px;
+  .upload-btn {
+    width: 100px;
+    height: 100px;
+    background-color: #fbfdff;
+    border: dashed 1px #c0ccda;
+    border-radius: 5px;
+    i {
+      font-size: 30px;
+      margin-top: 20px;
+    }
+    &-text {
+      margin-top: -10px;
+    }
+  }
+  .avatar {
+    cursor: pointer;
+  }
+  .title-class{
+    font-size: 16px;
+    font-weight: bold;
+    color: black;
+    margin-bottom: 20px;
+    margin-top: 20px;
+  }
+  .item-class{
+    margin-bottom: 20px;
+  }
+}
+
+.voucher-list{
+  display: grid;
+  grid-template-columns: repeat(4, 1fr);
+  gap: 24rpx;
+}
+.pay-type-remark{
+  margin:14px 0;
+}
+
+.dialog-bbb {
+  width: 100%;
+  display: flex;
+  --widdd: 700px;
+
+  >div:first-child {
+    width: var(--widdd);
+    flex-shrink: 0;
+    overflow-y: auto;
+    padding: 0 0 10px 0;
+    margin-right: 10px;
+  }
+
+  .dialog-bbb_2 {
+    width: calc(100% - var(--widdd));
+    height: 100%;
+  }
+}
+
+</style>

+ 15 - 3
src/views/order/groupBuyingMr/index.vue

@@ -351,6 +351,10 @@
                   command="6" 
                   v-if="hasPermi('groupBuyingMr:groupBuyingMr:rebook') && scope.row.status == 3 && scope.row.allowReSubmit == 1"
                   >改签</el-dropdown-item>
+                  <el-dropdown-item 
+                  command="7" 
+                  v-if="hasPermi('groupBuyingMr:groupBuyingMr:duigongedit') && (scope.row.status == 3 || scope.row.status == 7)"
+                  >修改凭证</el-dropdown-item>
                 </el-dropdown-menu>
               </el-dropdown>
             </template>
@@ -374,7 +378,8 @@
     <resetOrder ref="resetOrder" :dict="dict" @getList="getList" />
     <!-- 编辑  -->
     <editBox ref="editBox" @getList="getList" />
-
+    <!--  修改凭证  -->
+    <payOrCredit ref="payOrCredit" @getList="getList" />
     <el-dialog
         title="选择小票机"
         :visible.sync="dialogVisible"
@@ -512,7 +517,7 @@ import {
 import { orderInfoCancel } from '@/api/windowTicketSales/ticketingSales';
 import detailsDia from "./dialog/details.vue";
 import resetOrder from "./dialog/resetOrder.vue";
-
+import payOrCredit from "./dialog/payOrCredit.vue";
 import { printApi } from '@/api/order/orderMr'
 import { getSelectById } from '@/api/order/groupBuyingMr'
 import { pageList as getPrintListApi } from "@/api/device/pda";
@@ -525,7 +530,7 @@ const axios = require('axios');
 export default {
   name: "GroupBuyingMr",
   dicts: ['agreement_type', 'team_type','order_status_type','pay_way_type'],
-  components: { detailsDia, resetOrder, editBox },
+  components: { detailsDia, resetOrder, editBox, payOrCredit },
   data() {
     return {
       qHeight: '0px',
@@ -1199,10 +1204,17 @@ export default {
         case "6":
           this.handGoRebook(row);
           break;
+        case "7":
+          this.handPayOrCredit(row);
+          break;
         default:
           break;
       }
     },
+    /** 修改凭证  */
+    handPayOrCredit(row){
+      this.$refs["payOrCredit"].openDialog("修改凭证", row, 'normal');
+    },
     /**  打开修改订单   */
     handleEditOpen(row) {
       this.$refs["editBox"].openDialog("详情", row, 'normal');

+ 4 - 6
src/views/order/viewers/index.vue

@@ -189,7 +189,7 @@
               <span v-hasPermi="['order:viewers:tuikuai']" style="display: inline-block;">
                 <el-button
                 style="margin-left: 10px;"
-                v-if="scope.row.status == 3 || scope.row.status == 6 || scope.row.status == 7 || scope.row.status == 8" size="mini" type="text"
+                v-if="(scope.row.status == 3 || scope.row.status == 6 || scope.row.status == 7 || scope.row.status == 8) && scope.row.source != 1 && scope.row.source != 6" size="mini" type="text"
                 @click="openRefundSubmitModel([scope.row])"
                 >退款</el-button>
               </span>
@@ -322,11 +322,6 @@
               :rows="3"
               v-model="tkRuleForm.remark"></el-input>
             </el-form-item>
-            <el-form-item label="" prop="remark">
-              <div style="">
-                注意:此订单来源于改签/升舱的订单。
-              </div>
-            </el-form-item>
             
           </el-form>
         </div>
@@ -809,6 +804,9 @@ export default {
           item.viewerList.forEach(viewer => {
             refundAmount = mathM.format(Number(refundAmount) + Number(viewer.salePrice), 10);
             refundAmountAll = mathM.format(Number(refundAmountAll) + Number(viewer.salePrice), 10);
+            if(viewer.orgRealPrice) {
+              refundAmountAll = mathM.format(Number(refundAmountAll) + Number(viewer.orgRealPrice), 10);
+            }
           });
           item.refundAmount = refundAmount;
           refundPeople += item.viewerList.length;