Commit ac685ec2 authored by heduo's avatar heduo

feat(system): 华中阜外审批小程序新增实验动物

parent a48cc744
...@@ -63,6 +63,15 @@ ...@@ -63,6 +63,15 @@
box-sizing: border-box; box-sizing: border-box;
display: flex;flex-direction: row;align-items: center display: flex;flex-direction: row;align-items: center
} }
.van-tabs__line {
z-index: 1;
left: 0;
bottom: 15px;
height: 3px;
position: absolute;
border-radius: 3px;
background-color: #409EFF !important;
}
</style> </style>
<!--<wxs module="m1" lang="babel">--> <!--<wxs module="m1" lang="babel">-->
...@@ -81,7 +90,10 @@ ...@@ -81,7 +90,10 @@
<header background="#45C9C2" title_text="待审批列表"/> <header background="#45C9C2" title_text="待审批列表"/>
<div style="width: 100%;height: 100%;padding: 10rpx;box-sizing: border-box;"> <div style="width: 100%;height: 100%;padding: 10rpx;box-sizing: border-box;">
<van-tabs v-if="platform === 'ckzv' || platform === 'ckzvSydw'" active="{{ activeTab }}" @change="onChange">
<van-tab title="试剂耗材"></van-tab>
<van-tab title="实验动物"></van-tab>
</van-tabs>
<van-empty v-if="orderList.length === 0" description="暂无待审批订单" /> <van-empty v-if="orderList.length === 0" description="暂无待审批订单" />
<div @tap="item_click(item)" v-for="(item,index) in orderList" class="item"> <div @tap="item_click(item)" v-for="(item,index) in orderList" class="item">
...@@ -123,15 +135,26 @@ wepy.page({ ...@@ -123,15 +135,26 @@ wepy.page({
data: { data: {
orderList: [], orderList: [],
userInfo: {}, userInfo: {},
platformOptions: [] platformOptions: [],
activeTab: 0,
activeTitle: '',
platform: ''
}, },
computed: {}, computed: {},
methods: { methods: {
item_click(item){ item_click(item){
let data = JSON.stringify(item) let data = JSON.parse(JSON.stringify(item))
wx.navigateTo({ data.activeTitle = this.activeTitle
url: '/pages/approvePreview?data=' + encodeURIComponent(data) if (this.activeTitle === '试剂耗材') {
}) wx.navigateTo({
url: '/pages/approvePreview?data=' + encodeURIComponent(JSON.stringify(data))
})
} else if (this.activeTitle === '实验动物') {
wx.navigateTo({
url: '/pages/sydwApprovePreview?data=' + encodeURIComponent(JSON.stringify(data))
})
}
// wx.setStorageSync("order", item); // wx.setStorageSync("order", item);
// wx.navigateTo({ // wx.navigateTo({
...@@ -233,6 +256,64 @@ wepy.page({ ...@@ -233,6 +256,64 @@ wepy.page({
}) })
} }
}); });
},
getSydwList() {
wx.getStorage({
key: 'user_info',
success: (res) => {
this.userInfo = JSON.parse(res.data);
wx.showLoading({
title: '加载中'
});
const requestURL = wx.getStorageSync('requestURL')
wx.request({
url: `${requestURL}/approveOpera/listUnApproveAnm`,
method: 'post',
header: {
'Content-Type': 'application/json',
'token': this.userInfo.token
},
data: {
searchText: '',
roleNum: this.userInfo.roleNum
},
success: (res) => {
if (res.data.success) {
this.orderList = res.data.data
} else if(res.statusCode === 401) {
wx.showModal({
title: '提示',
content: '重新扫码登录',
showCancel: false,
success: () => {
}
})
} else {
this.orderList = []
}
wx.hideLoading()
}
});
},
fail: function() {
wx.showModal({
title: '提示',
content: '重新扫码登录',
showCancel: false,
success: () => {
}
})
}
});
},
onChange(event) {
this.activeTitle = event.$wx.detail.title
this.orderList = []
if (event.$wx.detail.title === '试剂耗材') {
this.getList()
} else if (event.$wx.detail.title === '实验动物') {
this.getSydwList()
}
} }
}, },
onShow() { onShow() {
...@@ -325,6 +406,7 @@ wepy.page({ ...@@ -325,6 +406,7 @@ wepy.page({
let username = arrPara[1] let username = arrPara[1]
let plat = arrPara[3] let plat = arrPara[3]
let requestURL = this.platformOptions.find(v => v.platformNum === plat).platformUrl let requestURL = this.platformOptions.find(v => v.platformNum === plat).platformUrl
this.platform = plat.replace('_test', '')
wx.setStorage({ wx.setStorage({
key: 'requestURL', key: 'requestURL',
data: requestURL data: requestURL
...@@ -355,7 +437,8 @@ wepy.page({ ...@@ -355,7 +437,8 @@ wepy.page({
角色编号:res.data.data.umsUserRoleQueryVo[0].roleNum, 角色编号:res.data.data.umsUserRoleQueryVo[0].roleNum,
课题组名称:res.data.data.umsUserRoleQueryVo[0].groupName, 课题组名称:res.data.data.umsUserRoleQueryVo[0].groupName,
课题组编号:res.data.data.umsUserRoleQueryVo[0].groupCode, 课题组编号:res.data.data.umsUserRoleQueryVo[0].groupCode,
默认页:'index' 默认页:'index',
platform: plat.replace('_test', '')
}; };
wx.setStorage({ wx.setStorage({
key: 'user_info', key: 'user_info',
...@@ -390,6 +473,7 @@ wepy.page({ ...@@ -390,6 +473,7 @@ wepy.page({
key: 'user_info', key: 'user_info',
success: (res) => { success: (res) => {
this.userInfo = JSON.parse(res.data); this.userInfo = JSON.parse(res.data);
this.platform = this.userInfo.platform
this.getList() this.getList()
}, },
fail: function() { fail: function() {
...@@ -471,7 +555,9 @@ header: '~@/components/header', ...@@ -471,7 +555,9 @@ header: '~@/components/header',
'van-button': 'module:@vant/weapp/lib/button', 'van-button': 'module:@vant/weapp/lib/button',
"van-action-sheet": "module:@vant/weapp/lib/action-sheet/index", "van-action-sheet": "module:@vant/weapp/lib/action-sheet/index",
"van-tabbar": "module:@vant/weapp/lib/tabbar/index", "van-tabbar": "module:@vant/weapp/lib/tabbar/index",
"van-tabbar-item": "module:@vant/weapp/lib/tabbar-item/index" "van-tabbar-item": "module:@vant/weapp/lib/tabbar-item/index",
"van-tabs": "module:@vant/weapp/lib/tabs/index",
"van-tab": "module:@vant/weapp/lib/tab/index"
} }
} }
</config> </config>
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment