This commit is contained in:
2025-08-08 10:03:19 +08:00
parent 5effcd61b3
commit a907127908
10 changed files with 685 additions and 367 deletions

View File

@@ -485,6 +485,13 @@
"navigationStyle": "custom"
}
}
,{
"path" : "pages/ftdl/mater-list0",
"style" :
{
"navigationStyle": "custom"
}
}
],
"globalStyle": {
// "pageOrientation": "landscape",

View File

@@ -1,6 +1,6 @@
<template>
<view class="zd_container">
<!-- 空载具出库 -->
<!-- 定点作业 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
@@ -40,7 +40,7 @@
</view>
<view class="zd-row submit-bar">
<button class="zd-col-6 button-default" @tap="clearUp">清空</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !val2 || !index || !index2}" :disabled="disabled" @tap="_vehicleOutConfirm">确认</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_sendPointTask">确认</button>
</view>
</view>
</template>
@@ -48,7 +48,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getSect, getRegion, vehicleOutConfirm} from '@/utils/getData3.js'
import {getRegions, getPointnByRegion, sendPointTask} from '@/utils/getData4.js'
export default {
components: {
NavBar,
@@ -71,12 +71,13 @@
this.title = options.title
},
created () {
this._getSect()
this._getRegions1()
this._getRegions2()
},
methods: {
async _getSect () {
async _getRegions1 () {
try {
let res = await getSect()
let res = await getRegions()
if (res) {
this.options = res
} else {
@@ -88,10 +89,11 @@
},
selectChange (e) {
this.index = e
this._getPointnByRegion1()
},
async _getRegion () {
async _getRegions2 () {
try {
let res = await getRegion()
let res = await getRegions()
if (res) {
this.options2 = res
} else {
@@ -103,22 +105,33 @@
},
selectChange2 (e) {
this.index2 = e
this._getPointnByRegion2()
},
async _getPointnByRegion1 () {
let res = await getPointnByRegion(this.index)
if (res.code === '200') {
this.val1 = res.data[0].point_code
}
},
async _getPointnByRegion2 () {
let res = await getPointnByRegion(this.index2)
if (res.code === '200') {
this.val2 = res.data[0].point_code
}
},
clearUp () {
this.val1 = ''
this.val2 = ''
this.index = ''
this.index2 = ''
this.disabled = false
},
async _vehicleOutConfirm () {
async _sendPointTask () {
this.disabled = true
if (!val1 || !val2 || !index || !index2) {
if (!val1 || !val2) {
this.disabled = false
return
}
try {
let res = await vehicleOutConfirm(this.index, this.val1)
let res = await sendPointTask(this.val1, this.val2)
if (res.code === '200') {
uni.showToast({
title: res.message,

View File

@@ -1,12 +1,12 @@
<template>
<view class="zd_container">
<!-- 任务管理 -->
<!-- 库存锁定/解锁 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">任务类型</span>
<span class="filter_label">区域</span>
</view>
<view class="zd-col-24 filter_select">
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
@@ -14,7 +14,7 @@
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">载具编码</span>
<span class="filter_label">点位</span>
</view>
<view class="zd-col-24 filter_select">
<search-box
@@ -22,42 +22,52 @@
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">物料</span>
</view>
<view class="zd-col-17">
<input type="text" class="filter_input" v-model="currentData.material_name" @tap="toJump">
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>任务类型</th>
<th>任务编码</th>
<th>载具编码</th>
<th @tap="toAllCheck"><uni-icons :type="allCheck ? 'checkbox' : 'circle'" size="24" color="#4e6ef2"></uni-icons></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_code === pkId}">
<td>{{e.task_type}}</td>
<td>{{e.task_code}}</td>
<td>{{e.vehicle_code}}</td>
<td>{{e.status}}</td>
<td>{{e.point_code1}}</td>
<td>{{e.point_code2}}</td>
<td>{{e.create_time}}</td>
<tr v-for="(e, i) in dataList" :key="i">
<td @tap="toCheck(e)"><uni-icons :type="e.checked ? 'checkbox' : 'circle'" size="24" color="#4e6ef2"></uni-icons></td>
<td>{{e.point_status}}</td>
<td>{{e.point_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.qty}}</td>
<td>{{e.measure_unit_id}}</td>
<td>{{e.containers.join(',')}}</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"/>
<!-- <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-6 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure('80')">完成</button>
<button class="zd-col-6 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure('80')">强制完成</button>
<button class="zd-col-6 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure('90')">取消</button>
<button class="zd-col-5 button-primary" @tap="searchList">查询</button>
<!-- <button class="zd-col-6 button-default" @tap="clearUp">清空</button> -->
<button class="zd-col-8 button-primary" @tap="searchList">查询</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !checkedArr.length}" :disabled="disabled" @tap="_lock">锁定</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !checkedArr.length}" :disabled="disabled2" @tap="_unlock">解锁</button>
</view>
</view>
</template>
@@ -65,7 +75,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getStatusEnum, schBaseTask, saveCheckTask} from '@/utils/getData2.js'
import {getRegions, getPointInfo, lock, unlock} from '@/utils/getData4.js'
export default {
components: {
NavBar,
@@ -74,103 +84,143 @@
data() {
return {
title: '',
val1: '',
val2: '1',
currentData: {},
dataList: [],
allCheck: false,
checkedArr: [],
options: [],
index: '',
val1: '',
dataList: [],
pkId: '',
reload: false,
status: 'more',
contentText: {
contentdown: '查看更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
},
totalCount: 0,
pageNum: 1,
pageSize: 10,
disabled: false
disabled: false,
disabled2: false,
};
},
onLoad (options) {
this.title = options.title
this._getStatusEnum()
},
created () {
this._getRegions()
},
onShow() {
if (this.$store.getters.publicObj !== '') {
this.currentData = this.$store.getters.publicObj
}
},
methods: {
async _getStatusEnum () {
let res = await getStatusEnum()
this.options = [...res]
this.options.map(el => {
this.$set(el, 'text', el.label)
searchList () {
this.dataList = []
this._getPointInfo()
},
toAllCheck () {
this.allCheck = !this.allCheck
this.dataList.map(el => {
el.checked = this.allCheck
})
},
toCheck (e) {
e.checked = !e.checked
this.checkedArr = this.dataList.filter(el => el.checked === true)
this.allCheck = this.checkedArr.length === this.dataList.length
},
toJump () {
uni.navigateTo({
url: '/pages/common/mater-list2?title=查询物料'
})
},
async _getPointInfo () {
let res = await getPointInfo( this.index, this.val1, this.currentData.material_code)
this.dataList = res.data
// this.totalCount = res.totalElements
// if (res.totalElements > 0) {
// const dataMap = res.data
// this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
// this.reload = false
// } else {
// this.dataList = []
// }
// if (this.totalCount == this.dataList.length) {
// this.reload = false
// this.status = 'noMore'
// }
},
async _getRegions () {
try {
let res = await getRegions()
if (res) {
this.options = res
} else {
this.options =[]
}
} catch (e) {
this.options = []
}
},
selectChange (e) {
this.index = e
},
searchList () {
this.dataList = []
this.pageNum = 1
this._schBaseTask()
clearUp () {
this.val1 = ''
this.val2 = ''
this.index = ''
this.index2 = ''
this.disabled = false
this.disabled2 = false
},
async _schBaseTask () {
let res = await schBaseTask(this.pageNum + '', this.pageSize + '', this.index, 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
} else {
this.dataList = []
}
if (this.totalCount == this.dataList.length) {
this.reload = false
this.status = 'noMore'
}
}
},
onReachBottom () {
if (this.totalCount > this.dataList.length) {
this.status = 'loading'
setTimeout(() => {
this.pageNum++
this._schBaseTask()
}, 1000)
} else { //停止加载
this.status = 'noMore'
}
},
toCheck (e) {
this.pkId = e.e.task_code === this.pkId ? '' : e.task_code
},
async toSure (status) {
async _lock () {
this.disabled = true
if (!this.pkId) {
if (!this.checkedArr.length) {
this.disabled = false
return
}
try {
let res = await saveCheckTask(this.pkId, status)
let res = await lock(this.checkedArr)
if (res.code === '200') {
this.index = ''
this.val1 = ''
this.dataList = []
this.pkId = ''
uni.showToast({
title: res.desc,
title: res.message,
icon: 'none'
})
this.clearUp()
} else {
uni.showToast({
title: res.desc,
title: res.message,
icon: 'none'
})
this.disabled = false
}
this.disabled = false
} catch (e) {
this.disabled = false
}
},
async _unlock () {
this.disabled2 = true
if (!this.checkedArr.length) {
this.disabled2 = false
return
}
try {
let res = await unlock(this.checkedArr)
if (res.code === '200') {
uni.showToast({
title: res.message,
icon: 'none'
})
this.clearUp()
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
this.disabled2 = false
}
} catch (e) {
this.disabled2 = false
}
}
}
}
</script>
</script>
<style lang="stylus">
</style>

View File

@@ -1,63 +1,41 @@
<template>
<view class="zd_container">
<!-- 任务管理 -->
<!-- 产线叫料 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">任务类型</span>
<view class="zd-col-8">
<span class="filter_label">区域</span>
</view>
<view class="zd-col-24 filter_select">
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
<view class="zd-col-16">
<search-box
v-model="val1"
@handleChange="handleChange1"
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">载具编码</span>
<span class="filter_label">物料</span>
</view>
<view class="zd-col-24 filter_select">
<search-box
v-model="val1"
/>
<view class="zd-col-17">
<input type="text" class="filter_input" v-model="currentData.material_name" @tap="toJump">
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">托盘数</span>
</view>
<view class="zd-col-17">
<input type="number" class="filter_input" v-model="val2">
</view>
</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>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.task_code === pkId}">
<td>{{e.task_type}}</td>
<td>{{e.task_code}}</td>
<td>{{e.vehicle_code}}</td>
<td>{{e.status}}</td>
<td>{{e.point_code1}}</td>
<td>{{e.point_code2}}</td>
<td>{{e.create_time}}</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-6 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure('80')">完成</button>
<button class="zd-col-6 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure('80')">强制完成</button>
<button class="zd-col-6 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure('90')">取消</button>
<button class="zd-col-5 button-primary" @tap="searchList">查询</button>
<button class="zd-col-6 button-default" @tap="clearUp">清空</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_vehicleOutConfirm">确认</button>
</view>
</view>
</template>
@@ -65,7 +43,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getStatusEnum, schBaseTask, saveCheckTask} from '@/utils/getData2.js'
import {getRegionByPoint, vehicleOutConfirm} from '@/utils/getData4.js'
export default {
components: {
NavBar,
@@ -74,103 +52,75 @@
data() {
return {
title: '',
options: [],
index: '',
val1: '',
dataList: [],
pkId: '',
reload: false,
status: 'more',
contentText: {
contentdown: '查看更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
},
totalCount: 0,
pageNum: 1,
pageSize: 10,
val2: '1',
currentData: {},
disabled: false
};
},
onLoad (options) {
this.title = options.title
this._getStatusEnum()
},
created () {
},
onShow() {
if (this.$store.getters.publicObj !== '') {
this.currentData = this.$store.getters.publicObj
}
},
methods: {
async _getStatusEnum () {
let res = await getStatusEnum()
this.options = [...res]
this.options.map(el => {
this.$set(el, 'text', el.label)
handleChange1 (e) {
this._getRegionByPoint(e)
},
async _getRegionByPoint (e) {
try {
let res = await getRegionByPoint(e)
if (res) {
this.val1 = res.code
}
} catch (e) {
this.val1 = ''
}
},
toJump () {
uni.navigateTo({
url: '/pages/ftdl/mater-list0?title=查询物料'
})
},
selectChange (e) {
this.index = e
clearUp () {
this.val1 = ''
this.val2 = ''
this.disabled = false
},
searchList () {
this.dataList = []
this.pageNum = 1
this._schBaseTask()
},
async _schBaseTask () {
let res = await schBaseTask(this.pageNum + '', this.pageSize + '', this.index, 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
} else {
this.dataList = []
}
if (this.totalCount == this.dataList.length) {
this.reload = false
this.status = 'noMore'
}
}
},
onReachBottom () {
if (this.totalCount > this.dataList.length) {
this.status = 'loading'
setTimeout(() => {
this.pageNum++
this._schBaseTask()
}, 1000)
} else { //停止加载
this.status = 'noMore'
}
},
toCheck (e) {
this.pkId = e.e.task_code === this.pkId ? '' : e.task_code
},
async toSure (status) {
async _vehicleOutConfirm () {
this.disabled = true
if (!this.pkId) {
if (!val1 || !val2) {
this.disabled = false
return
}
try {
let res = await saveCheckTask(this.pkId, status)
let res = await vehicleOutConfirm(this.val1, this.currentData.material_code, this.val2)
if (res.code === '200') {
this.index = ''
this.val1 = ''
this.dataList = []
this.pkId = ''
uni.showToast({
title: res.desc,
title: res.message,
icon: 'none'
})
this.clearUp()
} else {
uni.showToast({
title: res.desc,
title: res.message,
icon: 'none'
})
this.disabled = false
}
this.disabled = false
} catch (e) {
this.disabled = false
}
}
}
}
</script>
</script>
<style lang="stylus">
</style>

View File

@@ -1,20 +1,12 @@
<template>
<view class="zd_container">
<!-- 任务管理 -->
<!-- 产线下料 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">任务类型</span>
</view>
<view class="zd-col-24 filter_select">
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">载具编码</span>
<span class="filter_label">点位</span>
</view>
<view class="zd-col-24 filter_select">
<search-box
@@ -22,30 +14,49 @@
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">送往区域</span>
</view>
<view class="zd-col-24 filter_select">
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
</view>
</view>
<view class="zd-row">
<view class="zd-col-11">
</view>
<view class="zd-col-4">
<button class="mini-btn" size="mini" style="display: block; margin-top: 9px; width: 103%;" type="primary" @tap="handleAdd">插入行</button>
</view>
<view class="zd-col-4">
<button class="mini-btn" size="mini" style="display: block; margin-top: 9px; width: 103%;" type="primary" @tap="handleAdd">删除行</button>
</view>
<view class="zd-col-4">
<button class="mini-btn" size="mini" style="display: block; margin-top: 9px; width: 103%;" type="primary" @tap="handleAdd">复制行</button>
</view>
</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_code === pkId}">
<td>{{e.task_type}}</td>
<tr v-for="(e, i) in dataList" :key="i">
<td>{{i+1}}</td>
<td>{{e.task_code}}</td>
<td>{{e.vehicle_code}}</td>
<td>{{e.status}}</td>
<td>{{e.point_code1}}</td>
<td>{{e.point_code2}}</td>
<td>{{e.create_time}}</td>
</tr>
</tbody>
</table>
@@ -54,10 +65,9 @@
<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-6 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure('80')">完成</button>
<button class="zd-col-6 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure('80')">强制完成</button>
<button class="zd-col-6 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure('90')">取消</button>
<button class="zd-col-5 button-primary" @tap="searchList">查询</button>
<!-- <button class="zd-col-6 button-default" @tap="clearUp">清空</button> -->
<!-- <button class="zd-col-11 button-primary" :class="{'button-info': !dataList.length}" :disabled="disabled" @tap="toSure('80')">物料绑定</button> -->
<button class="zd-col-22 button-primary" :class="{'button-info': !dataList.length}" :disabled="disabled" @tap="toSure('80')">确认下料</button>
</view>
</view>
</template>
@@ -65,7 +75,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getStatusEnum, schBaseTask, saveCheckTask} from '@/utils/getData2.js'
import {getSect, schBaseTask, saveCheckTask} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -74,11 +84,10 @@
data() {
return {
title: '',
options: [],
index: '',
val1: '',
dataList: [],
pkId: '',
options: [],
index: '',
reload: false,
status: 'more',
contentText: {
@@ -94,26 +103,47 @@
},
onLoad (options) {
this.title = options.title
this._getStatusEnum()
},
created () {
this._getSect()
},
methods: {
async _getStatusEnum () {
let res = await getStatusEnum()
this.options = [...res]
this.options.map(el => {
this.$set(el, 'text', el.label)
})
async _getSect () {
try {
let res = await getSect()
if (res) {
this.options = res
} else {
this.options =[]
}
} catch (e) {
this.options = []
}
},
selectChange (e) {
this.index = e
},
handleAdd () {
if (!this.val1) {
return
}
this.dataList.push({vehicle_code: this.val1, site_code: this.val1})
this.dataList.map(el => {
this.$set(el, 'checked', false)
})
},
clearUp () {
this.val1 = ''
this.dataList = []
this.disabled = false
},
searchList () {
this.dataList = []
this.pageNum = 1
this._schBaseTask()
},
async _schBaseTask () {
let res = await schBaseTask(this.pageNum + '', this.pageSize + '', this.index, this.val1)
let res = await schBaseTask(this.pageNum + '', this.pageSize + '', this.val1)
if (res.code === '200') {
this.totalCount = res.totalElements
if (res.totalElements > 0) {
@@ -140,22 +170,17 @@
this.status = 'noMore'
}
},
toCheck (e) {
this.pkId = e.e.task_code === this.pkId ? '' : e.task_code
},
async toSure (status) {
this.disabled = true
if (!this.pkId) {
if (!this.dataList.length) {
this.disabled = false
return
}
try {
let res = await saveCheckTask(this.pkId, status)
let res = await saveCheckTask(this.dataList)
if (res.code === '200') {
this.index = ''
this.val1 = ''
this.dataList = []
this.pkId = ''
uni.showToast({
title: res.desc,
icon: 'none'

View File

@@ -20,38 +20,28 @@
<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">
<td>{{e.task_type}}</td>
<td>{{e.task_code}}</td>
<td>{{e.vehicle_code}}</td>
<td>{{e.status}}</td>
<td>{{e.point_code1}}</td>
<td>{{e.point_code2}}</td>
<td>{{e.create_time}}</td>
<td>{{e.create_time}}</td>
<td>{{e.create_time}}</td>
<td>{{e.container_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.pscn}}</td>
<td>{{e.measure_unit_id}}</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"/>
<!-- <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-6 button-default" @tap="clearUp">清空</button>
<button class="zd-col-7 button-primary" :class="{'button-info': !dataList.length}" :disabled="disabled" @tap="toSure('80')">确认取货</button>
<button class="zd-col-7 button-primary" :class="{'button-info': !val1 || !dataList.length}" :disabled="disabled" @tap="_comfirmGetting">确认取货</button>
</view>
</view>
</template>
@@ -59,7 +49,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {schBaseTask, saveCheckTask} from '@/utils/getData2.js'
import {getMaterialInfoByPoint, comfirmGetting} from '@/utils/getData4.js'
export default {
components: {
NavBar,
@@ -95,23 +85,24 @@
searchList () {
this.dataList = []
this.pageNum = 1
this._schBaseTask()
this._getMaterialInfoByPoint()
},
async _schBaseTask () {
let res = await schBaseTask(this.pageNum + '', this.pageSize + '', this.val1)
async _getMaterialInfoByPoint () {
let res = await getMaterialInfoByPoint(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
} else {
this.dataList = []
}
if (this.totalCount == this.dataList.length) {
this.reload = false
this.status = 'noMore'
}
this.dataList = res.data
// this.totalCount = res.totalElements
// if (res.totalElements > 0) {
// const dataMap = res.content
// this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
// this.reload = false
// } else {
// this.dataList = []
// }
// if (this.totalCount == this.dataList.length) {
// this.reload = false
// this.status = 'noMore'
// }
}
},
onReachBottom () {
@@ -119,20 +110,20 @@
this.status = 'loading'
setTimeout(() => {
this.pageNum++
this._schBaseTask()
this._getMaterialInfoByPoint()
}, 1000)
} else { //停止加载
this.status = 'noMore'
}
},
async toSure (status) {
async _comfirmGetting () {
this.disabled = true
if (!this.dataList.length) {
if (!this.val1 || !this.dataList.length) {
this.disabled = false
return
}
try {
let res = await saveCheckTask(this.dataList)
let res = await comfirmGetting(this.val1, this.dataList)
if (res.code === '200') {
this.val1 = ''
this.dataList = []

View File

@@ -1,20 +1,12 @@
<template>
<view class="zd_container">
<!-- 任务管理 -->
<!-- 人工放货 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">任务类型</span>
</view>
<view class="zd-col-24 filter_select">
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">载具编码</span>
<span class="filter_label">点位</span>
</view>
<view class="zd-col-24 filter_select">
<search-box
@@ -22,30 +14,41 @@
/>
</view>
</view>
<view class="zd-row">
<view class="zd-col-11">
</view>
<view class="zd-col-4">
<button class="mini-btn" size="mini" style="display: block; margin-top: 9px; width: 103%;" type="primary" @tap="handleAdd">插入行</button>
</view>
<view class="zd-col-4">
<button class="mini-btn" size="mini" style="display: block; margin-top: 9px; width: 103%;" type="primary" @tap="handleAdd">删除行</button>
</view>
<view class="zd-col-4">
<button class="mini-btn" size="mini" style="display: block; margin-top: 9px; width: 103%;" type="primary" @tap="handleAdd">复制行</button>
</view>
</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_code === pkId}">
<td>{{e.task_type}}</td>
<tr v-for="(e, i) in dataList" :key="i">
<td>{{i+1}}</td>
<td>{{e.task_code}}</td>
<td>{{e.vehicle_code}}</td>
<td>{{e.status}}</td>
<td>{{e.point_code1}}</td>
<td>{{e.point_code2}}</td>
<td>{{e.create_time}}</td>
</tr>
</tbody>
</table>
@@ -54,10 +57,9 @@
<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-6 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure('80')">完成</button>
<button class="zd-col-6 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure('80')">强制完成</button>
<button class="zd-col-6 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure('90')">取消</button>
<button class="zd-col-5 button-primary" @tap="searchList">查询</button>
<!-- <button class="zd-col-6 button-default" @tap="clearUp">清空</button> -->
<button class="zd-col-11 button-primary" :class="{'button-info': !dataList.length}" :disabled="disabled" @tap="toSure('80')">物料绑定</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !dataList.length}" :disabled="disabled" @tap="toSure('80')">空载具绑定</button>
</view>
</view>
</template>
@@ -65,7 +67,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getStatusEnum, schBaseTask, saveCheckTask} from '@/utils/getData2.js'
import {schBaseTask, saveCheckTask} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -74,11 +76,8 @@
data() {
return {
title: '',
options: [],
index: '',
val1: '',
dataList: [],
pkId: '',
reload: false,
status: 'more',
contentText: {
@@ -94,18 +93,21 @@
},
onLoad (options) {
this.title = options.title
this._getStatusEnum()
},
methods: {
async _getStatusEnum () {
let res = await getStatusEnum()
this.options = [...res]
this.options.map(el => {
this.$set(el, 'text', el.label)
handleAdd () {
if (!this.val1) {
return
}
this.dataList.push({vehicle_code: this.val1, site_code: this.val1})
this.dataList.map(el => {
this.$set(el, 'checked', false)
})
},
selectChange (e) {
this.index = e
clearUp () {
this.val1 = ''
this.dataList = []
this.disabled = false
},
searchList () {
this.dataList = []
@@ -113,7 +115,7 @@
this._schBaseTask()
},
async _schBaseTask () {
let res = await schBaseTask(this.pageNum + '', this.pageSize + '', this.index, this.val1)
let res = await schBaseTask(this.pageNum + '', this.pageSize + '', this.val1)
if (res.code === '200') {
this.totalCount = res.totalElements
if (res.totalElements > 0) {
@@ -140,22 +142,17 @@
this.status = 'noMore'
}
},
toCheck (e) {
this.pkId = e.e.task_code === this.pkId ? '' : e.task_code
},
async toSure (status) {
this.disabled = true
if (!this.pkId) {
if (!this.dataList.length) {
this.disabled = false
return
}
try {
let res = await saveCheckTask(this.pkId, status)
let res = await saveCheckTask(this.dataList)
if (res.code === '200') {
this.index = ''
this.val1 = ''
this.dataList = []
this.pkId = ''
uni.showToast({
title: res.desc,
icon: 'none'

134
pages/ftdl/mater-list0.vue Normal file
View File

@@ -0,0 +1,134 @@
<template>
<view class="zd_container">
<!-- 查询物料 -->
<nav-bar :title="title" :inner="true"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">物料</span>
</view>
<view class="zd-col-24">
<input type="text" class="filter_input" v-model="val1">
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>物料编码</th>
<th>物料名称</th>
<th>单位</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.material_code === pkId}" @tap="toCheck(e)">
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.measure_unit_id}}</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-5 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-8 button-primary" @tap="searchList">查询</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !pkId}" @tap="toSure">确认</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {selectMaterials} from '@/utils/getData4.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
// dataList: [],
dataList: [
{material_code: 'code1', material_name: 'name1', measure_unit_id: '千克'},
{material_code: 'code2', material_name: 'name2', measure_unit_id: '千克'},
{material_code: 'code3', material_name: 'name3', measure_unit_id: '千克'},
],
pkId: '',
pkObj: {},
reload: false,
status: 'more',
contentText: {
contentdown: '查看更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
},
totalCount: 0,
pageNum: 1,
pageSize: 10
};
},
onLoad (options) {
this.title = options.title
this.searchList()
},
methods: {
searchList () {
this.dataList = []
this.pageNum = 1
this._selectMaterials()
},
async _selectMaterials () {
let res = await selectMaterials( this.val1)
this.dataList = res.data
// this.totalCount = res.totalElements
// if (res.totalElements > 0) {
// const dataMap = res.data
// this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
// this.reload = false
// } else {
// this.dataList = []
// }
// if (this.totalCount == this.dataList.length) {
// this.reload = false
// this.status = 'noMore'
// }
},
onReachBottom () {
if (this.totalCount > this.dataList.length) {
this.status = 'loading'
setTimeout(() => {
this.pageNum++
this._selectMaterials()
}, 1000)
} else { //停止加载
this.status = 'noMore'
}
},
toCheck (e) {
this.pkId = this.pkId === e.material_code ? '' : e.material_code
this.pkObj = this.pkId === e.material_code ? e : {}
},
toEmpty () {
this.val1 = ''
this.dataList = []
this.pageNum = 1
this.pkId = ''
},
toSure () {
if (this.pkId) {
this.$store.dispatch('setPublicObj', this.pkObj)
uni.navigateBack()
}
}
}
}
</script>

View File

@@ -1,6 +1,6 @@
<template>
<view class="zd_container">
<!-- 任务管理 -->
<!-- 作业管理 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
@@ -47,12 +47,12 @@
</table>
</view>
</view>
<uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/>
<!-- <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-7 button-primary" @tap="searchList">查询</button>
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure('80')">完成</button>
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure('80')">强制完成</button>
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="_againTask">重新下发</button>
<button class="zd-col-7 button-primary" :class="{'button-info': !pkId}" :disabled="disabled2" @tap="_forceConfirm">强制完成</button>
</view>
</view>
</template>
@@ -60,7 +60,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {schBaseTask, saveCheckTask} from '@/utils/getData2.js'
import {queryTask, againTask, forceConfirm} from '@/utils/getData4.js'
export default {
components: {
NavBar,
@@ -82,7 +82,8 @@
totalCount: 0,
pageNum: 1,
pageSize: 10,
disabled: false
disabled: false,
disabled2: false,
};
},
onLoad (options) {
@@ -92,23 +93,24 @@
searchList () {
this.dataList = []
this.pageNum = 1
this._schBaseTask()
this._queryTask()
},
async _schBaseTask () {
let res = await schBaseTask(this.pageNum + '', this.pageSize + '', this.index, this.val1)
async _queryTask () {
let res = await queryTask(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
} else {
this.dataList = []
}
if (this.totalCount == this.dataList.length) {
this.reload = false
this.status = 'noMore'
}
this.dataList = res.data
// this.totalCount = res.totalElements
// if (res.totalElements > 0) {
// const dataMap = res.content
// this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
// this.reload = false
// } else {
// this.dataList = []
// }
// if (this.totalCount == this.dataList.length) {
// this.reload = false
// this.status = 'noMore'
// }
}
},
onReachBottom () {
@@ -116,7 +118,7 @@
this.status = 'loading'
setTimeout(() => {
this.pageNum++
this._schBaseTask()
this._queryTask()
}, 1000)
} else { //停止加载
this.status = 'noMore'
@@ -125,16 +127,15 @@
toCheck (e) {
this.pkId = e.e.task_code === this.pkId ? '' : e.task_code
},
async toSure (status) {
async _againTask () {
this.disabled = true
if (!this.pkId) {
this.disabled = false
return
}
try {
let res = await saveCheckTask(this.pkId, status)
let res = await againTask(this.pkId)
if (res.code === '200') {
this.index = ''
this.val1 = ''
this.dataList = []
this.pkId = ''
@@ -152,6 +153,33 @@
} catch (e) {
this.disabled = false
}
},
async _forceConfirm () {
this.disabled2 = true
if (!this.pkId) {
this.disabled2 = false
return
}
try {
let res = await forceConfirm(this.pkId)
if (res.code === '200') {
this.val1 = ''
this.dataList = []
this.pkId = ''
uni.showToast({
title: res.desc,
icon: 'none'
})
} else {
uni.showToast({
title: res.desc,
icon: 'none'
})
}
this.disabled2 = false
} catch (e) {
this.disabled2 = false
}
}
}
}

123
utils/getData4.js Normal file
View File

@@ -0,0 +1,123 @@
import request from './request.js'
// 版本更新测试
export const pdaUpdate = () => request({
url:'api/pda/iosOut/update'
})
// export const pdaUpdate = () => {
// let res = {
// versionName: '1.0.1',
// url: 'https://mp-e979e0eb-882b-42b3-a4a1-923ad08ea194.cdn.bspapp.com/cloudstorage/f72ec59f-7b25-487d-a034-fead1b6654c6.apk'
// }
// return res
// }
// 登录
export const handLogin = (user, password) => request({
url:'mobile/auth/login',
data: {
username: user,
password: password
}
})
// 公共接口
// 产线叫料
// 1.1根据点位查询区域
export const getRegionByPoint = (pcode) => request({
url:'api/hand/getRegionByPoint',
data: {point_code: pcode}
})
// 1.2查询物料信息
export const selectMaterials = (blurry) => request({
url:'api/hand/selectMaterials',
data: {blurry: blurry}
})
// 1.3叫料
export const loading = (rcode, mcode, num) => request({
url:'api/hand/loading',
data: {region_code: rcode, material_code: mcode, num: num}
})
// 产线下料
// 1.2查询所有区域
export const getRegions = () => request({
url:'api/hand/getRegions',
data: {}
})
// 1.3确认下料
export const blanking = (pcode, arr, rcode) => request({
url:'api/hand/blanking',
data: {point_code: pcode, data: arr, region_code: rcode}
})
// 人工放货
// 1.2物料绑定
export const materialBinding = (pcode, arr) => request({
url:'api/hand/materialBinding',
data: {point_code: pcode, data: arr}
})
// 1.3空载具绑定
export const vehicleBinding = (pcode) => request({
url:'api/hand/vehicleBinding',
data: {point_code: pcode}
})
// 人工取货
// 1.1根据点位查询物料信息
export const getMaterialInfoByPoint = (pcode) => request({
url:'api/hand/getMaterialInfoByPoint',
data: {point_code: pcode}
})
// 1.2确认取货
export const comfirmGetting = (pcode, arr) => request({
url:'api/hand/comfirmGetting',
data: {point_code: pcode, data: arr}
})
// 点位维护
// 1.1查询缓冲区点位库存
export const getPointInfo = (rcode, pcode, mcode) => request({
url:'api/hand/getPointInfo',
data: {region_code: rcode, point_code: pcode, material_code: mcode}
})
// 1.2锁定
export const lock = (arr) => request({
url:'api/hand/lock',
data: {data: arr}
})
// 1.3解锁
export const unlock = (arr) => request({
url:'api/hand/unlock',
data: {data: arr}
})
// 定点任务
// 1.1根据区域查询点位
export const getPointnByRegion = (rcode) => request({
url:'api/hand/getPointnByRegion',
data: {region_code: rcode}
})
// 1.2确认
export const sendPointTask = (pcode1, pcode2) => request({
url:'api/hand/sendPointTask',
data: {point_code: pcode1, point_code2: pcode2}
})
// 作业管理
// 1.1查询未完成的任务
export const queryTask = (tcode) => request({
url:'api/hand/queryTask',
data: {task_code: tcode}
})
// 1.2重新下发
export const againTask = (tcode) => request({
url:'api/hand/againTask',
data: {task_code: tcode}
})
// 1.3强制确认
export const forceConfirm = (tcode) => request({
url:'api/hand/forceConfirm',
data: {task_code: tcode}
})