Browse Source

shangchuan

liuhj 5 days ago
parent
commit
db44113ed8
3 changed files with 243 additions and 56 deletions
  1. 169 5
      src/components/Finance/LncomingBills.vue
  2. 73 50
      src/components/OP/Groupedit.vue
  3. 1 1
      src/components/home.vue

+ 169 - 5
src/components/Finance/LncomingBills.vue

@@ -48,7 +48,28 @@
             </div>
             <div class="lncomingbill-checked">
                 <div class="checked-label">收款账单</div>
-                <div>
+                <div style="display: flex;">
+                    <el-popover v-if="groupInfo.frFilePaths.length>0" placement="right" width="400" trigger="hover">
+                        <div style="white-space: pre-line;">
+                            <label>文件列表:</label>
+                            <div v-for="(item, index) in groupInfo.frFilePaths" :key="index" @click="downloadimg(item)">
+                                <div class="lncomingbill-box">
+                                    <div>{{ ExtractWJ(item) }}</div>
+                                    <div @click.stop="deleteImage(ExtractWJ(item))"
+                                        class="lncomingbill-content-dleWJ">✖</div>
+                                </div>
+                            </div>
+                        </div>
+                        <el-button style="margin-right: 10px;" slot="reference" type="primary">已上传文件</el-button>
+                    </el-popover>
+                    <el-upload style="margin-right: 10px;" 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
+                            :type="groupInfo.isUploadFile?'danger':'primary'">
+                            <span>实际报价明细</span>
+                        </el-button>
+                    </el-upload>
                     <el-button @click="PostReceivablesImportFee" type="primary">导入三公费用</el-button>
                     <el-button @click="addition" type="primary">添加一行</el-button>
                 </div>
@@ -167,9 +188,14 @@ export default {
                 // }
             ],
             currencyoptions: [],
-            groupInfo: {},
+            groupInfo: {
+                frFilePaths:[]
+            },
             fullscreenLoading: false,
-            jurisdiction: false
+            jurisdiction: false,
+
+            fileList: [],       // 上传的文件列表
+            maxFileLen:0,       // 最大上传文件数
         }
     },
     methods: {
@@ -252,10 +278,10 @@ export default {
                     diId: that.value
                 }
             }).then(function (res) {
-                console.log(res)
                 if (res.data.code) {
                     that.tableData = res.data.data.groupCollectionStatementData;
                     that.groupInfo = res.data.data.groupInfo;
+                    console.log(that.groupInfo)
                     setTimeout(function () { that.fullscreenLoading = false; }, 0)
                 } else {
                     setTimeout(function () { that.fullscreenLoading = false; }, 0)
@@ -286,7 +312,6 @@ export default {
                         message: res.data.msg,
                         type: 'success'
                     });
-                    console.log(res)
                     window.open(res.data.data.url)
                 } else {
                     that.$message.error(res.data.msg);
@@ -526,6 +551,123 @@ export default {
                 return rowBackground;
             }
         },
+        //文件上传
+        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);
+                }
+            })
+            var url = "/api/Financial/ReceivablesUploadFile?groupId=" + this.value
+            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.PostGroupReceivablesInfoByDiId();
+            });
+        },
+        //图片下载
+        downloadimg(filePath) {
+            window.open(filePath);
+        },
+        //截取
+        ExtractWJ(fileName) {
+            if (!fileName) return '';
+            const lastSlashIndex = fileName.split('/');
+            return fileName.split('/')[lastSlashIndex.length - 1];
+        },
+        //删除图片
+        deleteImage(filePath) {
+            var url = "/api/Financial/DeleteReceivablesFile?groupId="+ this.value
+            var that = this
+            new Promise(function (resolve, reject) {
+                that.$axios({
+                    method: 'delete',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + that.token,
+                        'Content-Type': 'application/json'
+                    },
+                    data: filePath,
+                }).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.PostGroupReceivablesInfoByDiId();
+            });
+            
+        },
     },
     created() {
         this.PostReceivablesFeilDownloadInit();
@@ -623,4 +765,26 @@ export default {
 .lncomingbill-form {
     margin-top: 10px;
 }
+
+.lncomingbill-box{
+    padding: 5px 0px;
+    border-radius: 5px;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+}
+.lncomingbill-box:hover{
+    background-color: #F5F7FA;
+    cursor: pointer;
+}
+.lncomingbill-content-dleWJ{
+    font-size: 20px;
+    font-weight: 600;
+    line-height: 20px;
+    margin-right: 5px;
+}
+.lncomingbill-content-dleWJ:hover{
+    color:red;
+    cursor: pointer;
+}
 </style>

+ 73 - 50
src/components/OP/Groupedit.vue

@@ -102,6 +102,15 @@
                     <el-form-item label-width="120px" label="团组名称:" prop="groupname">
                         <el-input el-input v-model="ruleForm.groupname"></el-input>
                     </el-form-item>
+                    <el-form-item label-width="120px" label="额外超支额度:">
+                        <el-input el-input v-model="ruleForm.extOverLimit"></el-input>
+                    </el-form-item>
+                    <el-form-item label-width="120px" label="额外超支额度币种:">
+                        <el-select filterable class="op-type" v-model="ruleForm.extOverCurrency" placeholder="请选择额外超支额度币种">
+                            <el-option v-for="(item, index) in currencyData" :key="index" :label="item.name"
+                                :value="item.id"></el-option>
+                        </el-select>
+                    </el-form-item>
                     <el-form-item label-width="120px" label="合同时间:">
                         <el-date-picker type="date" placeholder="选择日期" v-model="ruleForm.contracttime"
                             style="width: 100%;"></el-date-picker>
@@ -260,6 +269,8 @@ export default {
                 customerunits: '',
                 countriesvisited: '',
                 visitingtime: '',
+                extOverLimit:'',
+                extOverCurrency:'',
                 contracttime: '',
                 numdays: '',
                 cityId:'',
@@ -357,6 +368,7 @@ export default {
             depname:'',
             //xiao nao fa yu bu jian quan de xu qiu
             companyName:'',
+            currencyData:[],
         };
     },
     methods: {
@@ -452,59 +464,66 @@ export default {
         getdown() {
             var url = "/api/Groups/GroupEditBasicSource"
             var that = this
-            this.$axios({
-                method: 'post',
-                url: url,
-                headers: {
-                    Authorization: 'Bearer ' + this.token
-                },
-                data: {
-                    portType: 1,
-                }
-            }).then(function (res) {
-                if (res.data.code == 200) {
-                    that.restaurantss=res.data.data.clientData;
-                    that.restaurants= that.restaurantss.map((terminal) => {
-                        return {
-                            value: terminal.contact +'   '+ terminal.client +'   '+terminal.telephone+'   '+terminal.wechat,
-                        };
-                    });
-                    that.customerunitslist= that.restaurantss.map((terminal) => {
-                        return {
-                            value:terminal.client,
-                        };
-                    });
-                    that.personarr = res.data.data.userData;
-                    that.gradearr = res.data.data.teamLevData;
-                    that.OPtype = res.data.data.teamTypeData;
-                    that.cityData = res.data.data.cityData;
-                    if (that.ruleForm.cityId=='') {
-                        if(that.companyName=='泛美(贵阳) 会展服务有限公司'){
-                            that.ruleForm.cityId=3332
-                        }else{
-                            that.ruleForm.cityId=that.filteredItems()[0].id;
+            that.fullscreenLoading = true;
+            new Promise(function (resolve, reject) {
+                that.$axios({
+                    method: 'post',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + that.token
+                    },
+                    data: {
+                        portType: 1,
+                    }
+                }).then(function (res) {
+                    if (res.data.code == 200) {
+                        that.restaurantss = res.data.data.clientData;
+                        that.restaurants = that.restaurantss.map((terminal) => {
+                            return {
+                                value: terminal.contact + '   ' + terminal.client + '   ' + terminal.telephone + '   ' + terminal.wechat,
+                            };
+                        });
+                        that.customerunitslist = that.restaurantss.map((terminal) => {
+                            return {
+                                value: terminal.client,
+                            };
+                        });
+                        that.personarr = res.data.data.userData;
+                        that.gradearr = res.data.data.teamLevData;
+                        that.OPtype = res.data.data.teamTypeData;
+                        that.cityData = res.data.data.cityData;
+                        that.currencyData = res.data.data.currencyData;
+                        if (that.ruleForm.cityId == '') {
+                            if (that.companyName == '泛美(贵阳) 会展服务有限公司') {
+                                that.ruleForm.cityId = 3332
+                            } else {
+                                that.ruleForm.cityId = that.filteredItems()[0].id;
+                            }
                         }
+                        if (that.editid == undefined) {
+                            that.ruleForm.OP = that.OPtype[0].id;
+                        }
+                        that.fullscreenLoading = false;
+                        resolve();
                     }
-                    if(that.editid==undefined) {
-                        that.ruleForm.OP=that.OPtype[0].id;
+                })
+            }).then(() => {
+                var url = "/api/System/QuerySetData"
+                var that = this
+                this.$axios({
+                    method: 'post',
+                    url: url,
+                    headers: {
+                        Authorization: 'Bearer ' + this.token
+                    },
+                    data: {
+                        dataType: 70,
                     }
-                }
-            })
-            var url = "/api/System/QuerySetData"
-            var that = this
-            this.$axios({
-                method: 'post',
-                url: url,
-                headers: {
-                    Authorization: 'Bearer ' + this.token
-                },
-                data: {
-                    dataType: 70,
-                }
-            }).then(function (res) {
-                if (res.data.code == 200) {
-                    that.opRoyaltyLvList = res.data.data;
-                }
+                }).then(function (res) {
+                    if (res.data.code == 200) {
+                        that.opRoyaltyLvList = res.data.data;
+                    }
+                })
             })
         },
         //personchange
@@ -646,6 +665,8 @@ export default {
                         that.ruleForm.OP = datagroup.teamDid;
                         that.ruleForm.grades = datagroup.teamLevSId;
                         that.ruleForm.person = datagroup.jietuanOperator;
+                        that.ruleForm.extOverLimit = datagroup.extOverLimit;
+                        that.ruleForm.extOverCurrency = datagroup.extOverCurrency;
                         that.ruleForm.opRoyaltyLv = parseInt(datagroup.opRoyaltyLv)==0?'':parseInt(datagroup.opRoyaltyLv);
                         that.ruleForm.opRoyaltyRemark = datagroup.opRoyaltyRemark;
                         that.ruleForm.radioval = datagroup.isBid==0?'0':'1';
@@ -707,6 +728,8 @@ export default {
                     tellPhone: that.ruleForm.phonenumber,
                     weChatNo:that.ruleForm.Wechat,
                     remark: that.ruleForm.remark,
+                    extOverLimit: that.ruleForm.extOverLimit,
+                    extOverCurrency: that.ruleForm.extOverCurrency,
                     opRoyaltyLv: that.ruleForm.opRoyaltyLv==""?0:that.ruleForm.opRoyaltyLv,
                     opRoyaltyRemark: that.ruleForm.opRoyaltyRemark,
                     isBid: that.ruleForm.radioval=='0'?0:1,

+ 1 - 1
src/components/home.vue

@@ -117,7 +117,7 @@
               <span>{{ item.modulName }}</span>
             </template>
             <el-menu-item-group>
-              <el-menu-item @click="toURL($event.index, items)" v-for="(items, index) in item.pageList" :key="index"
+              <el-menu-item style="padding-left: 54px;" @click="toURL($event.index, items)" v-for="(items, index) in item.pageList" :key="index"
                 :index="items.modulid + '-' + items.pageid">{{ items.pageName }}</el-menu-item>
             </el-menu-item-group>
           </el-submenu>