Browse Source

自动提交和合格品扫码

master
lijuncheng 5 months ago
parent
commit
44320eb52b
  1. 22
      src/api/request2.js
  2. 8
      src/common/classify.data.js
  3. 9
      src/pages.json
  4. 7
      src/pages/foam/downLink.vue
  5. 105
      src/pages/foam/upLink.vue
  6. 281
      src/pages/plastics/plasticsGood.vue
  7. 32
      src/pages/plastics/scanCode.vue
  8. 3
      src/static/config.js
  9. 1
      src/store/modules/user.js

22
src/api/request2.js

@ -234,7 +234,7 @@ export function getFoamPlaneNumberList() {
*/
export function getPlasticsPlaneNumberList() {
return request({
url: baseApi + "/Plan/GetList?Type=paomo",
url: baseApi + "/Plan/GetList?Type=zhusu",
method: "get",
data: {},
});
@ -408,7 +408,7 @@ export function plasticsNoGoodSubmit(params) {
*/
export function getUpLinkPlaneNumberList() {
return request({
url: baseApi + "/Inventory/GetPlanList?state=ok",
url: baseApi + "/Inventory/GetPlanList?type=1&state=ok",
method: "get",
data: {},
});
@ -427,10 +427,11 @@ export function getFoamScanUpLinkInfo(machineCode) {
/**
* @param params获取泡沫 不良品收货 计划单号
* type 1泡沫 2注塑
*/
export function getFoamNoGoodNumberList() {
export function getFoamNoGoodNumberList(type) {
return request({
url: baseApi + "/Inventory/GetPlanList?state=nok",
url: baseApi + "/Inventory/GetPlanList?type=1&state=nok",
method: "get",
data: {},
});
@ -441,7 +442,18 @@ export function getFoamNoGoodNumberList() {
*/
export function getPlasticsNoGoodNumberList() {
return request({
url: baseApi + "/Inventory/GetPlanList?state=nok",
url: baseApi + "/Inventory/GetPlanList?type=2&state=nok",
method: "get",
data: {},
});
}
/**
* @param params 注塑合格品 计划 type=2 注塑
*/
export function getPlasticsGoodPlaneNumberList() {
return request({
url: baseApi + "/Inventory/GetPlanList?type=2&state=ok",
method: "get",
data: {},
});

8
src/common/classify.data.js

@ -80,6 +80,14 @@ export default [{
"path": "/pages/plastics/plasticsNoGood",
"index": 2,
},
{
"name": "合格品扫码",
"code":"SPDA000005",
"icon": "/unbind_pallet.svg",
"isShow":true,
"path": "/pages/plastics/plasticsGood",
"index": 2,
},
]
}

9
src/pages.json

@ -126,6 +126,15 @@
}
}
},
{
"path": "pages/plastics/plasticsGood",
"style": {
"navigationBarTitleText": "合格品扫码(注塑)",
"titleNView": {
"buttons": [{}]
}
}
},
{
"path": "pages/plastics/scanCode",
"style": {

7
src/pages/foam/downLink.vue

@ -17,6 +17,7 @@
<view class="" style="width: 90%; ">
<uni-easyinput style="margin-left: 10rpx; margin-right: 10rpx;" trim="all"
v-model="scanCode" @clear="clearCode"
ref="inputScan"
:focus="true"
@confirm="onConfirm"></uni-easyinput>
</view>
@ -133,7 +134,9 @@
downLickSubmit(param).then(res => {
uni.hideLoading()
this.showMessage("提交成功")
uni.showToast({
title: '提交成功',
});
this.resetData()
}).catch(error => {
uni.hideLoading()
@ -148,6 +151,7 @@
resetData() {
this.scanCode =""
this.scanCheckCode=""
this.$refs.inputScan.focused = true
},
clearCode() {
this.scanCode = ""
@ -160,6 +164,7 @@
}
this.scanCode = data;
this.scanCheckCode=data
this.submit();
// if(data==undefined||data==""){
// this.showMessage(",")
// return;

105
src/pages/foam/upLink.vue

@ -31,37 +31,10 @@
<view class="uni-flex space-between">
<view class="" style="width: 75%; ">
<uni-easyinput style="margin-left: 10rpx; margin-right: 10rpx;" trim="all"
v-model="scanCode" @clear="clearCode"
ref="inputScan"
v-model="scanCode" @clear="clearCode" ref="inputScan"
@confirm="onConfirm"></uni-easyinput>
</view>
</view>
<view class="" v-if="false">
<uni-table border stripe >
<!-- 表头行 -->
<!-- <uni-tr>
<uni-th align="center">日期</uni-th>
<uni-th align="center">姓名</uni-th>
<uni-th align="left">地址</uni-th>
</uni-tr> -->
<!-- 表格数据行 -->
<uni-tr>
<uni-td >箱码</uni-td>
<uni-td>1234</uni-td>
</uni-tr>
<uni-tr>
<uni-td>批次</uni-td>
<uni-td>20240508</uni-td>
</uni-tr>
<uni-tr>
<uni-td>库位</uni-td>
<uni-td>103</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
@ -99,7 +72,6 @@
import {
getUpLinkPlaneNumberList,
upLickSubmit,
getFoamScanUpLinkInfo
} from '@/api/request2.js';
import {
showConfirmMsg
@ -128,15 +100,15 @@
materialList: [],
planList: [],
scanCode: "",
scanCheckCode:"",
scanCheckCode: "",
lastTime: null, //
currentTime: null, //
timeOut:uni.getStorageSync("timeOut")?uni.getStorageSync("timeOut"):config.pageTimeOut,// :30
timeOut: uni.getStorageSync("timeOut") ? uni.getStorageSync("timeOut") : config.pageTimeOut, // :30
}
},
computed: {},
onShow(){
onShow() {
this.lastTime = new Date().getTime()
},
@ -144,7 +116,7 @@
touchScreen() {
this.currentTime = new Date().getTime() //
console.log("当前时间", this.currentTime)
if (this.currentTime - this.lastTime > this.timeOut*60*1000) { // 30
if (this.currentTime - this.lastTime > this.timeOut * 60 * 1000) { // 30
console.log("当前时间跳转")
uni.reLaunch({
url: "../login/index"
@ -160,30 +132,33 @@
return
}
if (this.scanCheckCode == "") {
this.scanCheckCode=""
this.showMessage("请先校验扫描码")
this.scanCheckCode = ""
this.showMessage("请先校验产品码")
return
}
uni.showLoading({
title: "加载中",
mask: true
})
var param = {
PlanID : this.planNumber,
PlanID: this.planNumber,
id: this.$store.state.user.id,
createTime: getCurrDateTime(),
ProductCode :this.scanCheckCode,
Type:1,
State:1,
ProductCode: this.scanCheckCode,
Type: 1,
State: 1,
User: this.$store.state.user.name
}
console.log("提交", JSON.stringify(param))
upLickSubmit(param).then(res => {
uni.hideLoading()
this.showMessage("提交成功")
uni.showToast({
title: '提交成功',
});
// this.showMessage("")
this.resetData()
}).catch(error => {
uni.hideLoading()
@ -196,49 +171,23 @@
})
},
resetData() {
this.planNumber = "";
this.scanCode =""
this.scanCheckCode=""
this.scanCode = ""
this.scanCheckCode = ""
this.$refs.inputScan.focused = true
},
clearCode() {
this.scanCode = "";
this.scanCheckCode=""
this.scanCheckCode = ""
},
onConfirm(data){
if(!data){
onConfirm(data) {
if (!data) {
this.showMessage("扫描数据不能为空")
return;
}
this.scanCode = data;
this.scanCheckCode=data
},
onConfirm1(data) {
if(this.planNumber==""){
this.showMessage("请先选择单号")
this.scanCode = "";
this.scanCheckCode = "";
return;
}
if(data==undefined||data==""){
this.showMessage("扫描数据为空,请先输入")
return;
}
uni.showLoading({
title: "加载中",
mask: true
})
getFoamScanUpLinkInfo(data).then(res => {
uni.hideLoading()
this.scanCode = data;
this.scanCheckCode = data;
console.log(data)
}).catch(error => {
this.scanCode = "";
this.scanCheckCode = "";
uni.hideLoading()
this.showMessage("扫描["+data+"]"+error)
})
this.scanCheckCode = data
this.submit();
},
showPlanSelect() {
uni.showLoading({
@ -256,7 +205,7 @@
})
this.$refs.selectPopup.openScanPopup(list)
} else {
this.showMessage("原料列表为0")
this.showMessage("列表为0")
}
}).catch(error => {

281
src/pages/plastics/plasticsGood.vue

@ -0,0 +1,281 @@
<template>
<view class="page-wraper" @touchstart="touchScreen">
<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-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 style="margin-left: 10rpx; margin-right: 10rpx;" trim="all"
v-model="scanCode" @clear="clearCode"
ref="inputScan"
@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 {
getPlasticsGoodPlaneNumberList,
upLickSubmit,
} from '@/api/request2.js';
import {
showConfirmMsg
} from "@/common/utils.js"
import {
getCurrDateTime,
} from "@/common/basic.js"
import selectClickList from "@/mycomponents/popup/selectClickList.vue"
import config from '@/static/config.js'
export default {
components: {
selectClickList
},
data() {
return {
dateTime: "",
planNumber: "",
dataList: [],
userForm: {
names: [],
values: [],
origin: []
},
materialList: [],
planList: [],
scanCode: "",
scanCheckCode:"",
lastTime: null, //
currentTime: null, //
timeOut:uni.getStorageSync("timeOut")?uni.getStorageSync("timeOut"):config.pageTimeOut,// :30
}
},
computed: {},
onShow(){
this.lastTime = new Date().getTime()
},
methods: {
touchScreen() {
this.currentTime = new Date().getTime() //
console.log("当前时间", this.currentTime)
if (this.currentTime - this.lastTime > this.timeOut*60*1000) { // 30
console.log("当前时间跳转")
uni.reLaunch({
url: "../login/index"
})
} else {
this.lastTime = new Date().getTime() // 30
console.log("当前时间跳转赋值,没跳转" + this.lastTime)
}
},
submit() {
if (this.planNumber == "") {
this.showMessage("请选择计划单号")
return
}
if (this.scanCheckCode == "") {
this.scanCheckCode=""
this.showMessage("请先校验产品码")
return
}
uni.showLoading({
title: "加载中",
mask: true
})
var param = {
PlanID : this.planNumber,
id: this.$store.state.user.id,
createTime: getCurrDateTime(),
ProductCode :this.scanCheckCode,
Type:2,
State:1,
User: this.$store.state.user.name
}
console.log("提交", JSON.stringify(param))
upLickSubmit(param).then(res => {
uni.hideLoading()
uni.showToast({
title: '提交成功',
});
this.resetData()
}).catch(error => {
uni.hideLoading()
this.showMessage(error)
})
},
showMessage(hint) {
showConfirmMsg("提示", hint, false, callBack => {
})
},
resetData() {
this.scanCode =""
this.scanCheckCode=""
this.$refs.inputScan.focused = true
},
clearCode() {
this.scanCode = "";
this.scanCheckCode=""
},
onConfirm(data){
if(!data){
this.showMessage("扫描数据不能为空")
return;
}
this.scanCode = data;
this.scanCheckCode=data
this.submit();
},
showPlanSelect() {
uni.showLoading({
title: "加载中",
mask: true
})
getPlasticsGoodPlaneNumberList().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
this.scanCode = "";
this.scanCheckCode = "";
this.$refs.inputScan.focused = true
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>

32
src/pages/plastics/scanCode.vue

@ -17,33 +17,10 @@
<view class="" style="width: 75%; ">
<uni-easyinput style="margin-left: 10rpx; margin-right: 10rpx;" trim="all"
v-model="scanCode" @clear="clearCode"
ref="inputScan"
@confirm="onConfirm"></uni-easyinput>
</view>
</view>
<view class="" v-if="false">
<uni-table border stripe>
<!-- 表头行 -->
<!-- <uni-tr>
<uni-th align="center">日期</uni-th>
<uni-th align="center">姓名</uni-th>
<uni-th align="left">地址</uni-th>
</uni-tr> -->
<!-- 表格数据行 -->
<uni-tr>
<uni-td>箱码</uni-td>
<uni-td>1234</uni-td>
</uni-tr>
<uni-tr>
<uni-td>批次</uni-td>
<uni-td>20240508</uni-td>
</uni-tr>
<uni-tr>
<uni-td>库位</uni-td>
<uni-td>103</uni-td>
</uni-tr>
</uni-table>
</view>
</view>
@ -151,7 +128,9 @@
scanCodeSubmit(param).then(res => {
uni.hideLoading()
this.showMessage("提交成功")
uni.showToast({
title: '提交成功',
});
this.resetData()
}).catch(error => {
uni.hideLoading()
@ -166,6 +145,8 @@
resetData() {
this.scanCode = "";
this.scanCheckCode=""
this.$refs.inputScan.focused = true
},
clearCode() {
this.scanCode = "";
@ -178,6 +159,7 @@
}
this.scanCode = data;
this.scanCheckCode=data
this.submit()
},
openScanPopup() {

3
src/static/config.js

@ -1,4 +1,5 @@
let request_url = "http://10.117.133.80:8880/api"
let request_url = "http://123.56.115.74:8088/api"
// let request_url = "http://10.117.133.80:8880/api"
// let request_url = "http://192.168.0.113:12080/admin-api"
let appUpdateUrl = "http://10.117.133.80:8880/appUpdate.json"

1
src/store/modules/user.js

@ -71,6 +71,7 @@ const user = {
// "SPDA000003",
// "SPDA000004"
// ]
res.Result.Powers.push("SPDA000005")
commit('SET_ID',res.Result.LoginUserID)
commit('SET_NAME',res.Result.UserName)
commit('SET_POWERS',res.Result.Powers)

Loading…
Cancel
Save