料桶入库

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

@@ -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,