Browse Source

修改页面

master
lijuncheng 7 months ago
parent
commit
3aea5424f4
  1. 44
      src/api/request2.js
  2. 4
      src/pages.json
  3. 8
      src/pages/appUpdate/appUpdate.js
  4. 126
      src/pages/foam/check.vue
  5. 63
      src/pages/foam/downLink.vue
  6. 43
      src/pages/foam/foamNoGood.vue
  7. 79
      src/pages/foam/upLink.vue
  8. 26
      src/pages/index/index.vue
  9. 2
      src/pages/login/index.vue
  10. 19
      src/pages/plastics/check.vue
  11. 47
      src/pages/plastics/plasticsNoGood.vue
  12. 116
      src/pages/plastics/scanCode.vue

44
src/api/request2.js

@ -381,3 +381,47 @@ export function plasticsNoGoodSubmit(params) {
}); });
} }
/**
* @param params 泡沫合格品上悬 计划
*/
export function getUpLinkPlaneNumberList() {
return request({
url: baseApi + "/Plan/GetList?Type=paomo",
method: "get",
data: {},
});
}
/**
* @param params 泡沫 合格品上悬扫码
*/
export function getFoamScanUpLinkInfo(machineCode) {
return request({
url: baseApi + "/MachineClass/Get?MachineCode="+machineCode,
method: "get",
data: {},
});
}
/**
* @param params获取泡沫 不良品收货 计划单号
*/
export function getFoamNoGoodNumberList() {
return request({
url: baseApi + "/Plan/GetList?Type=paomo",
method: "get",
data: {},
});
}
/**
* @param params获取注塑 不良品收货 计划单号
*/
export function getPlasticsNoGoodNumberList() {
return request({
url: baseApi + "/Plan/GetList?Type=paomo",
method: "get",
data: {},
});
}

4
src/pages.json

@ -78,7 +78,7 @@
{ {
"path": "pages/foam/foamNoGood", "path": "pages/foam/foamNoGood",
"style": { "style": {
"navigationBarTitleText": "不良品收货", "navigationBarTitleText": "不良品收货(泡沫)",
"titleNView": { "titleNView": {
"buttons": [{}] "buttons": [{}]
} }
@ -105,7 +105,7 @@
{ {
"path": "pages/plastics/plasticsNoGood", "path": "pages/plastics/plasticsNoGood",
"style": { "style": {
"navigationBarTitleText": "不良品收货", "navigationBarTitleText": "不良品收货(注塑)",
"titleNView": { "titleNView": {
"buttons": [{}] "buttons": [{}]
} }

8
src/pages/appUpdate/appUpdate.js

@ -10,10 +10,15 @@ export function checkVersion(isShowHint){
versionCode: widgetInfo.versionCode versionCode: widgetInfo.versionCode
} }
curversionCode = data.versionCode curversionCode = data.versionCode
uni.showLoading({
title:"加载中",
mask:true
})
uni.request({ uni.request({
url:"http://192.168.0.105:9527/appUpdate.json", url:"http://192.168.0.105:9527/appUpdate.json",
method:"GET" method:"GET"
}).then(res=>{ }).then(res=>{
uni.hideLoading()
console.log("当前版本提示", curversionCode) console.log("当前版本提示", curversionCode)
var json = JSON.stringify(res) var json = JSON.stringify(res)
console.log("获取更新数据", json) console.log("获取更新数据", json)
@ -53,7 +58,8 @@ export function checkVersion(isShowHint){
} }
} }
}).catch(error=>{ }).catch(error=>{
uni.hideLoading()
console.log("请求错误"+error)
}) })
}) })
} }

126
src/pages/foam/check.vue

@ -3,7 +3,7 @@
<view class="page-header flex" <view class="page-header flex"
style="font-size: 32rpx; padding-left: 10rpx; padding-top: 10rpx; flex-direction: column;"> style="font-size: 32rpx; padding-left: 10rpx; padding-top: 10rpx; flex-direction: column;">
<!-- <view class="flex u-col-center space-between"> --> <!-- <view class="flex u-col-center space-between"> -->
<!-- <view class=""> <!-- <view class="">
<view class="" style="margin: 5rpx; font-weight: bold;"> <view class="" style="margin: 5rpx; font-weight: bold;">
设备编号 : {{deviceCode}} 设备编号 : {{deviceCode}}
</view> </view>
@ -11,9 +11,9 @@
设备名称 : {{deviceName}} 设备名称 : {{deviceName}}
</view> --> </view> -->
<!-- <text v-if="deviceName!=''">({{deviceName}})</text> --> <!-- <text v-if="deviceName!=''">({{deviceName}})</text> -->
<!-- </view> --> <!-- </view> -->
<!-- <view class=""> <!-- <view class="">
<button type="primary" size="mini" @click="openScanPopup">扫描</button> <button type="primary" size="mini" @click="openScanPopup">扫描</button>
</view> --> </view> -->
@ -25,18 +25,17 @@
点检人 : {{worker}} 点检人 : {{worker}}
</view> --> </view> -->
<view class=""> <view class="">
<view class="uni-flex uni-row space-between u-col-center" > <uni-section title="设备编号" subTitle="" subTitleFontSize="26rpx" titleFontSize="35rpx" type="line">
<view class="" style="margin: 5rpx; font-weight: bold;"> </uni-section>
<view class="uni-flex uni-row space-between u-col-center">
<!-- <view class="" style="margin: 5rpx; font-weight: bold;">
设备编号: 设备编号:
</view> </view> -->
<uni-easyinput <uni-easyinput class="" trim="all" ref="inputDevice" v-model="deviceCode" @clear="deviceClear"
class="" :focus="true" @confirm="onConfirmDevice"></uni-easyinput>
trim="all" </view>
ref="inputDevice" <view class="" style="margin: 5rpx; font-weight: bold;" v-if="deviceName!=''">
v-model="deviceCode" 设备编号 : {{deviceCheckCode}}
@clear="deviceClear"
:focus="true"
@confirm="onConfirmDevice"></uni-easyinput>
</view> </view>
<view class="" style="margin: 5rpx; font-weight: bold;" v-if="deviceName!=''"> <view class="" style="margin: 5rpx; font-weight: bold;" v-if="deviceName!=''">
设备名称 : {{deviceName}} 设备名称 : {{deviceName}}
@ -48,8 +47,8 @@
点检人 : {{worker}} 点检人 : {{worker}}
</view> </view>
</view> </view>
<view class="" style="width: 100%;background-color: gray;height: 2rpx; margin-top: 10rpx;" /> <view class="" style="width: 100%;background-color: gray;height: 2rpx; margin-top: 10rpx;" />
</view> </view>
@ -89,7 +88,7 @@
foamCheckSubmit, foamCheckSubmit,
getFoamDeviceInfo getFoamDeviceInfo
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
showConfirmMsg showConfirmMsg
} from "@/common/utils.js" } from "@/common/utils.js"
@ -102,7 +101,7 @@
return { return {
dateTime: "", dateTime: "",
deviceCode: "", deviceCode: "",
deviceCheckCode:"", deviceCheckCode: "",
deviceName: "", deviceName: "",
worker: this.$store.state.user.name, worker: this.$store.state.user.name,
dataList: [], dataList: [],
@ -241,7 +240,8 @@
}) })
getFoamDeviceInfo(result).then(res => { getFoamDeviceInfo(result).then(res => {
uni.hideLoading() uni.hideLoading()
this.deviceCode = result; this.deviceCode = "";
this.deviceCheckCode = result
console.log(result) console.log(result)
var groupSelect = { var groupSelect = {
Type: "4", Type: "4",
@ -252,45 +252,48 @@
// this.dataList = this.formData // this.dataList = this.formData
this.dataList = res.Result; this.dataList = res.Result;
this.dataList.push(groupSelect) this.dataList.push(groupSelect)
this.deviceName=this.dataList[0].Name; this.deviceName = this.dataList[0].Name;
this.dateTime = getCurrDateTime() this.dateTime = getCurrDateTime()
this.worker = this.$store.state.user.name this.worker = this.$store.state.user.name
this.$forceUpdate();
}).catch(error => { }).catch(error => {
this.deviceCode = ""
this.deviceCheckCode = result
uni.hideLoading() uni.hideLoading()
this.showMessage(error) this.showMessage("扫描设备[" + data + "]" + error)
}) })
}, },
submit() { submit() {
if (this.deviceCode == "") { if (this.deviceCheckCode == "") {
this.deviceCheckCode="" this.deviceCheckCode = ""
this.showMessage("请先扫描设备编号") this.showMessage("请先扫描设备编号")
return return
} }
this.$refs.customerFrom.submit(data => { this.$refs.customerFrom.submit(data => {
var groupName=""; var groupName = "";
var groupValue="" var groupValue = ""
data.forEach(res=>{ data.forEach(res => {
if(res.Type=="4"){ if (res.Type == "4") {
groupName=res.SelectName; groupName = res.SelectName;
groupValue=res.SelectValue; groupValue = res.SelectValue;
} }
}) })
var commitData={ var commitData = {
id:this.$store.state.user.id, id: this.$store.state.user.id,
createTime:getCurrDateTime(), createTime: getCurrDateTime(),
groupName:groupName, groupName: groupName,
groupValue:groupValue, groupValue: groupValue,
dataList:data dataList: data
} }
console.log("提交", JSON.stringify(commitData)) console.log("提交", JSON.stringify(commitData))
foamCheckSubmit(commitData).then(res=>{ foamCheckSubmit(commitData).then(res => {
uni.hideLoading() uni.hideLoading()
this.showMessage("提交成功") this.showMessage("提交成功")
this.clearData() this.clearData()
}).catch(error=>{ }).catch(error => {
uni.hideLoading() uni.hideLoading()
this.showMessage(error) this.showMessage(error)
}) })
@ -298,15 +301,15 @@
}, },
clearData() { clearData() {
this.deviceCode = "" this.deviceCode = ""
this.deviceName=""; this.deviceCheckCode = ""
this.dateTime =""; this.deviceName = "";
this.dateTime = "";
this.dateTime = "", this.dateTime = "",
this.deviceCode = "",
this.deviceName = "", this.deviceName = "",
this.worker="" this.worker = ""
this.dataList=[] this.dataList = []
// this.reset(); // this.reset();
}, },
reset() { reset() {
this.$refs.customerFrom.reset() this.$refs.customerFrom.reset()
}, },
@ -317,28 +320,28 @@
closeScanPopup() { closeScanPopup() {
this.$refs.scanPopup.closeScanPopup(); this.$refs.scanPopup.closeScanPopup();
}, },
deviceClear(){ deviceClear() {
this.deviceCode=""; this.deviceCode = "";
this.deviceCheckCode="" this.deviceCheckCode = ""
}, },
showMessage(hint){ showMessage(hint) {
showConfirmMsg("提示", hint,false,callBack=>{ showConfirmMsg("提示", hint, false, callBack => {
} ) })
}, },
onConfirmDevice(data){ onConfirmDevice(data) {
if(data==undefined||data==""){ if (data == undefined || data == "") {
this.showMessage("扫描设备编号") this.showMessage("扫描数据为空,请输入设备编号")
return; return;
} }
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
mask: true mask: true
}) })
getFoamDeviceInfo(data).then(res => { getFoamDeviceInfo(data).then(res => {
uni.hideLoading() uni.hideLoading()
this.deviceCode = data; this.deviceCode = "";
this.deviceCheckCode = data; this.deviceCheckCode = data;
console.log(data) console.log(data)
var groupSelect = { var groupSelect = {
@ -349,11 +352,12 @@
} }
this.dataList = res.Result; this.dataList = res.Result;
this.dataList.push(groupSelect) this.dataList.push(groupSelect)
this.deviceName=this.dataList[0].Name; this.deviceName = this.dataList[0].Name;
this.dateTime = getCurrDateTime() this.dateTime = getCurrDateTime()
}).catch(error => { }).catch(error => {
this.deviceCode = "";
uni.hideLoading() uni.hideLoading()
this.showMessage(error) this.showMessage("扫描设备[" + data + "]" + error)
}) })
}, },

63
src/pages/foam/downLink.vue

@ -17,11 +17,38 @@
<view class="" style="width: 90%; "> <view class="" style="width: 90%; ">
<uni-easyinput style="margin-left: 10rpx; margin-right: 10rpx;" trim="all" <uni-easyinput style="margin-left: 10rpx; margin-right: 10rpx;" trim="all"
v-model="scanCode" @clear="clearCode" v-model="scanCode" @clear="clearCode"
:focus="true"
@confirm="onConfirm"></uni-easyinput> @confirm="onConfirm"></uni-easyinput>
</view> </view>
</view> </view>
<view class="" v-if="scanCode!=''">
<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> </view>
</view> </view>
</scroll-view> </scroll-view>
@ -53,7 +80,8 @@
</script> </script>
<script> <script>
import { import {
downLickSubmit downLickSubmit,
getFoamScanUpLinkInfo
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
showConfirmMsg showConfirmMsg
@ -79,7 +107,8 @@
}, },
materialList: [], materialList: [],
planList: [], planList: [],
scanCode: "" scanCode: "",
scanCheckCode:"",
} }
@ -93,6 +122,11 @@
methods: { methods: {
submit() { submit() {
if (this.scanCode == "") {
this.scanCheckCode=""
this.showMessage("请先扫描")
return
}
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
mask: true mask: true
@ -118,12 +152,33 @@
}) })
}, },
resetData() { resetData() {
this.scanCode == ""
this.scanCheckCode=""
}, },
clearCode() { clearCode() {
this.scanCode = ""; this.scanCode == ""
this.scanCheckCode=""
}, },
onConfirm(data) { onConfirm(data) {
console.log(data) 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)
})
}, },

43
src/pages/foam/foamNoGood.vue

@ -81,6 +81,30 @@
</view> </view>
</view> </view>
<view class="" v-if="scanCode!=''">
<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> </view>
</scroll-view> </scroll-view>
@ -114,7 +138,7 @@
</script> </script>
<script> <script>
import { import {
getFoamPlaneNumberList, getFoamNoGoodNumberList,
foamNoGoodSubmit foamNoGoodSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
@ -181,6 +205,14 @@
this.showMessage("请选择计划单号") this.showMessage("请选择计划单号")
return return
} }
if (this.reason == "") {
this.showMessage("请选择原因")
return
}
if (this.type == "") {
this.showMessage("请选择类型")
return
}
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
mask: true mask: true
@ -208,6 +240,9 @@
}, },
resetData() { resetData() {
this.planNumber = ""; this.planNumber = "";
this.reason = ""
this.type = ""
this.scanCode = ""
}, },
clearCode() { clearCode() {
this.scanCode = ""; this.scanCode = "";
@ -220,7 +255,7 @@
title: "加载中", title: "加载中",
mask: true mask: true
}) })
getFoamPlaneNumberList().then(res => { getFoamNoGoodNumberList().then(res => {
uni.hideLoading() uni.hideLoading()
if (res.Result.length > 0) { if (res.Result.length > 0) {
var list = []; var list = [];
@ -242,7 +277,9 @@
selectPlan(data) { selectPlan(data) {
this.planNumber = data.label this.planNumber = data.label
console.log(data) this.reason = ""
this.type = ""
this.scanCode = ""
}, },
openScanPopup() { openScanPopup() {
this.$refs.scanPopup.openScanPopup(); this.$refs.scanPopup.openScanPopup();

79
src/pages/foam/upLink.vue

@ -2,7 +2,6 @@
<view class="page-wraper"> <view class="page-wraper">
<view class="page-header flex" <view class="page-header flex"
style="font-size: 32rpx; padding-left: 10rpx; padding-top: 10rpx; flex-direction: column;"> style="font-size: 32rpx; padding-left: 10rpx; padding-top: 10rpx; flex-direction: column;">
</view> </view>
<view class="page-main"> <view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
@ -33,9 +32,38 @@
<view class="" style="width: 75%; "> <view class="" style="width: 75%; ">
<uni-easyinput style="margin-left: 10rpx; margin-right: 10rpx;" trim="all" <uni-easyinput style="margin-left: 10rpx; margin-right: 10rpx;" trim="all"
v-model="scanCode" @clear="clearCode" v-model="scanCode" @clear="clearCode"
ref="inputScan"
@confirm="onConfirm"></uni-easyinput> @confirm="onConfirm"></uni-easyinput>
</view> </view>
</view> </view>
<view class="" v-if="scanCode!=''">
<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> </view>
@ -71,8 +99,9 @@
</script> </script>
<script> <script>
import { import {
getFoamPlaneNumberList, getUpLinkPlaneNumberList,
upLickSubmit upLickSubmit,
getFoamScanUpLinkInfo
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
showConfirmMsg showConfirmMsg
@ -99,7 +128,8 @@
}, },
materialList: [], materialList: [],
planList: [], planList: [],
scanCode: "" scanCode: "",
scanCheckCode:"",
} }
@ -117,6 +147,11 @@
this.showMessage("请选择计划单号") this.showMessage("请选择计划单号")
return return
} }
if (this.scanCode == "") {
this.scanCheckCode=""
this.showMessage("请先扫描")
return
}
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
@ -145,22 +180,45 @@
}, },
resetData() { resetData() {
this.planNumber = ""; this.planNumber = "";
this.materialName = "" this.scanCode == ""
this.materialQty = ""; this.scanCheckCode=""
this.materialCode = ""
}, },
clearCode() { clearCode() {
this.scanCode = ""; this.scanCode = "";
}, },
onConfirm(data) { onConfirm(data) {
console.log(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)
})
}, },
showPlanSelect() { showPlanSelect() {
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
mask: true mask: true
}) })
getFoamPlaneNumberList().then(res => { getUpLinkPlaneNumberList().then(res => {
uni.hideLoading() uni.hideLoading()
if (res.Result.length > 0) { if (res.Result.length > 0) {
var list = []; var list = [];
@ -182,6 +240,9 @@
selectPlan(data) { selectPlan(data) {
this.planNumber = data.label this.planNumber = data.label
this.scanCode = "";
this.scanCheckCode = "";
this.$refs.inputScan.focused = true
console.log(data) console.log(data)
}, },

26
src/pages/index/index.vue

@ -136,19 +136,19 @@
} }
}, },
onUnload() {}, onUnload() {},
onBackPress(e) { // onBackPress(e) {
// returntrue // // returntrue
this.backButtonPress++; // this.backButtonPress++;
if (this.backButtonPress > 1) { // if (this.backButtonPress > 1) {
plus.runtime.quit(); // plus.runtime.quit();
} else { // } else {
plus.nativeUI.toast('再按一次退出应用'); // plus.nativeUI.toast('退');
} // }
setTimeout(function() { // setTimeout(function() {
this.backButtonPress = 0; // this.backButtonPress = 0;
}, 1000); // }, 1000);
return true; // return true;
}, // },
mounted() {}, mounted() {},
methods: { methods: {
getPowersByRoles(){ getPowersByRoles(){

2
src/pages/login/index.vue

@ -133,7 +133,7 @@
}, },
onLoad() { onLoad() {
// #ifdef APP-PLUS // #ifdef APP-PLUS
checkVersion(false) // checkVersion(false)
// #endif // #endif
}, },
methods: { methods: {

19
src/pages/plastics/check.vue

@ -25,10 +25,12 @@
点检人 : {{worker}} 点检人 : {{worker}}
</view> --> </view> -->
<view class=""> <view class="">
<uni-section title="设备编号" subTitle="" subTitleFontSize="26rpx" titleFontSize="35rpx" type="line">
</uni-section>
<view class="uni-flex uni-row space-between u-col-center" > <view class="uni-flex uni-row space-between u-col-center" >
<view class="" style="margin: 5rpx; font-weight: bold;"> <!-- <view class="" style="margin: 5rpx; font-weight: bold;">
设备编号: 设备编号:
</view> </view> -->
<uni-easyinput <uni-easyinput
class="" class=""
trim="all" trim="all"
@ -38,6 +40,9 @@
:focus="true" :focus="true"
@confirm="onConfirmDevice"></uni-easyinput> @confirm="onConfirmDevice"></uni-easyinput>
</view> </view>
<view class="" style="margin: 5rpx; font-weight: bold;" v-if="deviceName!=''">
设备编号 : {{deviceCheckCode}}
</view>
<view class="" style="margin: 5rpx; font-weight: bold;" v-if="deviceName!=''"> <view class="" style="margin: 5rpx; font-weight: bold;" v-if="deviceName!=''">
设备名称 : {{deviceName}} 设备名称 : {{deviceName}}
</view> </view>
@ -240,7 +245,8 @@
}) })
getPlasticsDeviceInfo(result).then(res => { getPlasticsDeviceInfo(result).then(res => {
uni.hideLoading() uni.hideLoading()
this.deviceCode = result; this.deviceCode = "";
this.deviceCheckCode = result;
console.log(result) console.log(result)
this.closeScanPopup(); this.closeScanPopup();
var groupSelect = { var groupSelect = {
@ -297,10 +303,10 @@
}, },
clearData() { clearData() {
this.deviceCode = "" this.deviceCode = ""
this.deviceCheckCode = ""
this.deviceName=""; this.deviceName="";
this.dateTime =""; this.dateTime ="";
this.dateTime = "", this.dateTime = "",
this.deviceCode = "",
this.deviceName = "", this.deviceName = "",
this.worker="" this.worker=""
this.dataList=[] this.dataList=[]
@ -337,7 +343,7 @@
}) })
getPlasticsDeviceInfo(data).then(res => { getPlasticsDeviceInfo(data).then(res => {
uni.hideLoading() uni.hideLoading()
this.deviceCode = data; this.deviceCode = "";
this.deviceCheckCode = data; this.deviceCheckCode = data;
console.log(data) console.log(data)
this.closeScanPopup(); this.closeScanPopup();
@ -352,8 +358,9 @@
this.deviceName=this.dataList[0].Name; this.deviceName=this.dataList[0].Name;
this.dateTime = getCurrDateTime() this.dateTime = getCurrDateTime()
}).catch(error => { }).catch(error => {
this.deviceCode = "";
uni.hideLoading() uni.hideLoading()
this.showMessage(error) this.showMessage("扫描设备["+data+"]"+error)
}) })
}, },

47
src/pages/plastics/plasticsNoGood.vue

@ -79,6 +79,30 @@
v-model="scanCode" @clear="clearCode" @confirm="onConfirm"></uni-easyinput> v-model="scanCode" @clear="clearCode" @confirm="onConfirm"></uni-easyinput>
</view> </view>
</view> </view>
<view class="" v-if="scanCode!=''">
<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> </view>
@ -114,8 +138,8 @@
</script> </script>
<script> <script>
import { import {
getFoamPlaneNumberList, getPlasticsNoGoodNumberList,
foamNoGoodSubmit plasticsNoGoodSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
showConfirmMsg showConfirmMsg
@ -181,6 +205,14 @@
this.showMessage("请选择计划单号") this.showMessage("请选择计划单号")
return return
} }
if (this.reason == "") {
this.showMessage("请选择原因")
return
}
if (this.type == "") {
this.showMessage("请选择类型")
return
}
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
mask: true mask: true
@ -192,7 +224,7 @@
} }
console.log("提交", JSON.stringify(param)) console.log("提交", JSON.stringify(param))
foamNoGoodSubmit(param).then(res => { plasticsNoGoodSubmit(param).then(res => {
uni.hideLoading() uni.hideLoading()
this.showMessage("提交成功") this.showMessage("提交成功")
this.resetData() this.resetData()
@ -208,6 +240,9 @@
}, },
resetData() { resetData() {
this.planNumber = ""; this.planNumber = "";
this.reason = ""
this.type = ""
this.scanCode = ""
}, },
clearCode() { clearCode() {
this.scanCode = ""; this.scanCode = "";
@ -220,7 +255,7 @@
title: "加载中", title: "加载中",
mask: true mask: true
}) })
getFoamPlaneNumberList().then(res => { getPlasticsNoGoodNumberList().then(res => {
uni.hideLoading() uni.hideLoading()
if (res.Result.length > 0) { if (res.Result.length > 0) {
var list = []; var list = [];
@ -242,7 +277,9 @@
selectPlan(data) { selectPlan(data) {
this.planNumber = data.label this.planNumber = data.label
console.log(data) this.reason = ""
this.type = ""
this.scanCode = ""
}, },
openScanPopup() { openScanPopup() {
this.$refs.scanPopup.openScanPopup(); this.$refs.scanPopup.openScanPopup();

116
src/pages/plastics/scanCode.vue

@ -20,6 +20,30 @@
@confirm="onConfirm"></uni-easyinput> @confirm="onConfirm"></uni-easyinput>
</view> </view>
</view> </view>
<view class="" v-if="scanCode!=''">
<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> </view>
@ -38,8 +62,6 @@
</view> </view>
</view> </view>
<selectClickList ref="selectPopup" title="选择计划单号" @select="selectPlan"></selectClickList>
<selectClickList ref="selectPopupMaterial" title="选择原料" @select="selectMaterial"></selectClickList>
</view> </view>
@ -56,8 +78,6 @@
</script> </script>
<script> <script>
import { import {
getFoamPlaneNumberList,
getMaterialLists,
foamInputSubmit foamInputSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
@ -76,9 +96,6 @@
data() { data() {
return { return {
dateTime: "", dateTime: "",
planNumber: "",
materialName: "",
materialCode: "",
materialQty: "", materialQty: "",
dataList: [], dataList: [],
userForm: { userForm: {
@ -86,8 +103,6 @@
values: [], values: [],
origin: [] origin: []
}, },
materialList: [],
planList: [],
scanCode: "" scanCode: ""
@ -102,27 +117,17 @@
methods: { methods: {
submit() { submit() {
if (this.planNumber == "") { if (this.scanCode == "") {
this.showMessage("请选择计划单号") this.showMessage("请选择计划单号")
return return
} }
if (this.materialName == "") {
this.showMessage("请输入原料名称")
return
}
if (this.materialQty == "" || this.materialQty == 0) {
this.showMessage("请输入原料数量")
return
}
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
mask: true mask: true
}) })
var param = { var param = {
planNumber: this.planNumber, scanCode: this.scanCode,
materialName: this.materialName,
materialCode: this.materialCode,
materialQty: this.materialQty,
id: this.$store.state.user.id, id: this.$store.state.user.id,
createTime: getCurrDateTime(), createTime: getCurrDateTime(),
} }
@ -143,10 +148,7 @@
}) })
}, },
resetData() { resetData() {
this.planNumber = ""; this.scanCode = "";
this.materialName = ""
this.materialQty = "";
this.materialCode = ""
}, },
clearCode() { clearCode() {
this.scanCode = ""; this.scanCode = "";
@ -154,69 +156,7 @@
onConfirm(data) { onConfirm(data) {
console.log(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)
},
showMaterialSelect() {
uni.showLoading({
title: "加载中",
mask: true
})
getMaterialLists().then(res => {
uni.hideLoading()
if (res.Result.length > 0) {
var list = [];
list = res.Result;
list.forEach(res => {
res.label = res.Name;
res.value = res.Code
})
this.$refs.selectPopupMaterial.openScanPopup(list)
} else {
this.showMessage("原料列表为0")
}
}).catch(error => {
uni.hideLoading()
this.showMessage(error)
})
},
selectMaterial(data) {
this.materialName = data.label
this.materialCode = data.value
this.$refs.inputQty.focused = true
console.log("selectPopupMaterial")
},
openScanPopup() { openScanPopup() {
this.$refs.scanPopup.openScanPopup(); this.$refs.scanPopup.openScanPopup();
}, },

Loading…
Cancel
Save