|
|
@@ -1,125 +1,30 @@
|
|
|
- const _Http = getApp().globalData.http;
|
|
|
- Page({
|
|
|
- data: {
|
|
|
- detail: null,
|
|
|
- isFollow: false,
|
|
|
- isSubmit: true, //是否可以提交
|
|
|
- files: {
|
|
|
- images: [],
|
|
|
- viewImages: [],
|
|
|
- videos: [],
|
|
|
- viewVideos: [],
|
|
|
- files: []
|
|
|
- },
|
|
|
- },
|
|
|
- onLoad(options) {
|
|
|
+const _Http = getApp().globalData.http;
|
|
|
+Page({
|
|
|
+ data: {
|
|
|
+ taskname: ""
|
|
|
+ },
|
|
|
+ onLoad(options) {
|
|
|
+ let content = JSON.parse(options.content);
|
|
|
+ this.setData({})
|
|
|
+ _Http.basic({
|
|
|
+ "id": 20221129152304,
|
|
|
+ "content": {
|
|
|
+ ...content,
|
|
|
+ pageSize: 999
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log("获取评估项", res)
|
|
|
+ content.actionnotes = ''
|
|
|
this.setData({
|
|
|
- detail: JSON.parse(options.data),
|
|
|
- isFollow: options.isFollow == 'true'
|
|
|
- });
|
|
|
- if (this.data.detail.attinfos.length != 0) this.selectComponent("#Yl_files").handleFiles(res.data)
|
|
|
- if (this.data.detail.notes != '' && this.data.isFollow) this.setData({
|
|
|
- isSubmit: false
|
|
|
+ taskname: options.taskname,
|
|
|
+ content,
|
|
|
+ list: res.data
|
|
|
})
|
|
|
- },
|
|
|
- //文本域输入
|
|
|
- onInput(e) {
|
|
|
- this.setData({
|
|
|
- "detail.notes": e.detail.value
|
|
|
- })
|
|
|
- },
|
|
|
- /* 绑定媒体 */
|
|
|
- insertImgEdit({
|
|
|
- detail
|
|
|
- }) {
|
|
|
- _Http.basic({
|
|
|
- "classname": "system.attachment.Attachment",
|
|
|
- "method": "createFileLink",
|
|
|
- "content": {
|
|
|
- "ownertable": "sa_project_stagework",
|
|
|
- "ownerid": this.data.detail.sa_project_stageworkid,
|
|
|
- "usetype": "default",
|
|
|
- "attachmentids": detail
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- console.log('跟进记录绑定附件', res)
|
|
|
- if (res.msg != '成功') return wx.showToast({
|
|
|
- title: res.data,
|
|
|
- icon: "none"
|
|
|
- })
|
|
|
- this.selectComponent("#Yl_files").handleFiles(res.data)
|
|
|
- this.data.detail.attinfos.push(res.data[0])
|
|
|
- this.changeFile();
|
|
|
- })
|
|
|
- },
|
|
|
- /* 修改源文件附件 */
|
|
|
- changeFile() {
|
|
|
- let pages = getCurrentPages(),
|
|
|
- page = pages[pages.length - 2].selectComponent("#Task"),
|
|
|
- i = page.data.list[page.data.viewIndex].work.findIndex(v => v.sa_project_stageworkid == this.data.detail.sa_project_stageworkid);
|
|
|
- page.setData({
|
|
|
- [`list[${page.data.viewIndex}].work[${i}].attinfos`]: this.data.detail.attinfos
|
|
|
- })
|
|
|
- },
|
|
|
- /* 保存 */
|
|
|
- save() {
|
|
|
- _Http.basic({
|
|
|
- "id": 20221024160202,
|
|
|
- "content": {
|
|
|
- sa_project_stageworkid: this.data.detail.sa_project_stageworkid,
|
|
|
- notes: this.data.detail.notes,
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- wx.showToast({
|
|
|
- title: res.msg == '成功' ? '保存成功' : res.data,
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- if (res.msg != '成功') return;
|
|
|
- this.setData({
|
|
|
- isSubmit: false
|
|
|
- })
|
|
|
- let pages = getCurrentPages(),
|
|
|
- page = pages[pages.length - 2].selectComponent("#Task"),
|
|
|
- i = page.data.list[page.data.viewIndex].work.findIndex(v => v.sa_project_stageworkid == this.data.detail.sa_project_stageworkid);
|
|
|
- page.setData({
|
|
|
- [`list[${page.data.viewIndex}].work[${i}].notes`]: this.data.detail.notes
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- },
|
|
|
- /* 提交 */
|
|
|
- submit() {
|
|
|
- let that = this;
|
|
|
- wx.showModal({
|
|
|
- title: '提示',
|
|
|
- content: `是否提交该任务,提交后将计算分值(仅可提交一次)`,
|
|
|
- complete: ({
|
|
|
- confirm
|
|
|
- }) => {
|
|
|
- if (confirm) _Http.basic({
|
|
|
- "id": 20221024160302,
|
|
|
- "content": {
|
|
|
- "sa_project_stageworkid": that.data.detail.sa_project_stageworkid
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- console.log("任务提交", res)
|
|
|
- if (res.msg != '成功') return wx.showToast({
|
|
|
- title: res.data,
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- let pages = getCurrentPages(),
|
|
|
- page = pages[pages.length - 2].selectComponent("#Task");
|
|
|
- pages[pages.length - 2].getDetail();
|
|
|
- page.getList();
|
|
|
- wx.showToast({
|
|
|
- title: '提交成功',
|
|
|
- icon: "none"
|
|
|
- });
|
|
|
- that.setData({
|
|
|
- "detail.finished": 1
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onInput(e) {
|
|
|
+ this.setData({
|
|
|
+ 'content.actionnotes': e.detail.value
|
|
|
+ })
|
|
|
+ }
|
|
|
+})
|