|
@@ -13,14 +13,17 @@ Page({
|
|
|
*/
|
|
*/
|
|
|
data: {
|
|
data: {
|
|
|
isDetails: false, //减分申请详情时状态
|
|
isDetails: false, //减分申请详情时状态
|
|
|
- minusPerson:'吴彦祖',
|
|
|
|
|
- minusTime:'2018-09-20',
|
|
|
|
|
- minusName:'',
|
|
|
|
|
- minusPoints:50,
|
|
|
|
|
- itemPerson:{},
|
|
|
|
|
|
|
+ minusPerson:'吴彦祖', //扣分人
|
|
|
|
|
+ minusTime:'2018-09-20', //日期
|
|
|
|
|
+ minusName:'', //被扣人
|
|
|
|
|
+ minusPoints:'', //扣得积分
|
|
|
|
|
+ minusNorm:'请选择',
|
|
|
|
|
+ itemPerson:{},
|
|
|
itemNorm: { normItem: '请选择', normScore:'' },//所选规则数据
|
|
itemNorm: { normItem: '请选择', normScore:'' },//所选规则数据
|
|
|
CotegoryArray: [],
|
|
CotegoryArray: [],
|
|
|
Cotegory: [],
|
|
Cotegory: [],
|
|
|
|
|
+
|
|
|
|
|
+ detailsData: {},
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -29,13 +32,16 @@ Page({
|
|
|
onLoad: function (options) {
|
|
onLoad: function (options) {
|
|
|
var that = this
|
|
var that = this
|
|
|
var isDetails = options.getisDetails
|
|
var isDetails = options.getisDetails
|
|
|
- that.setData({
|
|
|
|
|
- isDetails: isDetails
|
|
|
|
|
- })
|
|
|
|
|
- that.changeTitle()
|
|
|
|
|
- that.initView()
|
|
|
|
|
|
|
+ var itemdata
|
|
|
|
|
|
|
|
- that.getCotegory()//获得分类列表
|
|
|
|
|
|
|
+ if (options.getItemdata) {
|
|
|
|
|
+ itemdata = JSON.parse(options.getItemdata)
|
|
|
|
|
+ that.setData({
|
|
|
|
|
+ isDetails: isDetails
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log('itemdata', itemdata)
|
|
|
|
|
+ that.initView(itemdata)
|
|
|
},
|
|
},
|
|
|
minusSubmit: function (event){
|
|
minusSubmit: function (event){
|
|
|
var that = this
|
|
var that = this
|
|
@@ -142,12 +148,71 @@ Page({
|
|
|
title: that.data.mername
|
|
title: that.data.mername
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- initView: function () {
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据invoicesId 获取加分单据详情数据
|
|
|
|
|
+ */
|
|
|
|
|
+ initDetailsView: function (invoicesId) {
|
|
|
var that = this
|
|
var that = this
|
|
|
- var nowTime = dateutil.getComDate(new Date, 'yy-mm-dd')
|
|
|
|
|
- that.setData({
|
|
|
|
|
- minusTime: nowTime
|
|
|
|
|
|
|
+ var data = { invoicesId: invoicesId }
|
|
|
|
|
+ var url = baseUrl + BASEURL.getUrl.getInvoices
|
|
|
|
|
+ netUtil.requestLoading(url, data, '正在加载数据...', 'GET', function (res) {
|
|
|
|
|
+ if (res.data.success && res.data.data) {
|
|
|
|
|
+ that.setData({
|
|
|
|
|
+ detailsData: res.data.data,
|
|
|
|
|
+ minusTime: res.data.data.invoicesDate,
|
|
|
|
|
+ minusName: res.data.data.adviceName,
|
|
|
|
|
+ minusNorm: res.data.data.normName,
|
|
|
|
|
+ minusPoints: res.data.data.score,
|
|
|
|
|
+ minusReason: res.data.data.reasons,
|
|
|
|
|
+ // applyJob: res.data.data.fillStation
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }, function (res) {
|
|
|
|
|
+ wx.showToast({
|
|
|
|
|
+ title: '加载数据失败',
|
|
|
|
|
+ icon: 'none',
|
|
|
|
|
+ duration: 2000
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ initView: function (itemdata) {
|
|
|
|
|
+ var that = this;
|
|
|
|
|
+ var isDetails = that.data.isDetails
|
|
|
|
|
+ var title
|
|
|
|
|
+ if (isDetails) {
|
|
|
|
|
+ title = '减分详情'
|
|
|
|
|
+ title = '加分申请详情'
|
|
|
|
|
+ if (itemdata && itemdata.invoicesId) {
|
|
|
|
|
+ // var invoicesStatus = itemdata.invoicesStatus
|
|
|
|
|
+ // var applyStatus
|
|
|
|
|
+
|
|
|
|
|
+ // if (invoicesStatus == 0) {
|
|
|
|
|
+ // applyStatus = '待审批'
|
|
|
|
|
+ // } else if (invoicesStatus == 1) {
|
|
|
|
|
+ // applyStatus = '已审批'
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // applyStatus = '未通过'
|
|
|
|
|
+ // }
|
|
|
|
|
+ // that.setData({
|
|
|
|
|
+ // applyStatus: applyStatus,
|
|
|
|
|
+ // invoicesStatus: invoicesStatus,
|
|
|
|
|
+ // })
|
|
|
|
|
+ that.initDetailsView(itemdata.invoicesId)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+ title = '减分申请'
|
|
|
|
|
+ var nowTime = dateutil.getComDate(new Date, 'yy-mm-dd')
|
|
|
|
|
+ that.setData({
|
|
|
|
|
+ minusTime: nowTime
|
|
|
|
|
+ })
|
|
|
|
|
+ that.getCotegory()//获得分类列表
|
|
|
|
|
+ }
|
|
|
|
|
+ wx.setNavigationBarTitle({
|
|
|
|
|
+ title: title
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// console.log('nowTime', nowTime)
|
|
// console.log('nowTime', nowTime)
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -163,9 +228,11 @@ Page({
|
|
|
* 选择被扣人对象
|
|
* 选择被扣人对象
|
|
|
*/
|
|
*/
|
|
|
selctMinusPerson:function(){
|
|
selctMinusPerson:function(){
|
|
|
- wx.navigateTo({
|
|
|
|
|
- url: '../selectStaff/selectStaff',
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ if (!this.data.isDetails){
|
|
|
|
|
+ wx.navigateTo({
|
|
|
|
|
+ url: '../selectStaff/selectStaff',
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
// return
|
|
// return
|
|
|
// var that = this
|
|
// var that = this
|
|
|
// var data = { }
|
|
// var data = { }
|
|
@@ -201,7 +268,19 @@ Page({
|
|
|
* 生命周期函数--监听页面显示
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
*/
|
|
|
onShow: function () {
|
|
onShow: function () {
|
|
|
|
|
+ var that = this
|
|
|
|
|
+ if (that.data.itemPerson){
|
|
|
|
|
+ that.setData({
|
|
|
|
|
+ minusName: that.data.itemPerson.empName
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ if (that.data.itemNorm){
|
|
|
|
|
+ that.setData({
|
|
|
|
|
+ minusNorm: that.data.itemNorm.normItem,
|
|
|
|
|
+ minusPoints: that.data.itemNorm.normScore
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
/**
|