修改请求

main
suixy 2 months ago
parent b951e710b4
commit 435c81a7bf

@ -1,5 +1,7 @@
// pages/production/production.js // pages/production/production.js
import {request} from '../../utils/request' import {
request
} from '../../utils/request'
const app = getApp() const app = getApp()
Page({ Page({
@ -12,8 +14,9 @@ Page({
this.setData({ this.setData({
selectedIndex: e.detail.value selectedIndex: e.detail.value
}) })
let id = this.data.optionsRow.map(e=>e.processName = this.data.options[e.detail.value]) let id = this.data.optionsRow.find(v => v.label === this.data.options[e.detail.value])?.value || ''
console.log(id); console.log(id);
}, },
@ -57,6 +60,20 @@ Page({
}).then(e => { }).then(e => {
app.globalData.token = e.data.access_token app.globalData.token = e.data.access_token
}) })
await request({
url: '/mes/baseProcessInfo/getProcessInfoList',
method: 'get',
}).then(e => {
this.setData({
optionsRow: JSON.parse(JSON.stringify(e.data)).map(v => {
return {
value : v.processId,
label : v.processName,
}
}),
options: e.data.map(v => v.processName),
})
})
}, },

Loading…
Cancel
Save