change
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="zd_container">
|
||||
<!-- 大料箱 - 料箱入库 -->
|
||||
<!-- 大料箱-料箱入库 -->
|
||||
<nav-bar :title="title"></nav-bar>
|
||||
<view class="zd_content">
|
||||
<view class="zd_wrapper">
|
||||
@@ -41,7 +41,7 @@
|
||||
<th>序号</th>
|
||||
<th>物料编码</th>
|
||||
<th>物料名称</th>
|
||||
<th>批号</th>
|
||||
<th>批次</th>
|
||||
<th>重量(kg)</th>
|
||||
<th>生产日期</th>
|
||||
<th>供应商编码</th>
|
||||
@@ -55,31 +55,29 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.task_code === pkId}">
|
||||
<tr v-for="(e, i) in dataList" :key="i">
|
||||
<td>{{i+1}}</td>
|
||||
<td>{{e.task_type}}</td>
|
||||
<td>{{e.task_code}}</td>
|
||||
<td>{{e.vehicle_code}}</td>
|
||||
<td>{{e.status}}</td>
|
||||
<td>{{e.point_code1}}</td>
|
||||
<td>{{e.point_code2}}</td>
|
||||
<td>{{e.create_time}}</td>
|
||||
<td>{{e.create_time}}</td>
|
||||
<td>{{e.create_time}}</td>
|
||||
<td>{{e.create_time}}</td>
|
||||
<td>{{e.create_time}}</td>
|
||||
<td>{{e.create_time}}</td>
|
||||
<td>{{e.create_time}}</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.material_spec}}</td>
|
||||
<td>{{e.material_model}}</td>
|
||||
<td>{{e.quality_time_day}}</td>
|
||||
<td>{{['', '待检', '合格', '不合格'][Number(e.quality_type)]}}</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-row submit-bar">
|
||||
<button class="zd-col-16 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure('80')">确认入库</button>
|
||||
<!-- <button class="zd-col-6 button-primary" @tap="searchList">查询</button> -->
|
||||
<button class="zd-col-5 button-primary" @tap="searchList">查询</button>
|
||||
<button class="zd-col-18 button-primary" :class="{'button-info': !index || !val2 || !val1 || !dataList.length}" :disabled="disabled" @tap="_materialBoxInConfirm">确认入库</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -87,7 +85,7 @@
|
||||
<script>
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import SearchBox from '@/components/SearchBox.vue'
|
||||
import {getStatusEnum, schBaseTask, saveCheckTask} from '@/utils/getData2.js'
|
||||
import {largeMaterialBoxgetType, getInGroupInfo, materialBoxInConfirm} from '@/utils/getData1.js'
|
||||
export default {
|
||||
components: {
|
||||
NavBar,
|
||||
@@ -101,93 +99,66 @@
|
||||
val1: '',
|
||||
val2: '',
|
||||
dataList: [],
|
||||
pkId: '',
|
||||
reload: false,
|
||||
status: 'more',
|
||||
contentText: {
|
||||
contentdown: '查看更多',
|
||||
contentrefresh: '加载中',
|
||||
contentnomore: '没有更多'
|
||||
},
|
||||
totalCount: 0,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
disabled: false
|
||||
};
|
||||
},
|
||||
onLoad (options) {
|
||||
this.title = options.title
|
||||
this._getStatusEnum()
|
||||
this._largeMaterialBoxgetType()
|
||||
},
|
||||
methods: {
|
||||
async _getStatusEnum () {
|
||||
let res = await getStatusEnum()
|
||||
this.options = [...res]
|
||||
this.options.map(el => {
|
||||
this.$set(el, 'text', el.label)
|
||||
})
|
||||
async _largeMaterialBoxgetType () {
|
||||
try {
|
||||
let res = await largeMaterialBoxgetType('ST_INV_IN_TYPE')
|
||||
if (res) {
|
||||
this.options = res.data
|
||||
} else {
|
||||
this.options = []
|
||||
}
|
||||
} catch (e) {
|
||||
this.options = []
|
||||
}
|
||||
},
|
||||
selectChange (e) {
|
||||
this.index = e
|
||||
},
|
||||
searchList () {
|
||||
this.dataList = []
|
||||
this.pageNum = 1
|
||||
this._schBaseTask()
|
||||
this._getInGroupInfo()
|
||||
},
|
||||
async _schBaseTask () {
|
||||
let res = await schBaseTask(this.pageNum + '', this.pageSize + '', this.index, this.val1)
|
||||
if (res.code === '200') {
|
||||
this.totalCount = res.totalElements
|
||||
if (res.totalElements > 0) {
|
||||
const dataMap = res.content
|
||||
this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap)
|
||||
this.reload = false
|
||||
async _getInGroupInfo () {
|
||||
try {
|
||||
let res = await getInGroupInfo(this.val1)
|
||||
if (res && res.data.length > 0) {
|
||||
this.dataList = [...res.data]
|
||||
} else {
|
||||
this.dataList = []
|
||||
}
|
||||
if (this.totalCount == this.dataList.length) {
|
||||
this.reload = false
|
||||
this.status = 'noMore'
|
||||
}
|
||||
} catch (e) {
|
||||
this.dataList = []
|
||||
}
|
||||
},
|
||||
onReachBottom () {
|
||||
if (this.totalCount > this.dataList.length) {
|
||||
this.status = 'loading'
|
||||
setTimeout(() => {
|
||||
this.pageNum++
|
||||
this._schBaseTask()
|
||||
}, 1000)
|
||||
} else { //停止加载
|
||||
this.status = 'noMore'
|
||||
}
|
||||
clearUp () {
|
||||
this.val1 = ''
|
||||
this.val2 = ''
|
||||
this.index = ''
|
||||
this.dataList = []
|
||||
this.disabled = false
|
||||
},
|
||||
toCheck (e) {
|
||||
this.pkId = e.e.task_code === this.pkId ? '' : e.task_code
|
||||
},
|
||||
async toSure (status) {
|
||||
async _materialBoxInConfirm () {
|
||||
this.disabled = true
|
||||
if (!this.pkId) {
|
||||
if (!this.index || !this.val2 || !this.val1 || !this.dataList.length) {
|
||||
this.disabled = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
let res = await saveCheckTask(this.pkId, status)
|
||||
if (res.code === '200') {
|
||||
this.index = ''
|
||||
this.val1 = ''
|
||||
this.dataList = []
|
||||
this.pkId = ''
|
||||
let res = await materialBoxInConfirm(this.index, this.val2, this.val1, this.dataList)
|
||||
if (res) {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.desc,
|
||||
title: res.message,
|
||||
icon: 'none'
|
||||
})
|
||||
this.clearUp()
|
||||
}
|
||||
this.disabled = false
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user