...
|
...
|
@@ -78,7 +78,7 @@ Page({ |
|
|
uploadImages() {
|
|
|
let that = this;
|
|
|
wx.chooseImage({
|
|
|
count: 9 - that.data.upimg.length ,
|
|
|
count: 8 - that.data.upimg.length ,
|
|
|
sizeType: ['original', 'compressed'],
|
|
|
success: function (res) {
|
|
|
let successUp = 0; //成功个数
|
...
|
...
|
@@ -116,10 +116,13 @@ Page({ |
|
|
wx.hideNavigationBarLoading();
|
|
|
wx.hideLoading();
|
|
|
let upimg = that.data.upimg;
|
|
|
upimg.push(temdata.data.url);
|
|
|
that.setData({
|
|
|
upimg: upimg
|
|
|
})
|
|
|
if(upimg.length<8){
|
|
|
upimg.push(temdata.data.url);
|
|
|
that.setData({
|
|
|
upimg: upimg
|
|
|
})
|
|
|
}
|
|
|
|
|
|
},
|
|
|
fail: function (res) {
|
|
|
wx.hideNavigationBarLoading()
|
...
|
...
|
@@ -169,42 +172,72 @@ Page({ |
|
|
err = '请填写血小板数量'
|
|
|
}
|
|
|
if (err == '') {
|
|
|
let url = 'user/addFilesLog';
|
|
|
let header = {
|
|
|
'XX-Token': wx.getStorageSync('token'),
|
|
|
'XX-Device-Type': ''
|
|
|
}
|
|
|
let params = {
|
|
|
form_id: e.detail.formId,
|
|
|
fields_id: that.data.files_id,
|
|
|
drug_name: that.data.drug,
|
|
|
stop_date: that.data.date,
|
|
|
blood_test_date: that.data.date1,
|
|
|
hemoglobin: that.data.hemoglobin,
|
|
|
white_blood_cell: that.data.white_blood_cell,
|
|
|
neutrophils: that.data.neutrophils,
|
|
|
platelet: that.data.platelet,
|
|
|
remark: that.data.remarks,
|
|
|
images: that.data.upimg
|
|
|
}
|
|
|
app.post(url, params,header).then((res) => {
|
|
|
wx.showModal({
|
|
|
title: '成功',
|
|
|
content: '添加记录成功',
|
|
|
showCancel: false,
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
wx.switchTab({
|
|
|
url: '/pages/index/index'
|
|
|
})
|
|
|
} else if (res.cancel) {
|
|
|
console.log('用户点击取消')
|
|
|
if (that.data.white_blood_cell > 100) {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '请输入正确的白细胞指标',
|
|
|
showCancel: false
|
|
|
})
|
|
|
return false
|
|
|
} else if (that.data.neutrophils > 100) {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '请输入正确的中性粒细胞指标',
|
|
|
showCancel: false
|
|
|
})
|
|
|
return false
|
|
|
} else if (that.data.hemoglobin > 250) {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '请输入正确的血红蛋白指标',
|
|
|
showCancel: false
|
|
|
})
|
|
|
return false
|
|
|
} else if (that.data.hemoglobin > 1000) {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '请输入正确的血小板指标',
|
|
|
showCancel: false
|
|
|
})
|
|
|
return false
|
|
|
} else {
|
|
|
let url = 'user/addFilesLog';
|
|
|
let header = {
|
|
|
'XX-Token': wx.getStorageSync('token'),
|
|
|
'XX-Device-Type': ''
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}).catch((errMsg) => {
|
|
|
console.log(errMsg)
|
|
|
})
|
|
|
let params = {
|
|
|
form_id: e.detail.formId,
|
|
|
fields_id: that.data.files_id,
|
|
|
drug_name: that.data.drug,
|
|
|
stop_date: that.data.date,
|
|
|
blood_test_date: that.data.date1,
|
|
|
hemoglobin: that.data.hemoglobin,
|
|
|
white_blood_cell: that.data.white_blood_cell,
|
|
|
neutrophils: that.data.neutrophils,
|
|
|
platelet: that.data.platelet,
|
|
|
remark: that.data.remarks,
|
|
|
images: that.data.upimg
|
|
|
}
|
|
|
app.post(url, params, header).then((res) => {
|
|
|
wx.showModal({
|
|
|
title: '成功',
|
|
|
content: '添加记录成功',
|
|
|
showCancel: false,
|
|
|
success(res) {
|
|
|
if (res.confirm) {
|
|
|
wx.switchTab({
|
|
|
url: '/pages/index/index'
|
|
|
})
|
|
|
} else if (res.cancel) {
|
|
|
console.log('用户点击取消')
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}).catch((errMsg) => {
|
|
|
console.log(errMsg)
|
|
|
})
|
|
|
}
|
|
|
} else {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
...
|
...
|
|