Browse Source

修改接口

master
lijuncheng 4 months ago
parent
commit
8f063fc1e0
  1. BIN
      nativeplugins/TestModule/android/TestModule.aar
  2. BIN
      nativeplugins/TestModule/libs/itextpdf-5.5.8.jar
  3. 35
      nativeplugins/TestModule/package.json
  4. 46
      src/api/request2.js
  5. 10
      src/common/classify.data.js
  6. 2
      src/pages.json
  7. 2
      src/pages/foam/check.vue
  8. 58
      src/pages/foam/downLink.vue
  9. 64
      src/pages/foam/foamNoGood.vue
  10. 31
      src/pages/foam/upLink.vue
  11. 94
      src/pages/index/index.vue
  12. 4
      src/pages/plastics/input.vue
  13. 63
      src/pages/plastics/plasticsNoGood.vue
  14. 29
      src/pages/plastics/scanCode.vue
  15. 5
      src/static/config.js
  16. 8
      src/store/modules/user.js

BIN
nativeplugins/TestModule/android/TestModule.aar

Binary file not shown.

BIN
nativeplugins/TestModule/libs/itextpdf-5.5.8.jar

Binary file not shown.

35
nativeplugins/TestModule/package.json

@ -0,0 +1,35 @@
{
"name": "TestModule",
"id": "TestModule",
"version": "1.0.0",
"description": "打印",
"_dp_type": "nativeplugin",
"_dp_nativeplugin": {
"android": {
"integrateType": "aar",
"plugins": [
{
"type": "module",
"name": "TestModule",
"class": "io.dcloud.uniplugin.TestModule"
}
]
}
}
}

46
src/api/request2.js

@ -342,7 +342,7 @@ export function checkItemCodeByBucket(BucketCode,itemCode) {
*/ */
export function upLickSubmit(params) { export function upLickSubmit(params) {
return request({ return request({
url: baseApi + "/Ware/Insert", url: baseApi + "/Inventory/Insert",
method: "post", method: "post",
data: params, data: params,
}); });
@ -353,18 +353,40 @@ export function upLickSubmit(params) {
*/ */
export function downLickSubmit(params) { export function downLickSubmit(params) {
return request({ return request({
url: baseApi + "/Ware/Insert", url: baseApi + "/Inventory/Insert",
method: "post", method: "post",
data: params, data: params,
}); });
} }
/**
* @param params 获取泡沫不良品原因
*/
export function getFoamNoGoodReason() {
return request({
url: baseApi + "/Inventory/GetDefectDictList",
method: "get",
data: {},
});
}
/**
* @param params 获取泡沫不良品类型
*/
export function getFoamNoGoodType() {
return request({
url: baseApi + "/Ware/Insert",
method: "get",
data: {},
});
}
/** /**
* @param params 泡沫不良品收货 提交 * @param params 泡沫不良品收货 提交
*/ */
export function foamNoGoodSubmit(params) { export function foamNoGoodSubmit(params) {
return request({ return request({
url: baseApi + "/Ware/Insert", url: baseApi + "/Inventory/Insert",
method: "post", method: "post",
data: params, data: params,
}); });
@ -375,7 +397,7 @@ export function foamNoGoodSubmit(params) {
*/ */
export function plasticsNoGoodSubmit(params) { export function plasticsNoGoodSubmit(params) {
return request({ return request({
url: baseApi + "/Ware/Insert", url: baseApi + "/Inventory/Insert",
method: "post", method: "post",
data: params, data: params,
}); });
@ -386,7 +408,7 @@ export function plasticsNoGoodSubmit(params) {
*/ */
export function getUpLinkPlaneNumberList() { export function getUpLinkPlaneNumberList() {
return request({ return request({
url: baseApi + "/Plan/GetList?Type=paomo", url: baseApi + "/Inventory/GetPlanList?state=ok",
method: "get", method: "get",
data: {}, data: {},
}); });
@ -408,7 +430,7 @@ export function getFoamScanUpLinkInfo(machineCode) {
*/ */
export function getFoamNoGoodNumberList() { export function getFoamNoGoodNumberList() {
return request({ return request({
url: baseApi + "/Plan/GetList?Type=paomo", url: baseApi + "/Inventory/GetPlanList?state=nok",
method: "get", method: "get",
data: {}, data: {},
}); });
@ -419,9 +441,19 @@ export function getFoamNoGoodNumberList() {
*/ */
export function getPlasticsNoGoodNumberList() { export function getPlasticsNoGoodNumberList() {
return request({ return request({
url: baseApi + "/Plan/GetList?Type=paomo", url: baseApi + "/Inventory/GetPlanList?state=nok",
method: "get", method: "get",
data: {}, data: {},
}); });
} }
/**
* @param params 开班件 提交
*/
export function scanCodeSubmit(params) {
return request({
url: baseApi + "/BeginShift/Insert",
method: "post",
data: params,
});
}

10
src/common/classify.data.js

@ -50,7 +50,7 @@ export default [{
"isShow":true, "isShow":true,
"children": [{ "children": [{
"name": "注塑点检", "name": "注塑点检",
"code":"SPDA0000001", "code":"SPDA000001",
"icon": "/query_supplier_deliver.svg", "icon": "/query_supplier_deliver.svg",
"isShow":true, "isShow":true,
"path": "/pages/plastics/check", "path": "/pages/plastics/check",
@ -58,15 +58,15 @@ export default [{
}, },
{ {
"name": "注塑投料", "name": "注塑投料",
"code":"SPDA0000002", "code":"SPDA000002",
"icon": "/unbind_pallet.svg", "icon": "/unbind_pallet.svg",
"isShow":true, "isShow":true,
"path": "/pages/plastics/input", "path": "/pages/plastics/input",
"index": 2, "index": 2,
}, },
{ {
"name": "开件扫码", "name": "开件扫码",
"code":"SPDA0000003", "code":"SPDA000003",
"icon": "/unbind_pallet.svg", "icon": "/unbind_pallet.svg",
"isShow":true, "isShow":true,
"path": "/pages/plastics/scanCode", "path": "/pages/plastics/scanCode",
@ -74,7 +74,7 @@ export default [{
}, },
{ {
"name": "不良品收货", "name": "不良品收货",
"code":"SPDA0000004", "code":"SPDA000004",
"icon": "/unbind_pallet.svg", "icon": "/unbind_pallet.svg",
"isShow":true, "isShow":true,
"path": "/pages/plastics/plasticsNoGood", "path": "/pages/plastics/plasticsNoGood",

2
src/pages.json

@ -114,7 +114,7 @@
{ {
"path": "pages/plastics/scanCode", "path": "pages/plastics/scanCode",
"style": { "style": {
"navigationBarTitleText": "开件扫码", "navigationBarTitleText": "开件扫码",
"titleNView": { "titleNView": {
"buttons": [{}] "buttons": [{}]
} }

2
src/pages/foam/check.vue

@ -1,5 +1,5 @@
<template> <template>
<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 class="flex u-col-center space-between"> --> <!-- <view class="flex u-col-center space-between"> -->

58
src/pages/foam/downLink.vue

@ -9,7 +9,7 @@
<view style="padding-bottom: 80rpx;width: 100%;"> <view style="padding-bottom: 80rpx;width: 100%;">
<view class="uni-flex uni-column " style="margin: 10rpx;"> <view class="uni-flex uni-column " style="margin: 10rpx;">
<uni-section title="扫描" subTitle="码" subTitleFontSize="26rpx" titleFontSize="35rpx" <uni-section title="扫描产品码" subTitle="产品码" subTitleFontSize="26rpx" titleFontSize="35rpx"
type="line"> type="line">
</uni-section> </uni-section>
@ -21,7 +21,7 @@
@confirm="onConfirm"></uni-easyinput> @confirm="onConfirm"></uni-easyinput>
</view> </view>
</view> </view>
<view class="" v-if="scanCode!=''"> <view class="" v-if="false">
<uni-table border stripe > <uni-table border stripe >
<!-- 表头行 --> <!-- 表头行 -->
<!-- <uni-tr> <!-- <uni-tr>
@ -45,7 +45,6 @@
</uni-table> </uni-table>
</view> </view>
</view> </view>
@ -122,8 +121,9 @@
methods: { methods: {
submit() { submit() {
if (this.scanCode == "") { if (this.scanCheckCode == "") {
this.scanCheckCode="" this.scanCheckCode=""
this.scanCode=""
this.showMessage("请先扫描") this.showMessage("请先扫描")
return return
} }
@ -134,6 +134,10 @@
var param = { var param = {
id: this.$store.state.user.id, id: this.$store.state.user.id,
createTime: getCurrDateTime(), createTime: getCurrDateTime(),
ProductCode:this.scanCheckCode,
Type:1,
State:2,//1.2,
User:this.$store.state.user.name
} }
console.log("提交", JSON.stringify(param)) console.log("提交", JSON.stringify(param))
@ -152,37 +156,41 @@
}) })
}, },
resetData() { resetData() {
this.scanCode == "" this.scanCode =""
this.scanCheckCode="" this.scanCheckCode=""
}, },
clearCode() { clearCode() {
this.scanCode == "" this.scanCode = ""
this.scanCheckCode="" this.scanCheckCode=""
}, },
onConfirm(data) { onConfirm(data) {
if(data==undefined||data==""){ if(!data){
this.showMessage("扫描数据为空,请先输入") this.showMessage("扫描数据不能为空")
return; return;
} }
uni.showLoading({ this.scanCode = data;
title: "加载中", this.scanCheckCode=data
mask: true // if(data==undefined||data==""){
}) // this.showMessage(",")
getFoamScanUpLinkInfo(data).then(res => { // return;
uni.hideLoading() // }
this.scanCode = data; // uni.showLoading({
this.scanCheckCode = data; // title: "",
console.log(data) // mask: true
}).catch(error => { // })
this.scanCode = ""; // getFoamScanUpLinkInfo(data).then(res => {
this.scanCheckCode = ""; // uni.hideLoading()
uni.hideLoading() // this.scanCode = data;
this.showMessage("扫描["+data+"]"+error) // this.scanCheckCode = data;
}) // console.log(data)
// }).catch(error => {
// this.scanCode = "";
// this.scanCheckCode = "";
// uni.hideLoading()
// this.showMessage("["+data+"]"+error)
// })
}, },
openScanPopup() { openScanPopup() {
this.$refs.scanPopup.openScanPopup(); this.$refs.scanPopup.openScanPopup();
}, },

64
src/pages/foam/foamNoGood.vue

@ -69,7 +69,7 @@
</view> </view>
<view class="uni-flex uni-column " style="margin: 10rpx;"> <view class="uni-flex uni-column " style="margin: 10rpx;">
<uni-section title="扫描" subTitle="码" subTitleFontSize="26rpx" titleFontSize="35rpx" <uni-section title="扫描产品码" subTitle="产品码" subTitleFontSize="26rpx" titleFontSize="35rpx"
type="line"> type="line">
</uni-section> </uni-section>
@ -81,7 +81,7 @@
</view> </view>
</view> </view>
<view class="" v-if="scanCode!=''"> <view class="" v-if="false">
<uni-table border stripe> <uni-table border stripe>
<!-- 表头行 --> <!-- 表头行 -->
<!-- <uni-tr> <!-- <uni-tr>
@ -139,7 +139,9 @@
<script> <script>
import { import {
getFoamNoGoodNumberList, getFoamNoGoodNumberList,
foamNoGoodSubmit foamNoGoodSubmit,
getFoamNoGoodReason,
getFoamNoGoodType
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
showConfirmMsg showConfirmMsg
@ -167,13 +169,15 @@
materialList: [], materialList: [],
planList: [], planList: [],
scanCode: "", scanCode: "",
scanCheckCode:"",
showReason: false, showReason: false,
showType: false, showType: false,
reason: "", reason: "",
type: "", type: "",
typeCode:"",
mode: 'selector', mode: 'selector',
reasonRange: ['破损', '返工与返修'], reasonRange: ['破损', '返工与返修'],
typeRange: ["合格", "报废"] typeRange: ["隔离", "报废"],
} }
}, },
@ -191,14 +195,36 @@
}, },
confirmType(e) { confirmType(e) {
this.type = this.typeRange[e[0]]; this.type = this.typeRange[e[0]];
console.log("原因", JSON.stringify(e)) console.log("类型", this.type)
if(this.type=="隔离"){
this.typeCode =3
}else if(this.type=="报废"){
this.typeCode =4
}
}, },
showReasonPicker() { showReasonPicker() {
this.showReason = true; uni.showLoading({
title: "加载中",
mask: true
})
getFoamNoGoodReason().then(res => {
uni.hideLoading()
this.showReason = true;
this.reasonRange=[]
res.Result.forEach(item=>{
this.reasonRange.push(item.MFGNAME
)
})
}).catch(error => {
uni.hideLoading()
this.reasonRange = []
this.showMessage(error)
})
}, },
confirmReason(e) { confirmReason(e) {
this.reason = this.reasonRange[e[0]]; this.reason = this.reasonRange[e[0]];
console.log("原因", JSON.stringify(e)) console.log("原因", this.reason)
}, },
submit() { submit() {
if (this.planNumber == "") { if (this.planNumber == "") {
@ -213,15 +239,26 @@
this.showMessage("请选择类型") this.showMessage("请选择类型")
return return
} }
if (this.scanCheckCode == "") {
this.scanCheckCode=""
this.showMessage("请先校验扫描码")
return
}
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
mask: true mask: true
}) })
var param = { var param = {
planNumber: this.planNumber, PlanID : this.planNumber,
id: this.$store.state.user.id, id: this.$store.state.user.id,
createTime: getCurrDateTime(), createTime: getCurrDateTime(),
ProductCode:this.scanCheckCode,
Type:1,
State:this.typeCode,
MFGNAME:this.reason,
User: this.$store.state.user.name
} }
console.log("提交", JSON.stringify(param)) console.log("提交", JSON.stringify(param))
foamNoGoodSubmit(param).then(res => { foamNoGoodSubmit(param).then(res => {
@ -239,16 +276,22 @@
}) })
}, },
resetData() { resetData() {
this.planNumber = "";
this.reason = "" this.reason = ""
this.type = "" this.type = ""
this.scanCode = "" this.scanCode = ""
this.scanCheckCode=""
}, },
clearCode() { clearCode() {
this.scanCode = ""; this.scanCode = "";
this.scanCheckCode=""
}, },
onConfirm(data) { onConfirm(data) {
console.log(data) if(!data){
this.showMessage("扫描数据不能为空")
return;
}
this.scanCode = data;
this.scanCheckCode=data
}, },
showPlanSelect() { showPlanSelect() {
uni.showLoading({ uni.showLoading({
@ -280,6 +323,7 @@
this.reason = "" this.reason = ""
this.type = "" this.type = ""
this.scanCode = "" this.scanCode = ""
this.scanCheckCode=""
}, },
openScanPopup() { openScanPopup() {
this.$refs.scanPopup.openScanPopup(); this.$refs.scanPopup.openScanPopup();

31
src/pages/foam/upLink.vue

@ -24,7 +24,7 @@
</view> </view>
<view class="uni-flex uni-column " style="margin: 10rpx;"> <view class="uni-flex uni-column " style="margin: 10rpx;">
<uni-section title="扫描" subTitle="码" subTitleFontSize="26rpx" titleFontSize="35rpx" <uni-section title="扫描产品码" subTitle="产品码" subTitleFontSize="26rpx" titleFontSize="35rpx"
type="line"> type="line">
</uni-section> </uni-section>
@ -37,7 +37,7 @@
</view> </view>
</view> </view>
<view class="" v-if="scanCode!=''"> <view class="" v-if="false">
<uni-table border stripe > <uni-table border stripe >
<!-- 表头行 --> <!-- 表头行 -->
<!-- <uni-tr> <!-- <uni-tr>
@ -62,8 +62,6 @@
</uni-table> </uni-table>
</view> </view>
</view> </view>
@ -147,9 +145,9 @@
this.showMessage("请选择计划单号") this.showMessage("请选择计划单号")
return return
} }
if (this.scanCode == "") { if (this.scanCheckCode == "") {
this.scanCheckCode="" this.scanCheckCode=""
this.showMessage("请先扫描") this.showMessage("请先校验扫描")
return return
} }
@ -158,9 +156,14 @@
mask: true mask: true
}) })
var param = { var param = {
planNumber: this.planNumber, PlanID : this.planNumber,
id: this.$store.state.user.id, id: this.$store.state.user.id,
createTime: getCurrDateTime(), createTime: getCurrDateTime(),
ProductCode :this.scanCheckCode,
Type:1,
State:1,
User: this.$store.state.user.name
} }
console.log("提交", JSON.stringify(param)) console.log("提交", JSON.stringify(param))
@ -180,13 +183,23 @@
}, },
resetData() { resetData() {
this.planNumber = ""; this.planNumber = "";
this.scanCode == "" this.scanCode =""
this.scanCheckCode="" this.scanCheckCode=""
}, },
clearCode() { clearCode() {
this.scanCode = ""; this.scanCode = "";
this.scanCheckCode=""
},
onConfirm(data){
if(!data){
this.showMessage("扫描数据不能为空")
return;
}
this.scanCode = data;
this.scanCheckCode=data
}, },
onConfirm(data) { onConfirm1(data) {
if(this.planNumber==""){ if(this.planNumber==""){
this.showMessage("请先选择单号") this.showMessage("请先选择单号")
this.scanCode = ""; this.scanCode = "";

94
src/pages/index/index.vue

@ -1,5 +1,5 @@
<template> <template>
<view class="u-wrap"> <view class="u-wrap" @touchstart="touchScreen" @touchcancel="touchMove">
<!-- <view class="serch txt-16"> <!-- <view class="serch txt-16">
<uni-search-bar class="flex1" placeholder="请输入菜单名称" @confirm="search" @input="input" cancelButton="none" <uni-search-bar class="flex1" placeholder="请输入菜单名称" @confirm="search" @input="input" cancelButton="none"
@clear="clearfilterlist"> @clear="clearfilterlist">
@ -29,7 +29,6 @@
<scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop" <scroll-view scroll-y scroll-with-animation class="u-tab-view menu-scroll-view" :scroll-top="scrollTop"
:scroll-into-view="itemId"> :scroll-into-view="itemId">
<view v-for="(item,index) in tabbar" :key="index" class="u-tab-item" <view v-for="(item,index) in tabbar" :key="index" class="u-tab-item"
:class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)"> :class="[current == index ? 'u-tab-item-active' : '']" @tap.stop="swichMenu(index)">
<text class="u-line-1">{{item.name}}</text> <text class="u-line-1">{{item.name}}</text>
</view> </view>
@ -70,7 +69,7 @@
<script> <script>
import classifyData from '@/common/classify.data.js'; import classifyData from '@/common/classify.data.js';
import config from '../../static/config.js'
export default { export default {
components: {}, components: {},
data() { data() {
@ -93,14 +92,17 @@
menusCount: {}, menusCount: {},
filterList: [], filterList: [],
serchval: "", serchval: "",
backButtonPress: 0 backButtonPress: 0,
pageTimeOut: config.pageTimeOut,
timeCount: null
} }
}, },
onLoad() { onLoad() {
var test =""
var test = ""
if (uni.getStorageSync("hasLogin")) { if (uni.getStorageSync("hasLogin")) {
this.tabbar = this.getPowersByRoles(); this.tabbar = this.getPowersByRoles();
this.startTimer();
} else { } else {
this.tabbar = [] this.tabbar = []
} }
@ -110,6 +112,13 @@
this.getMenuItemTop() this.getMenuItemTop()
} }
},
beforeDestroy() {
if (this.timeCount) {
clearInterval(this.timeCount);
this.timeCount = null;
}
}, },
onHide() {}, onHide() {},
onShow() { onShow() {
@ -151,38 +160,69 @@
// }, // },
mounted() {}, mounted() {},
methods: { methods: {
getPowersByRoles(){ startTimer(){
var that = this;
this.timeCount = setInterval(()=> {
console.log("记时", that.pageTimeOut)
if(that.pageTimeOut>0&&that.pageTimeOut<=config.pageTimeOut){
that.pageTimeOut--;
}else {
console.log("停止", that.pageTimeOut)
clearInterval(this.timeCount);
this.timeCount = null;
uni.reLaunch({
url: "../login/index"
})
}
}, 1000)
},
touchScreen() {
this.pageTimeOut = config.pageTimeOut
if (this.timeCount) {
clearInterval(this.timeCount);
this.timeCount = null;
}
this.startTimer();
console.log("页面点击touchScreen", this.pageTimeOut)
},
touchMove(){
this.pageTimeOut = config.pageTimeOut
console.log("页面点击touchMove", this.pageTimeOut)
},
getPowersByRoles() {
var permissionList = this.$store.state.user.powers var permissionList = this.$store.state.user.powers
var tempList=[]; var tempList = [];
classifyData.forEach(menuItem=>{ classifyData.forEach(menuItem => {
var temp = { var temp = {
name :menuItem.name, name: menuItem.name,
isShow:menuItem.isShow, isShow: menuItem.isShow,
children:[] children: []
} }
menuItem.children.forEach(rightItem=>{ menuItem.children.forEach(rightItem => {
permissionList.forEach(permission=>{ permissionList.forEach(permission => {
if(rightItem.code==permission){ if (rightItem.code == permission) {
rightItem.isShow=true rightItem.isShow = true
temp.children.push(rightItem) temp.children.push(rightItem)
}else { } else {
rightItem.isShow=false rightItem.isShow = false
} }
}) })
}) })
tempList.push(temp) tempList.push(temp)
}) })
var showList =[]; var showList = [];
tempList.forEach(res=>{ tempList.forEach(res => {
if(res.children.length>0){ if (res.children.length > 0) {
showList.push(res) showList.push(res)
} }
}) })
return showList; return showList;
}, },
findList(tab) { findList(tab) {
let res = null let res = null
for (let i = 0; i < tab.length; i++) { for (let i = 0; i < tab.length; i++) {
@ -305,10 +345,10 @@
uni.navigateTo({ uni.navigateTo({
url: url url: url
}); });
}, },
showMessage(message) { showMessage(message) {
this.$refs.comMessage.showMessage(message, res => { this.$refs.comMessage.showMessage(message, res => {
if (res) { if (res) {

4
src/pages/plastics/input.vue

@ -247,7 +247,7 @@
if (this.bucketCode == "") { if (this.bucketCode == "") {
this.bucketCode = "" this.bucketCode = ""
this.bucketCheckCode == "" this.bucketCheckCode ==""
this.showMessage("2.料筒号", "请扫描料筒号") this.showMessage("2.料筒号", "请扫描料筒号")
return return
} }
@ -259,7 +259,7 @@
if (this.itemCode == "") { if (this.itemCode == "") {
this.itemCode = "" this.itemCode = ""
this.itemCheckCode == "" this.itemCheckCode = ""
this.showMessage("3.零件号", "请扫描零件号") this.showMessage("3.零件号", "请扫描零件号")
return return
} }

63
src/pages/plastics/plasticsNoGood.vue

@ -69,7 +69,7 @@
</view> </view>
<view class="uni-flex uni-column " style="margin: 10rpx;"> <view class="uni-flex uni-column " style="margin: 10rpx;">
<uni-section title="扫描" subTitle="码" subTitleFontSize="26rpx" titleFontSize="35rpx" <uni-section title="扫描产品码" subTitle="产品码" subTitleFontSize="26rpx" titleFontSize="35rpx"
type="line"> type="line">
</uni-section> </uni-section>
@ -100,7 +100,7 @@
<uni-td>库位</uni-td> <uni-td>库位</uni-td>
<uni-td>103</uni-td> <uni-td>103</uni-td>
</uni-tr> </uni-tr>
</uni-table> </uni-table>
</view> </view>
@ -139,6 +139,7 @@
<script> <script>
import { import {
getPlasticsNoGoodNumberList, getPlasticsNoGoodNumberList,
getFoamNoGoodReason,
plasticsNoGoodSubmit plasticsNoGoodSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
@ -167,13 +168,15 @@
materialList: [], materialList: [],
planList: [], planList: [],
scanCode: "", scanCode: "",
scanCheckCode:"",
showReason: false, showReason: false,
showType: false, showType: false,
reason: "", reason: "",
type: "", type: "",
typeCode:"",
mode: 'selector', mode: 'selector',
reasonRange: ['破损', '返工与返修'], reasonRange: [],
typeRange: ["合格", "报废"] typeRange: ["隔离", "报废"],
} }
}, },
@ -185,20 +188,39 @@
}, },
methods: { methods: {
showTypePicker() { showTypePicker() {
this.showType = true; this.showType = true;
}, },
confirmType(e) { confirmType(e) {
this.type = this.typeRange[e[0]]; this.type = this.typeRange[e[0]];
console.log("原因", JSON.stringify(e)) console.log("类型", this.type)
if (this.type == "隔离") {
this.typeCode = 3
} else if (this.type == "报废") {
this.typeCode = 4
}
}, },
showReasonPicker() { showReasonPicker() {
this.showReason = true; uni.showLoading({
title: "加载中",
mask: true
})
getFoamNoGoodReason().then(res => {
uni.hideLoading()
this.showReason = true;
this.reasonRange = []
res.Result.forEach(item => {
this.reasonRange.push(item.MFGNAME)
})
}).catch(error => {
uni.hideLoading()
this.reasonRange = []
this.showMessage(error)
})
}, },
confirmReason(e) { confirmReason(e) {
this.reason = this.reasonRange[e[0]]; this.reason = this.reasonRange[e[0]];
console.log("原因", JSON.stringify(e)) console.log("原因", this.reason)
}, },
submit() { submit() {
if (this.planNumber == "") { if (this.planNumber == "") {
@ -213,14 +235,24 @@
this.showMessage("请选择类型") this.showMessage("请选择类型")
return return
} }
if (this.scanCheckCode == "") {
this.scanCheckCode=""
this.showMessage("请先校验扫描码")
return
}
uni.showLoading({ uni.showLoading({
title: "加载中", title: "加载中",
mask: true mask: true
}) })
var param = { var param = {
planNumber: this.planNumber, PlanID : this.planNumber,
id: this.$store.state.user.id, id: this.$store.state.user.id,
createTime: getCurrDateTime(), createTime: getCurrDateTime(),
ProductCode:this.scanCheckCode,
Type:2,
State:this.typeCode,
MFGNAME:this.reason,
User: this.$store.state.user.name
} }
console.log("提交", JSON.stringify(param)) console.log("提交", JSON.stringify(param))
@ -239,16 +271,22 @@
}) })
}, },
resetData() { resetData() {
this.planNumber = "";
this.reason = "" this.reason = ""
this.type = "" this.type = ""
this.scanCode = "" this.scanCode = ""
this.scanCheckCode=""
}, },
clearCode() { clearCode() {
this.scanCode = ""; this.scanCode = "";
this.scanCheckCode=""
}, },
onConfirm(data) { onConfirm(data) {
console.log(data) if(!data){
this.showMessage("扫描数据不能为空")
return;
}
this.scanCode = data;
this.scanCheckCode=data
}, },
showPlanSelect() { showPlanSelect() {
uni.showLoading({ uni.showLoading({
@ -266,7 +304,7 @@
}) })
this.$refs.selectPopup.openScanPopup(list) this.$refs.selectPopup.openScanPopup(list)
} else { } else {
this.showMessage("原料列表为0") this.showMessage("单号列表为0")
} }
}).catch(error => { }).catch(error => {
@ -280,6 +318,7 @@
this.reason = "" this.reason = ""
this.type = "" this.type = ""
this.scanCode = "" this.scanCode = ""
this.scanCheckCode=""
}, },
openScanPopup() { openScanPopup() {
this.$refs.scanPopup.openScanPopup(); this.$refs.scanPopup.openScanPopup();

29
src/pages/plastics/scanCode.vue

@ -9,7 +9,7 @@
<view style="padding-bottom: 80rpx;width: 100%;"> <view style="padding-bottom: 80rpx;width: 100%;">
<view class="uni-flex uni-column " style="margin: 10rpx;"> <view class="uni-flex uni-column " style="margin: 10rpx;">
<uni-section title="扫描" subTitle="码" subTitleFontSize="26rpx" titleFontSize="35rpx" <uni-section title="扫描产品码" subTitle="产品码" subTitleFontSize="26rpx" titleFontSize="35rpx"
type="line"> type="line">
</uni-section> </uni-section>
@ -20,7 +20,7 @@
@confirm="onConfirm"></uni-easyinput> @confirm="onConfirm"></uni-easyinput>
</view> </view>
</view> </view>
<view class="" v-if="scanCode!=''"> <view class="" v-if="false">
<uni-table border stripe> <uni-table border stripe>
<!-- 表头行 --> <!-- 表头行 -->
<!-- <uni-tr> <!-- <uni-tr>
@ -78,7 +78,7 @@
</script> </script>
<script> <script>
import { import {
foamInputSubmit scanCodeSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
showConfirmMsg showConfirmMsg
@ -103,7 +103,8 @@
values: [], values: [],
origin: [] origin: []
}, },
scanCode: "" scanCode: "",
scanCheckCode:""
} }
@ -117,8 +118,8 @@
methods: { methods: {
submit() { submit() {
if (this.scanCode == "") { if (this.scanCheckCode == "") {
this.showMessage("请选择计划单号") this.showMessage("请扫描产品码")
return return
} }
@ -127,13 +128,14 @@
mask: true mask: true
}) })
var param = { var param = {
scanCode: this.scanCode, ProductCode: this.scanCheckCode,
id: this.$store.state.user.id, id: this.$store.state.user.id,
createTime: getCurrDateTime(), CreateDate: getCurrDateTime(),
CreateUser: this.$store.state.user.name
} }
console.log("提交", JSON.stringify(param)) console.log("提交", JSON.stringify(param))
foamInputSubmit(param).then(res => { scanCodeSubmit(param).then(res => {
uni.hideLoading() uni.hideLoading()
this.showMessage("提交成功") this.showMessage("提交成功")
this.resetData() this.resetData()
@ -149,12 +151,19 @@
}, },
resetData() { resetData() {
this.scanCode = ""; this.scanCode = "";
this.scanCheckCode=""
}, },
clearCode() { clearCode() {
this.scanCode = ""; this.scanCode = "";
this.scanCheckCode=""
}, },
onConfirm(data) { onConfirm(data) {
console.log(data) if(!data){
this.showMessage("扫描数据不能为空")
return;
}
this.scanCode = data;
this.scanCheckCode=data
}, },
openScanPopup() { openScanPopup() {

5
src/static/config.js

@ -2,8 +2,11 @@ let request_url = "http://123.56.115.74:8088/api"
// let request_url = "http://192.168.0.113:12080/admin-api" // let request_url = "http://192.168.0.113:12080/admin-api"
let isDevelopment = true let isDevelopment = true
//10秒
let pageTimeOut =30
export default { export default {
request_url, request_url,
isDevelopment isDevelopment,
pageTimeOut
} }

8
src/store/modules/user.js

@ -65,10 +65,10 @@ const user = {
"PDA0000003", "PDA0000003",
"PDA0000004", "PDA0000004",
"PDA0000005", "PDA0000005",
"SPDA0000001", "SPDA000001",
"SPDA0000002", "SPDA000002",
"SPDA0000003", "SPDA000003",
"SPDA0000004" "SPDA000004"
] ]
commit('SET_ID',res.Result.LoginUserID) commit('SET_ID',res.Result.LoginUserID)
commit('SET_NAME',res.Result.UserName) commit('SET_NAME',res.Result.UserName)

Loading…
Cancel
Save