liuhj 2 months ago
parent
commit
274c421f44

+ 6 - 6
src/components/Login.vue

@@ -106,12 +106,12 @@ export default {
         },
         //登录
         Login() {
-            if (this.usernum!='051') {
-                return this.$message({
-                    message: "oa系统整改",
-                    type: 'warning'
-                });
-            }
+            // if (this.usernum!='051') {
+            //     return this.$message({
+            //         message: "oa系统整改",
+            //         type: 'warning'
+            //     });
+            // }
             var homepage = "";
             if (this.usernum == "" || this.password == "") {
                 this.$message({

+ 126 - 16
src/components/OP/PickupList.vue

@@ -1,5 +1,22 @@
 <template>
     <div v-loading.fullscreen.lock="fullscreenLoading">
+        <el-dialog width="1140px" class="pickupList-ai" title="Ai识别客户名单" :visible.sync="AiVisible">
+            <div class="pickupList-ai-title">第一步:{{textToCopy}}<span @click="btn1">点击复制左侧文字</span></div>
+            <div class="pickupList-ai-title">第二步:打开<span @click="openkimi">KIML</span>,将上述文字和截图粘贴到KIMI文本框里</div>
+            <div class="pickupList-ai-title">第三步:将KIMI生成的内容复制到以下文本框</div>
+            <div class="pickupList-ai-textarea">
+                <el-input
+                style="width:100%"
+                type="textarea"
+                :rows="15"
+                placeholder="请输入内容"
+                v-model="textarea">
+                </el-input>
+            </div>
+            <div class="pickupList-ai-btn">
+                <el-button @click="recognizeclick" size="small"  type="primary">识别</el-button>
+            </div>
+        </el-dialog>
         <div class="pickuplist-all">
             <div class="pickuplist-head">
                 <div class="pickuplist-head-li">
@@ -26,7 +43,8 @@
                     </div>
                     <div class="pickuplist-info-li">
                         <label>起止日期:</label>
-                        <span>{{ GroupInfo.visitStartDate | filter_time }}~{{ GroupInfo.visitEndDate | filter_time }}</span>
+                        <span>{{ GroupInfo.visitStartDate | filter_time }}~{{ GroupInfo.visitEndDate | filter_time
+                            }}</span>
                     </div>
                     <div class="pickuplist-info-li">
                         <label>天数/人数:</label>
@@ -35,11 +53,13 @@
                 </div>
             </div>
             <div class="pickuplist-Upload-box">
+                <el-button style="margin-right: 10px;" size="small" type="primary" @click="AIshibie">AI识别</el-button>
                 <div slot="tip" class="el-upload__tip">只能识别jpg/png文件&nbsp;&nbsp;&nbsp;</div>
                 <el-upload class="upload-demo" ref="upload" action="" :on-change="httpRequest" :on-remove="httpRequest"
                     accept=".png, .jpg, .jpeg" :limit="1" :file-list="fileList" :auto-upload="false">
                     <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
-                    <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">识别图片</el-button>
+                    <el-button style="margin-left: 10px;" size="small" type="success"
+                        @click="submitUpload">识别图片</el-button>
                 </el-upload>
             </div>
             <div class="pickuplist-table">
@@ -74,8 +94,8 @@
                                 type="text" size="small">
                                 详细
                             </el-button>
-                            <el-button @click.native.prevent="PostTourClientListDel(scope.$index, scope.row)" type="text"
-                                size="small">
+                            <el-button @click.native.prevent="PostTourClientListDel(scope.$index, scope.row)"
+                                type="text" size="small">
                                 删除
                             </el-button>
                         </template>
@@ -127,8 +147,8 @@
                         </el-radio-group>
                     </el-form-item>
                     <el-form-item style="width:395px ;" label="出生日期">
-                        <el-date-picker value-format="yyyy-MM-dd" size="medium" type="date" placeholder="选择出生日期" v-model.trim="pickupinif.birth"
-                            style="width: 100%;">
+                        <el-date-picker value-format="yyyy-MM-dd" size="medium" type="date" placeholder="选择出生日期"
+                            v-model.trim="pickupinif.birth" style="width: 100%;">
                         </el-date-picker>
                     </el-form-item>
                     <el-form-item style="width:395px ;" label="舱位类型" prop="Accommodation">
@@ -175,9 +195,10 @@
                         <el-table-column type="index" label="序号" width="50"></el-table-column>
                         <el-table-column property="date" label="姓" width="100">
                             <template slot-scope="scope">
-                                <el-autocomplete popper-class="el-autocomplete-suggestion" :popper-append-to-body="false"
-                                    class="inline-input" size="mini" v-model.trim="scope.row.lastName"
-                                    :fetch-suggestions="querySearch" @select="DTPromptChecked(scope.row)"></el-autocomplete>
+                                <el-autocomplete popper-class="el-autocomplete-suggestion"
+                                    :popper-append-to-body="false" class="inline-input" size="mini"
+                                    v-model.trim="scope.row.lastName" :fetch-suggestions="querySearch"
+                                    @select="DTPromptChecked(scope.row)"></el-autocomplete>
                             </template>
                         </el-table-column>
                         <el-table-column label="名" width="100">
@@ -230,16 +251,18 @@
                         </el-table-column>
                         <el-table-column label="出生日期" width="100">
                             <template slot-scope="scope">
-                                <el-date-picker value-format="yyyy-MM-dd" :clearable="false" size="mini" type="date" placeholder="出生日期"
-                                    v-model.trim="scope.row.birthDay" style="width: 100%;padding-left: 0px;padding-right: 0px;">
+                                <el-date-picker value-format="yyyy-MM-dd" :clearable="false" size="mini" type="date"
+                                    placeholder="出生日期" v-model.trim="scope.row.birthDay"
+                                    style="width: 100%;padding-left: 0px;padding-right: 0px;">
                                 </el-date-picker>
                             </template>
                         </el-table-column>
                         <el-table-column label="舱位类型" width="115">
                             <template slot-scope="scope">
-                                <el-select size="mini" style="width:100%" v-model="scope.row.shippingSpaceTypeId" clearable
-                                    filterable placeholder="请选择">
-                                    <el-option v-for="item in cangweiType" :key="item.id" :label="item.name" :value="item.id">
+                                <el-select size="mini" style="width:100%" v-model="scope.row.shippingSpaceTypeId"
+                                    clearable filterable placeholder="请选择">
+                                    <el-option v-for="item in cangweiType" :key="item.id" :label="item.name"
+                                        :value="item.id">
                                     </el-option>
                                 </el-select>
                             </template>
@@ -495,7 +518,10 @@ export default {
             fileList: [],
             upLoadFile: [],
             fullscreenLoading: false,
-            timeStamp: ''
+            timeStamp: '',
+            AiVisible:false,
+            textToCopy:'按照姓、名、姓名拼音、性别、单位、职务、出生日期的json格式来排列整理(性别和出生日期通过身份证来识别,出生日期按照yyyy-MM-dd来整理)',
+            textarea:""
         }
     },
     methods: {
@@ -522,6 +548,22 @@ export default {
             this.PostShareGroupInfo()
             this.addhandoff()
         },
+        //点击复制
+        btn1() {
+            navigator.clipboard
+                .writeText(this.textToCopy)
+                .then(() => {
+                    this.$message.success("复制成功");
+                })
+                .catch((err) => {
+                    // 复制失败
+                    that.$message.error("复制失败");
+                });
+        },
+        //打开kimi
+        openkimi(){
+            window.open("https://kimi.moonshot.cn");
+        },
         //清空
         clearedlist() {
             this.tourClientListInfos = [
@@ -1094,8 +1136,64 @@ export default {
 
             });
         },
+        //识别
+        recognizeclick(){
+            let textarea=JSON.parse(this.textarea)
+            for (let i = 0; i < textarea.length; i++) {
+                textarea[i].lastName=textarea[i].姓;
+                delete textarea[i].姓;
+                textarea[i].firstName=textarea[i].名;
+                delete textarea[i].名;
+                textarea[i].companyFullName=textarea[i].工作单位;
+                delete textarea[i].工作单位;
+                textarea[i].birthDay=textarea[i].出生日期;
+                delete textarea[i].出生日期;
+                textarea[i].sex=textarea[i].性别;
+                delete textarea[i].性别;
+                textarea[i].job=textarea[i].职务;
+                delete textarea[i].职务;
+                textarea[i].pinyin=textarea[i].姓名拼音.replace(' ','/');
+                delete textarea[i].姓名拼音;
+                textarea[i].iDcard="-";
+                textarea[i].phone="-";
+                textarea[i].shippingSpaceTypeId=460;
+                textarea[i].remark="";
+                textarea[i].isAccompany='否';
+            }
+            console.log(textarea);
+            this.dialogTableVisible=true;
+            this.AiVisible=false;
+            this.tourClientListInfos = textarea
+            var len = 10 - textarea.length
+            for (var jk = 0; jk < len; jk++) {
+                this.tourClientListInfos.push(
+                    {
+                        lastName: '',
+                        firstName: "",
+                        pinyin: '',
+                        sex: '男',
+                        isAccompany: '否',//陪同
+                        companyFullName: "",
+                        job: "",
+                        idCardNo: "",
+                        phone: "",
+                        birthDay: "",
+                        shippingSpaceTypeId: 460,
+                        shippingSpaceSpecialNeeds: '',
+                        hotelSpecialNeeds: '',
+                        mealSpecialNeeds: '',
+                        remark: '',
+                    }
+                )
+            }
+        },
+        //
+        AIshibie(){
+            this.AiVisible=true;
+            this.textarea='';
+        },
         //多条保存
-        manysave() {
+        manysave(){
             var tourClientList = [];
             console.log(this.tourClientListInfos)
             for (var i = 0; i < this.tourClientListInfos.length; i++) {
@@ -1479,4 +1577,16 @@ export default {
 .el-table th.el-table__cell>.cell {
     text-align: left;
 }
+.pickupList-ai-title{
+    margin-bottom: 10px;
+}
+.pickupList-ai-title span{
+    color: #409eff;
+    cursor:pointer;
+    text-decoration: underline;
+}
+.pickupList-ai-btn{
+    text-align: right;
+    margin-top: 10px;
+}
 </style>

+ 9 - 4
src/components/home.vue

@@ -535,7 +535,12 @@ export default {
                 console.log('没有新通知!')
               }
                 // return res.data.data.unreadCount;
-            }else{
+            }else if(res.data.code==204){
+                localStorage.clear();
+                that.$router.push({ name: 'Login' })
+                that.$message.error(res.data.msg);
+            }
+            else{
                 that.$message.error(res.data.msg);
             }
         }).catch(function (error) {
@@ -714,9 +719,9 @@ export default {
     this.token=JSON.parse(localStorage.getItem('userinif')).token;
     this.userinif = JSON.parse(localStorage.getItem('userinif'));
     this.PotsMessageUnreadTotalCount();
-    if (this.userId!=21) {
-        localStorage.clear();
-    }
+    // if (this.userId!=21) {
+    //     localStorage.clear();
+    // }
     // this.startConnection();
   },
   computed: {

+ 252 - 0
src/components/statistics/enterpriseProfit.vue

@@ -0,0 +1,252 @@
+<template>
+    <div class="enterpriseprofit-all">
+        <div class="enterpriseprofit-haed">
+            <el-date-picker style="width:300px" v-model="dates" @change="dateschange" type="daterange" align="right" unlink-panels range-separator="至"
+                start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions">
+            </el-date-picker>
+            <div class="enterpriseprofit-haed-btn">
+                <el-select style="width:150px" v-model="value" filterable placeholder="请选择">
+                    <el-option
+                      v-for="item in options"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value">
+                    </el-option>
+                </el-select>
+                <el-button @click="CorporateProfitExcelDownload" type="primary">导出</el-button>
+            </div>
+        </div>
+        <div class="enterpriseprofit-table">
+            <el-table
+                :data="tableData"
+                border
+                style="width: 100%">
+                <el-table-column
+                prop="rowIndex"
+                label="序号"
+                width="50">
+                </el-table-column>
+                <el-table-column
+                prop="clientName"
+                label="单位"
+                >
+                </el-table-column>
+                <el-table-column
+                prop="teamName"
+                label="团组名称"
+                >
+                </el-table-column>
+                <el-table-column
+                prop="visitDate"
+                :formatter="filteryear"
+                label="出访时间"
+                width="180">
+                </el-table-column>
+                <el-table-column
+                prop="collectionTotal"
+                label="收款"
+                width="180">
+                    <template slot-scope="scope">
+                        <span style="color: #409eff;">{{ townum(scope.row.collectionTotal) }}</span>  (CNY)
+                    </template>
+                </el-table-column>
+                <el-table-column
+                prop="costTotal"
+                label="产生费用"
+                width="180">
+                    <template slot-scope="scope">
+                        <span style="color: red;">{{ townum(scope.row.costTotal) }}</span>  (CNY)
+                    </template>
+                </el-table-column>
+                <el-table-column
+                prop="profitTotal"
+                label="利润"
+                width="180">
+                    <template slot-scope="scope">
+                        <span style="color:#67c23a;">{{ townum(scope.row.profitTotal) }}</span>  (CNY)
+                    </template>
+                </el-table-column>
+            </el-table>
+        </div>
+        <div v-html="enterpriseprofitlabel" class="enterpriseprofit-table-label">
+            
+        </div>
+    </div>
+</template>
+<script>
+export default {
+    data () {
+        return {
+            pickerOptions: {
+                shortcuts: [
+                    {
+                        text: '最近三个月',
+                        onClick(picker) {
+                            const end = new Date();
+                            const start = new Date();
+                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+                            picker.$emit('pick', [start, end]);
+                        }
+                    }, {
+                        text: '最近半年',
+                        onClick(picker) {
+                            const end = new Date();
+                            const start = new Date();
+                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 180);
+                            picker.$emit('pick', [start, end]);
+                        }
+                    }, {
+                        text: '最近一年',
+                        onClick(picker) {
+                            const end = new Date();
+                            const start = new Date();
+                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 365);
+                            picker.$emit('pick', [start, end]);
+                        }
+                    },]
+            },
+            options:[
+                {
+                    value: 1,
+                    label: '月报表'
+                },
+                {
+                    value: 2,
+                    label: '季度报表'
+                },
+                {
+                    value: 3,
+                    label: '年报表'
+                },
+                {
+                    value: 4,
+                    label: '导出'
+                },
+                {
+                    value: 5,
+                    label: '生成'
+                },
+            ],
+            dates:"",
+            value:1,
+            tableData:[],
+            token:"",
+            userId:"",
+            pageId:61,
+            enterpriseprofitlabel:'',
+        }
+    },
+    methods:{
+        //保留两位小数
+        townum(val){
+            return Number(val).toFixed(4)
+        },
+        //时间
+        filteryear(val){
+            let gstime=val.visitDate.split(' ')[0]
+            return gstime;
+        },
+        //处理时间
+        disposeTime(val){
+            var date = new Date(val);
+            var y = date.getFullYear();
+            var m = date.getMonth() + 1;
+            m = m < 10 ? ('0' + m) : m;
+            var d = date.getDate();
+            d = d < 10 ? ('0' + d) : d;
+            let time = y + '-' + m + '-' + d;
+            return time
+        },
+        //时间切换
+        dateschange(val){
+            console.log(this.disposeTime(this.dates[0]));
+            this.CorporateProfitItem(this.disposeTime(this.dates[0]),this.disposeTime(this.dates[1]))
+        },
+        //获取表格
+        CorporateProfitItem(beginDt,endDt) {
+            let tableDatas={}
+            var url = "/api/Statistics/CorporateProfitItem"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer ' + that.token
+                },
+                data: {
+                    portType: 1,
+                    userId: that.userId,
+                    pageId: that.pageId,
+                    beginDt:beginDt,
+                    endDt: endDt,
+                }
+            }).then(function (res) {
+                console.log(res)
+                if (res.data.code == 200) {
+                    tableDatas=res.data.data;
+                    that.tableData=tableDatas.items;
+                    that.enterpriseprofitlabel=tableDatas.label;
+                } else {
+                    that.$message.error(res.data.msg);
+                }
+            }).catch(function (error) {
+                that.$message.error("获取数据源失败!");
+            });
+        },
+        //导出
+        CorporateProfitExcelDownload() {
+            var url = "/api/Statistics/CorporateProfitExcelDownload"
+            var that = this
+            this.$axios({
+                method: 'post',
+                url: url,
+                headers: {
+                    Authorization: 'Bearer ' + that.token
+                },
+                data: {
+                    portType: 1,
+                    userId: that.userId,
+                    pageId: that.pageId,
+                    excelType:that.value,
+                    beginDt:that.disposeTime(that.dates[0]),
+                    endDt: that.disposeTime(that.dates[1]),
+                }
+            }).then(function (res) {
+                console.log(res)
+                if (res.data.code == 200) {
+                    window.open(res.data.data)
+                    that.$message({
+                        message: res.data.msg,
+                        type: 'success',
+                    });
+                } else {
+                    that.$message.error(res.data.msg);
+                }
+            }).catch(function (error) {
+                that.$message.error("导出失败!");
+            });
+        },
+    },
+    mounted(){
+        this.userId=JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
+        this.token=JSON.parse(localStorage.getItem('userinif')).token;
+    }
+}
+</script>
+<style>
+.enterpriseprofit-all{
+    background-color: #fff;
+    padding: 10px;
+    box-shadow: 0 0 5px #0005;
+    border-radius: 10px;
+    min-height: 840px;
+}
+.enterpriseprofit-haed{
+    display: flex;
+    justify-content: space-between;
+}
+.enterpriseprofit-table{
+    margin-top: 15px;
+    margin-bottom: 10px;
+}
+</style>

+ 2 - 2
src/main.js

@@ -29,9 +29,9 @@ Vue.use(VueTypedJs)
 
 
 import axios from 'axios';
-axios.defaults.baseURL = 'http://132.232.92.186:9001';
+axios.defaults.baseURL = 'http://132.232.92.186:8888';
 // axios.defaults.baseURL = 'http://132.232.92.186:9001';
-//axios.defaults.baseURL = 'http://localhost:5256/';
+//axios.defaults.baseURL = 'http://localhost:5256/'; 
 import { Message } from "element-ui";
 
 import common from './assets/js/common'//全局

+ 6 - 0
src/router/index.js

@@ -131,6 +131,7 @@ import InsCountry from '@/components/Resource/InsCountry';
 import WorldMap from '@/components/ConferenceModule/WorldMap';
 import EntryDetailsdraft from '@/components/OP/EntryDetailsdraft';
 import mealrecord from '@/components/OP/mealrecord';
+import enterpriseprofit from '@/components/statistics/enterpriseprofit';
 
 Vue.use(Router)
 
@@ -787,6 +788,11 @@ export default new Router({
           name: 'mealrecord',
           component: mealrecord
         },
+        {
+          path: '/home/enterpriseprofit',
+          name: 'enterpriseprofit',
+          component: enterpriseprofit
+        },
       ]
     },
     {