Просмотр исходного кода

Merge branch 'master' of http://192.168.1.41:3000/maixinrong/Calculation

TonyKang 5 лет назад
Родитель
Сommit
6f8ba915b0

+ 80 - 7
app/const/cld_office.js

@@ -1,22 +1,95 @@
 'use strict';
 'use strict';
 
 
 /**
 /**
- * CLD办事处
+ * CLD办事处(和CLD里ID相对应)
  *
  *
  * @author CaiAoLin
  * @author CaiAoLin
  * @date 2017/10/31
  * @date 2017/10/31
  * @version
  * @version
  */
  */
 const officeType = {
 const officeType = {
-    HEAD_OFFICE: 1,
-    GUANGDONG: 2,
-    CHONGQING: 3,
+    ANHUI: 2,
+    GANSU: 3,
+    GUANGDONG: 4,
+    GUANGXI: 5,
+    JIANGXI: 6,
+    SICHUAN: 7,
+    CHONGQING: 8,
+    NEIMENG: 9,
+    ZHEJIANG: 10,
+    SHANDONG: 11,
+    ZONGBU: 12,
+    YUNNAN: 13,
+    GUIZHOU: 14,
+    BEIJING: 15,
+    FUJIAN: 16,
+    HAINAN: 17,
+    HEBEI: 18,
+    HENAN: 19,
+    HEILONGJIANG: 20,
+    HUBEI: 21,
+    HUNAN: 22,
+    JILIN: 23,
+    JIANGSU: 24,
+    LIAONING: 25,
+    NINGXIA: 26,
+    YJZX: 27,
 };
 };
 
 
 const office = [];
 const office = [];
-office[officeType.HEAD_OFFICE] = '总部';
-office[officeType.GUANGDONG] = '广东办事处';
-office[officeType.CHONGQING] = '重庆办事处';
+office[officeType.ANHUI] = '安徽办';
+office[officeType.GANSU] = '甘肃办';
+office[officeType.GUANGDONG] = '广东办';
+office[officeType.GUANGXI] = '广西办';
+office[officeType.JIANGXI] = '江西办';
+office[officeType.SICHUAN] = '四川办';
+office[officeType.CHONGQING] = '重庆办';
+office[officeType.NEIMENG] = '内蒙办';
+office[officeType.ZHEJIANG] = '浙江办';
+office[officeType.SHANDONG] = '上海办';
+office[officeType.ZONGBU] = '总部';
+office[officeType.YUNNAN] = '云南办';
+office[officeType.GUIZHOU] = '贵州办';
+office[officeType.BEIJING] = '北京办';
+office[officeType.FUJIAN] = '福建办';
+office[officeType.HAINAN] = '海南办';
+office[officeType.HEBEI] = '河北办';
+office[officeType.HENAN] = '河南办';
+office[officeType.HEILONGJIANG] = '黑龙江办';
+office[officeType.HUBEI] = '湖北办';
+office[officeType.HUNAN] = '湖南办';
+office[officeType.JILIN] = '吉林办';
+office[officeType.JIANGSU] = '江苏办';
+office[officeType.LIAONING] = '辽宁办';
+office[officeType.NINGXIA] = '宁夏办';
+office[officeType.YJZX] = '总部-造价研究中心';
+// const office = [
+//     {id: officeType.ANHUI, name: '安徽办'},
+//     {id: officeType.GANSU, name: '甘肃办'},
+//     {id: officeType.GUANGDONG, name: '广东办'},
+//     {id: officeType.GUANGXI, name: '广西办'},
+//     {id: officeType.JIANGXI, name: '江西办'},
+//     {id: officeType.SICHUAN, name: '四川办'},
+//     {id: officeType.CHONGQING, name: '重庆办'},
+//     {id: officeType.NEIMENG, name: '内蒙办'},
+//     {id: officeType.ZHEJIANG, name: '浙江办'},
+//     {id: officeType.SHANDONG, name: '山东办'},
+//     {id: officeType.ZONGBU, name: '总部'},
+//     {id: officeType.YUNNAN, name: '云南办'},
+//     {id: officeType.GUIZHOU, name: '贵州办'},
+//     {id: officeType.BEIJING, name: '北京办'},
+//     {id: officeType.FUJIAN, name: '福建办'},
+//     {id: officeType.HAINAN, name: '海南办'},
+//     {id: officeType.HEBEI, name: '河北办'},
+//     {id: officeType.HENAN, name: '河南办'},
+//     {id: officeType.HEILONGJIANG, name: '黑龙江办'},
+//     {id: officeType.HUBEI, name: '湖北办'},
+//     {id: officeType.HUNAN, name: '湖南办'},
+//     {id: officeType.JILIN, name: '吉林办'},
+//     {id: officeType.JIANGSU, name: '江苏办'},
+//     {id: officeType.LIAONING, name: '辽宁办'},
+//     {id: officeType.NINGXIA, name: '宁夏办'}
+// ];
 
 
 module.exports = {
 module.exports = {
     type: officeType,
     type: officeType,

+ 10 - 2
app/controller/dashboard_controller.js

@@ -9,6 +9,7 @@
  */
  */
 
 
 const auditConst = require('../const/audit');
 const auditConst = require('../const/audit');
+const officeList = require('../const/cld_office').list;
 
 
 module.exports = app => {
 module.exports = app => {
 
 
@@ -25,19 +26,23 @@ module.exports = app => {
             const auditStages = await ctx.service.stageAudit.getAuditStage(ctx.session.sessionUser.accountId);
             const auditStages = await ctx.service.stageAudit.getAuditStage(ctx.session.sessionUser.accountId);
             const auditChanges = await ctx.service.changeAudit.getAuditChange(ctx.session.sessionUser.accountId);
             const auditChanges = await ctx.service.changeAudit.getAuditChange(ctx.session.sessionUser.accountId);
             const auditRevise = await ctx.service.reviseAudit.getAuditRevise(ctx.session.sessionUser.accountId);
             const auditRevise = await ctx.service.reviseAudit.getAuditRevise(ctx.session.sessionUser.accountId);
-            const projectAccountInfo = await ctx.service.projectAccount.getDataById(ctx.session.sessionUser.accountId);
             const pa = await ctx.service.projectAccount.getDataById(ctx.session.sessionUser.accountId);
             const pa = await ctx.service.projectAccount.getDataById(ctx.session.sessionUser.accountId);
             const lastNotice = pa.last_notice ? pa.last_notice : (pa.last_notice === 0 ? new Date() : new Date(pa.last_login * 1000));
             const lastNotice = pa.last_notice ? pa.last_notice : (pa.last_notice === 0 ? new Date() : new Date(pa.last_login * 1000));
             const noticeLedger = await ctx.service.ledgerAudit.getNoticeTender(ctx.session.sessionProject.id, pa.id, lastNotice);
             const noticeLedger = await ctx.service.ledgerAudit.getNoticeTender(ctx.session.sessionProject.id, pa.id, lastNotice);
             const noticeStage = await ctx.service.stageAudit.getNoticeStage(ctx.session.sessionProject.id, pa.id, lastNotice);
             const noticeStage = await ctx.service.stageAudit.getNoticeStage(ctx.session.sessionProject.id, pa.id, lastNotice);
             const noticeChange = await ctx.service.changeAudit.getNoticeChange(ctx.session.sessionProject.id, pa.id, lastNotice);
             const noticeChange = await ctx.service.changeAudit.getNoticeChange(ctx.session.sessionProject.id, pa.id, lastNotice);
             const noticeRevise = await ctx.service.reviseAudit.getNoticeRevise(ctx.session.sessionProject.id, pa.id, lastNotice);
             const noticeRevise = await ctx.service.reviseAudit.getNoticeRevise(ctx.session.sessionProject.id, pa.id, lastNotice);
+            const projectData = await ctx.service.project.getDataById(ctx.session.sessionProject.id);
+            // 获取销售人员数据
+            const salesmanData = await ctx.service.manager.getDataById(projectData.manager_id);
+            const officeName = officeList[salesmanData.office];
             const renderData = {
             const renderData = {
                 auditTenders,
                 auditTenders,
                 auditStages,
                 auditStages,
                 auditChanges,
                 auditChanges,
                 auditRevise,
                 auditRevise,
-                role: projectAccountInfo.role,
+                role: pa.role,
+                authMobile: pa.auth_mobile,
                 acLedger: auditConst.ledger,
                 acLedger: auditConst.ledger,
                 acStage: auditConst.stage,
                 acStage: auditConst.stage,
                 acChange: auditConst.flow,
                 acChange: auditConst.flow,
@@ -46,6 +51,9 @@ module.exports = app => {
                 noticeStage,
                 noticeStage,
                 noticeChange,
                 noticeChange,
                 noticeRevise,
                 noticeRevise,
+                projectData,
+                salesmanData,
+                officeName,
             };
             };
             await this.layout('dashboard/index.ejs', renderData);
             await this.layout('dashboard/index.ejs', renderData);
             await ctx.service.projectAccount.defaultUpdate({
             await ctx.service.projectAccount.defaultUpdate({

+ 35 - 0
app/controller/profile_controller.js

@@ -8,9 +8,12 @@
  * @version
  * @version
  */
  */
 
 
+const moment = require('moment');
 const profileMenu = require('../../config/menu').profileMenu;
 const profileMenu = require('../../config/menu').profileMenu;
 const smsTypeConst = require('../const/sms_type');
 const smsTypeConst = require('../const/sms_type');
 const qr = require('qr-image');
 const qr = require('qr-image');
+const path = require('path');
+const sendToWormhole = require('stream-wormhole');
 
 
 module.exports = app => {
 module.exports = app => {
 
 
@@ -302,6 +305,38 @@ module.exports = app => {
         }
         }
 
 
         /**
         /**
+         * 上传签名图
+         *
+         * @param {object} ctx - egg全局变量
+         * @return {void}
+         */
+        async signUpload(ctx) {
+            const responseData = {
+                err: 0, msg: '', data: null,
+            };
+            try {
+                const stream = await ctx.getFileStream();
+                const create_time = Date.parse(new Date()) / 1000;
+                const fileInfo = path.parse(stream.filename);
+                const dirName = 'public/upload/sign';
+                const fileName = moment().format('YYYYMMDD') + '_sign_' + create_time + fileInfo.ext;
+                await ctx.helper.saveStreamFile(stream, path.join(this.app.baseDir, 'app', dirName, fileName));
+                await sendToWormhole(stream);
+                const result = await ctx.service.projectAccount.update({ sign_path: fileName }, { id: ctx.session.sessionUser.accountId });
+                if (result) {
+                    responseData.data = { sign_path: fileName };
+                } else {
+                    throw '添加数据库失败';
+                }
+            } catch (err) {
+                this.log(err);
+                responseData.err = 1;
+                responseData.msg = err;
+            }
+            ctx.body = responseData;
+        }
+
+        /**
          * 账号安全
          * 账号安全
          *
          *
          * @param {object} ctx - egg全局变量
          * @param {object} ctx - egg全局变量

+ 1 - 1
app/public/js/ledger.js

@@ -99,7 +99,7 @@ $(document).ready(function() {
                 if (data) {
                 if (data) {
                     $('#bills-expr').val(data[col.field]).attr('field', col.field).attr('org', data[col.field]);
                     $('#bills-expr').val(data[col.field]).attr('field', col.field).attr('org', data[col.field]);
                     if (col.field.indexOf('dgn') >= 0) {
                     if (col.field.indexOf('dgn') >= 0) {
-                        $('#bills-expr').attr('readOnly', readOnly || cell.locked() || data.b_code);
+                        $('#bills-expr').attr('readOnly', readOnly || cell.locked() || (_.isString(data.b_code) && data.b_code !== ''));
                     } else {
                     } else {
                         $('#bills-expr').attr('readOnly', readOnly || cell.locked() || (data.children && data.children.length > 0));
                         $('#bills-expr').attr('readOnly', readOnly || cell.locked() || (data.children && data.children.length > 0));
                     }
                     }

+ 31 - 0
app/public/js/profile.js

@@ -117,6 +117,37 @@ $(document).ready(function() {
                 $('#sign-show').remove();
                 $('#sign-show').remove();
                 toast('移除成功', 'success');
                 toast('移除成功', 'success');
             })
             })
+        });
+
+        // 签名模式切换
+        $('.sign-type').click(function () {
+            if (parseInt($(this).val()) === 1) {
+                $('#show-upload').hide();
+                $('#show-qrcode').show();
+            } else {
+                $('#show-upload').show();
+                $('#show-qrcode').hide();
+            }
+        });
+
+        // 上传签名
+        $('#sign-upload').change(function () {
+            const file = this.files[0];
+            const ext = file.name.toLowerCase().split('.').splice(-1)[0];
+            const imgStr = /(jpg|jpeg|png|bmp|BMP|JPG|PNG|JPEG)$/;
+            if (!imgStr.test(ext)) {
+                toast('请上传正确的图片格式文件','error');
+                return
+            }
+            if ($(this).val()) {
+                const formData = new FormData();
+                formData.append('file', this.files[0]);
+                postDataWithFile('/profile/sign/upload', formData, function (result) {
+                    const html = '<img src="/public/upload/sign/'+ result.sign_path +'" width="90">';
+                    $('#sign-show').html(html);
+                    $('#sign-upload').val('');
+                });
+            }
         })
         })
     } catch (error) {
     } catch (error) {
         console.log(error);
         console.log(error);

+ 2 - 2
app/public/js/revise.js

@@ -62,9 +62,9 @@ $(document).ready(() => {
                     $('#bills-expr').val(data[col.field]).attr('field', col.field).attr('org', data[col.field]);
                     $('#bills-expr').val(data[col.field]).attr('field', col.field).attr('org', data[col.field]);
 
 
                     if (col.field.indexOf('dgn') >= 0) {
                     if (col.field.indexOf('dgn') >= 0) {
-                        $('#bills-expr').attr('readOnly', readOnly || cell.locked() || data.b_code);
+                        $('#bills-expr').attr('readOnly', readOnly || cell.locked() || (_.isString(data.b_code) && data.b_code !== ''));
                     } else if (col.field === 'unit_price') {
                     } else if (col.field === 'unit_price') {
-                        $('#bills-expr').attr('readOnly', readOnly || cell.locked() || (data.children && data.children.length > 0) || node.used);
+                        $('#bills-expr').attr('readOnly', readOnly || cell.locked() || (data.children && data.children.length > 0) || (_.isBoolean(data.used) && data.used === true));
                     } else {
                     } else {
                         $('#bills-expr').attr('readOnly', readOnly || cell.locked() || (data.children && data.children.length > 0));
                         $('#bills-expr').attr('readOnly', readOnly || cell.locked() || (data.children && data.children.length > 0));
                     }
                     }

+ 6 - 2
app/public/js/stage.js

@@ -498,8 +498,12 @@ $(document).ready(() => {
                 if (nodePos && nodePos.length > 0) {
                 if (nodePos && nodePos.length > 0) {
                     $('#bills-expr').val('').attr('readOnly', true);
                     $('#bills-expr').val('').attr('readOnly', true);
                 } else {
                 } else {
-                    $('#bills-expr').val(data[col.field]).attr('field', col.field).attr('org', data[col.field])
-                        .attr('readOnly', readOnly || cell.locked());
+                    $('#bills-expr').val(data[col.field]).attr('field', col.field).attr('org', data[col.field]);
+                    if (col.field.indexOf('tp') >= 0) {
+                        $('#bills-expr').attr('readOnly', readOnly || cell.locked() || data.is_tp !== 1);
+                    } else {
+                        $('#bills-expr').attr('readOnly', readOnly || cell.locked() || data.is_tp === 1)
+                    }
                 }
                 }
             } else {
             } else {
                 $('#bills-expr').val('').attr('readOnly', true);
                 $('#bills-expr').val('').attr('readOnly', true);

+ 1 - 0
app/public/upload/qrcode/page.html

@@ -0,0 +1 @@
+当前页存签名图片

+ 1 - 0
app/router.js

@@ -240,6 +240,7 @@ module.exports = app => {
     app.post('/profile/sms/type', sessionAuth, 'profileController.smsType');
     app.post('/profile/sms/type', sessionAuth, 'profileController.smsType');
     app.get('/profile/sign', sessionAuth, 'profileController.sign');
     app.get('/profile/sign', sessionAuth, 'profileController.sign');
     app.post('/profile/sign/delete', sessionAuth, 'profileController.signDelete');
     app.post('/profile/sign/delete', sessionAuth, 'profileController.signDelete');
+    app.post('/profile/sign/upload', sessionAuth, 'profileController.signUpload');
     app.get('/profile/safe', sessionAuth, 'profileController.safe');
     app.get('/profile/safe', sessionAuth, 'profileController.safe');
     app.post('/profile/save', sessionAuth, 'profileController.saveBase');
     app.post('/profile/save', sessionAuth, 'profileController.saveBase');
     app.post('/profile/password', sessionAuth, 'profileController.modifyPassword');
     app.post('/profile/password', sessionAuth, 'profileController.modifyPassword');

+ 16 - 4
app/service/change.js

@@ -420,6 +420,7 @@ module.exports = app => {
          * @return {void}
          * @return {void}
          */
          */
         async approvalSuccess(postData, changeData) {
         async approvalSuccess(postData, changeData) {
+            let tenderInfo;
             // 初始化事务
             // 初始化事务
             this.transaction = await this.db.beginTransaction();
             this.transaction = await this.db.beginTransaction();
             let result = false;
             let result = false;
@@ -445,8 +446,12 @@ module.exports = app => {
                     const lid = listInfo[0];
                     const lid = listInfo[0];
                     const amount = listInfo[1];
                     const amount = listInfo[1];
                     const changeListInfo = await this.ctx.service.changeAuditList.getDataById(lid);
                     const changeListInfo = await this.ctx.service.changeAuditList.getDataById(lid);
+                    if (!tenderInfo) {
+                        tenderInfo  = await this.ctx.service.tenderInfo.getTenderInfo(changeListInfo.tid);
+                    }
                     if (changeListInfo !== undefined) {
                     if (changeListInfo !== undefined) {
-                        total_price += this.ctx.helper.accMul(changeListInfo.unit_price, parseFloat(amount));
+                        total_price = this.ctx.helper.add(total_price,
+                            this.ctx.helper.mul(changeListInfo.unit_price, amount, tenderInfo.decimal.tp));
                         const audit_amount = changeListInfo.audit_amount !== null && changeListInfo.audit_amount !== '' ? changeListInfo.audit_amount.split(',') : [];
                         const audit_amount = changeListInfo.audit_amount !== null && changeListInfo.audit_amount !== '' ? changeListInfo.audit_amount.split(',') : [];
                         audit_amount.push(amount);
                         audit_amount.push(amount);
                         const list_update = {
                         const list_update = {
@@ -514,6 +519,7 @@ module.exports = app => {
                 await this.transaction.commit();
                 await this.transaction.commit();
                 result = true;
                 result = true;
             } catch (error) {
             } catch (error) {
+                console.log(error);
                 await this.transaction.rollback();
                 await this.transaction.rollback();
                 result = false;
                 result = false;
             }
             }
@@ -571,6 +577,7 @@ module.exports = app => {
             let result = false;
             let result = false;
             try {
             try {
                 const changeInfo = await this.getDataByCondition({ cid: postData.change_id });
                 const changeInfo = await this.getDataByCondition({ cid: postData.change_id });
+                const tenderInfo  = await this.ctx.service.tenderInfo.getTenderInfo(changeInfo.tid);
                 // 设置审批人退回
                 // 设置审批人退回
                 const audit_update = {
                 const audit_update = {
                     id: postData.audit_id,
                     id: postData.audit_id,
@@ -607,7 +614,8 @@ module.exports = app => {
                 const changeList = await this.ctx.service.changeAuditList.getAllDataByCondition({ where: { cid: changeInfo.cid } });
                 const changeList = await this.ctx.service.changeAuditList.getAllDataByCondition({ where: { cid: changeInfo.cid } });
                 let total_price = 0;
                 let total_price = 0;
                 for (const cl of changeList) {
                 for (const cl of changeList) {
-                    total_price += this.ctx.helper.accMul(cl.unit_price, cl.camount);
+                    total_price = this.ctx.helper.add(total_price,
+                        this.ctx.helper.mul(cl.unit_price, cl.camount, tenderInfo.decimal.tp));
                 }
                 }
                 // 设置变更令退回
                 // 设置变更令退回
                 const change_update = {
                 const change_update = {
@@ -662,6 +670,7 @@ module.exports = app => {
             let result = false;
             let result = false;
             try {
             try {
                 const changeInfo = await this.getDataByCondition({ cid: postData.change_id });
                 const changeInfo = await this.getDataByCondition({ cid: postData.change_id });
+                const tenderInfo  = await this.ctx.service.tenderInfo.getTenderInfo(changeInfo.tid);
                 // 设置审批人退回
                 // 设置审批人退回
                 const audit_update = {
                 const audit_update = {
                     id: postData.audit_id,
                     id: postData.audit_id,
@@ -732,7 +741,8 @@ module.exports = app => {
                         audit_amount: audit_amount.join(','),
                         audit_amount: audit_amount.join(','),
                         spamount: parseFloat(last_amount),
                         spamount: parseFloat(last_amount),
                     };
                     };
-                    total_price += this.ctx.helper.accMul(cl.unit_price, parseFloat(last_amount));
+                    total_price = this.ctx.helper.add(total_price,
+                        this.ctx.helper.mul(cl.unit_price, parseFloat(last_amount), tenderInfo.decimal.tp));
                     await this.transaction.update(this.ctx.service.changeAuditList.tableName, list_update);
                     await this.transaction.update(this.ctx.service.changeAuditList.tableName, list_update);
                 }
                 }
 
 
@@ -902,6 +912,7 @@ module.exports = app => {
             let result = false;
             let result = false;
             try {
             try {
                 const changeInfo = await this.getDataByCondition({ cid });
                 const changeInfo = await this.getDataByCondition({ cid });
+                const tenderInfo  = await this.ctx.service.tenderInfo.getTenderInfo(changeInfo.tid);
 
 
                 // 获取终审
                 // 获取终审
                 const auditInfo = (await this.ctx.service.changeAudit.getAllDataByCondition({ where: { cid }, orders: [['usort', 'desc']], limit: 1, offset: 0 }))[0];
                 const auditInfo = (await this.ctx.service.changeAudit.getAllDataByCondition({ where: { cid }, orders: [['usort', 'desc']], limit: 1, offset: 0 }))[0];
@@ -949,7 +960,8 @@ module.exports = app => {
                         audit_amount: audit_amount.join(','),
                         audit_amount: audit_amount.join(','),
                         samount: '',
                         samount: '',
                     };
                     };
-                    total_price += this.ctx.helper.accMul(cl.unit_price, cl.camount);
+                    total_price = this.ctx.helper.add(total_price,
+                        this.ctx.helper.mul(cl.unit_price, cl.camount, tenderInfo.decima.tp));
                     await this.transaction.update(this.ctx.service.changeAuditList.tableName, list_update);
                     await this.transaction.update(this.ctx.service.changeAuditList.tableName, list_update);
                 }
                 }
 
 

+ 1 - 1
app/view/change/info.ejs

@@ -649,7 +649,7 @@
                             <td><%= ctx.helper.roundNum(ctx.helper.accMul(cl.unit_price, cl.camount), tpUnit) %></td>
                             <td><%= ctx.helper.roundNum(ctx.helper.accMul(cl.unit_price, cl.camount), tpUnit) %></td>
                             <% for (const audit of auditList) { %>
                             <% for (const audit of auditList) { %>
                                 <% if (audit.usite !== 0) { %>
                                 <% if (audit.usite !== 0) { %>
-                                    <% if (uid === audit.uid) { %>
+                                    <% if (uid === audit.uid && audit.status === 2) { %>
                                     <td>
                                     <td>
                                         <input class="form-control form-control-sm"  style="min-width:80px" placeholder="变更数量" type="text"
                                         <input class="form-control form-control-sm"  style="min-width:80px" placeholder="变更数量" type="text"
                                                onkeyup="RegNum(this,event,<%= ctx.helper.findDecimal(cl.unit) %>)"
                                                onkeyup="RegNum(this,event,<%= ctx.helper.findDecimal(cl.unit) %>)"

+ 31 - 2
app/view/dashboard/index.ejs

@@ -5,7 +5,14 @@
     <div class="content-wrap">
     <div class="content-wrap">
         <div class="sjs-height-0">
         <div class="sjs-height-0">
             <div class="row m-4">
             <div class="row m-4">
-                <div class="col-6">
+                <% if (!authMobile) { %>
+                <div class="col-12">
+                    <div class="alert alert-danger" role="alert">
+                        <strong>您的账号未认证手机。</strong> 设置认证手机后,可以用于「找回密码」及接收「短信通知」。<a class="btn btn-sm btn-light" href="/profile/sms">点击设置</a>
+                    </div>
+                </div>
+                <% } %>
+                <div class="col-5">
                     <div class="card">
                     <div class="card">
                         <div class="card-header">需要你处理</div>
                         <div class="card-header">需要你处理</div>
                         <div class="card-body">
                         <div class="card-body">
@@ -103,7 +110,7 @@
                         </div>
                         </div>
                     </div>
                     </div>
                 </div>
                 </div>
-                <div class="col-6">
+                <div class="col-5">
                     <div class="card">
                     <div class="card">
                         <div class="card-header">需要你关注</div>
                         <div class="card-header">需要你关注</div>
                         <div class="card-body">
                         <div class="card-body">
@@ -169,6 +176,28 @@
                         </div>
                         </div>
                     </div>
                     </div>
                 </div>
                 </div>
+                <div class="col-2">
+                    <div class="card">
+                        <div class="card-body">
+                            <h4 class="card-title"><%= salesmanData.username %></h4>
+                            <h6 class="card-subtitle mb-2 text-muted"><%= officeName %></h6>
+                        </div>
+                        <ul class="list-group list-group-flush">
+                            <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="腾讯QQ"><i class="fa fa-qq"></i> <%=salesmanData.qq%></li>
+                            <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="手机号码"><i class="fa fa-tablet"></i> <%=salesmanData.telephone%></li>
+                            <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="固定电话"><i class="fa fa-phone"></i> <%=salesmanData.fixedphone%></li>
+                            <% if (projectData.qrcode_json) { %>
+                            <li class="list-group-item container-fluid">
+                                <div class="row">
+                                    <% for (const qr of JSON.parse(projectData.qrcode_json)) { %>
+                                    <div class="col-sm text-center"><img src="/<%= qr.path %>" width="90"><div class="text-center"><%= qr.name %></div></div>
+                                    <% } %>
+                                </div>
+                            </li>
+                            <% } %>
+                        </ul>
+                    </div>
+                </div>
             </div>
             </div>
         </div>
         </div>
     </div>
     </div>

+ 18 - 18
app/view/profile/sign.ejs

@@ -12,22 +12,22 @@
                 <div class="col-5 my-3">
                 <div class="col-5 my-3">
                     <!--账号资料-->
                     <!--账号资料-->
                     <form>
                     <form>
-                        <!--<div class="form-group">-->
-                            <!--<div class="form-check form-check-inline">-->
-                                <!--<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2">-->
-                                <!--<label class="form-check-label" for="inlineRadio2">在线手写签名图</label>-->
-                            <!--</div>-->
-                            <!--<div class="form-check form-check-inline">-->
-                                <!--<input class="form-check-input" type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1">-->
-                                <!--<label class="form-check-label" for="inlineRadio1">上传签名图</label>-->
-                            <!--</div>-->
-                        <!--</div>-->
-                        <!--<div class="form-group">-->
-                            <!--<label>上传签名图</label>-->
-                            <!--<input type="file" class="form-control-file" id="exampleFormControlFile1">-->
-                            <!--<small class="form-text text-danger">图片大小为600x300,格式PNG透明背景。</small>-->
-                        <!--</div>-->
                         <div class="form-group">
                         <div class="form-group">
+                            <div class="form-check form-check-inline">
+                                <input class="form-check-input sign-type" type="radio" name="sign" id="sign-type-1" value="1" checked>
+                                <label class="form-check-label" for="sign-type-1">在线手写签名图</label>
+                            </div>
+                            <div class="form-check form-check-inline">
+                                <input class="form-check-input sign-type" type="radio" name="sign" id="sign-type-2" value="2">
+                                <label class="form-check-label" for="sign-type-2">上传签名图</label>
+                            </div>
+                        </div>
+                        <div class="form-group" id="show-upload" style="display: none">
+                            <label>上传签名图</label>
+                            <input type="file" class="form-control-file" id="sign-upload">
+                            <small class="form-text text-danger">图片大小为600x300,格式PNG透明背景。</small>
+                        </div>
+                        <div class="form-group" id="show-qrcode">
                             <label>在线手写签名</label>
                             <label>在线手写签名</label>
                             <div><img src="/profile/qrCode" width="150"></div>
                             <div><img src="/profile/qrCode" width="150"></div>
                             <small class="form-text text-danger">微信扫码使用在线手写程序</small>
                             <small class="form-text text-danger">微信扫码使用在线手写程序</small>
@@ -38,11 +38,11 @@
                             <div>
                             <div>
                                 <div class="position-relative">
                                 <div class="position-relative">
                                     <img src="/public/images/baobiao3.png">
                                     <img src="/public/images/baobiao3.png">
-                                    <% if (accountData.sign_path !== '') { %>
                                     <div class="position-absolute fixed-top" id="sign-show" style="left:290px;top:320px">
                                     <div class="position-absolute fixed-top" id="sign-show" style="left:290px;top:320px">
-                                        <img src="/public/upload/sign/<%= accountData.sign_path %>" width="90">
+                                        <% if (accountData.sign_path !== '') { %>
+                                            <img src="/public/upload/sign/<%= accountData.sign_path %>" width="90">
+                                        <% } %>
                                     </div>
                                     </div>
-                                    <% } %>
                                 </div>
                                 </div>
                             </div>
                             </div>
                         </div>
                         </div>

+ 10 - 1
app/view/setting/info.ejs

@@ -30,12 +30,21 @@
                                 <div class="card w-50">
                                 <div class="card w-50">
                                     <div class="card-body">
                                     <div class="card-body">
                                         <h4 class="card-title"><%= salesmanData.username %></h4>
                                         <h4 class="card-title"><%= salesmanData.username %></h4>
-                                        <h6 class="card-subtitle mb-2 text-muted" ><%= officeName%></h6>
+                                        <h6 class="card-subtitle mb-2 text-muted" ><%= officeName %></h6>
                                     </div>
                                     </div>
                                     <ul class="list-group list-group-flush">
                                     <ul class="list-group list-group-flush">
                                         <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="腾讯QQ"><i class="fa fa-qq"></i> <%=salesmanData.qq%></li>
                                         <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="腾讯QQ"><i class="fa fa-qq"></i> <%=salesmanData.qq%></li>
                                         <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="手机号码"><i class="fa fa-tablet"></i> <%=salesmanData.telephone%></li>
                                         <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="手机号码"><i class="fa fa-tablet"></i> <%=salesmanData.telephone%></li>
                                         <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="固定电话"><i class="fa fa-phone"></i> <%=salesmanData.fixedphone%></li>
                                         <li class="list-group-item" data-toggle="tooltip" data-placement="bottom" title="固定电话"><i class="fa fa-phone"></i> <%=salesmanData.fixedphone%></li>
+                                        <% if (projectData.qrcode_json) { %>
+                                        <li class="list-group-item container-fluid">
+                                            <div class="row">
+                                                <% for (const qr of JSON.parse(projectData.qrcode_json)) { %>
+                                                <div class="col-6 text-center"><img src="/<%= qr.path %>" width="90"><div class="text-center"><%= qr.name %></div></div>
+                                                <% } %>
+                                            </div>
+                                        </li>
+                                        <% } %>
                                     </ul>
                                     </ul>
                                 </div>
                                 </div>
                             </div>
                             </div>