Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cg_approveApp_2023
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
cg_approveApp_2023
Commits
ac685ec2
You need to sign in or sign up before continuing.
Commit
ac685ec2
authored
Nov 28, 2024
by
heduo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(system): 华中阜外审批小程序新增实验动物
parent
a48cc744
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
568 additions
and
8 deletions
+568
-8
src/pages/index.wpy
src/pages/index.wpy
+94
-8
src/pages/sydwApprovePreview.wpy
src/pages/sydwApprovePreview.wpy
+474
-0
No files found.
src/pages/index.wpy
View file @
ac685ec2
...
...
@@ -63,6 +63,15 @@
box-sizing: border-box;
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>
<!--<wxs module="m1" lang="babel">-->
...
...
@@ -81,7 +90,10 @@
<header background="#45C9C2" title_text="待审批列表"/>
<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="暂无待审批订单" />
<div @tap="item_click(item)" v-for="(item,index) in orderList" class="item">
...
...
@@ -123,15 +135,26 @@ wepy.page({
data: {
orderList: [],
userInfo: {},
platformOptions: []
platformOptions: [],
activeTab: 0,
activeTitle: '',
platform: ''
},
computed: {},
methods: {
item_click(item){
let data = JSON.stringify(item)
let data = JSON.parse(JSON.stringify(item))
data.activeTitle = this.activeTitle
if (this.activeTitle === '试剂耗材') {
wx.navigateTo({
url: '/pages/approvePreview?data=' + encodeURIComponent(JSON.stringify(data))
})
} else if (this.activeTitle === '实验动物') {
wx.navigateTo({
url: '/pages/approvePreview?data=' + encodeURIComponent(data
)
url: '/pages/sydwApprovePreview?data=' + encodeURIComponent(JSON.stringify(data)
)
})
}
// wx.setStorageSync("order", item);
// wx.navigateTo({
...
...
@@ -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() {
...
...
@@ -325,6 +406,7 @@ wepy.page({
let username = arrPara[1]
let plat = arrPara[3]
let requestURL = this.platformOptions.find(v => v.platformNum === plat).platformUrl
this.platform = plat.replace('_test', '')
wx.setStorage({
key: 'requestURL',
data: requestURL
...
...
@@ -355,7 +437,8 @@ wepy.page({
角色编号:res.data.data.umsUserRoleQueryVo[0].roleNum,
课题组名称:res.data.data.umsUserRoleQueryVo[0].groupName,
课题组编号:res.data.data.umsUserRoleQueryVo[0].groupCode,
默认页:'index'
默认页:'index',
platform: plat.replace('_test', '')
};
wx.setStorage({
key: 'user_info',
...
...
@@ -390,6 +473,7 @@ wepy.page({
key: 'user_info',
success: (res) => {
this.userInfo = JSON.parse(res.data);
this.platform = this.userInfo.platform
this.getList()
},
fail: function() {
...
...
@@ -471,7 +555,9 @@ header: '~@/components/header',
'van-button': 'module:@vant/weapp/lib/button',
"van-action-sheet": "module:@vant/weapp/lib/action-sheet/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>
src/pages/sydwApprovePreview.wpy
0 → 100644
View file @
ac685ec2
<style lang="less">
.panel-title {
font-size: 36rpx;
color: black;
}
.main {
margin-bottom: 100rpx;
box-sizing: border-box;
flex: 1;
overflow-y: scroll;
width: 100%;
}
.header {
z-index: 1000;
width: 100%;
height: 170rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
.inner {
margin-top: 10rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
width: 490rpx;
.avatar-small {
display: flex;flex-direction: row;
align-items: center;
justify-content: center;
border-radius: 50%;
overflow: hidden;
z-index: 90;
background: white;
width: 98rpx;
height: 98rpx;
}
.avatar-big {
z-index: 90;
display: flex;flex-direction: row;
align-items: center;
justify-content: center;
border-radius: 50%;
background: white;
width: 138rpx;
height: 138rpx;
}
}
}
.gaishu{
margin-bottom: 25rpx;
background: white;
box-sizing: border-box;
width: 100%;
margin-top: 10rpx;
display: flex;
padding: 10rpx 30rpx;
flex-direction: column;
label{
margin-top: 20rpx;
}
}
.detail{
width: 100%;
box-sizing: border-box;
padding: 30rpx;
border-bottom: 1rpx solid #EDEDED;
view{
margin-bottom: 10rpx;
}
}
.van-image{
display: block!important;
}
</style>
<!--<wxs module="m1" lang="babel">-->
<!--const getTime = (time) => {-->
<!--let date = getDate(time);-->
<!--let hour = date.getHours();-->
<!--let mins = date.getMinutes();-->
<!--let sec = date.getSeconds();-->
<!--let milli = date.getMilliseconds();-->
<!--return `${hour}:${mins}:${sec}.${milli}`;-->
<!--}-->
<!--module.exports.getTime = getTime;-->
<!--</wxs>-->
<template>
<div class="container" style="align-items: center">
<header background="#45C9C2" title_text="预览" isShow="true"/>
<div style="width: 100%">
<div class="gaishu">
<div style="font-size: 40rpx;font-weight: 600">订单总览</div>
<div style="display: flex;justify-content: space-between">
<div>{{ queryOrder.orderSn }}</div>
<div>总金额:{{ queryOrder.amount }}元</div>
</div>
<div>提交人:{{ queryOrder.submitName }}</div>
<div>课题组:{{ queryOrder.groupName }}</div>
<div>经费卡:{{ queryOrder.fundsCar }}</div>
<div>伦理卡号:{{ queryOrder.ethNo }}</div>
<div>供应商:{{ queryOrder.supplierName }}</div>
</div>
<div style="background: white;width: 100%;margin-top: 20rpx;padding-top: 20rpx">
<span style="font-size: 40rpx;font-weight: 600;margin-left: 30rpx">商品明细</span>
<div class="detail" v-for="(item,index) in queryOrder.detail" :key="index">
<div style="display: flex;justify-content: space-between">
<div>商品名称:{{ item.name }}</div>
<div>单价:{{ item.price }}元</div>
</div>
<div>{{ '品牌: '+ item.brand +';货号:'+ item.goodsNo +';品种:' + item.spec2 }}</div>
<div>{{ '规格: '+ item.spec +';等级:'+ item.grade +';年龄:' + item.old }}</div>
<div>{{ '体重: '+ item.weight +';性别:'+ item.sex }}</div>
</div>
</div>
</div>
<div style="width: 100%;padding: 30rpx;box-sizing: border-box;display: flex;flex-direction: column">
<van-button @tap="pass()" block type="primary">审批通过</van-button>
<van-button @tap="showRefuse()" block type="warning" style="margin-top: 20rpx">审批拒绝</van-button>
</div>
<van-dialog
@close="onDClose"
@cancel="cancelRefuse"
use-slot
@confirm="refuse"
show-cancel-button
title="填写拒绝原因"
show="{{ showM }}"
>
<div style="padding: 100rpx 40rpx;width: 550rpx">
<input style="width: 550rpx" v-model="refuse_reason" placeholder="请输入拒绝原因"/>
</div>
</van-dialog>
</div>
</template>
<script>
import wepy from '@wepy/core'
import { mapState } from '@wepy/x'
import store from '../store'
import testMixin from '../mixins/test'
import http from '../common/http.js'
const app = getApp().$wepy.$options
wepy.page({
store,
hooks: {
},
mixins: [testMixin],
data: {
orderList: [],
showM: false,
refuse_reason: '',
queryOrder: {},
userInfo: {},
requestURL: ''
},
computed: {},
methods: {
onDClose(){
this.showM = false
},
cancelRefuse() {
wx.showToast({
title: '您取消了拒绝',
icon: 'none'
})
},
pass(){
wx.showModal({
title: "提示",
content: '确认通过吗?',
success: (res) => {
if(res.confirm) {
wx.showLoading({
title: '加载中'
});
const param = {
taskId: this.queryOrder.taskId,
option: '通过'
}
wx.request({
url: `${this.requestURL}/approveOpera/passAnm`,
method: 'post',
header: {
'Content-Type': 'application/json',
'token': this.userInfo.token
},
data: {
taskId: this.queryOrder.taskId,
option: '通过',
type: '审批'
},
success: (res) => {
if (res.data.success) {
wx.hideLoading()
wx.showModal({
title: "提示",
showCancel: false,
content: '通过成功',
//点击确认返回main界面
success: function (res) {
wx.reLaunch({
url: '/pages/index',
})
// wx.navigateBack({
// delta: 1
// })
}
})
} else {
wx.hideLoading()
wx.showModal({
title: "提示",
showCancel: false,
content: res.message,
success: function (res) {
}
})
}
}
});
}else {
wx.showToast({
title: '您取消了通过',
icon: 'none'
})
}
}
})
// let order = wx.getStorageSync("order");
// let username = wx.getStorageSync("username");
// let role = wx.getStorageSync("role");
// const param = {
// username: username, 订单id: order, 审批角色: role,
// 审批通过: '1', 审批说明: '', 审批人帐号: username
// }
// http.post('/order/orderApproval', param).then(res => {
// if(res.flag === '1'){
// wx.showModal({
// title: "提示",
// showCancel: false,
// content: '审批完成',
// //点击确认返回main界面
// success: function (res) {
// wx.navigateBack({
// delta: 1
// })
// }
// })
// }else{
// wx.showModal({
// title: "提示",
// showCancel: false,
// content: res.message,
// //点击确认返回main界面
// success: function (res) {
// wx.navigateBack({
// delta: 1
// })
// }
// })
// }
// })
},
showRefuse(){
this.showM = true
this.refuse_reason = ''
},
refuse(){
if(!this.refuse_reason || this.refuse_reason.trim() === ''){
wx.showToast({
title: '请输入拒绝原因',
icon: 'none'
})
return
}
this.showM = false
wx.showLoading({
title: '加载中'
});
wx.request({
url: `${this.requestURL}/approveOpera/refuseAnm`,
method: 'post',
header: {
'Content-Type': 'application/json',
'token': this.userInfo.token
},
data: {
taskId: this.queryOrder.taskId,
option: '拒绝',
reason: this.refuse_reason
},
success: (res) => {
if (res.data.success) {
wx.hideLoading()
wx.showModal({
title: "提示",
showCancel: false,
content: '拒绝成功',
//点击确认返回main界面
success: function (res) {
wx.reLaunch({
url: '/pages/index',
})
// wx.navigateBack({
// delta: 1
// })
}
})
} else {
wx.hideLoading()
wx.showModal({
title: "提示",
showCancel: false,
content: res.message,
success: function (res) {
}
})
}
}
});
// let order = wx.getStorageSync("order");
// let username = wx.getStorageSync("username");
// let role = wx.getStorageSync("role");
// const param = {
// username: username, 订单id: order, 审批角色: role,
// 审批通过: '0', 审批说明: this.refuse_reason, 审批人帐号: username
// }
// http.post('/order/orderApproval', param).then(res => {
// this.showM = false
// if(res.flag === '1'){
// wx.showModal({
// title: "提示",
// showCancel: false,
// content: '审批完成',
// //点击确认返回main界面
// success: function (res) {
// wx.navigateBack({
// delta: 1
// })
// }
// })
// }else{
// wx.showModal({
// title: "提示",
// showCancel: false,
// content: res.message,
// //点击确认返回main界面
// success: function (res) {
// wx.navigateBack({
// delta: 1
// })
// }
// })
// }
// })
},
history(){
}
},
onLoad(option) {
this.requestURL = wx.getStorageSync('requestURL')
// 接收上个页面传过来的 一整个对象
this.queryOrder = JSON.parse(decodeURIComponent(option.data))
console.log(this.queryOrder)
if(!this.queryOrder.orderSn) {
wx.showModal({
title: "提示",
showCancel: false,
content: '未找到此订单',
//点击确认返回main界面
success: function (res) {
wx.navigateBack({
delta: 1
})
}
})
}
wx.getStorage({
key: 'user_info',
success: (res) => {
this.userInfo = JSON.parse(res.data);
},
fail: function() {
wx.showModal({
title: "提示",
showCancel: false,
content: '用户未登录',
success: function (res) {
wx.navigateBack({
delta: 1
})
}
})
}
});
// let role = wx.getStorageSync("role");
// let order = wx.getStorageSync("order");
// http.post('/JPost?query=订单详情_mp', { 订单号: order }).then(res => {
// if(res.flag === "1"){
// if(res.data[0]['等待审批']!==role){
// wx.showModal({
// title: "提示",
// showCancel: false,
// content: '您当前无法审批此订单,可能尚未流转至您或者您已审批过此订单',
// //点击确认返回main界面
// success: function (res) {
// wx.navigateBack({
// delta: 1
// })
// }
// })
// return
// }
// this.orderList = res.data
// }else{
// wx.showModal({
// title: "提示",
// showCancel: false,
// content: '未找到此订单',
// //点击确认返回main界面
// success: function (res) {
// wx.navigateBack({
// delta: 1
// })
// }
// })
// }
// })
}
})
</script>
<config>
{
navigationBarTextStyle: "white",
navigationBarBackgroundColor: "#45C9C3",
navigationBarTitleText: '小树懒捎带',
usingComponents: {
"van-card": "module:@vant/weapp/lib/card/index",
"van-icon": "module:@vant/weapp/lib/icon/index",
"van-overlay": "module:@vant/weapp/lib/overlay/index",
"van-cell": "module:@vant/weapp/lib/cell/index",
"van-cell-group": "module:@vant/weapp/lib/cell-group/index",
"van-search": "module:@vant/weapp/lib/search/index",
"van-image": "module:@vant/weapp/lib/image/index",
"van-dialog": "module:@vant/weapp/lib/dialog/index",
header: '~@/components/header',
"van-picker": "module:@vant/weapp/lib/picker/index",
"van-popup": "module:@vant/weapp/lib/popup/index",
'van-button': 'module:@vant/weapp/lib/button',
"van-action-sheet": "module:@vant/weapp/lib/action-sheet/index",
"van-tabbar": "module:@vant/weapp/lib/tabbar/index",
"van-tabbar-item": "module:@vant/weapp/lib/tabbar-item/index"
}
}
</config>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment