Commit dc322a14 authored by 李苏's avatar 李苏 💬

徐工道路app初始化

parent 0409e501
Pipeline #181 failed with stages
/package-lock.json
node_modules/
.project unpackage/
.DS_Store
unpackage/
uni_modules
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/xgdlapp.iml" filepath="$PROJECT_DIR$/.idea/xgdlapp.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<script>
import Vue from 'vue'
import appUpdate from 'common/util/appUpdate.js'
import api from 'api/api.js'
export default {
onLaunch: function() {
// appUpdate()
uni.getSystemInfo({
success: function(e) {
// #ifdef APP-PLUS
// 检测升级
appUpdate()
// #endif
// #ifndef MP
Vue.prototype.StatusBar = e.statusBarHeight;
if (e.platform == 'android') {
Vue.prototype.CustomBar = e.statusBarHeight + 50;
} else {
Vue.prototype.CustomBar = e.statusBarHeight + 45;
};
// #endif
// #ifdef MP-WEIXIN
Vue.prototype.StatusBar = e.statusBarHeight;
let custom = wx.getMenuButtonBoundingClientRect();
Vue.prototype.Custom = custom;
Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
// #endif
// #ifdef MP-ALIPAY
Vue.prototype.StatusBar = e.statusBarHeight;
Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
// #endif
// #ifdef APP-PLUS
//Vue.prototype.$api.listenTranMsg()
// var info = plus.push.getClientInfo();
// /* 5+ push 消息推送 ps:使用:H5+的方式监听,实现推送*/
// plus.push.addEventListener("click", function(msg) {
// console.log("click:" + JSON.stringify(msg));
// console.log(msg.payload);
// console.log(JSON.stringify(msg));
// //这里可以写跳转业务代码
// }, false);
// // 监听在线消息事件
// plus.push.addEventListener("receive", function(msg) {
// // plus.ui.alert(2);
// //这里可以写跳转业务代码
// console.log("recevice:" + JSON.stringify(msg))
// }, false);
// #endif
//Vue.prototype.$api.initLogin()
}
})
Vue.prototype.ColorList = [{
title: '嫣红',
name: 'red',
color: '#e54d42'
},
{
title: '桔橙',
name: 'orange',
color: '#f37b1d'
},
{
title: '明黄',
name: 'yellow',
color: '#fbbd08'
},
{
title: '橄榄',
name: 'olive',
color: '#8dc63f'
},
{
title: '森绿',
name: 'green',
color: '#39b54a'
},
{
title: '天青',
name: 'cyan',
color: '#1cbbb4'
},
{
title: '海蓝',
name: 'blue',
color: '#0081ff'
},
{
title: '姹紫',
name: 'purple',
color: '#6739b6'
},
{
title: '木槿',
name: 'mauve',
color: '#9c26b0'
},
{
title: '桃粉',
name: 'pink',
color: '#e03997'
},
{
title: '棕褐',
name: 'brown',
color: '#a5673f'
},
{
title: '玄灰',
name: 'grey',
color: '#8799a3'
},
{
title: '草灰',
name: 'gray',
color: '#aaaaaa'
},
{
title: '墨黑',
name: 'black',
color: '#333333'
},
{
title: '雅白',
name: 'white',
color: '#ffffff'
},
]
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style>
@import "plugin/colorui/main.css";
@import "plugin/colorui/icon.css";
@import "plugin/colorui/animation.css";
.nav-list {
display: flex;
flex-wrap: wrap;
padding: 0px 40upx 0px;
justify-content: space-between;
}
.nav-li {
padding: 30upx;
border-radius: 12upx;
width: 45%;
margin: 0 2.5% 40upx;
background-image: url(https://cdn.nlark.com/yuque/0/2019/png/280374/1552996358352-assets/web-upload/cc3b1807-c684-4b83-8f80-80e5b8a6b975.png);
background-size: cover;
background-position: center;
position: relative;
z-index: 1;
}
.nav-li::after {
content: "";
position: absolute;
z-index: -1;
background-color: inherit;
width: 100%;
height: 100%;
left: 0;
bottom: -10%;
border-radius: 10upx;
opacity: 0.2;
transform: scale(0.9, 0.9);
}
.nav-li.cur {
color: #fff;
background: rgb(94, 185, 94);
box-shadow: 4upx 4upx 6upx rgba(94, 185, 94, 0.4);
}
.nav-title {
font-size: 32upx;
font-weight: 300;
}
.nav-title::first-letter {
font-size: 40upx;
margin-right: 4upx;
}
.nav-name {
font-size: 28upx;
text-transform: Capitalize;
margin-top: 20upx;
position: relative;
}
.nav-name::before {
content: "";
position: absolute;
display: block;
width: 40upx;
height: 6upx;
background: #fff;
bottom: 0;
right: 0;
opacity: 0.5;
}
.nav-name::after {
content: "";
position: absolute;
display: block;
width: 100upx;
height: 1px;
background: #fff;
bottom: 0;
right: 40upx;
opacity: 0.3;
}
.nav-name::first-letter {
font-weight: bold;
font-size: 36upx;
margin-right: 1px;
}
.nav-li text {
position: absolute;
right: 30upx;
top: 30upx;
font-size: 52upx;
width: 60upx;
height: 60upx;
text-align: center;
line-height: 60upx;
}
.text-light {
font-weight: 300;
}
@keyframes show {
0% {
transform: translateY(-50px);
}
60% {
transform: translateY(40upx);
}
100% {
transform: translateY(0px);
}
}
@-webkit-keyframes show {
0% {
transform: translateY(-50px);
}
60% {
transform: translateY(40upx);
}
100% {
transform: translateY(0px);
}
}
</style>
import { http } from '@/common/service/service.js'
import configService from '@/common/service/config.service.js';
const apiService = {
/**
* 登录
*/
login(params) {
return http.post('/login',params)
},
/**
* 手机号码登录
*/
phoneNoLogin(params) {
return http.post('/sys/phoneLogin',params);
},
/**
* 退出
*/
logout(params) {
return http.post('/sys/logout',params);
},
/*数据请求 */
postData(url,params){
return http.post(url,params);
},
/**
* 获取文件访问路径
* @param avatar
* @param subStr
* @returns {*}
*/
getFileAccessHttpUrl(avatar,subStr){
if(!subStr) subStr = 'http'
if(avatar && avatar.startsWith(subStr)){
return avatar;
}else{
return configService.staticDomainURL + "/" + avatar;
}
}
};
export default apiService;
This diff is collapsed.
'use strict'
import isAbsoluteURL from '../helpers/isAbsoluteURL'
import combineURLs from '../helpers/combineURLs'
/**
* Creates a new URL by combining the baseURL with the requestedURL,
* only when the requestedURL is not already an absolute URL.
* If the requestURL is absolute, this function returns the requestedURL untouched.
*
* @param {string} baseURL The base URL
* @param {string} requestedURL Absolute or relative URL to combine
* @returns {string} The combined full path
*/
export default function buildFullPath(baseURL, requestedURL) {
if (baseURL && !isAbsoluteURL(requestedURL)) {
return combineURLs(baseURL, requestedURL)
}
return requestedURL
}
'use strict'
import * as utils from './../utils'
function encode(val) {
return encodeURIComponent(val).
replace(/%40/gi, '@').
replace(/%3A/gi, ':').
replace(/%24/g, '$').
replace(/%2C/gi, ',').
replace(/%20/g, '+').
replace(/%5B/gi, '[').
replace(/%5D/gi, ']')
}
/**
* Build a URL by appending params to the end
*
* @param {string} url The base of the url (e.g., http://www.google.com)
* @param {object} [params] The params to be appended
* @returns {string} The formatted url
*/
export default function buildURL(url, params) {
/*eslint no-param-reassign:0*/
if (!params) {
return url
}
var serializedParams
if (utils.isURLSearchParams(params)) {
serializedParams = params.toString()
} else {
var parts = []
utils.forEach(params, function serialize(val, key) {
if (val === null || typeof val === 'undefined') {
return
}
if (utils.isArray(val)) {
key = key + '[]'
} else {
val = [val]
}
utils.forEach(val, function parseValue(v) {
if (utils.isDate(v)) {
v = v.toISOString()
} else if (utils.isObject(v)) {
v = JSON.stringify(v)
}
parts.push(encode(key) + '=' + encode(v))
})
})
serializedParams = parts.join('&')
}
if (serializedParams) {
var hashmarkIndex = url.indexOf('#')
if (hashmarkIndex !== -1) {
url = url.slice(0, hashmarkIndex)
}
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams
}
return url
}
'use strict'
/**
* Creates a new URL by combining the specified URLs
*
* @param {string} baseURL The base URL
* @param {string} relativeURL The relative URL
* @returns {string} The combined URL
*/
export default function combineURLs(baseURL, relativeURL) {
return relativeURL
? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
: baseURL
}
'use strict'
/**
* Determines whether the specified URL is absolute
*
* @param {string} url The URL to test
* @returns {boolean} True if the specified URL is absolute, otherwise false
*/
export default function isAbsoluteURL(url) {
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
// by any combination of letters, digits, plus, period, or hyphen.
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url)
}
import Request from './core/Request'
export default Request
'use strict'
// utils is a library of generic helper functions non-specific to axios
var toString = Object.prototype.toString
/**
* Determine if a value is an Array
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an Array, otherwise false
*/
export function isArray (val) {
return toString.call(val) === '[object Array]'
}
/**
* Determine if a value is an Object
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an Object, otherwise false
*/
export function isObject (val) {
return val !== null && typeof val === 'object'
}
/**
* Determine if a value is a Date
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Date, otherwise false
*/
export function isDate (val) {
return toString.call(val) === '[object Date]'
}
/**
* Determine if a value is a URLSearchParams object
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
*/
export function isURLSearchParams (val) {
return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams
}
/**
* Iterate over an Array or an Object invoking a function for each item.
*
* If `obj` is an Array callback will be called passing
* the value, index, and complete array for each item.
*
* If 'obj' is an Object callback will be called passing
* the value, key, and complete object for each property.
*
* @param {Object|Array} obj The object to iterate
* @param {Function} fn The callback to invoke for each item
*/
export function forEach (obj, fn) {
// Don't bother if no value provided
if (obj === null || typeof obj === 'undefined') {
return
}
// Force an array if not already something iterable
if (typeof obj !== 'object') {
/*eslint no-param-reassign:0*/
obj = [obj]
}
if (isArray(obj)) {
// Iterate over array values
for (var i = 0, l = obj.length; i < l; i++) {
fn.call(null, obj[i], i, obj)
}
} else {
// Iterate over object keys
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
fn.call(null, obj[key], key, obj)
}
}
}
}
/**
* 是否为boolean 值
* @param val
* @returns {boolean}
*/
export function isBoolean(val) {
return typeof val === 'boolean'
}
import modules from './modules'
import Vue from 'vue'
import Router from '@/plugin/uni-simple-router/index.js'
import {ACCESS_TOKEN} from '@/common/util/constants.js'
Vue.use(Router)
//初始化
const router = new Router({
encodeURI:true,
routes: [...modules]//路由表
});
const whiteList = ['/pages/login/login','/pages/login/fwqsz']
//全局路由前置守卫
router.beforeEach((to, from, next) => {
let token=uni.getStorageSync(ACCESS_TOKEN);
if(token){
next()
}else{
if (whiteList.indexOf(to.path) !== -1) {
next()
}else{
next({ path: '/pages/login/login'})
}
next()
}
})
// 全局路由后置守卫
router.afterEach((to, from) => {
console.log("afterEach");
})
export default router;
\ No newline at end of file
const files = require.context('.', false, /\.js$/)
const modules = []
files.keys().forEach(key => {
if (key === './index.js') return
const item = files(key).default
modules.push(...item)
})
export default modules
\ No newline at end of file
const routes = [
{
path: "/pages/login/login",
name: 'login',
meta: {
title: '登录',
},
},
{
path: "/pages/login/fwqsz",
name: 'fwqsz',
meta: {
title: '服务器设置',
},
},
{
//注意:path必须跟pages.json中的地址对应,最前面别忘了加'/'哦
path: '/pages/homepage/homepage',
name: 'homepage',
meta: {
title: '主页',
},
},
{
//注意:path必须跟pages.json中的地址对应,最前面别忘了加'/'哦
path: '/pages/index/index',
name: 'index',
meta: {
title: '首页',
},
},
{
path: '/pages/user/people',
name: 'people',
meta: {
title: '个人中心',
},
},
{
path: '/pages/user/userdetail',
name: 'userdetail',
meta: {
title: '个人详情',
},
},
{
path: '/pages/user/useredit',
name: 'useredit',
meta: {
title: '个人编辑',
},
},
{
path: '/pages/common/exit',
name: 'exit',
meta: {
title: '退出',
},
},
{
path: '/pages/common/success',
name: 'success',
meta: {
title: 'success',
},
},
{
path: '/pages/xzck/xzck',
name: 'xzck',
meta: {
title: '选择仓库',
},
},
/* 徐工道路入库 */
{
path: '/pages/dl_putin_storage/index',
name: 'putin_storage',
meta: {
title: '入库登记',
},
},
{
path: '/pages/dl_putin_storage/putin_register',
name: 'putin_register',
meta: {
title: '登记信息',
},
},
/* 出库 */
{
path: '/pages/dl_putout_storage/index',
name: 'putout_storage',
meta: {
title: '出库登记',
},
},
{
path: '/pages/dl_putout_storage/putin_register',
name: 'putout_register',
meta: {
title: '登记信息',
},
},
/* 工位叫料 */
{
path: '/pages/dl_cmaterial/index',
name: 'cmaterial',
meta: {
title: '工位叫料',
},
},
{
path: '/pages/dl_cmaterial/xzwl',
name: 'xzwl',
meta: {
title: '选择物料',
},
},
/* 调整 */
{
path: '/pages/dl_tray_adjust/index',
name: 'trayAdjust',
meta: {
title: '托盘调整',
},
},
{
path: '/pages/dl_tray_clear/index',
name: 'trayClear',
meta: {
title: '托盘清空',
},
},
]
export default routes
\ No newline at end of file
let BASE_URL = ''
if (process.env.NODE_ENV == 'development') {
BASE_URL = 'http://192.168.30.57:9080' // 开发环境
} else {
BASE_URL = 'http://192.168.30.57:9080'// 生产环境
}
let staticDomainURL = BASE_URL+ '/sys/common/static';
const configService = {
apiUrl: BASE_URL,
staticDomainURL: staticDomainURL
};
export default configService
\ No newline at end of file
import Request from '@/common/luch-request/index.js'
import {ACCESS_TOKEN} from '@/common/util/constants.js'
import configService from './config.service.js'
import tip from '@/common/util/tip.js';
import store from '@/store/index.js';
let apiUrl = configService.apiUrl;
const getTokenStorage = () => {
let token = ''
try{
token = uni.getStorageSync(ACCESS_TOKEN)
}catch(e){
//TODO handle the exception
console.log("getTokenStorage",token)
}
return token
}
const http = new Request()
http.setConfig((config) => { /* 设置全局配置 */
config.baseUrl = apiUrl /* 根域名不同 */
config.header = {
...config.header
}
return config
})
/**
* 自定义验证器,如果返回true 则进入响应拦截器的响应成功函数(resolve),否则进入响应拦截器的响应错误函数(reject)
* @param { Number } statusCode - 请求响应体statusCode(只读)
* @return { Boolean } 如果为true,则 resolve, 否则 reject
*/
// 有默认,非必写
http.validateStatus = (statusCode) => {
return statusCode === 200
}
http.interceptor.request((config, cancel) => { /* 请求之前拦截器 */
// tip.alert(config.baseUrl)
uni.getStorageInfo({
success: function (res) {
if(uni.getStorageSync('storage_key')){
config.baseUrl=uni.getStorageSync('storage_key');
}
}
})
config.header = {
...config.header,
'X-Access-Token':getTokenStorage()
}
/*
if (!token) { // 如果token不存在,调用cancel 会取消本次请求,但是该函数的catch() 仍会执行
cancel('token 不存在') // 接收一个参数,会传给catch((err) => {}) err.errMsg === 'token 不存在'
}
*/
return config
})
// 必须使用异步函数,注意
http.interceptor.response(async (response) => { /* 请求之后拦截器 */
// if (response.data.code !== 200) { // 服务端返回的状态码不等于200,则reject()
// return Promise.reject(response)
// }
return response
}, (response) => {
// 请求错误做点什么
tip.alert("网络请求异常,请检查网络")
// this.$tip.alert("网络请求异常,请检查网络");
console.log("请求错误做点什么",response);
if (response) {
let data = response.data
const token = uni.getStorageSync(ACCESS_TOKEN)
console.log("------异常响应------",token)
console.log("------异常响应------",data.status)
switch (data.status) {
case 403:
tip.error('拒绝访问');
break
case 500:
if(!token || data.message=="Token失效,请重新登录"){
let timeout=setTimeout(tip.alert('登录已过期'), 1000);
store.dispatch('Logout').then(() => {
clearTimeout(timeout)
window.location.reload()
})
}
break
case 404:
break
case 504:
break
case 401:
if (token) {
/* store.dispatch('Logout').then(() => {
setTimeout(() => {
window.location.reload()
}, 1500)
}) */
}
break
default:
tip.error({
duration: 0,
forbidClick: true,
message: data.message
});
break
}
}
return response
})
export {
http
}
let cacheMap = new Map()
let timeoutDefault = 1200
function isTimeout (name) {
const data = cacheMap.get(name)
if (!data) return true
if (data.timeout === 0) return false
const currentTime = Date.now()
const overTime = (currentTime - data.createTime) / 1000
if (overTime > data.timeout) {
cacheMap.delete(name)
if (name.startsWith('_')) {
try {
uni.removeStorageSync(name)
} catch (e) {
console.log(e)
}
}
return true
}
return false
}
class CacheCell {
constructor (data, timeout) {
this.data = data
this.timeout = timeout
this.createTime = Date.now()
}
}
class MinCache {
constructor (timeout) {
try {
const res = uni.getStorageInfoSync()
res.keys.forEach(name => {
try {
const value = uni.getStorageSync(name)
cacheMap.set(name, value)
} catch (e) {
console.log(e)
}
})
} catch (e) {
console.log(e)
}
timeoutDefault = timeout
}
set (name, data, timeout = timeoutDefault) {
const cachecell = new CacheCell(data, timeout)
let cache = null
if (name.startsWith('_')) {
try {
uni.setStorageSync(name, cachecell)
cache = cacheMap.set(name, cachecell)
} catch (e) {
console.log(e)
}
} else {
cache = cacheMap.set(name, cachecell)
}
return cache
}
get (name) {
return isTimeout(name) ? null : cacheMap.get(name).data
}
delete (name) {
let value = false
if (name.startsWith('_')) {
try {
uni.removeStorageSync(name)
value = cacheMap.delete(name)
} catch (e) {
console.log(e)
}
} else {
value = cacheMap.delete(name)
}
return value
}
has (name) {
return !isTimeout(name)
}
clear () {
let value = false
try {
uni.clearStorageSync()
cacheMap.clear()
value = true
} catch (e) {
console.log(e)
}
return value
}
}
MinCache.install = function (Vue, {timeout = 1200} = {}) {
Vue.prototype.$cache = new MinCache(timeout)
}
export default MinCache
//APP更新
import api from 'api/api.js'
export default function appUpdate() {
/* let url="http://119.3.92.249:17007/app/download/datacenter.apk";
plus.runtime.openURL(url, function(ress) {
console.log(ress);
}); */
api.postData('/getAppVersion',{
/* version: plus.runtime.version,
imei: plus.device.imei, */
apptype:"0",
// appid: plus.runtime.appid,
appid:"__UNI__5BC4E2F"
}).then((res) => {
if(res){
plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
let client_version = wgtinfo.version;
var flag_update_v =Number(client_version.split(".")[0]);
var flag_update_v2=Number(res.data.version);
console.log(flag_update_v)
console.log("getAppVersion")
console.log(res)
console.log(flag_update_v2)
var flag_hot =false;
if (flag_update_v<flag_update_v2) {
// 提醒用户更新
uni.showModal({
title: '更新提示',
content: "请进行版本更新,当前版本-"+flag_update_v+",更新版本-"+flag_update_v2,
success: (showResult) => {
if (showResult.confirm) {
plus.nativeUI.toast("正在准备环境,请稍后! ");
uni.showModal({
content:res.data.url
})
plus.runtime.openURL(res.data.url, function(ress) {
console.log(ress);
});
/* var dtask = plus.downloader.createDownload(res.data.url, {
method: 'GET',
filename: '_doc/update/'
}, function(d, status) {
if (status == 200) {
var path = d.filename; //下载apk
plus.runtime.install(path); // 自动安装apk文件
} else {
plus.nativeUI.alert('版本更新失败:' + status);
}
}); */
dtask.start();
}
}
})
} else if (flag_hot) {
uni.downloadFile({
url: res.data.url,
success: (downloadResult) => {
console.log(downloadResult.tempFilePath)
if (downloadResult.statusCode === 200) {
plus.nativeUI.toast(`正在热更新!${res.data.versionCode}`);
plus.runtime.install(downloadResult.tempFilePath, {
force: false
}, function() {
plus.nativeUI.toast("热更新成功");
plus.runtime.restart();
}, function(e) {
console.log(e)
plus.nativeUI.toast(`热更新失败:${e.message}`);
});
}
}
});
}
});
}
}).catch((err) => {
}).finally(()=>{
})
}
export const ACCESS_TOKEN = 'Access-Token'
export const USER_NAME = 'login_username'
export const USER_INFO = 'login_user_info'
const STORAGE_OPTIONS = {
namespace: 'pro__', // key prefix
name: 'ls', // name variable Vue.[ls] or this.[$ls],
storage: 'local', // storage name session, local, memory
}
export default STORAGE_OPTIONS;
// 对Date的扩展,将 Date 转化为指定格式的String
// 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
// 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
// (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
// (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18
Date.prototype.Format = function (fmt) {
var o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
"S": this.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt))
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}
export function formatTimeToStr(times, pattern) {
var d = new Date(times).Format("yyyy-MM-dd hh:mm:ss");
if (pattern) {
d = new Date(times).Format(pattern);
}
return d.toLocaleString();
}
\ No newline at end of file
This diff is collapsed.
import Vue from 'vue'
var eventBus = new Vue({});
export default eventBus;
\ No newline at end of file
This diff is collapsed.
/**
* 提示与加载工具类
*/
export default class Tips {
constructor() {
this.isLoading = false;
}
/**
* 弹出提示框
*/
static success(title, duration = 1000) {
setTimeout(() => {
uni.showToast({
title: title,
icon: "none",
mask: true,
duration: duration
});
}, 300);
if (duration > 0) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve();
}, duration);
});
}
}
/**
* 弹出确认窗口
*/
static confirm(text,showCancel, payload = {}, title = "提示") {
return new Promise((resolve, reject) => {
uni.showModal({
title: title,
content: text,
showCancel: showCancel,
success: res => {
if (res.confirm) {
resolve(payload);
} else if (res.cancel) {
reject(payload);
}
},
fail: res => {
reject(payload);
}
});
}).catch((e) => {});
}
static toast(title, onHide, icon = "none") {
setTimeout(() => {
uni.showToast({
title: title,
icon: icon,
mask: true,
duration:1000
});
}, 300);
// 隐藏结束回调
if (onHide) {
setTimeout(() => {
onHide();
}, 500);
}
}
/**
* 警告框
*/
static alert(title) {
uni.showToast({
title: title,
icon:"none",
mask: true,
duration: 1500
});
}
/**
* 错误框
*/
static error(title, onHide) {
uni.showToast({
title: title,
// image: "../../static/error.png",
mask: true,
duration: 1500
});
// 隐藏结束回调
if (onHide) {
setTimeout(() => {
onHide();
}, 500);
}
}
/**
* 弹出加载提示
*/
static loading(title = "加载中") {
if (Tips.isLoading) {
return;
}
Tips.isLoading = true;
uni.showLoading({
title: title,
mask: true
});
}
/**
* 加载完毕
*/
static loaded() {
if (Tips.isLoading) {
Tips.isLoading = false;
uni.hideLoading();
}
}
}
/**
* 静态变量,是否加载中
*/
Tips.isLoading = false;
import Vconsole from 'vconsole'
const vConsole = new Vconsole()
export default vConsole
\ No newline at end of file
/**
* 常用服务
* useful server
*/
export const us = {
data:[
]
}
/**
* other server 其他服务
*/
export const os = {
data:[
{
title:"检验送检",
icon:"/static/icon/sj.png",
useCount:1000,
page:"jyline"
},
{
title:"送空车",
icon:"/static/icon/car.png",
useCount:1000,
page:"carline"
},
{
title:"调整",
icon:"/static/icon/adjust.png",
useCount:1000,
page:"adjust"
},
]
}
\ No newline at end of file
This diff is collapsed.
import Vue from 'vue'
import App from './App'
import store from './store'
import MinCache from'./common/util/MinCache.js'
import tip from'./common/util/tip.js'
import configService from'./common/service/config.service.js'
import router from './common/router'
import {RouterMount} from './plugin/uni-simple-router/index.js'
// 注册缓存器
Vue.use(MinCache,{timeout: 6})
// store
Vue.prototype.$store=store;
// tip
Vue.prototype.$tip=tip;
// config
Vue.prototype.$config=configService;
// 全局去除空格
// 正则表达式去除字符串空格
Vue.prototype.$trim=function Trim(str)
{
return str.replace(/\s/g,"")
}
// request请求
import { http } from '@/common/service/service.js'
Vue.prototype.$http = http
import interfacepage from './pages/index/index.vue'
Vue.component('interfacepage',interfacepage)
import people from './pages/user/people.vue'
Vue.component('people',people)
import cuCustom from './plugin/colorui/components/cu-custom.vue'
Vue.component('cu-custom',cuCustom)
// import VConsole from '@/common/util/vconsole.min.js'
// var vConsole = new VConsole();
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
store,
MinCache,
...App
})
//v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
// #ifdef H5
RouterMount(app,'#app');
// #endif
// #ifndef H5
app.$mount(); //为了兼容小程序及app端必须这样写才有效果
// #endif
{
"name" : "wcs",
"appid" : "__UNI__B0C55F0",
"description" : "徐工道路系统功能",
"versionName" : "1.0.0",
"versionCode" : 100,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* 模块配置 */
"modules" : {},
/* 应用发布信息 */
"distribute" : {
/* android打包配置 */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios打包配置 */
"ios" : {},
/* SDK配置 */
"sdkConfigs" : {
"ad" : {}
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
}
}
}
}
},
/* 快应用特有相关 */
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"h5" : {
"template" : "template.h5.html",
"devServer" : {
"https" : false
},
"title" : "xgapp",
"router" : {
"base" : "./"
}
},
"vueVersion" : "2"
}
{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path" : "pages/login/login",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path": "pages/homepage/homepage",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": ""
}
}
,
{
"path": "pages/xzck/xzck",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "pages/login/fwqsz",
"style": {
"navigationBarTitleText": ""
}
},
/* 道路入库 */
{
"path" : "pages/dl_putin_storage/index",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/dl_putin_storage/putin_register",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
/* 道路出库 */
{
"path" : "pages/dl_putout_storage/index",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/dl_putout_storage/putin_register",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
/* 工位叫料 */
{
"path" : "pages/dl_cmaterial/index",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path" : "pages/dl_cmaterial/xzwl",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
/* 调整 */
{
"path" : "pages/dl_tray_adjust/index",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},
{
"path" : "pages/dl_tray_clear/index",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarBackgroundColor": "#0081ff",
"navigationBarTitleText": "",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
}
This diff is collapsed.
<template>
<view>
<view class="cu-bar bg-white search fixed" :style="[{top:70 + 'px'}]">
<view class="search-form round">
<text class="cuIcon-search"></text>
<input type="text" placeholder="输入搜索的信息" confirm-type="search" @confirm="searchFood" v-model="serachName"/>
</view>
<view class="action">
<button class="cu-btn bg-gradual-green shadow-blur round" @tap="searchFood">搜索</button>
</view>
</view>
<view class="bg-white">
<cu-custom bgColor="bg-gradual-blue" :isBack="true"><block slot="content">选择物料</block></cu-custom>
</view>
<view class="cu-bar bg-white solid-bottom">
<view class="action">
<text class="cuIcon-title text-orange "></text> 物料列表
</view>
</view>
<view class="bg-white " v-for="(item,index) in wlinfor" :key="index" @tap="nextTo(item)">
<view class="flex flex-wrap margin-bottom-xs padding bg-grey white radio">
<view class="wid50 margin-top-xs margin-bottom-xs radius">物料:<span>{{item.wlcode}} </span></view>
<view class="wid50 margin-top-xs margin-bottom-xs radius">名称:<span>{{item.wlname}}</span></view>
<view class="wid50 margin-top-xs margin-bottom-xs radius">规格:<span>{{item.wlgg}}</span></view>
<view class="wid50 margin-top-xs margin-bottom-xs radius">托盘号:<span>{{item.tpcode}}</span></view>
<view class="wid50 margin-top-xs margin-bottom-xs radius">批号:<span>{{item.wlph}}</span></view>
<view class="wid50 margin-top-xs margin-bottom-xs radius">剩余数量:<span>{{item.ztsl}}</span></view>
</view>
</view>
</view>
</template>
<script>
import api from '@/api/api.js';
import eventBus from '@/common/util/eventBus.js'
export default {
data() {
return {
serachName:"",
status:"",
gwjlinfor:{},
wlinfor:[
]
}
},
onPullDownRefresh(){
setTimeout(()=>{
uni.stopPullDownRefresh()
},2500)
},
methods:{
apiGetwl(){
let _self=this;
api.postData("xgwms/tpmx/queryWlxx",{
"ckid":_self.$ckid,
"condition":_self.serachName
}).then((resp) => {
if(resp.data.success){
_self.wlinfor=resp.data.data.records
}else{
this.$tip.alert(resp.data.message||"请求失败");
}
}).catch((err) => {
let msg = err.data.message || "请求出现错误,请稍后再试"
this.$tip.alert(msg);
}).finally(()=>{
})
},
searchFood(){
this.apiGetwl()
},
nextTo(item){
let info={
gwjlinfor:this.gwjlinfor,
xzwl:"xzwl",
wlinfor:item
}
eventBus.$emit('addressInfo',info);
this.$router.go(-1)
// this.$Router.replace({ path:'/pages/gwjl/gwjl', query:{
// gwjlinfor:this.gwjlinfor,
// xzwl:"xzwl",
// wlinfor:item
// }
// })
},
gotoBackPage(){
this.$router.go(-1)
}
},
onLoad(e) {
if(!e.query){
return 0
}
let einfor =JSON.parse(e.query)
this.gwjlinfor=einfor.gwjlinfor
this.apiGetwl()
}
}
</script>
<style scoped>
.wid50{
width: 50%;
}
</style>
<template>
<view class="bg-white" style="height: 100vh;">
<cu-custom bgColor="bg-gradual-blue" :isBack="true" :reWrite="'homepage'">
<block slot="backText">返回</block>
<block slot="content">托盘信息绑定</block>
</cu-custom>
<view class="padding-xs bg-white">
<view class="cu-form-group ">
<view class="title">配盘单码</view>
<input focus="true" placeholder="请扫描配盘单码"></input>
</view>
</view>
<view class="padding-xs bg-white">
<view class="cu-form-group ">
<view class="title">扫托盘码</view>
<input @confirm="searchTpm" placeholder="请扫描配盘单码"></input>
</view>
</view>
<view class="padding flex justify-around bg-white ">
<button @tap="watchInfo" class="cu-btn bg-gradual-green xs " style="width: 50%;margin-top: 40vh;">查看入库登记信息</button>
</view>
</view>
</view>
</view>
</template>
<script>
import api from '@/api/api.js';
export default {
data() {
return {
}
},
filters: {
formatTime: function(time) {
if (time != null && time != "") {
var date = new Date(time);
return date.Format("MM-dd hh:mm")
} else {
return "";
}
}
},
methods: {
searchTpm(){
uni.showModal({
title: '提示',
content: '配盘单码:PPM20220426001\n配盘单码:PPM20220426001',
cancelText: "继续扫描", // 取消按钮的文字
confirmText: "开始入库", // 确认按钮的文字
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
watchInfo(){
this.$router.push({name:"putin_register"})
},
// 确认按钮
hideModal(e) {
this.modalName = null
},
// 生成任务
// 扫描托盘号
// 选择物料
// 任务列表
},
onLoad(e) {
}
}
</script>
<style scoped>
input{
border-bottom: #EEEEEE 1px solid;
}
.disable {
background-color: #EEEEEE;
}
.b-right {
position: relative;
}
.wid50 {
width: 50%;
}
</style>
<template>
<view class="bg-white" style="height: 100vh;">
<cu-custom bgColor="bg-gradual-blue" :isBack="true" :reWrite="'homepage'">
<block slot="backText">返回</block>
<block slot="content">入库登记信息</block>
</cu-custom>
<view class="cu-modal" :class="modalName=='Modal'?'show':''">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">库位信息</view>
<view class="action" @tap="hideModal">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-xl">
<!-- 库位位置 -->
</view>
</view>
</view>
<view class="padding-xs bg-white" style="height: 60vh;overflow: auto;">
<!-- title -->
<view class="tbtit">
<view class="tbtit_son">托盘码</view>
<view class="tbtit_son">库位</view>
<view style="flex: 1;">状态</view>
</view>
<view class="tbtit_row " :class="item.selected?'selected':''" v-for="(item,index) in rkdjlist" :key="index" @tap="selectTb(item,index)">
<view class="tbtit_row_son1">{{item.tpm}}</view>
<view style="flex: 1">{{item.kw}}</view>
<view class="tbtit_row_son3">{{item.zt}}</view>
</view>
</view>
<view class="padding flex justify-around bg-white ">
<view class="padding-xs bg-white" style="">
<view class="cu-form-group ">
<view class="title">库位码</view>
<input focus="true" @confirm="searchKwm()" placeholder="扫描库位码查询"></input>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import api from '@/api/api.js';
export default {
data() {
return {
modalName:"",
rkdjlist:[{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
},
{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
},
{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
},
{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
},
{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
}]
}
},
filters: {
formatTime: function(time) {
if (time != null && time != "") {
var date = new Date(time);
return date.Format("MM-dd hh:mm")
} else {
return "";
}
}
},
methods: {
searchKwm(){
/* 三种状态,1,对应库位入库,2,不对应库位,3,非界面的库位 */
uni.showModal({
title: '提示',
content: '确认入库',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
selectTb(item,index){
this.modalName="Modal"
if(this.rkdjlist[index].selected==true){
this.rkdjlist[index].selected=false
/* 清除选中值 */
}else{
this.rkdjlist[index].selected=true
/* 存储选中值 */
}
/* 清除其他选中值 */
this.rkdjlist.forEach((e,eindex)=>{
if(index!=eindex){
this.rkdjlist[eindex].selected=false
}
})
console.log(this.rkdjlist)
},
watchInfo(){
this.$router.push({name:"putin_register"})
},
// 确认按钮
hideModal(e) {
this.modalName = null
},
// 生成任务
// 扫描托盘号
// 选择物料
// 任务列表
},
onLoad(e) {
}
}
</script>
<style scoped>
.selected{
background-color: deepskyblue;
color: #fff;
}
.tbtit{
display: flex;border: 1px solid #EEEEEE;height: 30px;width: 100%;line-height: 30px;text-align: center;
}
.tbtit_row{
display: flex;border-bottom: 1px solid #EEEEEE;height: 30px;width: 100%;line-height: 30px;text-align: center;
}
.tbtit_son{
flex: 1;border-right: 1px solid #EEEEEE;
}
.tbtit_row_son1{
flex: 1;border-right: 1px solid #EEEEEE;border-left: #EEEEEE 1px solid;
}
.tbtit_row_son3{
flex: 1;border-right: 1px solid #EEEEEE;border-left: #EEEEEE 1px solid;
}
input{
border-bottom: #EEEEEE 1px solid;
}
.disable {
background-color: #EEEEEE;
}
.b-right {
position: relative;
}
.wid50 {
width: 50%;
}
</style>
<template>
<view class="bg-white" style="height: 100vh;">
<cu-custom bgColor="bg-gradual-blue" :isBack="true" :reWrite="'homepage'">
<block slot="backText">返回</block>
<block slot="content">出库登记信息</block>
</cu-custom>
<view class="cu-modal" :class="modalName=='Modal'?'show':''">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">库位信息</view>
<view class="action" @tap="hideModal">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-xl">
<view class="" style="height: 250px;width: 90vw;display: flex;flex-wrap:wrap">
<view style="height: 20%;width:90%;display: flex;">
<view style="flex: 1;line-height: 40px;"></view>
<view style="flex: 1;line-height: 40px;">G1</view>
<view style="flex: 1;line-height: 40px;">G2</view>
<view style="flex: 1;line-height: 40px;">G3</view>
<view style="flex: 1;line-height: 40px;">G4</view>
<view style="flex: 1;line-height: 40px;">G5</view>
<view style="flex: 1;line-height: 40px;">G6</view>
</view>
<view style="height: 20%;width:90%;display: flex;">
<view style="flex: 1;line-height: 40px;">S1</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位2</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位3</view>
<view style="flex: 1;height: 40px;"></view>
<view style="flex: 1;height: 40px;"></view>
<view style="flex: 1;height: 40px;"></view>
<view style="flex: 1;height: 40px;"></view>
</view>
<view style="height: 20%;width:90%;display: flex;">
<view style="flex: 1;line-height: 40px;">S2</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位2</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位3</view>
<view style="flex: 1;height: 40px;"></view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位5</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位6</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位7</view>
</view>
<view style="height: 20%;width:90%;display: flex;">
<view style="flex: 1;line-height: 40px;">S3</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位2</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位3</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位4</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位5</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位6</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位7</view>
</view>
<view style="height: 20%;width:90%;display: flex;">
<view style="flex: 1;line-height: 40px;">S4</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位2</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位3</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位4</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位5</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位6</view>
<view style="flex: 1;border: 1px solid #666;height: 40px;">库位7</view>
</view>
</view>
</view>
</view>
</view>
<view class="padding-xs bg-white" style="height: 45vh;overflow: auto;">
<!-- title -->
<view class="tbtit">
<view class="tbtit_son">托盘码</view>
<view class="tbtit_son">库位</view>
<view style="flex: 1;">状态</view>
</view>
<view class="tbtit_row " :class="item.selected?'selected':''" v-for="(item,index) in rkdjlist" :key="index" @tap="selectTb(item,index)">
<view class="tbtit_row_son1">{{item.tpm}}</view>
<view style="flex: 1">{{item.kw}}</view>
<view class="tbtit_row_son3">{{item.zt}}</view>
</view>
</view>
<view class="padding flex justify-around bg-white ">
<view class="padding-xs bg-white" style="">
<view class="cu-form-group ">
<view class="title">库位码</view>
<input focus="true" @confirm="searchKwm()" placeholder="扫描库位码查询"></input>
</view>
</view>
</view>
<view class=" flex justify-around bg-white ">
<view class="padding-xs bg-white" style="">
<view class="cu-form-group ">
<view class="title">取料区码</view>
<input focus="true" @confirm="searchQlqm()" placeholder="扫描取料区码查询"></input>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import api from '@/api/api.js';
export default {
data() {
return {
modalName:"",
rkdjlist:[{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
},
{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
},
{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
},
{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
},
{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
}]
}
},
filters: {
formatTime: function(time) {
if (time != null && time != "") {
var date = new Date(time);
return date.Format("MM-dd hh:mm")
} else {
return "";
}
}
},
methods: {
searchQlqm(){
/* 三种状态,1,对应库位入库,2,不对应库位,3,非界面的库位 */
uni.showModal({
title: '提示',
content: '确认入库',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
searchKwm(){
/* 三种状态,1,对应库位入库,2,不对应库位,3,非界面的库位 */
uni.showModal({
title: '提示',
content: '确认入库',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
selectTb(item,index){
this.modalName="Modal"
if(this.rkdjlist[index].selected==true){
this.rkdjlist[index].selected=false
/* 清除选中值 */
}else{
this.rkdjlist[index].selected=true
/* 存储选中值 */
}
/* 清除其他选中值 */
this.rkdjlist.forEach((e,eindex)=>{
if(index!=eindex){
this.rkdjlist[eindex].selected=false
}
})
console.log(this.rkdjlist)
},
watchInfo(){
this.$router.push({name:"putin_register"})
},
// 确认按钮
hideModal(e) {
this.modalName = null
},
// 生成任务
// 扫描托盘号
// 选择物料
// 任务列表
},
onLoad(e) {
}
}
</script>
<style scoped>
.selected{
background-color: deepskyblue;
color: #fff;
}
.tbtit{
display: flex;border: 1px solid #EEEEEE;height: 30px;width: 100%;line-height: 30px;text-align: center;
}
.tbtit_row{
display: flex;border-bottom: 1px solid #EEEEEE;height: 30px;width: 100%;line-height: 30px;text-align: center;
}
.tbtit_son{
flex: 1;border-right: 1px solid #EEEEEE;
}
.tbtit_row_son1{
flex: 1;border-right: 1px solid #EEEEEE;border-left: #EEEEEE 1px solid;
}
.tbtit_row_son3{
flex: 1;border-right: 1px solid #EEEEEE;border-left: #EEEEEE 1px solid;
}
input{
border-bottom: #EEEEEE 1px solid;
}
.disable {
background-color: #EEEEEE;
}
.b-right {
position: relative;
}
.wid50 {
width: 50%;
}
</style>
<template>
<view class="bg-white" style="height: 100vh;">
<cu-custom bgColor="bg-gradual-blue" :isBack="true" :reWrite="'homepage'">
<block slot="backText">返回</block>
<block slot="content">入库登记信息</block>
</cu-custom>
<view class="cu-modal" :class="modalName=='Modal'?'show':''">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">库位信息</view>
<view class="action" @tap="hideModal">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-xl">
<!-- 库位位置 -->
</view>
</view>
</view>
<view class="padding-xs bg-white" style="height: 60vh;overflow: auto;">
<!-- title -->
<view class="tbtit">
<view class="tbtit_son">托盘码</view>
<view class="tbtit_son">库位</view>
<view style="flex: 1;">状态</view>
</view>
<view class="tbtit_row " :class="item.selected?'selected':''" v-for="(item,index) in rkdjlist" :key="index" @tap="selectTb(item,index)">
<view class="tbtit_row_son1">{{item.tpm}}</view>
<view style="flex: 1">{{item.kw}}</view>
<view class="tbtit_row_son3">{{item.zt}}</view>
</view>
</view>
<view class="padding flex justify-around bg-white ">
<view class="padding-xs bg-white" style="">
<view class="cu-form-group ">
<view class="title">库位码</view>
<input focus="true" @confirm="searchKwm()" placeholder="扫描库位码查询"></input>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import api from '@/api/api.js';
export default {
data() {
return {
modalName:"",
rkdjlist:[{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
},
{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
},
{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
},
{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
},
{
tpm:100010,
kw:100031,
zt:'zt',
selected:false
}]
}
},
filters: {
formatTime: function(time) {
if (time != null && time != "") {
var date = new Date(time);
return date.Format("MM-dd hh:mm")
} else {
return "";
}
}
},
methods: {
searchKwm(){
/* 三种状态,1,对应库位入库,2,不对应库位,3,非界面的库位 */
uni.showModal({
title: '提示',
content: '确认入库',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
selectTb(item,index){
this.modalName="Modal"
if(this.rkdjlist[index].selected==true){
this.rkdjlist[index].selected=false
/* 清除选中值 */
}else{
this.rkdjlist[index].selected=true
/* 存储选中值 */
}
/* 清除其他选中值 */
this.rkdjlist.forEach((e,eindex)=>{
if(index!=eindex){
this.rkdjlist[eindex].selected=false
}
})
console.log(this.rkdjlist)
},
watchInfo(){
this.$router.push({name:"putin_register"})
},
// 确认按钮
hideModal(e) {
this.modalName = null
},
// 生成任务
// 扫描托盘号
// 选择物料
// 任务列表
},
onLoad(e) {
}
}
</script>
<style scoped>
.selected{
background-color: deepskyblue;
color: #fff;
}
.tbtit{
display: flex;border: 1px solid #EEEEEE;height: 30px;width: 100%;line-height: 30px;text-align: center;
}
.tbtit_row{
display: flex;border-bottom: 1px solid #EEEEEE;height: 30px;width: 100%;line-height: 30px;text-align: center;
}
.tbtit_son{
flex: 1;border-right: 1px solid #EEEEEE;
}
.tbtit_row_son1{
flex: 1;border-right: 1px solid #EEEEEE;border-left: #EEEEEE 1px solid;
}
.tbtit_row_son3{
flex: 1;border-right: 1px solid #EEEEEE;border-left: #EEEEEE 1px solid;
}
input{
border-bottom: #EEEEEE 1px solid;
}
.disable {
background-color: #EEEEEE;
}
.b-right {
position: relative;
}
.wid50 {
width: 50%;
}
</style>
<template>
<view class="bg-white">
<cu-custom bgColor="bg-gradual-blue" :isBack="true"><block slot="content">托盘调整</block>
<block slot="backText">返回</block></cu-custom>
<view class="cu-form-group" >
<view class="title ">托盘号</view>
<input v-model="tpcode" placeholder="请扫描托盘号" focus="true" @confirm="apigetinfor()" ></input>
</view>
<view class="cu-form-group disable" >
<view class="title ">已扫托盘号</view>
<input v-model="ystpcode" disabled="" focus="true" @confirm="apigetinfor()" ></input>
</view>
<view v-for="(item,index) in wlinfor" :key="index">
<view class="flex flex-wrap padding bg-grey white radio" style="position: relative;">
<button @tap="deldata(item,index)" style="position: absolute;right: 10px;top: 5px;color: red;font-size: 12px;">
<span style="" >删除</span>
</button>
<view class="basis-sm margin-top-xs margin-bottom-xs radius">物料<span>{{item.wlcode}}</span></view>
<view class="basis-lg margin-top-xs margin-bottom-xs radius">名称:<span>{{item.wlname}}</span></view>
<view class="basis-sm margin-top-xs margin-bottom-xs radius">规格:<span>{{item.wlgg}}</span></view>
<view class="basis-lg margin-top-xs margin-bottom-xs radius">数量:<span>{{item.ztsl}}</span></view>
<view class="basis-sm margin-top-xs margin-bottom-xs radius">托盘号:<span>{{item.tpcode}}</span></view>
<view class="basis-lg margin-top-xs margin-bottom-xs radius">物料批号:<span>{{item.wlph}}</span></view>
</view>
<view class="cu-form-group" >
<view class="title ">物料数量维护</view>
<uni-number-box :min="0" :max="99999" v-model="item.ztsl" ></uni-number-box>
</view>
</view>
<!-- 假数据 -->
<view class="flex flex-wrap padding bg-grey white radio" style="position: relative;">
<button @tap="deldata(item,index)" style="position: absolute;right: 10px;top: 45px;color: #fff;background-color: red;font-size: 12px;">
<span style="" >删除</span>
</button>
<view class="basis-sm margin-top-xs margin-bottom-xs radius">物料:<span>{{'样式'}}</span></view>
<view class="basis-lg margin-top-xs margin-bottom-xs radius">名称:<span>{{'样式'}}</span></view>
<view class="basis-sm margin-top-xs margin-bottom-xs radius">规格:<span>{{'样式'}}</span></view>
<view class="basis-lg margin-top-xs margin-bottom-xs radius">数量:<span>{{'样式'}}</span></view>
<view class="basis-sm margin-top-xs margin-bottom-xs radius">托盘号:<span>{{'样式'}}</span></view>
<view class="basis-lg margin-top-xs margin-bottom-xs radius">物料批号:<span>{{'样式'}}</span></view>
</view>
<view class="cu-form-group" >
<view class="title ">物料数量维护</view>
<uni-number-box :min="0" :max="99999" v-model="testys" ></uni-number-box>
</view>
<view class="padding flex align-center bg-white justify-around">
<button class="cu-btn bg-gradual-green lg wid50" @tap="isbctz(2)">调整</button>
</view>
<view class="cu-modal" :class="modalName=='DialogModal1'?'show':''">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">提示</view>
<view class="action" @tap="hideModal">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-xl bg-white">
是否删除该条信息?
</view>
<view class="cu-bar bg-white justify-end">
<view class="action">
<button class="cu-btn line-green text-green" @tap="hideModal">取消</button>
<button class="cu-btn bg-green margin-left" @tap="cdeldata()">确定</button>
</view>
</view>
</view>
</view>
<view class="cu-modal" :class="modalName=='DialogModal2'?'show':''">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">提示</view>
<view class="action" @tap="hideModal">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-xl bg-white">
是否保存并调整?
</view>
<view class="cu-bar bg-white justify-end">
<view class="action">
<button class="cu-btn line-green text-green" @tap="hideModal">取消</button>
<button class="cu-btn bg-green margin-left" @tap="apibctz()">确定</button>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import api from '@/api/api.js';
export default {
data() {
return {
testys:10,
selected:"",
ystpcode:"",
modalName:"",
tpcode:"",
wlinfor:[],
}
},
methods:{
// api保存调整
apibctz(){
this.hideModal()
api.postData("xgwms/tpmx/adjustTpByCode",{
"ckid":this.$ckid,
"code":this.tpcode,
"data":this.wlinfor
}).then((resp) => {
if(resp.data.success)
{
this.$tip.alert("调整成功");
}
else{
this.$tip.alert(res.data.message || "操作失败");
}
this.tpcode=""
this.ystpcode=""
this.wlinfor=[]
}).catch((err) => {
let msg = err.data.message || "请求出现错误,请稍后再试"
this.$tip.alert(msg);
this.tpcode=""
}).finally(()=>{
})
},
isbctz(){
if(this.ystpcode){
this.confirm(2)
}else{
this.$tip.alert("请先扫描有效托盘信息");
}
},
hideModal(){
this.modalName=""
},
// 弹框
confirm(e){
this.modalName="DialogModal"+e
},
// 删除确认
deldata(item,index){
this.selected=index
this.confirm(1)
},
// 确认删除
cdeldata(){
this.hideModal()
this.wlinfor.splice(this.selected,1)
this.selected=""
},
// 获取托盘信息
apigetinfor(){
this.tpcode=this.$trim(this.tpcode)
api.postData("xgwms/tpmx/searchTpmxsByCode",{
"ckid":this.$ckid,
"code":this.tpcode
}).then((resp) => {
if(resp.data.data.records)
{ this.ystpcode=this.tpcode
this.wlinfor=resp.data.data.records
}
else{
this.$tip.alert("该托盘无数据");
}
}).catch((err) => {
let msg = err.data.message || "请求出现错误,请稍后再试"
this.$tip.alert(msg);
this.tpcode=""
}).finally(()=>{
})
}
},
onLoad() {
}
}
</script>
<style scoped>
/deep/.uni-numbox-btns{
width: 27.69px!important;
}
.disable{
background-color: #F5F5F5
}
.wid50{
width: 50%;
}
</style>
<template>
<view class="bg-white">
<cu-custom bgColor="bg-gradual-blue" :isBack="true"><block slot="content">托盘调整</block>
<block slot="backText">返回</block></cu-custom>
<view class="cu-form-group" >
<view class="title ">托盘号</view>
<input v-model="tpcode" placeholder="请扫描托盘号" focus="true" @confirm="apigetinfor()" ></input>
</view>
<view class="cu-form-group disable" >
<view class="title ">已扫托盘号</view>
<input v-model="ystpcode" disabled="" focus="true" @confirm="apigetinfor()" ></input>
</view>
<view v-for="(item,index) in wlinfor" :key="index">
<view class="flex flex-wrap padding bg-grey white radio" style="position: relative;">
<button @tap="deldata(item,index)" style="position: absolute;right: 10px;top: 5px;color: red;font-size: 12px;">
<span style="" >删除</span>
</button>
<view class="basis-sm margin-top-xs margin-bottom-xs radius">物料<span>{{item.wlcode}}</span></view>
<view class="basis-lg margin-top-xs margin-bottom-xs radius">名称:<span>{{item.wlname}}</span></view>
<view class="basis-sm margin-top-xs margin-bottom-xs radius">规格:<span>{{item.wlgg}}</span></view>
<view class="basis-lg margin-top-xs margin-bottom-xs radius">数量:<span>{{item.ztsl}}</span></view>
<view class="basis-sm margin-top-xs margin-bottom-xs radius">托盘号:<span>{{item.tpcode}}</span></view>
<view class="basis-lg margin-top-xs margin-bottom-xs radius">物料批号:<span>{{item.wlph}}</span></view>
</view>
<!-- <view class="cu-form-group" >
<view class="title ">物料数量维护</view>
<uni-number-box v-model="item.ztsl" ></uni-number-box>
</view> -->
</view>
<!-- 假数据 -->
<view class="flex flex-wrap padding bg-grey white radio" style="position: relative;">
<button @tap="deldata(item,index)" style="position: absolute;right: 10px;top: 45px;color: #fff;background-color: red;font-size: 12px;">
<span style="" >删除</span>
</button>
<view class="basis-sm margin-top-xs margin-bottom-xs radius">物料:<span>{{'样式'}}</span></view>
<view class="basis-lg margin-top-xs margin-bottom-xs radius">名称:<span>{{'样式'}}</span></view>
<view class="basis-sm margin-top-xs margin-bottom-xs radius">规格:<span>{{'样式'}}</span></view>
<view class="basis-lg margin-top-xs margin-bottom-xs radius">数量:<span>{{'样式'}}</span></view>
<view class="basis-sm margin-top-xs margin-bottom-xs radius">托盘号:<span>{{'样式'}}</span></view>
<view class="basis-lg margin-top-xs margin-bottom-xs radius">物料批号:<span>{{'样式'}}</span></view>
</view>
<!-- <view class="cu-form-group" >
<view class="title ">物料数量维护</view>
<uni-number-box min="0" max="99999" v-model="testys" ></uni-number-box>
</view> -->
<view class="padding flex align-center bg-white justify-around">
<button class="cu-btn bg-gradual-green lg wid50" @tap="isbctz(2)">清空</button>
</view>
<view class="cu-modal" :class="modalName=='DialogModal1'?'show':''">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">提示</view>
<view class="action" @tap="hideModal">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-xl bg-white">
是否删除该条信息?
</view>
<view class="cu-bar bg-white justify-end">
<view class="action">
<button class="cu-btn line-green text-green" @tap="hideModal">取消</button>
<button class="cu-btn bg-green margin-left" @tap="cdeldata()">确定</button>
</view>
</view>
</view>
</view>
<view class="cu-modal" :class="modalName=='DialogModal2'?'show':''">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">提示</view>
<view class="action" @tap="hideModal">
<text class="cuIcon-close text-red"></text>
</view>
</view>
<view class="padding-xl bg-white">
是否保存并调整?
</view>
<view class="cu-bar bg-white justify-end">
<view class="action">
<button class="cu-btn line-green text-green" @tap="hideModal">取消</button>
<button class="cu-btn bg-green margin-left" @tap="apibctz()">确定</button>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import api from '@/api/api.js';
export default {
data() {
return {
testys:10,
selected:"",
ystpcode:"",
modalName:"",
tpcode:"",
wlinfor:[],
}
},
methods:{
// api保存调整
apibctz(){
this.hideModal()
api.postData("xgwms/tpmx/adjustTpByCode",{
"ckid":this.$ckid,
"code":this.tpcode,
"data":this.wlinfor
}).then((resp) => {
if(resp.data.success)
{
this.$tip.alert("调整成功");
}
else{
this.$tip.alert(res.data.message || "操作失败");
}
this.tpcode=""
this.ystpcode=""
this.wlinfor=[]
}).catch((err) => {
let msg = err.data.message || "请求出现错误,请稍后再试"
this.$tip.alert(msg);
this.tpcode=""
}).finally(()=>{
})
},
isbctz(){
if(this.ystpcode){
this.confirm(2)
}else{
this.$tip.alert("请先扫描有效托盘信息");
}
},
hideModal(){
this.modalName=""
},
// 弹框
confirm(e){
this.modalName="DialogModal"+e
},
// 删除确认
deldata(item,index){
this.selected=index
this.confirm(1)
},
// 确认删除
cdeldata(){
this.hideModal()
this.wlinfor.splice(this.selected,1)
this.selected=""
},
// 获取托盘信息
apigetinfor(){
this.tpcode=this.$trim(this.tpcode)
api.postData("xgwms/tpmx/searchTpmxsByCode",{
"ckid":this.$ckid,
"code":this.tpcode
}).then((resp) => {
if(resp.data.data.records)
{ this.ystpcode=this.tpcode
this.wlinfor=resp.data.data.records
}
else{
this.$tip.alert("该托盘无数据");
}
}).catch((err) => {
let msg = err.data.message || "请求出现错误,请稍后再试"
this.$tip.alert(msg);
this.tpcode=""
}).finally(()=>{
})
}
},
onLoad() {
}
}
</script>
<style scoped>
/deep/.uni-numbox-btns{
width: 27.69px!important;
}
.disable{
background-color: #F5F5F5
}
.wid50{
width: 50%;
}
</style>
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment