This commit is contained in:
2025-09-08 15:41:33 +08:00
parent c41a17952b
commit d7667fac02
10 changed files with 628 additions and 718 deletions

View File

@@ -4,6 +4,14 @@
<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">载具编码</span>
</view>
<view class="zd-col-18">
<search-box v-model="vehicleCode"/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-6">
<span class="filter_label">起点</span>
@@ -32,7 +40,7 @@
</view>
<view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="toEmpty">清空</button>
<button class="zd-col-18 button-primary" :class="{'button-info': !code1}" :disabled="disabled">生成任务</button>
<button class="zd-col-18 button-primary" :class="{'button-info': !code1 || !code2 || !index}" :disabled="disabled" @tap="_createTask">生成任务</button>
</view>
</view>
</template>
@@ -40,8 +48,8 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getDate} from '@/utils/utils.js'
import {getStructCount, inStorageOrder, getBillNoInfo, storList, inStorageConfirm} from '@/utils/getData2.js'
import {queryVehicleType} from '@/utils/mork2.js'
import {createTask} from '@/utils/getData2.js'
export default {
components: {
NavBar,
@@ -50,46 +58,54 @@
data() {
return {
title: '',
vehicleCode: null,
code1: '',
code2: '',
options: [{value: '1', text: '小料箱'}, {value: '2', text: '大料箱或其他'}],
options: [],
index: '',
disabled: false
};
},
onLoad (options) {
this.title = options.title
this._queryVehicleType()
},
methods: {
/** 下拉框*/
async _inStorageOrder () {
let res = await inStorageOrder()
this.options1 = [...res]
},
handleChange1 (e) {
if (e) {
this._getBillNoInfo(e)
async _queryVehicleType () {
try {
let res = await queryVehicleType()
if (res && res.data.length > 0) {
this.options = [...res.data]
} else {
this.options = []
}
} catch (e) {
this.options = []
}
},
toEmpty () {
this.vehicleCode = null,
this.code1 = ''
this.code2 = ''
this.index = ''
this.disabled = false
},
async _inStorageConfirm () {
async _createTask () {
this.disabled = true
if (!this.index) {
if (!this.code1 || !this.code2 || !this.index) {
this.disabled = false
return
}
try {
let res = await inStorageConfirm()
if (res.code === '200') {
this.index = ''
let res = await createTask(this.vehicleCode, this.code1, this.code2, this.index)
if (res) {
uni.showToast({
title: res.message,
icon: 'none'
})
}
this.disabled = false
uni.showToast({
title: res.msg,
icon: 'none'
})
} catch (e) {
this.disabled = false
}