|
@@ -7,19 +7,19 @@ Page({
|
|
|
data: {
|
|
|
detailsData: {},
|
|
|
butText: false,
|
|
|
+ content: "",
|
|
|
+ loading: false,
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad(options) {
|
|
|
- console.log(options)
|
|
|
let detailsData = JSON.parse(options.item);
|
|
|
this.setData({
|
|
|
detailsData,
|
|
|
butText: options.type
|
|
|
})
|
|
|
-
|
|
|
console.log("是否一事一报", detailsData.oneToOne)
|
|
|
|
|
|
/* 详情计数 */
|
|
@@ -33,7 +33,12 @@ Page({
|
|
|
console.log("提报详情", res)
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
+ /* 文本域输入 */
|
|
|
+ textareaInput(e) {
|
|
|
+ this.setData({
|
|
|
+ content: e.detail.value.trim()
|
|
|
+ })
|
|
|
+ },
|
|
|
/* 去详情 */
|
|
|
toDetails() {
|
|
|
if (this.data.butText == '开始提报') {
|
|
@@ -41,7 +46,39 @@ Page({
|
|
|
url: './details?type=保存&item=' + JSON.stringify(this.data.detailsData),
|
|
|
})
|
|
|
} else {
|
|
|
-
|
|
|
+ if (!this.data.content) return wx.showToast({
|
|
|
+ title: '您还未输入提报内容',
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ if (this.data.loading) return wx.showToast({
|
|
|
+ title: '正在提交中,请勿重新提交',
|
|
|
+ icon: "none"
|
|
|
+ })
|
|
|
+ this.setData({
|
|
|
+ loading: true
|
|
|
+ })
|
|
|
+ _Http.basic({
|
|
|
+ "classname": "saletool.submitedit.submitedit",
|
|
|
+ "method": "sub_submitdetailed",
|
|
|
+ "content": {
|
|
|
+ "sat_submiteditmodelid": this.data.detailsData.sat_submiteditmodelid,
|
|
|
+ "content": this.data.content,
|
|
|
+ "sat_submiteditid": 0
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ this.setData({
|
|
|
+ loading: false
|
|
|
+ })
|
|
|
+ if (res.msg != '成功') return wx.showToast({
|
|
|
+ title: res.data,
|
|
|
+ icon: "none"
|
|
|
+ });
|
|
|
+ wx.showToast({
|
|
|
+ title: '提交成功',
|
|
|
+ icon: "success"
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
|