料桶入库

This commit is contained in:
2025-07-31 17:32:15 +08:00
parent b96685546a
commit e1b9275bf2
4 changed files with 154 additions and 58 deletions

View File

@@ -26,7 +26,7 @@
</view>
<view class="zd-col-12">
<!-- <search-box v-model="code" @handleChange="handleChange1" @handleDel="handleDel1" /> -->
<input type="text" class="filter_input" v-model="val3">
<input type="text" class="filter_input" v-model="val3" disabled>
</view>
<button class="mini-btn" type="primary" size="mini" @tap="toSearch">获取重量</button>
</view>
@@ -63,15 +63,15 @@
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" @tap="toChek(e)" :class="{'checked': pkId === e.group_id}">
<td>{{e.material_name}}</td>
<td>{{e.qty}}</td>
<tr v-for="(e, i) in dataList" :key="i" @tap="toChek(e)" :class="{'checked': pkId === e.workorder_id}">
<td>{{e.workorder_code}}</td>
<td>{{e.material_code}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.struct_code}}</td>
<td>{{e.qty_unit_name}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.material_name}}</td>
<td>{{e.workorder_status}}</td>
<td>{{e.operator}}</td>
<td>{{e.create_name}}</td>
<td>{{e.plan_qty}}</td>
<td>{{e.real_qty}}</td>
</tr>
</tbody>
</table>
@@ -80,8 +80,8 @@
<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-11 button-primary" @tap="seachList">查询工单</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !dataList.length}" @tap="_callMaterialConfirm">确认下料</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !this.index2}" @tap="seachList">查询工单</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !this.index2 || !this.val3 || !this.val1 || !this.val2 || !this.pkId}" @tap="xlconfirm">确认下料</button>
</view>
</view>
</template>
@@ -89,7 +89,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getRegion, linegetMaterialDtl, callMaterialConfirm} from '@/utils/getData3.js'
import {regionList, pointList, getWeight, getOrderList, downMaterial} from '@/utils/getData4.js'
export default {
components: {
NavBar,
@@ -110,6 +110,7 @@
dataList: [],
pkId: '',
pkObj: {},
flag: '',
disabled: false,
reload: false,
status: 'more',
@@ -128,12 +129,12 @@
this.id = options.id
},
created () {
this._getRegion()
this._regionList()
},
methods: {
async _getRegion () {
async _regionList () {
try {
let res = await getRegion('YZHJ')
let res = await regionList()
if (res) {
this.options = res
} else {
@@ -143,28 +144,44 @@
this.options = []
}
},
async _pointList (e) {
try {
let res = await pointList(e)
if (res) {
this.options2 = res
} else {
this.options2 =[]
}
} catch (e) {
this.options2 = []
}
},
selectChange (e) {
this.index = e
this._pointList(e)
},
selectChange2 (e) {
this.index = e
this.index2 = e
},
handleChange (e) {
if (e) {
this.dataList = []
this.pageNum = 1
this.pkId = ''
this._linegetMaterialDtl()
this._getOrderList()
}
},
seachList () {
if (!this.index2) {
return
}
this.dataList = []
this.pageNum = 1
this.pkId = ''
this._linegetMaterialDtl()
this._getOrderList()
},
async _linegetMaterialDtl () {
let res = await linegetMaterialDtl(this.index)
async _getOrderList () {
let res = await getOrderList(this.index2, '2')
if (res.code === '200') {
this.dataList = res.data
// this.totalCount = res.totalElements
@@ -186,24 +203,50 @@
this.status = 'loading'
setTimeout(() => {
this.pageNum++
this._linegetMaterialDtl()
this._getOrderList()
}, 1000)
} else { //停止加载
this.status = 'noMore'
}
},
toChek (e) {
this.pkId = this.pkId === e.group_id ? '' : e.group_id
this.pkObj = this.pkId === e.group_id ? e : {}
this.pkId = this.pkId === e.workorder_id ? '' : e.workorder_id
this.pkObj = this.pkId === e.workorder_id ? e : {}
},
async _callMaterialConfirm () {
async _getWeight () {
if (!this.index2) {
return
}
let res = await getWeight(this.index2, this.pkId)
if (res.code === '200') {
this.val3 = res.data.weight
this.flag = res.data.flag
}
},
xlconfirm () {
this.disabled = true
if (!this.dataList.length) {
if (!this.index2 || !this.val3 || !this.val1 || !this.val2 || !this.pkId) {
this.disabled = false
return
}
if (this.flag === '2') {
uni.showModal({
title: '提示',
content: '是否确认以重量:' + this.val3 + '提交?',
confirmColor: '#ff6a00',
success: (res) => {
if (res.confirm) {
this._downMaterial()
} else if (res.cancel) {
this.disabled = false
}
}
})
}
},
async _downMaterial () {
try {
let res = await callMaterialConfirm(this.index, this.val1, this.pkObj)
let res = await downMaterial(this.pkId, this.index, this.val3, this.index2, this.val1, this.val2)
if (res.code === '200') {
uni.showToast({
title: res.message,

View File

@@ -45,15 +45,15 @@
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" @tap="toChek(e)" :class="{'checked': pkId === e.group_id}">
<td>{{e.material_name}}</td>
<td>{{e.qty}}</td>
<tr v-for="(e, i) in dataList" :key="i" @tap="toChek(e)" :class="{'checked': pkId === e.workorder_id}">
<td>{{e.workorder_code}}</td>
<td>{{e.material_code}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.struct_code}}</td>
<td>{{e.qty_unit_name}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.material_name}}</td>
<td>{{e.workorder_status}}</td>
<td>{{e.operator}}</td>
<td>{{e.create_name}}</td>
<td>{{e.plan_qty}}</td>
<td>{{e.real_qty}}</td>
</tr>
</tbody>
</table>
@@ -62,8 +62,8 @@
<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-11 button-primary" @tap="seachList">查询工单</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !dataList.length}" @tap="_callMaterialConfirm">确认下</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !this.index2}" @tap="seachList">查询工单</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !this.index || !this.index2 || !this.val1 || !this.pkId}" @tap="_jbReturnMaterial">解包退</button>
</view>
</view>
</template>
@@ -71,7 +71,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getRegion, linegetMaterialDtl, callMaterialConfirm} from '@/utils/getData3.js'
import {regionList, pointList, getOrderList, jbReturnMaterial} from '@/utils/getData4.js'
export default {
components: {
NavBar,
@@ -108,12 +108,12 @@
this.id = options.id
},
created () {
this._getRegion()
this._regionList()
},
methods: {
async _getRegion () {
async _regionList () {
try {
let res = await getRegion('YZHJ')
let res = await regionList()
if (res) {
this.options = res
} else {
@@ -123,28 +123,44 @@
this.options = []
}
},
async _pointList (e) {
try {
let res = await pointList(e)
if (res) {
this.options2 = res
} else {
this.options2 =[]
}
} catch (e) {
this.options2 = []
}
},
selectChange (e) {
this.index = e
this._pointList(e)
},
selectChange2 (e) {
this.index = e
this.index2 = e
},
handleChange (e) {
if (e) {
this.dataList = []
this.pageNum = 1
this.pkId = ''
this._linegetMaterialDtl()
this._getOrderList()
}
},
seachList () {
if (!this.index2) {
return
}
this.dataList = []
this.pageNum = 1
this.pkId = ''
this._linegetMaterialDtl()
this._getOrderList()
},
async _linegetMaterialDtl () {
let res = await linegetMaterialDtl(this.index)
async _getOrderList () {
let res = await getOrderList(this.index2, '2')
if (res.code === '200') {
this.dataList = res.data
// this.totalCount = res.totalElements
@@ -166,24 +182,24 @@
this.status = 'loading'
setTimeout(() => {
this.pageNum++
this._linegetMaterialDtl()
this._getOrderList()
}, 1000)
} else { //停止加载
this.status = 'noMore'
}
},
toChek (e) {
this.pkId = this.pkId === e.group_id ? '' : e.group_id
this.pkObj = this.pkId === e.group_id ? e : {}
this.pkId = this.pkId === e.workorder_id ? '' : e.workorder_id
this.pkObj = this.pkId === e.workorder_id ? e : {}
},
async _callMaterialConfirm () {
async _jbReturnMaterial () {
this.disabled = true
if (!this.dataList.length) {
if (!this.index || !this.index2 || !this.val1 || !this.pkId) {
this.disabled = false
return
}
try {
let res = await callMaterialConfirm(this.index, this.val1, this.pkObj)
let res = await jbReturnMaterial(this.index, this.index2, this.pkId)
if (res.code === '200') {
uni.showToast({
title: res.message,

View File

@@ -54,7 +54,7 @@
<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-11 button-primary" @tap="seachList">查询工单</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !index2}" @tap="seachList">查询工单</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !index2 || !pkId}" @tap="_callMaterial">开工</button>
</view>
</view>
@@ -134,6 +134,9 @@
this.index2 = e
},
seachList () {
if (!this.index2) {
return
}
this.dataList = []
this.pageNum = 1
this.pkId = ''

View File

@@ -27,8 +27,8 @@
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-11 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_bindOrUnbind('1')">检查站点</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_bindOrUnbind('0')">确认放置</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !val1}" :disabled="disabled" @tap="_checkStruct">检查站点</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !val1 || !val2 || flag === '2'}" :disabled="disabled2" @tap="_confirmSet">确认放置</button>
</view>
</view>
</template>
@@ -36,7 +36,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {bindOrUnbind} from '@/utils/getData3.js'
import {checkStruct, confirmSet} from '@/utils/getData4.js'
export default {
components: {
NavBar,
@@ -47,7 +47,9 @@
title: '',
val1: '',
val2: '',
flag: '',
disabled: false,
disabled2: false,
};
},
onLoad (options) {
@@ -61,15 +63,22 @@
this.val2 = ''
this.disabled = false
},
async _bindOrUnbind (type) {
clearUp2 () {
this.val1 = ''
this.val2 = ''
this.disabled2 = false
},
async _checkStruct () {
console.log(1111)
this.disabled = true
if (!this.val1 || !this.val2) {
if (!this.val1) {
this.disabled = false
return
}
try {
let res = await bindOrUnbind(this.val1, this.val2, type)
let res = await checkStruct(this.val1)
if (res.code === '200') {
this.flag = res.data.flag
uni.showToast({
title: res.message,
icon: 'none'
@@ -85,6 +94,31 @@
} catch (e) {
this.disabled = false
}
},
async _confirmSet () {
this.disabled2 = true
if (!this.val1 || !this.val2 || this.flag === '2') {
this.disabled2 = false
return
}
try {
let res = await confirmSet(this.val1, this.val2)
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
}
}
}
}