新需求

This commit is contained in:
蔡玲
2024-09-06 10:51:49 +08:00
parent 20f8520be2
commit f2c9f1b896
5 changed files with 45 additions and 78 deletions

View File

@@ -3,36 +3,25 @@
<nav-bar :title="title"></nav-bar> <nav-bar :title="title"></nav-bar>
<view class="zd_content"> <view class="zd_content">
<view class="zd_wrapper"> <view class="zd_wrapper">
<view class="zd-row border-bottom"> <view class="zd-row">
<view class="zd-col-5"> <view class="zd-col-5">
<span class="filter_label">区域一</span> <span class="filter_label">区域一</span>
</view> </view>
<view class="zd-col-19 filter_select"> <view class="zd-col-19 filter_select">
<uni-data-select v-model="index1" :localdata="options1"></uni-data-select> <zxz-uni-data-select
</view> v-model="index"
</view> :localdata="options"
<view class="zd-row border-bottom"> :multiple="true"
<view class="zd-col-5"> :collapseTags="true"
<span class="filter_label">区域二</span> />
</view>
<view class="zd-col-19 filter_select">
<uni-data-select v-model="index2" :localdata="options1"></uni-data-select>
</view>
</view>
<view class="zd-row">
<view class="zd-col-5">
<span class="filter_label">区域三</span>
</view>
<view class="zd-col-19 filter_select">
<uni-data-select v-model="index3" :localdata="options1"></uni-data-select>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="zd-row submit-bar"> <view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="clearUp">清空</button> <button class="zd-col-5 button-default" @tap="clearUp">清空</button>
<button class="zd-col-8 button-primary" :class="{'button-info': index1 === '' && index2 === '' && index3 === ''}" :disabled="disabled" @tap="_handheldLock('1')">锁定</button> <button class="zd-col-8 button-primary" :class="{'button-info': index.length === 0}" :disabled="disabled" @tap="_handheldLock('1')">锁定</button>
<button class="zd-col-8 button-primary" :class="{'button-info': index1 === '' && index2 === '' && index3 === ''}" :disabled="disabled" @tap="_handheldLock('0')">释放</button> <button class="zd-col-8 button-primary" :class="{'button-info': index.length === 0}" :disabled="disabled" @tap="_handheldLock('0')">释放</button>
</view> </view>
</view> </view>
</template> </template>
@@ -50,10 +39,9 @@
data() { data() {
return { return {
title: '', title: '',
options1: [], options: [],
index1: '', index: [],
index2: '', multiple: true,
index3: '',
disabled: false disabled: false
}; };
}, },
@@ -64,20 +52,19 @@
methods: { methods: {
async _regionList () { async _regionList () {
let res = await regionList() let res = await regionList()
this.options1 = [...res.content] this.options = [...res.content]
this.options1.map(el => { this.options.map(el => {
this.$set(el, 'text', el.label) this.$set(el, 'text', el.label)
}) })
}, },
async _handheldLock (type) { async _handheldLock (type) {
this.disabled = true this.disabled = true
if (this.index1 === '' && this.index2 === '' && this.index3 === '') { if (this.index.length === 0) {
this.disabled = false this.disabled = false
return return
} }
try { try {
let arr = [this.index1, this.index2, this.index3] let res = await handheldLock(this.index, type)
let res = await handheldLock(arr, type)
this.clearUp() this.clearUp()
uni.showToast({ uni.showToast({
title: res.message, title: res.message,
@@ -88,9 +75,7 @@
} }
}, },
clearUp () { clearUp () {
this.index1 = '' this.index = []
this.index2 = ''
this.index3 = ''
this.disabled = false this.disabled = false
} }
} }

View File

@@ -33,8 +33,8 @@
</view> </view>
<view class="zd-row submit-bar"> <view class="zd-row submit-bar">
<button class="zd-col-4 button-default button-primary_s" @tap="clearUp">清空</button> <button class="zd-col-4 button-default button-primary_s" @tap="clearUp">清空</button>
<button class="zd-col-9 button-primary button-primary_s" :class="{'button-info': !val1 || !val2 || !index}" :disabled="disabled" @tap="_handheldCageFrame">空笼框送回确认</button> <button class="zd-col-9 button-primary button-primary_s" :class="{'button-info': !val1 || !val2 || !index}" :disabled="disabled" @tap="_handheldCageFrame('1')">空笼框送回确认</button>
<button class="zd-col-9 button-primary button-primary_s" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_handheldRack">空料架送回确认</button> <button class="zd-col-9 button-primary button-primary_s" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_handheldCageFrame('2')">空料架送回确认</button>
</view> </view>
</view> </view>
</template> </template>
@@ -43,7 +43,7 @@
import NavBar from '@/components/NavBar.vue' import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue' import SearchBox from '@/components/SearchBox.vue'
import LinkScan from '@/components/LinkScan.vue' import LinkScan from '@/components/LinkScan.vue'
import {handheldCageFrame, handheldRack} from '@/utils/getData2.js' import {handheldCageFrame} from '@/utils/getData2.js'
export default { export default {
components: { components: {
NavBar, NavBar,
@@ -67,31 +67,22 @@
getScanlist (e) { getScanlist (e) {
this.val2 = e.join() this.val2 = e.join()
}, },
async _handheldCageFrame () { async _handheldCageFrame (type) {
this.disabled = true this.disabled = true
if (!this.val1 || !this.val2 || !this.index) { if (type === '1' && (!this.val1 || !this.val2 || !this.index)) {
this.disabled = false
return
}
if (type === '2' && (!this.val1 || !this.val2)) {
this.disabled = false this.disabled = false
return return
} }
try { try {
let res = await handheldCageFrame(this.val1, this.val2, this.index) if (type === '1') {
this.clearUp() let res = await handheldCageFrame(type, this.val1, this.val2, this.index)
uni.showToast({ } else if (type === '2') {
title: res.message, let res = await handheldCageFrame(type, this.val1, this.val2, '')
icon: 'none' }
})
} catch (e) {
this.disabled = false
}
},
async _handheldRack () {
this.disabled = true
if (!this.val1 || !this.val2) {
this.disabled = false
return
}
try {
let res = await handheldRack(this.val1, this.val2)
this.clearUp() this.clearUp()
uni.showToast({ uni.showToast({
title: res.message, title: res.message,

View File

@@ -67,8 +67,8 @@
</view> </view>
<view class="zd-row submit-bar"> <view class="zd-row submit-bar">
<button class="zd-col-5 button-default" @tap="clearUp">清空</button> <button class="zd-col-5 button-default" @tap="clearUp">清空</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_handheldBlanking">入库确认</button> <button class="zd-col-8 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_handheldBlanking('1')">入库确认</button>
<button class="zd-col-8 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_handheldTranshipment">物料转运</button> <button class="zd-col-8 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_handheldBlanking('2')">物料转运</button>
</view> </view>
</view> </view>
</template> </template>
@@ -76,7 +76,7 @@
<script> <script>
import NavBar from '@/components/NavBar.vue' import NavBar from '@/components/NavBar.vue'
import SearchBox from '@/components/SearchBox.vue' import SearchBox from '@/components/SearchBox.vue'
import {regionList, handheldBlanking, handheldTranshipment} from '@/utils/getData2.js' import {regionList, handheldBlanking} from '@/utils/getData2.js'
export default { export default {
components: { components: {
NavBar, NavBar,
@@ -122,7 +122,7 @@
this.index1 = '' this.index1 = ''
this.disabled = false this.disabled = false
}, },
async _handheldBlanking () { async _handheldBlanking (type) {
this.disabled = true this.disabled = true
if (!this.val1 || !this.val2) { if (!this.val1 || !this.val2) {
this.disabled = false this.disabled = false
@@ -135,20 +135,11 @@
} }
}) })
try { try {
let res = await handheldBlanking(this.val1, this.index, this.val2, arr, this.index1) if (type === '1') {
this.clearUp() let res = await handheldBlanking(type, this.val1, this.index, this.val2, arr, this.index1)
} catch (e) { } else if (type === '2') {
this.disabled = false let res = await handheldBlanking(type, this.val1, '', this.val2, '', '')
} }
},
async _handheldTranshipment () {
this.disabled = true
if (!this.val1 || !this.val2) {
this.disabled = false
return
}
try {
let res = await handheldTranshipment(this.val1, this.val2)
this.clearUp() this.clearUp()
uni.showToast({ uni.showToast({
title: res.message, title: res.message,

View File

@@ -36,9 +36,9 @@ export const handheldRack = (code, vcode) => request({
data: {device_code: code, vehicle_code: vcode} data: {device_code: code, vehicle_code: vcode}
}) })
// 外协区空笼框送回 // 外协区空笼框送回
export const handheldCageFrame = (code, list, rcode) => request({ export const handheldCageFrame = (type, code, list, rcode) => request({
url:'api/handheld/cageFrame', url:'api/handheld/cageFrame',
data: {device_code: code, vehicle_list: list, region_code: rcode} data: {type: type, device_code: code, vehicle_list: list, region_code: rcode}
}) })
// 物料转运 // 物料转运
export const handheldTranshipment = (code, vcode) => request({ export const handheldTranshipment = (code, vcode) => request({
@@ -60,9 +60,9 @@ export const handheldStorehouse = (code, type) => request({
// url:'api/handheld/getRegionCode', // url:'api/handheld/getRegionCode',
// data: {orderCode: code} // data: {orderCode: code}
// }) // })
export const handheldBlanking = (code, rcode, vcode, material, rcode1) => request({ export const handheldBlanking = (type, code, rcode, vcode, material, rcode1) => request({
url:'api/handheld/blanking', url:'api/handheld/blanking',
data: {device_code: code, region_code: rcode, vehicle_code: vcode, material: material, region_code1: rcode1} data: {type: type, device_code: code, region_code: rcode, vehicle_code: vcode, material: material, region_code1: rcode1}
}) })
// 修改订单工序 // 修改订单工序
export const fabOrders = (code) => request({ export const fabOrders = (code) => request({

View File

@@ -9,7 +9,7 @@ export const handLogin = (user, password) => {
} }
export const regionList = () => { export const regionList = () => {
let res = { let res = {
content: [{value: '1', label: 'aa'}, {value: '2', label: 'bb'}] content: [{value: '1', label: 'A0000001'}, {value: '2', label: 'A0000002'}, {value: '3', label: 'A0000003'}, {value: '4', label: 'A0000004'}, {value: '5', label: 'A0000005'}, {value: '6', label: 'A0000006'}]
} }
return res return res
} }