This commit is contained in:
2025-08-08 10:03:19 +08:00
parent 5effcd61b3
commit a907127908
10 changed files with 685 additions and 367 deletions

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">
@@ -40,7 +40,7 @@
</view>
<view class="zd-row submit-bar">
<button class="zd-col-6 button-default" @tap="clearUp">清空</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !val2 || !index || !index2}" :disabled="disabled" @tap="_vehicleOutConfirm">确认</button>
<button class="zd-col-16 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_sendPointTask">确认</button>
</view>
</view>
</template>
@@ -48,7 +48,7 @@
<script>
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import {getSect, getRegion, vehicleOutConfirm} from '@/utils/getData3.js'
import {getRegions, getPointnByRegion, sendPointTask} from '@/utils/getData4.js'
export default {
components: {
NavBar,
@@ -71,12 +71,13 @@
this.title = options.title
},
created () {
this._getSect()
this._getRegions1()
this._getRegions2()
},
methods: {
async _getSect () {
async _getRegions1 () {
try {
let res = await getSect()
let res = await getRegions()
if (res) {
this.options = res
} else {
@@ -88,10 +89,11 @@
},
selectChange (e) {
this.index = e
this._getPointnByRegion1()
},
async _getRegion () {
async _getRegions2 () {
try {
let res = await getRegion()
let res = await getRegions()
if (res) {
this.options2 = res
} else {
@@ -103,22 +105,33 @@
},
selectChange2 (e) {
this.index2 = e
this._getPointnByRegion2()
},
async _getPointnByRegion1 () {
let res = await getPointnByRegion(this.index)
if (res.code === '200') {
this.val1 = res.data[0].point_code
}
},
async _getPointnByRegion2 () {
let res = await getPointnByRegion(this.index2)
if (res.code === '200') {
this.val2 = res.data[0].point_code
}
},
clearUp () {
this.val1 = ''
this.val2 = ''
this.index = ''
this.index2 = ''
this.disabled = false
},
async _vehicleOutConfirm () {
async _sendPointTask () {
this.disabled = true
if (!val1 || !val2 || !index || !index2) {
if (!val1 || !val2) {
this.disabled = false
return
}
try {
let res = await vehicleOutConfirm(this.index, this.val1)
let res = await sendPointTask(this.val1, this.val2)
if (res.code === '200') {
uni.showToast({
title: res.message,