cb_unit.js
1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
var util = require('../../utils/util.js')
var uri=require('../../utils/uri.js')
Page({
data:{
},
onLoad:function(){
util.setBarTitle('计价单位管理');
this.setData({
sellerid:util.cache('sellerid')
})
},
onShow:function () {
this.unitList();
this.alert=this.selectComponent('#alert');
var that=this;
util.postSuccessFun=function(json,uri_code){
switch (uri_code){
case uri.CGI__USER_GETSPECBYSELLERID__CODE:
that.setData({
unitlist:json.data[0]
})
break;
}
}
},
unitList:function(){
util.post(uri.CGI__USER_GETSPECBYSELLERID,{sellerid:this.data.sellerid},uri.CGI__USER_GETSPECBYSELLERID__CODE)
},
addunit:function () {
if(util.powercontro('计价单位')==false){
this.alert.show('您暂没有权限添加计价单位')
}else{
wx.navigateTo({
url:'cb_addunit'
})
}
},
deleteunit:function(e){
if(util.powercontro('计价单位')==false){
this.alert.show('您暂没有权限删除计价单位')
}else{
var unitid=e.currentTarget.dataset.id;
var unitname=e.currentTarget.dataset.unitname;
wx.navigateTo({
url:'cb_addunit?unitid='+unitid+'&unitname='+unitname
})
}
},
netchange:function(){
this.onShow();
},
})