You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
302 lines
7.0 KiB
302 lines
7.0 KiB
<template>
|
|
<view class="page-wraper">
|
|
<view class="page-header flex"
|
|
style="font-size: 32rpx; padding-left: 10rpx; padding-top: 10rpx; flex-direction: column;">
|
|
|
|
</view>
|
|
<view class="page-main">
|
|
<scroll-view scroll-y="true" class="page-main-scroll">
|
|
<view style="padding-bottom: 80rpx;width: 100%;">
|
|
<view class="uni-flex uni-column " style="margin: 10rpx;">
|
|
<uni-section title="计划单号" subTitle="选择计划单号" subTitleFontSize="26rpx" titleFontSize="35rpx"
|
|
type="line">
|
|
</uni-section>
|
|
|
|
<view class="uni-flex space-between">
|
|
<view class="" style="width: 75%; ">
|
|
<uni-easyinput disabled style="margin-left: 10rpx; margin-right: 10rpx;" trim="all"
|
|
v-model="planNumber"></uni-easyinput>
|
|
</view>
|
|
<view class="uni-flex" style="width: 25%; align-items: center;">
|
|
<button type="primary" size="mini" @click="showPlanSelect">单号</button>
|
|
</view>
|
|
</view>
|
|
|
|
</view>
|
|
<view class="">
|
|
|
|
<uni-section title="选择原因" subTitle="" subTitleFontSize="26rpx" titleFontSize="35rpx"
|
|
type="line">
|
|
|
|
</uni-section>
|
|
<view class="uni-flex space-between" @click="showReasonPicker" style="height: 70rpx; align-items: center;
|
|
margin: 10rpx;
|
|
|
|
background-color: #F7F6F6; border: 1rpx solid #E5E5E5; border-radius: 10rpx; font-size: 38rpx;">
|
|
|
|
<view class="" style="margin-left: 20rpx;">
|
|
{{reason}}
|
|
</view>
|
|
<view class="">
|
|
<uni-icons type="forward" size="28"></uni-icons>
|
|
</view>
|
|
</view>
|
|
|
|
<u-picker mode="selector" v-model="showReason" :range="reasonRange"
|
|
@confirm="confirmReason"></u-picker>
|
|
</view>
|
|
<view class="">
|
|
|
|
<uni-section title="选择类型" subTitle="" subTitleFontSize="26rpx" titleFontSize="35rpx"
|
|
type="line">
|
|
|
|
</uni-section>
|
|
<view class="uni-flex space-between" @click="showTypePicker" style="height: 70rpx; align-items: center;
|
|
margin: 10rpx;
|
|
|
|
background-color: #F7F6F6; border: 1rpx solid #E5E5E5; border-radius: 10rpx; font-size: 38rpx;">
|
|
|
|
<view class="" style="margin-left: 20rpx; align-items: center;">
|
|
{{type}}
|
|
</view>
|
|
<view class="">
|
|
<uni-icons type="forward" size="28"></uni-icons>
|
|
</view>
|
|
</view>
|
|
|
|
<u-picker mode="selector" v-model="showType" :range="typeRange"
|
|
@confirm="confirmType"></u-picker>
|
|
</view>
|
|
|
|
<view class="uni-flex uni-column " style="margin: 10rpx;">
|
|
<uni-section title="扫描" subTitle="扫码" subTitleFontSize="26rpx" titleFontSize="35rpx"
|
|
type="line">
|
|
</uni-section>
|
|
|
|
<view class="uni-flex space-between">
|
|
<view class="" style="width: 90%; ">
|
|
<uni-easyinput style="margin-left: 10rpx; margin-right: 10rpx;" trim="all"
|
|
v-model="scanCode" @clear="clearCode" @confirm="onConfirm"></uni-easyinput>
|
|
</view>
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
</scroll-view>
|
|
</view>
|
|
<view class="page-footer">
|
|
<view class="uni-flex u-col-center space-between padding_10"
|
|
style="background-color:ghostwhite; width: 100%; ">
|
|
<view class="">
|
|
<!-- <button class="btn_single_reset" hover-class="btn_single_after" @click="reset">重置</button> -->
|
|
</view>
|
|
<view class=" uni-flex uni-row">
|
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="submit">提交</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<selectClickList ref="selectPopup" title="选择计划单号" @select="selectPlan"></selectClickList>
|
|
|
|
</view>
|
|
|
|
|
|
</template>
|
|
<script module="render" lang="renderjs">
|
|
export default {
|
|
methods: {
|
|
_inputFocus(event) {
|
|
document.querySelector('#inputSelect input').select()
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
<script>
|
|
import {
|
|
getFoamPlaneNumberList,
|
|
foamNoGoodSubmit
|
|
} from '@/api/request2.js';
|
|
import {
|
|
showConfirmMsg
|
|
} from "@/common/utils.js"
|
|
|
|
import {
|
|
getCurrDateTime,
|
|
} from "@/common/basic.js"
|
|
import selectClickList from "@/mycomponents/popup/selectClickList.vue"
|
|
|
|
export default {
|
|
components: {
|
|
selectClickList
|
|
},
|
|
data() {
|
|
return {
|
|
dateTime: "",
|
|
planNumber: "",
|
|
dataList: [],
|
|
userForm: {
|
|
names: [],
|
|
values: [],
|
|
origin: []
|
|
},
|
|
materialList: [],
|
|
planList: [],
|
|
scanCode: "",
|
|
showReason: false,
|
|
showType: false,
|
|
reason: "",
|
|
type: "",
|
|
mode: 'selector',
|
|
reasonRange: ['破损', '返工与返修'],
|
|
typeRange: ["合格", "报废"]
|
|
|
|
}
|
|
},
|
|
computed: {},
|
|
onLoad() {},
|
|
onUnload() {},
|
|
onReady() {
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
showTypePicker() {
|
|
this.showType = true;
|
|
},
|
|
confirmType(e) {
|
|
this.type = this.typeRange[e[0]];
|
|
console.log("原因", JSON.stringify(e))
|
|
},
|
|
showReasonPicker() {
|
|
this.showReason = true;
|
|
},
|
|
confirmReason(e) {
|
|
this.reason = this.reasonRange[e[0]];
|
|
console.log("原因", JSON.stringify(e))
|
|
},
|
|
submit() {
|
|
if (this.planNumber == "") {
|
|
this.showMessage("请选择计划单号")
|
|
return
|
|
}
|
|
uni.showLoading({
|
|
title: "加载中",
|
|
mask: true
|
|
})
|
|
var param = {
|
|
planNumber: this.planNumber,
|
|
id: this.$store.state.user.id,
|
|
createTime: getCurrDateTime(),
|
|
}
|
|
console.log("提交", JSON.stringify(param))
|
|
|
|
foamNoGoodSubmit(param).then(res => {
|
|
uni.hideLoading()
|
|
this.showMessage("提交成功")
|
|
this.resetData()
|
|
}).catch(error => {
|
|
uni.hideLoading()
|
|
this.showMessage(error)
|
|
})
|
|
},
|
|
showMessage(hint) {
|
|
showConfirmMsg("提示", hint, false, callBack => {
|
|
|
|
})
|
|
},
|
|
resetData() {
|
|
this.planNumber = "";
|
|
},
|
|
clearCode() {
|
|
this.scanCode = "";
|
|
},
|
|
onConfirm(data) {
|
|
console.log(data)
|
|
},
|
|
showPlanSelect() {
|
|
uni.showLoading({
|
|
title: "加载中",
|
|
mask: true
|
|
})
|
|
getFoamPlaneNumberList().then(res => {
|
|
uni.hideLoading()
|
|
if (res.Result.length > 0) {
|
|
var list = [];
|
|
list = res.Result;
|
|
list.forEach(res => {
|
|
res.label = res.PLAN_NO;
|
|
res.value = res.SHIFT_CODE
|
|
})
|
|
this.$refs.selectPopup.openScanPopup(list)
|
|
} else {
|
|
this.showMessage("原料列表为0")
|
|
}
|
|
|
|
}).catch(error => {
|
|
uni.hideLoading()
|
|
this.showMessage(error)
|
|
})
|
|
},
|
|
|
|
selectPlan(data) {
|
|
this.planNumber = data.label
|
|
console.log(data)
|
|
},
|
|
openScanPopup() {
|
|
this.$refs.scanPopup.openScanPopup();
|
|
},
|
|
|
|
closeScanPopup() {
|
|
this.$refs.scanPopup.closeScanPopup();
|
|
},
|
|
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.example {
|
|
padding: 15px;
|
|
background-color: #fff;
|
|
}
|
|
|
|
.segmented-control {
|
|
margin-bottom: 15px;
|
|
}
|
|
|
|
.button-group {
|
|
margin-top: 15px;
|
|
display: flex;
|
|
justify-content: space-around;
|
|
}
|
|
|
|
.form-item {
|
|
display: flex;
|
|
align-items: center;
|
|
flex: 1;
|
|
}
|
|
|
|
.button {
|
|
display: flex;
|
|
align-items: center;
|
|
height: 35px;
|
|
line-height: 35px;
|
|
margin-left: 10px;
|
|
}
|
|
|
|
.input {
|
|
padding: 10rpx;
|
|
height: 65rpx;
|
|
text-align: left;
|
|
margin: 5rpx;
|
|
font-size: 28rpx;
|
|
color: #333;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
outline: none;
|
|
border-radius: 10rpx;
|
|
border: 1rpx solid lightgrey;
|
|
}
|
|
</style>
|