生产管理
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
<view class="zd-col-24 filter_select">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
@handleChange="handleChange"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
@@ -20,7 +21,7 @@
|
||||
</view>
|
||||
<view class="zd-col-24 filter_select">
|
||||
<search-box
|
||||
v-model="val1"
|
||||
v-model="val2"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
@@ -50,7 +51,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i">
|
||||
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.bucket_code === pkId}" @tap="toCheck(e)">
|
||||
<td>{{i+1}}</td>
|
||||
<td>{{e.bag_code}}</td>
|
||||
<td>{{e.material_code}}</td>
|
||||
@@ -68,8 +69,8 @@
|
||||
</view>
|
||||
<view class="zd-row submit-bar">
|
||||
<!-- <button class="zd-col-5 button-default" @tap="toEmpty">清空</button> -->
|
||||
<button class="zd-col-10 button-primary" :class="{'button-info': !val1 || !dataList.length}" :disabled="disabled" @tap="_packInConfirm">入站</button>
|
||||
<button class="zd-col-10 button-primary" :class="{'button-info': !val1 || !dataList.length}" :disabled="disabled" @tap="_packInConfirm">出站</button>
|
||||
<button class="zd-col-10 button-primary" :class="{'button-info': !pkId || !val2 || !val1 || !num}" :disabled="disabled" @tap="_manualInbound">入站</button>
|
||||
<button class="zd-col-10 button-primary" :class="{'button-info': !pkId || !val2 || !val1 || !num}" :disabled="disabled" @tap="_manualOutbound">出站</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -77,7 +78,7 @@
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {queryPointInDownload, queryPointInDtl, packInConfirm} from '@/utils/getData3.js'
|
||||
import {getTaskBucketGroupInfo, manualInbound, manualOutbound} from '@/utils/getData3.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -86,10 +87,11 @@
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
options: [],
|
||||
index: '',
|
||||
val1: '',
|
||||
val2: '',
|
||||
num: null,
|
||||
pkId: '',
|
||||
pkObj: {},
|
||||
dataList: [],
|
||||
// dataList: [{material_code: 'm001', qty: 100, checked: false, initialQty: 100}, {material_code: 'm002', qty: 200, checked: false, initialQty: 200}],
|
||||
disabled: false
|
||||
@@ -97,34 +99,25 @@
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
this._queryPointInDownload()
|
||||
},
|
||||
methods: {
|
||||
toEmpty () {
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.dataList = []
|
||||
this.disabled = false
|
||||
},
|
||||
async _queryPointInDownload () {
|
||||
try {
|
||||
let res = await queryPointInDownload()
|
||||
if (res) {
|
||||
this.options = res.data
|
||||
} else {
|
||||
this.options = []
|
||||
}
|
||||
} catch (e) {
|
||||
this.options = []
|
||||
handleChange (e) {
|
||||
if (e) {
|
||||
this._getTaskBucketGroupInfo()
|
||||
}
|
||||
},
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
},
|
||||
async _queryPointInDtl () {
|
||||
async _getTaskBucketGroupInfo () {
|
||||
try {
|
||||
let res = await queryPointInDtl(this.val1)
|
||||
let res = await getTaskBucketGroupInfo(this.val1)
|
||||
if (res && res.data.length > 0) {
|
||||
this.dataList = [...res.data]
|
||||
this.num = this.dataList.reduce((sum, item) => sum + Number(item.qty), 0)
|
||||
} else {
|
||||
this.dataList = []
|
||||
}
|
||||
@@ -132,14 +125,38 @@
|
||||
this.dataList = []
|
||||
}
|
||||
},
|
||||
async _packInConfirm () {
|
||||
toCheck (e) {
|
||||
this.pkId = this.pkId === e.bucket_code ? '' : e.bucket_code
|
||||
this.pkObj = this.pkId === e.bucket_code ? e : {}
|
||||
},
|
||||
async _manualInbound () {
|
||||
this.disabled = true
|
||||
if (!this.val1 || !this.dataList.length) {
|
||||
if (!this.pkId || !this.val2 || !this.val1 || !this.num) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await packInConfirm(this.val1, this.index, this.dataList)
|
||||
let res = await manualInbound(this.pkObj, this.val2, this.val1, this.num)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
this.toEmpty()
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
async _manualOutbound () {
|
||||
this.disabled = true
|
||||
if (!this.pkId || !this.val2 || !this.val1 || !this.num) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await manualOutbound(this.pkObj, this.val2, this.val1, this.num)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
|
||||
@@ -299,6 +299,23 @@ export const productionLine = (vcode, pcode, iswait) => request({
|
||||
url:'api/pdaProduction/productionLine',
|
||||
data: {vehicle_code: vcode, point_code: pcode, is_wait: iswait}
|
||||
})
|
||||
// 料桶称重
|
||||
// 获取物料库存信息
|
||||
export const getTaskBucketGroupInfo = (vcode) => request({
|
||||
url:'api/pdaProduction/getTaskBucketGroupInfo',
|
||||
data: {vehicle_code: vcode}
|
||||
})
|
||||
// 入站
|
||||
export const manualInbound = (row, cpoint, vcode, total) => request({
|
||||
url:'api/pdaProduction/manualInbound',
|
||||
data: {row: row, current_point: cpoint, vehicle_code: vcode, total: total}
|
||||
})
|
||||
// 出站
|
||||
export const manualOutbound = (row, cpoint, vcode, total) => request({
|
||||
url:'api/pdaProduction/manualOutbound',
|
||||
data: {row: row, current_point: cpoint, vehicle_code: vcode, total: total}
|
||||
})
|
||||
|
||||
|
||||
// 收货入库
|
||||
// 获取物料信息 Copy
|
||||
|
||||
Reference in New Issue
Block a user