Commit b4a44fc8 by huangqy

黄麒宇的政务钉钉第一版发布

Signed-off-by: huangqy <huangqy@junmp.com.cn>
parents
.tea
node_modules
page {
background-color: #F7F7F7;
border: 1px solid rgba(0,0,0,0);
box-sizing: border-box;
}
.page {
font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif;
font-size: 24rpx;
padding: 15rpx;
flex: 1;
}
.page-description {
margin-bottom: 32rpx;
}
.page-section {
background: #fff;
margin-bottom: 15rpx;
}
.page-section-final {
background: #fff;
margin-bottom: 90rpx;
}
.page-section-title {
padding: 15rpx 20rpx;
}
.page-section-demo {
padding: 32rpx;
}
.page-section-btns {
border-top: 1px solid #ddd;
display: flex;
justify-content: space-around;
align-items: center;
}
.page-section-btns > view {
flex: 1;
height: 84rpx;
display: flex;
align-items: center;
justify-content: space-around;
color: #49a9ee;
}
.page-section-btns > view + view {
border-left: 1px solid #ddd;
}
.bc_blue {
background-color: #49A9EE;
}
.bc_red {
background-color: #F04134;
}
.bc_yellow {
background-color: #FFBF00;
}
.bc_green {
background-color: #00A854;
}
.form-row-label-left {
width: 50%;
padding: 15rpx 8rpx;
font-size: 26rpx;
text-align: left;
color: #000;
}
.form-row-label-right {
width: 50%;
padding: 15rpx 8rpx;
font-size: 26rpx;
text-align: right;
color: #000;
}
.page-add {
position: fixed;
bottom: 0;
width: 100%;
}
import login from '/src/api/login'
App({
// 全局变量,获取方法getApp().globalData
globalData: {
// 域名,用于发送请求
host: 'http://192.168.2.36:5000',
host2: 'http://192.168.2.36:10004'
},
// 小程序初始化
onLaunch(options) {
// 登录
login()
}
})
\ No newline at end of file
{
"pages": [
"pages/index/index",
"pages/store/store",
"pages/personal/personal",
"pages/purchaseInfo/purchaseInfo",
"pages/borrowMyInfo/borrowMyInfo",
"pages/repairInfo/repairInfo",
"pages/scrapInfo/scrapInfo",
"pages/transferInfo/transferInfo",
"pages/purchaseMain/purchaseMain",
"pages/borrowMyMain/borrowMyMain",
"pages/repairMain/repairMain",
"pages/scrapMain/scrapMain",
"pages/transferMain/transferMain",
"pages/receiveMain/receiveMain",
"pages/receiveInfo/receiveInfo",
"pages/receiveAdd/receiveAdd",
"pages/borrowMyAdd/borrowMyAdd",
"pages/purchaseAdd/purchaseAdd",
"pages/transferAdd/transferAdd",
"pages/error/error",
"pages/inOutList/inOutList",
"pages/cabinetInfo/cabinetInfo"
],
"window": {
"defaultTitle": "警用装备智能管理平台",
"titleBarColor": "#2074D4",
"allowsBounceVertical": "YES",
"pullRefresh": true
},
"tabBar": {
"textColor": "#1f1f1f",
"selectedColor": "#3296fa",
"backgroundColor": "#ffffff",
"items": [
{
"pagePath": "pages/index/index",
"name": "待办",
"icon": "src/assets/待办.png",
"activeIcon": "src/assets/待办亮.png"
},
{
"pagePath": "pages/store/store",
"name": "工作台",
"icon": "src/assets/工作台.png",
"activeIcon": "src/assets/工作台亮.png"
},
{
"pagePath": "pages/personal/personal",
"name": "我的",
"icon": "src/assets/我的.png",
"activeIcon": "src/assets/我的亮.png"
}
]
}
}
{
"enableDistFileMinify": true,
"component2": true,
"axmlStrictCheck": true,
"enableParallelLoader": true
}
\ No newline at end of file
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"@babel/runtime": {
"version": "7.14.6",
"resolved": "https://repo.huaweicloud.com/repository/npm/@babel/runtime/-/runtime-7.14.6.tgz",
"integrity": "sha512-/PCB2uJ7oM44tz8YhC4Z/6PeOKXp4K588f+5M3clr1M4zbqztlo0XEfJ2LEzj/FgwfgGcIdl8n7YYjTCI0BYwg==",
"requires": {
"regenerator-runtime": "^0.13.4"
}
},
"@remax/mini-types": {
"version": "0.1.0",
"resolved": "https://repo.huaweicloud.com/repository/npm/@remax/mini-types/-/mini-types-0.1.0.tgz",
"integrity": "sha512-bVDcbUrp6p0PZwfS0xGVQS6k9f8B35BtZaYt/W/IGKh7VALYQ+tS2KcytLRmIJ/Vmohaw5ikIRN89I+frPdh4g=="
},
"gdt-jsapi": {
"version": "1.9.13",
"resolved": "https://repo.huaweicloud.com/repository/npm/gdt-jsapi/-/gdt-jsapi-1.9.13.tgz",
"integrity": "sha512-Gab2g4cJYy8Rd3oFlrt0Ur2Fw+WolxPA3SqjPD9yh7wCB8NIrsfR2Imp3WFOkIU8ejlVnEcaNHIrDmaBGpA8fA==",
"requires": {
"@babel/runtime": "^7.10.2",
"@remax/mini-types": "^0.1.0"
}
},
"js-md5": {
"version": "0.7.3",
"resolved": "https://repo.huaweicloud.com/repository/npm/js-md5/-/js-md5-0.7.3.tgz",
"integrity": "sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ=="
},
"mini-ali-ui": {
"version": "1.3.8",
"resolved": "https://repo.huaweicloud.com/repository/npm/mini-ali-ui/-/mini-ali-ui-1.3.8.tgz",
"integrity": "sha512-FejafUdxUUCDF1ec6QdVugTmx8ITVe0xONZYK2r5cdLufOmcbh5NUR65hnFmwlJ84Cng4YoAAqeUu5Wiqn6ezA==",
"requires": {
"@babel/runtime": "^7.11.2"
}
},
"regenerator-runtime": {
"version": "0.13.7",
"resolved": "https://repo.huaweicloud.com/repository/npm/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz",
"integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew=="
}
}
}
{
"dependencies": {
"gdt-jsapi": "^1.9.13",
"js-md5": "^0.7.3",
"mini-ali-ui": "^1.3.8"
}
}
.am-title {
margin-top: 25rpx
}
.row {
display: flex;
align-items: center;
padding: 0 30rpx;
}
.row-title {
flex: 1;
padding-top: 28rpx;
padding-bottom: 28rpx;
font-size: 34rpx;
color: #000;
}
.row-extra {
flex-basis: initial;
font-size: 32rpx;
color: #888;
}
.row-arrow {
width: 32rpx;
height: 32rpx;
margin-left: 16rpx;
}
.button-submit {
padding: 30rpx;
}
.button-add {
padding: 10rpx 180rpx;
}
.border-line {
border: 1rpx solid #f1f1f1;
}
\ No newline at end of file
<view>
<tabs tabs="{{tabs}}" tabsName="activeTab" activeTab="{{activeTab}}" onTabClick="handleTabClick">
<block a:for="{{tabs}}">
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:if="{{index === 0}}">
<view>
<title>第一步: 选择仓库</title>
<view class="page-section">
<picker onChange="warehousePickerChange" value="{{waIndex}}" range="{{warehouseList}}" range-key="name">
<view class="row">
<view class="row-title">仓库</view>
<view class="row-extra">当前选择:{{warehouseList[waIndex].name}}</view>
</view>
</picker>
<view class="row" onTap="showDatePicker">
<view class="row-title">归还时间</view>
<view class="row-extra">当前选择:{{expectedTime}}</view>
</view>
</view>
<title>第二步: 选择装备</title>
<view class="page-section">
<picker onChange="eqPickerChange" value="{{eqIndex}}" range="{{equipmentList}}" range-key="equipmentDetailName">
<view class="row">
<view class="row-title">装备</view>
<view class="row-extra">当前选择:{{equipmentList[eqIndex].equipmentDetailName}}</view>
</view>
</picker>
<view class="border-line"/>
<view class="button-add"><button onTap="addEqu" style="background-color:#13ce66;color: #fff;">添加装备</button></view>
</view>
<title>已选择装备</title>
<block a:for="{{detailList}}">
<view class="page-section">
<flex>
<view class="form-row-label-left">装备名称: {{item.equipmentName}}</view>
<view class="form-row-label-right">库存: {{item.sizeCount}}</view>
</flex>
<flex>
<view class="form-row-label-left" onTap="changeStepper" data-small="{{index}}"><stepper onChange="callBackFn" showNumber value="{{item.quantity}}" readOnly="{{true}}" min="{{1}}" max="{{item.sizeCount}}"/></view>
<view class="form-row-label-right"><button type="warn" size="mini" onTap="delete" data-index="{{index}}">删除</button></view>
</flex>
</view>
</block>
<multi-liner placeholder="请输入借用原因" value="{{note}}" onInput="onInput" last="{{true}}" auto-height="{{true}}" controlled="{{controlled}}"/>
<view class="button-submit"><button type="primary" onTap="submit">提交</button></view>
</view>
</tab-content>
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:elif="{{index === 1}}">
<view>
<steps className="demo-steps-class" activeIndex="{{activeIndex}}" failIndex="{{failIndex}}" items="{{steps}}"></steps>
<title>审核详情</title>
<block a:for="{{items}}">
<view class="page-section">
<flex>
<view class="form-row-label-left">步骤名称: {{item.stepName}}</view>
<view class="form-row-label-right">审核人: {{item.auditUserName}}</view>
</flex>
<flex>
<view class="form-row-label-left">操作时间: {{item.updateTime}}</view>
<view class="form-row-label-right">审核意见: {{item.auditMind ? item.auditMind : '无'}}</view>
</flex>
</view>
</block>
</view>
</tab-content>
</block>
</tabs>
</view>
\ No newline at end of file
import dd from 'gdt-jsapi';
import http from '/src/http';
import util from '/src/libs/util'
Page({
data: {
tabs: [
{ title: '借用信息' },
{ title: '流程信息' }
],
activeTab: 0,
activeIndex: 1,
failIndex: 1,
steps: [],
items: [],
expectedTime: '',
warehouseList: [],
equipmentList: [],
note: '',
controlled: true,
num: 1,
detailList: [],
orderInfo: {},
processForm: {}
},
onLoad(query) {
this.getListOrgWarehouse()
this.getProcess(query.nextStepId)
if (query.id) {
this.getById(query.id)
}
},
getListOrgWarehouse() {
this.data.detailList = []
http.post('/api/Warehouse/GetListOrgWarehouse', {orgizationId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40"}).then(res => {
this.setData({
warehouseList: res.data
})
})
},
getProcess (nextStepId) {
const _this = this
const params = {
code: "borrowMy",
orgId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40",
stepId: nextStepId || "",
flowGateway: ""
}
http.post('/api/Process/GetProcess', params).then(res => {
if(res.code === "10000") {
_this.data.processForm = {
currentStepName: res.data.currentStepName,
dataScope: res.data.dataScope,
flowId: res.data.flowId,
flowName: res.data.flowName,
flowState: res.data.flowState,
flowType: res.data.flowType,
nextStepId: res.data.nextStepId,
orgId: res.data.orgId,
userInfo: res.data.userInfo,
userType: res.data.userType
}
}
})
http.post('/api/Process/GetAllProcess', {code: "borrowMy", orgId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40"}).then(res => {
if (res.code === '10000') {
var arr = []
res.data.forEach(element => {
arr.push({ title: element })
})
_this.setData({
steps: arr
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
getById (id) {
const _this = this
http.post('/api/Borrow/GetByID', {id: id}).then(res => {
if (res.code === '10000') {
_this.setData({
items: res.data.historyList,
orderInfo: res.data,
detailList: res.data.detailList,
expectedTime: res.data.expectedTime,
waIndex: _this.data.warehouseList.findIndex((value)=>value.id === res.data.warehouseId),
activeIndex: res.data.flowState ? _this.data.steps.length : _this.data.steps.findIndex(i => i.title === res.data.currentStepName) + 1
})
_this.getAllInventoryList(_this.data.waIndex)
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
handleTabClick({ index, tabsName }) {
this.setData({
[tabsName]: index
});
},
showDatePicker() {
dd.datePicker({
format: "yyyy-MM-dd",
currentDate: new Date(),
}).then(res => {
this.setData({
expectedTime: res.date
})
}).catch(err => {})
},
warehousePickerChange(e) {
this.setData({
waIndex: e.detail.value,
})
this.getAllInventoryList(e.detail.value)
},
returnTimePickerChange(e) {
this.setData({
timeIndex: e.detail.value,
})
},
getAllInventoryList(waIndex) {
http.post('/api/Inventory/GetAllInventoryList', {warehouseId: this.data.warehouseList[waIndex].id}).then(res => {
this.setData({
equipmentList: res.data
})
})
},
eqPickerChange(e) {
this.setData({
eqIndex: e.detail.value,
})
},
onInput (e) {
this.setData({
note: e.detail.value
});
},
addEqu() {
var result = this.data.detailList.filter(item => item.equipmentId === this.data.equipmentList[this.data.eqIndex].equipmentDetailId)
if(this.data.eqIndex == undefined) {
util.ddToast({ type: 'fail', text: '请选择装备' })
} else if(result.length > 0) {
util.ddToast({ type: 'fail', text: '已添加过该装备' })
} else {
var detailList = this.data.detailList;
let row = {
id: "",
equipmentName : this.data.equipmentList[this.data.eqIndex].equipmentDetailName,
equipmentId : this.data.equipmentList[this.data.eqIndex].equipmentDetailId,
sizeCount: this.data.equipmentList[this.data.eqIndex].detailCount,
quantity : 1
}
detailList.unshift(row)
this.setData({
detailList: detailList
})
}
},
delete(e) {
var detailList = this.data.detailList;
detailList.splice(e.target.dataset.index, 1)
this.setData({
detailList: detailList
})
},
callBackFn(value) {
this.setData({
num: value
})
},
changeStepper(e) {
const small = e.target.dataset.small
this.setData({
["detailList["+small+"].quantity"]: this.data.num
})
},
submit() {
if(new Date(this.data.expectedTime) < new Date()) {
util.ddToast({ type: 'fail', text: '归还时间应大于当前时间' })
} else if (this.data.detailList.length < 1) {
util.ddToast({ type: 'fail', text: '请至少添加一件装备' })
} else {
const queryParam = {
id: this.data.orderInfo.id,
warehouseId: this.data.warehouseList[this.data.waIndex].id,
note: this.data.note,
applyId: getApp().globalData.userId || "10",
applyName: getApp().globalData.username || '测试',
detailList: this.data.detailList,
expectedTime: this.data.expectedTime,
orgId: getApp().globalData.orgId || 'E05CC28D-C189-4389-8081-DD0D6E483B40',
orgCode: getApp().globalData.code || '330200'
}
let form = { ...queryParam, ...this.data.processForm }
http.post('/api/Borrow/AddOrUpdateBorrowOrder', form).then(res => {
if (res.code === "10000") {
util.ddToast({ type: 'success', text: res.msg })
dd.navigateBack({})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
}
}
});
{
"usingComponents": {
"tabs": "mini-ali-ui/es/tabs/index",
"tab-content": "mini-ali-ui/es/tabs/tab-content/index",
"steps": "mini-ali-ui/es/steps/index",
"title": "mini-ali-ui/es/title/index",
"multi-liner": "mini-ali-ui/es/multi-liner/index",
"flex": "mini-ali-ui/es/flex/index",
"stepper": "mini-ali-ui/es/stepper/index"
}
}
\ No newline at end of file
.am-title {
padding:var(--am-title-paddingLR,12px) var(--am-title-paddingB,12px)
}
.demo-steps-class {
margin-bottom: 20rpx;
}
.am-tabs-content-wrap {
background-color:#f1f1f1
}
.form-row {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
padding: 0 30rpx;
margin-top: 15rpx;
background-color:#fff
}
.form-row-label {
width: 45%;
font-size: 26rpx;
margin: 10rpx;
text-align: left;
color: #000;
}
.form-row-label-single {
width: 45%;
padding: 20rpx 10rpx;
font-size: 26rpx;
text-align: left;
color: #000;
}
.form-line {
height: 1px;
background-color: #ddd;
margin-left: 30rpx;
}
.button-center {
display: block;
text-align: center;
}
button {
margin-top: 20rpx;
}
<view>
<tabs tabs="{{tabs}}" tabsName="activeTab" activeTab="{{activeTab}}" onTabClick="handleTabClick" swipeable={{false}}>
<block a:for="{{tabs}}">
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:if="{{index === 0}}">
<view>
<title style="margin-top: 20rpx">基本信息</title>
<view class="form-row">
<view class="form-row-label-single">借用单号:</view>
<view class="form-row-label-single">{{orderInfo.orderCode}} </view>
<view class="form-row-label-single">目标仓库:</view>
<view class="form-row-label-single">{{orderInfo.warehouseName}}</view>
<view class="form-row-label-single">订单状态:</view>
<view class="form-row-label-single" a:if="{{orderInfo.flowState}}">已通过</view>
<view class="form-row-label-single" a:if="{{!orderInfo.flowState && orderInfo.userInfo !== ''}}">待审批</view>
<view class="form-row-label-single" a:if="{{!orderInfo.flowState && orderInfo.actionResult === '0'}}">撤销</view>
<view class="form-row-label-single" a:if="{{!orderInfo.flowState && orderInfo.userInfo === ''}}">已驳回</view>
<view class="form-row-label-single">申请人:</view>
<view class="form-row-label-single">{{orderInfo.applyName}}</view>
<view class="form-row-label-single">申请时间:</view>
<view class="form-row-label-single">{{orderInfo.applyTime}}</view>
<view class="form-row-label-single">更新时间:</view>
<view class="form-row-label-single">{{orderInfo.updateTime}}</view>
<view class="form-row-label-single">拟还时间:</view>
<view class="form-row-label-single">{{orderInfo.expectedTime}}</view>
<view class="form-row-label-single">申请理由:</view>
<view class="form-row-label-single">{{orderInfo.note ? orderInfo.note : '无'}}</view>
</view>
<title style="margin-top: 20rpx">装备信息</title>
<view class="page-section" a:for="{{orderInfo.detailList}}">
<flex>
<view class="form-row-label-left">装备名称: {{item.equipmentName}}</view>
</flex>
<flex>
<view class="form-row-label-left">装备数量 {{item.quantity}}</view>
</flex>
</view>
</view>
</tab-content>
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:elif="{{index === 1}}">
<view>
<steps className="demo-steps-class" activeIndex="{{activeIndex}}" failIndex="{{failIndex}}" items="{{steps}}"></steps>
<title>审核详情</title>
<block a:for="{{items}}">
<view class="page-section">
<flex>
<view class="form-row-label-left">步骤名称: {{item.stepName}}</view>
<view class="form-row-label-right">审核人: {{item.auditUserName}}</view>
</flex>
<flex>
<view class="form-row-label-left">操作时间: {{item.updateTime}}</view>
<view class="form-row-label-right">审核意见: {{item.auditMind ? item.auditMind : '无'}}</view>
</flex>
</view>
</block>
</view>
</tab-content>
</block>
</tabs>
<view a:if={{!type}}>
<title>审核意见</title>
<multi-liner placeholder="请输入审核意见" value="{{approvalMsg}}" onInput="onInput" last="{{true}}" auto-height="{{true}}" controlled="{{controlled}}"/>
<view class="button-center">
<button type="warn" size="mini" onTap="agree" data-result="no">不通过</button>
<button type="primary" size="mini" style="margin-left: 20rpx" onTap="agree" data-result="yes">通过</button>
</view>
</view>
</view>
\ No newline at end of file
import dd from "gdt-jsapi";
import http from '../../src/http/index'
import util from '../../src/libs/util'
Page({
data: {
tabs: [
{ title: '借用信息' },
{ title: '流程信息' }
],
activeTab: 0,
activeIndex: 1,
failIndex: 0,
steps: [],
items: [],
orderInfo: {},
controlled: true,
approvalMsg: '',
type: ''
},
onLoad(query) {
this.getAllProcess()
this.getById(query.id)
this.setData({
type: query.type
})
},
getAllProcess (id) {
const _this = this
http.post('/api/Process/GetAllProcess', {code: "borrowMy", orgId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40"}).then(res => {
if (res.code === '10000') {
var arr = []
res.data.forEach(element => {
arr.push({ title: element })
})
_this.setData({
steps: arr
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
getById (id) {
const _this = this
http.post('/api/Borrow/GetByID', {id: id}).then(res => {
if (res.code === '10000') {
_this.setData({
items: res.data.historyList,
orderInfo: res.data,
activeIndex: res.data.flowState ? _this.data.steps.length : _this.data.steps.findIndex(i => i.title === res.data.currentStepName) + 1
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
handleTabClick({ index, tabsName }) {
this.setData({
[tabsName]: index
});
},
onInput (e) {
this.setData({
approvalMsg: e.detail.value,
});
},
async agree (event) {
const result = event.target.dataset.result
const _this = this
var data = {
code: _this.data.orderInfo.flowType,
orgId: _this.data.orderInfo.orgId,
stepId: _this.data.orderInfo.nextStepId,
flowGateway: result === 'no' ? "不同意" : "同意"
}
let form = {}
await http.post('/api/Process/GetProcess', data).then(res => {
if (res.code === '10000') {
form = {
id: _this.data.orderInfo.id,
orgId : getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40",
flowState : res.data.flowState,
approvalMsg : _this.data.approvalMsg || data.flowGateway,
userType: res.data.userType,
userInfo: res.data.userInfo,
dataScope: res.data.dataScope,
nextStepId: res.data.nextStepId,
currentStepName: res.data.currentStepName,
auditUser: getApp().globalData.userId || "11",
auditUserName: getApp().globalData.username || "测试"
}
}
})
await http.post('/api/Borrow/ApproveOrder', form).then(res => {
if (res.code === "10000") {
util.ddToast({ type: 'success', text: res.msg })
dd.navigateBack({})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
}
});
\ No newline at end of file
{
"usingComponents": {
"tabs": "mini-ali-ui/es/tabs/index",
"tab-content": "mini-ali-ui/es/tabs/tab-content/index",
"steps": "mini-ali-ui/es/steps/index",
"title": "mini-ali-ui/es/title/index",
"multi-liner": "mini-ali-ui/es/multi-liner/index",
"flex": "mini-ali-ui/es/flex/index"
}
}
\ No newline at end of file
.am-title {
padding:var(--am-title-paddingLR,12px) var(--am-title-paddingB,12px)
}
.demo-steps-class {
margin-bottom: 20rpx;
}
.am-tabs-content-wrap {
background-color:#f1f1f1
}
.form-row-label-left {
flex: 2;
padding: 15rpx 8rpx;
font-size: 26rpx;
text-align: left;
color: #000;
}
.form-row-label-right {
flex: 1;
padding: 15rpx 8rpx;
font-size: 26rpx;
text-align: right;
color: #000;
}
.page-content {
background-color:#f1f1f1
}
.am-container {
margin-bottom: 15rpx
}
<scroll-view scroll-y="{{true}}" enable-back-to-top="{{true}}" style="height: 100vh;" onScrollToLower="onScrollToLower">
<tabs tabs="{{tabs}}" tabsName="activeTab" activeTab="{{activeTab}}" onTabClick="handleTabClick" swipeable={{false}}>
<block a:for="{{tabs}}">
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:if="{{index === 0}}">
<view>
<view class="{{applyList.length-1 === index && index > 4? 'page-section-final' : 'page-section'}}" a:for="{{applyList}}">
<container>
<view>
<flex>
<view class="form-row-label-left">借用单号: {{item.orderCode}}</view>
<view class="form-row-label-right" a:if="{{item.flowState}}">状态: 已通过</view>
<view class="form-row-label-right" a:elif="{{!item.flowState && item.userInfo !== ''}}">状态: 待审批</view>
<view class="form-row-label-right" a:elif="{{!item.flowState && item.actionResult === '0'}}">状态: 撤销</view>
<view class="form-row-label-right" a:elif="{{!item.flowState && item.userInfo === ''}}">状态: 已驳回</view>
</flex>
<flex>
<view class="form-row-label-left">目标仓库: {{item.warehouseName}}</view>
<view class="form-row-label-right">申请人: {{item.applyName}}</view>
</flex>
<flex>
<view class="form-row-label-left">申请时间: {{item.applyTime}}</view>
<button type="primary" size="mini" onTap="showInfo" data-id="{{item.id}}">查看</button>
<button size="mini" onTap="edit" data-row="{{item}}" a:if="{{!item.flowState && item.userInfo === ''}}"
style="margin-left: 10rpx;background-color:#ffba00;color: #fff">编辑</button>
<button type="warn" size="mini" onTap="back" data-row="{{item}}" a:if="{{!item.flowState && item.userInfo !== ''}}"
style="margin-left: 10rpx">撤销</button>
</flex>
</view>
</container>
</view>
</view>
</tab-content>
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:elif="{{index === 1}}">
<view class="{{list.length-1 === index && index > 4 ? 'page-section-final' : 'page-section'}}" a:for="{{list}}">
<container>
<view>
<flex>
<view class="form-row-label-left">借用单号: {{item.orderCode}}</view>
<view class="form-row-label-right" a:if="{{item.flowState}}">状态: 已通过</view>
<view class="form-row-label-right" a:if="{{!item.flowState && item.userInfo !== ''}}">状态: 待审批</view>
<view class="form-row-label-right" a:if="{{!item.flowState && item.actionResult === 0}}">状态: 撤销</view>
<view class="form-row-label-right" a:if="{{!item.flowState && item.userInfo === ''}}">状态: 已驳回</view>
</flex>
<flex>
<view class="form-row-label-left">目标仓库: {{item.warehouseName}}</view>
<view class="form-row-label-right">申请人: {{item.applyName}}</view>
</flex>
<flex>
<view class="form-row-label-left">申请时间: {{item.applyTime}}</view>
<button type="primary" size="mini" onTap="showInfo" data-id="{{item.id}}">查看</button>
</flex>
</view>
</container>
</view>
</tab-content>
</block>
</tabs>
<button class="page-add" onTap="openAdd">借用申请</button>
</scroll-view>
\ No newline at end of file
import dd from "gdt-jsapi";
import http from '../../src/http/index'
import util from '../../src/libs/util'
Page({
data: {
tabs: [
{ title: '借用申请' },
{ title: '借用列表' }
],
applyList: [],
list: [],
activeTab: 0,
activeIndex: 1,
failIndex: 0,
steps: [],
items: [],
orderInfo: {},
controlled: true,
approvalMsg: '',
size: 8
},
onLoad(query) {
this.getApply()
this.getList()
},
onPullDownRefresh() {
// 页面被下拉
this.getApply();
this.getList();
setTimeout(() => {
dd.stopPullDownRefresh();
}, 100);
},
onShow() {
// 页面显示
this.getApply();
this.getList();
},
getApply () {
const _this = this
http.post('/api/Borrow/GetAllBorrowOrderList', {applyId: getApp().globalData.userId || "10", actionType: 0, page: 0, size: _this.data.size, approveType: 3}).then(res => {
if (res.code === '10000') {
_this.setData({
applyList: res.data.content
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
getList () {
const _this = this
const queryParam = {orgId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40", flowType: "borrowMy" , userId: getApp().globalData.userId || '11',
roleIds: getApp().globalData.roleIds || [3], page: 0, size: _this.data.size, approveType: 3 }
http.post('/api/Process/GetPageHistoryProcessList', queryParam).then(res => {
if (res.code === '10000') {
_this.setData({
list: res.data.content
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
onScrollToLower(e) {
const _this = this
_this.setData({
size: _this.data.size + 8
})
if(this.data.activeTab === 0) {
this.getApply()
} else if (this.data.activeTab === 1) {
this.getList()
}
},
openAdd() {
dd.navigateTo({
url: '../borrowMyAdd/borrowMyAdd'
})
},
handleTabClick({ index, tabsName }) {
this.setData({
[tabsName]: index
});
},
showInfo(event) {
let id = event.target.dataset.id
dd.navigateTo({
url: '../borrowMyInfo/borrowMyInfo?id=' + id + '&type=2'
})
},
edit(event) {
let id = event.target.dataset.row.id
let nextStepId = event.target.dataset.row.nextStepId
dd.navigateTo({
url: '../borrowMyAdd/borrowMyAdd?id=' + id + '&nextStepId=' + nextStepId
})
},
back(event) {
let row = event.target.dataset.row
dd.confirm({
title: "确定撤销吗",
buttonLabels: [
"确定",
"取消"
],
}).then(res => {
if (res.buttonIndex === 0) {
this.confirmBack(row)
}
})
},
async confirmBack(row) {
const _this = this
var data = {
code: row.flowType,
orgId: row.orgId,
stepId: row.nextStepId,
flowGateway: "撤销"
}
let form = {}
await http.post('/api/Process/GetProcess', data).then(res => {
if (res.code === '10000') {
form = {
id: row.id,
detailList: row.detailList,
orgId : getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40",
flowState : res.data.flowState,
approvalMsg : data.flowGateway,
userType: res.data.userType,
userInfo: res.data.userInfo,
dataScope: res.data.dataScope,
nextStepId: res.data.nextStepId,
currentStepName: res.data.currentStepName,
auditUser: getApp().globalData.userId || "10",
auditUserName: getApp().globalData.username || "测试"
}
}
})
await http.post('/api/Borrow/ApproveOrder', form).then(res => {
if (res.code === "10000") {
util.ddToast({ type: 'success', text: res.msg })
_this.getApply()
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
}
});
\ No newline at end of file
{
"usingComponents": {
"tabs": "mini-ali-ui/es/tabs/index",
"tab-content": "mini-ali-ui/es/tabs/tab-content/index",
"title": "mini-ali-ui/es/title/index",
"multi-liner": "mini-ali-ui/es/multi-liner/index",
"container": "mini-ali-ui/es/container/index",
"flex": "mini-ali-ui/es/flex/index",
"flex-item": "mini-ali-ui/es/flex/flex-item/index"
}
}
\ No newline at end of file
<view>
<view class="page-section" a:for="{{items}}">
<flex>
<view class="form-row-label-left">装备名称: {{item.equipmentName}}</view>
<view class="form-row-label-right">型号名称: {{item.sizeName}}</view>
</flex>
<flex>
<view class="form-row-label-left">操作警员: {{item.policeName}}</view>
<view class="form-row-label-right">出入库类型: {{item.outInState === 0 ? '出库' : '入库'}}</view>
</flex>
<flex>
<view class="form-row-label-left">警柜名称: {{item.cabinetName}}</view>
<view class="form-row-label-right">数量: {{item.count}}</view>
</flex>
</view>
</view>
\ No newline at end of file
import http from '../../src/http/index'
Page({
data: {
items: []
},
onLoad(query) {
this.getCabinetList(query.id)
},
getCabinetList(id) {
http.post('/api/Inventory/GetCabinetList', {parentId: id, page: 0, size: 10}).then(res => {
this.setData({
items: res.data.content
})
})
}
});
{
"usingComponents": {
"flex": "mini-ali-ui/es/flex/index"
}
}
\ No newline at end of file
<page-result
type="network"
title="网络不给力"
brief="世界上最遥远的距离莫过于此"
footer="{{footer}}"
onTapLeft="onTapLeft"
onTapRight="onTapRight"
/>
\ No newline at end of file
import dd from 'gdt-jsapi';
Page({
data: {
footer: [{
text: '修复',
}, {
text: '刷新',
}],
},
onTapLeft(e) {
console.log(e, 'onTapLeft');
},
onTapRight(e) {
dd.switchTab({ url: '/pages/index/index' })
},
});
\ No newline at end of file
{
"usingComponents": {
"page-result": "mini-ali-ui/es/page-result/index"
}
}
\ No newline at end of file
.am-title {
padding:var(--am-title-paddingLR,12px) var(--am-title-paddingB,12px)
}
.demo-steps-class {
margin-bottom: 20rpx;
}
.am-tabs-content-wrap {
background-color:#f1f1f1
}
.form-row-label-left {
flex: 2;
padding: 15rpx 8rpx;
font-size: 26rpx;
text-align: left;
color: #000;
}
.form-row-label-right {
flex: 1;
padding: 15rpx 8rpx;
font-size: 26rpx;
text-align: right;
color: #000;
}
.page-content {
background-color:#f1f1f1
}
.am-container {
margin-bottom: 15rpx
}
<scroll-view scroll-y="{{true}}" enable-back-to-top="{{true}}" style="height: 100vh;" onScrollToLower="onScrollToLower">
<tabs tabs="{{tabs}}" tabsName="activeTab" activeTab="{{activeTab}}" onTabClick="handleTabClick" swipeable={{false}}>
<block a:for="{{tabs}}">
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:if="{{index === 0}}">
<view>
<view class="page-section" a:for="{{warehouseList}}">
<container>
<view>
<flex>
<view class="form-row-label-left">订单编号: {{item.order}}</view>
<view class="form-row-label-right" a:if="{{item.actionState === 1}}">业务类型: 采购</view>
<view class="form-row-label-right" a:if="{{item.actionState === 2}}">业务类型: 借用</view>
<view class="form-row-label-right" a:if="{{item.actionState === 3}}">业务类型: 领用</view>
<view class="form-row-label-right" a:if="{{item.actionState === 4}}">业务类型: 调拨</view>
<view class="form-row-label-right" a:if="{{item.actionState === 6}}">业务类型: 维修</view>
<view class="form-row-label-right" a:if="{{item.actionState === 8}}">业务类型: 报废</view>
<view class="form-row-label-right" a:if="{{item.actionState === 13 || item.actionState === 14}}">业务类型: 本库借用</view>
</flex>
<flex>
<view class="form-row-label-left">装备名称: {{item.equipmentName}}</view>
<view class="form-row-label-right">型号名称: {{item.sizeName}}</view>
</flex>
<flex>
<view class="form-row-label-left">操作人: {{item.policeName}}</view>
<view class="form-row-label-right">出入库类型: {{item.outInState === 0 ? '出库' : '入库'}}</view>
</flex>
<flex>
<view class="form-row-label-left">操作时间: {{item.createTime}}</view>
<button type="primary" size="mini" onTap="showImage" data-row="{{item}}" a:if={{item.picUrl}}>预览</button>
</flex>
</view>
</container>
</view>
</view>
</tab-content>
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:elif="{{index === 1}}">
<view class="page-section" a:for="{{cabinetList}}">
<container>
<view>
<flex>
<view class="form-row-label-left">单警柜名称: {{item.cabinetName}}</view>
<view class="form-row-label-right">出入库类型: {{item.outInState === 0 ? '出库' : '入库'}}</view>
</flex>
<flex>
<view class="form-row-label-left">操作人员: {{item.policeName}}</view>
</flex>
<flex>
<view class="form-row-label-left">操作时间: {{item.createTime}}</view>
<button type="primary" size="mini" onTap="showInfo" data-id="{{item.id}}">查看</button>
<button type="primary" size="mini" onTap="showImage" data-row="{{item}}" style="margin-left: 20rpx" a:if={{item.picUrl}}>预览</button>
</flex>
</view>
</container>
</view>
</tab-content>
</block>
</tabs>
</scroll-view>
\ No newline at end of file
import dd from "gdt-jsapi";
import http from '../../src/http/index'
import util from '../../src/libs/util'
Page({
data: {
tabs: [
{ title: '仓库' },
{ title: '单警柜' }
],
warehouseList: [],
cabinetList: [],
activeTab: 0,
activeIndex: 1,
failIndex: 0,
steps: [],
items: [],
orderInfo: {},
controlled: true,
approvalMsg: '',
size: 8
},
onLoad(query) {
this.getWarehouseInOutHistory()
this.getCabinetList()
},
onPullDownRefresh() {
// 页面被下拉
this.getWarehouseInOutHistory();
this.getCabinetList()
setTimeout(() => {
dd.stopPullDownRefresh();
}, 100);
},
onScrollToLower(e) {
const _this = this
_this.setData({
size: _this.data.size + 8
})
if(this.data.activeTab === 0) {
this.getWarehouseInOutHistory()
} else if (this.data.activeTab === 1) {
this.getCabinetList()
}
},
getWarehouseInOutHistory () {
const _this = this
http.post('/api/Inventory/GetAllInOutHistory', {orgId: getApp().globalData.orgId || "B483A47A-0D9B-455C-B26A-FB0AEA3455D8", actionState: 0, page: 0, size: _this.data.size}).then(res => {
if (res.code === '10000') {
_this.setData({
warehouseList: res.data.content
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
getCabinetList () {
const _this = this
const queryParam = {orgId: getApp().globalData.orgId || "B483A47A-0D9B-455C-B26A-FB0AEA3455D8", actionState: 5, page: 0, size: _this.data.size}
http.post('/api/Inventory/GetAllInOutHistory', queryParam).then(res => {
if (res.code === '10000') {
_this.setData({
cabinetList: res.data.content
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
showImage(event) {
const picUrl = getApp().globalData.host + event.target.dataset.row.picUrl
const urls = [picUrl]
my.previewImage({
current: picUrl,
urls: urls
}).then(res => {
console.log(res)
}).catch(err => {
console.log(err)
})
},
handleTabClick({ index, tabsName }) {
this.setData({
[tabsName]: index
});
},
showInfo(event) {
let id = event.target.dataset.id
dd.navigateTo({
url: '../cabinetInfo/cabinetInfo?id=' + id
})
}
});
\ No newline at end of file
{
"usingComponents": {
"tabs": "mini-ali-ui/es/tabs/index",
"tab-content": "mini-ali-ui/es/tabs/tab-content/index",
"title": "mini-ali-ui/es/title/index",
"multi-liner": "mini-ali-ui/es/multi-liner/index",
"container": "mini-ali-ui/es/container/index",
"flex": "mini-ali-ui/es/flex/index",
"flex-item": "mini-ali-ui/es/flex/flex-item/index"
}
}
\ No newline at end of file
.warning {
margin-left: 12rpx;
background-color: #ffba00;
color: #fff
}
.footer {
display: block;
text-align: center;
}
\ No newline at end of file
<view class="page">
<view a:for="{{orderList}}" class="page-section">
<container title="{{item.flowName}}" thumb="../../src/assets/icon/{{item.flowName}}.png">
<view slot="operation"><button type="primary" size="mini" onTap="approve" data-row="{{item}}">审批</button></view>
<view class="item">
<view class="page-section-title">订单编号: {{item.orderNo}}</view>
<view class="page-section-title">目标仓库: {{item.warehouseName}}</view>
<view class="page-section-title">申请时间: {{item.createTime}}</view>
<view class="page-section-title">更新时间: {{item.updateTime}}</view>
</view>
</container>
</view>
</view>
import dd from 'gdt-jsapi';
import http from '../../src/http/index'
import util from '../../src/libs/util'
Page({
data: {
orderList: []
},
onLoad(query) {
// 下次得修复
if (getApp().globalData.userId) {
this.getTaskList()
} else {
getApp().cbLoginCallBack = res => {
if (res) {
this.getTaskList()
}
}
}
},
getTaskList() {
const _this = this
const params = { page: 0, size: 10, orgId: getApp().globalData.orgId, userId: getApp().globalData.userId, roleIds: getApp().globalData.roleIds };
// const params = { page: 0, size: 10, orgId: 'B483A47A-0D9B-455C-B26A-FB0AEA3455D8', userId: '40288a9d7aeace6c017b15b516240000', roleIds: [3] };
http.post('/api/Process/GetPageAllOrderList', params).then(res => {
if (res.code === '10000') {
_this.setData({
orderList: res.data.content
})
} else {
util.ddToast({ type: 'fail', text: '加载中....' })
}
})
},
onReady() {
// 页面加载完成
},
onShow() {
// 页面显示
// 下次得修复
if (getApp().globalData.userId) {
this.getTaskList()
} else {
getApp().cbLoginCallBack = res => {
if (res) {
this.getTaskList()
}
}
}
},
onHide() {
// 页面隐藏
},
onUnload() {
// 页面被关闭
},
onTitleClick() {
// 标题被点击
},
onPullDownRefresh() {
// 页面被下拉
this.getTaskList();
setTimeout(() => {
dd.stopPullDownRefresh();
}, 100);
},
approve (event) {
let id = event.target.dataset.row.orderId
switch (event.target.dataset.row.flowType) {
case 'purchase':
dd.navigateTo({
url: '../purchaseInfo/purchaseInfo?id=' + id
}); break
case 'borrowMy':
dd.navigateTo({
url: '../borrowMyInfo/borrowMyInfo?id=' + id
}); break
case 'repair':
dd.navigateTo({
url: '../repairInfo/repairInfo?id=' + id
}); break
case 'scrap':
dd.navigateTo({
url: '../scrapInfo/scrapInfo?id=' + id
}); break
case 'allocationUp':
dd.navigateTo({
url: '../transferInfo/transferInfo?id=' + id + '&flowType=' + event.target.dataset.row.flowType
}); break
case 'allocationDown':
dd.navigateTo({
url: '../transferInfo/transferInfo?id=' + id + '&flowType=' + event.target.dataset.row.flowType
}); break
default: break
}
},
onShareAppMessage() {
// 返回自定义分享信息
return {
title: 'My App',
desc: 'My App description',
path: 'pages/index/index',
};
},
});
{
"component": true,
"usingComponents": {
"container": "mini-ali-ui/es/container/index",
"title": "mini-ali-ui/es/title/index"
}
}
\ No newline at end of file
.page-sysdescription {
padding: 30rpx;
font-size: 34rpx;
}
.border-line {
border: 1rpx solid #f1f1f1;
}
\ No newline at end of file
<view>
<view>
<list class="hqy">
<list-item thumb="../../src/assets/logo.png" arrow="{{false}}" thumbSize="80px" upperSubtitle="用户职位: {{roleName}}" lowerSubtitle="手机号码: {{phone}}">用户名称: {{username}}</list-item>
</list>
<view class="page-section" style="margin-top: 20rpx">
<view class="page-sysdescription">系统版本: 1.0.0</view>
<view class="border-line"/>
<view class="page-sysdescription">手机型号: {{model}}</view>
<view class="border-line"/>
<view class="page-sysdescription">手机版本: {{version}}</view>
</view>
</view>
</view>
\ No newline at end of file
import dd from 'gdt-jsapi';
Page({
data: {
phone: '',
username: '',
model: '',
version: ''
},
onLoad() {
this.getSys()
},
onPullDownRefresh() {
// 页面被下拉
setTimeout(() => {
dd.stopPullDownRefresh();
}, 100);
},
getSys() {
this.setData({
username: getApp().globalData.username,
phone: getApp().globalData.phone,
roleName: getApp().globalData.roleIds.includes(2) ? '仓管员' : getApp().globalData.roleIds.includes(3) ? '审核员' : ''
})
dd.getSystemInfo({}).then(res => {
this.setData({
model: res.model,
version: res.version
})
}).catch(err => {})
}
});
{
"usingComponents":{
"list": "mini-ali-ui/es/list/index",
"list-item": "mini-ali-ui/es/list/list-item/index"
}
}
\ No newline at end of file
.am-title {
margin-top: 25rpx
}
.row {
display: flex;
align-items: center;
padding: 0 30rpx;
}
.row-title {
flex: 1;
padding-top: 28rpx;
padding-bottom: 28rpx;
font-size: 34rpx;
color: #000;
}
.row-extra {
flex-basis: initial;
font-size: 32rpx;
color: #888;
}
.row-arrow {
width: 32rpx;
height: 32rpx;
margin-left: 16rpx;
}
.button-submit {
padding: 30rpx;
}
.button-add {
padding: 10rpx 180rpx;
}
.border-line {
border: 1rpx solid #f1f1f1;
}
\ No newline at end of file
<view>
<tabs tabs="{{tabs}}" tabsName="activeTab" activeTab="{{activeTab}}" onTabClick="handleTabClick">
<block a:for="{{tabs}}">
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:if="{{index === 0}}">
<view>
<title>第一步: 选择仓库</title>
<view class="page-section">
<picker onChange="warehousePickerChange" value="{{waIndex}}" range="{{warehouseList}}" range-key="name">
<view class="row">
<view class="row-title">仓库</view>
<view class="row-extra">当前选择:{{warehouseList[waIndex].name}}</view>
</view>
</picker>
</view>
<title>第二步: 选择装备</title>
<view class="page-section">
<picker onChange="typePickerChange" value="{{typeIndex}}" range="{{typeList}}" range-key="name">
<view class="row">
<view class="row-title">装备类型</view>
<view class="row-extra">当前选择: {{typeList[typeIndex].name}}</view>
</view>
</picker>
<picker onChange="eqPickerChange" value="{{eqIndex}}" range="{{equipmentList}}" range-key="name">
<view class="row">
<view class="row-title">装备</view>
<view class="row-extra">当前选择: {{equipmentList[eqIndex].name}}</view>
</view>
</picker>
<picker onChange="sizePickerChange" value="{{sizeIndex}}" range="{{sizeList}}" range-key="sizeName">
<view class="row">
<view class="row-title">装备号型</view>
<view class="row-extra">当前选择: {{sizeList[sizeIndex].sizeName}}</view>
</view>
</picker>
<view class="border-line"/>
<view class="button-add"><button onTap="addEqu" style="background-color:#13ce66;color: #fff;">添加装备</button></view>
</view>
<title>已选择装备</title>
<block a:for="{{detailList}}">
<view class="page-section">
<flex>
<view class="form-row-label-left">装备名称: {{item.equipmentName}}</view>
<view class="form-row-label-right">装备号型: {{item.equipmentSizeName}}</view>
</flex>
<flex>
<view class="form-row-label-left" onTap="changeStepper" data-small="{{index}}"><stepper onChange="callBackFn" showNumber value="{{item.quantity}}" readOnly="{{true}}" min="{{1}}" max="{{item.sizeCount}}"/></view>
<view class="form-row-label-right"><button type="warn" size="mini" onTap="delete" data-index="{{index}}">删除</button></view>
</flex>
</view>
</block>
<multi-liner placeholder="请输入采购原因" value="{{note}}" onInput="onInput" last="{{true}}" auto-height="{{true}}" controlled="{{controlled}}"/>
<view class="button-submit"><button type="primary" onTap="submit">提交</button></view>
</view>
</tab-content>
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:elif="{{index === 1}}">
<view>
<steps className="demo-steps-class" activeIndex="{{activeIndex}}" failIndex="{{failIndex}}" items="{{steps}}"></steps>
<title>审核详情</title>
<block a:for="{{items}}">
<view class="page-section">
<flex>
<view class="form-row-label-left">步骤名称: {{item.stepName}}</view>
<view class="form-row-label-right">审核人: {{item.auditUserName}}</view>
</flex>
<flex>
<view class="form-row-label-left">操作时间: {{item.updateTime}}</view>
<view class="form-row-label-right">审核意见: {{item.auditMind ? item.auditMind : '无'}}</view>
</flex>
</view>
</block>
</view>
</tab-content>
</block>
</tabs>
</view>
\ No newline at end of file
import dd from 'gdt-jsapi';
import http from '/src/http';
import util from '/src/libs/util'
Page({
data: {
tabs: [
{ title: '采购信息' },
{ title: '流程信息' }
],
activeTab: 0,
activeIndex: 1,
failIndex: 1,
steps: [],
items: [],
warehouseList: [],
typeList: [],
equipmentList: [],
sizeList: [],
note: '',
controlled: true,
num: 1,
detailList: [],
orderInfo: {},
processForm: {},
equName: null
},
onLoad(query) {
this.getListOrgWarehouse()
this.getTypeList()
this.getProcess(query.nextStepId)
if (query.id) {
this.getById(query.id)
}
},
getListOrgWarehouse() {
this.data.detailList = []
http.post('/api/Warehouse/GetListOrgWarehouse', {orgizationId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40"}).then(res => {
this.setData({
warehouseList: res.data
})
})
},
getTypeList() {
http.post('/api/EquipmentInfo/GetListEquipment', {}).then(res => {
this.setData({
typeList: res.data
})
})
},
getListEquipment() {
http.postNoSign('/api/EquipmentDetail/GetListEquipmentDetail', {equipmentId: this.data.typeList[this.data.typeIndex].id}).then(res => {
this.setData({
equipmentList: res.data
})
})
},
warehousePickerChange(e) {
this.setData({
waIndex: e.detail.value,
})
},
typePickerChange(e) {
this.setData({
typeIndex: e.detail.value,
})
this.getListEquipment()
},
eqPickerChange(e) {
this.setData({
eqIndex: e.detail.value,
})
this.getSizeList()
},
sizePickerChange(e) {
this.setData({
sizeIndex: e.detail.value,
})
this.getListEquipment()
},
getSizeList() {
http.post('/api/EquipmentSize/GetListEquipmentSize', {detailId: this.data.equipmentList[this.data.eqIndex].id}).then(res => {
this.setData({
sizeList: res.data
})
})
},
getProcess (nextStepId) {
const _this = this
const params = {
code: "purchase",
orgId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40",
stepId: nextStepId || "",
flowGateway: ""
}
http.post('/api/Process/GetProcess', params).then(res => {
if(res.code === "10000") {
_this.data.processForm = {
currentStepName: res.data.currentStepName,
dataScope: res.data.dataScope,
flowId: res.data.flowId,
flowName: res.data.flowName,
flowState: res.data.flowState,
flowType: res.data.flowType,
nextStepId: res.data.nextStepId,
orgId: res.data.orgId,
userInfo: res.data.userInfo,
userType: res.data.userType
}
}
})
http.post('/api/Process/GetAllProcess', {code: "purchase", orgId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40"}).then(res => {
if (res.code === '10000') {
var arr = []
res.data.forEach(element => {
arr.push({ title: element })
})
_this.setData({
steps: arr
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
getById (id) {
const _this = this
http.post('/api/PuchaseOrder/GetByID', {id: id}).then(res => {
if (res.code === '10000') {
_this.setData({
items: res.data.historyList,
orderInfo: res.data,
detailList: res.data.detailList,
waIndex: _this.data.warehouseList.findIndex((value)=>value.id === res.data.warehouseId),
activeIndex: res.data.flowState ? _this.data.steps.length : _this.data.steps.findIndex(i => i.title === res.data.currentStepName) + 1
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
handleTabClick({ index, tabsName }) {
this.setData({
[tabsName]: index
});
},
onInput (e) {
this.setData({
note: e.detail.value
});
},
addEqu() {
var result = this.data.detailList.filter(item => item.equipmentId === this.data.equipmentList[this.data.eqIndex].id)
if(this.data.eqIndex == undefined) {
util.ddToast({ type: 'fail', text: '请选择装备' })
} else if(result.length > 0) {
util.ddToast({ type: 'fail', text: '已添加过该装备' })
} else {
var detailList = this.data.detailList;
let row = {
id: '',
equipmentName : this.data.equipmentList[this.data.eqIndex].name,
equipmentSizeName: this.data.sizeList[this.data.sizeIndex].sizeName,
equipmentId : this.data.equipmentList[this.data.eqIndex].id,
equipmentSizeId : this.data.sizeList[this.data.sizeIndex].id,
quantity : 1
}
detailList.unshift(row)
this.setData({
detailList: detailList
})
}
},
delete(e) {
var detailList = this.data.detailList;
detailList.splice(e.target.dataset.index, 1)
this.setData({
detailList: detailList
})
},
callBackFn(value) {
this.setData({
num: value
})
},
changeStepper(e) {
const small = e.target.dataset.small
this.setData({
["detailList["+small+"].quantity"]: this.data.num
})
},
submit() {
if (this.data.waIndex === undefined) {
util.ddToast({ type: 'success', text: '请选择仓库' })
} else if (this.data.detailList.length < 1) {
util.ddToast({ type: 'fail', text: '请至少添加一件装备' })
} else {
const queryParam = {
id: this.data.orderInfo.id || '',
warehouseId: this.data.warehouseList[this.data.waIndex].id,
note: this.data.note,
applyId: getApp().globalData.userId || "10",
applyName: getApp().globalData.username || '测试',
detailList: this.data.detailList,
orgId: getApp().globalData.orgId || 'E05CC28D-C189-4389-8081-DD0D6E483B40',
orgCode: getApp().globalData.code || '330200'
}
let form = { ...queryParam, ...this.data.processForm }
http.post('/api/PuchaseOrder/AddOrUpdatePurchase', form).then(res => {
if (res.code === "10000") {
util.ddToast({ type: 'success', text: res.msg })
dd.navigateBack({})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
}
}
});
{
"usingComponents": {
"tabs": "mini-ali-ui/es/tabs/index",
"tab-content": "mini-ali-ui/es/tabs/tab-content/index",
"steps": "mini-ali-ui/es/steps/index",
"title": "mini-ali-ui/es/title/index",
"multi-liner": "mini-ali-ui/es/multi-liner/index",
"flex": "mini-ali-ui/es/flex/index",
"stepper": "mini-ali-ui/es/stepper/index"
}
}
\ No newline at end of file
.am-title {
padding:var(--am-title-paddingLR,12px) var(--am-title-paddingB,12px)
}
.demo-steps-class {
margin-bottom: 20rpx;
}
.am-tabs-content-wrap {
background-color:#f1f1f1
}
.form-row {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
padding: 0 30rpx;
margin-top: 15rpx;
background-color:#fff
}
.form-row-label {
width: 45%;
font-size: 26rpx;
margin: 10rpx;
text-align: left;
color: #000;
}
.form-row-label-single {
width: 45%;
padding: 20rpx 10rpx;
font-size: 26rpx;
text-align: left;
color: #000;
}
.form-line {
height: 1px;
background-color: #ddd;
margin-left: 30rpx;
}
.button-center {
display: block;
text-align: center;
}
button {
margin-top: 20rpx;
}
<view>
<tabs tabs="{{tabs}}" tabsName="activeTab" activeTab="{{activeTab}}" onTabClick="handleTabClick" swipeable={{false}}>
<block a:for="{{tabs}}">
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:if="{{index === 0}}">
<view>
<title style="margin-top: 20rpx">基本信息</title>
<view class="form-row">
<view class="form-row-label-single">采购单号:</view>
<view class="form-row-label-single">{{orderInfo.orderCode}} </view>
<view class="form-row-label-single">目标仓库:</view>
<view class="form-row-label-single">{{orderInfo.warehouseName}}</view>
<view class="form-row-label-single">订单状态:</view>
<view class="form-row-label-single" a:if="{{orderInfo.flowState}}">已通过</view>
<view class="form-row-label-single" a:if="{{!orderInfo.flowState && orderInfo.userInfo !== ''}}">待审批</view>
<view class="form-row-label-single" a:if="{{!orderInfo.flowState && orderInfo.actionResult === '0'}}">撤销</view>
<view class="form-row-label-single" a:if="{{!orderInfo.flowState && orderInfo.userInfo === ''}}">已驳回</view>
<view class="form-row-label-single">申请人:</view>
<view class="form-row-label-single">{{orderInfo.applyName}}</view>
<view class="form-row-label-single">申请时间:</view>
<view class="form-row-label-single">{{orderInfo.applyTime}}</view>
<view class="form-row-label-single">更新时间:</view>
<view class="form-row-label-single">{{orderInfo.updateTime}}</view>
<view class="form-row-label-single">申请理由:</view>
<view class="form-row-label-single">{{orderInfo.note ? orderInfo.note : '无'}}</view>
</view>
<title style="margin-top: 20rpx">装备信息</title>
<view class="page-section" a:for="{{orderInfo.detailList}}">
<flex>
<view class="form-row-label-left">装备名称: {{item.equipmentName}}</view>
<view class="form-row-label-right">装备号型: {{item.equipmentSizeName}}</view>
</flex>
<view class="form-row-label-left">装备数量: {{item.quantity}}</view>
</view>
</view>
</tab-content>
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:elif="{{index === 1}}">
<view>
<steps className="demo-steps-class" activeIndex="{{activeIndex}}" failIndex="{{failIndex}}" items="{{steps}}"></steps>
<title>审核详情</title>
<block a:for="{{items}}">
<view class="page-section">
<flex>
<view class="form-row-label-left">步骤名称: {{item.stepName}}</view>
<view class="form-row-label-right">审核人: {{item.auditUserName}}</view>
</flex>
<flex>
<view class="form-row-label-left">操作时间: {{item.updateTime}}</view>
<view class="form-row-label-right">审核意见: {{item.auditMind ? item.auditMind : '无'}}</view>
</flex>
</view>
</block>
</view>
</tab-content>
</block>
</tabs>
<view a:if={{!type}}>
<title>审核意见</title>
<multi-liner placeholder="请输入审核意见" value="{{approvalMsg}}" onInput="onInput" last="{{true}}" auto-height="{{true}}" controlled="{{controlled}}"/>
<view class="button-center">
<button type="warn" size="mini" onTap="agree" data-result="no">不通过</button>
<button type="primary" size="mini" style="margin-left: 20rpx" onTap="agree" data-result="yes">通过</button>
</view>
</view>
</view>
\ No newline at end of file
import dd from "gdt-jsapi";
import http from '../../src/http/index'
import util from '../../src/libs/util'
Page({
data: {
tabs: [
{ title: '采购信息' },
{ title: '流程信息' }
],
activeTab: 0,
activeIndex: 1,
failIndex: 0,
steps: [],
items: [],
orderInfo: {},
controlled: true,
approvalMsg: '',
type: ''
},
onLoad(query) {
this.getAllProcess()
this.getById(query.id)
this.setData({
type: query.type
})
},
getAllProcess (id) {
const _this = this
http.post('/api/Process/GetAllProcess', {code: "purchase", orgId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40"}).then(res => {
if (res.code === '10000') {
var arr = []
res.data.forEach(element => {
arr.push({ title: element })
})
_this.setData({
steps: arr
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
getById (id) {
const _this = this
http.post('/api/PuchaseOrder/GetByID', {id: id}).then(res => {
if (res.code === '10000') {
_this.setData({
items: res.data.historyList,
orderInfo: res.data,
activeIndex: res.data.flowState ? _this.data.steps.length : _this.data.steps.findIndex(i => i.title === res.data.currentStepName) + 1
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
handleTabClick({ index, tabsName }) {
this.setData({
[tabsName]: index
});
},
onInput (e) {
this.setData({
approvalMsg: e.detail.value,
});
},
async agree (event) {
const result = event.target.dataset.result
const _this = this
var data = {
code: _this.data.orderInfo.flowType,
orgId: _this.data.orderInfo.orgId,
stepId: _this.data.orderInfo.nextStepId,
flowGateway: result === 'no' ? "不同意" : "同意"
}
let form = {}
await http.post('/api/Process/GetProcess', data).then(res => {
if (res.code === '10000') {
form = {
id: _this.data.orderInfo.id,
detailList: _this.data.orderInfo.detailList,
orgId : getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40",
flowState : res.data.flowState,
approvalMsg : _this.data.approvalMsg || data.flowGateway,
warehouseId: _this.data.orderInfo.warehouseId,
userType: res.data.userType,
userInfo: res.data.userInfo,
dataScope: res.data.dataScope,
nextStepId: res.data.nextStepId,
currentStepName: res.data.currentStepName,
auditUser: getApp().globalData.userId || "11",
auditUserName: getApp().globalData.username || "测试",
targetWarehouseID: _this.data.orderInfo.warehouseId
}
}
})
await http.post('/api/PuchaseOrder/ApproveOrder', form).then(res => {
if (res.code === "10000") {
util.ddToast({ type: 'success', text: res.msg })
dd.navigateBack({})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
}
});
\ No newline at end of file
{
"usingComponents": {
"tabs": "mini-ali-ui/es/tabs/index",
"tab-content": "mini-ali-ui/es/tabs/tab-content/index",
"steps": "mini-ali-ui/es/steps/index",
"title": "mini-ali-ui/es/title/index",
"multi-liner": "mini-ali-ui/es/multi-liner/index",
"flex": "mini-ali-ui/es/flex/index"
}
}
\ No newline at end of file
.am-title {
padding:var(--am-title-paddingLR,12px) var(--am-title-paddingB,12px)
}
.demo-steps-class {
margin-bottom: 20rpx;
}
.am-tabs-content-wrap {
background-color:#f1f1f1
}
.form-row-label-left {
flex: 2;
padding: 15rpx 8rpx;
font-size: 26rpx;
text-align: left;
color: #000;
}
.form-row-label-right {
flex: 1;
padding: 15rpx 8rpx;
font-size: 26rpx;
text-align: right;
color: #000;
}
.page-content {
background-color:#f1f1f1
}
.am-container {
margin-bottom: 15rpx
}
<scroll-view scroll-y="{{true}}" enable-back-to-top="{{true}}" style="height: 100vh;" onScrollToLower="onScrollToLower">
<tabs tabs="{{tabs}}" tabsName="activeTab" activeTab="{{activeTab}}" onTabClick="handleTabClick" swipeable={{false}}>
<block a:for="{{tabs}}">
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:if="{{index === 0}}">
<view>
<view class="{{applyList.length - 1 === index && index > 4 ? 'page-section-final' : 'page-section'}}" a:for="{{applyList}}">
<container>
<view>
<flex>
<view class="form-row-label-left">采购单号: {{item.orderCode}}</view>
<view class="form-row-label-right" a:if="{{item.flowState}}">状态: 已通过</view>
<view class="form-row-label-right" a:elif="{{!item.flowState && item.userInfo !== ''}}">状态: 待审批</view>
<view class="form-row-label-right" a:elif="{{!item.flowState && item.actionResult === '0'}}">状态: 撤销</view>
<view class="form-row-label-right" a:elif="{{!item.flowState && item.userInfo === ''}}">状态: 已驳回</view>
</flex>
<flex>
<view class="form-row-label-left">目标仓库: {{item.warehouseName}}</view>
<view class="form-row-label-right">申请人: {{item.applyName}}</view>
</flex>
<flex>
<view class="form-row-label-left">申请时间: {{item.applyTime}}</view>
<button type="primary" size="mini" onTap="showInfo" data-id="{{item.id}}">查看</button>
<button size="mini" onTap="edit" data-row="{{item}}" a:if="{{!item.flowState && item.userInfo === ''}}"
style="margin-left: 10rpx;background-color:#ffba00;color: #fff">编辑</button>
<button type="warn" size="mini" onTap="back" data-row="{{item}}" a:if="{{!item.flowState && item.userInfo !== ''}}"
style="margin-left: 10rpx">撤销</button>
</flex>
</view>
</container>
</view>
</view>
</tab-content>
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:elif="{{index === 1}}">
<view class="{{list.length-1 === index && index > 4 ? 'page-section-final' : 'page-section'}}" a:for="{{list}}">
<container>
<view>
<flex>
<view class="form-row-label-left">采购单号: {{item.orderCode}}</view>
<view class="form-row-label-right" a:if="{{item.flowState}}">状态: 已通过</view>
<view class="form-row-label-right" a:if="{{!item.flowState && item.userInfo !== ''}}">状态: 待审批</view>
<view class="form-row-label-right" a:if="{{!item.flowState && item.actionResult === 0}}">状态: 撤销</view>
<view class="form-row-label-right" a:if="{{!item.flowState && item.userInfo === ''}}">状态: 已驳回</view>
</flex>
<flex>
<view class="form-row-label-left">目标仓库: {{item.warehouseName}}</view>
<view class="form-row-label-right">申请人: {{item.applyName}}</view>
</flex>
<flex>
<view class="form-row-label-left">申请时间: {{item.applyTime}}</view>
<button type="primary" size="mini" onTap="showInfo" data-id="{{item.id}}">查看</button>
</flex>
</view>
</container>
</view>
</tab-content>
</block>
</tabs>
<button class="page-add" onTap="openAdd">采购申请</button>
</scroll-view>
\ No newline at end of file
import dd from "gdt-jsapi";
import http from '../../src/http/index'
import util from '../../src/libs/util'
Page({
data: {
tabs: [
{ title: '采购申请' },
{ title: '采购列表' }
],
applyList: [],
list: [],
activeTab: 0,
activeIndex: 1,
failIndex: 0,
steps: [],
items: [],
orderInfo: {},
controlled: true,
approvalMsg: '',
size: 8
},
onLoad(query) {
this.getApply()
this.getList()
},
onPullDownRefresh() {
// 页面被下拉
this.getApply();
this.getList();
setTimeout(() => {
dd.stopPullDownRefresh();
}, 100);
},
onShow() {
// 页面显示
this.getApply();
this.getList();
},
getApply () {
const _this = this
http.post('/api/puchaseOrder/GetAllPurchases', {orgId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40", applyId: getApp().globalData.userId || "10",
actionType: 0, page: 0, size: _this.data.size, approveType: 3}).then(res => {
if (res.code === '10000') {
_this.setData({
applyList: res.data.content
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
getList () {
const _this = this
const queryParam = {orgId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40", flowType: "purchase" , userId: getApp().globalData.userId || '11',
roleIds: getApp().globalData.roleIds || [3], page: 0, size: _this.data.size, approveType: 3 }
http.post('/api/Process/GetPageHistoryProcessList', queryParam).then(res => {
if (res.code === '10000') {
_this.setData({
list: res.data.content
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
onScrollToLower(e) {
const _this = this
_this.setData({
size: _this.data.size + 8
})
if(this.data.activeTab === 0) {
this.getApply()
} else if (this.data.activeTab === 1) {
this.getList()
}
},
openAdd() {
dd.navigateTo({
url: '../purchaseAdd/purchaseAdd'
})
},
handleTabClick({ index, tabsName }) {
this.setData({
[tabsName]: index
});
},
showInfo(event) {
let id = event.target.dataset.id
dd.navigateTo({
url: '../purchaseInfo/purchaseInfo?id=' + id + '&type=2'
})
},
edit(event) {
let id = event.target.dataset.row.id
let nextStepId = event.target.dataset.row.nextStepId
dd.navigateTo({
url: '../purchaseAdd/purchaseAdd?id=' + id + '&nextStepId=' + nextStepId
})
},
back(event) {
let row = event.target.dataset.row
dd.confirm({
title: "确定撤销吗",
buttonLabels: [
"确定",
"取消"
],
}).then(res => {
if (res.buttonIndex === 0) {
this.confirmBack(row)
}
})
},
async confirmBack(row) {
const _this = this
var data = {
code: row.flowType,
orgId: row.orgId,
stepId: row.nextStepId,
flowGateway: "撤销"
}
let form = {}
await http.post('/api/Process/GetProcess', data).then(res => {
if (res.code === '10000') {
form = {
id: row.id,
detailList: row.detailList,
orgId : getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40",
flowState : res.data.flowState,
approvalMsg : data.flowGateway,
userType: res.data.userType,
userInfo: res.data.userInfo,
dataScope: res.data.dataScope,
nextStepId: res.data.nextStepId,
currentStepName: res.data.currentStepName,
auditUser: getApp().globalData.userId || "10",
auditUserName: getApp().globalData.username || "测试"
}
}
})
await http.post('/api/PuchaseOrder/ApproveOrder', form).then(res => {
if (res.code === "10000") {
util.ddToast({ type: 'success', text: res.msg })
_this.getApply()
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
}
});
\ No newline at end of file
{
"usingComponents": {
"tabs": "mini-ali-ui/es/tabs/index",
"tab-content": "mini-ali-ui/es/tabs/tab-content/index",
"title": "mini-ali-ui/es/title/index",
"multi-liner": "mini-ali-ui/es/multi-liner/index",
"container": "mini-ali-ui/es/container/index",
"flex": "mini-ali-ui/es/flex/index",
"flex-item": "mini-ali-ui/es/flex/flex-item/index"
}
}
\ No newline at end of file
.am-title {
margin-top: 25rpx
}
.row {
display: flex;
align-items: center;
padding: 0 30rpx;
}
.row-title {
flex: 1;
padding-top: 28rpx;
padding-bottom: 28rpx;
font-size: 34rpx;
color: #000;
}
.row-extra {
flex-basis: initial;
font-size: 32rpx;
color: #888;
}
.row-arrow {
width: 32rpx;
height: 32rpx;
margin-left: 16rpx;
}
.button-submit {
padding: 30rpx;
}
.button-add {
padding: 10rpx 180rpx;
}
.border-line {
border: 1rpx solid #f1f1f1;
}
\ No newline at end of file
<view>
<title>第一步: 选择仓库</title>
<view class="page-section">
<picker onChange="warehousePickerChange" value="{{index}}" range="{{warehouseList}}" range-key="name">
<view class="row">
<view class="row-title">仓库</view>
<view class="row-extra">当前选择:{{warehouseList[index].name}}</view>
</view>
</picker>
</view>
<title>第二步: 选择装备</title>
<view class="page-section">
<picker onChange="eqPickerChange" value="{{eqIndex}}" range="{{equipmentList}}" range-key="equipmentDetailName">
<view class="row">
<view class="row-title">装备</view>
<view class="row-extra">当前选择:{{equipmentList[eqIndex].equipmentDetailName}}</view>
</view>
</picker>
<view class="border-line"/>
<view class="button-add"><button onTap="addEqu" style="background-color:#13ce66;color: #fff;">添加装备</button></view>
</view>
<title>已选择装备</title>
<block a:for="{{detailList}}">
<view class="page-section">
<flex>
<view class="form-row-label-left">装备名称: {{item.equipmentName}}</view>
<view class="form-row-label-right">库存: {{item.sizeCount}}</view>
</flex>
<flex>
<view class="form-row-label-left" onTap="changeStepper" data-small="{{index}}"><stepper onChange="callBackFn" showNumber value="{{item.quantity}}" readOnly="{{true}}" min="{{1}}" max="{{item.sizeCount}}"/></view>
<view class="form-row-label-right"><button type="warn" size="mini" onTap="delete" data-index="{{index}}">删除</button></view>
</flex>
</view>
</block>
<multi-liner placeholder="请输入领用原因" value="{{note}}" onInput="onInput" last="{{true}}" auto-height="{{true}}" controlled="{{controlled}}"/>
<view class="button-submit"><button type="primary" onTap="submit">提交</button></view>
</view>
\ No newline at end of file
import dd from 'gdt-jsapi';
import http from '/src/http';
import util from '/src/libs/util'
Page({
data: {
warehouseList: [],
equipmentList: [],
note: '',
controlled: true,
num: 1,
detailList: []
},
onLoad() {
this.getListOrgWarehouse()
},
getListOrgWarehouse() {
this.data.detailList = []
http.post('/api/Warehouse/GetListOrgWarehouse', {orgizationId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40"}).then(res => {
this.setData({
warehouseList: res.data
})
})
},
warehousePickerChange(e) {
this.setData({
index: e.detail.value,
})
this.getAllInventoryList(e.detail.value)
},
getAllInventoryList(index) {
http.post('/api/Inventory/GetAllInventoryList', {warehouseId: this.data.warehouseList[index].id}).then(res => {
this.setData({
equipmentList: res.data
})
})
},
eqPickerChange(e) {
this.setData({
eqIndex: e.detail.value,
})
},
onInput (e) {
this.setData({
note: e.detail.value
});
},
addEqu() {
var result = this.data.detailList.filter(item => item.equipmentDetailId === this.data.equipmentList[this.data.eqIndex].equipmentDetailId)
if(this.data.eqIndex == undefined) {
util.ddToast({ type: 'fail', text: '请选择装备' })
} else if(result.length > 0) {
util.ddToast({ type: 'fail', text: '已添加过该装备' })
} else {
var detailList = this.data.detailList;
let row = {
estimateId : "",
equipmentName : this.data.equipmentList[this.data.eqIndex].equipmentDetailName,
equipmentDetailId : this.data.equipmentList[this.data.eqIndex].equipmentDetailId,
sizeCount: this.data.equipmentList[this.data.eqIndex].detailCount,
quantity : 1
}
detailList.unshift(row)
this.setData({
detailList: detailList
})
}
},
delete(e) {
var detailList = this.data.detailList;
detailList.splice(e.target.dataset.index, 1)
this.setData({
detailList: detailList
})
},
callBackFn(value) {
this.setData({
num: value
})
},
changeStepper(e) {
const small = e.target.dataset.small
this.setData({
["detailList["+small+"].quantity"]: this.data.num
})
},
submit() {
const queryParam = {
warehouseId: this.data.warehouseList[this.data.index].id,
note: this.data.note,
applyId: getApp().globalData.userId || "10",
applyName: getApp().globalData.username || '测试',
detailList: this.data.detailList,
orgId: getApp().globalData.orgId || 'E05CC28D-C189-4389-8081-DD0D6E483B40',
orgCode: getApp().globalData.code || '330200'
}
http.post('/api/Borrow/AddAndApprovalBorrowOrder', queryParam).then(res => {
if (res.code === "10000") {
util.ddToast({ type: 'success', text: res.msg })
dd.navigateBack({})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
}
});
{
"usingComponents": {
"title": "mini-ali-ui/es/title/index",
"multi-liner": "mini-ali-ui/es/multi-liner/index",
"flex": "mini-ali-ui/es/flex/index",
"stepper": "mini-ali-ui/es/stepper/index"
}
}
\ No newline at end of file
.am-title {
padding:var(--am-title-paddingLR,12px) var(--am-title-paddingB,12px)
}
.demo-steps-class {
margin-bottom: 20rpx;
}
.am-tabs-content-wrap {
background-color:#f1f1f1
}
.form-row {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
padding: 0 30rpx;
margin-top: 15rpx;
background-color:#fff
}
.form-row-label-single {
width: 45%;
padding: 20rpx 10rpx;
font-size: 26rpx;
text-align: left;
color: #000;
}
.form-line {
height: 1px;
background-color: #ddd;
margin-left: 30rpx;
}
.button-center {
display: block;
text-align: center;
}
button {
margin-top: 20rpx;
}
\ No newline at end of file
<view>
<tabs tabs="{{tabs}}" tabsName="activeTab" activeTab="{{activeTab}}" onTabClick="handleTabClick">
<block a:for="{{tabs}}">
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:if="{{index === 0}}">
<view>
<title style="margin-top: 20rpx">基本信息</title>
<view class="form-row">
<view class="form-row-label-single">领用单号:</view>
<view class="form-row-label-single">{{orderInfo.orderCode}} </view>
<view class="form-row-label-single">目标仓库:</view>
<view class="form-row-label-single">{{orderInfo.warehouseName}}</view>
<view class="form-row-label-single">申请人:</view>
<view class="form-row-label-single">{{orderInfo.applyName}}</view>
<view class="form-row-label-single">申请时间:</view>
<view class="form-row-label-single">{{orderInfo.applyTime}}</view>
<view class="form-row-label-single">申请理由:</view>
<view class="form-row-label-single">{{orderInfo.note ? orderInfo.note : '无'}}</view>
</view>
<title style="margin-top: 20rpx">装备信息</title>
<view class="page-section" a:for="{{orderInfo.detailList}}">
<flex>
<view class="form-row-label-left">装备名称: {{item.equipmentName}}</view>
</flex>
<flex>
<view class="form-row-label-left">装备数量: {{item.quantity}}</view>
</flex>
</view>
</view>
</tab-content>
</block>
</tabs>
</view>
\ No newline at end of file
import dd from "gdt-jsapi";
import http from '../../src/http/index'
import util from '../../src/libs/util'
Page({
data: {
tabs: [
{ title: '领用信息' }
],
activeTab: 0,
activeIndex: 1,
failIndex: 0,
steps: [],
items: [],
orderInfo: {}
},
onLoad(query) {
this.getById(query.id)
},
getById (id) {
const _this = this
http.post('/api/Borrow/GetByID', {id: id}).then(res => {
if (res.code === '10000') {
_this.setData({
items: res.data.historyList,
orderInfo: res.data
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
handleTabClick({ index, tabsName }) {
this.setData({
[tabsName]: index
});
},
onInput (e) {
this.setData({
approvalMsg: e.detail.value,
});
}
});
\ No newline at end of file
{
"usingComponents": {
"tabs": "mini-ali-ui/es/tabs/index",
"tab-content": "mini-ali-ui/es/tabs/tab-content/index",
"steps": "mini-ali-ui/es/steps/index",
"title": "mini-ali-ui/es/title/index",
"multi-liner": "mini-ali-ui/es/multi-liner/index",
"flex": "mini-ali-ui/es/flex/index"
}
}
\ No newline at end of file
.am-title {
padding:var(--am-title-paddingLR,12px) var(--am-title-paddingB,12px)
}
.demo-steps-class {
margin-bottom: 20rpx;
}
.am-tabs-content-wrap {
background-color:#f1f1f1
}
.form-row-label-left {
flex: 2;
padding: 15rpx 8rpx;
font-size: 26rpx;
text-align: left;
color: #000;
}
.form-row-label-right {
flex: 1;
padding: 15rpx 8rpx;
font-size: 26rpx;
text-align: right;
color: #000;
}
.page-content {
background-color:#f1f1f1
}
.am-container {
margin-bottom: 15rpx
}
<scroll-view scroll-y="{{true}}" enable-back-to-top="{{true}}" style="height: 100vh;" onScrollToLower="onScrollToLower">
<button class="page-add" onTap="openAdd">领用申请</button>
<view class="{{list.length-1 === index && index > 4 ? 'page-section-final' : 'page-section'}}" a:for="{{list}}">
<container>
<view>
<flex>
<view class="form-row-label-left">领用单号: {{item.orderCode}}</view>
</flex>
<flex>
<view class="form-row-label-left">目标仓库: {{item.warehouseName}}</view>
<view class="form-row-label-right">创建人: {{item.applyName}}</view>
</flex>
<flex>
<view class="form-row-label-left">申请时间: {{item.applyTime}}</view>
<button type="primary" size="mini" onTap="showInfo" data-row="{{item}}">查看</button>
<!-- <button size="mini" onTap="edit" data-row="{{item}}" style="margin-left: 10rpx;background-color:#ffba00;color: #fff">编辑</button> -->
<button type="warn" size="mini" onTap="delete" data-id="{{item.id}}" disabled="{{item.changeFlag === 1}}" style="margin-left: 10rpx">删除</button>
</flex>
</view>
</container>
</view>
</scroll-view>>
\ No newline at end of file
import dd from "gdt-jsapi";
import http from '../../src/http/index'
import util from '../../src/libs/util'
Page({
data: {
list: [],
activeTab: 0,
activeIndex: 1,
failIndex: 0,
items: [],
orderInfo: {},
size: 8
},
onLoad(query) {
this.getList()
},
onPullDownRefresh() {
// 页面被下拉
this.getList();
setTimeout(() => {
dd.stopPullDownRefresh();
}, 100);
},
onShow() {
// 页面显示
this.getList()
},
getList () {
const _this = this
const queryParam = {orgId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40", actionType: 1, applyId: getApp().globalData.userId || '10',
page: 0, size: _this.data.size }
http.post('/api/Borrow/GetAllBorrowOrderList', queryParam).then(res => {
if (res.code === '10000') {
_this.setData({
list: res.data.content
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
onScrollToLower(e) {
const _this = this
_this.setData({
size: _this.data.size + 8
})
this.getList()
},
handleTabClick({ index, tabsName }) {
this.setData({
[tabsName]: index
});
},
showInfo(event) {
let id = event.target.dataset.row.id
dd.navigateTo({
url: '../receiveInfo/receiveInfo?id=' + id
})
},
openAdd() {
dd.navigateTo({
url: '../receiveAdd/receiveAdd'
})
},
edit() {
},
delete(event) {
let id = event.target.dataset.id
dd.confirm({
title: "确定删除吗",
buttonLabels: [
"确定",
"取消"
],
}).then(res => {
if (res.buttonIndex === 0) {
http.post('/api/Borrow/DeleteOrder', {id: id}).then(res => {
if (res.code === '10000') {
util.ddToast({ type: 'success', text: '删除成功' })
this.getList()
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
}
})
}
});
\ No newline at end of file
{
"usingComponents": {
"title": "mini-ali-ui/es/title/index",
"container": "mini-ali-ui/es/container/index",
"flex": "mini-ali-ui/es/flex/index",
"flex-item": "mini-ali-ui/es/flex/flex-item/index"
}
}
\ No newline at end of file
.am-title {
padding:var(--am-title-paddingLR,12px) var(--am-title-paddingB,12px)
}
.demo-steps-class {
margin-bottom: 20rpx;
}
.am-tabs-content-wrap {
background-color:#f1f1f1
}
.form-row {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
padding: 0 30rpx;
margin-top: 15rpx;
background-color:#fff
}
.form-row-label {
width: 45%;
font-size: 26rpx;
margin: 10rpx;
text-align: left;
color: #000;
}
.form-row-label-single {
width: 45%;
padding: 20rpx 10rpx;
font-size: 26rpx;
text-align: left;
color: #000;
}
.form-line {
height: 1px;
background-color: #ddd;
margin-left: 30rpx;
}
.button-center {
display: block;
text-align: center;
}
button {
margin-top: 20rpx;
}
<view>
<tabs tabs="{{tabs}}" tabsName="activeTab" activeTab="{{activeTab}}" onTabClick="handleTabClick" swipeable={{false}}>
<block a:for="{{tabs}}">
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:if="{{index === 0}}">
<view>
<title style="margin-top: 20rpx">基本信息</title>
<view class="form-row">
<view class="form-row-label-single">维修单号:</view>
<view class="form-row-label-single">{{orderInfo.orderCode}} </view>
<view class="form-row-label-single">目标仓库:</view>
<view class="form-row-label-single">{{orderInfo.warehouseName}}</view>
<view class="form-row-label-single">订单状态:</view>
<view class="form-row-label-single" a:if="{{orderInfo.flowState}}">已通过</view>
<view class="form-row-label-single" a:if="{{!orderInfo.flowState && orderInfo.userInfo !== ''}}">待审批</view>
<view class="form-row-label-single" a:if="{{!orderInfo.flowState && orderInfo.actionResult === '0'}}">撤销</view>
<view class="form-row-label-single" a:if="{{!orderInfo.flowState && orderInfo.userInfo === ''}}">已驳回</view>
<view class="form-row-label-single">申请人:</view>
<view class="form-row-label-single">{{orderInfo.applyName}}</view>
<view class="form-row-label-single">申请时间:</view>
<view class="form-row-label-single">{{orderInfo.applyTime}}</view>
<view class="form-row-label-single">更新时间:</view>
<view class="form-row-label-single">{{orderInfo.updateTime}}</view>
<view class="form-row-label-single">申请理由:</view>
<view class="form-row-label-single">{{orderInfo.note ? orderInfo.note : '无'}}</view>
</view>
<title style="margin-top: 20rpx">装备信息</title>
<view class="page-section" a:for="{{orderInfo.detailList}}">
<flex>
<view class="form-row-label-left">装备名称: {{item.equipmentName}}</view>
<view class="form-row-label-right">装备号型: {{item.equipmentSizeName}}</view>
</flex>
<flex>
<view class="form-row-label-left">供应商: {{item.supplierName}}</view>
<view class="form-row-label-right">装备数量: {{item.quantity}}</view>
</flex>
</view>
</view>
</tab-content>
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:elif="{{index === 1}}">
<view>
<steps className="demo-steps-class" activeIndex="{{activeIndex}}" failIndex="{{failIndex}}" items="{{steps}}"></steps>
<title>审核详情</title>
<block a:for="{{items}}">
<view class="page-section">
<flex>
<view class="form-row-label-left">步骤名称: {{item.stepName}}</view>
<view class="form-row-label-right">审核人: {{item.auditUserName}}</view>
</flex>
<flex>
<view class="form-row-label-left">操作时间: {{item.updateTime}}</view>
<view class="form-row-label-right">审核意见: {{item.auditMind ? item.auditMind : '无'}}</view>
</flex>
</view>
</block>
</view>
</tab-content>
</block>
</tabs>
<view a:if={{!type}}>
<title>审核意见</title>
<multi-liner placeholder="请输入审核意见" value="{{approvalMsg}}" onInput="onInput" last="{{true}}" auto-height="{{true}}" controlled="{{controlled}}"/>
<view class="button-center">
<button type="warn" size="mini" onTap="agree" data-result="no">不通过</button>
<button type="primary" size="mini" style="margin-left: 20rpx" onTap="agree" data-result="yes">通过</button>
</view>
</view>
</view>
\ No newline at end of file
import dd from "gdt-jsapi";
import http from '../../src/http/index'
import util from '../../src/libs/util'
Page({
data: {
tabs: [
{ title: '维修信息' },
{ title: '流程信息' }
],
activeTab: 0,
activeIndex: 1,
failIndex: 0,
steps: [],
items: [],
orderInfo: {},
controlled: true,
approvalMsg: '',
type: ''
},
onLoad(query) {
this.getAllProcess()
this.getById(query.id)
this.setData({
type: query.type
})
},
getAllProcess (id) {
const _this = this
http.post('/api/Process/GetAllProcess', {code: "repair", orgId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40"}).then(res => {
if (res.code === '10000') {
var arr = []
res.data.forEach(element => {
arr.push({ title: element })
})
_this.setData({
steps: arr
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
getById (id) {
const _this = this
http.post('/api/FixReceiveApply/GetByID', {id: id}).then(res => {
if (res.code === '10000') {
_this.setData({
items: res.data.historyList,
orderInfo: res.data,
activeIndex: res.data.flowState ? _this.data.steps.length : _this.data.steps.findIndex(i => i.title === res.data.currentStepName) + 1
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
handleTabClick({ index, tabsName }) {
this.setData({
[tabsName]: index
});
},
onInput (e) {
this.setData({
approvalMsg: e.detail.value,
});
},
async agree (event) {
const result = event.target.dataset.result
const _this = this
var data = {
code: _this.data.orderInfo.flowType,
orgId: _this.data.orderInfo.orgId,
stepId: _this.data.orderInfo.nextStepId,
flowGateway: result === 'no' ? "不同意" : "同意"
}
let form = {}
await http.post('/api/Process/GetProcess', data).then(res => {
if (res.code === '10000') {
form = {
id: _this.data.orderInfo.id,
orgId : getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40",
flowState : res.data.flowState,
approvalMsg : _this.data.approvalMsg || data.flowGateway,
userType: res.data.userType,
userInfo: res.data.userInfo,
dataScope: res.data.dataScope,
nextStepId: res.data.nextStepId,
currentStepName: res.data.currentStepName,
auditUser: getApp().globalData.userId || "11",
auditUserName: getApp().globalData.username || "测试"
}
}
})
await http.post('/api/FixReceiveApply/ApproveOrder', form).then(res => {
if (res.code === "10000") {
util.ddToast({ type: 'success', text: res.msg })
dd.navigateBack({})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
}
});
\ No newline at end of file
{
"usingComponents": {
"tabs": "mini-ali-ui/es/tabs/index",
"tab-content": "mini-ali-ui/es/tabs/tab-content/index",
"steps": "mini-ali-ui/es/steps/index",
"title": "mini-ali-ui/es/title/index",
"multi-liner": "mini-ali-ui/es/multi-liner/index",
"flex": "mini-ali-ui/es/flex/index"
}
}
\ No newline at end of file
.am-title {
padding:var(--am-title-paddingLR,12px) var(--am-title-paddingB,12px)
}
.demo-steps-class {
margin-bottom: 20rpx;
}
.am-tabs-content-wrap {
background-color:#f1f1f1
}
.form-row-label-left {
flex: 2;
padding: 15rpx 8rpx;
font-size: 26rpx;
text-align: left;
color: #000;
}
.form-row-label-right {
flex: 1;
padding: 15rpx 8rpx;
font-size: 26rpx;
text-align: right;
color: #000;
}
.page-content {
background-color:#f1f1f1
}
.am-container {
margin-bottom: 15rpx
}
\ No newline at end of file
<scroll-view scroll-y="{{true}}" enable-back-to-top="{{true}}" style="height: 100vh;" onScrollToLower="onScrollToLower">
<tabs tabs="{{tabs}}" tabsName="activeTab" activeTab="{{activeTab}}" onTabClick="handleTabClick" swipeable={{false}}>
<block a:for="{{tabs}}">
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}">
<view class="page-content">
<container a:for="{{list}}">
<view>
<flex>
<view class="form-row-label-left">维修单号: {{item.orderCode}}</view>
<view class="form-row-label-right" a:if="{{item.flowState}}">状态: 已通过</view>
<view class="form-row-label-right" a:if="{{!item.flowState && item.userInfo !== ''}}">状态: 待审批</view>
<view class="form-row-label-right" a:if="{{!item.flowState && item.actionResult === 0}}">状态: 撤销</view>
<view class="form-row-label-right" a:if="{{!item.flowState && item.userInfo === ''}}">状态: 已驳回</view>
</flex>
<flex>
<view class="form-row-label-left">目标仓库: {{item.warehouseName}}</view>
<view class="form-row-label-right">申请人: {{item.applyName}}</view>
</flex>
<flex>
<view class="form-row-label-left">申请时间: {{item.applyTime}}</view>
<button type="primary" size="mini" onTap="showInfo" data-id="{{item.id}}">查看</button>
</flex>
</view>
</container>
</view>
</tab-content>
</block>
</tabs>
</scroll-view>
\ No newline at end of file
import dd from "gdt-jsapi";
import http from '../../src/http/index'
import util from '../../src/libs/util'
Page({
data: {
tabs: [
{ title: '维修列表' }
],
list: [],
activeTab: 0,
activeIndex: 1,
failIndex: 0,
size: 8
},
onLoad(query) {
this.getList()
},
getList () {
const _this = this
const queryParam = {orgId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40", flowType: "repair" , userId: getApp().globalData.userId || '11',
roleIds: getApp().globalData.roleIds || [3], page: 0, size: _this.data.size, approveType: 3 }
http.post('/api/Process/GetPageHistoryProcessList', queryParam).then(res => {
if (res.code === '10000') {
_this.setData({
list: res.data.content
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
onScrollToLower(e) {
const _this = this
_this.setData({
size: _this.data.size + 8
})
this.getList()
},
onPullDownRefresh() {
// 页面被下拉
this.getList();
setTimeout(() => {
dd.stopPullDownRefresh();
}, 100);
},
handleTabClick({ index, tabsName }) {
this.setData({
[tabsName]: index
});
},
showInfo(event) {
let id = event.target.dataset.id
dd.navigateTo({
url: '../repairInfo/repairInfo?id=' + id + '&type=2'
})
}
});
\ No newline at end of file
{
"usingComponents": {
"tabs": "mini-ali-ui/es/tabs/index",
"tab-content": "mini-ali-ui/es/tabs/tab-content/index",
"title": "mini-ali-ui/es/title/index",
"multi-liner": "mini-ali-ui/es/multi-liner/index",
"container": "mini-ali-ui/es/container/index",
"flex": "mini-ali-ui/es/flex/index",
"flex-item": "mini-ali-ui/es/flex/flex-item/index"
}
}
\ No newline at end of file
.am-title {
padding:var(--am-title-paddingLR,12px) var(--am-title-paddingB,12px)
}
.demo-steps-class {
margin-bottom: 20rpx;
}
.am-tabs-content-wrap {
background-color:#f1f1f1
}
.form-row {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
padding: 0 30rpx;
margin-top: 15rpx;
background-color:#fff
}
.form-row-label {
width: 45%;
font-size: 26rpx;
margin: 10rpx;
text-align: left;
color: #000;
}
.form-row-label-single {
width: 45%;
padding: 20rpx 10rpx;
font-size: 26rpx;
text-align: left;
color: #000;
}
.form-line {
height: 1px;
background-color: #ddd;
margin-left: 30rpx;
}
.button-center {
display: block;
text-align: center;
}
button {
margin-top: 20rpx;
}
<view>
<tabs tabs="{{tabs}}" tabsName="activeTab" activeTab="{{activeTab}}" onTabClick="handleTabClick" swipeable={{false}}>
<block a:for="{{tabs}}">
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:if="{{index === 0}}">
<view>
<title style="margin-top: 20rpx">基本信息</title>
<view class="form-row">
<view class="form-row-label-single">报废单号:</view>
<view class="form-row-label-single">{{orderInfo.orderCode}} </view>
<view class="form-row-label-single">目标仓库:</view>
<view class="form-row-label-single">{{orderInfo.warehouseName}}</view>
<view class="form-row-label-single">订单状态:</view>
<view class="form-row-label-single" a:if="{{orderInfo.flowState}}">已通过</view>
<view class="form-row-label-single" a:if="{{!orderInfo.flowState && orderInfo.userInfo !== ''}}">待审批</view>
<view class="form-row-label-single" a:if="{{!orderInfo.flowState && orderInfo.actionResult === '0'}}">撤销</view>
<view class="form-row-label-single" a:if="{{!orderInfo.flowState && orderInfo.userInfo === ''}}">已驳回</view>
<view class="form-row-label-single">申请人:</view>
<view class="form-row-label-single">{{orderInfo.applyName}}</view>
<view class="form-row-label-single">申请时间:</view>
<view class="form-row-label-single">{{orderInfo.applyTime}}</view>
<view class="form-row-label-single">更新时间:</view>
<view class="form-row-label-single">{{orderInfo.updateTime}}</view>
<view class="form-row-label-single">申请理由:</view>
<view class="form-row-label-single">{{orderInfo.note ? orderInfo.note : '无'}}</view>
</view>
<title style="margin-top: 20rpx">装备信息</title>
<view class="page-section" a:for="{{orderInfo.detailList}}">
<flex>
<view class="form-row-label-left">装备名称: {{item.equipmentName}}</view>
<view class="form-row-label-right">装备号型: {{item.equipmentSizeName}}</view>
</flex>
<flex>
<view class="form-row-label-left">供应商: {{item.supplierName}}</view>
<view class="form-row-label-right">装备数量: {{item.quantity}}</view>
</flex>
</view>
</view>
</tab-content>
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:elif="{{index === 1}}">
<view>
<steps className="demo-steps-class" activeIndex="{{activeIndex}}" failIndex="{{failIndex}}" items="{{steps}}"></steps>
<title>审核详情</title>
<block a:for="{{items}}">
<view class="page-section">
<flex>
<view class="form-row-label-left">步骤名称: {{item.stepName}}</view>
<view class="form-row-label-right">审核人: {{item.auditUserName}}</view>
</flex>
<flex>
<view class="form-row-label-left">操作时间: {{item.updateTime}}</view>
<view class="form-row-label-right">审核意见: {{item.auditMind ? item.auditMind : '无'}}</view>
</flex>
</view>
</block>
</view>
</tab-content>
</block>
</tabs>
<view a:if={{!type}}>
<title>审核意见</title>
<multi-liner placeholder="请输入审核意见" value="{{approvalMsg}}" onInput="onInput" last="{{true}}" auto-height="{{true}}" controlled="{{controlled}}"/>
<view class="button-center">
<button type="warn" size="mini" onTap="agree" data-result="no">不通过</button>
<button type="primary" size="mini" style="margin-left: 20rpx" onTap="agree" data-result="yes">通过</button>
</view>
</view>
</view>
\ No newline at end of file
import dd from "gdt-jsapi";
import http from '../../src/http/index'
import util from '../../src/libs/util'
Page({
data: {
tabs: [
{ title: '报废信息' },
{ title: '流程信息' }
],
activeTab: 0,
activeIndex: 1,
failIndex: 0,
steps: [],
items: [],
orderInfo: {},
controlled: true,
approvalMsg: '',
type: ''
},
onLoad(query) {
this.getAllProcess()
this.getById(query.id)
this.setData({
type: query.type
})
},
getAllProcess (id) {
const _this = this
http.post('/api/Process/GetAllProcess', {code: "scrap", orgId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40"}).then(res => {
if (res.code === '10000') {
var arr = []
res.data.forEach(element => {
arr.push({ title: element })
})
_this.setData({
steps: arr
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
getById (id) {
const _this = this
http.post('/api/FixReceiveApply/GetByID', {id: id}).then(res => {
if (res.code === '10000') {
_this.setData({
items: res.data.historyList,
orderInfo: res.data,
activeIndex: res.data.flowState ? _this.data.steps.length : _this.data.steps.findIndex(i => i.title === res.data.currentStepName) + 1
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
handleTabClick({ index, tabsName }) {
this.setData({
[tabsName]: index
});
},
onInput (e) {
this.setData({
approvalMsg: e.detail.value,
});
},
async agree (event) {
const result = event.target.dataset.result
const _this = this
var data = {
code: _this.data.orderInfo.flowType,
orgId: _this.data.orderInfo.orgId,
stepId: _this.data.orderInfo.nextStepId,
flowGateway: result === 'no' ? "不同意" : "同意"
}
let form = {}
await http.post('/api/Process/GetProcess', data).then(res => {
if (res.code === '10000') {
form = {
id: _this.data.orderInfo.id,
orgId : getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40",
flowState : res.data.flowState,
approvalMsg : _this.data.approvalMsg || data.flowGateway,
userType: res.data.userType,
userInfo: res.data.userInfo,
dataScope: res.data.dataScope,
nextStepId: res.data.nextStepId,
currentStepName: res.data.currentStepName,
auditUser: getApp().globalData.userId || "11",
auditUserName: getApp().globalData.username || "测试"
}
}
})
await http.post('/api/FixReceiveApply/ApproveOrder', form).then(res => {
if (res.code === "10000") {
util.ddToast({ type: 'success', text: res.msg })
dd.navigateBack({})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
}
});
\ No newline at end of file
{
"usingComponents": {
"tabs": "mini-ali-ui/es/tabs/index",
"tab-content": "mini-ali-ui/es/tabs/tab-content/index",
"steps": "mini-ali-ui/es/steps/index",
"title": "mini-ali-ui/es/title/index",
"multi-liner": "mini-ali-ui/es/multi-liner/index",
"flex": "mini-ali-ui/es/flex/index"
}
}
\ No newline at end of file
.am-title {
padding:var(--am-title-paddingLR,12px) var(--am-title-paddingB,12px)
}
.demo-steps-class {
margin-bottom: 20rpx;
}
.am-tabs-content-wrap {
background-color:#f1f1f1
}
.form-row-label-left {
flex: 2;
padding: 15rpx 8rpx;
font-size: 26rpx;
text-align: left;
color: #000;
}
.form-row-label-right {
flex: 1;
padding: 15rpx 8rpx;
font-size: 26rpx;
text-align: right;
color: #000;
}
.page-content {
background-color:#f1f1f1
}
.am-container {
margin-bottom: 15rpx
}
\ No newline at end of file
<scroll-view scroll-y="{{true}}" enable-back-to-top="{{true}}" style="height: 100vh;" onScrollToLower="onScrollToLower">
<tabs tabs="{{tabs}}" tabsName="activeTab" activeTab="{{activeTab}}" onTabClick="handleTabClick" swipeable={{false}}>
<block a:for="{{tabs}}">
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}">
<view class="page-content">
<container a:for="{{list}}">
<view>
<flex>
<view class="form-row-label-left">报废单号: {{item.orderCode}}</view>
<view class="form-row-label-right" a:if="{{item.flowState}}">状态: 已通过</view>
<view class="form-row-label-right" a:if="{{!item.flowState && item.userInfo !== ''}}">状态: 待审批</view>
<view class="form-row-label-right" a:if="{{!item.flowState && item.actionResult === 0}}">状态: 撤销</view>
<view class="form-row-label-right" a:if="{{!item.flowState && item.userInfo === ''}}">状态: 已驳回</view>
</flex>
<flex>
<view class="form-row-label-left">目标仓库: {{item.warehouseName}}</view>
<view class="form-row-label-right">申请人: {{item.applyName}}</view>
</flex>
<flex>
<view class="form-row-label-left">申请时间: {{item.applyTime}}</view>
<button type="primary" size="mini" onTap="showInfo" data-id="{{item.id}}">查看</button>
</flex>
</view>
</container>
</view>
</tab-content>
</block>
</tabs>
</scroll-view>
\ No newline at end of file
import dd from "gdt-jsapi";
import http from '../../src/http/index'
import util from '../../src/libs/util'
Page({
data: {
tabs: [
{ title: '报废列表' }
],
list: [],
activeTab: 0,
activeIndex: 1,
failIndex: 0,
size: 8
},
onLoad(query) {
this.getList()
},
getList () {
const _this = this
const queryParam = {orgId: getApp().globalData.orgId || "B483A47A-0D9B-455C-B26A-FB0AEA3455D8", flowType: "scrap" , userId: getApp().globalData.userId || '14',
roleIds: getApp().globalData.roleIds || [2], page: 0, size: _this.data.size, approveType: 3 }
http.post('/api/Process/GetPageHistoryProcessList', queryParam).then(res => {
if (res.code === '10000') {
_this.setData({
list: res.data.content
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
onScrollToLower(e) {
const _this = this
_this.setData({
size: _this.data.size + 8
})
this.getList()
},
onPullDownRefresh() {
// 页面被下拉
this.getList();
setTimeout(() => {
dd.stopPullDownRefresh();
}, 100);
},
handleTabClick({ index, tabsName }) {
this.setData({
[tabsName]: index
});
},
showInfo(event) {
let id = event.target.dataset.id
dd.navigateTo({
url: '../scrapInfo/scrapInfo?id=' + id + '&type=2'
})
}
});
\ No newline at end of file
{
"usingComponents": {
"tabs": "mini-ali-ui/es/tabs/index",
"tab-content": "mini-ali-ui/es/tabs/tab-content/index",
"title": "mini-ali-ui/es/title/index",
"multi-liner": "mini-ali-ui/es/multi-liner/index",
"container": "mini-ali-ui/es/container/index",
"flex": "mini-ali-ui/es/flex/index",
"flex-item": "mini-ali-ui/es/flex/flex-item/index"
}
}
\ No newline at end of file
<view>
<grid onGridItemClick="onItemClick" columnNum="{{3}}" list="{{list}}" infinite="{{true}}" circular="{{true}}"
hasLine="{{false}}" infiniteHeight="240rpx" />
</view>
\ No newline at end of file
import dd from 'gdt-jsapi';
Page({
data: {
list: [
{
icon: '../../src/assets/icon/采购流程.png',
text: '采购',
},
{
icon: '../../src/assets/icon/调拨下发流程.png',
text: '调拨',
},
{
icon: '../../src/assets/icon/本库借用流程.png',
text: '本库借用',
},
{
icon: '../../src/assets/icon/领用.png',
text: '领用',
},
{
icon: '../../src/assets/icon/维修流程.png',
text: '维修',
},
{
icon: '../../src/assets/icon/报废流程.png',
text: '报废',
},
{
icon: '../../src/assets/icon/出入库记录.png',
text: '出入库记录',
}
],
},
onItemClick(ev) {
let index = ev.detail.index
switch (index) {
case 0:
dd.navigateTo({
url: '../purchaseMain/purchaseMain'
}); break
case 1:
dd.navigateTo({
url: '../transferMain/transferMain'
}); break
case 2:
dd.navigateTo({
url: '../borrowMyMain/borrowMyMain'
}); break
case 3:
dd.navigateTo({
url: '../receiveMain/receiveMain'
}); break
case 4:
dd.navigateTo({
url: '../repairMain/repairMain'
}); break
case 5:
dd.navigateTo({
url: '../scrapMain/scrapMain'
}); break
case 6:
dd.navigateTo({
url: '../inOutList/inOutList'
}); break
default: break
}
},
});
{
"usingComponents":{
"grid":"mini-ali-ui/es/grid/index"
}
}
\ No newline at end of file
.am-title {
margin-top: 25rpx
}
.row {
display: flex;
align-items: center;
padding: 0 30rpx;
}
.row-title {
flex: 1;
padding-top: 28rpx;
padding-bottom: 28rpx;
font-size: 34rpx;
color: #000;
}
.row-extra {
flex-basis: initial;
font-size: 32rpx;
color: #888;
}
.row-arrow {
width: 32rpx;
height: 32rpx;
margin-left: 16rpx;
}
.button-submit {
padding: 30rpx;
}
.button-add {
padding: 10rpx 180rpx;
}
.border-line {
border: 1rpx solid #f1f1f1;
}
\ No newline at end of file
<view>
<tabs tabs="{{tabs}}" tabsName="activeTab" activeTab="{{activeTab}}" onTabClick="handleTabClick">
<block a:for="{{tabs}}">
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:if="{{index === 0}}">
<view>
<title>第一步: 选择仓库</title>
<view class="page-section">
<picker onChange="warehousePickerChange" value="{{waIndex}}" range="{{warehouseList}}" range-key="name">
<view class="row">
<view class="row-title">仓库</view>
<view class="row-extra">当前选择:{{warehouseList[waIndex].name}}</view>
</view>
</picker>
</view>
<title>第二步: 选择装备</title>
<view class="page-section">
<picker onChange="eqPickerChange" value="{{eqIndex}}" range="{{equipmentList}}" range-key="equipmentName">
<view class="row">
<view class="row-title">装备</view>
<view class="row-extra">当前选择:{{equipmentList[eqIndex].equipmentName}}</view>
</view>
</picker>
<view class="border-line"/>
<view class="button-add"><button onTap="addEqu" style="background-color:#13ce66;color: #fff;">添加装备</button></view>
</view>
<title>已选择装备</title>
<block a:for="{{detailList}}">
<view class="page-section">
<flex>
<view class="form-row-label-left">装备名称: {{item.equipmentDetailName}}</view>
<!-- <view class="form-row-label-right">库存: {{item.maxCount}}</view> -->
</flex>
<flex>
<view class="form-row-label-left" onTap="changeStepper" data-small="{{index}}"><stepper onChange="callBackFn" showNumber value="{{item.quantity}}" readOnly="{{true}}" min="{{1}}" max="{{item.maxCount}}"/></view>
<view class="form-row-label-right"><button type="warn" size="mini" onTap="delete" data-index="{{index}}">删除</button></view>
</flex>
</view>
</block>
<multi-liner placeholder="请输入调拨原因" value="{{note}}" onInput="onInput" last="{{true}}" auto-height="{{true}}" controlled="{{controlled}}"/>
<view class="button-submit"><button type="primary" onTap="submit">提交</button></view>
</view>
</tab-content>
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:elif="{{index === 1}}">
<view>
<steps className="demo-steps-class" activeIndex="{{activeIndex}}" failIndex="{{failIndex}}" items="{{steps}}"></steps>
<title>审核详情</title>
<block a:for="{{items}}">
<view class="page-section">
<flex>
<view class="form-row-label-left">步骤名称: {{item.stepName}}</view>
<view class="form-row-label-right">审核人: {{item.auditUserName}}</view>
</flex>
<flex>
<view class="form-row-label-left">操作时间: {{item.updateTime}}</view>
<view class="form-row-label-right">审核意见: {{item.auditMind ? item.auditMind : '无'}}</view>
</flex>
</view>
</block>
</view>
</tab-content>
</block>
</tabs>
</view>
\ No newline at end of file
import dd from 'gdt-jsapi';
import http from '/src/http';
import util from '/src/libs/util'
Page({
data: {
tabs: [
{ title: '调拨信息' },
{ title: '流程信息' }
],
activeTab: 0,
activeIndex: 1,
failIndex: 1,
steps: [],
items: [],
warehouseList: [],
equipmentList: [],
note: '',
controlled: true,
num: 1,
detailList: [],
orderInfo: {},
processForm: {}
},
onLoad(query) {
if (query.flowType === 'allocationUp') {
this.getListOrgWarehouse()
this.getListEquipmentByOrgParentZk()
} else if (query.flowType === 'allocationDown') {
this.getListEquipmentByOrgZk()
this.getListWarehouse()
}
this.getProcess(query.flowType, query.nextStepId)
if (query.id) {
setTimeout(() => {
this.getById(query.id)
}, 1000)
}
},
getListOrgWarehouse() {
this.data.detailList = []
http.post('/api/Warehouse/GetListOrgWarehouse', {orgizationId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40"}).then(res => {
this.setData({
warehouseList: res.data
})
})
},
getListWarehouse() {
this.data.detailList = []
http.post('/api/Warehouse/GetListWarehouse', {orgizationId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40"}).then(res => {
this.setData({
warehouseList: res.data
})
})
},
getProcess (flowType, nextStepId) {
const _this = this
const params = {
code: flowType,
orgId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40",
stepId: nextStepId || "",
flowGateway: ""
}
http.post('/api/Process/GetProcess', params).then(res => {
if(res.code === "10000") {
_this.data.processForm = {
currentStepName: res.data.currentStepName,
dataScope: res.data.dataScope,
flowId: res.data.flowId,
flowName: res.data.flowName,
flowState: res.data.flowState,
flowType: res.data.flowType,
nextStepId: res.data.nextStepId,
orgId: res.data.orgId,
userInfo: res.data.userInfo,
userType: res.data.userType,
transferId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40"
}
}
})
http.post('/api/Process/GetAllProcess', {code: flowType, orgId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40"}).then(res => {
if (res.code === '10000') {
var arr = []
res.data.forEach(element => {
arr.push({ title: element })
})
_this.setData({
steps: arr
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
getById (id) {
const _this = this
http.post('/api/Transfer/GetByID', {id: id}).then(res => {
if (res.code === '10000') {
_this.setData({
items: res.data.historyList,
orderInfo: res.data,
detailList: res.data.detailList,
waIndex: _this.data.warehouseList.findIndex((value)=>value.id === res.data.warehouseId),
activeIndex: res.data.flowState ? _this.data.steps.length : _this.data.steps.findIndex(i => i.title === res.data.currentStepName) + 1
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
handleTabClick({ index, tabsName }) {
this.setData({
[tabsName]: index
});
},
warehousePickerChange(e) {
this.setData({
waIndex: e.detail.value,
})
},
getListEquipmentByOrgParentZk() {
http.post('/api/Inventory/GetListEquipmentByOrgParentZk', {orgId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40"}).then(res => {
this.setData({
equipmentList: res.data
})
})
},
getListEquipmentByOrgZk() {
http.post('/api/Inventory/GetListEquipmentByOrgZk', {orgId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40"}).then(res => {
this.setData({
equipmentList: res.data
})
})
},
eqPickerChange(e) {
this.setData({
eqIndex: e.detail.value,
})
},
onInput (e) {
this.setData({
note: e.detail.value
});
},
addEqu() {
var result = this.data.detailList.filter(item => item.equipmentDetailId === this.data.equipmentList[this.data.eqIndex].equipmentId)
if(this.data.eqIndex == undefined) {
util.ddToast({ type: 'fail', text: '请选择装备' })
} else if(result.length > 0) {
util.ddToast({ type: 'fail', text: '已添加过该装备' })
} else {
var detailList = this.data.detailList;
let row = {
id: "",
equipmentDetailName : this.data.equipmentList[this.data.eqIndex].equipmentName,
equipmentDetailId : this.data.equipmentList[this.data.eqIndex].equipmentId,
maxCount: this.data.equipmentList[this.data.eqIndex].zkCount,
quantity : 1
}
detailList.unshift(row)
this.setData({
detailList: detailList
})
}
},
delete(e) {
var detailList = this.data.detailList;
detailList.splice(e.target.dataset.index, 1)
this.setData({
detailList: detailList
})
},
callBackFn(value) {
this.setData({
num: value
})
},
changeStepper(e) {
const small = e.target.dataset.small
this.setData({
["detailList["+small+"].quantity"]: this.data.num
})
},
submit() {
if (this.data.waIndex === undefined) {
util.ddToast({ type: 'success', text: '请选择仓库' })
} else if (this.data.detailList.length < 1) {
util.ddToast({ type: 'fail', text: '请至少添加一件装备' })
} else {
const queryParam = {
id: this.data.orderInfo.id || '',
actionType: 0,
warehouseId: this.data.warehouseList[this.data.waIndex].id,
note: this.data.note,
applyId: getApp().globalData.userId || "10",
applyName: getApp().globalData.username || '测试',
detailList: this.data.detailList,
orgId: getApp().globalData.orgId || 'E05CC28D-C189-4389-8081-DD0D6E483B40',
orgCode: getApp().globalData.code || '330200'
}
let form = { ...queryParam, ...this.data.processForm }
http.post('/api/Transfer/AddOrUpdateTransferOrder', form).then(res => {
if (res.code === "10000") {
util.ddToast({ type: 'success', text: res.msg })
dd.navigateBack({})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
}
}
});
{
"usingComponents": {
"tabs": "mini-ali-ui/es/tabs/index",
"tab-content": "mini-ali-ui/es/tabs/tab-content/index",
"steps": "mini-ali-ui/es/steps/index",
"title": "mini-ali-ui/es/title/index",
"multi-liner": "mini-ali-ui/es/multi-liner/index",
"flex": "mini-ali-ui/es/flex/index",
"stepper": "mini-ali-ui/es/stepper/index"
}
}
\ No newline at end of file
.am-title {
padding:var(--am-title-paddingLR,12px) var(--am-title-paddingB,12px)
}
.demo-steps-class {
margin-bottom: 20rpx;
}
.am-tabs-content-wrap {
background-color:#f1f1f1
}
.form-row {
display: flex;
flex-wrap: wrap;
align-items: center;
padding: 0 30rpx;
margin-top: 15rpx;
background-color:#fff
}
.form-row-label {
width: 45%;
font-size: 26rpx;
margin: 10rpx;
text-align: left;
color: #000;
}
.form-row-label-single {
width: 46%;
padding: 20rpx 10rpx;
font-size: 26rpx;
text-align: left;
color: #000;
}
.form-line {
height: 1px;
background-color: #ddd;
margin-left: 30rpx;
}
.button-center {
display: block;
text-align: center;
}
button {
margin-top: 20rpx;
}
<view>
<tabs tabs="{{tabs}}" tabsName="activeTab" activeTab="{{activeTab}}" onTabClick="handleTabClick" swipeable={{false}}>
<block a:for="{{tabs}}">
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:if="{{index === 0}}">
<view>
<title style="margin-top: 20rpx">基本信息</title>
<view class="form-row">
<view class="form-row-label-single">调拨单号:</view>
<view class="form-row-label-single">{{orderInfo.order}} </view>
<view class="form-row-label-single">目标仓库:</view>
<view class="form-row-label-single">{{orderInfo.warehouseName}}</view>
<view class="form-row-label-single">订单状态:</view>
<view class="form-row-label-single" a:if="{{orderInfo.flowState}}">已通过</view>
<view class="form-row-label-single" a:if="{{!orderInfo.flowState && orderInfo.userInfo !== ''}}">待审批</view>
<view class="form-row-label-single" a:if="{{!orderInfo.flowState && orderInfo.actionResult === '0'}}">撤销</view>
<view class="form-row-label-single" a:if="{{!orderInfo.flowState && orderInfo.userInfo === ''}}">已驳回</view>
<view class="form-row-label-single">申请人:</view>
<view class="form-row-label-single">{{orderInfo.applyName}}</view>
<view class="form-row-label-single">申请时间:</view>
<view class="form-row-label-single">{{orderInfo.applyTime}}</view>
<view class="form-row-label-single">更新时间:</view>
<view class="form-row-label-single">{{orderInfo.updateTime}}</view>
<view class="form-row-label-single">申请理由:</view>
<view class="form-row-label-single">{{orderInfo.note ? orderInfo.note : '无'}}</view>
</view>
<title style="margin-top: 20rpx">装备信息</title>
<view class="page-section" a:for="{{orderInfo.detailList}}">
<flex>
<view class="form-row-label-left">装备名称: {{item.equipmentDetailName}}</view>
<view class="form-row-label-right">装备数量 {{item.quantity}}</view>
</flex>
</view>
<view a:if="{{transferTableList}}">
<title style="margin-top: 20rpx">调拨信息</title>
<view class="page-section" a:for="{{transferTableList}}">
<flex>
<view class="form-row-label-left">装备名称: {{item.equipmentDetailName}}</view>
<view class="form-row-label-right">发出仓库: {{item.warehouseName}}</view>
</flex>
<view class="form-row-label-left">装备数量 {{item.quantity}}</view>
</view>
</view>
</view>
</tab-content>
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:elif="{{index === 1}}">
<view>
<steps className="demo-steps-class" activeIndex="{{activeIndex}}" failIndex="{{failIndex}}" items="{{steps}}"></steps>
<title>审核详情</title>
<block a:for="{{items}}">
<view class="page-section">
<flex>
<view class="form-row-label-left">步骤名称: {{item.stepName}}</view>
<view class="form-row-label-right">审核人: {{item.auditUserName}}</view>
</flex>
<flex>
<view class="form-row-label-left">操作时间: {{item.updateTime}}</view>
<view class="form-row-label-right">审核意见: {{item.auditMind ? item.auditMind : '无'}}</view>
</flex>
</view>
</block>
</view>
</tab-content>
</block>
</tabs>
<view a:if={{!type}}>
<title>审核意见</title>
<multi-liner a:if="{{!showBottom}}" placeholder="请输入审核意见" value="{{approvalMsg}}" onInput="onInput" last="{{true}}" auto-height="{{true}}" controlled="{{controlled}}"/>
<view class="button-center">
<button type="warn" size="mini" onTap="agree" data-result="no">不通过</button>
<button type="primary" size="mini" style="margin-left: 20rpx" onTap="agree" data-result="yes">通过</button>
</view>
<popup show="{{showBottom}}" position="bottom" onClose="onPopupClose">
<view>
<block a:for={{orderInfo.detailList}} a:for-index="outIndex">
<container title="装备名称:{{item.equipmentDetailName}} / 需求数量:{{item.quantity}}">
<list>
<block a:for="{{item.warehouseList}}">
<list-item upperSubtitle="仓库名称: {{item.name}}" lowerSubtitle="库存: {{item.equCount}}">
<view slot="extra" onTap="changeStepper" data-small="{{index}}" data-big="{{outIndex}}">
<stepper onChange="callBackFn" showNumber value="{{0}}" readOnly="{{true}}" inputWidth="60px" min="{{0}}" max="{{item.equCount}}"/>
</view>
</list-item>
</block>
</list>
</container>
</block>
<button onTap="end">确定</button>
<button onTap="cancel">取消</button>
</view>
</popup>
</view>
</view>
\ No newline at end of file
import dd from "gdt-jsapi";
import http from '../../src/http/index'
import util from '../../src/libs/util'
Page({
data: {
tabs: [
{ title: '调拨信息' },
{ title: '流程信息' }
],
activeTab: 0,
activeIndex: 1,
failIndex: 0,
steps: [],
items: [],
transferTableList: [],
orderInfo: {},
showBottom: false,
form: {},
num: 0,
type: ''
},
onLoad(query) {
this.getAllProcess(query.flowType)
this.getById(query.id)
this.setData({
type: query.type
})
},
getAllProcess (flowType) {
const _this = this
http.post('/api/Process/GetAllProcess', {code: flowType, orgId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40"}).then(res => {
if (res.code === '10000') {
var arr = []
res.data.forEach(element => {
arr.push({ title: element })
})
_this.setData({
steps: arr
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
getById (id) {
const _this = this
http.post('/api/Transfer/GetByID', {id: id}).then(res => {
if (res.code === '10000') {
let transferTableList = []
if(!res.data.flowState && res.data.realityDetailList) {
for (var i=0;i<res.data.realityDetailList.length;i++) {
for(var j=0;j<res.data.realityDetailList[i].warehouseList.length;j++) {
var obj = {}
obj.equipmentDetailName = res.data.realityDetailList[i].equipmentDetailName
obj.warehouseName = res.data.realityDetailList[i].warehouseList[j].name
obj.quantity = res.data.realityDetailList[i].warehouseList[j].quantity
if (obj.quantity > 0) {
transferTableList.unshift(obj)
}
}
}
} else { transferTableList = res.data.realityDetailList }
_this.setData({
items: res.data.historyList,
orderInfo: res.data,
orderInfoCopy: res.data,
activeIndex: res.data.flowState ? _this.data.steps.length : _this.data.steps.findIndex(i => i.title === res.data.currentStepName) + 1,
transferTableList: transferTableList
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
handleTabClick({ index, tabsName }) {
this.setData({
[tabsName]: index
});
},
onInput (e) {
this.setData({
approvalMsg: e.detail.value,
});
},
async agree (event) {
const result = event.target.dataset.result
const _this = this
var data = {
code: _this.data.orderInfo.flowType,
orgId: _this.data.orderInfo.orgId,
stepId: _this.data.orderInfo.nextStepId,
flowGateway: result === 'no' ? "不同意" : "同意"
}
await http.post('/api/Process/GetProcess', data).then(res => {
if (res.code === '10000') {
_this.data.form = {
id: _this.data.orderInfo.id,
actionType: 0,
orgId : getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40",
flowState : res.data.flowState,
actionFlg: res.data.actionFlg,
approvalMsg : _this.data.approvalMsg || data.flowGateway,
userType: res.data.userType,
userInfo: res.data.userInfo,
dataScope: res.data.dataScope,
nextStepId: res.data.nextStepId,
currentStepName: res.data.currentStepName,
auditUser: getApp().globalData.userId || "11",
auditUserName: getApp().globalData.username || "测试",
detailList: _this.data.orderInfo.detailList
}
}
})
if (data.code === 'allocationUp' && _this.data.form.actionFlg === '有') {
_this.initCount()
_this.setData({
showBottom: true
})
} else if (data.code === 'allocationDown' && _this.data.form.flowState) {
_this.initCount()
_this.setData({
showBottom: true
})
} else {
await http.post('/api/Transfer/ApproveOrder', _this.data.form).then(res => {
if (res.code === "10000") {
util.ddToast({ type: 'success', text: res.msg })
dd.navigateBack({})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
}
},
onPopupClose() {
this.setData({
showBottom: false,
orderInfo: this.data.orderInfoCopy
})
},
cancel() {
this.setData({
showBottom: false,
orderInfo: this.data.orderInfoCopy
})
},
async initCount() {
const _this = this
var equipmentDetailIdList = _this.data.orderInfo.detailList.map(i => i.equipmentDetailId)
for (var i=0;i<equipmentDetailIdList.length;i++) {
await http.post('/api/Warehouse/GetPageWarehouseEquipment',{orgizationId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40",
equipmentId: equipmentDetailIdList[i], isCurrentLevel: "true", page: 0, size: 9999, warehouseId: _this.data.orderInfo.warehouseId}).then(res => {
if (res.data.totalElements < 1) {
util.ddToast({ type: 'fail', text: '库存不足' })
}
var s = 0
for (var j=0;j<res.data.content.length;j++){
s = s + res.data.content[j].equCount;
}
_this.setData({
["orderInfo.detailList["+i+"].tCount"]: s,
["orderInfo.detailList["+i+"].warehouseList"]: res.data.content
})
})
}
},
callBackFn(value) {
this.setData({
num: value
})
},
changeStepper(e) {
const big = e.target.dataset.big
const small = e.target.dataset.small
this.setData({
["orderInfo.detailList["+big+"].warehouseList["+small+"].quantity"]: this.data.num
})
},
end() {
let realityDetailList = this.data.orderInfo.detailList.map((item)=>{
return Object.keys(item).reduce((obj,key)=>{
if(key === 'transferNum' || key === 'tCount' || key === 'quantity'|| key ==='equipmentSizeId'
|| key ==='equipmentSizeName' || key === 'supplierId' || key === 'supplierName') return obj;
obj[key] = item[key];
return obj;
},{});
});
this.setData({
["form.realityDetailList"]: realityDetailList,
["form.updateFlag"]: true
})
let result = true
for (var i=0;i<this.data.orderInfo.detailList.length;i++) {
var sumValue = this.data.orderInfo.detailList[i].warehouseList.reduce(function(sum,warehouseList){ //sum2 前两个数的和
return sum + warehouseList.quantity;
}, 0)
if (sumValue !== this.data.orderInfo.detailList[i].quantity) {
result = false
}
}
if (result) {
http.post('/api/Transfer/ApproveOrder', this.data.form).then(res => {
if (res.code === "10000") {
util.ddToast({ type: 'success', text: res.msg })
dd.navigateBack({})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
} else {
util.ddToast({ type: 'fail', text: '请匹配好物资数量' })
}
}
});
\ No newline at end of file
{
"usingComponents": {
"tabs": "mini-ali-ui/es/tabs/index",
"tab-content": "mini-ali-ui/es/tabs/tab-content/index",
"steps": "mini-ali-ui/es/steps/index",
"title": "mini-ali-ui/es/title/index",
"multi-liner": "mini-ali-ui/es/multi-liner/index",
"popup": "mini-ali-ui/es/popup/index",
"stepper": "mini-ali-ui/es/stepper/index",
"container": "mini-ali-ui/es/container/index",
"list": "mini-ali-ui/es/list/index",
"list-item": "mini-ali-ui/es/list/list-item/index",
"flex": "mini-ali-ui/es/flex/index"
}
}
\ No newline at end of file
.am-title {
padding:var(--am-title-paddingLR,12px) var(--am-title-paddingB,12px)
}
.demo-steps-class {
margin-bottom: 20rpx;
}
.am-tabs-content-wrap {
background-color:#f1f1f1
}
.form-row-label-left {
flex: 2;
padding: 15rpx 8rpx;
font-size: 26rpx;
text-align: left;
color: #000;
}
.form-row-label-right {
flex: 1;
padding: 15rpx 8rpx;
font-size: 26rpx;
text-align: right;
color: #000;
}
.page-add-left {
width: 50%;
position: fixed;
bottom: 0;
}
.page-add-right {
width: 50%;
position: fixed;
right: 0;
bottom: 0;
}
\ No newline at end of file
<scroll-view scroll-y="{{true}}" enable-back-to-top="{{true}}" style="height: 100vh;" onScrollToLower="onScrollToLower">
<tabs tabs="{{tabs}}" tabsName="activeTab" activeTab="{{activeTab}}" onTabClick="handleTabClick" swipeable={{false}}>
<block a:for="{{tabs}}">
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:if="{{index === 0}}">
<view>
<view class="{{applyList.length-1 === index && index > 3 ? 'page-section-final' : 'page-section'}}" a:for="{{applyList}}">
<container>
<view>
<flex>
<view class="form-row-label-left">调拨单号: {{item.order}}</view>
<view class="form-row-label-right" a:if="{{item.flowState}}">状态: 已通过</view>
<view class="form-row-label-right" a:elif="{{!item.flowState && item.userInfo !== ''}}">状态: 待审批</view>
<view class="form-row-label-right" a:elif="{{!item.flowState && item.actionResult === '0'}}">状态: 撤销</view>
<view class="form-row-label-right" a:elif="{{!item.flowState && item.userInfo === ''}}">状态: 已驳回</view>
</flex>
<flex>
<view class="form-row-label-left">目标仓库: {{item.warehouseName}}</view>
<view class="form-row-label-right" a:if="{{item.flowType === 'allocationDown'}}">调拨类型: 调拨下发</view>
<view class="form-row-label-right" a:if="{{item.flowType === 'allocationUp'}}">调拨类型: 调拨申请</view>
</flex>
<flex>
<view class="form-row-label-left">申请时间: {{item.applyTime}}</view>
<view class="form-row-label-right">申请人: {{item.applyName}}</view>
</flex>
<flex>
<view class="form-row-label-left">更新时间: {{item.updateTime}}</view>
<button type="primary" size="mini" onTap="showInfo" data-row="{{item}}">查看</button>
<button size="mini" onTap="edit" data-row="{{item}}" a:if="{{!item.flowState && item.userInfo === ''}}"
style="margin-left: 10rpx;background-color:#ffba00;color: #fff">编辑</button>
<button type="warn" size="mini" onTap="back" data-row="{{item}}" a:if="{{!item.flowState && item.userInfo !== ''}}"
style="margin-left: 10rpx">撤销</button>
</flex>
</view>
</container>
</view>
</view>
</tab-content>
<tab-content key="{{index}}" tabId="{{index}}" activeTab="{{activeTab}}" a:elif="{{index === 1}}">
<view class="{{list.length-1 === index && index > 3 ? 'page-section-final' : 'page-section'}}" a:for="{{list}}">
<container>
<view>
<flex>
<view class="form-row-label-left">调拨单号: {{item.order}}</view>
<view class="form-row-label-right" a:if="{{item.flowState}}">状态: 已通过</view>
<view class="form-row-label-right" a:if="{{!item.flowState && item.userInfo !== ''}}">状态: 待审批</view>
<view class="form-row-label-right" a:if="{{!item.flowState && item.actionResult === 0}}">状态: 撤销</view>
<view class="form-row-label-right" a:if="{{!item.flowState && item.userInfo === ''}}">状态: 已驳回</view>
</flex>
<flex>
<view class="form-row-label-left">目标仓库: {{item.warehouseName}}</view>
<view class="form-row-label-right" a:if="{{item.flowType === 'allocationDown'}}">调拨类型: 调拨下发</view>
<view class="form-row-label-right" a:if="{{item.flowType === 'allocationUp'}}">调拨类型: 调拨申请</view>
</flex>
<flex>
<view class="form-row-label-left">申请时间: {{item.applyTime}}</view>
<view class="form-row-label-right">申请人: {{item.applyName}}</view>
</flex>
<flex>
<view class="form-row-label-left">更新时间: {{item.updateTime}}</view>
<button type="primary" size="mini" onTap="showInfo" data-row="{{item}}">查看</button>
</flex>
</view>
</container>
</view>
</tab-content>
</block>
</tabs>
<button class="page-add-left" onTap="openAdd" data-flowType="allocationUp">调拨申请</button>
<button class="page-add-right" onTap="openAdd" data-flowType="allocationDown">调拨下发</button>
</scroll-view>
\ No newline at end of file
import dd from "gdt-jsapi";
import http from '../../src/http/index'
import util from '../../src/libs/util'
Page({
data: {
tabs: [
{ title: '调拨申请' },
{ title: '调拨列表' }
],
list: [],
activeTab: 0,
activeIndex: 1,
failIndex: 0,
steps: [],
items: [],
orderInfo: {},
controlled: true,
approvalMsg: '',
size: 8
},
onLoad(query) {
this.getApply()
this.getList()
},
onPullDownRefresh() {
// 页面被下拉
this.getApply();
this.getList();
setTimeout(() => {
dd.stopPullDownRefresh();
}, 100);
},
onShow() {
// 页面显示
this.getApply();
this.getList();
},
onScrollToLower(e) {
const _this = this
_this.setData({
size: _this.data.size + 8
})
if(this.data.activeTab === 0) {
this.getApply()
} else if (this.data.activeTab === 1) {
this.getList()
}
},
getApply () {
const _this = this
http.post('/api/Transfer/GetAllTransfersVerify', {orgId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40", applyId: getApp().globalData.userId || "10",
flowType: "allocation", actionType: 0, page: 0, size: _this.data.size, approveType: 3}).then(res => {
if (res.code === '10000') {
_this.setData({
applyList: res.data.content
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
getList () {
const _this = this
const queryParam = {orgId: getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40", flowType: "allocation" , userId: getApp().globalData.userId || '10',
roleIds: getApp().globalData.roleIds || [3], page: 0, size: _this.data.size, approveType: 3 }
http.post('/api/Process/GetPageHistoryProcessList', queryParam).then(res => {
if (res.code === '10000') {
_this.setData({
list: res.data.content
})
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
handleTabClick({ index, tabsName }) {
this.setData({
[tabsName]: index
});
},
openAdd(event) {
let flowType = event.target.dataset.flowType
dd.navigateTo({
url: '../transferAdd/transferAdd?flowType=' + flowType
})
},
edit(event) {
let id = event.target.dataset.row.id
let nextStepId = event.target.dataset.row.nextStepId
let flowType = event.target.dataset.row.flowType
dd.navigateTo({
url: '../transferAdd/transferAdd?id=' + id + '&nextStepId=' + nextStepId + '&flowType=' + flowType
})
},
showInfo(event) {
let id = event.target.dataset.row.id
dd.navigateTo({
url: '../transferInfo/transferInfo?id=' + id + '&type=2' + '&flowType=' + event.target.dataset.row.flowType
})
},
back(event) {
let row = event.target.dataset.row
dd.confirm({
title: "确定撤销吗",
buttonLabels: [
"确定",
"取消"
],
}).then(res => {
if (res.buttonIndex === 0) {
this.confirmBack(row)
}
})
},
async confirmBack(row) {
const _this = this
var data = {
code: row.flowType,
orgId: row.orgId,
stepId: row.nextStepId,
flowGateway: "撤销"
}
let form = {}
await http.post('/api/Process/GetProcess', data).then(res => {
if (res.code === '10000') {
form = {
id: row.id,
detailList: row.detailList,
orgId : getApp().globalData.orgId || "E05CC28D-C189-4389-8081-DD0D6E483B40",
flowState : res.data.flowState,
approvalMsg : data.flowGateway,
userType: res.data.userType,
userInfo: res.data.userInfo,
dataScope: res.data.dataScope,
nextStepId: res.data.nextStepId,
currentStepName: res.data.currentStepName,
auditUser: getApp().globalData.userId || "10",
auditUserName: getApp().globalData.username || "测试"
}
}
})
await http.post('/api/Transfer/ApproveOrder', form).then(res => {
if (res.code === "10000") {
util.ddToast({ type: 'success', text: res.msg })
_this.getApply()
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
}
});
\ No newline at end of file
{
"usingComponents": {
"tabs": "mini-ali-ui/es/tabs/index",
"tab-content": "mini-ali-ui/es/tabs/tab-content/index",
"title": "mini-ali-ui/es/title/index",
"multi-liner": "mini-ali-ui/es/multi-liner/index",
"container": "mini-ali-ui/es/container/index",
"flex": "mini-ali-ui/es/flex/index",
"flex-item": "mini-ali-ui/es/flex/flex-item/index"
}
}
\ No newline at end of file
import http from '../http';
import util from '/src/libs/util.js'
import dd from 'gdt-jsapi';
// 登录接口
const LOGIN_URL = '/zzdApi/getUserInfo'
const PHONE_URL = '/api/Policeman/GetPolicemanByPhone'
// 登录方法
function login() {
// 获取免登授权码
my.getAuthCode({
success: (res) => {
http.get(getApp().globalData.host2 + LOGIN_URL, {code: res.result.code}).then(res => {
if (res.success) {
getApp().globalData.phone = res.content.data.account
http.post(PHONE_URL, {phone: res.content.data.account}).then(res => {
if (res.code === '10000' && res.data.length === 1) {
getApp().globalData.userId = res.data[0].id
getApp().globalData.username = res.data[0].nickName
getApp().globalData.orgId = res.data[0].organizationId
getApp().globalData.roleIds = res.data[0].roles.map(i => i.roleId)
getApp().globalData.code = res.data[0].code.substring(0,6)
if (getApp().cbLoginCallBack) {
getApp().cbLoginCallBack(res.data[0].id)
dd.switchTab({ url: '/pages/index/index' })
}
} else {
util.ddToast({ type: 'fail', text: '登录失败' })
}
})
}
})
}
})
}
export default login
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论