liuhj hai 12 horas
pai
achega
065f300340
Modificáronse 2 ficheiros con 191 adicións e 15 borrados
  1. 190 11
      src/components/Finance/ConferenceCost.vue
  2. 1 4
      src/components/OP/GroupProgress.vue

+ 190 - 11
src/components/Finance/ConferenceCost.vue

@@ -111,13 +111,13 @@
                             :controls="false" v-model="scope.row.coefficient"></el-input-number>
                     </template>
                 </el-table-column>
-                <el-table-column prop="name" :label="`单项成本金额`" width="130">
+                <el-table-column prop="name" :label="`单项成本金额`" width="110">
                     <template slot-scope="scope">
                         {{ townum(scope.row.costPrice * scope.row.count) }}
                         <!-- <el-input-number :precision="2" size="mini" :controls="false" v-model="scope.row.baoJiaPrice"></el-input-number> -->
                     </template>
                 </el-table-column>
-                <el-table-column prop="name" label="单项报价金额" width="160">
+                <el-table-column prop="name" label="单项报价金额" width="120">
                     <template slot-scope="scope">
                         {{ `${townum(scope.row.baoJiaPrice)} (CNY)` }}
                         <div v-if="scope.row.currency != 836">
@@ -153,11 +153,46 @@
                         {{ scope.row.reviewStatus === 0 ? '未审核' : scope.row.reviewStatus === 1 ? '已通过' : '已撤销' }}
                     </template>
                 </el-table-column>
+                <el-table-column  label="文件查看" width="75"> 
+                    <template slot-scope="scope">
+                        <el-popover v-if="scope.row.imgsList.length>0" placement="right" width="400" trigger="hover">
+                            <div style="white-space: pre-line;">
+                                <label>文件列表:</label>
+                                <div v-for="(item,index) in scope.row.imgsList" :key="index">
+                                    <div class="conferencecostfile-box">
+                                        <div>{{ExtractWJ(item)}}</div>
+                                        <div @click.stop="deleteImage(item,scope.row.id)" class="conferencecost-content-dleWJ">✖</div>
+                                    </div>
+                                </div>
+                            </div>
+                            <div slot="reference" style="cursor: pointer;">
+                                查看
+                            </div>
+                        </el-popover>
+                        <div v-else style="cursor: pointer;">查看</div>
+                    </template>
+                </el-table-column>
                 <el-table-column label="操作" width="100px">
                     <template slot-scope="scope">
                         <div class="conferencecost-content-btn">
                             <el-button size="mini" @click="removeRow(scope.$index, scope.row)" type="danger">移
                                 除</el-button>
+                                <el-upload
+                                class="upload-inline"
+                                action="#"
+                                :multiple="true"
+                                :show-file-list="false"
+                                :before-upload="beforeWordUpload"
+                                :on-change="handleWordFileChange"
+                                :auto-upload="false"
+                                :file-list="fileList"
+                                accept=".jpg,.jpeg,.png,">
+                                    <el-button @click="handleWordFileClick(scope.row)" style="margin-top: 5px;" size="mini" type="primary">
+
+                                        <span>上 传</span>
+                                    </el-button>
+                                </el-upload>
+                            <!-- <el-button size="mini" @click="removeRow(scope.$index, scope.row)" type="primary">上 传</el-button> -->
                             <div v-if="control.isReview" style="margin-top: 5px;">
                                 <el-button size="mini" @click="ConferenceAffairsAudits(1, scope.row.id)"
                                     type="primary">通
@@ -286,10 +321,13 @@ export default {
             viewUsersarr: [],
             viewUsers: [],
 
+            fileList: [],
+            uploadFile: null,           // 当前选中的Word文件
+            childId:0,        // 上传状态
+            maxFileLen:0,       // 最大上传文件数
         }
     },
     updated() {
-        //console.log(1);
         if (this.restriction) {
             this.$emit('transfer', true)
             this.restriction = false;
@@ -320,7 +358,6 @@ export default {
                     _this.danweiId = _this.rateStatistics.length == 1 ? _this.rateStatistics[0].currencyId : 836;
                 }
                 _this.updateTotals();
-                console.log("tableDatas");
             },
             deep: true
         }
@@ -331,6 +368,12 @@ export default {
         }
     },
     methods: {
+        //截取
+        ExtractWJ(fileName) {
+            if (!fileName) return '';
+            const lastSlashIndex = fileName.split('/');
+            return fileName.split('/')[lastSlashIndex.length - 1];
+        },
         //保留两位小数
         townum(val) {
             val = Number(val);
@@ -339,7 +382,6 @@ export default {
         handleSelectionChange(val) {
             this.conferenceAffairsCostChildids = [];
             this.multipleSelection = val;
-            console.log(this.multipleSelection);
             for (let i = 0; i < this.multipleSelection.length; i++) {
                 this.conferenceAffairsCostChildids.push(this.multipleSelection[i].id);
             }
@@ -398,8 +440,6 @@ export default {
         updateTotals() {
             // 计算成本总计
             this.conferenceAffairsCost.costAll = this.tableDatas.reduce((sum, item) => {
-                console.log(item);
-                console.log(sum);
                 
                 if (this.rateStatistics.length > 1) {
                     return sum + ((Number(item.costPrice) || 0) * (Number(item.count) || 0) * (Number(item.rate) || 0))+((Number(item.rate) || 0) * (Number(item.addedValue) || 0));
@@ -420,8 +460,7 @@ export default {
         },
         //分配HUI率切换
         allocationGroupIdchange(val) {
-            console.log(val);
-            console.log(val);
+
 
             var obj = this.options.find(function (i) {
                 return i.currencyId === val;
@@ -432,7 +471,6 @@ export default {
         },
         //移除
         removeRow(index, row) {
-            console.log(index, row.id);
 
             // this.tableDatas.splice(index, 1);
             //this.updateTotals();//jisuan总计
@@ -733,7 +771,127 @@ export default {
                     });
                 }
             })
-        }
+        },
+
+        //d带参数
+        handleWordFileClick(row) {
+            // 这里可以存储当前行数据,以便在上传完成后进行处理
+            this.childId = row.id;
+        },
+        //文件上传
+        handleWordFileChange(file, fileList) {
+            this.uploadFile = file.raw;
+            let length = fileList.length
+            this.maxFileLen = Math.max(length, this.maxFileLen)
+            setTimeout(() => {
+                if (length === this.maxFileLen) {
+                    this.fileList=fileList;
+                    this.uploadWordFile();
+                }
+            }, 100)
+        },
+        
+        // 🆕 上传前的验证
+        beforeWordUpload(file) {
+            // 验证文件类型
+            const isWord = file.name.endsWith('.jpg') || file.name.endsWith('.jpeg')|| file.name.endsWith('.png');
+            if (!isWord) {
+                this.$message.error('只能上传图片文件(.jpg,.jpeg,.png,)!');
+                return false;
+            }
+            // 验证文件大小(限制为10MB)
+            const isLt10M = file.size / 1024 / 1024 < 10;
+            if (!isLt10M) {
+                this.$message.error('文件大小不能超过10MB!');
+                return false;
+            }
+            return true;
+        },
+        
+        // 🆕 执行上传到指定接口
+        async uploadWordFile() {
+            
+            //判断是否有文件再上传
+            if (this.fileList.length === 0) {
+                return this.$message.warning('请选取文件后再上传!');
+            }
+            
+            const formData = new FormData();
+            this.fileList.forEach((file) => {
+                if (!this.beforeWordUpload(file)) {
+                    return;
+                }
+                if(file.raw!=undefined){
+                    formData.append('Files', file.raw);
+                }
+            })
+            // formData.append('Files', this.uploadFile);
+            formData.append('childId', this.childId);
+            var url = "/api/Groups/ConferenceAffairsChildImageUpload"
+            var that = this
+            new Promise(function (resolve, reject) {
+                that.$axios({
+                    method: 'post',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + that.token
+                    },
+                    data: formData,
+
+                }).then(function (res) {
+                    if (res.data.code == 200) {
+                        that.$message({
+                            type: 'success',
+                            message: res.data.msg
+                        });
+                        that.fileList = [];
+                        resolve();
+                    } else {
+                        that.$message({
+                            type: 'error',
+                            message: res.data.msg
+                        });
+                    }
+                })
+            }).then(() => {
+                that.ConferenceAffairsLoad();
+            });
+        },
+        //删除图片
+        deleteImage(filePath, childId) {
+            const filePaths=[filePath];
+            var url = "/api/Groups/ConferenceAffairsChildImageDelete"
+            var that = this
+            new Promise(function (resolve, reject) {
+                that.$axios({
+                    method: 'post',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + that.token
+                    },
+                    data: {
+                        childId: childId,
+                        fileNames: filePaths,
+                    }
+                }).then(function (res) {
+                    if (res.data.code == 200) {
+                        that.$message({
+                            type: 'success',
+                            message: res.data.msg
+                        });
+                        resolve();
+                    } else {
+                        that.$message({
+                            type: 'error',
+                            message: res.data.msg
+                        });
+                    }
+                })
+            }).then(() => {
+                that.ConferenceAffairsLoad();
+            });
+            
+        },
     },
     mounted() {
         this.token = JSON.parse(localStorage.getItem('userinif')).token;
@@ -830,4 +988,25 @@ button {
     /* Element UI 主题色 */
     font-weight: bold;
 }
+.conferencecostfile-box{
+    padding: 5px 0px;
+    border-radius: 5px;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+}
+.conferencecostfile-box:hover{
+    background-color: #F5F7FA;
+    cursor: pointer;
+}
+.conferencecost-content-dleWJ{
+    font-size: 20px;
+    font-weight: 600;
+    line-height: 20px;
+    margin-right: 5px;
+}
+.conferencecost-content-dleWJ:hover{
+    color:red;
+    cursor: pointer;
+}
 </style>

+ 1 - 4
src/components/OP/GroupProgress.vue

@@ -673,9 +673,7 @@ export default {
                 this.AuditStatusArr = [...this.AuditStatus];
                 return;
             }
-
             const trimmedQuery = query.trim();
-
             if (this.searchMode === 'character') {
                 // 字符匹配模式:每个字都必须包含
                 this.characterMatchFilter(trimmedQuery);
@@ -687,7 +685,6 @@ export default {
         /*** 严格的字符匹配 - 每个查询字符都必须出现*/
         characterMatchFilter(query) {
             const queryChars = query.split('').filter(char => char.trim() !== '');
-
             this.AuditStatusArr = this.AuditStatus.filter(item => {
                 const groupName = item.groupName || '';
                 return queryChars.every(char => groupName.includes(char));
@@ -838,7 +835,7 @@ export default {
             // }
             this.tableData.push({
                 countryName: '',
-                nodeName1: '收集资料',
+                nodeName1: '签证材料收集和准备',
                 isHandle1: false,
                 handleTime1: '',
                 nodeName2: '取护照资料',