|
@@ -5,10 +5,12 @@ Page({
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
|
|
- detailsData: {},
|
|
|
- butText: false,
|
|
|
- content: "",
|
|
|
- loading: false,
|
|
|
+ detailsData: {}, //详情数据
|
|
|
+ butText: false, //底部按钮文本
|
|
|
+ content: "", //提交内容
|
|
|
+ loading: false, //按钮加载状态
|
|
|
+ recordL: {}, //记录
|
|
|
+ isCommit: false, //是否提交
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -20,18 +22,31 @@ Page({
|
|
|
detailsData,
|
|
|
butText: options.type
|
|
|
})
|
|
|
- console.log("是否一事一报", detailsData.oneToOne)
|
|
|
-
|
|
|
/* 详情计数 */
|
|
|
- if (options.type == '开始提报') _Http.basic({
|
|
|
+ if (options.type == '开始提报') {
|
|
|
+ this.select_submitdetailed();
|
|
|
+ } else if (options.type == 'false') {
|
|
|
+ /* 查看记录 */
|
|
|
+ this.setData({
|
|
|
+ recordL: JSON.parse(options.record)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ console.log("是否一事一报", detailsData.oneToOne)
|
|
|
+ },
|
|
|
+ /* 查询详情 */
|
|
|
+ select_submitdetailed() {
|
|
|
+ _Http.basic({
|
|
|
"classname": "saletool.submitedit.submitedit",
|
|
|
"method": "select_submitdetailed",
|
|
|
"content": {
|
|
|
- "sat_submiteditmodelid": detailsData.sat_submiteditmodelid
|
|
|
+ "sat_submiteditmodelid": this.data.detailsData.sat_submiteditmodelid
|
|
|
}
|
|
|
}).then(res => {
|
|
|
console.log("提报详情", res)
|
|
|
- })
|
|
|
+ this.setData({
|
|
|
+ 'detailsData.submitedit': res.data[0].submitedit
|
|
|
+ })
|
|
|
+ });
|
|
|
},
|
|
|
/* 文本域输入 */
|
|
|
textareaInput(e) {
|
|
@@ -46,6 +61,10 @@ Page({
|
|
|
url: './details?type=保存&item=' + JSON.stringify(this.data.detailsData),
|
|
|
})
|
|
|
} else {
|
|
|
+ if (this.data.isCommit) return wx.showToast({
|
|
|
+ title: '请勿重新提交',
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
if (!this.data.content) return wx.showToast({
|
|
|
title: '您还未输入提报内容',
|
|
|
icon: "none"
|
|
@@ -66,7 +85,6 @@ Page({
|
|
|
"sat_submiteditid": 0
|
|
|
}
|
|
|
}).then(res => {
|
|
|
- console.log(res)
|
|
|
this.setData({
|
|
|
loading: false
|
|
|
})
|
|
@@ -74,21 +92,39 @@ Page({
|
|
|
title: res.data,
|
|
|
icon: "none"
|
|
|
});
|
|
|
+ this.setData({
|
|
|
+ isCommit: true
|
|
|
+ })
|
|
|
+ let pages = getCurrentPages();
|
|
|
+ let prevPage = pages[pages.length - 2];
|
|
|
+ if (prevPage.data.butText == '开始提报') prevPage.select_submitdetailed();
|
|
|
wx.showToast({
|
|
|
title: '提交成功',
|
|
|
icon: "success"
|
|
|
- })
|
|
|
+ });
|
|
|
+ setTimeout(() => {
|
|
|
+ wx.navigateBack({
|
|
|
+ delta: 0,
|
|
|
+ })
|
|
|
+ }, 300)
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
+ /* 查看提报记录 */
|
|
|
+ seeHistory(e) {
|
|
|
+ const {
|
|
|
+ item
|
|
|
+ } = e.currentTarget.dataset;
|
|
|
+ wx.navigateTo({
|
|
|
+ url: `./details?type=false&item=${JSON.stringify(this.data.detailsData)}&record=${JSON.stringify(item)}`,
|
|
|
+ })
|
|
|
+ },
|
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
*/
|
|
|
onReady() {
|
|
|
|
|
|
},
|
|
|
-
|
|
|
/**
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|