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