You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.3 KiB
62 lines
1.3 KiB
// monitor/pages/materialDetail/materialDetail.js
|
|
var Api = require("../../../utils/util.js");
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
formData: {}
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad(options) {
|
|
this.setData({
|
|
materialId: options.materialId,
|
|
id: options.id,
|
|
title: options.title
|
|
})
|
|
wx.setNavigationBarTitle({
|
|
title: options.title,
|
|
})
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow() {
|
|
this.getDetail()
|
|
},
|
|
|
|
//详情
|
|
getDetail(e) {
|
|
let that = this
|
|
let url = '', dataObj = {}
|
|
wx.showLoading({
|
|
title: '加载中...',
|
|
})
|
|
if(this.data.title == '已用物料') {
|
|
url = 'blade-operationOrderMaterial/operationOrderMaterial/getOrderUseFittingDetail'
|
|
dataObj = {
|
|
id: this.data.id,
|
|
}
|
|
}else if(this.data.title == '可用物料') {
|
|
url = 'blade-operationOrderMaterial/operationOrderMaterial/getOrderCanUseFittingDetail'
|
|
dataObj = {
|
|
materialId: this.data.materialId,
|
|
empUserId: wx.getStorageSync('userId')
|
|
}
|
|
}
|
|
Api.req(url, dataObj, 'get').then(res => {
|
|
wx.hideLoading()
|
|
if(res.code == 200){
|
|
that.setData({
|
|
formData: res.data,
|
|
})
|
|
}
|
|
})
|
|
},
|
|
}) |