|
|
@@ -755,6 +755,47 @@ export const deleteGrowthRecord = (id) => {
|
|
|
return request('/api/growth/record/' + id + '/delete', 'POST')
|
|
|
}
|
|
|
|
|
|
+export const uploadAndParseReport = (filePath) => {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ const token = uni.getStorageSync('token')
|
|
|
+ uni.uploadFile({
|
|
|
+ url: BASE_URL + '/api/growth/record/upload-and-parse',
|
|
|
+ filePath: filePath,
|
|
|
+ name: 'file',
|
|
|
+ header: {
|
|
|
+ 'Authorization': token ? 'Bearer ' + token : ''
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ const data = JSON.parse(res.data)
|
|
|
+ if (data.code === 200) {
|
|
|
+ resolve(data)
|
|
|
+ } else {
|
|
|
+ reject(data)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ reject(err)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+export const createGrowthRecordFromUpload = (data) => {
|
|
|
+ return request('/api/growth/record/create-from-upload', 'POST', data)
|
|
|
+}
|
|
|
+
|
|
|
+export const createGrowthSupplement = (data) => {
|
|
|
+ return request('/api/growth/record/supplement', 'POST', data)
|
|
|
+}
|
|
|
+
|
|
|
+export const checkGrowthDuplicate = (data) => {
|
|
|
+ return request('/api/growth/record/check-duplicate', 'POST', data)
|
|
|
+}
|
|
|
+
|
|
|
+export const getGrowthSupplements = (id) => {
|
|
|
+ return request('/api/growth/record/' + id + '/supplements', 'POST')
|
|
|
+}
|
|
|
+
|
|
|
// 成长规划师模块API
|
|
|
export const getTeamMembers = () => {
|
|
|
return request('/api/guide/team/members', 'POST')
|