|
|
@@ -6,7 +6,6 @@ const QQMapWX = require('../../utils/qqmap-wx-jssdk.min'),
|
|
|
import {
|
|
|
formatTime
|
|
|
} from "../../utils/getTime";
|
|
|
-
|
|
|
let timing = null;
|
|
|
Page({
|
|
|
data: {
|
|
|
@@ -15,6 +14,7 @@ Page({
|
|
|
time: formatTime(new Date(), '-'),
|
|
|
form: null,
|
|
|
continue1: null,
|
|
|
+ count: 0
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
this.getLocation();
|
|
|
@@ -32,7 +32,6 @@ Page({
|
|
|
content.remarks = data.remarks;
|
|
|
if (data.sys_enterprise) content.sys_enterpriseid = data.sys_enterprise[1][0];
|
|
|
if (data.sa_project) content.sa_projectid = data.sa_project[1][0];
|
|
|
- console.log(content)
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '是否确认本次签到',
|
|
|
@@ -53,10 +52,36 @@ Page({
|
|
|
title: res.msg == '成功' ? '签到成功' : res.msg,
|
|
|
icon: "none"
|
|
|
})
|
|
|
- if (res.msg == '成功') setTimeout(() => {
|
|
|
+ if (res.msg != '成功') return;
|
|
|
+
|
|
|
+ let {
|
|
|
+ attachmentids
|
|
|
+ } = this.selectComponent("#Yl_Files").getFiles();
|
|
|
+ if (attachmentids.length == 0) return setTimeout(() => {
|
|
|
getCurrentPages()[getCurrentPages().length - 2].toDate(this.data.time.split(" ")[0]);
|
|
|
wx.navigateBack();
|
|
|
}, 500)
|
|
|
+ _Http.basic({
|
|
|
+ "classname": "system.attachment.Attachment",
|
|
|
+ "method": "createFileLink",
|
|
|
+ "content": {
|
|
|
+ "ownertable": "sys_signin",
|
|
|
+ "ownerid": res.data.sys_signinid,
|
|
|
+ "usetype": "default",
|
|
|
+ attachmentids
|
|
|
+ }
|
|
|
+ }).then(s => {
|
|
|
+ console.log('附件改绑', s)
|
|
|
+ if (s.msg != '成功') wx.showToast({
|
|
|
+ title: s.msg,
|
|
|
+ icon: "none",
|
|
|
+ mask: true
|
|
|
+ });
|
|
|
+ setTimeout(() => {
|
|
|
+ getCurrentPages()[getCurrentPages().length - 2].toDate(this.data.time.split(" ")[0]);
|
|
|
+ wx.navigateBack();
|
|
|
+ }, 500)
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
rander() {
|
|
|
@@ -286,7 +311,37 @@ Page({
|
|
|
onUnload() {
|
|
|
clearInterval(timing)
|
|
|
},
|
|
|
- onReady() {
|
|
|
-
|
|
|
+ /* 绑定媒体 */
|
|
|
+ insertImgEdit({
|
|
|
+ detail
|
|
|
+ }) {
|
|
|
+ _Http.basic({
|
|
|
+ "classname": "system.attachment.Attachment",
|
|
|
+ "method": "createFileLink",
|
|
|
+ "content": {
|
|
|
+ "ownertable": "sys_signin",
|
|
|
+ "ownerid": 0,
|
|
|
+ "usetype": "default",
|
|
|
+ "attachmentids": detail
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log('跟进记录绑定附件', res)
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ this.selectComponent("#Yl_Files").handleFiles(res.data)
|
|
|
+ this.setData({
|
|
|
+ count: this.data.count + detail.length
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
+ /* 监听删除附件 */
|
|
|
+ onDeteleFiles({
|
|
|
+ detail
|
|
|
+ }) {
|
|
|
+ this.setData({
|
|
|
+ count: detail.attachmentids.length
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|