add 二楼生产出库\二楼取货确认\二楼货架绑定

This commit is contained in:
2025-02-13 09:57:55 +08:00
parent ed15e81831
commit 1b7fc00e47
8 changed files with 383 additions and 1 deletions

View File

@@ -181,6 +181,10 @@
try {
let res = await outStorageConfirm(obj)
if (res.code === '200') {
uni.showToast({
title: res.msg,
icon: 'none'
})
this.toEmpty()
}
this.disabled = false

View File

@@ -0,0 +1,84 @@
<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-8">
<span class="filter_label">产线站点编号</span>
</view>
<view class="zd-col-16">
<search-box
v-model="val1"
/>
</view>
</view>
<view class="zd-row">
<view class="zd-col-8">
<span class="filter_label">货架编号</span>
</view>
<view class="zd-col-16">
<search-box
v-model="val2"
/>
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-6 button-primary" @tap="toEmpty">清空</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_takeConfirm">扫码取货确认</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {takeConfirm} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
val2: '',
disabled: false
};
},
onLoad (options) {
this.title = options.title
},
methods: {
toEmpty () {
this.val1 = ''
this.val2 = ''
this.disabled = false
},
async _takeConfirm () {
this.disabled = true
if (!this.val1 || !this.val2) {
this.disabled = false
return
}
try {
let res = await takeConfirm(this.val1, this.val2)
if (res.code === '200') {
this.toEmpty()
}
this.disabled = false
uni.showToast({
title: res.msg,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
}
}
}
</script>

View File

@@ -0,0 +1,141 @@
<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-8">
<span class="filter_label">产线站点编号</span>
</view>
<view class="zd-col-16">
<search-box
v-model="val1"
/>
</view>
</view>
<view class="zd-row">
<view class="zd-col-8">
<span class="filter_label">单据编码</span>
</view>
<view class="zd-col-16">
<search-box
v-model="val2"
/>
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>选择</th>
<th class="td_3"><view class="td_3">物料名称</view></th>
<th>物料编码</th>
<th>数量</th>
<th>批次号</th>
<th>单位</th>
</tr>
</thead>
<tbody>
<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 class="td_3">{{e.material_name}}</td>
<td>{{e.material_code}}</td>
<td>{{e.qty}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.unit_id}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-6 button-primary" @tap="_getCtuOrderList">查询</button>
<button class="zd-col-16 button-primary" :class="{'button-info': checkData.length === 0}" :disabled="disabled" @tap="_ctuOutConfirm">确认</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getCtuOrderList, ctuOutConfirm} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
val2: '',
dataList: [],
disabled: false,
checkData: []
};
},
onLoad (options) {
this.title = options.title
},
methods: {
async _getCtuOrderList () {
try {
let res = await getCtuOrderList(this.val1, this.val2)
if (res.code === '200') {
this.checkData = []
if (res.content.length > 0) {
this.dataList = [...res.content]
this.dataList.map(el => {
this.$set(el, 'checked', false)
})
}
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
} catch (e) {
console.log(e)
}
},
toCheck (e) {
e.checked = !e.checked
let arr = this.dataList.filter(el => el.checked === true)
if (arr.length > 9) {
uni.showToast({
title: '最多只能选择9个物料',
icon: 'none'
})
e.checked = false
arr = this.dataList.filter(el => el.checked === true)
}
this.checkData = arr
},
async _ctuOutConfirm () {
this.disabled = true
if (this.checkData.length === 0) {
this.disabled = false
return
}
try {
let res = await ctuOutConfirm(this.val1, this.val2, this.checkData)
if (res.code === '200') {
this._getCtuOrderList()
}
this.disabled = false
uni.showToast({
title: res.msg,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
}
}
}
</script>

View File

@@ -0,0 +1,88 @@
<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-8">
<span class="filter_label">地面站点编号</span>
</view>
<view class="zd-col-16">
<search-box
v-model="val1"
/>
</view>
</view>
<view class="zd-row">
<view class="zd-col-8">
<span class="filter_label">货架编号</span>
</view>
<view class="zd-col-16">
<search-box
v-model="val2"
/>
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-5 button-primary" @tap="toEmpty">清空</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="toSure('1')">绑定</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="toSure('0')">解绑</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {bindOrUnbind} from '@/utils/getData2.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
val2: '',
disabled: false
};
},
onLoad (options) {
this.title = options.title
},
methods: {
toEmpty () {
this.val1 = ''
this.val2 = ''
this.disabled = false
},
toSure (type) {
this.disabled = true
if (!this.val1 || !this.val2) {
this.disabled = false
return
}
this._bindOrUnbind(type)
},
async _bindOrUnbind (type) {
try {
let res = await bindOrUnbind(this.val1, this.val2, type)
if (res.code === '200') {
this.toEmpty()
}
this.disabled = false
uni.showToast({
title: res.msg,
icon: 'none'
})
} catch (e) {
this.disabled = false
}
}
}
}
</script>