Files
hht-xzhy-uni/pages/Material/dlx-move-store.vue
2025-09-10 11:05:41 +08:00

201 lines
5.0 KiB
Vue

<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-7">
<span class="filter_label">移出</span>
</view>
<view class="zd-col-24 filter_select">
<search-box
v-model="val1"
@handleChange="handleChange"
/>
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>序号</th>
<th>点位</th>
<th>载具</th>
<th>物料编码</th>
<th>物料名称</th>
<th>批号</th>
<th>重量(kg)</th>
<th>生产日期</th>
<th>供应商编码</th>
<th>供应商名称</th>
<th>烘干次数</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i">
<td>{{i+1}}</td>
<td>{{e.struct_code}}</td>
<td>{{e.storagevehicle_code}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.qty}}</td>
<td>{{e.produce_time}}</td>
<td>{{e.supp_code}}</td>
<td>{{e.supp_name}}</td>
<td>{{e.bake_num}}</td>
</tr>
</tbody>
</table>
</view>
</view>
<uni-load-more color="#007AFF" iconType="circle" :status="status" :icon-size="14" :content-text="contentText" v-if="dataList.length > 0"/>
</view>
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">移入</span>
</view>
<view class="zd-col-24 filter_select">
<search-box
v-model="val2"
@handleChange="handleChange2"
/>
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
<table>
<thead>
<tr>
<th>序号</th>
<th>点位</th>
<th>载具</th>
<th>物料编码</th>
<th>物料名称</th>
<th>批号</th>
<th>重量(kg)</th>
<th>生产日期</th>
<th>供应商编码</th>
<th>供应商名称</th>
<th>烘干次数</th>
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList2" :key="i">
<td>{{i+1}}</td>
<td>{{e.struct_code}}</td>
<td>{{e.storagevehicle_code}}</td>
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.qty}}</td>
<td>{{e.produce_time}}</td>
<td>{{e.supp_code}}</td>
<td>{{e.supp_name}}</td>
<td>{{e.bake_num}}</td>
</tr>
</tbody>
</table>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-16 button-primary" :class="{'button-info': !dataList.length || !dataList2.length}" :disabled="disabled" @tap="_materialBoxMoveConfirm">确认移库</button>
<!-- <button class="zd-col-6 button-primary" @tap="searchList">查询</button> -->
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getMoveDocumentInfo, materialBoxMoveConfirm} from '@/utils/getData1.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
val2: '',
dataList: [],
dataList2: [],
mdid: '',
disabled: false
};
},
onLoad (options) {
this.title = options.title
},
methods: {
handleChange (e) {
if (e) {
this.dataList = []
this._getMoveDocumentInfo()
}
},
handleChange2 (e) {
if (e && !this.mdid && this.dataList.length) {
this.dataList2 = []
this._getMoveDocumentInfo2()
}
},
async _getMoveDocumentInfo () {
try {
let res = await getMoveDocumentInfo('1', this.val1, this.mdid)
if (res && res.data.length > 0) {
this.dataList = [...res.data]
this.mdid = ths.dataList[0].moveinvdtl_id
if (this.dataList.length && this.mdid) {
this._getMoveDocumentInfo2()
}
} else {
this.dataList = []
}
} catch (e) {
this.dataList = []
}
},
async _getMoveDocumentInfo2 () {
try {
let res = await getMoveDocumentInfo('2', this.val2, this.mdid)
if (res && res.data.length > 0) {
this.dataList2 = [...res.data]
} else {
this.dataList2 = []
}
} catch (e) {
this.dataList2 = []
}
},
async _materialBoxMoveConfirm () {
this.disabled = true
if (!this.dataList.length || !this.dataList2.length) {
this.disabled = false
return
}
try {
let res = await materialBoxMoveConfirm(this.dataList, this.dataList2)
if (res) {
uni.showToast({
title: res.message,
icon: 'none'
})
this.clearUp()
}
this.disabled = false
} catch (e) {
this.disabled = false
}
}
}
}
</script>