全局开发

This commit is contained in:
2024-08-02 17:26:50 +08:00
parent 1fa746d6cb
commit 03e0d44dd6
20 changed files with 931 additions and 1067 deletions

164
pages/entry/document.vue Normal file
View File

@@ -0,0 +1,164 @@
<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 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>
</view>
<view class="zd-col-24 filter_select">
<search-box
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>
<th>物料编码</th>
<th>物料规格</th>
<th>物料批次</th>
<th>计划数量</th>
<th>未入库数量</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i">
<td>{{i+1}}</td>
<td>{{e.source_form_type}}</td>
<td>{{e.source_form_date}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.assign_qty}}</td>
<td>{{e.qty}}</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" @tap="toSure">组盘确认</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {FormTypes, pmFormData} from '@/utils/mork2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
options: [],
index: '',
val1: '',
dataList: [],
pkId: '',
reload: false,
status: 'more',
contentText: {
contentdown: '查看更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
},
totalCount: 0,
pageNum: 1,
pageSize: 10
};
},
onLoad (options) {
this.title = options.title
this._FormTypes()
},
methods: {
async _FormTypes () {
let res = await FormTypes()
this.options = [...res]
this.options.map(el => {
this.$set(el, 'text', el.lable)
})
},
selectChange (e) {
this.index = e
},
searchList () {
this.dataList = []
this.pageNum = 1
this._pmFormData()
},
async _pmFormData () {
let res = await pmFormData(this.pageNum + '', this.pageSize + '', this.val1, this.index)
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._pmFormData()
}, 1000)
} else { //停止加载
this.status = 'noMore'
}
},
toEmpty () {
this.index = ''
this.val1 = ''
this.dataList = []
this.pageNum = 1
},
toSure () {
if (this.dataList.length) {
this.$store.dispatch('setPublicArr', this.dataList)
uni.navigateBack()
}
}
}
}
</script>
<style lang="stylus">
@import '../../common/style/mixin.styl';
.msg_wrapper
height auto
min-height 30%
</style>

View File

@@ -1,49 +1,32 @@
<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-17 filter_select">
<view class="zd-col-17">
<search-box
v-model="val1"
/>
</view>
</view>
</view>
<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-17 filter_select">
<input type="number" class="filter_input" v-model="obj.material_weight" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">数量</span>
</view>
<view class="zd-col-17 filter_select">
<input type="number" class="filter_input" v-model="obj.material_qty" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">牌号</span>
</view>
<view class="zd-col-17 filter_select">
<input type="text" class="filter_input" v-model="obj.material_code" disabled>
<view class="zd-col-24 filter_select">
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-6 button-default" @tap="clearUp">清空</button>
<button class="zd-col-15 button-primary" :class="{'button-info': !val1}" :disabled="disabled" @tap="_zpxxTask">确认</button>
<button class="zd-col-15 button-primary" :class="{'button-info': !val1 || !index}" :disabled="disabled" @tap="_pdaPalletIostorinvIn">确认</button>
</view>
</view>
</template>
@@ -51,7 +34,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {zpxxTask} from '@/utils/getData2.js'
import {pdaPalletIostorinvIn} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -61,7 +44,8 @@
return {
title: '',
val1: '',
obj: {},
options: [{text:'堆叠托盘', value:'22222222'},{text:'料箱',value: '11111111'}],
index: '',
disabled: false
};
},
@@ -71,24 +55,31 @@
created () {
},
methods: {
selectChange (e) {
this.index = e
},
clearUp () {
this.val1 = ''
this.obj = {}
this.index = ''
this.disabled = false
},
async _zpxxTask () {
async _pdaPalletIostorinvIn () {
this.disabled = true
if (!this.val1) {
if (!this.val1 || !this.index) {
this.disabled = false
return
}
try {
let res = await zpxxTask(this.val1)
this.disabled = false
uni.showToast({
title: res.message,
icon: 'none'
})
this.obj = res
let res = await pdaPalletIostorinvIn(this.val1, this.index)
if (res.code === '200') {
uni.showToast({
title: res.msg,
icon: 'none'
})
this.clearUp()
} else {
this.disabled = false
}
} catch (e) {
this.disabled = false
}

View File

@@ -1,5 +1,6 @@
<template>
<view class="zd_container">
<!-- 组盘入库 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<view class="zd_wrapper">
@@ -7,7 +8,7 @@
<view class="zd-col-7">
<span class="filter_label">载具编码</span>
</view>
<view class="zd-col-24 filter_select">
<view class="zd-col-24">
<search-box
v-model="val1"
/>
@@ -17,10 +18,8 @@
<view class="zd-col-7">
<span class="filter_label">关联单据</span>
</view>
<view class="zd-col-24 filter_select">
<search-box
v-model="val2"
/>
<view class="zd-col-24">
<input type="text" class="filter_input" @tap="toJump" v-model="val2">
</view>
</view>
</view>
@@ -29,7 +28,7 @@
<table>
<thead>
<tr>
<th class="fontcol1">物料编码</th>
<th>物料编码</th>
<th>物料名称</th>
<th>物料规格</th>
<th>批次</th>
@@ -37,8 +36,8 @@
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" @tap="toCheck(e)">
<td class="fontcol1">{{e.material_id}}</td>
<tr v-for="(e, i) in dataList" :key="i">
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.pcsn}}</td>
@@ -48,10 +47,14 @@
</table>
</view>
</view>
</view>
<view class="compute_wraper">
</view>
<view class="zd-row submit-bar">
<button class="zd-col-6 button-default">清空</button>
<button class="zd-col-15 button-primary" :class="{'button-info': !pkId}" :disabled="disabled">组盘确认</button>
<view class="zd-col-10"></view>
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-7 button-primary" :class="{'button-info': !checkArr.length}" :disabled="disabled">组盘确认</button>
</view>
</view>
</template>
@@ -59,7 +62,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {unpackShelfInfo, cbjqlTask} from '@/utils/getData2.js'
import {mdGruopDick} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -71,34 +74,42 @@
val1: '',
val2: '',
dataList: [],
pkId: '',
checkArr: '',
disabled: false
};
},
onLoad (options) {
this.title = options.title
},
onShow () {
if (this.$store.getters.publicArr.length) {
this.dataList = [...this.$store.getters.publicArr]
this.$store.dispatch('setPublicArr', '')
}
},
methods: {
async _unpackShelfInfo () {
let res = await unpackShelfInfo()
this.dataList = [...res]
toJump () {
uni.navigateTo({
url: '/pages/entry/document?title=关联单据'
})
},
toCheck (e) {
this.pkId = this.pkId === e.material_id ? '' : e.material_id
toEmpty () {
this.val1 = ''
this.dataList = []
},
async _cbjqlTask () {
async _mdGruopDick () {
this.disabled = true
if (!this.pkId) {
if (!this.checkArr.length) {
this.disabled = false
return
}
try {
let res = await cbjqlTask(this.pkId)
this.pkId = ''
let res = await mdGruopDick(this.dataList, this.val1, this.val2)
if (res.code === '200') {
}
this.disabled = false
this._unpackShelfInfo()
uni.showToast({
title: res.message,
title: res.msg,
icon: 'none'
})
} catch (e) {