This commit is contained in:
2025-11-24 11:02:42 +08:00
parent ca41f4f528
commit 765f48bd03
12 changed files with 441 additions and 221 deletions

View File

@@ -16,6 +16,15 @@
/>
</view>
</view>
<view class="zd-row border-bottom">
<view class="zd-col-7">
<!-- <span class="filter_label"></span> -->
<span class="filter_label">{{$t('filter.col')}}</span>
</view>
<view class="zd-col-24 filter_select">
<uni-data-select v-model="index" :localdata="options" placeholder="" @change="selectChange"></uni-data-select>
</view>
</view>
</view>
<view class="zd_wrapper grid-wraper">
<view class="slide_new">
@@ -52,12 +61,12 @@
<!-- <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-6 button-default" @tap="clearUp">清空</button>
<!-- <button class="zd-col-6 button-default" @tap="clearUp">清空点位</button>
<button class="zd-col-7 button-primary" @tap="searchList">查询</button>
<button class="zd-col-7 button-primary" :class="{'button-info': !val1 || !dataList.length}" :disabled="disabled" @tap="_comfirmGetting">确认取货</button> -->
<button class="zd-col-8 button-default" @tap="clearUp">{{$t('button.clear')}}</button>
<button class="zd-col-7 button-primary" :class="{'button-info': !val1 || !dataList.length}" :disabled="disabled" @tap="_cleanCol">清空列</button> -->
<button class="zd-col-8 button-default" :class="{'button-info': !val1}" :disabled="disabled2" @tap="_cleanPoint">{{$t('button.clear-point')}}</button>
<button class="zd-col-7 button-primary" @tap="searchList">{{$t('button.search')}}</button>
<button class="zd-col-7 button-primary" :class="{'button-info': !val1}" :disabled="disabled" @tap="handleConfirm">{{$t('button.confirm-quhuo')}}</button>
<button class="zd-col-7 button-primary" :class="{'button-info': !index}" :disabled="disabled" @tap="handleConfirm">{{$t('button.clear-col')}}</button>
</view>
</view>
</template>
@@ -66,7 +75,7 @@
import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue'
import { confirmAction } from '@/utils/utils.js'
import {getMaterialInfoByPoint, comfirmGetting} from '@/utils/getData4.js'
import {getColsByPoint, getMaterialInfoByPoint, cleanPoint, cleanCol} from '@/utils/getData4.js'
export default {
components: {
NavBar,
@@ -76,6 +85,8 @@
return {
title: '',
val1: '',
options: [],
index: '',
dataList: [],
reload: false,
status: 'more',
@@ -87,20 +98,38 @@
totalCount: 0,
pageNum: 1,
pageSize: 10,
disabled: false
disabled: false,
disabled2: false,
};
},
onLoad (options) {
this.title = options.title
},
methods: {
async _getColsByPoint () {
try {
let res = await getColsByPoint(this.val1)
if (res) {
this.options = res.data
} else {
this.options =[]
}
} catch (e) {
this.options = []
}
},
selectChange (e) {
this.index = e
},
clearUp () {
this.val1 = ''
this.index = ''
this.dataList = []
this.disabled = false
},
handleChange (e) {
if (e) {
this._getColsByPoint()
this.searchList()
}
},
@@ -109,6 +138,25 @@
this.pageNum = 1
this._getMaterialInfoByPoint()
},
async _cleanPoint () {
this.disabled2 = true
if (!this.val1) {
this.disabled2 = false
return
}
try {
let res = await cleanPoint(this.val1)
if (res) {
uni.showToast({
title: res.message,
icon: 'none'
})
}
this.val1 = ''
} catch (e) {
this.disabled2 = false
}
},
async _getMaterialInfoByPoint () {
let res = await getMaterialInfoByPoint(this.val1)
if (res.code === '200') {
@@ -139,18 +187,18 @@
}
},
async handleConfirm() {
if (!this.val1) {
if (!this.index) {
return
}
const isConfirmed = await confirmAction("确认操作", "确定要执行此操作吗?")
if (isConfirmed) {
this._comfirmGetting()
this._cleanCol()
}
},
async _comfirmGetting () {
async _cleanCol () {
this.disabled = true
try {
let res = await comfirmGetting(this.val1, this.dataList)
let res = await cleanCol(this.index)
uni.showToast({
title: res.message,
icon: 'none'