来料入库

This commit is contained in:
2026-02-24 17:14:02 +08:00
parent 2426e2a2a0
commit 94e4374a46

View File

@@ -3,15 +3,6 @@
<!-- 来料入库 -->
<nav-bar :title="title"></nav-bar>
<view class="zd_content">
<!-- <view class="zd_wrapper">
<view class="zd-row">
<view class="zd-col-19">
</view>
<view class="zd-col-4">
<button class="mini-btn" size="mini" style="display: block; margin-top: 9px;" type="primary" @tap="handleAdd">添加</button>
</view>
</view>
</view> -->
<view class="zd_wrapper" v-if="flag">
<view class="zd-row border-bottom">
<view class="zd-col-7">
@@ -59,7 +50,7 @@
<table>
<thead>
<tr>
<th>选择</th>
<th @tap="toAllCheck"><uni-icons :type="allCheck ? 'checkbox' : 'circle'" size="24" color="#4e6ef2"></uni-icons></th>
<th>点位码</th>
<th>托盘码</th>
<th>批次号</th>
@@ -86,8 +77,10 @@
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-22 button-primary" :class="{'button-info': !checkedArr.length}" @tap="_zwConfirmIn">提交</button>
<button class="zd-col-11 button-primary" @tap="_getInBillList">刷新</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !checkedArr.length}" @tap="_zwConfirmIn">提交</button>
</view>
</view>
</template>
@@ -111,10 +104,9 @@
dataList: [],
// dataList: [
// {site_code: 's01', vehicle_code: 'v01', checked: false},
// {site_code: 's02', vehicle_code: 'v02', checked: false},
// {site_code: 's03', vehicle_code: 'v03', checked: false},
// {site_code: 's04', vehicle_code: 'v04', checked: false}
// ],
allCheck: false,
checkedArr: [],
pkId: '',
currentData: {},
@@ -126,21 +118,10 @@
this.title = options.title
this.id = options.id
},
onShow() {
if (this.$store.getters.dataList !== []) {
this.dataList = this.$store.getters.publicArr
}
},
created () {
this._getInBillList()
},
methods: {
handleAdd () {
this.dataList.map(el => {
this.$set(el, 'checked', false)
})
this.$store.dispatch('setPublicArr', this.dataList)
},
// async _getPlate () {
// try {
// let res = await getPlate(this.val1)
@@ -164,26 +145,37 @@
this.pkId = this.pkId === e.site_code ? '' : e.site_code
this.pkObj = this.pkId === e.site_code ? e : {}
},
toAllCheck () {
this.allCheck = !this.allCheck
this.dataList.map(el => {
el.checked = this.allCheck
})
},
toAllCheck () {
this.allCheck = !this.allCheck
this.dataList.map(el => {
el.checked = this.allCheck
})
},
toCheck (e) {
e.checked = !e.checked
this.checkedArr = this.dataList.filter(el => el.checked === true)
if (this.checkedArr.length > 0) {
this.dataList.map(el => {
this.$set(el, 'checked', false)
})
e.checked = !e.checked
}
this.allCheck = this.checkedArr.length === this.dataList.length
},
clearUp () {
this.dataList = []
this.checkedArr = []
},
async _getInBillList () {
this.toAllCheck()
try {
let res = await getInBillList()
if (res.code === '200') {
this.dataList = [...this.dataList, ...res.data]
this.handleAdd()
this.dataList = [...res.data]
this.allCheck = true
this.dataList.map(el => {
el.checked = this.allCheck
})
} else {
uni.showToast({
title: res.message,