物料入库修改
This commit is contained in:
@@ -20,7 +20,7 @@
|
|||||||
<view class="pop_arrow"></view>
|
<view class="pop_arrow"></view>
|
||||||
<view class="zd-row" v-for="(e, i) in scanList" :key="i">
|
<view class="zd-row" v-for="(e, i) in scanList" :key="i">
|
||||||
<view class="scan_list_item">{{e}}</view>
|
<view class="scan_list_item">{{e}}</view>
|
||||||
<uni-icons type="clear" size="20" color="#666" @tap="toDelItem(i)"></uni-icons>
|
<!-- <uni-icons type="clear" size="20" color="#666" @tap="toDelItem(i)"></uni-icons> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -3,15 +3,15 @@
|
|||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
class="filter_input pdr120"
|
class="filter_input pdr120"
|
||||||
|
confirm-type="go"
|
||||||
:value="value"
|
:value="value"
|
||||||
:focus="focusState"
|
:focus="focusState"
|
||||||
@blur="handleBlur($event)"
|
@focus="handleFocus"
|
||||||
@input="handleChange($event)">
|
@blur="handleBlur"
|
||||||
|
@confirm="handleSend">
|
||||||
<view class="zd-row buttons_wraper">
|
<view class="zd-row buttons_wraper">
|
||||||
<!-- <uni-icons @tap="toDel" type="closeempty" size="20" color="#4e6ef2"></uni-icons> -->
|
<uni-icons v-show="value !== '' && value !== null && value !== undefined" class="pdr10" type="clear" size="24" color="#666" @tap="toDel"></uni-icons>
|
||||||
<uni-icons class="pdr10" @tap="toScan" type="scan" size="20" :color="focusState ? '#ff6a00' : '#4e6ef2'"></uni-icons>
|
<uni-icons type="scan" size="22" :color="focusState ? '#ff6a00' : '#4e6ef2'" @tap="focusState=true"></uni-icons>
|
||||||
<uni-icons @tap="toPhone" type="camera" size="26" color="#4e6ef2"></uni-icons>
|
|
||||||
<uni-icons v-show="seaShow" @tap="toSearch" type="search" size="20" color="#4e6ef2"></uni-icons>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -21,7 +21,6 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
cur: '',
|
|
||||||
focusState: false
|
focusState: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -30,97 +29,28 @@
|
|||||||
event: 'input'
|
event: 'input'
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
value: String,
|
value: String
|
||||||
seaShow: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
focused: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
focused() {
|
|
||||||
this.focusState = this.focused
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted () {
|
|
||||||
if (this.focused) {
|
|
||||||
this.focusState = true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
handleChange ($event) {
|
handleFocus () {
|
||||||
this.cur = $event.target.value
|
this.focusState = true
|
||||||
this.$emit('input', this.cur)
|
|
||||||
this.$emit('handleChange', this.cur)
|
|
||||||
if (this.focusState) {
|
|
||||||
this.focusState = false
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
handleBlur () {
|
handleBlur (e) {
|
||||||
this.focusState = false
|
this.$emit('input', e.target.value)
|
||||||
},
|
// if (e.target.value.length) {
|
||||||
toSearch () {
|
// this.$emit('handleChange', e.target.value)
|
||||||
this.$emit('toSearch', this.cur)
|
// }
|
||||||
|
this.focusState = false
|
||||||
},
|
},
|
||||||
toDel () {
|
toDel () {
|
||||||
this.cur = ''
|
|
||||||
this.$emit('input', '')
|
this.$emit('input', '')
|
||||||
},
|
},
|
||||||
toScan () {
|
handleSend (e) {
|
||||||
setTimeout(() => {
|
this.$emit('input', e.target.value)
|
||||||
this.focusState = true
|
if (e.target.value.length) {
|
||||||
},0)
|
this.$emit('handleChange', e.target.value)
|
||||||
setTimeout(() => {
|
|
||||||
uni.hideKeyboard()
|
|
||||||
}, 300)
|
|
||||||
this.cur = ''
|
|
||||||
this.$emit('input', '')
|
|
||||||
},
|
|
||||||
async toPhone() {
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
let status = await this.checkPermission();
|
|
||||||
if (status !== 1) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
// #endif
|
|
||||||
uni.scanCode({
|
|
||||||
success: (res) => {
|
|
||||||
this.$emit('input', res.result)
|
|
||||||
this.$emit('handleChange', res.result)
|
|
||||||
},
|
|
||||||
fail: (err) => {
|
|
||||||
// uni.showToast({
|
|
||||||
// title: '出错',
|
|
||||||
// icon: 'none'
|
|
||||||
// })
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
// #ifdef APP-PLUS
|
|
||||||
,
|
|
||||||
async checkPermission(code) {
|
|
||||||
let status = permision.isIOS ? await permision.requestIOS('camera') :
|
|
||||||
await permision.requestAndroid('android.permission.CAMERA');
|
|
||||||
|
|
||||||
if (status === null || status === 1) {
|
|
||||||
status = 1;
|
|
||||||
} else {
|
|
||||||
uni.showModal({
|
|
||||||
content: "需要相机权限",
|
|
||||||
confirmText: "设置",
|
|
||||||
success: function(res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
permision.gotoAppSetting();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="zd-row submit-bar">
|
<view class="zd-row submit-bar">
|
||||||
<button class="zd-col-7 button-default" @tap="clearUp">清空</button>
|
<button class="zd-col-7 button-default" @tap="clearUp">清空</button>
|
||||||
<button class="zd-col-15 button-primary" :class="{'button-info': !val1 || !val2 || !val3}" :disabled="disabled" @tap="_handheldBlanking">入库确认</button>
|
<button class="zd-col-15 button-primary" :class="{'button-info': !val1 || !val2}" :disabled="disabled" @tap="_handheldBlanking">入库确认</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -97,12 +97,18 @@
|
|||||||
},
|
},
|
||||||
async _handheldBlanking () {
|
async _handheldBlanking () {
|
||||||
this.disabled = true
|
this.disabled = true
|
||||||
if (!this.val1 || !this.val2 || !this.val3) {
|
if (!this.val1 || !this.val2) {
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
let arr = []
|
||||||
|
this.dataList.map(el => {
|
||||||
|
if (el.order_code !== '' && el.material_qty !== '') {
|
||||||
|
arr.push(el)
|
||||||
|
}
|
||||||
|
})
|
||||||
try {
|
try {
|
||||||
let res = await handheldBlanking(this.val1, this.val3, this.val2, this.dataList)
|
let res = await handheldBlanking(this.val1, this.val3, this.val2, arr)
|
||||||
this.clearUp()
|
this.clearUp()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.disabled = false
|
this.disabled = false
|
||||||
|
|||||||
@@ -2,6 +2,18 @@
|
|||||||
<view class="zd_container">
|
<view class="zd_container">
|
||||||
<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-row border-bottom">
|
||||||
|
<view class="zd-col-5">
|
||||||
|
<span class="filter_label">载具号</span>
|
||||||
|
</view>
|
||||||
|
<view class="zd-col-19">
|
||||||
|
<search-box
|
||||||
|
v-model="val1"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="zd_wrapper grid-wraper">
|
<view class="zd_wrapper grid-wraper">
|
||||||
<view class="slide_new">
|
<view class="slide_new">
|
||||||
<table>
|
<table>
|
||||||
@@ -35,7 +47,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="zd-row submit-bar">
|
<view class="zd-row submit-bar">
|
||||||
<button class="zd-col-7 button-default" @tap="clearUp">清空</button>
|
<button class="zd-col-7 button-default" @tap="clearUp">清空</button>
|
||||||
<button class="zd-col-15 button-primary" :class="{'button-info': !dataList.length}" :disabled="disabled" @tap="_updateOrder">入库确认</button>
|
<button class="zd-col-8 button-primary" :class="{'button-info': !val1}" :disabled="disabled" @tap="_fabOrders">查询</button>
|
||||||
|
<button class="zd-col-8 button-primary" :class="{'button-info': !dataList.length}" :disabled="disabled" @tap="_updateOrder">入库确认</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -53,6 +66,7 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: '',
|
title: '',
|
||||||
|
val1: '',
|
||||||
options: [],
|
options: [],
|
||||||
index: '',
|
index: '',
|
||||||
disabled: false,
|
disabled: false,
|
||||||
@@ -71,10 +85,9 @@
|
|||||||
this.options.map(el => {
|
this.options.map(el => {
|
||||||
this.$set(el, 'text', el.label)
|
this.$set(el, 'text', el.label)
|
||||||
})
|
})
|
||||||
this._fabOrders()
|
|
||||||
},
|
},
|
||||||
async _fabOrders () {
|
async _fabOrders () {
|
||||||
let res = await fabOrders()
|
let res = await fabOrders(this.val1)
|
||||||
this.dataList = [...res.content]
|
this.dataList = [...res.content]
|
||||||
},
|
},
|
||||||
selectChange (val) {
|
selectChange (val) {
|
||||||
|
|||||||
@@ -65,9 +65,9 @@ export const handheldBlanking = (code, rcode, vcode, material) => request({
|
|||||||
data: {device_code: code, region_code: rcode, vehicle_code: vcode, material: material}
|
data: {device_code: code, region_code: rcode, vehicle_code: vcode, material: material}
|
||||||
})
|
})
|
||||||
// 修改订单工序
|
// 修改订单工序
|
||||||
export const fabOrders = (data) => request({
|
export const fabOrders = (code) => request({
|
||||||
url:'api/fab/orders',
|
url:'api/fab/orders',
|
||||||
data: data
|
data: {vehicle_code: code}
|
||||||
})
|
})
|
||||||
export const updateOrder = (data) => request({
|
export const updateOrder = (data) => request({
|
||||||
url:'api/handheld/updateOrder',
|
url:'api/handheld/updateOrder',
|
||||||
|
|||||||
Reference in New Issue
Block a user