Forráskód Böngészése

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

Min 2 éve
szülő
commit
a54e3186d7

+ 3 - 2
fhKeeper/formulahousekeeper/inva_4_tivo/index.html

@@ -771,8 +771,9 @@
 
         function check(){
             let str = window.location.href
-            if(str.indexOf('360') > 1) {
-                $('#tilA').attr('href', 'http://worktime.ttkuaiban.com/#/register?from=360')
+            if(str.indexOf('from') > 1) {
+				let strUrl = window.location.href.split('?')[1]
+                $('#tilA').attr('href', `http://worktime.ttkuaiban.com/#/register?${strUrl}`)
             } else {
                 $('#tilA').attr('href', 'http://worktime.ttkuaiban.com/#/register')
             }

BIN
fhKeeper/formulahousekeeper/timesheet/src/assets/image/aacbc.png


+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue

@@ -738,7 +738,7 @@
                         timestamp: res.data.timestamp, // 必填,生成签名的时间戳 
                         nonceStr: res.data.noncestr, // 必填,生成签名的随机串 
                         signature: res.data.sign, // 必填,签名,见附录1 
-                        jsApiList: ['chooseImage','previewImage','uploadImage','downloadImage','previewFile','getLocation','agentConfig'] 
+                        jsApiList: ['chooseImage','previewImage','uploadImage','downloadImage','previewFile','getLocation','agentConfig', 'getLocalImgData'] 
                         });
                         var that = this;
                         wx.ready(function(){

+ 382 - 13
fhKeeper/formulahousekeeper/timesheet/src/views/project/fileCenter.vue

@@ -2,22 +2,12 @@
     <section >
         <div :style="'background:#f7f7f7;padding:10px 50px;height:'+tableHeight+'px;'">
         <!--工具条-->
-        <!-- <el-col :span="24" class="toolbar" style="padding-bottom: 0px;background:#fff;border-bottom:1px solid #f7f7f7;">
-            <el-form :inline="true">
-                <el-form-item label="文件库">
-                </el-form-item>
-                <el-form-item style="float:right;">
-                    <el-link type="primary" :underline="false" @click="createFolder()"><i class="el-icon-folder-add"></i><span style="margin-left:5px;">创建文件夹</span></el-link>
-                    <el-upload ref="upload" action="#" :http-request="uploadFile" :show-file-list="false" :limit="1" style="display:inline-block;">
-                        <el-link type="primary" :underline="false" style="margin-left:10px;"><i class="iconfont firerock-iconshangchuan"></i><span style="margin-left:5px;">文件上传</span></el-link>
-                    </el-upload>
-                </el-form-item>
-            </el-form>
-        </el-col> -->
         <div style="padding: 20px;background:#fff;border-bottom:1px solid #ddd;font-weight:500;font-size:15px;">
             <span @click="viewFolder(null)" style="color: #409EFF;cursor: pointer;">{{ $t('library') }}</span>
             <span v-for="path in pathList" :key="path.id" @click="viewFolder(path)" class="mianbaoxie"> <i class="el-icon-arrow-right jianto"></i> {{path.documentName}}</span>
             <span style="float:right;">
+                <el-link type="primary" :underline="false" v-if="list.length
+                > 0"><i class="el-icon-setting"></i><span style="margin-right:5px;" @click="templatedialingClick('设为模板')">设为模板</span></el-link>
                     <el-link type="primary" :underline="false" @click="createFolder"><i class="el-icon-folder-add"></i><span style="margin-left:5px;">{{ $t('createafolder') }}</span></el-link>
                     <el-upload ref="upload" action="#" :http-request="uploadFile" :show-file-list="false" :limit="1" style="display:inline-block;">
                         <el-link type="primary" :underline="false" style="margin-left:10px;"><i class="iconfont firerock-iconshangchuan"></i><span style="margin-left:5px;">{{ $t('fileupload') }}</span></el-link>
@@ -107,7 +97,7 @@
         </el-dialog>
 
          <!-- 文件夹弹出框 -->
-        <el-dialog :title="$t('modifyingFolder')" v-if="addFolderDialog" :visible.sync="addFolderDialog" :close-on-click-modal="false" customClass="customWidth" width="300px">
+        <!-- <el-dialog :title="$t('modifyingFolder')" v-if="addFolderDialog" :visible.sync="addFolderDialog" :close-on-click-modal="false" customClass="customWidth" width="300px">
             <el-form ref="form2" :model="folderForm" :rules="rules" >
                 <el-form-item prop="documentName">
                     <el-input v-model="folderForm.documentName" :placeholder="$t('pleaseenterfoldername')" maxlength="25"
@@ -117,6 +107,105 @@
             <div slot="footer" class="dialog-footer">
                 <el-button type="primary" @click="addFolder" style="width:100%;" >{{ $t('save') }}</el-button>
             </div>
+        </el-dialog> -->
+
+        <el-dialog :title="$t('modifyingFolder')" v-if="addFolderDialog" :visible.sync="addFolderDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
+            <div class="titleBox">
+                <el-tabs v-model="activeName" @tab-click="handleClick" v-if="!addFolderDialogTwo">
+                    <el-tab-pane label="新建/修改文件夹" name="one">
+                        <el-form ref="form2" :model="folderForm" :rules="rules" style="margin-top: 10px">
+                            <el-form-item prop="documentName">
+                                <el-input v-model="folderForm.documentName" :placeholder="$t('pleaseenterfoldername')" maxlength="25"
+                                    show-word-limit clearable></el-input>
+                            </el-form-item>
+                        </el-form>
+                    </el-tab-pane>
+                    <el-tab-pane label="从模板中创建" name="two">
+                        <div v-for="(item,index) in templateList" :key="index" @click="cardClick(index)">
+                            <el-card :class="`box-card ${templateIndex == index ? 'cardOn' : ''}`">
+                                <div class="text item">
+                                    <div>{{ item.name }}</div>
+                                    <div>
+                                        <el-link :underline="false" @click="editTemplate(item)"><i class="el-icon-edit"></i></el-link>
+                                        <el-link :underline="false" @click="removeTemplate(item)"><i  class="el-icon-delete" style="margin-left: 10px"></i></el-link>
+                                        <div class="cardIcon">
+                                            <i class="el-icon-check" v-if="templateIndex == index"></i>
+                                        </div>
+                                    </div>
+                                </div>
+                            </el-card>
+                        </div>
+                    </el-tab-pane>
+                </el-tabs>
+
+                <el-form ref="form2" :model="folderForm" :rules="rules" v-if="addFolderDialogTwo">
+                    <el-form-item prop="documentName">
+                        <el-input v-model="folderForm.documentName" :placeholder="$t('pleaseenterfoldername')" maxlength="25"
+                            show-word-limit clearable></el-input>
+                    </el-form-item>
+                </el-form>
+            </div>
+            <div slot="footer" class="dialog-footer">
+                <el-button v-if="activeName == 'one'" type="primary" @click="addFolder" style="width:100%;" >{{ $t('save') }}</el-button>
+                <el-button v-if="activeName == 'two'" type="primary" @click="addFolderTemplate" style="width:100%;" >{{ $t('save') }}</el-button>
+            </div>
+        </el-dialog>
+
+        <!-- 设为模板 -->
+        <el-dialog :title="'编辑模板'" v-if="templatedialing" :visible.sync="templatedialing" :close-on-click-modal="false" customClass="customWidth" width="500px">
+            <div>
+                <el-form :model="templateForm" ref="templateForm" label-width="80px">
+                    <el-form-item label="模板名称" prop="name" :rules="[
+                            { required: true, message: '请输入模板名称'}
+                        ]">
+                        <el-input v-model="templateForm.name" :placeholder="'请输入模板名称'" maxlength="25" show-word-limit clearable ></el-input>
+                    </el-form-item>
+                    <el-form-item>
+                        <el-checkbox v-model="templateForm.creWithPro">随项目自动创建</el-checkbox>
+                    </el-form-item>
+                </el-form>
+
+                <div class="fileCenter">文件中心结构</div>
+                <div class="filrTree">
+                    <el-tree
+                        :data="templateDataTree"
+                        node-key="id"
+                        default-expand-all
+                        :expand-on-click-node="false">
+                        <span class="custom-tree-node tree_node" slot-scope="{ node, data }">
+                            <span>{{ node.label }}</span>
+                            <span class="tree_node_btn">
+                                <i class="el-icon-circle-plus-outline" @click="addtemplateNodeDailoing = true, excessiveNodeData = data, nodeForm.name = ''"></i>
+                                <i class="el-icon-delete" style="margin-left: 20px" @click="removeNode(node, data)"></i>
+                            </span>
+                        </span>
+                        </el-tree>
+                </div>
+
+            </div>
+            <div slot="footer" class="dialog-footer">
+                <!-- <el-button v-if="templateFlg" type="primary" style="width:100%;" :loading="templateDataTreeDaylong" @click="addTemplate('templateForm')">{{ $t('save') }}</el-button>
+                <el-button v-if="!templateFlg" type="primary" style="width:100%;" :loading="templateDataTreeDaylong" @click="uploadTemplate('templateForm')">{{ $t('save') }}</el-button> -->
+                <el-button type="primary" style="width:100%;" :loading="templateDataTreeDaylong" @click="addTemplate('templateForm')">{{ $t('save') }}</el-button>
+            </div>
+        </el-dialog>
+
+        <!-- 添加子节点 -->
+        <el-dialog :title="'新增节点'" v-if="addtemplateNodeDailoing" :visible.sync="addtemplateNodeDailoing" :close-on-click-modal="false" customClass="customWidth" width="500px">
+            <div>
+                <el-form :model="nodeForm" ref="nodeForm" label-width="100px" class="demo-ruleForm">
+                    <el-form-item label="节点名称" prop="name"
+                        :rules="[
+                            { required: true, message: '请输入节点名称'}
+                        ]"
+                    >
+                        <el-input v-model="nodeForm.name"></el-input>
+                    </el-form-item>
+                </el-form>
+            </div>
+            <div slot="footer" class="dialog-footer">
+                <el-button type="primary" style="width:100%;" @click="addtemplateNode('nodeForm')">确定</el-button>
+            </div>
         </el-dialog>
         </div>
     </section>
@@ -135,6 +224,63 @@
 .mianbaoxie:hover .jianto {
     color: #909399;
 }
+.custom-tree-node {
+    flex: 1;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    font-size: 14px;
+    padding-right: 8px;
+}
+.fileCenter {
+    margin-bottom: 10px;
+}
+.filrTree {
+    width: 100%;
+    max-height: 280px;
+    overflow: auto;
+    margin-bottom: 10px;
+}
+.titleBox {
+    width: 100%;
+    max-height: 340px;
+    overflow: auto;
+    margin-bottom: 10px;
+    padding: 0 10px;
+    box-sizing: border-box;
+}
+.text {
+  font-size: 14px;
+}
+.item {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: space-between;
+}
+.clearfix:before,
+.clearfix:after {
+  display: table;
+  content: "";
+}
+.clearfix:after {
+  clear: both
+}
+.box-card {
+  width: 100%;
+  box-sizing: border-box;
+  margin: 10px 0;
+}
+.cardOn {
+    border: 1px solid #409EFF;
+}
+.cardIcon {
+    display: inline-block; 
+    margin-left: 10px;
+    width: 20px;
+    color: #409EFF;
+    font-size: 16px;
+    font-weight: bold;
+}
 </style>
 <script>
     import util from "../../common/js/util";
@@ -166,9 +312,216 @@
                 addForm: {
                     
                 },
+                templateTitle: '',
+                templatedialing: false,
+                templateForm: {
+                    name: ''
+                },
+                templateDataTree: [],
+                addtemplateNodeDailoing: false,
+                nodeForm: {
+                    name: ''
+                },
+                excessiveNodeData: null,
+                templateDataTreeDaylong: false,
+                activeName: 'one',
+                templateList: [],
+                templateFlg: false,
+                templateIndex: '0',
+                addFolderDialogTwo: false
             };
         },
         methods: {
+            addFolderTemplate() {
+                let obj = {
+                    templateId: this.templateList[this.templateIndex].id,
+                    projectId: this.curProjectId,
+                }
+                this.parentFid ? obj.parentFid = this.parentFid : ''
+                console.log('obj', obj)
+                // return
+                this.http.post('/document/buildWithTemplate', obj,
+                res => {
+                    if (res.code == "ok") {
+                        this.addFolderDialog = false
+                        this.getList()
+                    } else {
+                        this.$message({message: res.msg,type: 'error'});
+                    }
+                }, error => {
+                    this.$message({message: error,type: 'error'});
+                })
+            },
+            cardClick(index) {
+                this.templateIndex = index
+            },
+            editTemplate(data) {
+                this.templateForm.name = data.name
+                this.templateForm.creWithPro = data.creWithPro ? true : false
+                this.templateForm.id = data.id
+                this.templateDataTree = data.proDocumentTemDetailList
+                this.templateFlg = false
+                this.templatedialing = true
+            },
+            removeTemplate(data) {
+                this.$confirm(`确定删除【${data.name}】模板吗?`, '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    this.http.post('/project-document-template/delete', {id: data.id},
+                        res => {
+                            if (res.code == "ok") {
+                                this.$message({
+                                    message: `删除成功`,
+                                    type: 'success'
+                                });
+                                this.getTemplateList()
+                            } else {
+                                this.$message({message: res.msg,type: 'error'});
+                            }
+                        }, error => {
+                            this.$message({message: error,type: 'error'});
+                        })
+                }).catch(() => {});
+            },
+            uploadTemplate(formName) {
+                this.$refs[formName].validate((valid) => {
+                    if (valid) {
+                        this.templateDataTreeDaylong = true
+                        this.http.post('/project-document-template/update', {
+                            proDocumentTemDetailList: JSON.stringify(this.templateDataTree),
+                            name: this.templateForm.name,
+                            creWithPro: this.templateForm.creWithPro ? '1' : '0',
+                            id: this.templateForm.id,
+                            companyId: this.user.companyId
+                        },
+                        res => {
+                            this.templateDataTreeDaylong = false
+                            if (res.code == "ok") {
+                                this.$message({
+                                    message: `操作成功`,
+                                    type: 'success'
+                                });
+                            } else {this.$message({message: res.msg,type: 'error'});}
+                        }, error => {
+                            this.templateDataTreeDaylong = false
+                            this.$message({message: error,type: 'error'});
+                        })
+                    } else {
+                        console.log('error submit!!');
+                        return false;
+                    }
+                });
+            },
+            addTemplate(formName) {
+                this.$refs[formName].validate((valid) => {
+                    if (valid) {
+                        let obj = {} 
+                        if(this.templateFlg) {
+                            obj = {
+                                documentString: JSON.stringify(this.templateDataTree),
+                                name: this.templateForm.name,
+                                creWithPro: this.templateForm.creWithPro ? '1' : '0',
+                                companyId: this.user.companyId
+                            }
+                        } else {
+                            obj = {
+                                documentString: JSON.stringify(this.templateDataTree),
+                                name: this.templateForm.name,
+                                creWithPro: this.templateForm.creWithPro ? '1' : '0',
+                                id: this.templateForm.id,
+                                companyId: this.user.companyId
+                            }
+                        }
+                        this.templateDataTreeDaylong = true
+                        // this.http.post('/project-document-template/addTemplate', {
+                        this.http.post('/project-document-template/addTemplate', obj,
+                        res => {
+                            this.templateDataTreeDaylong = false
+                            if (res.code == "ok") {
+                                this.$message({
+                                    message: `(${this.templateForm.name}) 模板添加成功,可在创建文件夹中查看`,
+                                    type: 'success'
+                                });
+                                this.templatedialing = false
+                            } else {
+                                this.$message({
+                                    message: res.msg,
+                                    type: 'error'
+                                });
+                            }
+                        }, error => {
+                            this.templateDataTreeDaylong = false
+                            this.$message({
+                                message: error,
+                                type: 'error'
+                            });
+                        })
+                    } else {
+                        console.log('error submit!!');
+                        return false;
+                    }
+                });
+            },
+            addtemplateNode(formName) {
+                this.$refs[formName].validate((valid) => {
+                    if (valid) {
+                        console.log('excessiveNodeData',this.excessiveNodeData)
+                        let data = this.excessiveNodeData
+                        const newChild = { label: this.nodeForm.name, children: [], folderId: this.excessiveNodeData.id || ''};
+                        if (!data.children) {
+                            this.$set(data, 'children', []);
+                        }
+                        data.children.push(newChild);
+                        this.addtemplateNodeDailoing = false
+                    } else {
+                        console.log('error submit!!');
+                        return false;
+                    }
+                });
+            },
+            removeNode(node, data) {
+                this.$confirm(`确定删除(${data.label})节点?`, '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    const parent = node.parent;
+                    const children = parent.data.children || parent.data;
+                    const index = children.findIndex(d => d.id === data.id);
+                    children.splice(index, 1);
+                }).catch(() => {});
+            },
+            templatedialingClick(title) {
+                this.templateTitle = title
+                this.templateForm = {name: ''}
+                this.templatedialing = true
+                this.templateFlg = true
+                this.getTemplateDataTree()
+            },
+            getTemplateDataTree() {
+                this.http.post('/document/getSubList', {
+                    projectId: this.curProjectId,
+                    parentFid: this.parentFid
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.templateDataTree = []
+                        this.templateDataTree = res.data
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        });
+                    }
+                }, error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    });
+                })
+            },
             cursorOver(row, column, cell, event) {
                 this.currentDataId = row.id;
             },
@@ -285,11 +638,27 @@
             },
             showEditName(row) {
                 this.addFolderDialog = true;
+                this.addFolderDialogTwo = true
                 this.folderForm = JSON.parse(JSON.stringify(row));
             },
             createFolder(){
                 this.addFolderDialog = true;
+                this.addFolderDialogTwo = false
                 this.folderForm = {projectId: this.curProjectId, folderId: this.parentFid,isFolder: 1};
+                this.activeName = 'one'
+                this.getTemplateList()
+            },
+            getTemplateList() {
+                this.http.post('/project-document-template/list ', {},
+                res => {
+                    if (res.code == "ok") {
+                        this.templateList = res.data
+                    } else {
+                        this.$message({message: res.msg,type: 'error'});
+                    }
+                }, error => {
+                    this.$message({message: error,type: 'error'});
+                })
             },
 
             openWin(url) {

+ 84 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -589,6 +589,19 @@
                             <el-input v-model="domain.content" type="textarea" :rows="4" :placeholder="$t('defaultText.pleaseFillOut')" clearable style="width:75%;margin-right:7%"
                             :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
                         </el-form-item>
+                        <!-- 拍照上传 -->
+                        <el-form-item label="图片上传" v-if="user.companyId == '7' || user.companyId == '10'">
+                            <div class="photos">
+                                <div class="photos_img" v-for="(p, ip) in domain.pics" :key="ip">
+                                    <img
+                                        style="width: 120px; height: 120px; margin-right:10px;"
+                                        :src="p" />
+                                </div>
+                                <div @click="addImg(index)" class="photos_img">
+                                    <img src="../../assets/image/aacbc.png" />
+                                </div>
+                            </div>
+                        </el-form-item>
                         </div>
                         <!--多个工作事项填报的情况 -->
                         <div v-if="reportTimeType.multiWorktime==1">
@@ -750,13 +763,13 @@
                         </div>
 
                         <!--照片的显示 -->
-                        <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;"> 
+                        <!-- <p v-if="domain.pics != null && domain.pics.length > 0" style="text-align:center;"> 
                             <el-image v-for="(pic, index) in domain.pics" :key="index"
                                 style="width: 100px; height: 100px; margin-right:10px;"
                                 :src="pic" 
                                 :preview-src-list="domain.pics">
                             </el-image>
-                        </p>
+                        </p> -->
                         <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider>
                     </div>
                     <span id="workFormsItemBottom"></span>
@@ -2105,6 +2118,59 @@
                     })
                 })
             },
+            // 图片上传
+            addImg(index) {
+                var that = this;
+                // if (that.workForm.domains[index].pics == null) {
+                //     that.workForm.domains[index].pics = [];
+                //     that.workForm.domains[index].iospics = [];
+                // }
+                // that.workForm.domains[index].pics.push('wxLocalResource://imageidQzpcVXNlcnNcTEpZXERlc2t0b3Bc5oG25pCe5Zu+54mHXGhwLmpwZw==')
+                // console.log(that.workForm.domains)
+                wx.chooseImage({
+                    count: 3, // 默认9
+                    sizeType: ['compressed'],
+                    sourceType: ['album'],
+                    defaultCameraMode: "batch",
+                    success: function (res) {
+                        console.log(res, '数据')
+                        var localIds = res.localIds;
+                        wx.getLocalImgData({
+                            localId: localIds[0], // 图片的localID
+                            success: function (res) {
+                                var localData = res.localData;
+                                console.log('转之后的', localData, res)
+                                if (that.workForm.domains[index].pics == null) {
+                                    that.workForm.domains[index].pics = [];
+                                    that.workForm.domains[index].iospics = [];
+                                }
+                                if (that.user.companyId == 7) {
+                                    that.workForm.domains[index].pics = that.workForm.domains[index].pics.concat(localData); 
+                                } else {
+                                    that.workForm.domains[index].pics = localData;
+                                }
+                                that.$forceUpdate(); 
+                                if (that.workForm.domains[index].serverPics == null) {
+                                    that.workForm.domains[index].serverPics = [];
+                                }
+                                for (var i=0;i<localIds.length; i++) {
+                                    wx.uploadImage({
+                                        localId: localIds[i], // 需要上传的图片的本地ID,由chooseImage接口获得
+                                        isShowProgressTips: 1, // 默认为1,显示进度提示
+                                        success: function (res) {
+                                            var serverId = res.serverId; // 返回图片的服务器端ID
+                                            that.workForm.domains[index].serverPics.push(serverId);
+
+                                            console.log(that.workForm.domains, '数据')
+                                        }
+                                    });
+                                }
+                            }
+                        });
+                        
+                    }
+                })
+            },
             test(){
                 console.log('test',this.workForm.domains);
             },
@@ -6691,6 +6757,22 @@
 </script>
 
 <style lang="scss" scoped>
+.photos {
+    position: relative;
+    display: flex;
+    flex-wrap: wrap;
+}
+.photos_img {
+    width: 120px;
+    height: 120px;
+    margin-right: 20px;
+    margin-bottom: 20px;
+    cursor: pointer;
+    img {
+        width: 100%;
+        height: 100%;
+    }
+}
 .paginatis {
     padding: 10px 10px;
     background: #f2f2f2;

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -501,7 +501,7 @@ import timetoolVue from '../timetool/timetool.vue';
                     searchList: []
                 },
                 // vacationTime: {},
-                // totalReportHours: 0,
+                totalReportHours: 0,
                 // leftDataList:[],
                 // rightDataList:[],
             };