Commit 1a2942ac authored by 张伯涛's avatar 张伯涛

接口对接

parent 686f7878
import request from '@/utils/request'
// 审批数据列表获取
export function getApproveList(type) {
return request({
url: `/wx/sysprocessinstance/listByPageExamine/${type}`,
method: 'get',
})
}
import request from '@/utils/request'
// 获取单据列表信息
export function queryDocumentList(params) {
return request({
url: '/wx/sysprocessinstance/listByPage',
method: 'get',
params
})
}
// 获取单据详情
export function getDocumentDetails(businessId) {
return request({
url: `/wx/sysprocessinstance/getDetail/${businessId}`,
method: 'get',
})
}
// 应用全局配置
module.exports = {
// baseUrl: 'https://vue.ruoyi.vip/prod-api',
baseUrl: 'http://49.232.167.247:20014', // 线上
// baseUrl: 'http://49.232.167.247:20014', // 线上
baseUrl: 'http://192.168.1.12:8001', // 线上
// baseUrl: 'http://localhost:8080',
// 应用信息
appInfo: {
......
......@@ -25,6 +25,11 @@
"navigationBarTitleText": "单据"
}
}, {
"path": "pages/document/documentInfo",
"style": {
"navigationBarTitleText": "详情"
}
},{
"path": "pages/mine/index",
"style": {
"navigationBarTitleText": "我的"
......
......@@ -9,9 +9,6 @@
<view v-show="current === 1" class="approval_content">
<my-approval></my-approval>
</view>
<!-- <view v-show="current === 2" class="approval_content">-->
<!-- <my-rejected></my-rejected>-->
<!-- </view>-->
</view>
</view>
</view>
......@@ -23,17 +20,27 @@
import MyRejected from './myrejected.vue'
import UniSegmentedControl
from "../../uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue";
import {getApproveList} from "../../api/system/approval";
export default {
components:{UniSegmentedControl, MyApproval, MyApply, MyRejected },
data() {
return {
current:0,
current:1, // 0: 待办, 1: 已办
approvalList:['待办','已办']
}
},
created() {
this.getApprovalList()
},
methods: {
getApprovalList() {
getApproveList(this.current).then(res => {
})
},
onClickItem(e) {
this.current = e.currentIndex
this.getApprovalList()
}
}
......
<template>
<view class="container">
<uni-card :is-shadow="false" is-full>
<text class="uni-h6">{{ classesForm.classesName }}</text>
</uni-card>
<uni-section title="班次信息" type="line">
<view class="example" style="padding: 0 10px">
<!-- 展示不同的排列方式 -->
<uni-forms ref="baseForm" :modelValue="classesForm" label-position="left" label-width="120">
<uni-forms-item label="部门" required>
<uni-data-picker v-model="classesForm.deptId" :map="{value: 'deptId', text: 'deptName'}" :localdata="deptTree" popup-title="请选择部门" @change="onchange"></uni-data-picker>
<text class="beforeValue">部门2</text>
</uni-forms-item>
<uni-forms-item label="产线" required>
<uni-data-picker v-model="classesForm.productId" :map="{value: 'productId', text: 'productName'}" :localdata="productTree" popup-title="请选择产线" @change="onchange"></uni-data-picker>
<text class="beforeValue">产线2</text>
</uni-forms-item>
<uni-forms-item label="是否跨天" required>
<uni-data-checkbox v-model="classesForm.isTwodays" style="float: right;margin-top: 5px;" :localdata="towDayMap"></uni-data-checkbox>
</uni-forms-item>
<uni-forms-item label="开始时间" required>
<uni-datetime-picker type="date" :clear-icon="false" v-model="classesForm.startDate" placeholder="请选择开始时间" />
<text class="beforeValue">2024-03-01</text>
</uni-forms-item>
<uni-forms-item label="结束时间" required>
<uni-datetime-picker type="date" :clear-icon="false" v-model="classesForm.endDate" placeholder="请选择结束时间" />
<text class="beforeValue">2024-03-11</text>
</uni-forms-item>
<uni-forms-item label="权重" required>
<uni-easyinput type="number" disabled v-model="classesForm.weight" placeholder="请输入权重" />
<text class="beforeValue">3</text>
</uni-forms-item>
<uni-forms-item label="版本" required>
<uni-easyinput v-model="classesForm.version" disabled placeholder="请输入版本" />
<text class="beforeValue">2</text>
</uni-forms-item>
</uni-forms>
<button type="primary" @click="submit('baseForm')">提交</button>
</view>
</uni-section>
</view>
</template>
<script>
import {getDocumentDetails} from "../../api/system/document";
export default {
name: "ClassesInfo",
data() {
return {
businessId: '',
approveHistoryList: [], // 审批历史
createDeptName: [], // 部门名称
flowChatNodeList: [], // 所有节点
newBusinessData: [], // 新表单
oldBusinessData: [], // 旧表单
classesForm: {},
deptTree: [
{
deptName: '部门1',
deptId: 1
},
{
deptName: '部门2',
deptId: 2
}
],
productTree: [
{
productName: '产线1',
productId: 1
},
{
productName: '产线2',
productId: 2
}
],
towDayMap: [
{
text: '是',
value: '1',
},
{
text: '否',
value: '0',
}
]
}
},
onLoad(options) {
this.businessId = options.businessId
this.getDetails()
// 页面启动的生命周期,这里编写页面加载时的逻辑
},
methods: {
onchange() {
},
/** 获取详情*/
getDetails() {
getDocumentDetails(this.businessId).then(res => {
this.approveHistoryList = res.data.approveHistoryList // 审批历史
this.createDeptName = res.data.createDeptName // 部门名称
this.flowChatNodeList = res.data.flowChatNodeList // 所有节点
this.newBusinessData = res.data.newBusinessData // 新表单
this.oldBusinessData = res.data.oldBusinessData // 旧表单
})
},
switchChange(e) {
console.log(e)
this.classesForm.isTwodays = e
},
submit(ref) {
this.$refs[ref].validate(res => {
console.log(this.classesForm)
aeclassesinfoUpdate(this.classesForm).then(res => {
uni.showToast({
title: `编辑成功`
})
setTimeout(_ => {
uni.navigateBack()
}, 500)
})
}).catch(err => {
console.log('err', err);
})
},
}
}
</script>
<style scoped lang="scss">
.beforeValue{
padding-left: 10px;
color: red;
}
.example {
padding: 15px;
background-color: #fff;
}
.segmented-control {
margin-bottom: 15px;
}
.button-group {
margin-top: 15px;
display: flex;
justify-content: space-around;
}
.form-item {
display: flex;
align-items: center;
}
.button {
display: flex;
align-items: center;
height: 35px;
margin-left: 10px;
}
</style>
<template>
<view class="document_module">
<view class="leave_container">
<view class="leave_title">
<text>单据类型<text class="red-icon">*</text></text>
<view class="leave_con">
<uni-combox :candidates="leaveList" placeholder="请选择单据类型" v-model="form.leave_type"></uni-combox>
</view>
</view>
<view class="leave_title">
<text>开始时间<text class="red-icon">*</text></text>
<view class="leave_con">
<uni-datetime-picker type="date" v-model="form.start_date" />
</view>
</view>
<view class="leave_title">
<text>结束时间<text class="red-icon">*</text></text>
<view class="leave_con">
<uni-datetime-picker type="date" v-model="form.end_date" />
</view>
</view>
<view class="leave_btn">
<button type="primary" @click="submitLeave">搜索</button>
</view >
<!-- <view class="leave_container">-->
<!-- <view class="leave_title">-->
<!-- <text>单据类型<text class="red-icon">*</text></text>-->
<!-- <view class="leave_con">-->
<!-- <uni-combox :candidates="leaveList" placeholder="请选择单据类型" v-model="form.leave_type"></uni-combox>-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="leave_title">-->
<!-- <text>开始时间<text class="red-icon">*</text></text>-->
<!-- <view class="leave_con">-->
<!-- <uni-datetime-picker type="date" v-model="form.start_date" />-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="leave_title">-->
<!-- <text>结束时间<text class="red-icon">*</text></text>-->
<!-- <view class="leave_con">-->
<!-- <uni-datetime-picker type="date" v-model="form.end_date" />-->
<!-- </view>-->
<!-- </view>-->
<!-- <view class="leave_btn">-->
<!-- <button type="primary" @click="submitLeave">搜索</button>-->
<!-- </view >-->
</view>
<!-- </view>-->
<uni-swipe-action>
<ul>
<li v-for="(item,index) in myApprovalList" :key="index" class="my_approval_li">
<uni-swipe-action-item :right-options="options" @click="bindClick($event,item.eventId)" @change="swipeChange($event, index)">
<view class="my_approval_item">
<h3 class="my_approval_title"><text>[{{item.type}}]--{{item.name}}</text> <text class="approval_title_right">{{item.stateName}}</text></h3>
<view class="my_approval_item" @click="toNav(item.businessId)">
<h3 class="my_approval_title"><text>[{{item.businessTypeName}}]--{{item.createUserName}}</text>
<text class="approval_info_type">{{item.status === '10' ? '待审批' :item.status === '2' ? '已审批':item.status === '5' ? '驳回' : ''}}</text></h3>
<view class="my_approval_info">
<text>{{item.department}}</text>
<text class="approval_info_right">{{item.time}}</text>
<text class="approval_info_right">{{item.createDate}}</text>
</view>
</view>
</uni-swipe-action-item>
......@@ -44,6 +45,8 @@
</template>
<script>
import {queryDocumentList} from "@/api/system/document";
export default{
data() {
return {
......@@ -64,16 +67,7 @@ export default{
{ value: 1, text: "足球" },
{ value: 2, text: "游泳" },
],
myApprovalList:[{
type:"请假",
name:"张三",
reason:"家里有事",
stateName:"待办",
state:'0',
department:"研发部",
time:'2021-10-14',
eventId:'211'
}],
myApprovalList:[],
options:[
{
text: '撤回',
......@@ -89,7 +83,27 @@ export default{
]
}
},
created() {
this.getDocumentList()
},
methods:{
/** 详情页跳转*/
toNav(id) {
uni.navigateTo({
url: `documentInfo?businessId=${id}`,
success:(res) =>{
},
fail:(err) =>{
console.log(err)
}
});
},
/** 查询单据列表*/
getDocumentList() {
queryDocumentList().then(res => {
this.myApprovalList = res.rows
})
},
bindClick(e,id) {
if(e.content.text === '撤回'){
console.log('撤回')
......@@ -154,6 +168,9 @@ export default{
color: #007aff;
}
}
.approval_info_type{
padding-left: 130px;
}
.my_approval_info{
height: 60rpx;
line-height: 60rpx;
......
......@@ -50,7 +50,7 @@
register: false,
globalConfig: getApp().globalData.config,
loginForm: {
username: "admin",
username: "guanliyuan",
password: "123456",
code: "",
uuid: ''
......
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