This commit is contained in:
2025-09-10 10:38:03 +08:00
parent 336cf4455e
commit 6f7e10fa3f
12 changed files with 800 additions and 620 deletions

View File

@@ -5,22 +5,23 @@
<view class="zd_content">
<view class="zd_wrapper">
<view class="zd-row border-bottom">
<view class="zd-col-7">
<view class="zd-col-6">
<span class="filter_label">日期</span>
</view>
<view class="zd-col-24 filter_select">
<uni-data-select v-model="index" :localdata="options" @change="selectChange"></uni-data-select>
<view class="zd-col-18 filter_picker">
<picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindDateChange">
<view class="uni-input">{{date}}</view>
</picker>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<view class="zd-col-5">
<span class="filter_label">单据</span>
</view>
<view class="zd-col-24 filter_select">
<search-box
v-model="val1"
/>
<view class="zd-col-14">
<input type="text" placeholder="输入物料关键字" class="filter_input" v-model="keyword" @focus="handleFocus">
</view>
<button class="mini-btn" type="primary" size="mini" @tap="_getIoDisDocumentInfo">查询</button>
</view>
</view>
<view class="zd_wrapper grid-wraper">
@@ -45,31 +46,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" :class="{'checked': e.iostorinv_id === pkId}" @tap="toCheck(e)">
<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.bill_code}}</td>
<td>{{e.bill_type}}</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.total_qty}}</td>
<td>{{e.plan_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-row submit-bar">
<button class="zd-col-18 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure('80')">确认入</button>
<button class="zd-col-5 button-primary" @tap="searchList">查询</button>
<button class="zd-col-24 button-primary" :class="{'button-info': !pkId}" @tap="toSure">扫码出</button>
</view>
</view>
</template>
@@ -77,111 +76,67 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getStatusEnum, schBaseTask, saveCheckTask} from '@/utils/getData2.js'
import {getDate} from '@/utils/utils.js'
import {getIoDisDocumentInfo} from '@/utils/getData1.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
const currentDate = getDate({
format: true
})
return {
title: '',
options: [],
index: '',
val1: '',
val2: '',
keyword: null,
date: currentDate,
dataList: [],
pkId: '',
reload: false,
status: 'more',
contentText: {
contentdown: '查看更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
},
totalCount: 0,
pageNum: 1,
pageSize: 10,
disabled: false
pkObj: {}
};
},
computed: {
startDate() {
return getDate('start');
},
endDate() {
return getDate('end');
}
},
onLoad (options) {
this.title = options.title
this._getStatusEnum()
this._getIoDisDocumentInfo()
},
methods: {
async _getStatusEnum () {
let res = await getStatusEnum()
this.options = [...res]
this.options.map(el => {
this.$set(el, 'text', el.label)
})
handleFocus () {
this.keyword = null
},
selectChange (e) {
this.index = e
bindDateChange: function(e) {
this.date = e.detail.value
},
searchList () {
this.dataList = []
this.pageNum = 1
this._schBaseTask()
},
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 _getIoDisDocumentInfo () {
try {
let res = await getIoDisDocumentInfo(this.keyword, this.date, '1')
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'
}
}
},
onReachBottom () {
if (this.totalCount > this.dataList.length) {
this.status = 'loading'
setTimeout(() => {
this.pageNum++
this._schBaseTask()
}, 1000)
} else { //停止加载
this.status = 'noMore'
} catch (e) {
this.dataList = []
}
},
toCheck (e) {
this.pkId = e.e.task_code === this.pkId ? '' : e.task_code
this.pkId = this.pkId === e.iostorinv_id ? '' : e.iostorinv_id
this.pkObj = this.pkId === e.iostorinv_id ? e : {}
},
async toSure (status) {
this.disabled = true
if (!this.pkId) {
this.disabled = false
return
}
try {
let res = await saveCheckTask(this.pkId, status)
if (res.code === '200') {
this.index = ''
this.val1 = ''
this.dataList = []
this.pkId = ''
uni.showToast({
title: res.desc,
icon: 'none'
})
} else {
uni.showToast({
title: res.desc,
icon: 'none'
})
}
this.disabled = false
} catch (e) {
this.disabled = false
toSure () {
if (this.pkId) {
this.$store.dispatch('setPublicObj', this.pkObj)
uni.navigateTo({
url: 'pages/Material/hw-out-store'
})
}
}
}

View File

@@ -0,0 +1,206 @@
<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-6">
<span class="filter_label filter_input_disabled">单据号</span>
</view>
<view class="zd-col-18">
<input type="text" class="filter_input filter_input_disabled" v-model="materialData.bill_code" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">点位/载具</span>
</view>
<view class="zd-col-17">
<search-box
v-model="val1"
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label filter_input_disabled">点位</span>
</view>
<view class="zd-col-18">
<input type="text" class="filter_input filter_input_disabled" v-model="materialData.struct_code" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label filter_input_disabled">出库物料</span>
</view>
<view class="zd-col-18">
<input type="text" class="filter_input filter_input_disabled" v-model="materialData.material_code" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label filter_input_disabled">物料名称</span>
</view>
<view class="zd-col-18">
<input type="text" class="filter_input filter_input_disabled" v-model="materialData.material_name" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">库存数量</span>
</view>
<view class="zd-col-16">
<input type="number" v-model="materialData.qty1" class="filter_input" disabled>
</view>
<view class="zd-col-2"><span class="filter_unit">KG</span></view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">出库数量</span>
</view>
<view class="zd-col-16">
<input type="number" v-model="materialData.plan_qty" class="filter_input" disabled>
</view>
<view class="zd-col-2"><span class="filter_unit">KG</span></view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<span class="filter_label">配送载具</span>
</view>
<view class="zd-col-17">
<search-box
v-model="val2"
/>
</view>
</view>
</view>
</view>
<view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="clearUp">清空</button>
<button class="zd-col-9 button-primary" :class="{'button-info': !val1}" :disabled="disabled1" @tap="labelPrint">标签打印</button>
<button class="zd-col-9 button-primary" :class="{'button-info': !val1 || !val2 || !index}" :disabled="disabled" @tap="_materialBoxOutConfirm">确认出库</button>
</view>
</view>
</template>
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getInvInfoQty, materialBoxOutConfirm} from '@/utils/getData1.js'
export default {
components: {
NavBar,
SearchBox
},
data() {
return {
title: '',
val1: '',
val2: '',
materialData: {},
// suppData: {},
disabled: false,
disabled1: false
};
},
onLoad (options) {
this.title = options.title
},
onShow () {
if (this.$store.getters.publicObj !== '') {
this.materialData = this.$store.getters.publicObj
this.$store.dispatch('setPublicObj', '')
}
},
methods: {
clearUp () {
this.val1 = ''
this.val2 = ''
this.disabled = false
},
async _getInvInfoQty () {
let res = await getInvInfoQty(this.val1)
this.materialData.qty1 = res.data.ivt_qty
},
async _materialBoxOutConfirm () {
this.disabled = true
if (!this.val1 || !this.val2) {
this.disabled = false
return
}
try {
let res = await materialBoxOutConfirm(this.materialData.iostorinv_id, this.materialData.storagevehicle_code, this.materialData.struct_code, this.val2, this.materialData.plan_qty)
if (res.code === '200') {
uni.showToast({
title: res.message,
icon: 'none'
})
this.clearUp()
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
this.disabled = false
}
} catch (e) {
this.disabled = false
}
},
labelPrint () {
this.disabled1 = true
let data = Object.assign({}, this.materialData, this.suppData, {pcsn: this.pcsn, produce_time: this.date, bake_num: this.num})
this.toPrint(data)
},
toPrint (data) {
let iparr = this.$store.getters.printUrl.split(":")
let printUrl = iparr[1].slice(2)
let LODOP = getCLodop();
if (!(LODOP.webskt && LODOP.webskt.readyState === 1)) {
uni.showToast({
title: '当前配置ip' + printUrl + '网络不通,请检查',
icon: 'none',
duration: 5000
})
this.disabled1 = false
return
}
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
LODOP.SET_LICENSES('浙江省烟草专卖局(公司)', 'C0C4A46A3A0D1F526D426018D9F11921', '', '')
// 更换为打印服务器ip 不需要加前缀
LODOP.PRINT_INIT(null, printUrl);
// 打印机序号 规则为打印服务器打印机列表倒数从0开始 -1为默认打印机
LODOP.SET_PRINTER_INDEX(-1);
// 设置打印纸大小
LODOP.SET_PRINT_PAGESIZE(1, '130mm', '67mm', '');
LODOP.ADD_PRINT_RECT('1mm', '3mm', '124mm', '61mm', 0, 1);
LODOP.SET_PRINT_STYLE('FontSize', 12);
LODOP.SET_PRINT_STYLE('Bold', 1);
LODOP.ADD_PRINT_BARCODE('2mm', '4mm', '33mm', '33mm', 'QRCode', data.material_code + '##' + data.supp_code);
LODOP.ADD_PRINT_TEXT('5mm', '35mm', '80mm', '15mm', '物料编码:' + data.material_code);
LODOP.ADD_PRINT_TEXT('12mm', '35mm', '80mm', '15mm', '物料名称:' + data.material_name);
LODOP.ADD_PRINT_TEXT('19mm', '35mm', '80mm', '15mm', ' 规格:' + data.material_spec);
LODOP.ADD_PRINT_TEXT('26mm', '35mm', '80mm', '15mm', ' 型号:' + data.material_model);
LODOP.ADD_PRINT_TEXT('34mm', '5mm', '80mm', '15mm', ' 执行标准:' + data.execution_stand)
LODOP.ADD_PRINT_TEXT('34mm', '59mm', '80mm', '15mm', '有效期(天)' + data.quality_time)
LODOP.ADD_PRINT_TEXT('41mm', '5mm', '80mm', '15mm', ' 批次:' + data.pcsn)
LODOP.ADD_PRINT_TEXT('41mm', '59mm', '80mm', '15mm', ' 生产日期:' + data.produce_time)
LODOP.ADD_PRINT_TEXT('48mm', '5mm', '80mm', '15mm', '供应商编码:' + data.supp_code)
LODOP.ADD_PRINT_TEXT('48mm', '59mm', '80mm', '15mm', '供应商名称:' + data.supp_name)
LODOP.ADD_PRINT_TEXT('55mm', '5mm', '80mm', '15mm', ' 烘干次数:' + data.bake_num)
// LODOP.PRINT();
LODOP.PREVIEW()
uni.showToast({
title: '打印成功',
icon: 'none'
})
this.disabled1 = false
}
}
}
</script>
<style lang="stylus">
</style>

View File

@@ -36,7 +36,7 @@
</view>
<view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="clearUp">清空</button>
<button class="zd-col-18 button-primary" :class="{'button-info': !val1 || !val2 || !index}" :disabled="disabled" @tap="_vehicleInConfirm">呼叫入库</button>
<button class="zd-col-18 button-primary" :class="{'button-info': !val1 || !val2 || !index}" :disabled="disabled" @tap="_vehicleIn">呼叫入库</button>
</view>
</view>
</template>
@@ -44,7 +44,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getPdaSect, getPointCodeByVehicleCode, vehicleInConfirm} from '@/utils/getData4.js'
import {querySectCode, vehicleIn} from '@/utils/getData1.js'
export default {
components: {
NavBar,
@@ -64,17 +64,12 @@
this.title = options.title
},
created () {
this._getPdaSect()
this._querySectCode()
},
methods: {
handleChange (e) {
if (e) {
this._getPointCodeByVehicleCode()
}
},
async _getPdaSect () {
async _querySectCode () {
try {
let res = await getPdaSect()
let res = await querySectCode()
if (res) {
this.options = res.data
} else {
@@ -89,27 +84,18 @@
},
clearUp () {
this.val1 = ''
this.val2 = ''
this.index = ''
this.disabled = false
},
async _getPointCodeByVehicleCode () {
try {
let res = await getPointCodeByVehicleCode(this.val1)
if (res.code === '200') {
this.val2 = res.data
} else {
}
} catch (e) {
}
},
async _vehicleInConfirm () {
async _vehicleIn () {
this.disabled = true
if (!this.val1 || !this.val2 || !this.index) {
this.disabled = false
return
}
try {
let res = await vehicleInConfirm(this.val1, this.index, this.val2)
let res = await vehicleIn(this.val2, this.val1, this.index)
if (res.code === '200') {
uni.showToast({
title: res.message,

View File

@@ -36,8 +36,8 @@
</view>
<view class="zd-row submit-bar">
<!-- <button class="zd-col-6 button-default" @tap="clearUp">清空</button> -->
<button class="zd-col-11 button-primary" :class="{'button-info': !val1 || !val2 || !index}" :disabled="disabled" @tap="_vehicleInConfirm">绑定</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !val1 || !val2 || !index}" :disabled="disabled" @tap="_vehicleInConfirm">解绑</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_bindEmptyVehicle">绑定</button>
<button class="zd-col-11 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_unBindEmptyVehicle">解绑</button>
</view>
</view>
</template>
@@ -45,7 +45,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getPdaSect, getPointCodeByVehicleCode, vehicleInConfirm} from '@/utils/getData4.js'
import {queryVehicleType, bindEmptyVehicle, unBindEmptyVehicle} from '@/utils/getData1.js'
export default {
components: {
NavBar,
@@ -65,17 +65,12 @@
this.title = options.title
},
created () {
this._getPdaSect()
this._queryVehicleType()
},
methods: {
handleChange (e) {
if (e) {
this._getPointCodeByVehicleCode()
}
},
async _getPdaSect () {
async _queryVehicleType () {
try {
let res = await getPdaSect()
let res = await queryVehicleType()
if (res) {
this.options = res.data
} else {
@@ -90,40 +85,46 @@
},
clearUp () {
this.val1 = ''
this.val2 = ''
this.index = ''
this.disabled = false
},
async _getPointCodeByVehicleCode () {
try {
let res = await getPointCodeByVehicleCode(this.val1)
if (res.code === '200') {
this.val2 = res.data
} else {
}
} catch (e) {
}
},
async _vehicleInConfirm () {
async _bindEmptyVehicle () {
this.disabled = true
if (!this.val1 || !this.val2 || !this.index) {
if (!this.val1 || !this.val2) {
this.disabled = false
return
}
try {
let res = await vehicleInConfirm(this.val1, this.index, this.val2)
if (res.code === '200') {
let res = await bindEmptyVehicle(this.val1, this.val2)
if (res) {
uni.showToast({
title: res.message,
icon: 'none'
})
this.clearUp()
} else {
}
this.disabled = false
} catch (e) {
this.disabled = false
}
},
async _unBindEmptyVehicle () {
this.disabled = true
if (!this.val1 || !this.val2) {
this.disabled = false
return
}
try {
let res = await unBindEmptyVehicle(this.val1, this.val2)
if (res) {
uni.showToast({
title: res.message,
icon: 'none'
})
this.disabled = false
this.clearUp()
}
this.disabled = false
} catch (e) {
this.disabled = false
}

View File

@@ -42,7 +42,7 @@
</view>
<view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="clearUp">清空</button>
<button class="zd-col-18 button-primary" :class="{'button-info': !val1 || !val2 || !index}" :disabled="disabled" @tap="_vehicleInConfirm">呼叫出库</button>
<button class="zd-col-18 button-primary" :class="{'button-info': !qty || !val2 || !index || !index2}" :disabled="disabled" @tap="_vehicleOut">呼叫出库</button>
</view>
</view>
</template>
@@ -51,7 +51,8 @@
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import NumberInput from '@/components/NumberInput.vue'
import {getPdaSect, getPointCodeByVehicleCode, vehicleInConfirm} from '@/utils/getData4.js'
import {queryVehicleType} from '@/utils/getData2.js'
import {querySectCode, vehicleOut} from '@/utils/getData1.js'
export default {
components: {
NavBar,
@@ -61,7 +62,6 @@
data() {
return {
title: '',
val1: '',
val2: '',
options: [],
index: '',
@@ -75,18 +75,13 @@
this.title = options.title
},
created () {
this._getPdaSect()
this._getPdaSect2()
this._queryVehicleType()
this._querySectCode()
},
methods: {
handleChange (e) {
if (e) {
this._getPointCodeByVehicleCode()
}
},
async _getPdaSect () {
async _queryVehicleType () {
try {
let res = await getPdaSect()
let res = await queryVehicleType()
if (res) {
this.options = res.data
} else {
@@ -96,9 +91,9 @@
this.options = []
}
},
async _getPdaSect2 () {
async _querySectCode () {
try {
let res = await getPdaSect()
let res = await querySectCode()
if (res) {
this.options2 = res.data
} else {
@@ -115,28 +110,20 @@
this.index2 = e
},
clearUp () {
this.val1 = ''
this.qty = ''
this.val2 = ''
this.index = ''
this.index2 = ''
this.disabled = false
},
async _getPointCodeByVehicleCode () {
try {
let res = await getPointCodeByVehicleCode(this.val1)
if (res.code === '200') {
this.val2 = res.data
} else {
}
} catch (e) {
}
},
async _vehicleInConfirm () {
async _vehicleOut () {
this.disabled = true
if (!this.val1 || !this.val2 || !this.index) {
if (!this.qty || !this.val2 || !this.index || !this.index2) {
this.disabled = false
return
}
try {
let res = await vehicleInConfirm(this.val1, this.index, this.val2)
let res = await vehicleOut(this.qty, this.val2, this.index, this.index2)
if (res.code === '200') {
uni.showToast({
title: res.message,

View File

@@ -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) {

View File

@@ -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': !dataList.length}" :disabled="disabled" @tap="toAddMater">加入物料</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,99 +99,65 @@
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
} else {
this.dataList = []
}
if (this.totalCount == this.dataList.length) {
this.reload = false
this.status = 'noMore'
}
}
},
onReachBottom () {
if (this.totalCount > this.dataList.length) {
this.status = 'loading'
setTimeout(() => {
this.pageNum++
this._schBaseTask()
}, 1000)
} else { //停止加载
this.status = 'noMore'
}
},
toCheck (e) {
this.pkId = e.e.task_code === this.pkId ? '' : e.task_code
},
async toSure (status) {
this.disabled = true
if (!this.pkId) {
this.disabled = false
return
}
async _getInGroupInfo () {
try {
let res = await saveCheckTask(this.pkId, status)
if (res.code === '200') {
this.index = ''
this.val1 = ''
this.dataList = []
this.pkId = ''
uni.showToast({
title: res.desc,
icon: 'none'
})
let res = await getInGroupInfo(this.val1)
if (res && res.data.length > 0) {
this.dataList = [...res.data]
} else {
uni.showToast({
title: res.desc,
icon: 'none'
})
this.dataList = []
}
this.disabled = false
} catch (e) {
this.disabled = false
this.dataList = []
}
}
},
clearUp () {
this.val1 = ''
this.val2 = ''
this.index = ''
this.dataList = []
this.disabled = false
},
toAddMater () {
if (!this.dataList.length) return
this.$store.dispatch('setPublicArr', this.dataList)
let fobj = {
bill_type: this.index,
struct_code: this.val2,
storagevehicle_code: this.val1
}
this.$store.dispatch('setPublicObj', fobj)
uni.navigateTo({
url: 'pages/Material/mater-save'
})
},
}
}
</script>

View File

@@ -1,26 +1,26 @@
<template>
<view class="zd_container">
<!-- 大料箱 - 物料维护 -->
<nav-bar :title="title"></nav-bar>
<!-- 大料箱-物料维护 -->
<nav-bar :title="title" :inner="true"></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"
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-8">
<span class="filter_label">入库数量(KG)</span>
<view class="zd-col-6">
<span class="filter_label">入库数量</span>
</view>
<view class="zd-col-16">
<NumberInput v-model="qty" />
<input type="number" v-model="qty" class="filter_input">
</view>
<view class="zd-col-2"><span class="filter_unit">KG</span></view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-5">
<span class="filter_label">加入物料</span>
</view>
<view class="zd-col-14">
<input type="text" placeholder="输入物料关键字" class="filter_input" v-model="val1">
</view>
<button class="mini-btn" type="primary" size="mini" @tap="searchList">查询</button>
</view>
</view>
<view class="zd_wrapper grid-wraper">
@@ -37,23 +37,22 @@
</tr>
</thead>
<tbody>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.task_code === pkId}">
<td>{{e.task_type}}</td>
<td>{{e.task_type}}</td>
<td>{{e.task_code}}</td>
<td>{{e.vehicle_code}}</td>
<td>{{e.status}}</td>
<td>{{e.status}}</td>
<tr v-for="(e, i) in dataList" :key="i" :class="{'checked': e.material_id === pkId}" @tap="toCheck(e)">
<td>{{e.material_code}}</td>
<td>{{e.material_name}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.unit_id}}</td>
<td>{{e.single_weight}}</td>
<td>{{e.pcsn}}</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"/>
<!-- <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-18 button-primary" :class="{'button-info': !pkId}" :disabled="disabled" @tap="toSure">入库</button>
<button class="zd-col-5 button-primary" @tap="searchList">查询</button>
<button class="zd-col-24 button-primary" :class="{'button-info': !pkId || !qty}" @tap="_materialInConfirm">入库</button>
</view>
</view>
</template>
@@ -61,7 +60,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getStatusEnum, schBaseTask, saveCheckTask} from '@/utils/getData2.js'
import {getMaterialInfo, materialInConfirm} from '@/utils/getData1.js'
export default {
components: {
NavBar,
@@ -69,11 +68,13 @@
},
data() {
return {
fobj: {},
tableData: [],
title: '',
val1: '',
val2: '',
dataList: [],
pkId: '',
pkObj: {},
qty: '',
reload: false,
status: 'more',
@@ -84,78 +85,105 @@
},
totalCount: 0,
pageNum: 1,
pageSize: 10,
disabled: false
pageSize: 10
};
},
onLoad (options) {
this.title = options.title
this.type = options.type
},
onShow () {
if (this.$store.getters.publicObj !== '') {
this.fobj = this.$store.getters.publicObj
this.$store.dispatch('setPublicObj', '')
}
if (this.$store.getters.publicArr.length) {
this.tableData = this.$store.getters.publicArr
this.$store.dispatch('setpublicArr', '')
}
},
methods: {
handleFocus () {
this.val1 = null
},
searchList () {
this.dataList = []
this.pageNum = 1
this._schBaseTask()
this._getMaterialInfo()
},
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
} else {
this.dataList = []
}
if (this.totalCount == this.dataList.length) {
this.reload = false
this.status = 'noMore'
}
}
async _getMaterialInfo () {
let res = await getMaterialInfo(this.val1)
this.dataList = res.data
// 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
// } else {
// this.dataList = []
// }
// if (this.totalCount == this.dataList.length) {
// this.reload = false
// this.status = 'noMore'
// }
// }
},
onReachBottom () {
if (this.totalCount > this.dataList.length) {
this.status = 'loading'
setTimeout(() => {
this.pageNum++
this._schBaseTask()
this._getMaterialInfo()
}, 1000)
} else { //停止加载
this.status = 'noMore'
}
},
toCheck (e) {
this.pkId = e.e.task_code === this.pkId ? '' : e.task_code
this.pkId = this.pkId === e.material_id ? '' : e.material_id
this.pkObj = this.pkId === e.material_id ? e : {}
},
async toSure (status) {
clearUp () {
this.val1 = ''
this.qty = ''
this.pkId = ''
this.pkObj = {}
this.dataList = []
this.disabled = false
},
async _materialInConfirm () {
this.disabled = true
if (!this.pkId) {
if (!this.pkId || !this.qty) {
this.disabled = false
return
}
try {
let res = await saveCheckTask(this.pkId, status)
this.pkObj.material_qty = this.qty
let res = await materialInConfirm(this.fobj.bill_type, this.fobj.struct_code, this.fobj.storagevehicle_code, this.tableData, this.pkObj)
if (res.code === '200') {
this.index = ''
this.val1 = ''
this.dataList = []
this.pkId = ''
uni.showToast({
title: res.desc,
title: res.message,
icon: 'none'
})
this.clearUp()
} else {
uni.showToast({
title: res.desc,
title: res.message,
icon: 'none'
})
this.disabled = false
}
this.disabled = false
} catch (e) {
this.disabled = false
}
}
}
}
</script>
</script>
<style scoped>
.filter_picker {
text-align: center
}
</style>

View File

@@ -11,33 +11,33 @@
<view class="zd-col-24 filter_select">
<search-box
v-model="val1"
@handleChange="handleChange"
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<view class="zd-col-6">
<span class="filter_label filter_input_disabled">所属机台</span>
</view>
<view class="zd-col-17">
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.material_spec" disabled>
<view class="zd-col-18">
<input type="text" class="filter_input filter_input_disabled" v-model="val2" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<view class="zd-col-6">
<span class="filter_label filter_input_disabled">工单</span>
</view>
<view class="zd-col-17">
<input type="text" class="filter_input filter_input_disabled" v-model="currentData.material_spec" disabled>
<view class="zd-col-18">
<input type="text" class="filter_input filter_input_disabled" v-model="val3" disabled>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-8">
<span class="filter_label">剩余物料(KG)</span>
<view class="zd-col-6">
<span class="filter_label">剩余物料</span>
</view>
<view class="zd-col-16">
<NumberInput v-model="qty" />
<input type="number" v-model="val4" class="filter_input">
</view>
<view class="zd-col-2"><span class="filter_unit">KG</span></view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
@@ -48,7 +48,7 @@
<th>序号</th>
<th>物料编码</th>
<th>物料名称</th>
<th></th>
<th></th>
<th>重量(kg)</th>
<th>生产日期</th>
<th>供应商编码</th>
@@ -62,31 +62,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': !val1 || !val3 || !val4}" :disabled="disabled" @tap="_returnConfirm">确认退回</button>
</view>
</view>
</template>
@@ -94,7 +92,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {schBaseTask, saveCheckTask} from '@/utils/getData2.js'
import {getOutGroupInfo, returnConfirm} from '@/utils/getData1.js'
export default {
components: {
NavBar,
@@ -103,21 +101,12 @@
data() {
return {
title: '',
materialData: {},
val1: '',
qty: '',
currentData: {},
val2: '',
val3: '',
val4: '',
dataList: [],
pkId: '',
reload: false,
status: 'more',
contentText: {
contentdown: '查看更多',
contentrefresh: '加载中',
contentnomore: '没有更多'
},
totalCount: 0,
pageNum: 1,
pageSize: 10,
disabled: false
};
},
@@ -125,69 +114,45 @@
this.title = options.title
},
methods: {
handleChange (e) {
if (e) {
this.searchList()
}
},
searchList () {
this.dataList = []
this.pageNum = 1
this._schBaseTask()
this._getOutGroupInfo()
},
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 _getOutGroupInfo () {
try {
let res = await getOutGroupInfo(this.val1)
if (res && res.data.length > 0) {
this.val2 = res.data.bom_code
this.val3 = res.data.device_code
this.dataList = [...res.data.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 _returnConfirm () {
this.disabled = true
if (!this.pkId) {
if (!this.val1 || !this.val3 || !this.val4) {
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 returnConfirm(this.val1, this.val3, this.val4)
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) {

View File

@@ -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 || !dataList.length}" :disabled="disabled" @tap="_pdaSmallBoxconfirmIn">确认入库</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 {queryInBillType, queryGroupInfo, pdaSmallBoxconfirmIn} 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._queryInBillType()
},
methods: {
async _getStatusEnum () {
let res = await getStatusEnum()
this.options = [...res]
this.options.map(el => {
this.$set(el, 'text', el.label)
})
async _queryInBillType () {
try {
let res = await queryInBillType()
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._queryGroupInfo()
},
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 _queryGroupInfo () {
try {
let res = await queryGroupInfo(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 _pdaSmallBoxconfirmIn () {
this.disabled = true
if (!this.pkId) {
if (!this.index || !this.val2 || !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 pdaSmallBoxconfirmIn(this.index, this.val2, 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) {