This commit is contained in:
2025-10-22 10:26:00 +08:00
7 changed files with 189 additions and 157 deletions

View File

@@ -1,6 +1,5 @@
# 注意事项
+ 原生APP云打包使用自有证书
+ 证书别名testalias
+ 接口在线地址:(https://apifox.com/apidoc/shared-e9d4798e-2db1-493d-a0cb-7a0e881c4bd6/api-160097540)
+ app图标为lms
+ 接口在线地址http://47.98.105.245:8001/project/21/interface/api/cat_122
+ 接口在线地址:(http://47.111.78.178:8014/)
+ app图标为lms

View File

@@ -1,6 +1,6 @@
<template>
<view class="zd_container">
<!-- 机台工单维护 -->
<!-- 历史查询 -->
<nav-bar :title="title" :inner="true"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
@@ -25,9 +25,9 @@
<span class="filter_label">关键字</span>
</view>
<view class="zd-col-14">
<input type="text" placeholder="载具号/点位号/作业号" class="filter_input" v-model="keyword" @focus="handleFocus">
<input type="text" placeholder="载具号/起点/终点/任务号" class="filter_input" v-model="keyword" @focus="handleFocus">
</view>
<button class="mini-btn" type="primary" size="mini" @tap="searchList">查询</button>
<button class="mini-btn" type="primary" size="mini" @tap="_queryHistoryTask">查询</button>
</view>
</view>
<view class="zd_wrapper grid-wraper">
@@ -48,21 +48,23 @@
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.material_id === pkId}" @tap="toCheck(e)">
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.unit_id}}</td>
<td>{{e.single_weight}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.task_time}}</td>
<td>{{e.vehicle_code}}</td>
<td>{{e.point_code1}}</td>
<td>{{e.point_code2}}</td>
<td>{{['生成', '', '', '下发', '执行中', '完成'][Number(e.task_status)]}}</td>
<td>{{e.task_code}}</td>
<td>{{e.config_name}}</td>
<td>{{e.car_no}}</td>
<td>{{e.remark}}</td>
</tr>
</tbody>
</table>
</view>
</view>
<uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-24 button-primary" :class="{'button-info': !pkId}" @tap="toSure">确认</button>
<button class="zd-col-24 button-primary" @tap="toSure">返回</button>
</view>
</view>
</template>
@@ -71,7 +73,7 @@
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getDate} from '@/utils/utils.js'
import {groupMaterList} from '@/utils/getData2.js'
import {queryHistoryTask} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -86,19 +88,7 @@
keyword: null,
date1: currentDate,
date2: currentDate,
dataList: [],
pkId: '',
pkObj: {},
reload: false,
status: 'more',
contentText: {
contentdown: '查看更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
},
totalCount: 0,
pageNum: 1,
pageSize: 10
dataList: []
};
},
computed: {
@@ -111,6 +101,7 @@
},
onLoad (options) {
this.title = options.title
this._queryHistoryTask()
},
methods: {
handleFocus () {
@@ -122,48 +113,24 @@
bindDateChange2: function(e) {
this.date2 = e.detail.value
},
searchList () {
this.dataList = []
this.pageNum = 1
this._groupMaterList()
},
async _groupMaterList () {
let res = await groupMaterList(this.pageNum + '', this.pageSize + '', this.val1)
if (res.code === '200') {
this.totalCount = res.totalElements
if (res.totalElements > 0) {
const dataMap = res.content
this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
this.reload = false
async _queryHistoryTask () {
try {
let res = await queryHistoryTask(this.keyword, this.date1, this.date2)
if (res && res.data) {
this.dataList = [...res.data]
} else {
this.dataList = []
uni.showToast({
title: res.message,
icon: 'none'
})
}
if (this.totalCount == this.dataList.length) {
this.reload = false
this.status = 'noMore'
}
} catch (e) {
this.dataList = []
}
},
onReachBottom () {
if (this.totalCount > this.dataList.length) {
this.status = 'loading'
setTimeout(() => {
this.pageNum++
this._groupMaterList()
}, 1000)
} else { //停止加载
this.status = 'noMore'
}
},
toCheck (e) {
this.pkId = this.pkId === e.material_id ? '' : e.material_id
this.pkObj = this.pkId === e.material_id ? e : {}
},
toSure () {
if (this.pkId) {
this.$store.dispatch('setPublicObj', this.pkObj)
uni.navigateBack()
}
uni.navigateBack()
}
}
}

View File

@@ -1,32 +1,44 @@
<template>
<view class="zd_container">
<nav-bar title="任务管理"></nav-bar>
<!-- 任务管理 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">关键字</span>
</view>
<view class="zd-col-13">
<search-box v-model="keyword"/>
</view>
<button class="mini-btn" type="primary" size="mini" @tap="_queryTask">查询</button>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>任务</th>
<th>载具</th>
<th>起点</th>
<th>终点</th>
<th>状态</th>
<th>托盘</th>
<th>物料类型</th>
<th>优先级</th>
<th>时间</th>
<th>作业</th>
<th>作业类型</th>
<th>设备号</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.task_uuid === pkId}">
<td>{{e.task_no}}</td>
<td>{{e.start_devicecode}}</td>
<td>{{e.next_devicecode}}</td>
<td>{{e.task_status_name}}</td>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.task_id === pkId}">
<td>{{e.vehicle_code}}</td>
<td>{{e.material_type_name}}</td>
<td>{{e.priority}}</td>
<td>{{e.create_time}}</td>
<td>{{e.point_code1}}</td>
<td>{{e.point_code2}}</td>
<td>{{['生成', '', '', '下发', '执行中', '完成'][Number(e.task_status)]}}</td>
<td>{{e.task_code}}</td>
<td>{{e.config_name}}</td>
<td>{{e.car_no}}</td>
<td>{{e.remark}}</td>
</tr>
</tbody>
</table>
@@ -34,89 +46,114 @@
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-11 button-primary" :class="{'button-info': !pkId}" :disabled="disabled1" @tap="toSure1('1')">重新生成</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !pkId}" :disabled="disabled2" @tap="toSure2('2')">强制完成</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !pkId}" :disabled="disabled1" @tap="_taskOperation">重新生成</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !pkId}" :disabled="disabled2" @tap="_forceConfirmTask">强制完成</button>
<button class="zd-col-6 button-primary" @tap="toJump('operation?title=历史查询')">历史查询</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import {queryTask, taskOperation} from '@/utils/getData2.js'
import SearchBox from '@/components/SearchBox.vue'
import {queryTask, taskOperation, forceConfirmTask} from '@/utils/getData2.js'
export default {
components: {
NavBar
NavBar,
SearchBox
},
data() {
return {
title: '',
keyword: '',
startPoint: '',
endPoint: '',
dataList: [],
disabled1: false,
disabled2: false,
disabled3: false,
pkId: ''
pkId: '',
pkObj: {}
};
},
created () {
this._queryTask(this.keyword, this.startPoint, this.endPoint)
},
onLoad (options) {
this.title = options.title
this._queryTask()
},
methods: {
toJump (name) {
uni.navigateTo({
url: `/pages/General/${name}`
})
},
async _queryTask () {
let res = await queryTask(this.keyword, this.startPoint, this.endPoint)
if (res.code === '1') {
this.dataList = [...res.result]
} else {
uni.showToast({
title: res.desc,
icon: 'none'
})
}
},
async _taskOperation (type) {
try {
let res = await taskOperation(this.pkId, type)
if (res.code === '1') {
this.disabled1 = false
this.disabled2 = false
this.pkId = ''
this._queryTask()
uni.showToast({
title: res.desc,
icon: 'none'
})
let res = await queryTask(this.keyword)
if (res && res.data) {
this.dataList = [...res.data]
} else {
this.dataList = []
uni.showToast({
title: res.desc,
title: res.message,
icon: 'none'
})
this.disabled1 = false
this.disabled2 = false
}
} catch (err) {
this.disabled1 = false
this.disabled2 = false
} catch (e) {
this.dataList = []
}
},
toCheck (e) {
this.pkId = this.pkId === e.task_uuid ? '' : e.task_uuid
},
toSure1 (type) {
async _taskOperation () {
this.disabled1 = true
if (!this.pkId) {
this.disabled1 = false
return
}
this._taskOperation(type)
try {
let res = await taskOperation(this.pkObj)
if (res) {
this._queryTask()
uni.showToast({
title: res.message,
icon: 'none'
})
}
this.disabled1 = false
this.disabled2 = false
this.pkId = ''
this.pkObj = {}
} catch (err) {
this.disabled1 = false
this.disabled2 = false
this.pkId = ''
this.pkObj = {}
}
},
toSure2 (type) {
async _forceConfirmTask () {
this.disabled2 = true
if (!this.pkId) {
this.disabled2 = false
return
}
this._taskOperation(type)
try {
let res = await forceConfirmTask(this.pkObj)
if (res) {
this._queryTask()
uni.showToast({
title: res.message,
icon: 'none'
})
}
this.disabled1 = false
this.disabled2 = false
this.pkId = ''
this.pkObj = {}
} catch (err) {
this.disabled1 = false
this.disabled2 = false
this.pkId = ''
this.pkObj = {}
}
},
toCheck (e) {
this.pkId = this.pkId === e.task_id ? '' : e.task_id
this.pkObj = this.pkId === e.task_id ? e : {}
}
}
}

View File

@@ -9,7 +9,7 @@
<span class="filter_label">载具编码</span>
</view>
<view class="zd-col-18">
<search-box v-model="vehicleCode"/>
<search-box v-model="vehicleCode" @handleChange="handleChange" @handleDel="handleDel"/>
</view>
</view>
<view class="zd-row border-bottom">
@@ -83,10 +83,10 @@
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">料箱类型</span>
<span class="filter_label filter_input_disabled">料箱类型</span>
</view>
<view class="zd-col-18 filter_select">
<uni-data-select v-model="index2" :localdata="options2"></uni-data-select>
<view class="zd-col-18">
<input type="text" class="filter_input filter_input_disabled" v-model="boxType" disabled>
</view>
</view>
<view class="zd-row border-bottom">
@@ -114,8 +114,8 @@
import NumberInput from '@/components/NumberInput.vue'
import {getDate} from '@/utils/utils.js'
const currentDate = getDate({format: true})
// import {queryGroupQuality, queryBoxType} from '@/utils/mork2.js'
import {queryGroupQuality, queryBoxType, confirmBox} from '@/utils/getData2.js'
// import {queryGroupQuality, queryNowVehicle} from '@/utils/mork2.js'
import {queryGroupQuality, queryNowVehicle, confirmBox} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -129,8 +129,7 @@
date: currentDate,
options1: [],
index1: '',
options2: [],
index2: '',
boxType: null,
materialData: {},
suppData: {},
pcsn: null,
@@ -151,7 +150,6 @@
onLoad (options) {
this.title = options.title
this._queryGroupQuality()
this._queryBoxType()
},
onShow () {
if (this.$store.getters.publicObj !== '') {
@@ -164,6 +162,26 @@
}
},
methods: {
handleChange (e) {
if (e) {
this._queryNowVehicle(e)
}
},
handleDel () {
this.boxType = ''
},
async _queryNowVehicle (e) {
try {
let res = await queryNowVehicle(e)
if (res) {
this.boxType = res.data.box_type
} else {
this.boxType = ''
}
} catch (e) {
this.boxType = ''
}
},
toJump (name) {
uni.navigateTo({
url: `/pages/General/${name}`
@@ -185,23 +203,11 @@
this.options1 = []
}
},
async _queryBoxType () {
try {
let res = await queryBoxType()
if (res && res.data) {
this.options2 = [...res.data]
} else {
this.options2 = []
}
} catch (e) {
this.options2 = []
}
},
toEmpty () {
this.vehicleCode = ''
this.date = currentDate
this.index1 = ''
this.index2 = ''
this.boxType = null
this.materialData = {}
this.suppData = {}
this.pcsn = null
@@ -215,7 +221,7 @@
return
}
try {
let res = await confirmBox(this.vehicleCode, this.materialData.material_id, this.materialData.material_code, this.materialData.material_name, this.suppData.supp_code, this.suppData.supp_name, this.pcsn, this.date, this.qty, this.index1, this.index2, this.num)
let res = await confirmBox(this.vehicleCode, this.materialData.material_id, this.materialData.material_code, this.materialData.material_name, this.suppData.supp_code, this.suppData.supp_name, this.pcsn, this.date, this.qty, this.index1, this.boxType, this.num)
if (res) {
uni.showToast({
title: res.message,

View File

@@ -114,6 +114,7 @@
let res = await getInvInfoQty(this.val1)
this.kcqty = res.data.ivt_qty
this.materialData.qty1 = res.data.ivt_qty
this.materialData.fac_qty = this.kcqty
},
async _materialBoxInventoryConfirm () {
this.disabled = true

View File

@@ -56,6 +56,12 @@ export const queryVehicleType = (time, search) => request({
url:'api/pdaGeneralPublic/queryVehicleType',
data: {start_time: time, search: search}
})
// 查询当前载具类型
export const queryNowVehicle = (code) => request({
url:'api/pdaGeneralPublic/queryNowVehicle',
data: {vehicle_code: code}
})
// 确认组箱(入库组箱)
export const confirmBox = (scode, id, mcode, mname, spcode, spname, pcsn, time, qty, quality, type, num) => request({
url:'api/pdaInGroupBox/confirmBox',
@@ -153,20 +159,29 @@ export const clearMaterial = (code, scode) => request({
/**
* 任务管理
*/
// 1.1 查询未完成指令
export const queryTask = (keyword, scode, ncode) => request({
url:'api/hand/tasks',
// 查询
export const queryTask = (keyword) => request({
url:'api/pdaTask/queryTask',
data: {
keyword: keyword,
start_devicecode: scode,
next_devicecode: ncode
search: keyword
}
})
// 1.2 指令操作
export const taskOperation = (uuid, type) => request({
url:'api/hand/taskoperation',
// 历史查询
export const queryHistoryTask = (keyword, st, et) => request({
url:'api/pdaTask/queryHistoryTask',
data: {
inst_uuid: uuid,
type: type
search: keyword,
start_time: st,
end_time: et
}
})
// 重新下发
export const taskOperation = (data) => request({
url:'api/pdaTask/againSendTask',
data: data
})
// 强制完成任务
export const forceConfirmTask = (data) => request({
url:'api/pdaTask/forceConfirmTask',
data: data
})

View File

@@ -136,4 +136,11 @@ export const updatePointqueryPointInfo = (time, search) => {
]
}
return res
}
export const queryNowVehicle = () => {
let res = {
message: 'ok',
data: {box_type: 'aa'}
}
return res
}