From 48118e7c69c14b86b06abbabb4c910cb59c12cfa Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期四, 12 十一月 2026 18:37:12 +0800
Subject: [PATCH] Merge branch 'master' of http://116.62.18.175:6699/r/~yxh/opo-web

---
 src/views/project/invoice/index.vue |  188 ++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 152 insertions(+), 36 deletions(-)

diff --git a/src/views/project/invoice/index.vue b/src/views/project/invoice/index.vue
index 7f6f47f..0cd6317 100644
--- a/src/views/project/invoice/index.vue
+++ b/src/views/project/invoice/index.vue
@@ -27,7 +27,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="鎶ラ攢鐘舵��" prop="reimburseState">
+      <el-form-item v-if="!selectMode" label="鎶ラ攢鐘舵��" prop="reimburseState">
         <el-select
           v-model="queryParams.reimburseState"
           placeholder="璇烽�夋嫨鎶ラ攢鐘舵��"
@@ -54,7 +54,7 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
+      <el-col v-if="!selectMode" :span="1.5">
         <el-button
           type="primary"
           plain
@@ -72,7 +72,7 @@
     </el-row>
 
     <!-- 鎵嬫満绔細鍗$墖鍒楄〃 -->
-    <div v-if="isMobile" class="invoice-cards" v-loading="loading">
+    <div v-if="isMobile && !selectMode" class="invoice-cards" v-loading="loading">
       <div
         v-for="row in invoiceList"
         :key="row.id"
@@ -151,7 +151,21 @@
       </div>
     </div>
 
-    <el-table v-else v-loading="loading" border :data="invoiceList">
+    <el-table
+      v-else
+      v-loading="loading"
+      border
+      row-key="id"
+      :data="invoiceList"
+      @selection-change="handleInvoiceSelectionChange"
+    >
+      <el-table-column
+        v-if="selectMode"
+        type="selection"
+        width="50"
+        align="center"
+        :reserve-selection="true"
+      />
       <el-table-column type="index" label="搴忓彿" width="55" align="center" />
       <el-table-column label="妗堜緥" align="center" prop="caseId"  width="100">
         
@@ -220,28 +234,30 @@
             @click="openPreview(scope.row.invoiceUrl, scope.row.invoiceName)"
             >鏂囦欢棰勮</el-button
           >
-          <el-button
-            v-if="String(scope.row.reimburseState) !== '1'"
-            type="text"
-            icon="el-icon-check"
-            @click="handleReimburse(scope.row)"
-            v-hasPermi="['project:invoice:edit']"
-            >宸叉姤閿�</el-button
-          >
-          <el-button
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['project:invoice:edit']"
-            >淇敼</el-button
-          >
-          <el-button
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['project:invoice:remove']"
-            >鍒犻櫎</el-button
-          >
+          <template v-if="!selectMode">
+            <el-button
+              v-if="String(scope.row.reimburseState) !== '1'"
+              type="text"
+              icon="el-icon-check"
+              @click="handleReimburse(scope.row)"
+              v-hasPermi="['project:invoice:edit']"
+              >宸叉姤閿�</el-button
+            >
+            <el-button
+              type="text"
+              icon="el-icon-edit"
+              @click="handleUpdate(scope.row)"
+              v-hasPermi="['project:invoice:edit']"
+              >淇敼</el-button
+            >
+            <el-button
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDelete(scope.row)"
+              v-hasPermi="['project:invoice:remove']"
+              >鍒犻櫎</el-button
+            >
+          </template>
         </template>
       </el-table-column>
     </el-table>
@@ -253,6 +269,20 @@
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
+
+    <div v-if="selectMode" class="invoice-select-footer">
+      <span class="invoice-select-footer__tip">
+        宸查�夋嫨 {{ selectedInvoices.length }} 寮犲彂绁�
+      </span>
+      <el-button size="mini" @click="$emit('cancel')">鍙� 娑�</el-button>
+      <el-button
+        type="primary"
+        size="mini"
+        :disabled="!selectedInvoices.length"
+        @click="confirmSelect"
+        >纭畾閫夋嫨</el-button
+      >
+    </div>
 
     <!-- 涓婁紶鍙戠エ / 鍙戠エ淇℃伅纭 -->
     <el-dialog
@@ -281,7 +311,11 @@
                 />
               </el-form-item>
             </el-col>
-           
+            <el-col :span="12">
+              <el-form-item label="鍑瘉">
+                <el-checkbox v-model="uploadForm.voucher">鍑瘉</el-checkbox>
+              </el-form-item>
+            </el-col>
           </el-row>
           <el-form-item label="鍙戠エ鏂囦欢">
             <el-upload
@@ -373,10 +407,30 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="鍙戠エ绫诲瀷" prop="invoiceType">
-              <el-input
+              <el-select
                 v-model="form.invoiceType"
-                placeholder="璇疯緭鍏ュ彂绁ㄧ被鍨�"
-              />
+                placeholder="璇烽�夋嫨鍙戠エ绫诲瀷"
+                filterable
+                clearable
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in invoiceTypeOptions"
+                  :key="item"
+                  :label="item"
+                  :value="item"
+                />
+                <!-- OCR 璇嗗埆鍑虹殑鍏跺畠绫诲瀷淇濈暀鍥炴樉锛岄伩鍏嶇洿鎺ヤ涪澶� -->
+                <el-option
+                  v-if="
+                    form.invoiceType &&
+                    invoiceTypeOptions.indexOf(form.invoiceType) === -1
+                  "
+                  :key="form.invoiceType"
+                  :label="form.invoiceType"
+                  :value="form.invoiceType"
+                />
+              </el-select>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -554,6 +608,13 @@
 
 export default {
   name: "ServiceInvoice",
+  props: {
+    // 浣滀负鍏朵粬鍗曟嵁鐨勫彂绁ㄩ�夋嫨鍣ㄥ祵鍏ユ椂浼� true锛氭樉绀哄閫夊垪锛屼粎灞曠ず鏈姤閿�鍙戠エ
+    selectMode: {
+      type: Boolean,
+      default: false
+    }
+  },
   data() {
     return {
       // 閬僵灞�
@@ -564,6 +625,8 @@
       total: 0,
       // 鍙戠エ鍒楄〃
       invoiceList: [],
+      // 閫夋嫨妯″紡涓嬪凡鍕鹃�夌殑鍙戠エ
+      selectedInvoices: [],
       // 寮圭獥
       open: false,
       // upload锛氫笂浼犲彂绁紱edit锛氳瘑鍒粨鏋滅‘璁�
@@ -579,7 +642,9 @@
       },
       // 涓婁紶闃舵琛ㄥ崟锛堢敤鎴稩D鍙栧綋鍓嶇櫥褰曠敤鎴凤紝涓嶅湪姝ゅ缂栬緫锛�
       uploadForm: {
-        caseId: ""
+        caseId: "",
+        // 鍕鹃�夊悗浼� voucher=1锛屽悗绔寜鈥滃嚟璇佲�濆鐞�
+        voucher: false
       },
       uploadRules: {
        
@@ -588,6 +653,21 @@
       uploadedList: [],
       // 姝e湪涓婁紶鐨勬枃浠舵暟锛岀敤浜庡垽鏂竴鎵逛笂浼犳槸鍚︾粨鏉�
       uploadingCount: 0,
+      // 鍙戠エ绫诲瀷涓嬫媺閫夐」
+      invoiceTypeOptions: [
+        "浜ら�氳垂",
+        "甯傚唴浜ら�氳垂",
+        "浣忓璐�",
+        "浼欓琛ュ姪",
+        "鍏潅璐硅ˉ鍔�",
+        "鍏朵粬璐圭敤",
+        "鍖绘姢鍥㈤槦涓撳璐�",
+        "璇勪及涓撳璐�",
+        "杞繍鎶ょ悊鍔冲姟璐�",
+        "鑾峰彇涓撳鍔冲姟璐�",
+        "浼︾悊瀹℃牳涓撳璐�",
+        "鍑瘉"
+      ],
       // 璇嗗埆缁撴灉 / 淇敼琛ㄥ崟
       form: {},
       rules: {
@@ -622,7 +702,8 @@
     uploadData() {
       return {
         userId: this.currentUserId,
-        caseId: this.uploadForm.caseId
+        caseId: this.uploadForm.caseId,
+        voucher: this.uploadForm.voucher ? "1" : "0"
       };
     }
   },
@@ -634,7 +715,11 @@
     /** 鏌ヨ鍙戠エ鍒楄〃 */
     getList() {
       this.loading = true;
-      this.queryParams.userId=this.currentUserId
+      this.queryParams.userId = this.currentUserId;
+      // 閫夋嫨妯″紡鍙厑璁稿紩鐢ㄦ湭鎶ラ攢鍙戠エ锛岄伩鍏嶅悓涓�寮犲彂绁ㄩ噸澶嶆姤閿�
+      if (this.selectMode) {
+        this.queryParams.reimburseState = "0";
+      }
       listInvoice(this.queryParams)
         .then(response => {
           this.invoiceList = response.rows;
@@ -693,9 +778,24 @@
     resetQuery() {
       this.queryParams.caseId = "";
       this.queryParams.invoiceName = "";
-      this.queryParams.reimburseState = "";
+      this.queryParams.reimburseState = this.selectMode ? "0" : "";
       this.queryParams.pageNum = 1;
       this.getList();
+    },
+    /** 閫夋嫨妯″紡锛氳褰曞嬀閫夌殑鍙戠エ */
+    handleInvoiceSelectionChange(selection) {
+      this.selectedInvoices = selection;
+    },
+    /** 閫夋嫨妯″紡锛氭妸鍕鹃�夌殑鍙戠エ浜ょ粰璋冪敤鏂� */
+    confirmSelect() {
+      if (!this.selectedInvoices.length) {
+        this.$modal.msgWarning("璇峰厛鍕鹃�夐渶瑕佸紩鐢ㄧ殑鍙戠エ");
+        return;
+      }
+      this.$emit(
+        "confirm",
+        this.selectedInvoices.map(row => Object.assign({}, row))
+      );
     },
     /** 涓婁紶鍙戠エ鎸夐挳鎿嶄綔 */
     async handleUpload() {
@@ -703,7 +803,8 @@
         await this.getCurrentUser();
       }
       this.uploadForm = {
-        caseId: ""
+        caseId: "",
+        voucher: false
       };
       this.uploadedList = [];
       this.uploadingCount = 0;
@@ -744,6 +845,8 @@
       this.getList();
       if (!invoiceList.length) {
         this.$modal.msgWarning("璇ユ枃浠舵湭璇嗗埆鍒板彂绁ㄤ俊鎭紝璇风‘璁ゆ枃浠舵竻鏅�");
+      } else if (this.uploadForm.voucher) {
+        this.$modal.msgSuccess("鍑瘉涓婁紶鎴愬姛");
       } else {
         this.$modal.msgSuccess(
           "鍙戠エ涓婁紶鎴愬姛锛岃瘑鍒埌 " + invoiceList.length + " 寮犲彂绁�"
@@ -786,7 +889,7 @@
         remark: record.remark
       };
       this.mode = "edit";
-      this.title = "鍙戠エ淇℃伅纭";
+      this.title = record.invoiceType === "鍑瘉" ? "鍑瘉淇℃伅纭" : "鍙戠エ淇℃伅纭";
       this.open = true;
       this.refreshThumb();
     },
@@ -1057,6 +1160,19 @@
   color: #909399;
 }
 
+.invoice-select-footer {
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+  padding: 12px 0 0;
+
+  &__tip {
+    margin-right: 16px;
+    font-size: 13px;
+    color: #606266;
+  }
+}
+
 /* 鎵嬫満绔�傞厤 */
 @media (max-width: 992px) {
   .app-container {

--
Gitblit v1.9.3