浏览代码

团购订单:详情支付信息,开具发票功能需求实现

shipeng 1 周之前
父节点
当前提交
c76a4e39f1

+ 9 - 0
src/api/financeMr/InvoiceRecords.js

@@ -38,6 +38,15 @@ export function getInvoiceDetail(params) {
   });
 }
 
+// 开票详情
+export function getInvoiceInfo(params) {
+  return request({
+    url: '/order/orderInvoice/getInvoiceDetail',
+    method: 'get',
+    params
+  });
+}
+
 //  订单查询
 export function queryOrderIdFun(params) {
   return request({

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

@@ -108,4 +108,21 @@ export const updateCorporateApi = (data) => {
     method: 'post',
     data: data
   })
+}
+
+// 提交开票
+export const saveAndEdit = (data) => {
+  return request({
+    url: '/order/orderInvoice/submit',
+    method: 'post',
+    data: data
+  })
+}
+
+// 获取开票信息
+export function getInvoiceInfo(id) {
+  return request({
+    url: '/order/orderInvoice/getInvoiceInfo?orderId=' + id,
+    method: 'get'
+  })
 }

+ 1 - 1
src/views/finance/InvoiceRecords/dialog/details.vue

@@ -35,7 +35,7 @@
             <div class="grid-content bg-purple item-class">申请类型: <span v-if="form.invoiceLine == 'bs'">数电专票</span><span v-else-if="form.invoiceLine == 'pc'">数电普票</span></div>
           </el-col>
           <el-col :span="24">
-            <div class="grid-content bg-purple item-class">纳税人识别号: <span>{{ form.creditCode || '-' }}</span></div>
+            <div class="grid-content bg-purple item-class">纳税人识别号: <span>{{ form.creditCode || '-' }}</span></div>
           </el-col>
           <el-col :span="24">
             <div class="grid-content bg-purple item-class">联系电话: <span>{{ form.mobile }}</span></div>

+ 323 - 0
src/views/order/groupBuyingMr/dialog/aduitInvoice.vue

@@ -0,0 +1,323 @@
+<!--
+ * @Description: 新增/编辑弹框
+-->
+<template>
+  <el-dialog
+    title="申请开票"
+    v-if="isShow"
+    :visible.sync="isShow"
+    width="700px"
+    append-to-body
+    :close-on-click-modal="false"
+    @close="cancel"
+  >
+    <div class="dialog">
+      <el-form :model="aduitForm" ref="aduitForm" :rules="formRules" label-width="150px">
+        <el-form-item label="抬头类型" prop="handlerType">
+          <el-radio-group v-model="aduitForm.handlerType" @input="changeType">
+            <el-radio :label="2">企业</el-radio>
+            <el-radio :label="1">个人</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item v-if="aduitForm.handlerType == 2" label="申请类型:" prop="invoiceLine">
+          <el-select
+            v-model="aduitForm.invoiceLine"
+            placeholder="请选择申请类型"
+            clearable
+            style="width: 100%;"
+          >
+            <el-option
+              v-for="dict in listType"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="抬头名称:" prop="name">
+          <el-input
+            v-model="aduitForm.name"
+            placeholder="请输入抬头名称"
+            clearable
+            style="width: 100%;"
+          />
+        </el-form-item>
+        <el-form-item v-if="aduitForm.handlerType == 2" label="税号:" prop="creditCode">
+          <el-input
+            v-model="aduitForm.creditCode"
+            placeholder="请输入税号"
+            clearable
+            style="width: 100%;"
+          />
+        </el-form-item>
+        <el-form-item label="电子邮箱:" prop="email">
+          <el-input
+            v-model="aduitForm.email"
+            placeholder="请输入电子邮箱"
+            clearable
+            style="width: 100%;"
+          />
+        </el-form-item>
+        <el-form-item label="发票金额(¥):" prop="invoiceAmount">
+          <el-input
+            v-model="aduitForm.invoiceAmount"
+            placeholder="发票金额"
+            disabled
+            clearable
+            style="width: 100%;"
+          />
+        </el-form-item>
+        
+      </el-form>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="cancel">取消</el-button>
+      <el-button
+        type="primary"
+        @click="submitForm"
+        v-loading.fullscreen.lock="loading"
+        element-loading-text="提交中..."
+        element-loading-spinner="el-icon-loading"
+        element-loading-background="rgba(0, 0, 0, 0.8)"
+      >
+        <span v-if="loading">提交中...</span>
+        <span v-else>保存</span>
+      </el-button>
+    </span>
+  </el-dialog>
+</template>
+
+<script>
+import { 
+  saveAndEdit,
+  getSelectById,
+  getInvoiceInfo
+} from '@/api/order/groupBuyingMr';
+import Editor from "@/components/Editor";
+
+export default {
+  name: "addAndEdit",
+  components: {
+    Editor,
+  },
+  data() {
+    let checkEmail = (rule, value, callback) => {
+      const regEmail = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
+      if (value && !regEmail.test(value)) {
+        callback(new Error('请输入有效的邮箱'));
+      } else {
+        callback(); // 确保调用 callback
+      }
+    };
+    return {
+      model: "EDIT",
+      isShow: false,
+      loading: false,
+      aduitForm: {
+        id: '',
+        invoiceAmount: '',
+        invoiceLine: '',
+        handlerType: '',
+        name: '',
+        creditCode: '',
+        mobile: '',
+        email: ''
+      },
+      listType: [
+          {
+              "label": "数电专票",
+              "value": 'bs',
+          },
+          {
+              "label": "数电普票",
+              "value": 'pc',
+          },
+      ],
+      formRules: {
+        name: [{ required: true, message: "请输入抬头名称", trigger: "blur" }],
+        invoiceLine: [{ required: true, message: "请选择申请类型", trigger: "change" }], 
+        email: [
+          { required: true, message: "请输入电子邮箱", trigger: "blur" },
+          {validator: checkEmail, trigger: "blur" }
+        ],
+        creditCode: [{ required: true, message: "请输入税号", trigger: "blur" }],
+      },
+    };
+  },
+  methods: {
+    /**
+     * 打开弹框
+     * @date 2023-11-22
+     * @param {any} obj
+     * @returns {any}
+     */
+    openDialog(title, obj, type) {
+      this.isShow = true;
+      // this.$set(this.form, 'handlerType', 2);
+      // this.reset();
+      this.$set(this.aduitForm, 'invoiceAmount', obj.realPrice || obj.invoiceAmount);
+      this.$set(this.aduitForm, 'id', type ? obj.orderId: obj.id);
+      this.$set(this.aduitForm, 'handlerType', 2);
+      this.$nextTick(() => {
+        if (this.$refs["aduitForm"]) {
+          console.log('表单已初始化');
+        }
+      });
+      // this.$nextTick(() => {
+      //     this.$refs["aduitForm"].clearValidate();
+      // });
+      // if (obj) {
+      //   // this.getSelectByIdApi(obj);
+      // } else {
+      //   this.$nextTick(() => {
+      //     this.$refs["aduitForm"].clearValidate();
+      //   });
+      // }
+    },
+    /** 获取开票信息 */
+    getSelectByIdApi(row) {
+      const id = row.id
+      getInvoiceInfo(id).then(response => {
+        const obj = response.data;
+        this.$nextTick(() => {
+          this.$nextTick(() => {
+            this.$set(this.aduitForm, 'id', obj.id);
+            this.$set(this.aduitForm, 'handlerType', obj.handlerType);
+            this.$set(this.aduitForm, 'name', obj.name);
+            this.$set(this.aduitForm, 'invoiceLine', obj.invoiceLine)
+            this.$set(this.aduitForm, 'email', obj.email);
+            this.$set(this.aduitForm, 'invoiceAmount', obj.invoiceAmount);
+            this.$set(this.aduitForm, 'creditCode', obj.creditCode);
+            this.$nextTick(() => {
+              this.$refs["aduitForm"].clearValidate();
+            });
+          });
+        });
+      });
+    },
+    // 保存
+    submitForm() {
+      console.log(this.formRules,'55555');
+      console.log(this.$refs["aduitForm"], '111'); // 检查表单引用
+      this.$refs["aduitForm"].validate((valid) => {
+        console.log('校验结果:', valid); // 检查校验结果
+        if (valid) {
+          console.log(3333, '111333'); // 校验通过后的逻辑
+          try {
+            this.loading = true;
+            let params = {
+              orderId: this.aduitForm.id,
+              invoiceAmount: this.aduitForm.invoiceAmount,
+              invoiceLine: this.aduitForm.invoiceLine,
+              invoiceHandler: {
+                handlerType: this.aduitForm.handlerType,
+                name: this.aduitForm.name,
+                creditCode: this.aduitForm.creditCode,
+                mobile: this.aduitForm.mobile,
+                email: this.aduitForm.email
+              }
+            };
+            saveAndEdit({ ...params }).then(({ code }) => {
+              if (code === 200) {
+                this.$message.success("操作成功!");
+                this.$emit("getList");
+                this.cancel();
+              }
+            });
+          } catch (error) {
+            console.error(error);
+          } finally {
+            this.loading = false;
+          }
+        } else {
+          console.error('表单校验失败');
+        }
+      });
+    },
+    /**
+     * 重置
+     * @date 2023-11-22
+     * @returns {any}
+     */
+    reset() {
+      this.$set(this.aduitForm, 'id', "");
+      this.$set(this.aduitForm, 'handlerType', '');
+      this.$set(this.aduitForm, 'invoiceLine', "")
+      this.$set(this.aduitForm, 'email', "");
+      this.$set(this.aduitForm, 'name', "");
+      this.$set(this.aduitForm, 'invoiceAmount', "");
+      this.$set(this.aduitForm, 'creditCode', '');
+    },
+    // 关闭弹框
+    cancel() {
+      this.reset();
+      this.isShow = false;
+      if (this.$refs["aduitForm"]) {
+        this.$refs["aduitForm"].resetFields();
+      }
+    },
+    /**  选择抬头类型  */
+    changeType(value) {
+      if (value == 2) {
+        // this.rules = {
+        //   ...this.rules,
+        //   creditCode: [{ required: true, message: "请输入税号", trigger: ["blur"] }]
+        // };
+        this.$set(this.aduitForm, 'invoiceLine', 'bs');
+
+      } else {
+        this.$set(this.aduitForm, 'invoiceLine', 'pc');
+        this.$set(this.aduitForm, 'creditCode', '');
+        delete this.rules.creditCode; // 移除 taxCode 校验规则  invoiceLine
+        delete this.rules.invoiceLine; // 移除 taxCode 校验规则  invoiceLine
+      }
+      this.$nextTick(() => {
+        if (this.$refs["aduitForm"]) {
+          this.$refs["aduitForm"].clearValidate();
+        }
+      });
+    }
+    
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.dialog {
+  padding: 0 30px;
+  max-height: 65vh;
+  overflow-y: auto;
+}
+.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;
+  }
+}
+.team_name_list {
+  width: 100%;
+  span {
+    display: flex;
+    width: 100%;
+    padding: 5px 10px;
+    cursor: pointer;
+  }
+  span:hover {
+    color: #1890ff;
+  }
+}
+</style>

+ 206 - 0
src/views/order/groupBuyingMr/dialog/detailInvoice.vue

@@ -0,0 +1,206 @@
+<!--
+ * @Description: 开票详情弹框
+-->
+<template>
+  <el-dialog
+    title="开票详情"
+    v-if="open"
+    :visible.sync="open"
+    width="70vw"
+    append-to-body
+    :close-on-click-modal="false"
+    @close="cancel"
+  >
+    <div class="dialog" v-if="form">
+      <div>
+        <el-row>
+          <el-col :span="24">
+            <div class="grid-content bg-purple item-class">订单号: <span>{{ form.orderId }}</span></div>
+          </el-col>
+          <el-col :span="24">
+            <div style="display: flex;" class="grid-content bg-purple item-class">状态: <span style="margin-left: 10px;"><dict-tag :options="dict.type.Invoicing_type" :value="form.status"/></span></div>
+          </el-col>
+          <el-col :span="24">
+            <div class="grid-content bg-purple item-class">申请时间: <span>{{ form.createTime }}</span></div>
+          </el-col>
+          <el-col :span="24">
+            <div style="display: flex;" class="grid-content bg-purple item-class">开票类型: <span style="margin-left: 10px;"><dict-tag :options="dict.type.lookup_type" :value="form.handlerType"/></span></div>
+          </el-col>
+          <el-col :span="24">
+            <div class="grid-content bg-purple item-class">申请类型: <span v-if="form.invoiceLine == 'bs'">数电专票</span><span v-else-if="form.invoiceLine == 'pc'">数电普票</span></div>
+          </el-col>
+          <el-col :span="24">
+            <div class="grid-content bg-purple item-class">纳税人识别号: <span>{{ form.creditCode || '-' }}</span></div>
+          </el-col>
+          <el-col :span="24">
+            <div class="grid-content bg-purple item-class">联系电话: <span>{{ form.mobile }}</span></div>
+          </el-col>
+          <el-col :span="24">
+            <div class="grid-content bg-purple item-class">邮箱: <span>{{ form.email }}</span></div>
+          </el-col>
+          <!-- <el-col :span="24">
+            <div class="grid-content bg-purple item-class">业务员: <span>{{ '' }}</span></div>
+          </el-col> -->
+          <el-col :span="24">
+            <div class="grid-content bg-purple item-class">开票金额: <span>{{ form.invoiceAmount }}</span></div>
+          </el-col>
+          <el-col :span="24" v-if="form.status == 3">
+            <div class="grid-content bg-purple item-class">失败原因: <span style="color: red;">{{ form.errReason }}</span></div>
+          </el-col>
+          <el-col :span="24">
+            <div style="display: flex;" class="grid-content bg-purple item-class">
+              <span style="white-space: nowrap;">附件: </span>
+              <div style="color: #409eff;display: flex;flex-direction: column;margin-left: 10px;">
+                <!-- <el-image 
+                  v-if="form.imageUrl"
+                  style="width: 100px; height: 100px"
+                  :src="form.imageUrl" 
+                  :preview-src-list="[form.imageUrl]">
+                </el-image> -->
+                
+                <span v-if="form.pdfUrl"><i class="el-icon-folder-opened"></i> {{ form.pdfUrl }} <span style="margin-left: 10px;cursor: pointer;color: #67c23a;" @click="openPDF(form.pdfUrl)">参看详情</span></span>
+                
+              </div>
+            </div>
+          </el-col>
+        </el-row>
+      </div>
+      <div>
+        <iframe width="90%" :src="form.pdfUrl" frameborder="0"></iframe>
+      </div>
+    </div>
+
+
+    <span slot="footer" class="dialog-footer" >
+      <el-button
+        @click="cancel"
+        v-loading.fullscreen.lock="loading"
+        element-loading-text="提交中..."
+        element-loading-spinner="el-icon-loading"
+        element-loading-background="rgba(0, 0, 0, 0.8)"
+      >
+        <span>关闭</span>
+      </el-button>
+      <el-button v-if="form.status === 3" type="primary" @click="handleNext">重新开票</el-button>
+    </span>
+
+  </el-dialog>
+</template>
+
+<script>
+import { getInvoiceInfo } from '@/api/financeMr/InvoiceRecords'
+export default {
+  name: "detailInvoice",
+  dicts: ['Invoicing_type','lookup_type'],
+  data() {
+    return {
+      title: "编辑",
+      model: "EDIT",
+      open: false,
+      loading: false,
+      form: {
+        id: undefined,
+      },
+      performerVisible: false,
+      performerList: [],
+      refund: false,
+    };
+  },
+  methods: {
+    /**
+     * 打开弹框
+     * @date 2023-11-22
+     * @param {any} obj
+     * @returns {any}
+     */
+    openDialog(title, obj) {
+      this.open = true;
+      this.getInvoiceDetailApi(obj);
+    },
+    /** 获取详情 */
+    getInvoiceDetailApi(row) {
+      // const id = row.orderId
+      getInvoiceInfo({
+        orderId: row.id
+      }).then(response => {
+        this.form = response.data;
+      });
+    },
+    /**
+     * 关闭弹框
+     * @date 2023-11-22
+     * @returns {any}
+     */
+    cancel() {
+      this.open = false;
+      this.$nextTick(() => {
+        if (this.$refs["form"]) {
+          this.$refs["form"].resetFields(); // 重置表单
+        }
+      });
+    },
+    // 重新开票
+    handleNext() {
+      let dataF = JSON.parse(JSON.stringify(this.form));
+      this.open = false;
+      this.$emit("goOrderInvoice", dataF);
+    },
+    openPDF(url) {
+      window.open(url)
+    }
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.dialog {
+  padding: 0 30px;
+  height: 60vh;
+  overflow-y: auto;
+}
+.dialog {
+  padding: 0 30px;
+  width: 100%;
+  box-sizing: border-box;
+  display: flex;
+  >div:first-child {
+    width: 400px;
+    padding-right: 20px;
+    box-sizing: border-box;
+  }
+  >div:last-child {
+    width: calc( 100% - 400px );
+    iframe {
+      width: 100%;
+      height: 100%;
+    }
+  }
+  .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;
+  }
+}
+</style>

+ 44 - 6
src/views/order/groupBuyingMr/dialog/details.vue

@@ -23,7 +23,7 @@
         <div class="title-class" style="margin-top: 0">基础信息</div>
         <el-row>
           <el-col :span="12">
-            <div class="grid-content bg-purple item-class">团队名称: <span>{{ form.teamName || ''}}</span></div>
+            <div class="grid-content bg-purple item-class textInfo">团队名称: <span :title="form.teamName">{{ form.teamName || ''}}</span></div>
           </el-col>
           <el-col :span="12">
             <div class="grid-content bg-purple item-class">团队类型: <span><dict-tag style="display: inline-block" :options="dict.type.team_type" :value="form.teamType"/></span></div>
@@ -73,33 +73,62 @@
           <el-col :span="12">
             <div class="grid-content bg-purple item-class">应收金额: <span>¥{{ form.orderPrice || form.orderPrice == 0 ? form.orderPrice : '' }}</span></div>
           </el-col>
-          <el-col :span="12">
+          <!-- <el-col :span="12">
             <div class="grid-content bg-purple item-class">实收金额: <span>¥{{ form.realPrice || form.realPrice == 0 ? form.realPrice : '' }}</span></div>
-          </el-col>
-          <el-col :span="12">
+          </el-col> -->
+          <!-- <el-col :span="12">
             <div class="grid-content bg-purple item-class">团购人数: <span>{{ form.quantity || '' }}</span></div>
           </el-col>
           <el-col :span="12">
             <div class="grid-content bg-purple item-class">支付时间: <span>{{ form.payTime || '' }}</span></div>
-          </el-col>
+          </el-col> -->
           <!-- <el-col :span="12">
             <div class="grid-content bg-purple item-class">支付方式: <span>{{ payWayList[form.payWay] || '' }}</span></div>
           </el-col>
           <el-col :span="12">
             <div class="grid-content bg-purple item-class">订单状态: <span>{{ statusList[form.status] || '' }}</span></div>
           </el-col> -->
+          <!-- <el-col :span="12">
+            <div class="grid-content bg-purple item-class" style="display: flex;">支付方式: <span
+                style="display: block;margin-left: 5px;"><dict-tag :options="dict.type.pay_way_type"
+                  :value="form.payWay" /></span></div>
+          </el-col>
+          <el-col :span="12">
+            <div class="grid-content bg-purple item-class" style="display: flex;">订单状态: <span
+                style="display: block;margin-left: 5px;"><dict-tag :options="dict.type.order_status_type"
+                  :value="form.status" /></span></div>
+          </el-col> -->
+          <el-col :span="12">
+            <div class="grid-content bg-purple item-class" style="display: flex;">是否成功开票: <span style="display: block;margin-left: 5px;">{{ form.ifSuccessInvoice=='1'?'是':'否'  }}</span></div>
+          </el-col>
+        </el-row>
+        <!--   支付信息   -->
+        <div class="title-class" style="margin-top: 0">支付信息</div>
+        <el-row>
+          <el-col :span="12">
+            <div class="grid-content bg-purple item-class">支付团队: <span>{{ form.repayName || '' }}</span></div>
+          </el-col>
           <el-col :span="12">
             <div class="grid-content bg-purple item-class" style="display: flex;">支付方式: <span
                 style="display: block;margin-left: 5px;"><dict-tag :options="dict.type.pay_way_type"
                   :value="form.payWay" /></span></div>
           </el-col>
+          <el-col :span="12">
+            <div class="grid-content bg-purple item-class">支付时间: <span>{{ form.payTime || '' }}</span></div>
+          </el-col>
+          <el-col :span="12">
+            <div class="grid-content bg-purple item-class">团购人数: <span>{{ form.quantity || '' }}</span></div>
+          </el-col>
+          <el-col :span="12">
+            <div class="grid-content bg-purple item-class">实收金额: <span>¥{{ form.realPrice || form.realPrice == 0 ? form.realPrice : '' }}</span></div>
+          </el-col>
           <el-col :span="12">
             <div class="grid-content bg-purple item-class" style="display: flex;">订单状态: <span
                 style="display: block;margin-left: 5px;"><dict-tag :options="dict.type.order_status_type"
                   :value="form.status" /></span></div>
           </el-col>
           <el-col :span="12">
-            <div class="grid-content bg-purple item-class" style="display: flex;">是否成功开票: <span style="display: block;margin-left: 5px;">{{ form.ifSuccessInvoice=='1'?'是':'否'  }}</span></div>
+            <div class="grid-content bg-purple item-class">是否其他团队代付: <span>{{ form.ifRepay === 0 ?'否':'是' }}</span></div>
           </el-col>
         </el-row>
 
@@ -481,6 +510,15 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.textInfo {
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  cursor: pointer;
+  width: 90%; /* 容器宽度 */
+  margin: 0;
+  padding: 0;
+}
 .dialog {
   width: 100%;
   height: 70vh;

+ 37 - 1
src/views/order/groupBuyingMr/index.vue

@@ -362,6 +362,11 @@
                   command="7" 
                   v-if="hasPermi('groupBuyingMr:groupBuyingMr:duigongedit') && (scope.row.status == 3 || scope.row.status == 7) && scope.row.payWay== 'corporate'"
                   >修改凭证</el-dropdown-item>
+                  <el-dropdown-item 
+                    command="8"
+                    v-if="scope.row.status == 7"
+                  >开具发票
+                  </el-dropdown-item>
                 </el-dropdown-menu>
               </el-dropdown>
             </template>
@@ -387,6 +392,11 @@
     <editBox ref="editBox" @getList="getList" />
     <!--  修改凭证  -->
     <payOrCredit ref="payOrCredit" @getList="getList" />
+    <!-- 开票详情 -->
+    <detail-invoice ref="detailInvoice" @goOrderInvoice="goOrderInvoice" @getList="getList"></detail-invoice>
+    <!-- 申请开票 -->
+    <aduit-invoice ref="aduitInvoice" @getList="getList"></aduit-invoice>
+
     <el-dialog
         title="选择小票机"
         :visible.sync="dialogVisible"
@@ -538,6 +548,8 @@ import {
  import { getBindTeamList, getSelectById as getBalanceInfo } from '@/api/team/teamMr'
 import { orderInfoCancel } from '@/api/windowTicketSales/ticketingSales';
 import detailsDia from "./dialog/details.vue";
+import detailInvoice from "./dialog/detailInvoice.vue";
+import aduitInvoice from "./dialog/aduitInvoice.vue";
 import resetOrder from "./dialog/resetOrder.vue";
 import payOrCredit from "./dialog/payOrCredit.vue";
 import { printApi } from '@/api/order/orderMr'
@@ -552,7 +564,14 @@ const axios = require('axios');
 export default {
   name: "GroupBuyingMr",
   dicts: ['agreement_type', 'team_type','order_status_type','pay_way_type'],
-  components: { detailsDia, resetOrder, editBox, payOrCredit },
+  components: { 
+    detailsDia,
+    resetOrder,
+    editBox,
+    payOrCredit,
+    detailInvoice,
+    aduitInvoice 
+  },
   data() {
     return {
       qHeight: '0px',
@@ -1252,10 +1271,27 @@ export default {
         case "7":
           this.handPayOrCredit(row);
           break;
+        case "8":
+          this.handleOrderInvoice(row);
+          break;
         default:
           break;
       }
     },
+    // 开具发票
+    handleOrderInvoice(row) {
+      console.log(row,'row1111');
+      if(row.ifInvoice === 1 ) {
+        // 已开票
+        this.$refs["detailInvoice"].openDialog("开票详情", row);
+      } else {
+        this.$refs["aduitInvoice"].openDialog("申请开票", row);
+      }
+    },
+    // 重新开票
+    goOrderInvoice(row) {
+      this.$refs["aduitInvoice"].openDialog("申请开票", row, 'next');
+    },
     /** 修改凭证  */
     handPayOrCredit(row){
       this.$refs["payOrCredit"].openDialog("修改凭证", row, 'normal');